gbflowengine 0.1.0 → 0.1.1

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.
Files changed (79) hide show
  1. package/README.md +271 -271
  2. package/dist/gbflowengine.css +1 -1
  3. package/dist/gbflowengine.js +8232 -6913
  4. package/dist/gbflowengine.js.map +1 -1
  5. package/dist/gbflowengine.umd.cjs +2 -2
  6. package/dist/gbflowengine.umd.cjs.map +1 -1
  7. package/package.json +85 -84
  8. package/src/center/DefinitionInspect.vue +291 -291
  9. package/src/center/FlowCenter.vue +33 -33
  10. package/src/center/index.js +29 -29
  11. package/src/center/storage.js +748 -748
  12. package/src/core/flow/condition.js +160 -160
  13. package/src/core/flow/customNode.js +385 -385
  14. package/src/core/flow/defaults.js +124 -124
  15. package/src/core/flow/flowConstant.js +265 -265
  16. package/src/core/flow/flowNodeUtils.js +29 -29
  17. package/src/core/flow/index.js +47 -47
  18. package/src/core/flow/node.js +44 -44
  19. package/src/core/flow/nodeFactory.js +58 -58
  20. package/src/core/flow/prediction.js +325 -325
  21. package/src/core/flow/schema.js +864 -864
  22. package/src/definition/FlowDefinitionDesigner.vue +338 -338
  23. package/src/definition/index.js +9 -9
  24. package/src/index.js +39 -39
  25. package/src/storage.js +200 -200
  26. package/src/testing/FlowTestPanel.vue +2502 -2502
  27. package/src/testing/UserConfigDrawer.vue +376 -376
  28. package/src/testing/diagram/FlowProgressDiagram.vue +318 -318
  29. package/src/testing/diagramModel.js +517 -517
  30. package/src/testing/index.js +23 -23
  31. package/src/testing/mock.js +246 -246
  32. package/src/testing/oaExecutors.js +51 -51
  33. package/src/testing/oaSeed.js +467 -467
  34. package/src/testing/sample.js +412 -412
  35. package/src/testing/seed.js +122 -122
  36. package/src/utils/format.js +27 -27
  37. package/src/visual/FlowCanvas.vue +440 -440
  38. package/src/visual/NodeProgressDetail.vue +43 -43
  39. package/src/visual/NodeStatusBadge.vue +17 -17
  40. package/src/visual/NodeWrap.vue +46 -46
  41. package/src/visual/ScWorkflow.vue +49 -49
  42. package/src/visual/SelectDialog.vue +459 -459
  43. package/src/visual/conditionHelpers.js +116 -116
  44. package/src/visual/index.js +6 -6
  45. package/src/visual/nodes/AddNode.vue +222 -222
  46. package/src/visual/nodes/ApproverNode.vue +347 -347
  47. package/src/visual/nodes/BranchNode.vue +441 -441
  48. package/src/visual/nodes/CustomNode.vue +339 -339
  49. package/src/visual/nodes/EndNode.vue +21 -21
  50. package/src/visual/nodes/PassNode.vue +100 -100
  51. package/src/visual/nodes/PromoterNode.vue +134 -134
  52. package/src/visual/nodes/RejectNode.vue +100 -100
  53. package/src/visual/nodes/SendNode.vue +151 -151
  54. package/src/visual/styles.scss +879 -879
  55. package/src/visual/useScNodeStatus.js +18 -18
  56. package/src/workbench/OaWorkbench.vue +1341 -1341
  57. package/src/workbench/components/ApprovalWorkspace.vue +2090 -2090
  58. package/src/workbench/components/CategoryIcon.vue +74 -74
  59. package/src/workbench/components/NotificationIcon.vue +73 -73
  60. package/src/workbench/components/ProcessSteps.vue +557 -557
  61. package/src/workbench/components/ResubmitDialog.vue +227 -227
  62. package/src/workbench/components/SidebarNav.vue +138 -138
  63. package/src/workbench/components/StartFlowDialog.vue +1058 -1058
  64. package/src/workbench/components/UserAvatar.vue +68 -68
  65. package/src/workbench/model.js +1080 -1080
  66. package/src/workbench/pages/DesignPage.vue +798 -798
  67. package/src/workbench/pages/HomePage.vue +1050 -1050
  68. package/src/workbench/pages/MonitorPage.vue +1029 -1029
  69. package/src/workbench/pages/NotificationsPage.vue +554 -554
  70. package/src/workbench/pages/RequestsPage.vue +644 -644
  71. package/src/workbench/pages/TaskCenterPage.vue +1155 -1155
  72. package/src/workbench/pages/TemplatesPage.vue +680 -680
  73. package/src/workbench/styles.scss +555 -555
  74. package/types/center.d.ts +5 -5
  75. package/types/core.d.ts +479 -479
  76. package/types/definition.d.ts +4 -4
  77. package/types/index.d.ts +34 -34
  78. package/types/testing.d.ts +20 -20
  79. package/types/visual.d.ts +20 -20
@@ -1,101 +1,101 @@
1
- <template>
2
- <div class="node-wrap">
3
- <div class="node-wrap-box" :class="statusClass" @click="show">
4
- <div class="title" style="background: #f54a4a">
5
- <el-icon class="icon"><Close /></el-icon>
6
- <span>{{ nodeConfig.nodeName }}</span>
7
- <NodeStatusBadge :status="statusInfo" />
8
- <el-icon class="close" @click.stop="delNode()"><Close /></el-icon>
9
- </div>
10
- <div class="content">
11
- <span>到达此节点后流程直接拒绝</span>
12
- </div>
13
- </div>
14
- <AddNode v-model="nodeConfig.childNode" :parent-node="nodeConfig" :readonly="isReadonly" @update:model-value="updateChild" />
15
- <el-drawer title="直接拒绝" v-model="drawer" destroy-on-close append-to-body :size="500">
16
- <template #header>
17
- <div class="node-wrap-drawer__title">
18
- <label v-if="!isEditTitle" @click="editTitle">
19
- {{ form.nodeName }}
20
- <el-icon class="node-wrap-drawer__title-edit"><Edit /></el-icon>
21
- </label>
22
- <el-input v-if="isEditTitle" ref="nodeTitle" v-model="form.nodeName" clearable @blur="saveTitle" @keyup.enter="saveTitle" />
23
- </div>
24
- </template>
25
- <el-container>
26
- <el-main style="padding: 0 20px 20px 20px">
27
- <el-form label-position="top">
28
- <el-form-item label="节点说明">
29
- <el-alert title="流程执行到此节点时直接结束并标记为拒绝,常用于条件分支中的驳回通道。" type="error" :closable="false" />
30
- </el-form-item>
31
- </el-form>
32
- </el-main>
33
- <el-footer>
34
- <el-button type="primary" @click="save">保存</el-button>
35
- <el-button @click="drawer = false">取消</el-button>
36
- </el-footer>
37
- </el-container>
38
- </el-drawer>
39
- </div>
40
- </template>
41
-
42
- <script setup>
43
- import { computed, inject, ref } from 'vue'
44
- import { Close, Edit } from '@element-plus/icons-vue'
45
- import AddNode from './AddNode.vue'
46
- import NodeStatusBadge from '../NodeStatusBadge.vue'
47
- import { useScNodeStatus } from '../useScNodeStatus.js'
48
-
49
- defineOptions({ name: 'ScRejectNode' })
50
-
51
- const props = defineProps({
52
- modelValue: { type: Object, required: true },
53
- parentNode: { type: Object, default: null }
54
- })
55
-
56
- const emit = defineEmits(['update:modelValue'])
57
-
58
- const readonly = inject('scReadonly', ref(false))
59
- const isReadonly = computed(() => readonly.value === true)
60
- const nodeConfig = computed(() => props.modelValue)
61
- const { statusInfo, statusClass } = useScNodeStatus(nodeConfig)
62
-
63
- const drawer = ref(false)
64
- const isEditTitle = ref(false)
65
- const nodeTitle = ref(null)
66
- const form = ref({})
67
-
68
- const updateChild = (child) => {
69
- const next = JSON.parse(JSON.stringify(nodeConfig.value))
70
- next.childNode = child
71
- emit('update:modelValue', next)
72
- }
73
-
74
- const show = () => {
75
- if (isReadonly.value) return
76
- form.value = JSON.parse(JSON.stringify(nodeConfig.value))
77
- isEditTitle.value = false
78
- drawer.value = true
79
- }
80
-
81
- const editTitle = () => {
82
- isEditTitle.value = true
83
- requestAnimationFrame(() => nodeTitle.value?.focus())
84
- }
85
-
86
- const saveTitle = () => {
87
- isEditTitle.value = false
88
- }
89
-
90
- const save = () => {
91
- const source = JSON.parse(JSON.stringify(nodeConfig.value))
92
- source.nodeName = form.value.nodeName
93
- emit('update:modelValue', source)
94
- drawer.value = false
95
- }
96
-
97
- const delNode = () => {
98
- if (isReadonly.value) return
99
- emit('update:modelValue', nodeConfig.value.childNode)
100
- }
1
+ <template>
2
+ <div class="node-wrap">
3
+ <div class="node-wrap-box" :class="statusClass" @click="show">
4
+ <div class="title" style="background: #f54a4a">
5
+ <el-icon class="icon"><Close /></el-icon>
6
+ <span>{{ nodeConfig.nodeName }}</span>
7
+ <NodeStatusBadge :status="statusInfo" />
8
+ <el-icon class="close" @click.stop="delNode()"><Close /></el-icon>
9
+ </div>
10
+ <div class="content">
11
+ <span>到达此节点后流程直接拒绝</span>
12
+ </div>
13
+ </div>
14
+ <AddNode v-model="nodeConfig.childNode" :parent-node="nodeConfig" :readonly="isReadonly" @update:model-value="updateChild" />
15
+ <el-drawer title="直接拒绝" v-model="drawer" destroy-on-close append-to-body :size="500">
16
+ <template #header>
17
+ <div class="node-wrap-drawer__title">
18
+ <label v-if="!isEditTitle" @click="editTitle">
19
+ {{ form.nodeName }}
20
+ <el-icon class="node-wrap-drawer__title-edit"><Edit /></el-icon>
21
+ </label>
22
+ <el-input v-if="isEditTitle" ref="nodeTitle" v-model="form.nodeName" clearable @blur="saveTitle" @keyup.enter="saveTitle" />
23
+ </div>
24
+ </template>
25
+ <el-container>
26
+ <el-main style="padding: 0 20px 20px 20px">
27
+ <el-form label-position="top">
28
+ <el-form-item label="节点说明">
29
+ <el-alert title="流程执行到此节点时直接结束并标记为拒绝,常用于条件分支中的驳回通道。" type="error" :closable="false" />
30
+ </el-form-item>
31
+ </el-form>
32
+ </el-main>
33
+ <el-footer>
34
+ <el-button type="primary" @click="save">保存</el-button>
35
+ <el-button @click="drawer = false">取消</el-button>
36
+ </el-footer>
37
+ </el-container>
38
+ </el-drawer>
39
+ </div>
40
+ </template>
41
+
42
+ <script setup>
43
+ import { computed, inject, ref } from 'vue'
44
+ import { Close, Edit } from 'gbicons'
45
+ import AddNode from './AddNode.vue'
46
+ import NodeStatusBadge from '../NodeStatusBadge.vue'
47
+ import { useScNodeStatus } from '../useScNodeStatus.js'
48
+
49
+ defineOptions({ name: 'ScRejectNode' })
50
+
51
+ const props = defineProps({
52
+ modelValue: { type: Object, required: true },
53
+ parentNode: { type: Object, default: null }
54
+ })
55
+
56
+ const emit = defineEmits(['update:modelValue'])
57
+
58
+ const readonly = inject('scReadonly', ref(false))
59
+ const isReadonly = computed(() => readonly.value === true)
60
+ const nodeConfig = computed(() => props.modelValue)
61
+ const { statusInfo, statusClass } = useScNodeStatus(nodeConfig)
62
+
63
+ const drawer = ref(false)
64
+ const isEditTitle = ref(false)
65
+ const nodeTitle = ref(null)
66
+ const form = ref({})
67
+
68
+ const updateChild = (child) => {
69
+ const next = JSON.parse(JSON.stringify(nodeConfig.value))
70
+ next.childNode = child
71
+ emit('update:modelValue', next)
72
+ }
73
+
74
+ const show = () => {
75
+ if (isReadonly.value) return
76
+ form.value = JSON.parse(JSON.stringify(nodeConfig.value))
77
+ isEditTitle.value = false
78
+ drawer.value = true
79
+ }
80
+
81
+ const editTitle = () => {
82
+ isEditTitle.value = true
83
+ requestAnimationFrame(() => nodeTitle.value?.focus())
84
+ }
85
+
86
+ const saveTitle = () => {
87
+ isEditTitle.value = false
88
+ }
89
+
90
+ const save = () => {
91
+ const source = JSON.parse(JSON.stringify(nodeConfig.value))
92
+ source.nodeName = form.value.nodeName
93
+ emit('update:modelValue', source)
94
+ drawer.value = false
95
+ }
96
+
97
+ const delNode = () => {
98
+ if (isReadonly.value) return
99
+ emit('update:modelValue', nodeConfig.value.childNode)
100
+ }
101
101
  </script>
@@ -1,152 +1,152 @@
1
- <template>
2
- <div class="node-wrap">
3
- <div class="node-wrap-box" :class="statusClass" @click="show">
4
- <div class="title" style="background: #3296fa">
5
- <el-icon class="icon"><Promotion /></el-icon>
6
- <span>{{ nodeConfig.nodeName }}</span>
7
- <NodeStatusBadge :status="statusInfo" />
8
- <el-icon class="close" @click.stop="delNode()"><Close /></el-icon>
9
- </div>
10
- <div v-if="!statusInfo" class="content">
11
- <span v-if="toText(nodeConfig)">{{ toText(nodeConfig) }}</span>
12
- <span v-else class="placeholder">请选择人员</span>
13
- </div>
14
- <NodeProgressDetail v-else :status="statusInfo" />
15
- </div>
16
- <AddNode v-model="nodeConfig.childNode" :parent-node="nodeConfig" :readonly="isReadonly" @update:model-value="updateChild" />
17
- <el-drawer title="抄送人设置" v-model="drawer" destroy-on-close append-to-body :size="500">
18
- <template #header>
19
- <div class="node-wrap-drawer__title">
20
- <label v-if="!isEditTitle" @click="editTitle">
21
- {{ form.nodeName }}
22
- <el-icon class="node-wrap-drawer__title-edit"><Edit /></el-icon>
23
- </label>
24
- <el-input v-if="isEditTitle" ref="nodeTitle" v-model="form.nodeName" clearable @blur="saveTitle" @keyup.enter="saveTitle" />
25
- </div>
26
- </template>
27
- <el-container>
28
- <el-main style="padding: 0 20px 20px 20px">
29
- <el-form label-position="top">
30
- <el-form-item label="选择要抄送的人员">
31
- <el-button type="primary" :icon="Plus" round @click="selectHandle(1, userProxy)">选择人员</el-button>
32
- <div class="tags-list">
33
- <el-tag v-for="(user, index) in form.nodeAssigneeList" :key="user.id" closable @close="delUser(index)">
34
- {{ user.name }}
35
- </el-tag>
36
- </div>
37
- </el-form-item>
38
- <el-form-item label="">
39
- <el-checkbox v-model="form.allowInitiatorAddUsers" label="允许发起人自选抄送人" />
40
- </el-form-item>
41
- </el-form>
42
- </el-main>
43
- <el-footer>
44
- <el-button type="primary" @click="save">保存</el-button>
45
- <el-button @click="drawer = false">取消</el-button>
46
- </el-footer>
47
- </el-container>
48
- </el-drawer>
49
- </div>
50
- </template>
51
-
52
- <script setup>
53
- import { computed, inject, ref } from 'vue'
54
- import { Close, Edit, Plus, Promotion } from '@element-plus/icons-vue'
55
- import AddNode from './AddNode.vue'
56
- import NodeStatusBadge from '../NodeStatusBadge.vue'
57
- import NodeProgressDetail from '../NodeProgressDetail.vue'
58
- import { useScNodeStatus } from '../useScNodeStatus.js'
59
-
60
- defineOptions({ name: 'ScSendNode' })
61
-
62
- const props = defineProps({
63
- modelValue: { type: Object, required: true }
64
- })
65
-
66
- const emit = defineEmits(['update:modelValue'])
67
-
68
- const select = inject('select', null)
69
- const readonly = inject('scReadonly', ref(false))
70
-
71
- const isReadonly = computed(() => readonly.value === true)
72
- const nodeConfig = computed(() => props.modelValue)
73
- const { statusInfo, statusClass } = useScNodeStatus(nodeConfig)
74
-
75
- const drawer = ref(false)
76
- const isEditTitle = ref(false)
77
- const nodeTitle = ref(null)
78
- const form = ref({})
79
-
80
- const userProxy = computed({
81
- get: () => form.value.nodeAssigneeList || [],
82
- set: () => {}
83
- })
84
-
85
- const updateChild = (child) => {
86
- const next = JSON.parse(JSON.stringify(nodeConfig.value))
87
- next.childNode = child
88
- emit('update:modelValue', next)
89
- }
90
-
91
- const show = () => {
92
- if (isReadonly.value) return
93
- const source = nodeConfig.value
94
- form.value = {
95
- ...JSON.parse(JSON.stringify(source)),
96
- nodeAssigneeList: (source.userList || []).map((id) => ({
97
- id,
98
- name: source.userNickNames?.[id] || `用户${id}`,
99
- deptName: source.deptNameMap?.[id] || ''
100
- }))
101
- }
102
- isEditTitle.value = false
103
- drawer.value = true
104
- }
105
-
106
- const editTitle = () => {
107
- isEditTitle.value = true
108
- requestAnimationFrame(() => nodeTitle.value?.focus())
109
- }
110
-
111
- const saveTitle = () => {
112
- isEditTitle.value = false
113
- }
114
-
115
- const selectHandle = (type, data) => {
116
- select?.(type, data)
117
- }
118
-
119
- const delUser = (index) => {
120
- form.value.nodeAssigneeList.splice(index, 1)
121
- }
122
-
123
- const save = () => {
124
- const source = JSON.parse(JSON.stringify(nodeConfig.value))
125
- const list = form.value.nodeAssigneeList || []
126
- source.nodeName = form.value.nodeName
127
- source.allowInitiatorAddUsers = form.value.allowInitiatorAddUsers
128
- source.userList = list.map((user) => user.id)
129
- source.userNickNames = list.reduce((result, user) => {
130
- result[user.id] = user.name
131
- return result
132
- }, {})
133
- source.deptNameMap = list.reduce((result, user) => {
134
- if (user.deptName) result[user.id] = user.deptName
135
- return result
136
- }, {})
137
- emit('update:modelValue', source)
138
- drawer.value = false
139
- }
140
-
141
- const delNode = () => {
142
- if (isReadonly.value) return
143
- emit('update:modelValue', nodeConfig.value.childNode)
144
- }
145
-
146
- const toText = (node) => {
147
- if (node.userList && node.userList.length > 0) {
148
- return node.userList.map((id) => node.userNickNames?.[id] || `用户${id}`).join('、')
149
- }
150
- return node.allowInitiatorAddUsers ? '发起人自选' : false
151
- }
1
+ <template>
2
+ <div class="node-wrap">
3
+ <div class="node-wrap-box" :class="statusClass" @click="show">
4
+ <div class="title" style="background: #3296fa">
5
+ <el-icon class="icon"><Promotion /></el-icon>
6
+ <span>{{ nodeConfig.nodeName }}</span>
7
+ <NodeStatusBadge :status="statusInfo" />
8
+ <el-icon class="close" @click.stop="delNode()"><Close /></el-icon>
9
+ </div>
10
+ <div v-if="!statusInfo" class="content">
11
+ <span v-if="toText(nodeConfig)">{{ toText(nodeConfig) }}</span>
12
+ <span v-else class="placeholder">请选择人员</span>
13
+ </div>
14
+ <NodeProgressDetail v-else :status="statusInfo" />
15
+ </div>
16
+ <AddNode v-model="nodeConfig.childNode" :parent-node="nodeConfig" :readonly="isReadonly" @update:model-value="updateChild" />
17
+ <el-drawer title="抄送人设置" v-model="drawer" destroy-on-close append-to-body :size="500">
18
+ <template #header>
19
+ <div class="node-wrap-drawer__title">
20
+ <label v-if="!isEditTitle" @click="editTitle">
21
+ {{ form.nodeName }}
22
+ <el-icon class="node-wrap-drawer__title-edit"><Edit /></el-icon>
23
+ </label>
24
+ <el-input v-if="isEditTitle" ref="nodeTitle" v-model="form.nodeName" clearable @blur="saveTitle" @keyup.enter="saveTitle" />
25
+ </div>
26
+ </template>
27
+ <el-container>
28
+ <el-main style="padding: 0 20px 20px 20px">
29
+ <el-form label-position="top">
30
+ <el-form-item label="选择要抄送的人员">
31
+ <el-button type="primary" :icon="Plus" round @click="selectHandle(1, userProxy)">选择人员</el-button>
32
+ <div class="tags-list">
33
+ <el-tag v-for="(user, index) in form.nodeAssigneeList" :key="user.id" closable @close="delUser(index)">
34
+ {{ user.name }}
35
+ </el-tag>
36
+ </div>
37
+ </el-form-item>
38
+ <el-form-item label="">
39
+ <el-checkbox v-model="form.allowInitiatorAddUsers" label="允许发起人自选抄送人" />
40
+ </el-form-item>
41
+ </el-form>
42
+ </el-main>
43
+ <el-footer>
44
+ <el-button type="primary" @click="save">保存</el-button>
45
+ <el-button @click="drawer = false">取消</el-button>
46
+ </el-footer>
47
+ </el-container>
48
+ </el-drawer>
49
+ </div>
50
+ </template>
51
+
52
+ <script setup>
53
+ import { computed, inject, ref } from 'vue'
54
+ import { Close, Edit, Plus, Promotion } from 'gbicons'
55
+ import AddNode from './AddNode.vue'
56
+ import NodeStatusBadge from '../NodeStatusBadge.vue'
57
+ import NodeProgressDetail from '../NodeProgressDetail.vue'
58
+ import { useScNodeStatus } from '../useScNodeStatus.js'
59
+
60
+ defineOptions({ name: 'ScSendNode' })
61
+
62
+ const props = defineProps({
63
+ modelValue: { type: Object, required: true }
64
+ })
65
+
66
+ const emit = defineEmits(['update:modelValue'])
67
+
68
+ const select = inject('select', null)
69
+ const readonly = inject('scReadonly', ref(false))
70
+
71
+ const isReadonly = computed(() => readonly.value === true)
72
+ const nodeConfig = computed(() => props.modelValue)
73
+ const { statusInfo, statusClass } = useScNodeStatus(nodeConfig)
74
+
75
+ const drawer = ref(false)
76
+ const isEditTitle = ref(false)
77
+ const nodeTitle = ref(null)
78
+ const form = ref({})
79
+
80
+ const userProxy = computed({
81
+ get: () => form.value.nodeAssigneeList || [],
82
+ set: () => {}
83
+ })
84
+
85
+ const updateChild = (child) => {
86
+ const next = JSON.parse(JSON.stringify(nodeConfig.value))
87
+ next.childNode = child
88
+ emit('update:modelValue', next)
89
+ }
90
+
91
+ const show = () => {
92
+ if (isReadonly.value) return
93
+ const source = nodeConfig.value
94
+ form.value = {
95
+ ...JSON.parse(JSON.stringify(source)),
96
+ nodeAssigneeList: (source.userList || []).map((id) => ({
97
+ id,
98
+ name: source.userNickNames?.[id] || `用户${id}`,
99
+ deptName: source.deptNameMap?.[id] || ''
100
+ }))
101
+ }
102
+ isEditTitle.value = false
103
+ drawer.value = true
104
+ }
105
+
106
+ const editTitle = () => {
107
+ isEditTitle.value = true
108
+ requestAnimationFrame(() => nodeTitle.value?.focus())
109
+ }
110
+
111
+ const saveTitle = () => {
112
+ isEditTitle.value = false
113
+ }
114
+
115
+ const selectHandle = (type, data) => {
116
+ select?.(type, data)
117
+ }
118
+
119
+ const delUser = (index) => {
120
+ form.value.nodeAssigneeList.splice(index, 1)
121
+ }
122
+
123
+ const save = () => {
124
+ const source = JSON.parse(JSON.stringify(nodeConfig.value))
125
+ const list = form.value.nodeAssigneeList || []
126
+ source.nodeName = form.value.nodeName
127
+ source.allowInitiatorAddUsers = form.value.allowInitiatorAddUsers
128
+ source.userList = list.map((user) => user.id)
129
+ source.userNickNames = list.reduce((result, user) => {
130
+ result[user.id] = user.name
131
+ return result
132
+ }, {})
133
+ source.deptNameMap = list.reduce((result, user) => {
134
+ if (user.deptName) result[user.id] = user.deptName
135
+ return result
136
+ }, {})
137
+ emit('update:modelValue', source)
138
+ drawer.value = false
139
+ }
140
+
141
+ const delNode = () => {
142
+ if (isReadonly.value) return
143
+ emit('update:modelValue', nodeConfig.value.childNode)
144
+ }
145
+
146
+ const toText = (node) => {
147
+ if (node.userList && node.userList.length > 0) {
148
+ return node.userList.map((id) => node.userNickNames?.[id] || `用户${id}`).join('、')
149
+ }
150
+ return node.allowInitiatorAddUsers ? '发起人自选' : false
151
+ }
152
152
  </script>