Skip to content

Commit b293f15

Browse files
committed
chore: mock测试数据
1 parent 753a32a commit b293f15

File tree

2 files changed

+210
-4
lines changed

2 files changed

+210
-4
lines changed

src/views/bpm/model/index.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@
4242
<!-- 分类卡片组 -->
4343
<div class="px-30px">
4444
<ContentWrap v-for="(list, title) in categoryGroup" :key="title">
45-
<h3 class="ml-20px">{{ title }}</h3>
45+
<div class="flex items-center mb-20px">
46+
<h3 class="ml-20px mr-8px">{{ title }}</h3>
47+
<div class="text-[var(--el-text-color-placeholder)]">({{ list?.length || 0 }})</div>
48+
</div>
4649
<el-table v-loading="loading" :data="list">
4750
<el-table-column label="流程名" align="center" prop="name" min-width="200">
4851
<template #default="scope">
49-
<div class="flex items-center justify-center">
52+
<div class="flex items-center">
5053
<el-image :src="scope.row.icon" class="h-32px w-32px mr-10px rounded" />
5154
{{ scope.row.name }}
5255
</div>
@@ -206,14 +209,14 @@ import { BpmModelType } from '@/utils/constants'
206209
import { checkPermi } from '@/utils/permission'
207210
import { useUserStoreWithOut } from '@/store/modules/user'
208211
import { groupBy } from 'lodash-es'
212+
import { mockData } from './mock'
209213
210214
defineOptions({ name: 'BpmModel' })
211215
212216
const message = useMessage() // 消息弹窗
213217
const { t } = useI18n() // 国际化
214218
const { push } = useRouter() // 路由
215219
const userStore = useUserStoreWithOut() // 用户信息缓存
216-
217220
const loading = ref(true) // 列表的加载中
218221
const queryParams = reactive({
219222
pageNo: 1,
@@ -224,14 +227,15 @@ const queryParams = reactive({
224227
})
225228
const queryFormRef = ref() // 搜索的表单
226229
const categoryList = ref([]) // 流程分类列表
227-
const categoryGroup = ref({}) // 按照category分组的数据
230+
const categoryGroup = ref<any>({}) // 按照category分组的数据
228231
229232
/** 查询列表 */
230233
const getList = async () => {
231234
loading.value = true
232235
try {
233236
// TODO 芋艿:这里需要一个不分页查全部的流程模型接口
234237
const data = await ModelApi.getModelPage(queryParams)
238+
data.list = mockData
235239
categoryGroup.value = groupBy(data.list, 'categoryName')
236240
} finally {
237241
loading.value = false

src/views/bpm/model/mock.js

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
export const mockData = [
2+
{
3+
key: 'out_apply',
4+
name: '外出申请',
5+
description: null,
6+
category: '1',
7+
categoryName: '测试1',
8+
formType: 20,
9+
formId: null,
10+
formCustomCreatePath: '/OA/goingOut/create',
11+
formCustomViewPath: '/OA/goingOut/detail',
12+
id: 'ff8f8bab-4d4e-11ef-8201-0242ac130002',
13+
formName: null,
14+
createTime: 1722218716216,
15+
processDefinition: {
16+
id: 'out_apply:4:7f56d464-4eec-11ef-8c3a-0242ac130002',
17+
version: 4,
18+
deploymentTime: 1722396312641,
19+
suspensionState: 1
20+
}
21+
},
22+
{
23+
key: 'contract_change_history',
24+
name: '合同变更申请',
25+
description: null,
26+
category: '2',
27+
categoryName: '测试2',
28+
formType: 20,
29+
formId: null,
30+
formCustomCreatePath: '/project/changeRecord/detail',
31+
formCustomViewPath: '/project/changeRecord/detail',
32+
id: '0c689067-3a92-11ef-b7f0-0242ac130002',
33+
formName: null,
34+
createTime: 1720158441959,
35+
processDefinition: {
36+
id: 'contract_change_history:1:f69fff4f-3a9a-11ef-b7f0-0242ac130002',
37+
version: 1,
38+
deploymentTime: 1720162270788,
39+
suspensionState: 1
40+
}
41+
},
42+
{
43+
key: 'expenses_claim',
44+
name: '费用报销申请',
45+
description: null,
46+
category: '1',
47+
categoryName: '测试1',
48+
formType: 20,
49+
formId: null,
50+
formCustomCreatePath: '/finance/reimbursement/detail',
51+
formCustomViewPath: '/finance/reimbursement/detail',
52+
id: '0310ad0c-351e-11ef-a653-0242ac130002',
53+
formName: null,
54+
createTime: 1719558848849,
55+
processDefinition: {
56+
id: 'expenses_claim:5:a043a1d8-4eec-11ef-8c3a-0242ac130002',
57+
version: 5,
58+
deploymentTime: 1722396367911,
59+
suspensionState: 1
60+
}
61+
},
62+
{
63+
key: 'out_business_apply',
64+
name: '申请单',
65+
description: null,
66+
category: '2',
67+
categoryName: '测试2',
68+
formType: 20,
69+
formId: null,
70+
formCustomCreatePath: '/finance/businessTripApply/detail',
71+
formCustomViewPath: '/finance/businessTripApply/detail',
72+
id: '279e27a4-3393-11ef-8401-0242ac130002',
73+
formName: null,
74+
createTime: 1719389258966,
75+
processDefinition: {
76+
id: 'out_business_apply:9:a7b2d4e2-430f-11ef-876f-0242ac130002',
77+
version: 9,
78+
deploymentTime: 1721091998780,
79+
suspensionState: 1
80+
}
81+
},
82+
{
83+
key: 'pms_project_delay_application',
84+
name: '项目延时申请',
85+
description: null,
86+
category: '2',
87+
categoryName: '测试2',
88+
formType: 20,
89+
formId: null,
90+
formCustomCreatePath: '/project/workHourDelay/create',
91+
formCustomViewPath: '/project/workHourDelay/detail',
92+
id: '46d87275-27c7-11ef-b258-0242ac130002',
93+
formName: null,
94+
createTime: 1718092231234,
95+
processDefinition: {
96+
id: 'b7ed308a-430f-11ef-876f-0242ac130002',
97+
version: 5,
98+
deploymentTime: 1721092026059,
99+
suspensionState: 1
100+
}
101+
},
102+
{
103+
key: 'pms_project_result_approval',
104+
name: '项目成果审核',
105+
description: null,
106+
category: '2',
107+
categoryName: '测试2',
108+
formType: 20,
109+
formId: null,
110+
formCustomCreatePath: '/project/projectTaskResult/detail',
111+
formCustomViewPath: '/project/projectTaskResult/detail',
112+
id: '4a15d4f8-23cc-11ef-8dd0-0242ac130002',
113+
formName: null,
114+
createTime: 1717654579502,
115+
processDefinition: {
116+
id: 'dd3cc360-4eec-11ef-8c3a-0242ac130002',
117+
version: 6,
118+
deploymentTime: 1722396470232,
119+
suspensionState: 1
120+
}
121+
},
122+
{
123+
key: 'pms_contract',
124+
name: '合同管理',
125+
description: null,
126+
category: '2',
127+
categoryName: '测试2',
128+
formType: 20,
129+
formId: null,
130+
formCustomCreatePath: '/sales/contract/create',
131+
formCustomViewPath: '/sales/contract/detail',
132+
id: '8317cb71-0d1a-11ef-8445-70b5e844a623',
133+
formName: null,
134+
createTime: 1715159299146,
135+
processDefinition: {
136+
id: 'pms_contract:5:c7d6012a-29f2-11ef-a08d-0242ac130002',
137+
version: 5,
138+
deploymentTime: 1718330818270,
139+
suspensionState: 1
140+
}
141+
},
142+
{
143+
key: 'pms_consult_task_act',
144+
name: '咨询任务书',
145+
description: null,
146+
category: '1',
147+
categoryName: '测试1',
148+
formType: 20,
149+
formId: null,
150+
formCustomCreatePath: '/consultTask/create',
151+
formCustomViewPath: '/consultTask/detail',
152+
id: '47fad8e4-0b91-11ef-b841-70b5e844a623',
153+
formName: null,
154+
createTime: 1714990407756,
155+
processDefinition: {
156+
id: 'pms_consult_task_act:1:67c2ae59-0b91-11ef-b841-70b5e844a623',
157+
version: 1,
158+
deploymentTime: 1714990460960,
159+
suspensionState: 1
160+
}
161+
},
162+
{
163+
key: 'pms_project',
164+
name: '立项管理',
165+
description: null,
166+
category: '1',
167+
categoryName: '测试1',
168+
formType: 20,
169+
formId: null,
170+
formCustomCreatePath: '/project/applyProject/create',
171+
formCustomViewPath: '/project/applyProject/detail',
172+
id: 'f0ba6bde-0b90-11ef-b841-70b5e844a623',
173+
formName: null,
174+
createTime: 1714990261372,
175+
processDefinition: {
176+
id: 'pms_project:6:b9e4e33b-2c6c-11ef-8386-0242ac130002',
177+
version: 6,
178+
deploymentTime: 1718603095738,
179+
suspensionState: 1
180+
}
181+
},
182+
{
183+
key: 'invoice_apply_manage',
184+
name: '开票申请',
185+
description: 'asdas',
186+
category: '1',
187+
categoryName: '测试1',
188+
formType: 20,
189+
formId: null,
190+
formCustomCreatePath: '/sales/invoice/create',
191+
formCustomViewPath: '/sales/invoice/detail',
192+
id: '7ec07575-0605-11ef-ab76-cc96e508c010',
193+
formName: null,
194+
createTime: 1714380614292,
195+
processDefinition: {
196+
id: 'invoice_apply_manage:8:665a8c40-44c9-11ef-9813-0242ac130002',
197+
version: 8,
198+
deploymentTime: 1721281726671,
199+
suspensionState: 1
200+
}
201+
}
202+
]

0 commit comments

Comments
 (0)