imatrix-ui 2.8.39-dw → 2.8.39-pvtmp

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 (189) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.umd.min.js +5 -35
  3. package/package.json +6 -4
  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 +411 -0
  10. package/packages/department-tree-inline/src/department-single-tree-inline.vue +293 -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 +275 -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 +639 -0
  20. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +274 -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 +248 -0
  23. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +142 -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 +75 -0
  28. package/packages/dynamic-source-select/src/dynamic-source-select.vue +586 -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 +468 -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 +825 -0
  73. package/packages/super-grid/src/columns-config.vue +335 -0
  74. package/packages/super-grid/src/custom-formatter.js +280 -0
  75. package/packages/super-grid/src/dynamic-input.vue +1286 -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 +775 -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 +654 -0
  90. package/packages/super-grid/src/search-form-dialog.vue +79 -0
  91. package/packages/super-grid/src/search-form-item.vue +405 -0
  92. package/packages/super-grid/src/search-form-number.vue +38 -0
  93. package/packages/super-grid/src/search-form-open.vue +170 -0
  94. package/packages/super-grid/src/search-form-ordinarySearch.vue +196 -0
  95. package/packages/super-grid/src/search-form.vue +642 -0
  96. package/packages/super-grid/src/search-methods.js +448 -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 +595 -0
  100. package/packages/super-grid/src/super-grid.vue +2936 -0
  101. package/packages/super-grid/src/utils.js +782 -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 +131 -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 +93 -0
  112. package/packages/super-nine-grid/src/super-nine-grid.vue +883 -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/memory-cache-utils.js +90 -0
  117. package/packages/utils/utils.js +152 -0
  118. package/packages/utils/value-set.js +86 -0
  119. package/packages/valid-code/index.js +7 -0
  120. package/packages/valid-code/src/valid-code.vue +95 -0
  121. package/packages/workflow-button/index.js +6 -0
  122. package/packages/workflow-button/src/workflow-button.vue +325 -0
  123. package/packages/workflow-history-list/index.js +6 -0
  124. package/packages/workflow-history-list/src/api.js +7 -0
  125. package/packages/workflow-history-list/src/workflow-history-list.vue +197 -0
  126. package/packages/workgroup-tree/index.js +6 -0
  127. package/packages/workgroup-tree/src/workgroup-tree.vue +77 -0
  128. package/packages/workgroup-tree-inline/index.js +6 -0
  129. package/packages/workgroup-tree-inline/src/search-result.vue +168 -0
  130. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +458 -0
  131. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +71 -0
  132. package/packages/workgroup-user-tree/index.js +6 -0
  133. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
  134. package/packages/workgroup-user-tree-inline/index.js +6 -0
  135. package/packages/workgroup-user-tree-inline/src/search-result.vue +197 -0
  136. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +192 -0
  137. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +584 -0
  138. package/packages/year-range-picker/index.js +6 -0
  139. package/packages/year-range-picker/src/year-range-picker.vue +51 -0
  140. package/src/api/sso-service.js +9 -1
  141. package/src/api/tab.js +3 -3
  142. package/src/i18n/i18n.js +1 -1
  143. package/src/i18n/langs/cn.js +15 -5
  144. package/src/i18n/langs/en.js +15 -5
  145. package/src/index.js +93 -0
  146. package/src/permission.js +51 -17
  147. package/src/plugins.js +3 -3
  148. package/src/store/getters.js +2 -1
  149. package/src/store/modules/app.js +10 -1
  150. package/src/store/modules/user.js +11 -18
  151. package/src/styles/display-layout.scss +34 -0
  152. package/src/styles/index.scss +32 -4
  153. package/src/styles/theme/dark-blue/button.scss +9 -0
  154. package/src/styles/theme/dark-blue/card.scss +64 -0
  155. package/src/styles/theme/dark-blue/checkbox.scss +10 -0
  156. package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
  157. package/src/styles/theme/dark-blue/dialog.scss +21 -0
  158. package/src/styles/theme/dark-blue/element-variables.scss +7 -0
  159. package/src/styles/theme/dark-blue/font.scss +71 -0
  160. package/src/styles/theme/dark-blue/form.scss +51 -0
  161. package/src/styles/theme/dark-blue/index.scss +247 -0
  162. package/src/styles/theme/dark-blue/input.scss +15 -0
  163. package/src/styles/theme/dark-blue/pagination.scss +14 -0
  164. package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
  165. package/src/styles/theme/dark-blue/sidebar.scss +296 -0
  166. package/src/styles/theme/dark-blue/tab.scss +83 -0
  167. package/src/styles/theme/dark-blue/table.scss +60 -0
  168. package/src/styles/theme/dark-blue/tree.scss +31 -0
  169. package/src/styles/theme/dark-blue/var.scss +1028 -0
  170. package/src/styles/theme/gray/input-style.scss +8 -0
  171. package/src/styles/theme/gray/sidebar.scss +14 -2
  172. package/src/utils/auth-api.js +171 -0
  173. package/src/utils/auth.js +75 -41
  174. package/src/utils/calculator/calculator-factory.js +2 -2
  175. package/src/utils/calculator/calculator-util.js +7 -7
  176. package/src/utils/common-util.js +134 -1
  177. package/src/utils/jump-page-utils.js +36 -10
  178. package/src/utils/menu.js +19 -0
  179. package/src/utils/permission.js +4 -0
  180. package/src/utils/permissionAuth.js +46 -25
  181. package/src/utils/request.js +65 -8
  182. package/src/utils/util.js +77 -29
  183. package/src/views/dsc-component/Sidebar/Item.vue +5 -5
  184. package/src/views/dsc-component/Sidebar/Link.vue +11 -2
  185. package/src/views/dsc-component/Sidebar/SidebarItem.vue +37 -21
  186. package/src/views/dsc-component/Sidebar/index.vue +24 -12
  187. package/src/views/dsc-component/tabs/tab-content.vue +18 -2
  188. package/src/views/layout/components/Breadcrumb/index.vue +1 -1
  189. package/src/views/login/index.vue +1 -1
@@ -0,0 +1,654 @@
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
+ const gridParams = store.get(this.code)
359
+ return getDynamicDataSourceOptions(column, this.isSql, gridParams.additionalParamMap)
360
+ },
361
+ // 值设置是否是动态数据源类型的数据源
362
+ isDynamicDataSourceSource(column) {
363
+ return isDynamicDataSourceSource(column)
364
+ },
365
+ refreshOperators() {
366
+ if (this.searchableColumns && this.searchableColumns.length > 0) {
367
+ for (var i = 0; i < this.searchableColumns.length; i++) {
368
+ const prop = this.searchableColumns[i].prop
369
+ const item = this.propMap[prop]
370
+ this.operationArr[i] = this.getOperators(item)
371
+ }
372
+ }
373
+ },
374
+ handleCurrentChange(val) {
375
+ this.currentRow = val
376
+ },
377
+ tableRowClassName({ row, rowIndex }) {
378
+ // 把每一行的索引放进row
379
+ row.index = rowIndex
380
+ },
381
+ // 选择行
382
+ selectRow(row) {
383
+ this.$refs.table.setCurrentRow(row)
384
+ },
385
+ // 改变选择的属性
386
+ changeFieldName(index) {
387
+ const prop = this.currentRow.prop
388
+ const item = this.propMap[prop]
389
+ this.searchFormList[index].dataType = item.dataType
390
+ this.searchFormList[index].orgProp = item.orgProp
391
+ this.searchFormList[index].componentType = item.componentType
392
+ this.searchFormList[index].componentName = item.componentName
393
+ this.searchFormList[index].queryMatching = item.queryMatching
394
+ this.searchFormList[index].searchControlWidth = item.searchControlWidth
395
+ this.searchFormList[index].fuzzy = item.fuzzy
396
+ this.searchFormList[index].valueSet = item.valueSet
397
+ this.operationArr[index] = this.getOperators(item)
398
+ },
399
+ setValueToModelProp(index, value, componentName) {
400
+ if (index !== null && index !== undefined) {
401
+ this.$set(this.searchFormList[index], 'value', value)
402
+ }
403
+ },
404
+ componentTypeTypeIsTree(componentType) {
405
+ if (componentType) {
406
+ if (componentType.indexOf('DeptManTree') > 0) {
407
+ // 说明是部门人员树
408
+ return true
409
+ }
410
+ if (componentType.indexOf('DeptTree') > 0) {
411
+ // 说明是部门树
412
+ return true
413
+ }
414
+ if (componentType.indexOf('WgManTree') > 0) {
415
+ // 说明是工作组人员树
416
+ return true
417
+ }
418
+ if (componentType.indexOf('WgManTree') > 0) {
419
+ // 说明是工作组树
420
+ return true
421
+ }
422
+ }
423
+ return false
424
+ },
425
+ getTreeFields(orgTreeSet) {
426
+ if (orgTreeSet && orgTreeSet !== '') {
427
+ return JSON.parse(orgTreeSet)
428
+ }
429
+ },
430
+ getTreeIsMultiTree(componentType) {
431
+ if (componentType && componentType.indexOf('single') >= 0 && componentType.indexOf('Tree') > 0) {
432
+ return false
433
+ } else {
434
+ return true
435
+ }
436
+ },
437
+ getTreeType(componentType) {
438
+ if (componentType) {
439
+ if (componentType.indexOf('DeptManTree') > 0) {
440
+ // 说明是部门人员树
441
+ return 'DeptUserTree'
442
+ }
443
+ if (componentType.indexOf('DeptTree') > 0) {
444
+ // 说明是部门树
445
+ return 'DeptTree'
446
+ }
447
+ if (componentType.indexOf('WgTree') > 0) {
448
+ // 说明是工作组人员树
449
+ return 'WgTree'
450
+ }
451
+ if (componentType.indexOf('WgManTree') > 0) {
452
+ // 说明是工作组树
453
+ return 'WgUserTree'
454
+ }
455
+ }
456
+ },
457
+ // 组织结构树文本框值改变事件
458
+ organizationInputEvent(prop, value) {
459
+ if (this.currentRow) {
460
+ this.$set(this.currentRow, 'value', value)
461
+ }
462
+ },
463
+ // 组织结构树文本框值清空事件
464
+ clearOrganizationInputEvent(prop) {
465
+ if (this.currentRow) {
466
+ this.$set(this.currentRow, 'value', null)
467
+ }
468
+ },
469
+ customComponent(prop) {
470
+ const column = this.propMap[prop]
471
+ const gridParams = store.get(this.code)
472
+ if (column.componentName && column.componentName !== '') {
473
+ this.customComponentNames.add(column.componentName)
474
+ return true
475
+ }
476
+ if ((!column.componentName || column.componentName === '') &&
477
+ gridParams.options &&
478
+ gridParams.options.search &&
479
+ gridParams.options.search.customSearchElements) {
480
+ // 定义了自定义查询组件
481
+ const propSearchEle = gridParams.options.search.customSearchElements[column.prop]
482
+ // console.log('customComponent-customSearchElements-propSearchEle-', column.prop)
483
+ if (propSearchEle) {
484
+ column.componentName = 'custom-' + column.prop
485
+ const component = propSearchEle.call(this, column)
486
+ // console.log('customComponent-customSearchElements-')
487
+ if (component) {
488
+ this.customComponentNames.add(column.componentName)
489
+ Vue.component(column.componentName, component)
490
+ return true
491
+ }
492
+ }
493
+ }
494
+ return false
495
+ },
496
+ validateForm() {
497
+ return new Promise((resolve, reject) => {
498
+ resolve(true)
499
+ })
500
+ },
501
+ resetForm() {
502
+ if (this.customComponentNames && this.customComponentNames.length > 0) {
503
+ for (const componentName of this.customComponentNames) { // 遍历
504
+ this.$refs[componentName][0].resetField()
505
+ }
506
+ }
507
+ // 当是保持页数默认赋值的查询字段resetFields()不会被清空,需要下面的方法遍历设未null
508
+ this.$emit('resetForm')
509
+ this.add()
510
+ },
511
+ setNumberValue(value, r, n) {
512
+ if (this.currentRow) {
513
+ this.$set(this.currentRow, 'value', value)
514
+ }
515
+ },
516
+ // 添加
517
+ add() {
518
+ if (!this.searchFormList) {
519
+ this.searchFormList = []
520
+ }
521
+ this.searchFormList.push(
522
+ {
523
+ leftBracket: '',
524
+ prop: '',
525
+ operator: '',
526
+ value: '',
527
+ rightBracket: '',
528
+ joinSign: 'or',
529
+ dataType: '',
530
+ propDbName: ''
531
+ }
532
+ )
533
+ this.operationArr.push([])
534
+ },
535
+ // 删除
536
+ remove(index) {
537
+ if (index !== null && index !== undefined && index !== -1) {
538
+ this.searchFormList.splice(index, 1)
539
+ } else {
540
+ if (this.currentRow === null) {
541
+ this.$alert(this.$t('message.pleaseSelectARow'))
542
+ return
543
+ }
544
+ if (this.currentRow && this.currentRow.index && this.currentRow.index !== null && this.currentRow.index !== undefined) {
545
+ this.searchFormList.splice(this.currentRow.index, 1)
546
+ }
547
+ }
548
+ },
549
+ // 实时根据类型改变连接符
550
+ getOperators(item) {
551
+ if (item) {
552
+ if (item.dataType === 'INTEGER' || item.dataType === 'LONG' || item.dataType === 'DOUBLE' || item.dataType === 'FLOAT') {
553
+ return [{
554
+ name: 'GT',
555
+ label: this.$t('imatrixUIPublicModel.greaterThan')
556
+ }, {
557
+ name: 'LT',
558
+ label: this.$t('imatrixUIPublicModel.lessThan')
559
+ }, {
560
+ name: 'EQ',
561
+ label: this.$t('imatrixUIPublicModel.beEqualTo')
562
+ }, {
563
+ name: 'LET',
564
+ label: this.$t('imatrixUIPublicModel.notGreaterThan')
565
+ }, {
566
+ name: 'GET',
567
+ label: this.$t('imatrixUIPublicModel.notLessThan')
568
+ }, {
569
+ name: 'NET',
570
+ label: this.$t('imatrixUIPublicModel.notEqualTo')
571
+ }, {
572
+ name: 'IS_NULL',
573
+ label: this.$t('imatrixUIPublicModel.isNull')
574
+ }, {
575
+ name: 'IS_NOT_NULL',
576
+ label: this.$t('imatrixUIPublicModel.isNotNull')
577
+ }]
578
+ } else if (item.dataType === 'DATE' || item.dataType === 'TIME') {
579
+ return [{
580
+ name: 'GT',
581
+ label: this.$t('imatrixUIPublicModel.laterThan')
582
+ }, {
583
+ name: 'LT',
584
+ label: this.$t('imatrixUIPublicModel.earlierThan')
585
+ }, {
586
+ name: 'EQ',
587
+ label: this.$t('imatrixUIPublicModel.beEqualTo')
588
+ }, {
589
+ name: 'LET',
590
+ label: this.$t('imatrixUIPublicModel.noLaterThan')
591
+ }, {
592
+ name: 'GET',
593
+ label: this.$t('imatrixUIPublicModel.noEarlierThan')
594
+ }, {
595
+ name: 'IS_NULL',
596
+ label: this.$t('imatrixUIPublicModel.isNull')
597
+ }, {
598
+ name: 'IS_NOT_NULL',
599
+ label: this.$t('imatrixUIPublicModel.isNotNull')
600
+ }]
601
+ } else if (item.dataType === 'TEXT') {
602
+ return [{
603
+ name: 'EQ',
604
+ label: this.$t('imatrixUIPublicModel.beEqualTo')
605
+ }, {
606
+ name: 'NET',
607
+ label: this.$t('imatrixUIPublicModel.notEqualTo')
608
+ }, {
609
+ name: 'CONTAIN',
610
+ label: this.$t('imatrixUIPublicModel.contain')
611
+ }, {
612
+ name: 'NOT_CONTAIN',
613
+ label: this.$t('imatrixUIPublicModel.notIncluded')
614
+ }, {
615
+ name: 'IS_NULL',
616
+ label: this.$t('imatrixUIPublicModel.isNull')
617
+ }, {
618
+ name: 'IS_NOT_NULL',
619
+ label: this.$t('imatrixUIPublicModel.isNotNull')
620
+ }]
621
+ } else {
622
+ return [{
623
+ name: 'EQ',
624
+ label: this.$t('imatrixUIPublicModel.beEqualTo')
625
+ }, {
626
+ name: 'NET',
627
+ label: this.$t('imatrixUIPublicModel.notEqualTo')
628
+ }, {
629
+ name: 'IS_NULL',
630
+ label: this.$t('imatrixUIPublicModel.isNull')
631
+ }, {
632
+ name: 'IS_NOT_NULL',
633
+ label: this.$t('imatrixUIPublicModel.isNotNull')
634
+ }]
635
+ }
636
+ } else {
637
+ return [{
638
+ name: 'EQ',
639
+ label: this.$t('imatrixUIPublicModel.beEqualTo')
640
+ }, {
641
+ name: 'NET',
642
+ label: this.$t('imatrixUIPublicModel.notEqualTo')
643
+ }, {
644
+ name: 'IS_NULL',
645
+ label: this.$t('imatrixUIPublicModel.isNull')
646
+ }, {
647
+ name: 'IS_NOT_NULL',
648
+ label: this.$t('imatrixUIPublicModel.isNotNull')
649
+ }]
650
+ }
651
+ }
652
+ }
653
+ }
654
+ </script>