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,310 @@
1
+ <template>
2
+ <div class="list-box">
3
+ <div class="list-item">
4
+ <ele-card
5
+ bordered
6
+ header="未分配"
7
+ :body-style="{
8
+ padding: '0',
9
+ overflowY: 'auto',
10
+ height: 'calc(100% - 50px)'
11
+ }"
12
+ :header-style="{
13
+ background: '#f7f7f7',
14
+ border: '1px solid #e8e8e8'
15
+ }"
16
+ class="list-card"
17
+ >
18
+ <ele-table ref="unAllocatedRef" class="demo-table">
19
+ <thead style="position: sticky; top: 0; z-index: 9">
20
+ <tr>
21
+ <th style="width: 40px"
22
+ ><el-checkbox
23
+ v-model="unAllocatedChecked"
24
+ @change="unAllocatedChange"
25
+ ></el-checkbox
26
+ ></th>
27
+ <th style="width: 40px"></th>
28
+ <th>属性</th>
29
+ <th>属性描述</th>
30
+ </tr>
31
+ </thead>
32
+ <vue-draggable
33
+ tag="tbody"
34
+ item-key="id"
35
+ :animation="300"
36
+ :modelValue="unAllocatedDatasource"
37
+ :force-fallback="true"
38
+ group="demoDragTable"
39
+ handle=".drag-handle"
40
+ :set-data="() => void 0"
41
+ >
42
+ <template #item="{ element }">
43
+ <tr>
44
+ <td
45
+ ><el-checkbox
46
+ v-model="unAllocatedSelection"
47
+ :label="element"
48
+ >
49
+ <template #default></template></el-checkbox
50
+ ></td>
51
+ <td>
52
+ <ele-text
53
+ :icon="DragOutlined"
54
+ type="placeholder"
55
+ class="drag-handle"
56
+ style="cursor: move"
57
+ />
58
+ </td>
59
+ <td>{{ element }}</td>
60
+ <td>{{ propertiesOriginData[element] }}</td>
61
+ </tr>
62
+ </template>
63
+ <template #footer v-if="!unAllocatedDatasource.length">
64
+ <tr>
65
+ <td colspan="4" style="text-align: center; background: none">
66
+ <ele-text type="placeholder">暂无数据</ele-text>
67
+ </td>
68
+ </tr>
69
+ </template>
70
+ </vue-draggable>
71
+ </ele-table>
72
+ </ele-card>
73
+ </div>
74
+ <div class="list-item">
75
+ <el-button
76
+ :icon="ArrowLeft"
77
+ type="primary"
78
+ @click="unAllocatedHandle"
79
+ :disabled="!allocatedSelection.length"
80
+ ></el-button>
81
+ <el-button
82
+ :icon="ArrowRight"
83
+ type="primary"
84
+ @click="allocatedHandle"
85
+ :disabled="!unAllocatedSelection.length"
86
+ ></el-button>
87
+ </div>
88
+ <div class="list-item"
89
+ ><ele-card
90
+ header="已分配"
91
+ bordered
92
+ :body-style="{
93
+ padding: '0',
94
+ overflowY: 'auto',
95
+ height: 'calc(100% - 50px)'
96
+ }"
97
+ :header-style="{
98
+ background: '#f7f7f7',
99
+ border: '1px solid #e8e8e8'
100
+ }"
101
+ class="list-card"
102
+ >
103
+ <ele-table class="demo-table" ref="allocatedRef">
104
+ <thead style="position: sticky; top: 0; z-index: 9">
105
+ <tr>
106
+ <th style="width: 40px">
107
+ <el-checkbox
108
+ v-model="allocatedChecked"
109
+ @change="allocatedChange"
110
+ ></el-checkbox>
111
+ </th>
112
+ <th style="width: 40px"></th>
113
+ <th>属性</th>
114
+ <th>属性描述</th>
115
+ </tr>
116
+ </thead>
117
+ <vue-draggable
118
+ tag="tbody"
119
+ item-key="id"
120
+ :animation="300"
121
+ :modelValue="modelValue"
122
+ :force-fallback="true"
123
+ group="demoDragTable"
124
+ handle=".drag-handle"
125
+ :set-data="() => void 0"
126
+ @update:modelValue="(value) => updateAllocated(value)"
127
+ >
128
+ <template #item="{ element }">
129
+ <tr>
130
+ <td
131
+ ><el-checkbox
132
+ v-model="allocatedSelection"
133
+ :label="element"
134
+ ></el-checkbox
135
+ ></td>
136
+ <td>
137
+ <ele-text
138
+ :icon="DragOutlined"
139
+ type="placeholder"
140
+ class="drag-handle"
141
+ style="cursor: move"
142
+ />
143
+ </td>
144
+ <td>{{ element }}</td>
145
+ <td>{{ propertiesOriginData[element] }}</td>
146
+ </tr>
147
+ </template>
148
+ <template #footer v-if="!modelValue.length">
149
+ <tr>
150
+ <td colspan="4" style="text-align: center; background: none">
151
+ <ele-text type="placeholder">暂无数据</ele-text>
152
+ </td>
153
+ </tr>
154
+ </template>
155
+ </vue-draggable>
156
+ </ele-table>
157
+ </ele-card>
158
+ </div>
159
+ </div>
160
+ </template>
161
+
162
+ <script setup>
163
+ import { ref, watch, computed } from 'vue';
164
+ import VueDraggable from 'vuedraggable';
165
+ import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
166
+ import { DragOutlined } from '@/components/icons';
167
+
168
+ const props = defineProps({
169
+ modelValue: {
170
+ type: Array,
171
+ default: () => []
172
+ },
173
+ properties: {
174
+ type: Array,
175
+ default: () => []
176
+ }
177
+ });
178
+
179
+ const emit = defineEmits(['update:modelValue']);
180
+
181
+ // 未分配
182
+ const unAllocatedChecked = ref(false);
183
+ const unAllocatedRef = ref(null);
184
+ const unAllocatedSelection = ref([]);
185
+
186
+ const propertiesData = ref([]);
187
+ const propertiesOriginData = ref({});
188
+
189
+ const unAllocatedDatasource = computed(() => {
190
+ return propertiesData.value.filter(
191
+ (item) => !props.modelValue.includes(item)
192
+ );
193
+ });
194
+
195
+ // 已分配
196
+ const allocatedChecked = ref(false);
197
+ const allocatedRef = ref(null);
198
+ const allocatedSelection = ref([]);
199
+
200
+ // 未分配全选
201
+ const unAllocatedChange = (val) => {
202
+ unAllocatedSelection.value = val ? unAllocatedDatasource.value : [];
203
+ };
204
+ // 已分配全选
205
+ const allocatedChange = (val) => {
206
+ allocatedSelection.value = val ? props.modelValue : [];
207
+ };
208
+
209
+ const updateAllocated = (value) => {
210
+ emit('update:modelValue', value);
211
+ };
212
+
213
+ const allocatedHandle = () => {
214
+ if (unAllocatedSelection.value.length > 0) {
215
+ emit('update:modelValue', [
216
+ ...props.modelValue,
217
+ ...unAllocatedSelection.value
218
+ ]);
219
+ unAllocatedSelection.value = [];
220
+ }
221
+ unAllocatedChecked.value = false;
222
+ };
223
+
224
+ const unAllocatedHandle = () => {
225
+ if (allocatedSelection.value.length > 0) {
226
+ emit(
227
+ 'update:modelValue',
228
+ props.modelValue.filter(
229
+ (item) => !allocatedSelection.value.includes(item)
230
+ )
231
+ );
232
+ allocatedSelection.value = [];
233
+ }
234
+ allocatedChecked.value = false;
235
+ };
236
+
237
+ watch(
238
+ () => props.properties,
239
+ (val) => {
240
+ if (val?.length > 0) {
241
+ propertiesData.value = val.map((item) => item.name);
242
+ propertiesOriginData.value = val.reduce((acc, item) => {
243
+ acc[item.name] = item.label;
244
+ return acc;
245
+ }, {});
246
+ }
247
+ },
248
+ {
249
+ immediate: true
250
+ }
251
+ );
252
+ </script>
253
+
254
+ <style lang="scss" scoped>
255
+ .list-box {
256
+ width: 1000px;
257
+ height: calc(100% - 2px);
258
+ overflow-x: auto;
259
+ overflow-y: hidden;
260
+ display: flex;
261
+ gap: 10px;
262
+
263
+ .list-item {
264
+ height: 100%;
265
+ width: 47%;
266
+ overflow: hidden;
267
+ max-width: 500px;
268
+ .list-card {
269
+ height: 100%;
270
+ overflow: hidden;
271
+ }
272
+ }
273
+
274
+ .list-item:nth-child(2) {
275
+ width: 6%;
276
+ min-width: 60px;
277
+ display: flex;
278
+ flex-direction: column;
279
+ align-items: center;
280
+ justify-content: center;
281
+ }
282
+ }
283
+
284
+ .el-button {
285
+ margin: 10px 0!important;
286
+ }
287
+ .demo-table {
288
+ .drag-handle {
289
+ color: #333;
290
+ }
291
+
292
+ tr.sortable-chosen {
293
+ user-select: none;
294
+ }
295
+
296
+ tr.sortable-ghost {
297
+ opacity: 0;
298
+ }
299
+
300
+ tr.sortable-fallback {
301
+ opacity: 1 !important;
302
+ display: table !important;
303
+
304
+ td {
305
+ background: var(--el-color-primary-light-8);
306
+ border-radius: 0 !important;
307
+ }
308
+ }
309
+ }
310
+ </style>
@@ -0,0 +1,206 @@
1
+ <template>
2
+ <ele-modal
3
+ form
4
+ width="1200px"
5
+ :minWidth="600"
6
+ height="70vh"
7
+ :minHeight="300"
8
+ v-model="configVisible"
9
+ title="筛选配置"
10
+ class="grid-config"
11
+ @close="close"
12
+ :bodyStyle="{ height: '70vh', overflowY: 'auto' }"
13
+ v-loading="loading"
14
+ >
15
+ <ele-card class="grid-filter-card" :bodyStyle="{ height: '100%', padding: '10px 0 0' }" v-if="filterConfig">
16
+ <ele-tabs v-model="gridActiveTab" :items="gridTabs" tabPosition="left" class="f-tabs" :key="tabsKey">
17
+ <template #list>
18
+ <grid-filter-list v-model="filterConfig.list" :properties="propertiesArray"></grid-filter-list>
19
+ </template>
20
+
21
+ <template #field>
22
+ <grid-filter-field v-model="filterConfig.filter.field" :properties="propertiesArray"></grid-filter-field>
23
+ </template>
24
+
25
+ <template #sort>
26
+ <grid-filter-sort v-model="filterConfig.filter.sort" :properties="propertiesArray"></grid-filter-sort>
27
+ </template>
28
+ <template #keywords>
29
+ <grid-filter-keywords
30
+ v-model="filterConfig.filter.keywords"
31
+ :properties="propertiesArray"
32
+ ></grid-filter-keywords>
33
+ </template>
34
+ <template #scheme>
35
+ <grid-filter-scheme
36
+ v-model="filterConfig.filter.scheme"
37
+ :properties="propertiesArray"
38
+ ></grid-filter-scheme>
39
+ </template>
40
+ <template #config>
41
+ <grid-filter-config v-model="filterConfig"></grid-filter-config>
42
+ </template>
43
+ </ele-tabs>
44
+ </ele-card>
45
+
46
+ <template #footer>
47
+ <el-button @click="close">取消</el-button>
48
+ <el-button type="primary" @click="save">确认</el-button>
49
+ </template>
50
+ </ele-modal>
51
+ </template>
52
+ <script setup>
53
+ import { defineProps, onMounted, ref, watch } from "vue";
54
+
55
+ import GridFilterField from './grid-filter-field.vue';
56
+ import GridFilterSort from './grid-filter-sort.vue';
57
+ import GridFilterKeywords from './grid-filter-keywords.vue';
58
+ import GridFilterScheme from './grid-filter-scheme.vue';
59
+ import GridFilterList from './grid-filter-list.vue';
60
+ import GridFilterConfig from './grid-filter-config.vue';
61
+
62
+ import { moduleCache } from '@/components/sohelp-eleplus/cache/ModuleCache.js';
63
+ import { EleMessage } from '@/components/ele-admin-plus/components';
64
+ const props = defineProps({
65
+ modelValue: Boolean,
66
+ config: Object
67
+ });
68
+
69
+ const emit = defineEmits(['done', 'update:modelValue']);
70
+
71
+ const loading = ref(false);
72
+ const configVisible = ref(props.modelValue);
73
+ const filterConfig = ref();
74
+ const originFilterConfigValue = ref(null);
75
+ const tabsKey = ref(0);
76
+ const propertiesArray = ref([]);
77
+
78
+
79
+ const gridActiveTab = ref('list');
80
+ const gridTabs = [
81
+ {
82
+ name: 'list',
83
+ label: '列表显示'
84
+ },
85
+ {
86
+ name: 'field',
87
+ label: '高级筛选'
88
+ },
89
+ {
90
+ name: 'sort',
91
+ label: '字段排序'
92
+ },
93
+ {
94
+ name: 'keywords',
95
+ label: '关键字搜索'
96
+ },
97
+ {
98
+ name: 'scheme',
99
+ label: '筛选场景'
100
+ },{
101
+ name: 'config',
102
+ label: '基本配置'
103
+ }
104
+ ];
105
+
106
+ watch(
107
+ () => props.modelValue,
108
+ (val) => {
109
+ configVisible.value = val;
110
+ gridActiveTab.value = 'list';
111
+ tabsKey.value++;
112
+ },
113
+ {
114
+ immediate: true
115
+ }
116
+ );
117
+
118
+ onMounted(()=>{
119
+ originFilterConfigValue.value = JSON.parse(JSON.stringify(props.config));
120
+ propertiesArray.value = props.config?.properties
121
+ ?.map(({ name, label, hidden }) => {
122
+ if (!hidden && !name.startsWith('_') && !name.endsWith('flw_id')) {
123
+ return {
124
+ name: name,
125
+ label: label
126
+ };
127
+ }
128
+ })
129
+ .filter(Boolean);
130
+ filterConfig.value = JSON.parse(JSON.stringify(props.config));
131
+ });
132
+
133
+ // watch(
134
+ // () => props.config,
135
+ // (val) => {
136
+ // originFilterConfigValue.value = JSON.parse(JSON.stringify(val));
137
+ // propertiesArray.value = val?.properties
138
+ // ?.map(({ name, label, hidden }) => {
139
+ // if (!hidden) {
140
+ // return {
141
+ // name: name,
142
+ // label: label
143
+ // };
144
+ // }
145
+ // })
146
+ // .filter(Boolean);
147
+ // filterConfig.value = JSON.parse(JSON.stringify(val));
148
+ // },
149
+ // {
150
+ // deep: true
151
+ // }
152
+ // );
153
+
154
+ const close = () => {
155
+ filterConfig.value = { ...originFilterConfigValue.value };
156
+ emit('update:modelValue', false);
157
+ };
158
+
159
+ const save = async () => {
160
+ loading.value = true;
161
+ const res = await moduleCache.saveFilterFields(filterConfig.value).catch((e) => {
162
+ EleMessage.error(e?.message || 'error');
163
+ });
164
+ loading.value = false;
165
+ if (res.meta.success) {
166
+ emit('update:modelValue', false);
167
+ moduleCache.clear();
168
+ emit('done',filterConfig.value);
169
+ EleMessage.success(res?.meta.message || '操作成功');
170
+ } else {
171
+ EleMessage.error(res?.meta.message || '操作成功');
172
+ }
173
+ };
174
+ </script>
175
+
176
+ <style lang="scss" scoped>
177
+ .f-tabs {
178
+ height: 100%;
179
+
180
+ :deep(.el-tabs__content) {
181
+ border-left: 1px solid #ccc;
182
+ padding: 0 20px 0 20px !important;
183
+ height: calc(100% - 2px) !important;
184
+
185
+ & .el-tab-pane {
186
+ height: calc(100% - 2px);
187
+ overflow-x: auto;
188
+ }
189
+ }
190
+
191
+ :deep(.el-tabs__item) {
192
+ margin-left: 10px !important;
193
+ }
194
+
195
+ :deep(.ele-tab-title) {
196
+ padding-right: 20px !important;
197
+ }
198
+ }
199
+
200
+ .grid-filter-card {
201
+ height: 100%;
202
+ min-height: 300px;
203
+ width: 100%;
204
+ overflow: hidden;
205
+ }
206
+ </style>