@ebiz/designer-components 0.1.110 → 0.1.112
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/dist/designer-components.css +1 -1
- package/dist/index.mjs +8299 -8326
- package/package.json +1 -1
- package/src/components/EbizApprovalDetail.vue +20 -4
- package/src/components/EbizApprovalForm.vue +1 -1
- package/src/components/EbizSApprovalProcess.vue +1 -6
- package/src/components/EbizTreeSelector.vue +25 -9
package/package.json
CHANGED
|
@@ -5,12 +5,10 @@
|
|
|
5
5
|
<!-- 区块详情 -->
|
|
6
6
|
<div class="block-detail">
|
|
7
7
|
<slot name="block"></slot>
|
|
8
|
+
<ebiz-s-approval-process ref="approvalprocessRef" :businessKey="businessKey" :type="type"></ebiz-s-approval-process>
|
|
8
9
|
</div>
|
|
9
10
|
<!-- 审批区域 -->
|
|
10
11
|
<div class="approval-area">
|
|
11
|
-
<ebiz-s-approval-process ref="approvalprocessRef" :businessKey="businessKey"
|
|
12
|
-
:type="type"></ebiz-s-approval-process>
|
|
13
|
-
|
|
14
12
|
<ebiz-approval-form v-if="isAssignee" :taskId="currTask.id" :businessKey="businessKey"
|
|
15
13
|
:taskDefinitionKey="currTask.taskDefinitionKey" :approvalDetail="approvalDetail" @pass="refresh"
|
|
16
14
|
@reject="refresh" @refresh="refresh"></ebiz-approval-form>
|
|
@@ -36,6 +34,8 @@ const props = defineProps({
|
|
|
36
34
|
}
|
|
37
35
|
})
|
|
38
36
|
|
|
37
|
+
const emit = defineEmits(['loaded'])
|
|
38
|
+
|
|
39
39
|
// 审批流程组件实例
|
|
40
40
|
const approvalprocessRef = ref(null)
|
|
41
41
|
|
|
@@ -51,9 +51,13 @@ const currTask = ref({})
|
|
|
51
51
|
// 是否为当前任务的审批人
|
|
52
52
|
const isAssignee = ref(false)
|
|
53
53
|
|
|
54
|
+
// 加载状态
|
|
55
|
+
const isLoading = ref(false)
|
|
56
|
+
|
|
54
57
|
// 获取审批详情
|
|
55
58
|
const getApprovalDetail = () => {
|
|
56
59
|
loading(true)
|
|
60
|
+
isLoading.value = true
|
|
57
61
|
dataService.fetch(
|
|
58
62
|
{
|
|
59
63
|
businessKey: props.businessKey,
|
|
@@ -72,8 +76,13 @@ const getApprovalDetail = () => {
|
|
|
72
76
|
isAssignee.value = false
|
|
73
77
|
}
|
|
74
78
|
loading(false)
|
|
79
|
+
isLoading.value = false
|
|
80
|
+
emit('loaded', res)
|
|
75
81
|
}).catch((err) => {
|
|
76
82
|
message.error(err.message)
|
|
83
|
+
loading(false)
|
|
84
|
+
isLoading.value = false
|
|
85
|
+
emit('loaded', err)
|
|
77
86
|
})
|
|
78
87
|
}
|
|
79
88
|
|
|
@@ -96,6 +105,13 @@ const refresh = () => {
|
|
|
96
105
|
onMounted(() => {
|
|
97
106
|
init()
|
|
98
107
|
})
|
|
108
|
+
|
|
109
|
+
defineExpose({
|
|
110
|
+
refresh,
|
|
111
|
+
currTask,
|
|
112
|
+
isLoading,
|
|
113
|
+
isAssignee
|
|
114
|
+
})
|
|
99
115
|
</script>
|
|
100
116
|
|
|
101
117
|
<style lang='less' scoped>
|
|
@@ -118,7 +134,7 @@ onMounted(() => {
|
|
|
118
134
|
.detail-container {
|
|
119
135
|
position: relative;
|
|
120
136
|
display: flex;
|
|
121
|
-
width:
|
|
137
|
+
width: 900px;
|
|
122
138
|
padding: 60px 12px;
|
|
123
139
|
background-color: #ffffff;
|
|
124
140
|
border-radius: 4px;
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
<!-- 流程基本信息 -->
|
|
15
15
|
<div v-if="state.processInfo" class="process-info">
|
|
16
|
-
<div class="info-item" v-if="getStartUserInfo().userId">
|
|
17
|
-
<span class="label">发起人:</span>
|
|
18
|
-
<user-info :userId="getStartUserInfo().userId" :userInfo="getStartUserInfo().userInfo"
|
|
19
|
-
avatar-size="small" name-size="small" :show-job-number="true" :show-department="false" />
|
|
20
|
-
</div>
|
|
21
16
|
<div class="info-item">
|
|
22
17
|
<span class="label">发起时间:</span>
|
|
23
18
|
<span>{{ state.processInfo.startTimeStr || '--' }}</span>
|
|
@@ -166,7 +161,7 @@
|
|
|
166
161
|
<div class="card">
|
|
167
162
|
<div class="card-header">
|
|
168
163
|
<span class="title">备注 <span v-if="state.remarks.length > 0">({{ state.remarks.length
|
|
169
|
-
|
|
164
|
+
}})</span></span>
|
|
170
165
|
<div class="card-actions">
|
|
171
166
|
<t-button variant="text" @click="showAddRemarkDialog">添加备注</t-button>
|
|
172
167
|
</div>
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
<span class="selected-label">{{ item.label }}</span>
|
|
68
68
|
<t-icon name="close-circle" class="remove-icon" @click="removePreviewItem(item)" />
|
|
69
69
|
</div>
|
|
70
|
-
<div v-if="[...selectPreview, ...selectPreviewPost, ...selectPreviewUser].length === 0"
|
|
70
|
+
<div v-if="[...selectPreview, ...selectPreviewPost, ...selectPreviewUser].length === 0"
|
|
71
|
+
class="no-selection">
|
|
71
72
|
<t-icon name="info-circle" />
|
|
72
73
|
<span style="user-select: none">请在左侧选择部门或成员</span>
|
|
73
74
|
</div>
|
|
@@ -148,13 +149,18 @@ const postTree = ref()
|
|
|
148
149
|
const fetchApiData = async () => {
|
|
149
150
|
loading.value = true
|
|
150
151
|
try {
|
|
152
|
+
// 加载部门
|
|
151
153
|
dataService.fetch(
|
|
152
154
|
{ keyWord: activeTab.value === 'organization' ? searchText.value : '' },
|
|
153
155
|
{},
|
|
154
156
|
'/appdata/execute/plugin?key=organizational_structure'
|
|
155
157
|
).then(res => {
|
|
156
158
|
organizationData.value = res || []
|
|
159
|
+
checkedNodes.value = props.modelValue.filter(i => i.type === 'DEPT').map((item) => item.bindid);
|
|
160
|
+
console.log("checkedNodes: {}", checkedNodes)
|
|
157
161
|
})
|
|
162
|
+
|
|
163
|
+
// 加载用户
|
|
158
164
|
dataService.fetch(
|
|
159
165
|
{ postEnable: true, keyWord: activeTab.value === 'employee' ? searchText.value : '' },
|
|
160
166
|
{},
|
|
@@ -165,7 +171,10 @@ const fetchApiData = async () => {
|
|
|
165
171
|
bindid: i.id,
|
|
166
172
|
type: 'employee'
|
|
167
173
|
}));
|
|
174
|
+
checkedUserNodes.value = props.modelValue.filter(i => i.type === 'employee').map((item) => item.bindid);
|
|
168
175
|
})
|
|
176
|
+
|
|
177
|
+
// 加载岗位
|
|
169
178
|
dataService.fetch({
|
|
170
179
|
apiKey: 'all_active_post',
|
|
171
180
|
queryParams: {
|
|
@@ -179,6 +188,7 @@ const fetchApiData = async () => {
|
|
|
179
188
|
bindid: i.id,
|
|
180
189
|
type: 'GW'
|
|
181
190
|
}))
|
|
191
|
+
checkedPostNodes.value = props.modelValue.filter(i => i.type === 'GW').map(item => item.bindid);
|
|
182
192
|
})
|
|
183
193
|
console.log(postData.value)
|
|
184
194
|
} catch (error) {
|
|
@@ -203,9 +213,9 @@ function showDialog() {
|
|
|
203
213
|
// 获取API数据
|
|
204
214
|
fetchApiData()
|
|
205
215
|
// 重置选中的节点
|
|
206
|
-
checkedNodes.value = props.modelValue.filter(i => i.type === 'DEPT').map((item) => item.bindid);
|
|
207
|
-
checkedUserNodes.value = props.modelValue.filter(i => i.type === 'employee').map((item) => item.bindid);
|
|
208
|
-
checkedPostNodes.value = props.modelValue.filter(i => i.type === 'GW').map(item => item.bindid);
|
|
216
|
+
// checkedNodes.value = props.modelValue.filter(i => i.type === 'DEPT').map((item) => item.bindid);
|
|
217
|
+
// checkedUserNodes.value = props.modelValue.filter(i => i.type === 'employee').map((item) => item.bindid);
|
|
218
|
+
// checkedPostNodes.value = props.modelValue.filter(i => i.type === 'GW').map(item => item.bindid);
|
|
209
219
|
dialogVisible.value = true
|
|
210
220
|
}
|
|
211
221
|
|
|
@@ -262,16 +272,21 @@ watch(
|
|
|
262
272
|
checkedNodes,
|
|
263
273
|
(newValues) => {
|
|
264
274
|
if (!organizationTree.value?.treeRef) return
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
275
|
+
console.log("部门选择变化", organizationTree.value.treeRef.getItem, newValues)
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
selectPreview.value = (newValues.map(organizationTree.value.treeRef.getItem) ?? []).map((i) => ({
|
|
278
|
+
label: i?.label,
|
|
279
|
+
type: i?.data?.type || i?.type,
|
|
280
|
+
bindid: i?.value
|
|
281
|
+
}))
|
|
282
|
+
}, 200)
|
|
283
|
+
|
|
270
284
|
},
|
|
271
285
|
{ deep: true }
|
|
272
286
|
)
|
|
273
287
|
watch(checkedUserNodes, nVal => {
|
|
274
288
|
// 获取新选中的用户数据
|
|
289
|
+
console.log("用户选择变化")
|
|
275
290
|
const newSelectedUsers = employeeData.value.filter(i => nVal.includes(i.bindid))
|
|
276
291
|
// 获取现有用户的bindid列表,避免重复添加
|
|
277
292
|
const existingBindIds = selectPreviewUser.value.map(user => user.bindid)
|
|
@@ -281,6 +296,7 @@ watch(checkedUserNodes, nVal => {
|
|
|
281
296
|
selectPreviewUser.value = [...selectPreviewUser.value, ...usersToAdd]
|
|
282
297
|
}, { deep: true })
|
|
283
298
|
watch(checkedPostNodes, nVal => {
|
|
299
|
+
console.log("岗位选择变化")
|
|
284
300
|
selectPreviewPost.value = postData.value.filter(i => nVal.includes(i.bindid))
|
|
285
301
|
}, { deep: true })
|
|
286
302
|
// 监听modelValue变化,同步到选中节点
|