@ebiz/designer-components 0.0.58 → 0.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -29
- package/dist/designer-components.css +1 -1
- package/dist/index.mjs +4822 -4822
- package/package.json +1 -1
- package/src/App.vue +26 -26
- package/src/apiService/SIMPLE_DATA_SERVICE.md +284 -284
- package/src/apiService/mockDataService.js +115 -115
- package/src/apiService/simpleDataService.js +297 -297
- package/src/assets/base.css +86 -86
- package/src/assets/logo.svg +1 -1
- package/src/components/Button.vue +149 -149
- package/src/components/DataContainer.vue +40 -40
- package/src/components/EbizApproval.vue +332 -338
- package/src/components/EbizAutoForm.vue +596 -596
- package/src/components/EbizAvatar.vue +115 -115
- package/src/components/EbizCheckbox.vue +93 -93
- package/src/components/EbizCheckboxGroup.vue +69 -69
- package/src/components/EbizDepartmentSelector.vue +144 -144
- package/src/components/EbizDescriptions.vue +340 -340
- package/src/components/EbizDescriptionsItem.vue +47 -47
- package/src/components/EbizDetailBlock.vue +81 -81
- package/src/components/EbizDialog.vue +260 -260
- package/src/components/EbizDiv.vue +32 -32
- package/src/components/EbizDivider.vue +96 -96
- package/src/components/EbizEmployeeInfo.vue +138 -138
- package/src/components/EbizEmployeeSelector.vue +1093 -1086
- package/src/components/EbizFileUpload.vue +238 -238
- package/src/components/EbizMap.vue +541 -541
- package/src/components/EbizOkrTree.vue +99 -99
- package/src/components/EbizPageHeader.vue +95 -95
- package/src/components/EbizPagination.vue +162 -162
- package/src/components/EbizPopconfirm.vue +47 -47
- package/src/components/EbizRadio.vue +86 -86
- package/src/components/EbizRadioGroup.vue +83 -83
- package/src/components/EbizRemoteSelect.vue +232 -232
- package/src/components/EbizRouteBreadcrumb.vue +46 -46
- package/src/components/EbizSelect.vue +85 -85
- package/src/components/EbizSpace.vue +100 -100
- package/src/components/EbizStatistic.vue +149 -149
- package/src/components/EbizStatsCard.vue +113 -113
- package/src/components/EbizSwiper.vue +113 -113
- package/src/components/EbizSwiperItem.vue +13 -13
- package/src/components/EbizSwitch.vue +85 -85
- package/src/components/EbizTabHeader.vue +132 -132
- package/src/components/EbizTabPanel.vue +22 -22
- package/src/components/EbizTable.vue +469 -469
- package/src/components/EbizTableColumn.vue +116 -116
- package/src/components/EbizTableSort.vue +179 -179
- package/src/components/EbizTabs.vue +142 -142
- package/src/components/EbizTdesignButtonDialog.vue +332 -332
- package/src/components/EbizTdesignLoading.vue +107 -107
- package/src/components/EbizTimePicker.vue +143 -143
- package/src/components/EbizTitle.vue +91 -91
- package/src/components/EbizTree.vue +152 -152
- package/src/components/EbizTreeMergeTable.vue +1414 -1414
- package/src/components/EbizTreeSelector.vue +418 -418
- package/src/components/EbizVxeTable.vue +290 -290
- package/src/components/Form.vue +28 -28
- package/src/components/Home.vue +7 -7
- package/src/components/MyComponent.vue +39 -39
- package/src/components/Table.vue +45 -45
- package/src/components/TdesignAlert.vue +115 -115
- package/src/components/TdesignButton.vue +135 -135
- package/src/components/TdesignCalendar/index.vue +145 -145
- package/src/components/TdesignCard.vue +195 -195
- package/src/components/TdesignCol.vue +101 -101
- package/src/components/TdesignCollapse.vue +142 -142
- package/src/components/TdesignCollapsePanel.vue +79 -79
- package/src/components/TdesignDatePicker.vue +124 -124
- package/src/components/TdesignDescriptions.vue +74 -74
- package/src/components/TdesignDescriptionsItem.vue +50 -50
- package/src/components/TdesignDialog.vue +225 -225
- package/src/components/TdesignForm.vue +138 -138
- package/src/components/TdesignFormItem.vue +105 -105
- package/src/components/TdesignGrid.vue +55 -55
- package/src/components/TdesignIcon.vue +67 -67
- package/src/components/TdesignImage.vue +162 -162
- package/src/components/TdesignImageViewer.vue +200 -200
- package/src/components/TdesignInput.vue +242 -242
- package/src/components/TdesignSelect.vue +444 -444
- package/src/components/TdesignTag.vue +117 -117
- package/src/components/TdesignTextarea.vue +142 -142
- package/src/components/TdesignTimeline.vue +58 -58
- package/src/components/TdesignTimelineItem.vue +71 -71
- package/src/components/TdesignUpload.vue +388 -388
- package/src/components/TdesignWatermark.vue +107 -107
- package/src/components/ebiz-form/components/cascader.vue +61 -61
- package/src/components/ebiz-form/components/checkbox.vue +37 -37
- package/src/components/ebiz-form/components/city.vue +137 -137
- package/src/components/ebiz-form/components/date-panel.vue +52 -52
- package/src/components/ebiz-form/components/date-range-panel.vue +52 -52
- package/src/components/ebiz-form/components/date-range.vue +56 -56
- package/src/components/ebiz-form/components/date.vue +52 -52
- package/src/components/ebiz-form/components/editor-multi-language.vue +47 -47
- package/src/components/ebiz-form/components/editor.vue +78 -78
- package/src/components/ebiz-form/components/file-multi-language.vue +52 -52
- package/src/components/ebiz-form/components/file.vue +149 -149
- package/src/components/ebiz-form/components/images-multi-language.vue +52 -52
- package/src/components/ebiz-form/components/images.vue +129 -129
- package/src/components/ebiz-form/components/img-multi-language.vue +51 -51
- package/src/components/ebiz-form/components/img.vue +129 -129
- package/src/components/ebiz-form/components/number.vue +50 -50
- package/src/components/ebiz-form/components/radio.vue +28 -28
- package/src/components/ebiz-form/components/select.vue +119 -119
- package/src/components/ebiz-form/components/switch.vue +23 -23
- package/src/components/ebiz-form/components/text-multi-language.vue +47 -47
- package/src/components/ebiz-form/components/text.vue +52 -52
- package/src/components/ebiz-form/components/textarea-multi-language.vue +48 -48
- package/src/components/ebiz-form/components/textarea.vue +29 -29
- package/src/components/ebiz-form/components/video-multi-language.vue +51 -51
- package/src/components/ebiz-form/components/video.vue +97 -97
- package/src/components/ebiz-form/index.vue +157 -157
- package/src/components/examples/PopconfirmExample.vue +149 -149
- package/src/components/icons/IconCommunity.vue +7 -7
- package/src/components/icons/IconDocumentation.vue +7 -7
- package/src/components/icons/IconEcosystem.vue +7 -7
- package/src/components/icons/IconSupport.vue +7 -7
- package/src/components/icons/IconTooling.vue +19 -19
- package/src/components/senior/EbizSData/index.vue +260 -260
- package/src/components/senior/EbizSDialog/index.vue +713 -713
- package/src/components/senior/EbizSForm/README.md +157 -157
- package/src/components/senior/EbizSForm/index.vue +668 -668
- package/src/components/senior/EbizSForm/item.vue +522 -522
- package/src/components/senior/EbizSForm/mItems/DateTimePicker.vue +51 -51
- package/src/components/senior/EbizSForm/mItems/Picker.vue +63 -63
- package/src/index.js +218 -218
- package/src/main.js +55 -55
- package/src/router/index.js +374 -374
- package/src/utils/formatCode.js +24 -24
- package/src/utils/generateImportStatement.js +52 -52
- package/src/utils/hasJsx.js +25 -25
- package/src/utils/index.js +166 -166
- package/src/utils/mergeOptions.js +29 -29
- package/src/utils/parseRequiredBlocks.js +18 -18
- package/src/utils/upload.ts +126 -126
- package/src/utils/vue-sfc-validator.js +155 -155
- package/src/views/Button.vue +23 -23
- package/src/views/CheckboxDemo.vue +104 -104
- package/src/views/DataContainer.vue +19 -19
- package/src/views/DialogDemo.vue +125 -125
- package/src/views/EbizApprovalDemo.vue +76 -76
- package/src/views/EbizAutoFormDemo.vue +129 -129
- package/src/views/EbizAvatar.vue +223 -223
- package/src/views/EbizDepartmentSelectorDemo.vue +169 -169
- package/src/views/EbizDetailBlockDemo.vue +30 -30
- package/src/views/EbizEmployeeInfo.vue +249 -249
- package/src/views/EbizEmployeeSelector.vue +83 -83
- package/src/views/EbizMap.vue +201 -201
- package/src/views/EbizRadioDemo.vue +151 -151
- package/src/views/EbizSDataDemo.vue +136 -136
- package/src/views/EbizSDialogDemo.vue +301 -301
- package/src/views/EbizSForm/index.vue +359 -359
- package/src/views/EbizSFormDemo.vue +420 -420
- package/src/views/EbizSpace.vue +185 -185
- package/src/views/EbizSwiper.vue +157 -157
- package/src/views/EbizTdesignButtonDialogExample.vue +437 -437
- package/src/views/Form.vue +19 -19
- package/src/views/GridDemo.vue +238 -238
- package/src/views/Home.vue +146 -146
- package/src/views/Mindmap.vue +17 -17
- package/src/views/MyComponent.vue +19 -19
- package/src/views/OkrTree.vue +19 -19
- package/src/views/PageHeaderDemo.vue +104 -104
- package/src/views/PaginationDemo.vue +96 -96
- package/src/views/PermissionBoxDemo.vue +85 -85
- package/src/views/PopconfirmDemo.vue +80 -80
- package/src/views/RemoteSelect.vue +350 -350
- package/src/views/StatisticDemo.vue +190 -190
- package/src/views/SwitchDemo.vue +79 -79
- package/src/views/Table.vue +19 -19
- package/src/views/TableDemo.vue +334 -334
- package/src/views/TableSortDemo.vue +143 -143
- package/src/views/TableView.vue +68 -68
- package/src/views/TabsDemo.vue +282 -282
- package/src/views/TagDemo.vue +101 -101
- package/src/views/TdesignAlert.vue +98 -98
- package/src/views/TdesignButton.vue +190 -190
- package/src/views/TdesignCalendar.vue +94 -94
- package/src/views/TdesignCard.vue +296 -296
- package/src/views/TdesignCollapse.vue +293 -293
- package/src/views/TdesignDatePicker.vue +187 -187
- package/src/views/TdesignDescriptions.vue +101 -101
- package/src/views/TdesignForm.vue +248 -248
- package/src/views/TdesignIcon.vue +203 -203
- package/src/views/TdesignImage.vue +215 -215
- package/src/views/TdesignImageViewer.vue +198 -198
- package/src/views/TdesignInput.vue +252 -252
- package/src/views/TdesignSelect.vue +473 -473
- package/src/views/TdesignSwiper.vue +157 -157
- package/src/views/TextareaDemo.vue +93 -93
- package/src/views/TimePickerDemo.vue +146 -146
- package/src/views/TimelineDemo.vue +160 -160
- package/src/views/Title.vue +19 -19
- package/src/views/TreeDemo.vue +254 -254
- package/src/views/TreeMergeTableDemo.vue +239 -239
- package/src/views/TreeSelectorDemo.vue +245 -245
- package/src/views/UploadDemo.vue +121 -121
- package/src/views/VxeTableDemo.vue +279 -279
- package/src/views/WatermarkDemo.vue +85 -85
@@ -1,339 +1,333 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="ebiz-approval">
|
3
|
-
<t-card>
|
4
|
-
<!-- 审批人部分 -->
|
5
|
-
<div class="approval-section">
|
6
|
-
<div class="approval-title">审批流程</div>
|
7
|
-
|
8
|
-
<div class="section-header">
|
9
|
-
<t-icon name="user" class="section-icon" />
|
10
|
-
<span class="section-title">
|
11
|
-
审批人
|
12
|
-
<span class="required" v-if="required">*</span>
|
13
|
-
</span>
|
14
|
-
</div>
|
15
|
-
<div class="approver-list">
|
16
|
-
<div class="approver-row">
|
17
|
-
<template v-for="(approver, index) in approvers" :key="index">
|
18
|
-
<div class="approver-item">
|
19
|
-
<t-avatar :image="approver.avatar" size="small">
|
20
|
-
{{ getAvatarText(approver.name) }}
|
21
|
-
</t-avatar>
|
22
|
-
<div class="user-info" :class="{ 'no-delete': required && approvers.length <= 1 }">
|
23
|
-
<span class="approver-name">{{ approver.name }}</span>
|
24
|
-
<t-icon v-if="!required || approvers.length > 1" name="close" size="16px"
|
25
|
-
@click="removeEmployee(approver, 'approver')" />
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
<t-icon v-if="index < approvers.length - 1" name="chevron-right" class="arrow-icon" />
|
29
|
-
</template>
|
30
|
-
<t-button theme="default" variant="text" @click="handleAddApprover" v-if="canEdit">
|
31
|
-
<template #icon>
|
32
|
-
<t-icon name="add" />
|
33
|
-
</template>
|
34
|
-
添加审批人
|
35
|
-
</t-button>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
</div>
|
39
|
-
|
40
|
-
<!-- 抄送人部分 -->
|
41
|
-
<div v-if="showCC" class="cc-section">
|
42
|
-
<div class="section-header">
|
43
|
-
<t-icon name="user-add" class="section-icon" />
|
44
|
-
<span class="section-title">抄送人</span>
|
45
|
-
</div>
|
46
|
-
<div class="cc-list">
|
47
|
-
<div class="cc-row">
|
48
|
-
<template v-for="(cc, index) in ccEmployees" :key="index">
|
49
|
-
<div class="cc-item">
|
50
|
-
<t-avatar :image="cc.avatar" size="small">
|
51
|
-
{{ getAvatarText(cc.name) }}
|
52
|
-
</t-avatar>
|
53
|
-
<div class="user-info">
|
54
|
-
<span class="cc-name">{{ cc.name }}</span>
|
55
|
-
<t-icon name="close" size="16px" @click="removeEmployee(cc, 'cc')" />
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
</template>
|
59
|
-
<t-button theme="default" variant="text" @click="handleAddCC" v-if="canEdit">
|
60
|
-
<template #icon>
|
61
|
-
<t-icon name="add" />
|
62
|
-
</template>
|
63
|
-
添加抄送人
|
64
|
-
</t-button>
|
65
|
-
</div>
|
66
|
-
</div>
|
67
|
-
</div>
|
68
|
-
</t-card>
|
69
|
-
|
70
|
-
<!-- 审批人选择弹窗 -->
|
71
|
-
<ebiz-employee-selector :showDefault="false" v-model:visible="showApproverSelector" v-model:value="tempApprover"
|
72
|
-
@change="handleApproverSelect" :single="true" />
|
73
|
-
<ebiz-employee-selector :showDefault="false" v-model:visible="showCCSelector" v-model:value="selectedCC" @change="handleCCSelect"
|
74
|
-
/>
|
75
|
-
</div>
|
76
|
-
</template>
|
77
|
-
|
78
|
-
<script setup lang="ts">
|
79
|
-
import { ref, watch, computed } from 'vue'
|
80
|
-
import { Icon as TIcon, Avatar as TAvatar, Card as TCard, Button as TButton, Dialog as TDialog } from 'tdesign-vue-next'
|
81
|
-
import EbizEmployeeSelector from './EbizEmployeeSelector.vue'
|
82
|
-
import dataService from '../apiService/simpleDataService'
|
83
|
-
|
84
|
-
interface Employee {
|
85
|
-
id: string | number
|
86
|
-
name: string
|
87
|
-
no: string
|
88
|
-
avatar?: string
|
89
|
-
}
|
90
|
-
|
91
|
-
interface Props {
|
92
|
-
approverList: (string | number)[] // 选中的审批人ID列表
|
93
|
-
ccList: (string | number)[] // 选中的抄送人ID列表
|
94
|
-
key: string // 审批流程的唯一标识
|
95
|
-
id: number // 审批流程的编号
|
96
|
-
required: boolean // 是否必填
|
97
|
-
type?: 'organization' | 'role' | 'all' // 查询类型
|
98
|
-
value?: string // 查询值
|
99
|
-
showRootOrg?: boolean // 是否显示顶层组织
|
100
|
-
childDeptEnable?: boolean // 是否包含子部门
|
101
|
-
showCC?: boolean // 是否显示抄送人模块
|
102
|
-
canEdit?: boolean // 是否可以编辑审批人,抄送人
|
103
|
-
}
|
104
|
-
|
105
|
-
const props = withDefaults(defineProps<Props>(), {
|
106
|
-
approverList: () => [],
|
107
|
-
ccList: () => [],
|
108
|
-
key: '',
|
109
|
-
id: 0,
|
110
|
-
required: true,
|
111
|
-
showRootOrg: true,
|
112
|
-
childDeptEnable: false,
|
113
|
-
showCC: true,
|
114
|
-
canEdit: true
|
115
|
-
})
|
116
|
-
|
117
|
-
const emit = defineEmits(['update:approverList', 'update:ccList', 'change'])
|
118
|
-
|
119
|
-
const fetchHistory = () => {
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
const
|
140
|
-
const
|
141
|
-
const
|
142
|
-
const
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
approvers.value
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
ccEmployees.value
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
{},
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
//
|
249
|
-
|
250
|
-
|
251
|
-
}
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
margin-bottom:
|
264
|
-
}
|
265
|
-
|
266
|
-
.
|
267
|
-
|
268
|
-
|
269
|
-
margin-bottom: 16px;
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
}
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
}
|
334
|
-
|
335
|
-
.cc-section {
|
336
|
-
margin-top: 24px;
|
337
|
-
}
|
338
|
-
}
|
1
|
+
<template>
|
2
|
+
<div class="ebiz-approval">
|
3
|
+
<t-card>
|
4
|
+
<!-- 审批人部分 -->
|
5
|
+
<div class="approval-section">
|
6
|
+
<div class="approval-title">审批流程</div>
|
7
|
+
|
8
|
+
<div class="section-header">
|
9
|
+
<t-icon name="user" class="section-icon" />
|
10
|
+
<span class="section-title">
|
11
|
+
审批人
|
12
|
+
<span class="required" v-if="required">*</span>
|
13
|
+
</span>
|
14
|
+
</div>
|
15
|
+
<div class="approver-list">
|
16
|
+
<div class="approver-row">
|
17
|
+
<template v-for="(approver, index) in approvers" :key="index">
|
18
|
+
<div class="approver-item">
|
19
|
+
<t-avatar :image="approver.avatar" size="small">
|
20
|
+
{{ getAvatarText(approver.name) }}
|
21
|
+
</t-avatar>
|
22
|
+
<div class="user-info" :class="{ 'no-delete': required && approvers.length <= 1 }">
|
23
|
+
<span class="approver-name">{{ approver.name }}</span>
|
24
|
+
<t-icon v-if="!required || approvers.length > 1" name="close" size="16px"
|
25
|
+
@click="removeEmployee(approver, 'approver')" />
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
<t-icon v-if="index < approvers.length - 1" name="chevron-right" class="arrow-icon" />
|
29
|
+
</template>
|
30
|
+
<t-button theme="default" variant="text" @click="handleAddApprover" v-if="canEdit">
|
31
|
+
<template #icon>
|
32
|
+
<t-icon name="add" />
|
33
|
+
</template>
|
34
|
+
添加审批人
|
35
|
+
</t-button>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<!-- 抄送人部分 -->
|
41
|
+
<div v-if="showCC" class="cc-section">
|
42
|
+
<div class="section-header">
|
43
|
+
<t-icon name="user-add" class="section-icon" />
|
44
|
+
<span class="section-title">抄送人</span>
|
45
|
+
</div>
|
46
|
+
<div class="cc-list">
|
47
|
+
<div class="cc-row">
|
48
|
+
<template v-for="(cc, index) in ccEmployees" :key="index">
|
49
|
+
<div class="cc-item">
|
50
|
+
<t-avatar :image="cc.avatar" size="small">
|
51
|
+
{{ getAvatarText(cc.name) }}
|
52
|
+
</t-avatar>
|
53
|
+
<div class="user-info">
|
54
|
+
<span class="cc-name">{{ cc.name }}</span>
|
55
|
+
<t-icon name="close" size="16px" @click="removeEmployee(cc, 'cc')" />
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
</template>
|
59
|
+
<t-button theme="default" variant="text" @click="handleAddCC" v-if="canEdit">
|
60
|
+
<template #icon>
|
61
|
+
<t-icon name="add" />
|
62
|
+
</template>
|
63
|
+
添加抄送人
|
64
|
+
</t-button>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
</t-card>
|
69
|
+
|
70
|
+
<!-- 审批人选择弹窗 -->
|
71
|
+
<ebiz-employee-selector :showDefault="false" v-model:visible="showApproverSelector" v-model:value="tempApprover"
|
72
|
+
@change="handleApproverSelect" :single="true" />
|
73
|
+
<ebiz-employee-selector :showDefault="false" v-model:visible="showCCSelector" v-model:value="selectedCC" @change="handleCCSelect"
|
74
|
+
/>
|
75
|
+
</div>
|
76
|
+
</template>
|
77
|
+
|
78
|
+
<script setup lang="ts">
|
79
|
+
import { ref, watch, computed } from 'vue'
|
80
|
+
import { Icon as TIcon, Avatar as TAvatar, Card as TCard, Button as TButton, Dialog as TDialog } from 'tdesign-vue-next'
|
81
|
+
import EbizEmployeeSelector from './EbizEmployeeSelector.vue'
|
82
|
+
import dataService from '../apiService/simpleDataService'
|
83
|
+
|
84
|
+
interface Employee {
|
85
|
+
id: string | number
|
86
|
+
name: string
|
87
|
+
no: string
|
88
|
+
avatar?: string
|
89
|
+
}
|
90
|
+
|
91
|
+
interface Props {
|
92
|
+
approverList: (string | number)[] // 选中的审批人ID列表
|
93
|
+
ccList: (string | number)[] // 选中的抄送人ID列表
|
94
|
+
key: string // 审批流程的唯一标识
|
95
|
+
id: number // 审批流程的编号
|
96
|
+
required: boolean // 是否必填
|
97
|
+
type?: 'organization' | 'role' | 'all' // 查询类型
|
98
|
+
value?: string // 查询值
|
99
|
+
showRootOrg?: boolean // 是否显示顶层组织
|
100
|
+
childDeptEnable?: boolean // 是否包含子部门
|
101
|
+
showCC?: boolean // 是否显示抄送人模块
|
102
|
+
canEdit?: boolean // 是否可以编辑审批人,抄送人
|
103
|
+
}
|
104
|
+
|
105
|
+
const props = withDefaults(defineProps<Props>(), {
|
106
|
+
approverList: () => [],
|
107
|
+
ccList: () => [],
|
108
|
+
key: '',
|
109
|
+
id: 0,
|
110
|
+
required: true,
|
111
|
+
showRootOrg: true,
|
112
|
+
childDeptEnable: false,
|
113
|
+
showCC: true,
|
114
|
+
canEdit: true
|
115
|
+
})
|
116
|
+
|
117
|
+
const emit = defineEmits(['update:approverList', 'update:ccList', 'change'])
|
118
|
+
|
119
|
+
const fetchHistory = () => {
|
120
|
+
dataService.fetch({
|
121
|
+
bussinessKey: props.id?props.id.toString():null,
|
122
|
+
type: props.key
|
123
|
+
}, {}, '/tasks/process/detail').then(res=>{
|
124
|
+
selectedApprover.value = res?.variables?.form?.approverList ?? [];
|
125
|
+
selectedCC.value = res?.variables?.form?.ccList ?? [];
|
126
|
+
if(!selectedApprover.value.length){
|
127
|
+
dataService.fetch({
|
128
|
+
apiKey: "offer_Application"
|
129
|
+
}, {},"/appdata/process?key=offer_Application").then(res=>{
|
130
|
+
selectedApprover.value = res?.data?.at(0)?.approve_list || [];
|
131
|
+
})
|
132
|
+
}
|
133
|
+
})
|
134
|
+
}
|
135
|
+
|
136
|
+
|
137
|
+
// 状态变量
|
138
|
+
const showApproverSelector = ref(false)
|
139
|
+
const showCCSelector = ref(false)
|
140
|
+
const employeeList = ref<Employee[]>([])
|
141
|
+
const loading = ref(false)
|
142
|
+
const tempApprover = ref([])
|
143
|
+
// 计算属性:已选审批人列表
|
144
|
+
const approvers = ref<Employee[]>([])
|
145
|
+
|
146
|
+
// 计算属性:已选抄送人列表
|
147
|
+
const ccEmployees = ref<Employee[]>([])
|
148
|
+
|
149
|
+
// 计算属性:审批人选择器的值
|
150
|
+
const selectedApprover = computed({
|
151
|
+
get: () => props.approverList,
|
152
|
+
set: (val) => {
|
153
|
+
approvers.value = val.map(id => employeeList.value.find(emp => emp.id == id)).filter(Boolean)
|
154
|
+
console.log(approvers.value,val)
|
155
|
+
emit('change', {
|
156
|
+
type: 'approver',
|
157
|
+
ids: val,
|
158
|
+
employees: approvers.value
|
159
|
+
})
|
160
|
+
emit('update:approverList', val)
|
161
|
+
}
|
162
|
+
})
|
163
|
+
|
164
|
+
// 计算属性:抄送人选择器的值
|
165
|
+
const selectedCC = computed({
|
166
|
+
get: () => props.ccList,
|
167
|
+
set: (val) => {
|
168
|
+
|
169
|
+
ccEmployees.value = val.map(id => employeeList.value.find(emp => emp.id == id)).filter(Boolean)
|
170
|
+
console.log(ccEmployees.value,161,val)
|
171
|
+
emit('change', {
|
172
|
+
type: 'cc',
|
173
|
+
ids: val,
|
174
|
+
employees: ccEmployees.value
|
175
|
+
})
|
176
|
+
emit('update:ccList', val)
|
177
|
+
}
|
178
|
+
})
|
179
|
+
|
180
|
+
// 获取头像文字
|
181
|
+
const getAvatarText = (name: string) => {
|
182
|
+
return name ? name.charAt(0) : ''
|
183
|
+
}
|
184
|
+
|
185
|
+
// 获取员工列表
|
186
|
+
const fetchEmployeeList = async () => {
|
187
|
+
loading.value = true
|
188
|
+
try {
|
189
|
+
const response = await dataService.fetch(
|
190
|
+
{},
|
191
|
+
{},
|
192
|
+
'/process/userList'
|
193
|
+
)
|
194
|
+
employeeList.value = response || [];
|
195
|
+
if(props.id) {
|
196
|
+
fetchHistory();
|
197
|
+
}
|
198
|
+
} catch (error) {
|
199
|
+
employeeList.value = []
|
200
|
+
} finally {
|
201
|
+
loading.value = false
|
202
|
+
}
|
203
|
+
}
|
204
|
+
|
205
|
+
// 处理审批人选择
|
206
|
+
const handleApproverSelect = (data: []) => {
|
207
|
+
console.log(data,195)
|
208
|
+
if(!data[0]) return;
|
209
|
+
if(selectedApprover.value.includes(data[0])) {
|
210
|
+
let index = selectedApprover.value.indexOf(data[0]);
|
211
|
+
selectedApprover.value.splice(index, 1);
|
212
|
+
};
|
213
|
+
selectedApprover.value = [...selectedApprover.value, data[0]];
|
214
|
+
console.log(selectedApprover.value,200)
|
215
|
+
tempApprover.value = [];
|
216
|
+
}
|
217
|
+
|
218
|
+
// 处理抄送人选择
|
219
|
+
const handleCCSelect = (data: []) => {
|
220
|
+
selectedCC.value = data;
|
221
|
+
}
|
222
|
+
|
223
|
+
// 移除人员
|
224
|
+
const removeEmployee = (employee: Employee, type: 'approver' | 'cc') => {
|
225
|
+
if (type === 'approver') {
|
226
|
+
if (props.required && props.approverList.length <= 1) {
|
227
|
+
return
|
228
|
+
}
|
229
|
+
const newList = props.approverList.filter(id => id !== employee.id);
|
230
|
+
selectedApprover.value = newList;
|
231
|
+
} else {
|
232
|
+
const newList = props.ccList.filter(id => id !== employee.id);
|
233
|
+
selectedCC.value = newList;
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
// 处理添加审批人
|
238
|
+
const handleAddApprover = () => {
|
239
|
+
showApproverSelector.value = true
|
240
|
+
}
|
241
|
+
|
242
|
+
// 处理添加抄送人
|
243
|
+
const handleAddCC = () => {
|
244
|
+
showCCSelector.value = true
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
// 监听查询条件变化
|
249
|
+
watch([() => props.type, () => props.value, () => props.showRootOrg, () => props.childDeptEnable], () => {
|
250
|
+
fetchEmployeeList()
|
251
|
+
}, { immediate: true })
|
252
|
+
</script>
|
253
|
+
|
254
|
+
<style lang="less" scoped>
|
255
|
+
.ebiz-approval {
|
256
|
+
.approval-section {
|
257
|
+
margin-bottom: 24px;
|
258
|
+
}
|
259
|
+
|
260
|
+
.approval-title {
|
261
|
+
font-size: 16px;
|
262
|
+
font-weight: 500;
|
263
|
+
margin-bottom: 16px;
|
264
|
+
}
|
265
|
+
|
266
|
+
.section-header {
|
267
|
+
display: flex;
|
268
|
+
align-items: center;
|
269
|
+
margin-bottom: 16px;
|
270
|
+
|
271
|
+
.section-icon {
|
272
|
+
margin-right: 8px;
|
273
|
+
}
|
274
|
+
|
275
|
+
.section-title {
|
276
|
+
font-size: 14px;
|
277
|
+
color: var(--td-text-color-primary);
|
278
|
+
|
279
|
+
.required {
|
280
|
+
color: var(--td-error-color);
|
281
|
+
margin-left: 4px;
|
282
|
+
}
|
283
|
+
}
|
284
|
+
}
|
285
|
+
|
286
|
+
.approver-list,
|
287
|
+
.cc-list {
|
288
|
+
.approver-row,
|
289
|
+
.cc-row {
|
290
|
+
display: flex;
|
291
|
+
align-items: center;
|
292
|
+
flex-wrap: wrap;
|
293
|
+
gap: 8px;
|
294
|
+
}
|
295
|
+
|
296
|
+
.approver-item,
|
297
|
+
.cc-item {
|
298
|
+
display: flex;
|
299
|
+
align-items: center;
|
300
|
+
padding: 4px 8px;
|
301
|
+
background: var(--td-bg-color-container);
|
302
|
+
border: 1px solid var(--td-component-border);
|
303
|
+
border-radius: 3px;
|
304
|
+
|
305
|
+
.user-info {
|
306
|
+
margin-left: 8px;
|
307
|
+
display: flex;
|
308
|
+
align-items: center;
|
309
|
+
gap: 8px;
|
310
|
+
cursor: pointer;
|
311
|
+
user-select: none;
|
312
|
+
&.no-delete {
|
313
|
+
margin-right: 0;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
.approver-name,
|
318
|
+
.cc-name {
|
319
|
+
font-size: 14px;
|
320
|
+
color: var(--td-text-color-primary);
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
.arrow-icon {
|
325
|
+
color: var(--td-text-color-secondary);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
|
329
|
+
.cc-section {
|
330
|
+
margin-top: 24px;
|
331
|
+
}
|
332
|
+
}
|
339
333
|
</style>
|