1
1
<template >
2
2
<ContentWrap >
3
- <div class =" max-w-1024px mx-auto" >
3
+ <div class =" mx-auto" >
4
4
<!-- 头部导航栏 -->
5
- <div class =" absolute top-0 left-0 right-0 h-50px bg-white border-bottom z-10 flex items-center px-20px" >
5
+ <div
6
+ class =" absolute top-0 left-0 right-0 h-50px bg-white border-bottom z-10 flex items-center px-20px"
7
+ >
6
8
<!-- 左侧标题 -->
7
9
<div class =" w-200px flex items-center overflow-hidden" >
8
10
<Icon icon =" ep:arrow-left" class =" cursor-pointer flex-shrink-0" @click =" router.back()" />
14
16
<!-- 步骤条 -->
15
17
<div class =" flex-1 flex items-center justify-center h-full" >
16
18
<div class =" w-400px flex items-center justify-between h-full" >
17
- <div v-for =" (step, index) in steps" :key =" index"
19
+ <div
20
+ v-for =" (step, index) in steps"
21
+ :key =" index"
18
22
class =" flex items-center cursor-pointer mx-15px relative h-full"
19
- :class =" [currentStep === index ? 'text-[#3473ff] border-[#3473ff] border-b-2 border-b-solid' : 'text-gray-500']"
20
- @click =" handleStepClick(index)" >
21
- <div class =" w-28px h-28px rounded-full flex items-center justify-center mr-8px border-2 border-solid text-15px"
22
- :class =" [currentStep === index ? 'bg-[#3473ff] text-white border-[#3473ff]' : 'border-gray-300 bg-white text-gray-500']" >
23
+ :class =" [
24
+ currentStep === index
25
+ ? 'text-[#3473ff] border-[#3473ff] border-b-2 border-b-solid'
26
+ : 'text-gray-500'
27
+ ]"
28
+ @click =" handleStepClick(index)"
29
+ >
30
+ <div
31
+ class =" w-28px h-28px rounded-full flex items-center justify-center mr-8px border-2 border-solid text-15px"
32
+ :class =" [
33
+ currentStep === index
34
+ ? 'bg-[#3473ff] text-white border-[#3473ff]'
35
+ : 'border-gray-300 bg-white text-gray-500'
36
+ ]"
37
+ >
23
38
{{ index + 1 }}
24
39
</div >
25
40
<span class =" text-16px font-bold whitespace-nowrap" >{{ step.title }}</span >
37
52
<!-- 主体内容 -->
38
53
<div class =" mt-50px" >
39
54
<!-- 第一步:基本信息 -->
40
- <BasicInfo v-if =" currentStep === 0"
41
- v-model =" formData"
42
- :categoryList =" categoryList"
43
- :userList =" userList"
44
- ref =" basicInfoRef" />
55
+ <div v-if =" currentStep === 0" class =" mx-auto" style =" max-width : 1024px " >
56
+ <BasicInfo
57
+ v-model =" formData"
58
+ :categoryList =" categoryList"
59
+ :userList =" userList"
60
+ ref =" basicInfoRef"
61
+ />
62
+ </div >
45
63
46
64
<!-- 第二步:表单设计 -->
47
- <FormDesign v-if =" currentStep === 1"
48
- v-model =" formData"
49
- :formList =" formList"
50
- ref =" formDesignRef" />
65
+ <div v-if =" currentStep === 1" class =" mx-auto" style =" max-width : 1024px " >
66
+ <FormDesign
67
+ v-model =" formData"
68
+ :formList =" formList"
69
+ ref =" formDesignRef"
70
+ />
71
+ </div >
51
72
52
73
<!-- 第三步:流程设计 -->
53
- <ProcessDesign v-if =" currentStep === 2"
74
+ <ProcessDesign
75
+ v-if =" currentStep === 2"
54
76
v-model =" formData"
55
77
ref =" processDesignRef"
56
- @success =" handleDesignSuccess" />
78
+ @success =" handleDesignSuccess"
79
+ />
57
80
</div >
58
81
</div >
59
82
</ContentWrap >
60
83
</template >
61
84
62
85
<script lang="ts" setup>
63
86
import { useRouter , useRoute } from ' vue-router'
64
- import { useI18n } from ' vue-i18n'
65
87
import { useMessage } from ' @/hooks/web/useMessage'
66
88
import * as ModelApi from ' @/api/bpm/model'
67
89
import * as FormApi from ' @/api/bpm/form'
@@ -75,7 +97,6 @@ import ProcessDesign from './ProcessDesign.vue'
75
97
76
98
const router = useRouter ()
77
99
const route = useRoute ()
78
- const { t } = useI18n ()
79
100
const message = useMessage ()
80
101
const userStore = useUserStoreWithOut ()
81
102
@@ -106,7 +127,7 @@ const steps = [
106
127
]
107
128
108
129
// 表单数据
109
- const formData = ref ({
130
+ const formData: any = ref ({
110
131
id: undefined ,
111
132
name: ' ' ,
112
133
key: ' ' ,
@@ -128,11 +149,11 @@ const formData = ref({
128
149
// 数据列表
129
150
const formList = ref ([])
130
151
const categoryList = ref ([])
131
- const userList = ref ([])
152
+ const userList = ref < UserApi . UserVO []> ([])
132
153
133
154
/** 初始化数据 */
134
155
const initData = async () => {
135
- const modelId = route .params .id
156
+ const modelId = route .params .id as string
136
157
if (modelId ) {
137
158
// 修改场景
138
159
formData .value = await ModelApi .getModel (modelId )
@@ -209,7 +230,7 @@ const handleStepClick = async (index: number) => {
209
230
}
210
231
// 校验当前步骤
211
232
try {
212
- if (steps [currentStep .value ].validator ) {
233
+ if (typeof steps [currentStep .value ].validator === ' function ' ) {
213
234
await steps [currentStep .value ].validator ()
214
235
}
215
236
currentStep .value = index
0 commit comments