imatrix-ui 0.0.15 → 0.1.1-up

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/.vscode/extensions.json +3 -0
  2. package/README.md +7 -0
  3. package/components/dynamic-source-select/dynamic-source-select-service.js +106 -0
  4. package/components/dynamic-source-select/dynamic-source-select.vue +673 -0
  5. package/components/dynamic-source-select/events.js +77 -0
  6. package/components/fs-preview/fs-preview.vue +287 -0
  7. package/components/index.js +26 -0
  8. package/components/plugins/export-data-new.js +623 -0
  9. package/components/plugins/export-data.js +431 -0
  10. package/components/plugins/index.js +15 -0
  11. package/components/plugins/public-method.js +47 -0
  12. package/components/rich-editor/index-bak.vue +306 -0
  13. package/components/rich-editor/index.vue +236 -0
  14. package/components/rich-editor/langs/zh-Hans.js +438 -0
  15. package/components/rich-editor/viewer.vue +105 -0
  16. package/components/super-grid/apis.js +1065 -0
  17. package/components/super-grid/columns-config.vue +430 -0
  18. package/components/super-grid/custom-formatter.js +330 -0
  19. package/components/super-grid/dynamic-input.vue +1706 -0
  20. package/components/super-grid/eventBus.js +2 -0
  21. package/components/super-grid/events.js +56 -0
  22. package/components/super-grid/formValidatorUtil.js +300 -0
  23. package/components/super-grid/formatter.js +190 -0
  24. package/components/super-grid/group-column.vue +100 -0
  25. package/components/super-grid/header-context-menu.vue +82 -0
  26. package/components/super-grid/index-column.vue +69 -0
  27. package/components/super-grid/normal-column.vue +1148 -0
  28. package/components/super-grid/public-methods.js +30 -0
  29. package/components/super-grid/row-operation.vue +193 -0
  30. package/components/super-grid/search-button.vue +74 -0
  31. package/components/super-grid/search-condition-input.vue +73 -0
  32. package/components/super-grid/search-condition-list.vue +68 -0
  33. package/components/super-grid/search-form-advancedQuery.vue +820 -0
  34. package/components/super-grid/search-form-dialog.vue +77 -0
  35. package/components/super-grid/search-form-item.vue +470 -0
  36. package/components/super-grid/search-form-number.vue +111 -0
  37. package/components/super-grid/search-form-open.vue +178 -0
  38. package/components/super-grid/search-form-ordinarySearch.vue +218 -0
  39. package/components/super-grid/search-form.vue +756 -0
  40. package/components/super-grid/search-methods.js +484 -0
  41. package/components/super-grid/selection-column.vue +46 -0
  42. package/components/super-grid/store.js +3 -0
  43. package/components/super-grid/super-grid-service.js +682 -0
  44. package/components/super-grid/super-grid.vue +2893 -0
  45. package/components/super-grid/utils.js +851 -0
  46. package/components/super-grid/view-image-dialog.vue +173 -0
  47. package/components/utils/gogocodeTransfer.js +59 -0
  48. package/components/utils/utils.js +180 -0
  49. package/components/utils/value-set.js +98 -0
  50. package/components/z-test-utton/index.vue +82 -0
  51. package/package.json +29 -40
  52. package/public/index.html +13 -0
  53. package/public/vite.svg +1 -0
  54. package/src/api/sso-service.js +172 -19
  55. package/src/api/tab.js +36 -0
  56. package/src/api/user-service.js +11 -11
  57. package/src/assets/401/401.gif +0 -0
  58. package/src/assets/404/404-cloud.png +0 -0
  59. package/src/assets/404/404.png +0 -0
  60. package/src/assets/cloud.png +0 -0
  61. package/src/directives/permission/index.js +13 -13
  62. package/src/directives/permission/permission.js +20 -15
  63. package/src/i18n/i18n.js +16 -0
  64. package/src/i18n/langs/cn.js +254 -0
  65. package/src/i18n/langs/en.js +264 -0
  66. package/src/permission.js +157 -71
  67. package/src/plugins.js +18 -18
  68. package/src/router/index.js +96 -69
  69. package/src/store/getters.js +15 -10
  70. package/src/store/index.js +19 -19
  71. package/src/store/modules/app.js +54 -42
  72. package/src/store/modules/permission.js +137 -73
  73. package/src/store/modules/tab-content.js +36 -0
  74. package/src/store/modules/user.js +293 -80
  75. package/src/styles/display-layout.scss +34 -0
  76. package/src/styles/element-ui.scss +29 -29
  77. package/src/styles/index.scss +157 -78
  78. package/src/styles/mixin.scss +27 -27
  79. package/src/styles/theme/black/font-style.scss +70 -0
  80. package/src/styles/theme/black/index.scss +306 -0
  81. package/src/styles/theme/black/sidebar.scss +189 -0
  82. package/src/styles/theme/blue/font-style.scss +46 -0
  83. package/src/styles/theme/blue/index.scss +172 -0
  84. package/src/styles/{sidebar.scss → theme/blue/sidebar.scss} +171 -141
  85. package/src/styles/theme/blue2/font-style.scss +70 -0
  86. package/src/styles/theme/blue2/index.scss +188 -0
  87. package/src/styles/theme/blue2/sidebar.scss +201 -0
  88. package/src/styles/theme/dark-blue/button.scss +9 -0
  89. package/src/styles/theme/dark-blue/card.scss +62 -0
  90. package/src/styles/theme/dark-blue/checkbox.scss +10 -0
  91. package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
  92. package/src/styles/theme/dark-blue/dialog.scss +21 -0
  93. package/src/styles/theme/dark-blue/element-variables.scss +7 -0
  94. package/src/styles/theme/dark-blue/font.scss +71 -0
  95. package/src/styles/theme/dark-blue/form.scss +51 -0
  96. package/src/styles/theme/dark-blue/index.scss +269 -0
  97. package/src/styles/theme/dark-blue/input.scss +15 -0
  98. package/src/styles/theme/dark-blue/message.scss +8 -0
  99. package/src/styles/theme/dark-blue/pagination.scss +14 -0
  100. package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
  101. package/src/styles/theme/dark-blue/sidebar.scss +266 -0
  102. package/src/styles/theme/dark-blue/tab.scss +83 -0
  103. package/src/styles/theme/dark-blue/table.scss +60 -0
  104. package/src/styles/theme/dark-blue/tree.scss +31 -0
  105. package/src/styles/theme/dark-blue/var.scss +1028 -0
  106. package/src/styles/theme/gray/card-style.scss +54 -0
  107. package/src/styles/theme/gray/font-style.scss +70 -0
  108. package/src/styles/theme/gray/index.scss +172 -0
  109. package/src/styles/theme/gray/input-style.scss +19 -0
  110. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  111. package/src/styles/theme/gray/sidebar.scss +231 -0
  112. package/src/styles/theme/gray/tab-style.scss +81 -0
  113. package/src/styles/transition.scss +47 -46
  114. package/src/utils/auth-api.js +159 -0
  115. package/src/utils/auth.js +61 -15
  116. package/src/utils/calculator/calculator-factory-wf.js +558 -0
  117. package/src/utils/calculator/calculator-factory.js +145 -0
  118. package/src/utils/calculator/calculator-util.js +166 -0
  119. package/src/utils/common-util.js +305 -0
  120. package/src/utils/eventBus.js +2 -0
  121. package/src/utils/iconUtils.js +28 -0
  122. package/src/utils/index.js +102 -86
  123. package/src/utils/jump-page-utils.js +814 -0
  124. package/src/utils/local-storage.js +33 -31
  125. package/src/utils/menu.js +19 -0
  126. package/src/utils/permission.js +31 -26
  127. package/src/utils/permissionAuth.js +90 -0
  128. package/src/utils/range-selector.js +188 -0
  129. package/src/utils/request.js +270 -116
  130. package/src/utils/restful-interface-utils.js +57 -0
  131. package/src/utils/util.js +698 -0
  132. package/src/utils/validate.js +34 -33
  133. package/src/utils/watermark.js +108 -0
  134. package/src/utils/workflow-util.js +93 -0
  135. package/src/views/404.vue +248 -228
  136. package/src/views/dsc-component/Sidebar/Item.vue +84 -0
  137. package/src/views/dsc-component/Sidebar/Link.vue +38 -0
  138. package/src/views/dsc-component/Sidebar/SidebarItem.vue +196 -0
  139. package/src/views/dsc-component/Sidebar/index.vue +220 -0
  140. package/src/views/dsc-component/tabs/tab-content.vue +199 -0
  141. package/src/views/error-page/401.vue +106 -91
  142. package/src/views/error-page/404.vue +248 -228
  143. package/src/views/layout/EmptyLayout.vue +3 -0
  144. package/src/views/layout/Layout.vue +81 -68
  145. package/src/views/layout/NewLayout.vue +18 -0
  146. package/src/views/layout/components/AppMain.vue +39 -29
  147. package/src/views/layout/components/Breadcrumb/index.vue +156 -0
  148. package/src/views/layout/components/Menubar/Item.vue +57 -0
  149. package/src/views/layout/components/Menubar/Link.vue +38 -0
  150. package/src/views/layout/components/Menubar/SidebarItem.vue +164 -0
  151. package/src/views/layout/components/Menubar/index.vue +210 -0
  152. package/src/views/layout/components/Sidebar/Item.vue +53 -29
  153. package/src/views/layout/components/Sidebar/Link.vue +38 -39
  154. package/src/views/layout/components/Sidebar/SidebarItem.vue +135 -100
  155. package/src/views/layout/components/Sidebar/index.vue +141 -48
  156. package/src/views/layout/components/iframe-page.vue +38 -0
  157. package/src/views/layout/components/index.js +4 -3
  158. package/src/views/layout/components/tabs/tab-content.vue +207 -0
  159. package/src/views/layout/mixin/ResizeHandler.js +41 -41
  160. package/src/views/layout/tab-content-iframe-index.vue +38 -0
  161. package/src/views/layout/tab-content-index.vue +93 -0
  162. package/src/views/login/authredirect.vue +10 -10
  163. package/src/views/login/index.vue +296 -203
  164. package/src/views/login/update-password.vue +243 -0
  165. package/src/views/redirect/index.vue +14 -12
  166. package/src/views/wf-history/tache-subprocess-history.vue +45 -0
  167. package/vite.config.js +31 -0
  168. package/lib/super-ui.css +0 -1
  169. package/lib/super-ui.umd.min.js +0 -2
  170. package/src/styles/variables.scss +0 -4
  171. package/src/views/layout/components/Navbar.vue +0 -92
@@ -0,0 +1,820 @@
1
+ <template>
2
+ <div v-if="formFlag">
3
+ <!-- <el-row style="padding-bottom: 8px">
4
+ <el-button type="primary" size="mini" plain icon="el-icon-circle-plus-outline" @click="add">
5
+ {{ $t('imatrixUIPublicModel.add') }}
6
+ </el-button>
7
+ <el-button type="primary" size="mini" plain icon="el-icon-delete" @click="remove">
8
+ {{ $t('imatrixUIPublicModel.delete') }}
9
+ </el-button>
10
+ </el-row> -->
11
+ <el-table
12
+ ref="table"
13
+ :data="searchFormList"
14
+ :row-class-name="tableRowClassName"
15
+ border
16
+ style="width: 100%"
17
+ highlight-current-row
18
+ @current-change="handleCurrentChange"
19
+ >
20
+ <el-table-column
21
+ :label="$t('imatrixUIPublicModel.edit')"
22
+ fixed="left"
23
+ align="center"
24
+ width="80"
25
+ >
26
+ <template v-slot="scope">
27
+ <el-icon><el-icon-circle-plus-outline /></el-icon>
28
+ <el-icon><el-icon-remove-outline /></el-icon>
29
+ </template>
30
+ </el-table-column>
31
+ <el-table-column prop="leftBracket" label="(" width="90">
32
+ <template v-slot="scope">
33
+ <el-select
34
+ v-model="scope.row.leftBracket"
35
+ size="small"
36
+ clearable
37
+ @focus="selectRow(scope.row)"
38
+ >
39
+ <el-option label="" value="" />
40
+ <el-option label="(" value="(" />
41
+ <el-option label="((" value="((" />
42
+ <el-option label="(((" value="(((" />
43
+ </el-select>
44
+ </template>
45
+ </el-table-column>
46
+ <el-table-column
47
+ :label="$t('imatrixUIPublicModel.fieldName')"
48
+ width="200"
49
+ >
50
+ <template v-slot="scope">
51
+ <el-select
52
+ v-model="scope.row.prop"
53
+ size="small"
54
+ clearable
55
+ filterable
56
+ @focus="selectRow(scope.row)"
57
+ @change="changeFieldName(scope.$index)"
58
+ >
59
+ <el-option
60
+ v-for="item in searchableColumns"
61
+ :key="item.prop"
62
+ :label="item.label"
63
+ :value="item.prop"
64
+ />
65
+ </el-select>
66
+ </template>
67
+ </el-table-column>
68
+ <el-table-column :label="$t('imatrixUIPublicModel.operator')" width="110">
69
+ <template v-slot="scope">
70
+ <el-select
71
+ v-model="scope.row.operator"
72
+ size="small"
73
+ clearable
74
+ @focus="selectRow(scope.row)"
75
+ >
76
+ <el-option
77
+ v-for="option in operationArr[scope.$index]"
78
+ :key="option.name"
79
+ :label="option.label"
80
+ :value="option.name"
81
+ />
82
+ </el-select>
83
+ </template>
84
+ </el-table-column>
85
+ <el-table-column :label="$t('imatrixUIPublicModel.value')">
86
+ <template v-if="scope.row.prop" v-slot="scope">
87
+ <el-date-picker
88
+ v-if="
89
+ scope.row.dataType === 'DATE' ||
90
+ scope.row.componentType === 'date'
91
+ "
92
+ v-model="scope.row.value"
93
+ type="daterange"
94
+ size="small"
95
+ :style="scope.row.searchControlWidth"
96
+ :range-separator="$t('imatrixUIPublicModel.to')"
97
+ unlink-panels
98
+ :start-placeholder="$t('imatrixUIMessage.startDate')"
99
+ :end-placeholder="$t('imatrixUIMessage.endDate')"
100
+ value-format="yyyy-MM-dd"
101
+ @input="setValueToModelProp(scope.$index, $event)"
102
+ @focus="selectRow(scope.row)"
103
+ />
104
+
105
+ <el-date-picker
106
+ v-else-if="scope.row.componentType === 'dateTimePicker'"
107
+ v-model="scope.row.value"
108
+ type="datetimerange"
109
+ :range-separator="$t('imatrixUIPublicModel.to')"
110
+ unlink-panels
111
+ size="small"
112
+ :style="scope.row.searchControlWidth"
113
+ :start-placeholder="$t('imatrixUIMessage.startDate')"
114
+ :end-placeholder="$t('imatrixUIMessage.endDate')"
115
+ value-format="yyyy-MM-dd HH:mm:ss"
116
+ @input="setValueToModelProp(scope.$index, $event)"
117
+ @focus="selectRow(scope.row)"
118
+ />
119
+
120
+ <el-date-picker
121
+ v-else-if="
122
+ scope.row.dataType === 'TIME' &&
123
+ scope.row.componentType === 'timepicker'
124
+ "
125
+ v-model="scope.row.value"
126
+ type="datetimerange"
127
+ :range-separator="$t('imatrixUIPublicModel.to')"
128
+ unlink-panels
129
+ size="small"
130
+ :style="scope.row.searchControlWidth"
131
+ :start-placeholder="$t('imatrixUIMessage.startDate')"
132
+ :end-placeholder="$t('imatrixUIMessage.endDate')"
133
+ value-format="HH:mm:ss"
134
+ @input="setValueToModelProp(scope.$index, $event)"
135
+ @focus="selectRow(scope.row)"
136
+ />
137
+
138
+ <el-time-picker
139
+ v-else-if="
140
+ scope.row.componentType === 'timepicker' &&
141
+ scope.row.dataType !== 'TIME' &&
142
+ scope.row.dataType !== 'DATE'
143
+ "
144
+ v-model="scope.row.value"
145
+ type="fixed-time"
146
+ size="small"
147
+ :placeholder="$t('imatrixUIMessage.selectTime')"
148
+ style="width: 100%"
149
+ value-format="HH:mm:ss"
150
+ @input="setValueToModelProp(scope.$index, $event)"
151
+ @focus="selectRow(scope.row)"
152
+ />
153
+
154
+ <organization-input
155
+ v-else-if="componentTypeTypeIsTree(scope.row.componentType)"
156
+ v-model:value="scope.row.value"
157
+ :fields="getTreeFields(scope.row.orgTreeSet)"
158
+ :models="searchForm"
159
+ :size="small"
160
+ :multiple="getTreeIsMultiTree(scope.row.componentType)"
161
+ :tree-type="getTreeType(scope.row.componentType)"
162
+ @setValue="organizationInputEvent"
163
+ @clear="clearOrganizationInputEvent"
164
+ @focus="selectRow(scope.row)"
165
+ />
166
+
167
+ <el-select
168
+ v-else-if="
169
+ ((scope.row.componentType &&
170
+ scope.row.componentType === 'select') ||
171
+ scope.row.dataType === 'BOOLEAN') &&
172
+ !isDynamicDataSourceSource(scope.row)
173
+ "
174
+ v-model="scope.row.value"
175
+ clearable
176
+ :style="scope.row.searchControlWidth"
177
+ :placeholder="$t('imatrixUIMessage.pleaseSelect')"
178
+ size="small"
179
+ @input="setValueToModelProp(scope.$index, $event)"
180
+ @focus="selectRow(scope.row)"
181
+ >
182
+ <el-option
183
+ v-for="item in scope.row.valueSet"
184
+ :key="item.value"
185
+ :label="item.label"
186
+ :value="item.value"
187
+ />
188
+ </el-select>
189
+ <el-select
190
+ v-else-if="
191
+ scope.row.componentType &&
192
+ scope.row.componentType === 'multiselect' &&
193
+ !isDynamicDataSourceSource(scope.row)
194
+ "
195
+ v-model="scope.row.value"
196
+ clearable
197
+ multiple
198
+ :style="scope.row.searchControlWidth"
199
+ collapse-tags
200
+ size="small"
201
+ :placeholder="$t('imatrixUIMessage.pleaseSelect')"
202
+ @input="setValueToModelProp(scope.$index, $event)"
203
+ @focus="selectRow(scope.row)"
204
+ >
205
+ <el-option
206
+ v-for="item in scope.row.valueSet"
207
+ :key="item.value"
208
+ :label="item.label"
209
+ :value="item.value"
210
+ />
211
+ </el-select>
212
+
213
+ <dynamic-source-select
214
+ v-else-if="
215
+ scope.row.componentType &&
216
+ (scope.row.componentType === 'multiselect' ||
217
+ scope.row.componentType === 'select') &&
218
+ isDynamicDataSourceSource(scope.row)
219
+ "
220
+ :value="scope.row.value"
221
+ :base-props="{
222
+ multiple:
223
+ scope.row.componentType === 'multiselect' ? true : false,
224
+ }"
225
+ :entity="scope.row"
226
+ :options="getDynamicDataSourceOptions(scope.row)"
227
+ :table-name="tableName"
228
+ :is-join-table="isJoinTable"
229
+ :list-code="code"
230
+ @input="setValueToModelProp(scope.$index, $event)"
231
+ />
232
+ <!--<search-form-number-->
233
+ <!-- v-else-if="-->
234
+ <!-- scope.row.componentType &&-->
235
+ <!-- scope.row.componentType === 'inputNumber'-->
236
+ <!-- "-->
237
+ <!-- :r="r"-->
238
+ <!-- :n="n"-->
239
+ <!-- size="small"-->
240
+ <!-- @setValue="setNumberValue"-->
241
+ <!-- @focus="selectRow(scope.row)"-->
242
+ <!--/>-->
243
+
244
+ <el-switch
245
+ v-else-if="
246
+ scope.row.componentType && scope.row.componentType === 'switch'
247
+ "
248
+ v-model="scope.row.value"
249
+ active-color="#13ce66"
250
+ inactive-color="#ff4949"
251
+ size="small"
252
+ :style="scope.row.searchControlWidth"
253
+ @input="setValueToModelProp(scope.$index, $event)"
254
+ @focus="selectRow(scope.row)"
255
+ />
256
+ <el-slider
257
+ v-else-if="
258
+ scope.row.componentType && scope.row.componentType === 'slider'
259
+ "
260
+ v-model="scope.row.value"
261
+ size="small"
262
+ :style="scope.row.searchControlWidth"
263
+ @input="setValueToModelProp(scope.$index, $event)"
264
+ @focus="selectRow(scope.row)"
265
+ />
266
+
267
+ <el-rate
268
+ v-else-if="
269
+ scope.row.componentType && scope.row.componentType === 'rate'
270
+ "
271
+ v-model="scope.row.value"
272
+ :style="scope.row.searchControlWidth"
273
+ size="small"
274
+ @input="setValueToModelProp(scope.$index, $event)"
275
+ @focus="selectRow(scope.row)"
276
+ />
277
+ <span v-else-if="customComponent(scope.row.prop) === true">
278
+ <component
279
+ :is="scope.row.componentName"
280
+ :ref="scope.row.componentName"
281
+ v-model:value="scope.row.value"
282
+ class="customComponent"
283
+ :prop="scope.row.prop"
284
+ :row="scope.row"
285
+ @input="
286
+ setValueToModelProp(
287
+ scope.$index,
288
+ $event,
289
+ scope.row.componentName
290
+ )
291
+ "
292
+ @focus="selectRow(scope.row)"
293
+ />
294
+ </span>
295
+ <el-input
296
+ v-else
297
+ v-model="scope.row.value"
298
+ size="small"
299
+ :style="scope.row.searchControlWidth"
300
+ @focus="selectRow(scope.row)"
301
+ @keyup.enter="submitForm('searchForm')"
302
+ @input="setValueToModelProp(scope.$index, $event)"
303
+ />
304
+ </template>
305
+ </el-table-column>
306
+ <el-table-column prop="rightBracket" label=")" width="90">
307
+ <template v-slot="scope">
308
+ <el-select
309
+ v-model="scope.row.rightBracket"
310
+ size="small"
311
+ clearable
312
+ @focus="selectRow(scope.row)"
313
+ >
314
+ <el-option label="" value="" />
315
+ <el-option label=")" value=")" />
316
+ <el-option label="))" value="))" />
317
+ <el-option label=")))" value=")))" />
318
+ </el-select>
319
+ </template>
320
+ </el-table-column>
321
+ <el-table-column
322
+ :label="$t('imatrixUIPublicModel.andOr')"
323
+ prop="logicOperator"
324
+ width="110"
325
+ >
326
+ <template v-slot="scope">
327
+ <el-select
328
+ v-model="scope.row.joinSign"
329
+ size="small"
330
+ clearable
331
+ @focus="selectRow(scope.row)"
332
+ >
333
+ <el-option :label="$t('imatrixUIPublicModel.perhaps')" value="or" />
334
+ <el-option :label="$t('imatrixUIPublicModel.also')" value="and" />
335
+ </el-select>
336
+ </template>
337
+ </el-table-column>
338
+ <el-table-column
339
+ :label="$t('imatrixUIPublicModel.whenTheVariableIsEmpty')"
340
+ width="110"
341
+ >
342
+ <template v-slot="scope">
343
+ <el-select
344
+ v-model="scope.row.variableIsNull"
345
+ size="small"
346
+ clearable
347
+ @focus="selectRow(scope.row)"
348
+ >
349
+ <el-option label="Null" value="null" />
350
+ <el-option
351
+ :label="$t('imatrixUIPublicModel.ignore11')"
352
+ value="1=1"
353
+ />
354
+ <el-option
355
+ :label="$t('imatrixUIPublicModel.nonConformity')"
356
+ value="1<>1"
357
+ />
358
+ </el-select>
359
+ </template>
360
+ </el-table-column>
361
+ </el-table>
362
+ </div>
363
+ </template>
364
+
365
+ <script>
366
+ import {
367
+ CirclePlusOutline as ElIconCirclePlusOutline,
368
+ RemoveOutline as ElIconRemoveOutline,
369
+ } from '@element-plus/icons'
370
+ import { $on, $off, $once, $emit } from '../utils/gogocodeTransfer'
371
+ import searchMethods from './search-methods'
372
+ // import searchFormNumber from './search-form-number'
373
+ // import { isOptionFunction, getSearchObject } from './utils'
374
+ import store from './store'
375
+ import SearchConditionInput from './search-condition-input'
376
+ import SearchConditionList from './search-condition-list'
377
+ import { getDynamicDataSourceOptions, isDynamicDataSourceSource } from './utils'
378
+ import * as Vue from 'vue'
379
+ export default {
380
+ components: {
381
+ // searchFormNumber,
382
+ SearchConditionInput,
383
+ SearchConditionList,
384
+ ElIconCirclePlusOutline,
385
+ ElIconRemoveOutline,
386
+ },
387
+ name: 'SearchForm',
388
+ props: {
389
+ searchableColumns: {
390
+ type: Array,
391
+ default: null,
392
+ },
393
+ searchFormList: {
394
+ type: Array,
395
+ default: null,
396
+ },
397
+ propMap: {
398
+ type: Object,
399
+ default: null,
400
+ },
401
+ code: {
402
+ type: String,
403
+ default: null,
404
+ },
405
+ isSql: {
406
+ type: Boolean,
407
+ default: false,
408
+ },
409
+ },
410
+ data() {
411
+ const gridParams = store.get(this.code)
412
+ let tableName
413
+ if (gridParams && gridParams.basicInfo && gridParams.basicInfo.tableName) {
414
+ tableName = gridParams.basicInfo.tableName
415
+ }
416
+ let isHasJoinTable
417
+ if (
418
+ gridParams &&
419
+ gridParams.basicInfo &&
420
+ gridParams.basicInfo.hasJoinTable
421
+ ) {
422
+ isHasJoinTable = gridParams.basicInfo.hasJoinTable
423
+ }
424
+ const customComponentNames = new Set()
425
+ return {
426
+ customComponentNames: customComponentNames,
427
+ currentRow: null,
428
+ formFlag: true,
429
+ operationArr: [],
430
+ tableName,
431
+ isJoinTable: isHasJoinTable, // 是否是关联表
432
+ }
433
+ },
434
+ computed: {},
435
+ watch: {
436
+ searchableColumns: {
437
+ deep: true,
438
+ handler(newValue, oldValue) {
439
+ this.searchableColumns = newValue
440
+ this.refreshOperators()
441
+ this.formFlag = false
442
+ this.$nextTick(() => {
443
+ this.formFlag = true
444
+ })
445
+ },
446
+ },
447
+ },
448
+ created() {
449
+ this.refreshOperators()
450
+ if (!this.searchFormList || this.searchFormList.length < 1) {
451
+ this.add()
452
+ }
453
+ },
454
+ methods: {
455
+ ...searchMethods,
456
+ getDynamicDataSourceOptions(column) {
457
+ return getDynamicDataSourceOptions(column, this.isSql)
458
+ },
459
+ // 值设置是否是动态数据源类型的数据源
460
+ isDynamicDataSourceSource(column) {
461
+ return isDynamicDataSourceSource(column)
462
+ },
463
+ refreshOperators() {
464
+ if (this.searchableColumns && this.searchableColumns.length > 0) {
465
+ for (var i = 0; i < this.searchableColumns.length; i++) {
466
+ const prop = this.searchableColumns[i].prop
467
+ const item = this.propMap[prop]
468
+ this.operationArr[i] = this.getOperators(item)
469
+ }
470
+ }
471
+ },
472
+ handleCurrentChange(val) {
473
+ this.currentRow = val
474
+ },
475
+ tableRowClassName({ row, rowIndex }) {
476
+ // 把每一行的索引放进row
477
+ row.index = rowIndex
478
+ },
479
+ // 选择行
480
+ selectRow(row) {
481
+ this.$refs.table.setCurrentRow(row)
482
+ },
483
+ // 改变选择的属性
484
+ changeFieldName(index) {
485
+ const prop = this.currentRow.prop
486
+ const item = this.propMap[prop]
487
+ this.searchFormList[index].dataType = item.dataType
488
+ this.searchFormList[index].orgProp = item.orgProp
489
+ this.searchFormList[index].componentType = item.componentType
490
+ this.searchFormList[index].componentName = item.componentName
491
+ this.searchFormList[index].queryMatching = item.queryMatching
492
+ this.searchFormList[index].searchControlWidth = item.searchControlWidth
493
+ this.searchFormList[index].fuzzy = item.fuzzy
494
+ this.searchFormList[index].valueSet = item.valueSet
495
+ this.operationArr[index] = this.getOperators(item)
496
+ },
497
+ setValueToModelProp(index, value, componentName) {
498
+ if (index !== null && index !== undefined) {
499
+ this.searchFormList[index]['value'] = value
500
+ }
501
+ },
502
+ componentTypeTypeIsTree(componentType) {
503
+ if (componentType) {
504
+ if (componentType.indexOf('DeptManTree') > 0) {
505
+ // 说明是部门人员树
506
+ return true
507
+ }
508
+ if (componentType.indexOf('DeptTree') > 0) {
509
+ // 说明是部门树
510
+ return true
511
+ }
512
+ if (componentType.indexOf('WgManTree') > 0) {
513
+ // 说明是工作组人员树
514
+ return true
515
+ }
516
+ if (componentType.indexOf('WgManTree') > 0) {
517
+ // 说明是工作组树
518
+ return true
519
+ }
520
+ }
521
+ return false
522
+ },
523
+ getTreeFields(orgTreeSet) {
524
+ if (orgTreeSet && orgTreeSet !== '') {
525
+ return JSON.parse(orgTreeSet)
526
+ }
527
+ },
528
+ getTreeIsMultiTree(componentType) {
529
+ if (
530
+ componentType &&
531
+ componentType.indexOf('single') >= 0 &&
532
+ componentType.indexOf('Tree') > 0
533
+ ) {
534
+ return false
535
+ } else {
536
+ return true
537
+ }
538
+ },
539
+ getTreeType(componentType) {
540
+ if (componentType) {
541
+ if (componentType.indexOf('DeptManTree') > 0) {
542
+ // 说明是部门人员树
543
+ return 'DeptUserTree'
544
+ }
545
+ if (componentType.indexOf('DeptTree') > 0) {
546
+ // 说明是部门树
547
+ return 'DeptTree'
548
+ }
549
+ if (componentType.indexOf('WgTree') > 0) {
550
+ // 说明是工作组人员树
551
+ return 'WgTree'
552
+ }
553
+ if (componentType.indexOf('WgManTree') > 0) {
554
+ // 说明是工作组树
555
+ return 'WgUserTree'
556
+ }
557
+ }
558
+ },
559
+ // 组织结构树文本框值改变事件
560
+ organizationInputEvent(prop, value) {
561
+ if (this.currentRow) {
562
+ this.currentRow['value'] = value
563
+ }
564
+ },
565
+ // 组织结构树文本框值清空事件
566
+ clearOrganizationInputEvent(prop) {
567
+ if (this.currentRow) {
568
+ this.currentRow['value'] = null
569
+ }
570
+ },
571
+ customComponent(prop) {
572
+ const column = this.propMap[prop]
573
+ const gridParams = store.get(this.code)
574
+ if (column.componentName && column.componentName !== '') {
575
+ this.customComponentNames.add(column.componentName)
576
+ return true
577
+ }
578
+ if (
579
+ (!column.componentName || column.componentName === '') &&
580
+ gridParams.options &&
581
+ gridParams.options.search &&
582
+ gridParams.options.search.customSearchElements
583
+ ) {
584
+ // 定义了自定义查询组件
585
+ const propSearchEle =
586
+ gridParams.options.search.customSearchElements[column.prop]
587
+ // console.log('customComponent-customSearchElements-propSearchEle-', column.prop)
588
+ if (propSearchEle) {
589
+ column.componentName = 'custom-' + column.prop
590
+ const component = propSearchEle.call(this, column)
591
+ // console.log('customComponent-customSearchElements-')
592
+ if (component) {
593
+ this.customComponentNames.add(column.componentName)
594
+ window.$vueApp.component(column.componentName, component)
595
+ return true
596
+ }
597
+ }
598
+ }
599
+ return false
600
+ },
601
+ validateForm() {
602
+ return new Promise((resolve, reject) => {
603
+ resolve(true)
604
+ })
605
+ },
606
+ resetForm() {
607
+ if (this.customComponentNames && this.customComponentNames.length > 0) {
608
+ for (const componentName of this.customComponentNames) {
609
+ // 遍历
610
+ this.$refs[componentName][0].resetField()
611
+ }
612
+ }
613
+ // 当是保持页数默认赋值的查询字段resetFields()不会被清空,需要下面的方法遍历设未null
614
+ $emit(this, 'resetForm')
615
+ this.add()
616
+ },
617
+ setNumberValue(value, r, n) {
618
+ if (this.currentRow) {
619
+ this.currentRow['value'] = value
620
+ }
621
+ },
622
+ // 添加
623
+ add() {
624
+ if (!this.searchFormList) {
625
+ this.searchFormList = []
626
+ }
627
+ this.searchFormList.push({
628
+ leftBracket: '',
629
+ prop: '',
630
+ operator: '',
631
+ value: '',
632
+ rightBracket: '',
633
+ joinSign: 'or',
634
+ dataType: '',
635
+ propDbName: '',
636
+ })
637
+ this.operationArr.push([])
638
+ },
639
+ // 删除
640
+ remove(index) {
641
+ if (index !== null && index !== undefined && index !== -1) {
642
+ this.searchFormList.splice(index, 1)
643
+ } else {
644
+ if (this.currentRow === null) {
645
+ this.$alert(this.$t('message.pleaseSelectARow'))
646
+ return
647
+ }
648
+ if (
649
+ this.currentRow &&
650
+ this.currentRow.index &&
651
+ this.currentRow.index !== null &&
652
+ this.currentRow.index !== undefined
653
+ ) {
654
+ this.searchFormList.splice(this.currentRow.index, 1)
655
+ }
656
+ }
657
+ },
658
+ // 实时根据类型改变连接符
659
+ getOperators(item) {
660
+ if (item) {
661
+ if (
662
+ item.dataType === 'INTEGER' ||
663
+ item.dataType === 'LONG' ||
664
+ item.dataType === 'DOUBLE' ||
665
+ item.dataType === 'FLOAT'
666
+ ) {
667
+ return [
668
+ {
669
+ name: 'GT',
670
+ label: this.$t('imatrixUIPublicModel.greaterThan'),
671
+ },
672
+ {
673
+ name: 'LT',
674
+ label: this.$t('imatrixUIPublicModel.lessThan'),
675
+ },
676
+ {
677
+ name: 'EQ',
678
+ label: this.$t('imatrixUIPublicModel.beEqualTo'),
679
+ },
680
+ {
681
+ name: 'LET',
682
+ label: this.$t('imatrixUIPublicModel.notGreaterThan'),
683
+ },
684
+ {
685
+ name: 'GET',
686
+ label: this.$t('imatrixUIPublicModel.notLessThan'),
687
+ },
688
+ {
689
+ name: 'NET',
690
+ label: this.$t('imatrixUIPublicModel.notEqualTo'),
691
+ },
692
+ {
693
+ name: 'IS_NULL',
694
+ label: this.$t('imatrixUIPublicModel.isNull'),
695
+ },
696
+ {
697
+ name: 'IS_NOT_NULL',
698
+ label: this.$t('imatrixUIPublicModel.isNotNull'),
699
+ },
700
+ ]
701
+ } else if (item.dataType === 'DATE' || item.dataType === 'TIME') {
702
+ return [
703
+ {
704
+ name: 'GT',
705
+ label: this.$t('imatrixUIPublicModel.laterThan'),
706
+ },
707
+ {
708
+ name: 'LT',
709
+ label: this.$t('imatrixUIPublicModel.earlierThan'),
710
+ },
711
+ {
712
+ name: 'EQ',
713
+ label: this.$t('imatrixUIPublicModel.beEqualTo'),
714
+ },
715
+ {
716
+ name: 'LET',
717
+ label: this.$t('imatrixUIPublicModel.noLaterThan'),
718
+ },
719
+ {
720
+ name: 'GET',
721
+ label: this.$t('imatrixUIPublicModel.noEarlierThan'),
722
+ },
723
+ {
724
+ name: 'IS_NULL',
725
+ label: this.$t('imatrixUIPublicModel.isNull'),
726
+ },
727
+ {
728
+ name: 'IS_NOT_NULL',
729
+ label: this.$t('imatrixUIPublicModel.isNotNull'),
730
+ },
731
+ ]
732
+ } else if (item.dataType === 'TEXT') {
733
+ return [
734
+ {
735
+ name: 'EQ',
736
+ label: this.$t('imatrixUIPublicModel.beEqualTo'),
737
+ },
738
+ {
739
+ name: 'NET',
740
+ label: this.$t('imatrixUIPublicModel.notEqualTo'),
741
+ },
742
+ {
743
+ name: 'CONTAIN',
744
+ label: this.$t('imatrixUIPublicModel.contain'),
745
+ },
746
+ {
747
+ name: 'NOT_CONTAIN',
748
+ label: this.$t('imatrixUIPublicModel.notIncluded'),
749
+ },
750
+ {
751
+ name: 'IS_NULL',
752
+ label: this.$t('imatrixUIPublicModel.isNull'),
753
+ },
754
+ {
755
+ name: 'IS_NOT_NULL',
756
+ label: this.$t('imatrixUIPublicModel.isNotNull'),
757
+ },
758
+ ]
759
+ } else {
760
+ return [
761
+ {
762
+ name: 'EQ',
763
+ label: this.$t('imatrixUIPublicModel.beEqualTo'),
764
+ },
765
+ {
766
+ name: 'NET',
767
+ label: this.$t('imatrixUIPublicModel.notEqualTo'),
768
+ },
769
+ {
770
+ name: 'IS_NULL',
771
+ label: this.$t('imatrixUIPublicModel.isNull'),
772
+ },
773
+ {
774
+ name: 'IS_NOT_NULL',
775
+ label: this.$t('imatrixUIPublicModel.isNotNull'),
776
+ },
777
+ ]
778
+ }
779
+ } else {
780
+ return [
781
+ {
782
+ name: 'EQ',
783
+ label: this.$t('imatrixUIPublicModel.beEqualTo'),
784
+ },
785
+ {
786
+ name: 'NET',
787
+ label: this.$t('imatrixUIPublicModel.notEqualTo'),
788
+ },
789
+ {
790
+ name: 'IS_NULL',
791
+ label: this.$t('imatrixUIPublicModel.isNull'),
792
+ },
793
+ {
794
+ name: 'IS_NOT_NULL',
795
+ label: this.$t('imatrixUIPublicModel.isNotNull'),
796
+ },
797
+ ]
798
+ }
799
+ },
800
+ },
801
+ emits: ['resetForm'],
802
+ }
803
+ </script>
804
+
805
+ <style scoped>
806
+ .grid-search-form {
807
+ overflow: auto;
808
+ }
809
+ .grid-search-form >>> .el-form-item {
810
+ margin-bottom: 0px;
811
+ }
812
+ .grid-search-form >>> .search-btn {
813
+ margin-bottom: 5px;
814
+ text-align: center;
815
+ }
816
+ .grid-search-form >>> .el-select,
817
+ .grid-search-form >>> .customComponent {
818
+ width: 100%;
819
+ }
820
+ </style>