sohelp-eleplus 1.1.13

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 (191) hide show
  1. package/README.md +7 -0
  2. package/cache/DictCache.js +58 -0
  3. package/cache/ModuleCache.js +352 -0
  4. package/components.js +45 -0
  5. package/core-export.js +4 -0
  6. package/http/CrudHttp.js +115 -0
  7. package/http/DictHttp.js +12 -0
  8. package/http/ModuleHttp.js +68 -0
  9. package/http/SohelpHttp.js +125 -0
  10. package/index.js +6 -0
  11. package/installer.js +8 -0
  12. package/lang/en_US.js +4 -0
  13. package/lang/zh_CN.js +4 -0
  14. package/lang/zh_TW.js +4 -0
  15. package/package.json +9 -0
  16. package/sohelp-ace-editor/index.vue +198 -0
  17. package/sohelp-application-select/index.vue +15 -0
  18. package/sohelp-autocode/index.vue +53 -0
  19. package/sohelp-calendar-view/index.vue +11 -0
  20. package/sohelp-card-view/index.vue +11 -0
  21. package/sohelp-condition/index.vue +210 -0
  22. package/sohelp-cry-input/index.vue +64 -0
  23. package/sohelp-date/index.vue +27 -0
  24. package/sohelp-datetime/index.vue +44 -0
  25. package/sohelp-datetime-picker/index.vue +86 -0
  26. package/sohelp-datetime-range/index.vue +59 -0
  27. package/sohelp-dict/index.vue +207 -0
  28. package/sohelp-dict/props.js +68 -0
  29. package/sohelp-drawer/index.vue +31 -0
  30. package/sohelp-drop-card/index.vue +94 -0
  31. package/sohelp-drop-card/props.js +68 -0
  32. package/sohelp-dyn-select/index.vue +99 -0
  33. package/sohelp-dyn-select/props.js +67 -0
  34. package/sohelp-dyn-tree/index.vue +82 -0
  35. package/sohelp-dyn-tree-select/index.vue +114 -0
  36. package/sohelp-entity-form/index.vue +524 -0
  37. package/sohelp-entity-grid/index.vue +30 -0
  38. package/sohelp-file-upload/index.vue +218 -0
  39. package/sohelp-filter-scheme/components/condition.vue +102 -0
  40. package/sohelp-filter-scheme/components/filter.vue +45 -0
  41. package/sohelp-filter-scheme/components/keywords.vue +15 -0
  42. package/sohelp-filter-scheme/components/scheme.vue +49 -0
  43. package/sohelp-filter-scheme/index.vue +113 -0
  44. package/sohelp-grid/SohelpGridConfig.js~ +408 -0
  45. package/sohelp-grid/components/filter-condition-item.vue +298 -0
  46. package/sohelp-grid/index.vue +1886 -0
  47. package/sohelp-grid/js/ConditionType.js +101 -0
  48. package/sohelp-grid/js/DefaultGridOptions.js +141 -0
  49. package/sohelp-grid/js/DefaultProps.js +27 -0
  50. package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
  51. package/sohelp-grid/js/SohelpGridConfig.js +101 -0
  52. package/sohelp-grid/js/useSohelpGridConfig.js +519 -0
  53. package/sohelp-grid-select/index.vue +245 -0
  54. package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
  55. package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
  56. package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
  57. package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
  58. package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
  59. package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
  60. package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
  61. package/sohelp-grid-view/filter/config/index.vue +206 -0
  62. package/sohelp-grid-view/filter/filter-form.vue +427 -0
  63. package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
  64. package/sohelp-grid-view/filter/index.vue +160 -0
  65. package/sohelp-grid-view/index.vue +379 -0
  66. package/sohelp-grid-view-select/index.vue +141 -0
  67. package/sohelp-group-view/index.vue +11 -0
  68. package/sohelp-icon-select/index.vue +96 -0
  69. package/sohelp-icon-select/vxeui-icon.js +90 -0
  70. package/sohelp-image-upload/index.vue +286 -0
  71. package/sohelp-input/index.vue +39 -0
  72. package/sohelp-modal/index.vue +49 -0
  73. package/sohelp-module/index.vue +54 -0
  74. package/sohelp-module/useModalManager.js +89 -0
  75. package/sohelp-module/useSohelpModule.js +66 -0
  76. package/sohelp-number-input/index.vue +32 -0
  77. package/sohelp-number-range/index.vue +135 -0
  78. package/sohelp-org-select/index.vue +30 -0
  79. package/sohelp-org-tree/index.vue +18 -0
  80. package/sohelp-org-tree-select/index.vue +93 -0
  81. package/sohelp-org-user-tree/index.vue +26 -0
  82. package/sohelp-org-user-tree-select/index.vue +11 -0
  83. package/sohelp-pagination/index.vue +11 -0
  84. package/sohelp-power/index.vue +105 -0
  85. package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
  86. package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
  87. package/sohelp-pro-form/index.vue +257 -0
  88. package/sohelp-pro-form/util.js +140 -0
  89. package/sohelp-pro-layout/index.vue +11 -0
  90. package/sohelp-pro-table/index.vue +14 -0
  91. package/sohelp-process/index.vue +216 -0
  92. package/sohelp-rate/index.vue +56 -0
  93. package/sohelp-rate/props.js +71 -0
  94. package/sohelp-relation/index.vue +11 -0
  95. package/sohelp-rich-text/index.vue +242 -0
  96. package/sohelp-rich-text/util.js +231 -0
  97. package/sohelp-richtext/index.vue +10 -0
  98. package/sohelp-role-select/index.vue +33 -0
  99. package/sohelp-search/components/search-config.vue +0 -0
  100. package/sohelp-search/index.vue +49 -0
  101. package/sohelp-search-pro-form/index.vue +11 -0
  102. package/sohelp-select/index.vue +120 -0
  103. package/sohelp-split-panel/index.vue +15 -0
  104. package/sohelp-switch/index.vue +56 -0
  105. package/sohelp-table/index.vue +151 -0
  106. package/sohelp-tenant-select/index.vue +128 -0
  107. package/sohelp-text/index.vue +14 -0
  108. package/sohelp-textarea-input/index.vue +36 -0
  109. package/sohelp-time/index.vue +10 -0
  110. package/sohelp-tree/index.vue +37 -0
  111. package/sohelp-tree-select/index.vue +18 -0
  112. package/sohelp-user-select/index.vue +44 -0
  113. package/sohelp-user-select/index.vue~ +53 -0
  114. package/sohelp-user-select/props.js +71 -0
  115. package/sohelp-user-tag/index.vue +12 -0
  116. package/sohelp-user-tree/index.vue +11 -0
  117. package/sohelp-vform-drawer/index.vue +40 -0
  118. package/sohelp-vform-eleplus/favicon.ico +0 -0
  119. package/sohelp-vform-eleplus/index.vue +297 -0
  120. package/sohelp-vform-eleplus/preview.html +91 -0
  121. package/sohelp-vform-eleplus/render.es.js +72433 -0
  122. package/sohelp-vform-eleplus/render.style.css +16 -0
  123. package/sohelp-vform-eleplus/render.umd.js +57 -0
  124. package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
  125. package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
  126. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
  127. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
  128. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
  129. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
  130. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
  131. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
  132. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
  133. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
  134. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
  135. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
  136. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
  137. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
  138. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
  139. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
  140. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  141. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
  142. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
  143. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
  144. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
  145. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
  146. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
  147. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
  148. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
  149. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
  150. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
  151. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
  152. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
  153. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  154. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
  155. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
  156. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
  157. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
  158. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
  159. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
  160. package/sohelp-vform-modal/index.vue +41 -0
  161. package/sohelp-vform-select/index.vue +11 -0
  162. package/sohelp-vform-vant/favicon.ico +0 -0
  163. package/sohelp-vform-vant/render.es.js +14608 -0
  164. package/sohelp-vform-vant/render.style.css +1 -0
  165. package/sohelp-vform-vant/render.umd.js +22 -0
  166. package/sohelp-vxe-grid/DefaultGridOptions.js +102 -0
  167. package/sohelp-vxe-grid/DefaultProps.js +37 -0
  168. package/sohelp-vxe-grid/SohelpGridConfig.js +142 -0
  169. package/sohelp-vxe-grid/index.vue +518 -0
  170. package/sohelp-vxe-grid-select/index.vue +148 -0
  171. package/sohelp-vxe-table/index.vue +184 -0
  172. package/sohelp-workflow/index.vue +495 -0
  173. package/sohelp-workflow/nodeWrap.vue +53 -0
  174. package/sohelp-workflow/nodes/addNode.vue +27 -0
  175. package/sohelp-workflow/nodes/approver.vue +125 -0
  176. package/sohelp-workflow/nodes/branch.vue +434 -0
  177. package/sohelp-workflow/nodes/promoter.vue +80 -0
  178. package/sohelp-workflow/nodes/send.vue +95 -0
  179. package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
  180. package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
  181. package/sohelp-workflow-drawer/components/form.vue +79 -0
  182. package/sohelp-workflow-drawer/components/table.vue +153 -0
  183. package/sohelp-workflow-drawer/components/timeline.vue +189 -0
  184. package/sohelp-workflow-drawer/components/workflow.vue +68 -0
  185. package/sohelp-workflow-drawer/index.vue +311 -0
  186. package/sohelp-workflow-drawer/js/index.js +119 -0
  187. package/style/index.scss +0 -0
  188. package/utils/ProFormConvertUtil.js +76 -0
  189. package/utils/core.js +310 -0
  190. package/utils/use-form-data.js +48 -0
  191. package/utils/use-mobile.js +43 -0
@@ -0,0 +1,189 @@
1
+ <template>
2
+ <div class="line-wrap">
3
+ <div
4
+ class="line"
5
+ v-for="(item, index) in stepData"
6
+ :key="index"
7
+ :class="[item.type]"
8
+ :title="getTypeLabel(item.type)"
9
+ >
10
+ <div class="avatar-box">
11
+ <el-avatar
12
+ shape="circle"
13
+ fit="cover"
14
+ :src="getAvatar(item.assignee_id)"
15
+ style="background: transparent; width: 26px; height: 26px"
16
+ v-if="item.actor_avatar"
17
+ />
18
+ <el-avatar style="background: transparent" :icon="UserFilled" v-else />
19
+ </div>
20
+ <div class="line-main">
21
+ <div>
22
+ <ele-text tag="span" type="info" style="display: inline-block; width: 180px">{{ item.nodeName }} </ele-text>
23
+ <ele-text tag="span" type="info">{{ item.create_time }}</ele-text>
24
+ </div>
25
+
26
+ <ele-text style="margin-top: 5px">
27
+ <div style="display: flex; gap: 5px; flex-wrap: wrap">
28
+ <ele-text v-if="item.task_type == 1">办理人:</ele-text>
29
+ <ele-text v-if="item.task_type == 0">申请人:</ele-text>
30
+ <ele-text v-if="item.task_type == 2" type="info">抄送人:</ele-text>
31
+ <span v-for="row in item?.actorList" :key="row.actor_id">
32
+ <vxe-tag status="primary">{{ row.actor_name }}</vxe-tag>
33
+ </span>
34
+ </div>
35
+ </ele-text>
36
+ <div style="display: flex; gap: 5px; flex-wrap: wrap">
37
+ <ele-text v-if="item.task_type === 1">办理意见:</ele-text>
38
+ <ele-text v-if="item.task_type === 0">申请理由:</ele-text>
39
+ <ele-text v-if="item.task_type !== 2">{{ getVariable(item)?.reason }}</ele-text>
40
+ <ele-text v-if="item.type !== 'done'" type="info">指派人:</ele-text>
41
+
42
+ <span v-if="item.type !== 'done'" v-for="row in item?.assigneeList" :key="row.name">
43
+ <vxe-tag status="info">{{ row.name }}</vxe-tag>
44
+ </span>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </template>
50
+
51
+ <script setup>
52
+ import { reactive, ref, watch } from 'vue';
53
+ import { ElMessage } from 'element-plus';
54
+ import { useMobile } from '@/utils/use-mobile.js';
55
+ import { getTasks } from '../js/index.js';
56
+ import { UserFilled } from '@element-plus/icons-vue';
57
+ import { API_BASE_URL } from '@/config/setting';
58
+
59
+ const { mobile } = useMobile();
60
+
61
+ const props = defineProps({
62
+ data: Object
63
+ });
64
+
65
+ const stepData = reactive([]);
66
+ const currentTaskIndex = ref(1);
67
+
68
+ const load = async () => {
69
+ const { refid, id } = props.data;
70
+ if (refid && id) {
71
+ const data = await getTasks({ refid, id });
72
+ data.forEach((item, index) => {
73
+ if (item.create_time) {
74
+ currentTaskIndex.value = index + 1;
75
+ }
76
+ stepData.push(item);
77
+ });
78
+ } else {
79
+ ElMessage.error('缺少id或refid参数');
80
+ }
81
+ };
82
+
83
+ /**
84
+ * 获取头像
85
+ */
86
+ const getAvatar = (id) => {
87
+ return API_BASE_URL + '/engine/web/user/avatar?id=' + id;
88
+ };
89
+
90
+ const getVariable = (item) => {
91
+ return JSON.parse(item.variable || '{}');
92
+ };
93
+
94
+ const type = {
95
+ todo: '处理中',
96
+ done: '已处理'
97
+ };
98
+
99
+ const getTypeLabel = (_type) => {
100
+ return type[_type] || '';
101
+ };
102
+
103
+ watch(
104
+ () => props.data,
105
+ (val) => {
106
+ if (val) {
107
+ load();
108
+ }
109
+ },
110
+ {
111
+ immediate: true
112
+ }
113
+ );
114
+ </script>
115
+ <style lang="scss" scoped>
116
+ .line-wrap {
117
+ margin-top: 20px;
118
+ display: flex;
119
+ flex-direction: column;
120
+ gap: 30px;
121
+ background: linear-gradient(to right, transparent 0px, transparent 15px, #eee 15px, #eee 20px, transparent 20px);
122
+
123
+ .line {
124
+ display: flex;
125
+ flex-direction: row;
126
+ gap: 10px;
127
+ align-items: flex-start;
128
+ position: relative;
129
+
130
+ .avatar-box {
131
+ display: flex;
132
+ align-items: center;
133
+ justify-content: center;
134
+ background: #f1f1f1;
135
+ border: 1px solid #eee;
136
+ border-radius: 50%;
137
+ box-sizing: border-box;
138
+ width: 36px;
139
+ height: 36px;
140
+ padding: 3px;
141
+ position: relative;
142
+ }
143
+
144
+ .avatar-box::before {
145
+ content: '';
146
+ display: inline-block;
147
+ position: absolute;
148
+ top: 0px;
149
+ right: -5px;
150
+ width: 10px;
151
+ height: 10px;
152
+ text-align: center;
153
+ line-height: 10px;
154
+ color: #fff;
155
+ font-size: 12px;
156
+ padding: 2px;
157
+ background: transparent;
158
+ border-radius: 50%;
159
+ }
160
+
161
+ .line-main {
162
+ flex: 1;
163
+ height: auto;
164
+ }
165
+ }
166
+
167
+ .line.done {
168
+ .avatar-box::before {
169
+ content: '✓';
170
+ background: #67c23a;
171
+ transform: rotate(15deg);
172
+ }
173
+ }
174
+
175
+ .line.todo {
176
+ .avatar-box::before {
177
+ content: '●';
178
+ background: #ff943e;
179
+ }
180
+ }
181
+
182
+ .line.undo {
183
+ .avatar-box::before {
184
+ content: 'x';
185
+ background: #ff6600;
186
+ }
187
+ }
188
+ }
189
+ </style>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div v-loading="loading" class="workflow-wrap">
3
+ <draw-box class="workflow-scroll">
4
+ <sohelp-workflow class="workflow" ref="workflowRef" v-model="workflow.nodeConfig" v-if="workflow?.nodeConfig" />
5
+ </draw-box>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup>
10
+ import { ref, watch, reactive } from 'vue';
11
+ import { ElMessage } from 'element-plus';
12
+ import { getWorkflow } from '../js/index.js';
13
+ import DrawBox from './draw-box.vue';
14
+
15
+ const props = defineProps({
16
+ data: Object
17
+ });
18
+
19
+ const loading = ref(false);
20
+ const workflow = ref(null);
21
+
22
+ const load = async () => {
23
+ loading.value = true;
24
+ const { id, refid } = props.data;
25
+ if (id && refid) {
26
+ const res = await getWorkflow({ refid, id }).catch((e) => {
27
+ ElMessage.error(e.message);
28
+ });
29
+ loading.value = false;
30
+ if (res) {
31
+ workflow.value = res;
32
+ }
33
+ } else {
34
+ ElMessage.error('缺少id或refid参数');
35
+ }
36
+ };
37
+
38
+ watch(
39
+ () => props.data,
40
+ (val) => {
41
+ if (val) {
42
+ load();
43
+ }
44
+ },
45
+ {
46
+ immediate: true
47
+ }
48
+ );
49
+ </script>
50
+ <style lang="scss" scoped>
51
+ .workflow-wrap {
52
+ width: 100%;
53
+ height: 100%;
54
+ display: flex;
55
+ box-sizing: border-box;
56
+ flex-direction: column;
57
+ overflow: hidden;
58
+ padding-top: 20px;
59
+ }
60
+
61
+ .slider {
62
+ display: flex;
63
+ gap: 20px;
64
+ width: 400px;
65
+ align-items: center;
66
+ margin: 0 20px 20px auto;
67
+ }
68
+ </style>
@@ -0,0 +1,311 @@
1
+ <!-- 工作流 -->
2
+ <template>
3
+ <ele-drawer
4
+ :append-to-body="true"
5
+ :z-index="2002"
6
+ :model-value="modelValue"
7
+ @update:modelValue="updateModelValue"
8
+ :destroyOnClose="true"
9
+ title="详情"
10
+ size="70%"
11
+ style="min-width: 600px"
12
+ :bodyStyle="{ padding: '0 20px' }"
13
+ class="workflow-drawer auto-height"
14
+ :body-style="{
15
+ height: '100%'
16
+ }"
17
+ @close="close"
18
+ @open="open"
19
+ :close-on-click-modal="false"
20
+ >
21
+ <ele-tabs :items="tabs" v-model="active" class="workflow-tabs">
22
+ <template #form>
23
+ <form-tab :data="data" v-if="active === 'form'"></form-tab>
24
+ </template>
25
+ <template #workflow>
26
+ <workflow-tab :data="data" v-if="active === 'workflow'"></workflow-tab>
27
+ </template>
28
+ <template #table>
29
+ <table-tab :data="data" v-if="active === 'table'"></table-tab>
30
+ </template>
31
+ <template #timeline>
32
+ <timeline-tab :data="data" v-if="active === 'timeline'"></timeline-tab>
33
+ </template>
34
+ </ele-tabs>
35
+
36
+ <!-- 同意、拒绝弹窗 -->
37
+ <approval-modal
38
+ v-model="approvalModalVisible"
39
+ :type="todoType"
40
+ :data="approvalData"
41
+ @confirm="done"
42
+ ></approval-modal>
43
+
44
+ <!-- 选择用户 -->
45
+ <ele-modal
46
+ :width="400"
47
+ form
48
+ v-model="userModal"
49
+ :title="moreOption[todoType]"
50
+ :close-on-click-modal="false"
51
+ @open="openUserModal"
52
+ :draggable="false"
53
+ >
54
+ <el-form label-position="top">
55
+ <el-form-item :label="`请选择要${moreOption[todoType]}的用户`">
56
+ <sohelp-user-select
57
+ :multiple="todoType != 'delegate'"
58
+ v-model="users"
59
+ style="width: 100%"
60
+ ></sohelp-user-select>
61
+ </el-form-item>
62
+ </el-form>
63
+
64
+ <template #footer>
65
+ <el-button @click="userModal = false">取消</el-button>
66
+ <el-button type="primary" @click="saveByUser(todoType, users)" v-loading="loading" :disabled="!users.length">{{
67
+ moreOption[todoType]
68
+ }}
69
+ </el-button>
70
+ </template>
71
+ </ele-modal>
72
+
73
+ <template #footer>
74
+ <el-button plain size="small" @click="updateModelValue(false)">关闭</el-button>
75
+ <span v-if="showOpera">
76
+ <el-button type="primary" size="small" @click="openModal('agree')" v-permission="'todo.wf.agree'"
77
+ >同意</el-button
78
+ >
79
+ <el-button type="danger" size="small" @click="openModal('reject')" v-permission="'todo.wf.reject'"
80
+ >拒绝</el-button
81
+ >
82
+ <ele-dropdown trigger="click" :items="getMore" @command="onOperate($event)" v-if="getMore.length > 0">
83
+ <el-button plain="" size="small" title="更多" :icon="MoreFilled"></el-button>
84
+ </ele-dropdown>
85
+ </span>
86
+ </template>
87
+ </ele-drawer>
88
+ </template>
89
+
90
+ <script setup>
91
+ import { buttonAuth, getTodoDetail, moreOption, todoOperate } from "@/api/todo/index.js";
92
+ import { EleMessage } from "@/components/ele-admin-plus/components";
93
+ import { MoreFilled } from "@element-plus/icons-vue";
94
+ import { ElMessageBox } from "element-plus/es";
95
+ import { usePermission } from "@/utils/use-permission";
96
+ import { computed, reactive, ref, watch } from "vue";
97
+ import FormTab from "./components/form.vue";
98
+ import TableTab from "./components/table.vue";
99
+ import TimelineTab from "./components/timeline.vue";
100
+ import WorkflowTab from "./components/workflow.vue";
101
+ import ApprovalModal from "./components/approval-modal.vue";
102
+
103
+ const permission = usePermission();
104
+
105
+ const props = defineProps({
106
+ modelValue: Boolean,
107
+ data: Object,
108
+ showOpera: {
109
+ type: Boolean,
110
+ default: true
111
+ }
112
+ });
113
+
114
+ const emit = defineEmits(["opera","update:data","update:showOpera","update:modelValue", "reload", "close"]);
115
+
116
+ const tabs = reactive([
117
+ { label: "表单", name: "form" },
118
+ { label: "流程图", name: "workflow" },
119
+ { label: "表格", name: "table" },
120
+ { label: "时间轴", name: "timeline" }
121
+ ]);
122
+ const active = ref("form");
123
+ const detail = ref();
124
+
125
+ const todoType = ref(null);
126
+ const userModal = ref(false);
127
+ const drawerVisible = ref(false);
128
+ const loading = ref(false);
129
+ const users = ref([]);
130
+
131
+ const approvalModalVisible = ref(false);
132
+ const approvalData = reactive({
133
+ id: "",
134
+ refid: ""
135
+ });
136
+
137
+
138
+ /**
139
+ * 显示详情
140
+ * @param params
141
+ */
142
+ const show = (params = {}) => {
143
+ emit("update:data",params);
144
+ emit("update:modelValue", true);
145
+ };
146
+
147
+ /** 更新modelValue */
148
+ const updateModelValue = (value) => {
149
+ emit("update:modelValue", value);
150
+ };
151
+
152
+ /**
153
+ * 打开抽屉
154
+ */
155
+ const open = async () => {
156
+ const { id, refid } = props.data;
157
+ if (id && refid) {
158
+ await getDetail({ refid, id });
159
+ } else {
160
+ EleMessage.error("缺少id或refid参数");
161
+ }
162
+ };
163
+
164
+ /**
165
+ * 关闭抽屉
166
+ */
167
+ const close = () => {
168
+ active.value = "form";
169
+ emit("close");
170
+ };
171
+
172
+ /**
173
+ * 获取详情
174
+ * @param params
175
+ */
176
+ const getDetail = async (params) => {
177
+ loading.value = true;
178
+ const res = await getTodoDetail(params);
179
+ loading.value = false;
180
+ if (res) {
181
+ detail.value = res;
182
+ } else {
183
+ EleMessage.error("获取详情失败");
184
+ }
185
+ };
186
+
187
+ /**
188
+ * 更多操作按钮
189
+ */
190
+ const getMore = computed(() => {
191
+ const exclude = ["agree", "reject", "batchAgree", "batchReject", "submit"];
192
+ return Object.entries(moreOption)
193
+ .filter(([key]) => !exclude.includes(key) && permission.hasPermission(buttonAuth[key]))
194
+ ?.map(([key, value]) => ({ title: value, command: key }));
195
+ });
196
+
197
+ /**
198
+ * 同意、拒绝弹窗
199
+ * @param type
200
+ */
201
+ const openModal = (type) => {
202
+ todoType.value = type;
203
+ const id = props.data.id;
204
+ Object.assign(approvalData, {
205
+ id: id,
206
+ refid: props.data.refid
207
+ });
208
+ approvalModalVisible.value = true;
209
+ };
210
+
211
+ /**
212
+ * 选择用户弹窗
213
+ */
214
+ const openUserModal = () => {
215
+ users.value = todoType.value === "delegate" ? "" : [];
216
+ };
217
+
218
+ /**
219
+ * 更多操作
220
+ * @param type 类型
221
+ * @param row
222
+ */
223
+ const onOperate = (type) => {
224
+ todoType.value = type;
225
+
226
+ // 委派、加签、减签
227
+ if (["delegate", "addSign", "removeSign"].includes(type)) {
228
+ userModal.value = true;
229
+ return false;
230
+ }
231
+
232
+ let data = {
233
+ taskId: props.data.taskId
234
+ };
235
+ // 跳转
236
+ if (type === "jump") {
237
+ data.nodeKey = props.data.nodeKey;
238
+ }
239
+
240
+ ElMessageBox.confirm(`确定要${moreOption[type]}吗?`, "系统提示", {
241
+ type: "danger",
242
+ draggable: false
243
+ })
244
+ .then(async () => {
245
+ save(type, data);
246
+ })
247
+ .catch((e) => {
248
+ });
249
+ };
250
+
251
+ // 更新table
252
+ const done = () => {
253
+ updateModelValue(false);
254
+ emit("reload");
255
+ };
256
+
257
+ /**
258
+ * 委派,加签,减签保存
259
+ * @param type
260
+ */
261
+ const saveByUser = (type) => {
262
+ save(type, {
263
+ id: props.data.id,
264
+ [type === "delegate" ? "userId" : "users"]: users.value
265
+ });
266
+ };
267
+
268
+ /**
269
+ * 保存
270
+ * @param type
271
+ * @param data
272
+ */
273
+ const save = (type, data) => {
274
+ loading.value = true;
275
+ todoOperate(type, data)
276
+ .then((msg) => {
277
+ loading.value = false;
278
+ EleMessage.success(msg);
279
+ done();
280
+ if (type == "agree" || type == "reject") {
281
+ todoDrawerRef.value?.closeModal();
282
+ }
283
+ if (["delegate", "addSign", "removeSign"].includes(type)) {
284
+ userModal.value = false;
285
+ }
286
+ })
287
+ .catch((e) => {
288
+ loading.value = false;
289
+ EleMessage.error(e.message);
290
+ });
291
+ };
292
+
293
+ defineExpose({
294
+ show,
295
+ close
296
+ });
297
+ watch(
298
+ () => props.modelValue,
299
+ (val) => {
300
+ drawerVisible.value = val;
301
+ emit("update:showOpera",false);
302
+ //获取可审批的任务
303
+ SohelpHttp.get("/engine/web/workflow/getMyTasks", { refid: props.data.refid, id: props.data.id }).then(res => {
304
+ if (res.meta.success) {
305
+ // emit("update:showOpera",res.data.length > 0)
306
+ }
307
+ });
308
+ }
309
+ );
310
+ </script>
311
+ <style lang="scss" scoped></style>
@@ -0,0 +1,119 @@
1
+ export const moreOption = {
2
+ agree: '同意',
3
+ reject: '拒绝',
4
+ submit: '提交申批',
5
+ batchAgree: '批量同意',
6
+ batchReject: '批量拒绝',
7
+ reclaim: '撤回',
8
+ delegate: '委派',
9
+ complete: '终止',
10
+ addSign: '加签',
11
+ removeSign: '减签',
12
+ jump: '跳转',
13
+ jumpPrevious: '返回上一步',
14
+ jumpFirst: '退回发起人'
15
+ };
16
+
17
+ export const buttonAuth = {
18
+ agree: 'todo.wf.agree',
19
+ reject: 'todo.wf.reject',
20
+ submit: 'todo.wf.submit',
21
+ reclaim: 'todo.wf.reclaim',
22
+ delegate: 'todo.wf.delegate',
23
+ complete: 'todo.wf.complete',
24
+ addSign: 'todo.wf.add-sign',
25
+ removeSign: 'todo.wf.remove-sign',
26
+ jump: 'todo.wf.jump',
27
+ jumpPrevious: 'todo.wf.jump-previous',
28
+ jumpFirst: 'todo.wf.jump-first'
29
+ }
30
+
31
+ /**
32
+ * 待办分页列表
33
+ * @param params customer_no
34
+ */
35
+ export async function getTodoPage(params) {
36
+ const res = await SohelpHttp.get(`/engine/web/workflow/pageByTodo`, params);
37
+ if (res.meta.success) {
38
+ return res.data;
39
+ }
40
+ return Promise.reject(new Error(res.meta.message));
41
+ }
42
+
43
+ /**
44
+ * 已办分页列表
45
+ * @param params customer_no
46
+ */
47
+ export async function getHisTaskPage(params) {
48
+ const res = await SohelpHttp.get(`/engine/web/workflow/pageByHisTask`, params);
49
+ if (res.meta.success) {
50
+ return res.data;
51
+ }
52
+ return Promise.reject(new Error(res.meta.message));
53
+ }
54
+
55
+ /**
56
+ * 待办 操作
57
+ * @param {*} type 类型 moreOption
58
+ * @param {*} params
59
+ * @returns
60
+ */
61
+
62
+ export async function todoOperate(type, params) {
63
+ const res = await SohelpHttp.post(`/engine/web/workflow/${type}`, params);
64
+ if (res.meta.success) {
65
+ return res.meta.message;
66
+ }
67
+ return Promise.reject(new Error(res.meta.message));
68
+ }
69
+
70
+ /**
71
+ * 获取待办详情
72
+ * @param {refid} params
73
+ * @param {id} params
74
+ * @returns
75
+ */
76
+ export async function getTodoDetail(params) {
77
+ const res = await SohelpHttp.get(`/engine/web/crud/detail`, params);
78
+ if (res.meta.success) {
79
+ return res.data;
80
+ }
81
+ return Promise.reject(new Error(res.meta.message));
82
+ }
83
+
84
+ /**
85
+ * 获取工作流
86
+ * @param {id,refid}
87
+ * @returns
88
+ */
89
+ export async function getWorkflow(params) {
90
+ const res = await SohelpHttp.get(`/engine/web/workflow/getProcess`, params);
91
+ if (res.meta.success) {
92
+ return res.data;
93
+ }
94
+ return Promise.reject(new Error(res.meta.message));
95
+ }
96
+
97
+ /**
98
+ * 获取历史任务
99
+ * @param {id,refid}
100
+ * @returns
101
+ */
102
+ export async function getTasks(params) {
103
+ const res = await SohelpHttp.get(`/engine/web/workflow/getTasks`, params);
104
+ if (res.meta.success) {
105
+ return res.data;
106
+ }
107
+ return Promise.reject(new Error(res.meta.message));
108
+ }
109
+
110
+ /**
111
+ * 已阅
112
+ */
113
+ export async function readByCc(taskId) {
114
+ const res = await SohelpHttp.post(`/engine/web/workflow/readByCc`, { taskId });
115
+ if (res.meta.success) {
116
+ return res.meta.message;
117
+ }
118
+ return Promise.reject(new Error(res.meta.message));
119
+ }
File without changes