imatrix-ui 2.8.21-dw → 2.8.21

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