4747 <el-row :gutter =" 16" >
4848 <el-col :span =" 12" >
4949 <el-card
50- class =" radio-card cursor"
50+ class =" template- radio-card cursor text-center flex-center "
5151 shadow =" never"
5252 @click =" selectedType('blank')"
5353 :class =" appTemplate === 'blank' ? 'active' : ''"
5454 >
55- {{ $t('views.application.form.appTemplate.blankApp') }}
55+ <div class =" flex-center p-24" >
56+ <el-icon class =" mr-12" ><Plus /></el-icon >
57+ {{ $t('views.application.form.appTemplate.blankApp.title') }}
58+ </div >
5659 </el-card >
5760 </el-col >
5861 <el-col :span =" 12" >
59- <el-card
60- class =" radio-card cursor"
62+ <CardBox
63+ :title =" $t('views.application.form.appTemplate.assistantApp.title')"
64+ :description =" $t('views.application.form.appTemplate.assistantApp.description')"
6165 shadow =" never"
66+ class =" template-radio-card cursor"
6267 :class =" appTemplate === 'assistant' ? 'active' : ''"
6368 @click =" selectedType('assistant')"
6469 >
65- {{ $t('views.application.form.appTemplate.assistantApp') }}
66- </el-card >
70+ <template #icon >
71+ <LogoIcon height =" 32px" />
72+ </template >
73+ <template #subTitle >
74+ <el-text class =" color-secondary" size =" small" >
75+ {{ $t('views.application.workflow') }}
76+ </el-text >
77+ </template >
78+ </CardBox >
6779 </el-col >
6880 </el-row >
6981 </div >
@@ -90,6 +102,7 @@ import applicationApi from '@/api/application/application'
90102import { MsgSuccess , MsgAlert } from ' @/utils/message'
91103import { isWorkFlow } from ' @/utils/application'
92104import { baseNodes } from ' @/workflow/common/data'
105+ import { applicationTemplate } from ' @/views/application/template'
93106import { t } from ' @/locales'
94107import useStore from ' @/stores'
95108const { user } = useStore ()
@@ -220,7 +233,7 @@ const submitHandle = async (formEl: FormInstance | undefined) => {
220233 if (! formEl ) return
221234 await formEl .validate ((valid ) => {
222235 if (valid ) {
223- if (isWorkFlow (applicationForm .value .type ) && appTemplate . value === ' blank ' ) {
236+ if (isWorkFlow (applicationForm .value .type )) {
224237 workflowDefault .value .nodes [0 ].properties .node_data .desc = applicationForm .value .desc
225238 workflowDefault .value .nodes [0 ].properties .node_data .name = applicationForm .value .name
226239 applicationForm .value [' work_flow' ] = workflowDefault .value
@@ -248,17 +261,18 @@ const submitHandle = async (formEl: FormInstance | undefined) => {
248261
249262function selectedType(type : string ) {
250263 appTemplate .value = type
264+ workflowDefault .value = applicationTemplate [type ]
251265}
252266
253267defineExpose ({ open })
254268 </script >
255269<style lang="scss" scoped>
256- .radio-card {
257- line-height : 22px ;
270+ .template-radio-card {
271+ height : 130px !important ;
272+ min-height : 130px !important ;
258273
259274 & .active {
260275 border-color : var (--el-color-primary );
261- color : var (--el-color-primary );
262276 }
263277}
264278 </style >
0 commit comments