olp-table 5.3.1 → 5.3.4

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 (171) hide show
  1. package/.env.build +1 -0
  2. package/README.md +26 -0
  3. package/babel.config.js +5 -0
  4. package/jsconfig.json +22 -0
  5. package/{olp-table.common.js → olp-table/olp-table.common.js} +5 -5
  6. package/{olp-table.umd.js → olp-table/olp-table.umd.js} +5 -5
  7. package/{olp-table.umd.min.js → olp-table/olp-table.umd.min.js} +3 -3
  8. package/package.json +92 -12
  9. package/public/favicon.ico +0 -0
  10. package/public/index.html +17 -0
  11. package/rmMode.bat +1 -0
  12. package/src/App.vue +199 -0
  13. package/src/api/crud.js +22 -0
  14. package/src/api/dist.js +6 -0
  15. package/src/assets/iconfont/iconfont.css +20 -0
  16. package/src/assets/iconfont/iconfont.json +16 -0
  17. package/src/assets/iconfont/iconfont.ttf +0 -0
  18. package/src/assets/iconfont/iconfont.woff +0 -0
  19. package/src/assets/iconfont/iconfont.woff2 +0 -0
  20. package/src/assets/logo.png +0 -0
  21. package/src/components/auto-height/index.vue +75 -0
  22. package/src/components/codemirror-tag.vue +100 -0
  23. package/src/components/lazy-load-select.vue +107 -0
  24. package/src/components/ol-dialog-excel.vue +112 -0
  25. package/src/components/ol-dialog-import.vue +304 -0
  26. package/src/components/ol-dialog-json.vue +82 -0
  27. package/src/components/ol-dialog-table.vue +81 -0
  28. package/src/components/ol-dialog-upload-file.vue +208 -0
  29. package/src/components/ol-dict-tag.vue +271 -0
  30. package/src/components/ol-select-dom.vue +71 -0
  31. package/src/components/ol-table-filter.vue +28 -0
  32. package/src/components/ol-table-render.vue +44 -0
  33. package/src/components/ol-table-select.vue +150 -0
  34. package/src/components/pinia-init.vue +18 -0
  35. package/src/components/table/model/ModelMixins.js +43 -0
  36. package/src/components/table/model/model-index.vue +121 -0
  37. package/src/components/table/model/ot-left-right.vue +18 -0
  38. package/src/components/table/model/ot-left-tree-right-table.scss +14 -0
  39. package/src/components/table/model/ot-left-tree-right-table.vue +41 -0
  40. package/src/components/table/model/ot-top-1-bottom-2.vue +39 -0
  41. package/src/components/table/model/ot-top-2-bottom-1.vue +38 -0
  42. package/src/components/table/model/ot-top-2-bottom-2.vue +38 -0
  43. package/src/components/table/model/ot-top-bottom.vue +18 -0
  44. package/src/components/table/model/splitpanesModel.css +22 -0
  45. package/src/components/table/model/splitpanesModel.vue +54 -0
  46. package/src/components/table/ol-form/index.vue +537 -0
  47. package/src/components/table/ol-form-v3/index.vue +455 -0
  48. package/src/components/table/ol-main-form-sub-table/index.vue +601 -0
  49. package/src/components/table/ol-pager/index.vue +46 -0
  50. package/src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue +233 -0
  51. package/src/components/table/ol-table/components/ol-table-column-config/index.vue +145 -0
  52. package/src/components/table/ol-table/components/ol-table-column-dict-color/index.vue +88 -0
  53. package/src/components/table/ol-table/index.vue +232 -0
  54. package/src/components/table/ol-table-operate/index.vue +61 -0
  55. package/src/components/table/ol-table-search/index.vue +17 -0
  56. package/src/components/table/ol-table-tool-btn/index.vue +60 -0
  57. package/src/components/tree/components/o-tree.vue +289 -0
  58. package/src/components/tree/index.vue +46 -0
  59. package/src/components/v-component/index.vue +43 -0
  60. package/src/config/dev-config.js +5 -0
  61. package/src/config/prod-config.js +5 -0
  62. package/src/config/shared-config.js +20 -0
  63. package/src/data.js +9378 -0
  64. package/src/directives/permission/hasPermi.js +63 -0
  65. package/src/directives/permission/hasRole.js +30 -0
  66. package/src/main.js +55 -0
  67. package/src/mixins/VTMixin/DefaultMethods.js +749 -0
  68. package/src/mixins/VTMixin/OTMixinBody.js +105 -0
  69. package/src/mixins/VTMixin/OTMixinBodyFooter.js +93 -0
  70. package/src/mixins/VTMixin/OTMixinBodyMethods.js +420 -0
  71. package/src/mixins/VTMixin/OTMixinColumnMethod.js +450 -0
  72. package/src/mixins/VTMixin/OTMixinInitMethod.js +130 -0
  73. package/src/mixins/VTMixin/OTMixinPager.js +38 -0
  74. package/src/mixins/VTMixin/OTMixinSortable.js +43 -0
  75. package/src/mixins/VTMixin/index.js +18 -0
  76. package/src/package/index.js +20 -0
  77. package/src/plugins/axios.js +61 -0
  78. package/src/store/dict.js +76 -0
  79. package/src/store/dictType.js +52 -0
  80. package/src/store/permi.js +45 -0
  81. package/src/styles/common.scss +37 -0
  82. package/src/styles/index.scss +48 -0
  83. package/src/styles/theme.scss +32 -0
  84. package/src/utils/AESCRUDUtils.js +87 -0
  85. package/src/utils/DateUtils.js +35 -0
  86. package/src/utils/ExcelUtil.js +159 -0
  87. package/src/utils/TableSortUtil.js +91 -0
  88. package/src/utils/columnProp.js +3 -0
  89. package/src/utils/groupCompute.js +68 -0
  90. package/src/utils/http/httpFactory.js +92 -0
  91. package/src/utils/http/httpFactory2.js +79 -0
  92. package/src/utils/http/httpUtil.js +123 -0
  93. package/src/utils/http/httpUtils.js +38 -0
  94. package/src/utils/loadStyle.js +14 -0
  95. package/src/utils/message.js +56 -0
  96. package/src/utils/object.js +80 -0
  97. package/src/utils/security/TokenUtil.js +19 -0
  98. package/src/utils/tree.js +54 -0
  99. package/src/utils/util.js +127 -0
  100. package/src/views/Test/index.vue +77 -0
  101. package/src/views/Test/index2.vue +33 -0
  102. package/src/views/components/btn-config/index.vue +202 -0
  103. package/src/views/components/option-config/index.vue +192 -0
  104. package/src/views/db/chineseToEnglish.vue +127 -0
  105. package/src/views/db/filed.vue +395 -0
  106. package/src/views/db/index.vue +192 -0
  107. package/src/views/db/preview/index.vue +139 -0
  108. package/src/views/db/preview/left.vue +204 -0
  109. package/src/views/db/preview/right.vue +466 -0
  110. package/src/views/groupTable/index.vue +137 -0
  111. package/src/views/groupTable/ol-table-column-config/columnIndex.vue +194 -0
  112. package/src/views/groupTable/ol-table-column-config/index.vue +92 -0
  113. package/src/views/table/add-or-edit/config/base-config/index.vue +539 -0
  114. package/src/views/table/add-or-edit/config/base-config/table-form.vue +333 -0
  115. package/src/views/table/add-or-edit/config/column-config/header-config.vue +475 -0
  116. package/src/views/table/add-or-edit/config/column-config/index.vue +790 -0
  117. package/src/views/table/add-or-edit/config/data/column.js +218 -0
  118. package/src/views/table/add-or-edit/config/data/crud.js +122 -0
  119. package/src/views/table/add-or-edit/config/data/events.js +109 -0
  120. package/src/views/table/add-or-edit/config/data/method.js +127 -0
  121. package/src/views/table/add-or-edit/config/data/option.js +725 -0
  122. package/src/views/table/add-or-edit/config/data/page.js +79 -0
  123. package/src/views/table/add-or-edit/config/field-config/filed-config-table.vue +42 -0
  124. package/src/views/table/add-or-edit/config/field-config/index.vue +91 -0
  125. package/src/views/table/add-or-edit/config/form-config/index.vue +1179 -0
  126. package/src/views/table/add-or-edit/config/index.vue +376 -0
  127. package/src/views/table/add-or-edit/config/initFormObject.js +25 -0
  128. package/src/views/table/add-or-edit/config/script-config/LeftMeun.vue +71 -0
  129. package/src/views/table/add-or-edit/config/script-config/index.vue +70 -0
  130. package/src/views/table/add-or-edit/config/table-config/btn-config.vue +340 -0
  131. package/src/views/table/add-or-edit/config/table-config/btn-sort.vue +132 -0
  132. package/src/views/table/add-or-edit/config/table-config/index.vue +446 -0
  133. package/src/views/table/add-or-edit/configOld/dataTags/filed-config-table-model.vue +41 -0
  134. package/src/views/table/add-or-edit/configOld/dataTags/filed-config.vue +74 -0
  135. package/src/views/table/add-or-edit/configOld/dataTags/index.vue +439 -0
  136. package/src/views/table/add-or-edit/configOld/dataTags/set-table-sql.vue +79 -0
  137. package/src/views/table/add-or-edit/configOld/dataTags/table-on-config.vue +74 -0
  138. package/src/views/table/add-or-edit/configOld/index.vue +127 -0
  139. package/src/views/table/add-or-edit/configOld/tableTags/columnConfig.js +5 -0
  140. package/src/views/table/add-or-edit/configOld/tableTags/index.vue +353 -0
  141. package/src/views/table/add-or-edit/configOld/tableTags/operation-but-config.vue +75 -0
  142. package/src/views/table/add-or-edit/configOld/tableTags/tool-but-config.vue +92 -0
  143. package/src/views/table/add-or-edit/index.vue +201 -0
  144. package/src/views/table/add-or-edit/themeModel/index.vue +53 -0
  145. package/src/views/table/add-or-edit/themeModel/init-model-table.vue +48 -0
  146. package/src/views/table/add-or-edit/themeModel/init-model.vue +81 -0
  147. package/src/views/table/add-or-edit/themeModel/left-right.vue +24 -0
  148. package/src/views/table/add-or-edit/themeModel/left-tree-right-table.vue +75 -0
  149. package/src/views/table/add-or-edit/themeModel/olTableSearchModelMixins.js +42 -0
  150. package/src/views/table/add-or-edit/themeModel/splitpanesThemeModel.vue +49 -0
  151. package/src/views/table/add-or-edit/themeModel/top-1-bottom-2.vue +29 -0
  152. package/src/views/table/add-or-edit/themeModel/top-2-bottom-1.vue +32 -0
  153. package/src/views/table/add-or-edit/themeModel/top-2-bottom-2.vue +32 -0
  154. package/src/views/table/add-or-edit/themeModel/top-bottom.vue +14 -0
  155. package/src/views/table/index.vue +43 -0
  156. package/src/views/table/index2.vue +199 -0
  157. package/src/views/table/preview/index.vue +29 -0
  158. package/src/views/tree/components/config-core-data.vue +85 -0
  159. package/src/views/tree/components/config-core-table.vue +362 -0
  160. package/src/views/tree/components/config-core-tree/data/events.js +95 -0
  161. package/src/views/tree/components/config-core-tree/data/option.js +88 -0
  162. package/src/views/tree/components/config-core-tree/data/prop.js +28 -0
  163. package/src/views/tree/components/config-core-tree/index.vue +181 -0
  164. package/src/views/tree/components/config-core.vue +42 -0
  165. package/src/views/tree/components/form-config/index.vue +967 -0
  166. package/src/views/tree/index.vue +424 -0
  167. package/vue.config.js +44 -0
  168. /package/{demo.html → olp-table/demo.html} +0 -0
  169. /package/{fonts → olp-table/fonts}/iconfont.1720006583309.7e4906d9.woff +0 -0
  170. /package/{fonts → olp-table/fonts}/iconfont.1720006583309.947a27f0.ttf +0 -0
  171. /package/{olp-table.css → olp-table/olp-table.css} +0 -0
@@ -0,0 +1,455 @@
1
+ <template>
2
+ <el-dialog
3
+ v-model="state.dialogVisible"
4
+ :title="state.title"
5
+ align-center
6
+ destroy-on-close
7
+ :width="state.width"
8
+ v-loading="state.loading"
9
+ :close-on-click-modal="false"
10
+ >
11
+ <el-scrollbar :max-height="state.maxHeight" style="padding-right: 10px">
12
+ <avue-form v-if="state.type == '0'" :key="state.key" ref="formRef" :option="state.form"
13
+ v-model="state.formData"></avue-form>
14
+ <VFormRender v-else :form-json="state.form" :form-data="state.formData"
15
+ :option-data="state.optionData"
16
+ ref="formRef">
17
+ </VFormRender>
18
+ </el-scrollbar>
19
+ <template #footer>
20
+ <el-button @click="state.dialogVisible = false;">取 消</el-button>
21
+ <el-button type="primary" :loading="state.loading" @click="doSave">保 存</el-button>
22
+ </template>
23
+ </el-dialog>
24
+ </template>
25
+ <script>
26
+ export default {
27
+ name: "olForm",
28
+ };
29
+ </script>
30
+ <script scope setup>
31
+ import {defineExpose, reactive, nextTick, defineEmits, ref, inject, onMounted} from "vue";
32
+ import {storeDict} from "@/store/dict";
33
+ import {pinyin} from "pinyin-pro";
34
+ import {useMessage} from "@/utils/message";
35
+ import {get, post, put} from "@/utils/http/httpUtils";
36
+ import {handleTree} from "@/utils/tree";
37
+ import {initDictTable} from "@/api/dist";
38
+ import {setArrayObjectKeyValue} from "@/utils/object";
39
+
40
+ const dict = storeDict();
41
+ onMounted(() => {
42
+ dict.init(http)
43
+ })
44
+ const events = ['change'];
45
+ const olPinyin = pinyin;
46
+ const http = inject("http")
47
+ const olMsg = useMessage() // 消息弹窗
48
+ const state = reactive({
49
+ key: 1,
50
+ loading: false,
51
+ fullscreen: false,
52
+ dialogVisible: false,
53
+ title: "",
54
+ width: '60%',
55
+ comCommit: true,
56
+ maxHeight: '400px',
57
+ type: '0',
58
+ edit: false,
59
+ form: {
60
+ column: []
61
+ },
62
+ saveUrl: '',
63
+ formData: {},
64
+ requestType: 'post',
65
+ updateKey: '',
66
+ theme: 't1',
67
+ tableConfigId: '',
68
+ optionData: {},
69
+ })
70
+ const formRef = ref()
71
+
72
+ const hideColumn = (prop) => {
73
+ setArrayObjectKeyValue(state.form.column, 'display', false, prop)
74
+ }
75
+ const showColumn = (prop) => {
76
+ setArrayObjectKeyValue(state.form.column, 'display', true, prop)
77
+ }
78
+
79
+ function getParams() {
80
+ let params = {
81
+ tableConfigId: state.tableConfigId,
82
+ columnAndValueMap: {},
83
+ };
84
+
85
+ if (state.type != '0') {
86
+ let formData = formRef.value.getFormData(false);
87
+ for (let prop of Object.keys(formData)) {
88
+ let value = formData[prop];
89
+ if (value instanceof String) {
90
+ value = value.trim();
91
+ }
92
+ params.columnAndValueMap[prop] = value;
93
+ }
94
+ } else {
95
+ for (let {prop} of state.form.column) {
96
+ let value = state.formData[prop];
97
+ if (value) {
98
+ if (value instanceof String) {
99
+ value = value.trim();
100
+ }
101
+ params.columnAndValueMap[prop] = value;
102
+ }
103
+ }
104
+ }
105
+
106
+ if (state.saveUrl) {
107
+ return params.columnAndValueMap;
108
+ }
109
+ if (state.edit) {
110
+ params.whereMap = {}
111
+ if (state.updateKey) {
112
+ let split = state.updateKey.split(',');
113
+ for (let kv of split) {
114
+ let kvs = kv.split("=");
115
+ if (kvs.length == 2) {
116
+ params.whereMap[kvs[0]] = params.columnAndValueMap[kvs[1]]
117
+ delete params.columnAndValueMap[kvs[0]];
118
+ } else {
119
+ let val = params.columnAndValueMap[kvs];
120
+ params.whereMap[kvs] = val != undefined ? val : state.formData[kvs];
121
+ delete params.columnAndValueMap[kvs];
122
+ }
123
+ }
124
+ } else {
125
+ // 编辑时默认更新条件为id
126
+ params.whereMap['id'] = state.formData['id'];
127
+ if (!params.whereMap['id']) {
128
+ params.whereMap['id'] = state.formData['t1_id'];
129
+ }
130
+ delete params.columnAndValueMap['id'];
131
+ }
132
+ }
133
+ return params
134
+ }
135
+
136
+ async function doValidate() {
137
+ let dom = undefined;
138
+ let keys = [];
139
+ let status = true;
140
+ if (state.type != '0') {
141
+ await formRef.value.getNativeForm().validate((valid, msg) => {
142
+ if (!valid) {
143
+ keys = Object.keys(msg);
144
+ dom = formRef.value.getWidgetRef(keys[0]);
145
+ status = false;
146
+ }
147
+ })
148
+ } else {
149
+ await formRef.value.validate((valid, done, msg) => {
150
+ if (!valid) {
151
+ keys = Object.keys(msg);
152
+ dom = formRef.value.getPropRef(keys[0]);
153
+ status = false;
154
+ }
155
+ done()
156
+ })
157
+ }
158
+ if (dom) {
159
+ // 定位代码
160
+ dom.$el.scrollIntoView({
161
+ block: "center",
162
+ behavior: "smooth",
163
+ });
164
+ olMsg.error("您还有" + keys.length + "项信息未填写,请填写后再操作!");
165
+ status = false;
166
+ }
167
+ return status
168
+ }
169
+
170
+ async function doSave() {
171
+ let validate = await doValidate();
172
+ if (!validate) {
173
+ return
174
+ }
175
+ state.loading = true;
176
+ try {
177
+ let params = getParams()
178
+ let url = state.saveUrl ? state.saveUrl : state.edit ? '/online/crud/modify' : '/online/crud/save'
179
+ if (state.requestType.toLowerCase() == "put") {
180
+ await put(http, url, params).then(status => {
181
+ state.loading = false;
182
+ if (status) {
183
+ state.dialogVisible = false;
184
+ emits('query')
185
+ }
186
+ })
187
+ } else {
188
+ await post(http, url, params).then(status => {
189
+ state.loading = false;
190
+ if (status) {
191
+ state.dialogVisible = false;
192
+ emits('query')
193
+ }
194
+ })
195
+ }
196
+ } catch (e) {
197
+ console.error(e)
198
+ } finally {
199
+ state.loading = false;
200
+ }
201
+
202
+ }
203
+
204
+ function init(data) {
205
+ if (data.saveUrl) {
206
+ state.saveUrl = data.saveUrl.trim();
207
+ if (data.requestType) {
208
+ state.requestType = data.requestType;
209
+ }
210
+ }
211
+ state.key++;
212
+ state.edit = data['code'] == 'edit' == true;
213
+ state.title = data.title ? data.title : state.edit ? '编辑' : '新增';
214
+ //赋值弹窗宽度和高度
215
+ if (data.form.diaLogWidth) {
216
+ state.width = data.form.diaLogWidth
217
+ }
218
+ if (data.form.diaLogHeight) {
219
+ state.maxHeight = data.form.diaLogHeight + 'px'
220
+ }
221
+ if (data.form.title) {
222
+ state.title = data.form.title
223
+ }
224
+ state.dialogVisible = true
225
+ for (let key of Object.keys(state)) {
226
+ if (data[key]) {
227
+ state[key] = data[key]
228
+ }
229
+ }
230
+ if (state.type == 0) {
231
+ for (let column of state.form.column) {
232
+ if (column.disabled == 1) {
233
+ column.disabled = true;
234
+ }
235
+ initDict(column);
236
+ parseJson(column);
237
+ for (let event of events) {
238
+ if (column[event] && !(column[event] instanceof Function)) {
239
+ try {
240
+ column[event] = getFunction(column[event])
241
+ } catch (e) {
242
+ console.error(e)
243
+ }
244
+ }
245
+ }
246
+ }
247
+ }
248
+ }
249
+
250
+ function parseJson(column) {
251
+ let attrs = column.attrs;
252
+ if (attrs) {
253
+ try {
254
+ attrs = JSON.parse(attrs)
255
+ for (let key of Object.keys(attrs)) {
256
+ column[key] = attrs[key];
257
+ }
258
+ } catch (e) {
259
+ console.error("解析attrs异常", attrs)
260
+ }
261
+ }
262
+ }
263
+
264
+ function initDict(column) {
265
+ if (column.dictCode) {
266
+ column.dicData = dict.val(column.dictCode)
267
+ if (column.selectDom == 1) {
268
+ column.type = "select";
269
+ }
270
+ if (state.edit) {
271
+ return;
272
+ }
273
+ if (column.value != undefined) {
274
+ state.formData[column.prop] = String(column.value)
275
+ } else {
276
+ //”number”、”string”、”boolean”、”object”、”function” 和 “undefined”
277
+ let dataType = typeof (state.formData[column.prop]);
278
+ // 数据字典与值类型不一致
279
+ if (state.formData[column.prop] != undefined && state.formData[column.prop] != '' && ["number", "boolean"].indexOf(dataType) != -1) {
280
+ state.formData[column.prop] = String(state.formData[column.prop])
281
+ column.value = state.formData[column.prop];
282
+ } else if (state.formData[column.prop] == undefined) {
283
+ setTimeout(() => {
284
+ if (column.dicData) {
285
+ for (let dicDatum of column.dicData) {
286
+ if (dicDatum.isDefault == 1) {
287
+ state.formData[column.prop] = dicDatum.value;
288
+ column.value = state.formData[column.prop];
289
+ }
290
+ }
291
+ }
292
+ }, 100)
293
+ }
294
+ }
295
+ } else if (column.dictTable || column.dictUrl) {
296
+ if (column.selectDom == 1) {
297
+ column.type = "select";
298
+ }
299
+ column.filterable = true;
300
+ column.dicData = [];
301
+ setTimeout(() => {
302
+ setDictTable(column, undefined);
303
+ }, 10)
304
+ if (column.type == 'tree') {
305
+ column.filterable = column.filterable == undefined ? true : column.clearable;
306
+ column.clearable = column.clearable == undefined ? true : column.clearable;
307
+ } else {
308
+ column.filterMethod = (e) => {
309
+ nextTick(() => {
310
+ setDictTable(column, e);
311
+ })
312
+ };
313
+ }
314
+ }
315
+ }
316
+
317
+ const doSetDictTable = (column, like) => {
318
+ let value = state.formData[column.prop];
319
+ /*String tableName;
320
+ String dataBase;
321
+ String label;
322
+ String value;
323
+ Map<String, Object> where;*/
324
+ // olp-vue-pro,system_users,nickname,id,parentId
325
+ let params = {}
326
+ let dictTable = JSON.parse(JSON.stringify(column.dictTable));
327
+ if (dictTable instanceof Object) {
328
+ params = dictTable;
329
+ } else {
330
+ dictTable = column.dictTable.split(",");
331
+ params["dbName"] = dictTable[0];
332
+ params["tableName"] = dictTable[1];
333
+ params["label"] = dictTable[2];
334
+ params["value"] = dictTable[3];
335
+ if (dictTable[4]) {
336
+ params["parentValue"] = dictTable[4];
337
+ }
338
+ }
339
+
340
+ if (like || value) {
341
+ if (!params.where) {
342
+ params.where = {};
343
+ }
344
+
345
+ }
346
+ if (!params["parentValue"]) {
347
+ if (like) {
348
+ params.where['_like_' + params["label"]] = like;
349
+ }
350
+ if (value) {
351
+ params.defaultValue = value;
352
+ }
353
+ }
354
+
355
+ initDictTable(http, params).then((data) => {
356
+ column.dicData.length = 0;
357
+ if (params["parentValue"]) {
358
+ column.dicData = handleTree(data, 'dictValue', 'parentValue');
359
+ } else {
360
+ data.forEach((d) => {
361
+ column.dicData.push(d);
362
+ })
363
+ }
364
+ })
365
+ }
366
+ const setDictUrl = (column, like) => {
367
+ let dictUrl = column.dictUrl.split(",");
368
+ let url;
369
+ let label = 'label';
370
+ let value = 'value';
371
+ let parentId = 'parentId';
372
+ // get,url,label,value,parent_id
373
+ let doGet = true;
374
+ if (dictUrl.length > 1
375
+ ) {
376
+ if (dictUrl[0].toString().toLowerCase() == 'post') {
377
+ doGet = false;
378
+ }
379
+ url = dictUrl[1];
380
+ label = dictUrl[2];
381
+ value = dictUrl[3];
382
+ parentId = dictUrl[4];
383
+ } else {
384
+ url = dictUrl[0];
385
+ }
386
+
387
+ if (doGet) {
388
+ get(http, url + "?label=" + like).then((data) => {
389
+ column.dicData.length = 0;
390
+ if (column.type == 'tree') {
391
+ for (let da of data) {
392
+ da['label'] = da[label]
393
+ da['value'] = da[value]
394
+ }
395
+ column.dicData = handleTree(data, value, parentId);
396
+ } else {
397
+ data.forEach((d) => {
398
+ column.dicData.push(d);
399
+ })
400
+ }
401
+ })
402
+ } else {
403
+ let params = {}
404
+ if (like) {
405
+ params['label'] = like;
406
+ }
407
+ post(http, column.dictUrl, params, false).then(({data}) => {
408
+ column.dicData.length = 0;
409
+ if (column.type == 'tree') {
410
+ for (let da of data) {
411
+ da['label'] = da[label]
412
+ da['value'] = da[value]
413
+ }
414
+ column.dicData = handleTree(data, value, parentId);
415
+ } else {
416
+ data.forEach((da => {
417
+ da['label'] = da[label];
418
+ da['value'] = da[value];
419
+ column.dicData.push(da);
420
+ }))
421
+ }
422
+ })
423
+ }
424
+ }
425
+ const setDictTable = (column, like) => {
426
+ if (column.dictTable && column.dictTable.toString().trim() != '') {
427
+ doSetDictTable(column, like);
428
+ } else if (column.dictUrl) {
429
+ setDictUrl(column, like);
430
+ }
431
+
432
+ }
433
+ const aws = async () => {
434
+ await nextTick()
435
+ }
436
+
437
+ function getFunction(v) {
438
+ return eval(" async (params)=>{await aws();let {formData} = state;let {value} = params;" + replaceDollarBraces(v) + "}")
439
+ }
440
+
441
+ function replaceDollarBraces(str) {
442
+ return str.toString().replace(/\$\{?([^{}]+)\}?/g, function (match, innerContent) {
443
+ return innerContent ? `'${innerContent}'` : match;
444
+ });
445
+ }
446
+
447
+
448
+ // 子组件调用父组件
449
+ const emits = defineEmits(['emits']) //声明 emits
450
+
451
+ // 对外暴露
452
+ defineExpose({
453
+ init,
454
+ })
455
+ </script>