8282 </el-dialog >
8383</template >
8484<script setup lang="ts">
85- import {ref , watch , reactive } from ' vue'
86- import {useRouter , useRoute } from ' vue-router'
87- import type {ApplicationFormType } from ' @/api/type/application'
88- import type {FormInstance , FormRules } from ' element-plus'
85+ import { ref , watch , reactive } from ' vue'
86+ import { useRouter , useRoute } from ' vue-router'
87+ import type { ApplicationFormType } from ' @/api/type/application'
88+ import type { FormInstance , FormRules } from ' element-plus'
8989import applicationApi from ' @/api/application/application'
90- import {MsgSuccess , MsgAlert } from ' @/utils/message'
91- import {isWorkFlow } from ' @/utils/application'
92- import {baseNodes } from ' @/workflow/common/data'
93- import {t } from ' @/locales'
94-
90+ import { MsgSuccess , MsgAlert } from ' @/utils/message'
91+ import { isWorkFlow } from ' @/utils/application'
92+ import { baseNodes } from ' @/workflow/common/data'
93+ import { t } from ' @/locales'
94+ import useStore from ' @/stores'
95+ const { user } = useStore ()
9596const router = useRouter ()
9697const emit = defineEmits ([' refresh' ])
9798
@@ -227,17 +228,19 @@ const submitHandle = async (formEl: FormInstance | undefined) => {
227228 }
228229 console .log (applicationForm .value .type )
229230 applicationApi
230- .postApplication (
231- {... applicationForm .value , folder_id: currentFolder .value },
232- loading ,
233- )
231+ .postApplication ({ ... applicationForm .value , folder_id: currentFolder .value }, loading )
232+ .then ((res ) => {
233+ return user .profile ().then (() => {
234+ return res
235+ })
236+ })
234237 .then ((res ) => {
235238 MsgSuccess (t (' common.createSuccess' ))
236239 emit (' refresh' )
237240 if (isWorkFlow (applicationForm .value .type )) {
238- router .push ({path: ` /application/${res .data .id }/workflow ` })
241+ router .push ({ path: ` /application/${res .data .id }/workflow ` })
239242 } else {
240- router .push ({path: ` /application/${res .data .id }/${res .data .type }/setting ` })
243+ router .push ({ path: ` /application/${res .data .id }/${res .data .type }/setting ` })
241244 }
242245 dialogVisible .value = false
243246 })
@@ -249,7 +252,7 @@ function selectedType(type: string) {
249252 appTemplate .value = type
250253}
251254
252- defineExpose ({open })
255+ defineExpose ({ open })
253256 </script >
254257<style lang="scss" scoped>
255258.radio-card {
0 commit comments