agilebuilder-ui 1.1.37 → 1.1.38-sit2

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 (38) hide show
  1. package/lib/{401-9314ce87.js → 401-42cb079f.js} +1 -1
  2. package/lib/{404-572d631d.js → 404-e5796cd8.js} +1 -1
  3. package/lib/{iframe-page-87c9c0d0.js → iframe-page-5b503e34.js} +1 -1
  4. package/lib/{index-79b98485.js → index-f5b5c746.js} +14758 -14629
  5. package/lib/super-ui.css +1 -1
  6. package/lib/super-ui.js +1 -1
  7. package/lib/super-ui.umd.cjs +76 -73
  8. package/lib/{tab-content-iframe-index-070ce653.js → tab-content-iframe-index-9bf6e5fc.js} +1 -1
  9. package/lib/{tab-content-index-3b98efb4.js → tab-content-index-28133c86.js} +22 -22
  10. package/lib/{tache-subprocess-history-46442012.js → tache-subprocess-history-7a5bfc89.js} +1 -1
  11. package/package.json +1 -1
  12. package/packages/fs-preview/src/fs-preview.vue +8 -3
  13. package/packages/fs-upload-list/src/fs-upload-list.vue +8 -1
  14. package/packages/fs-upload-new/src/fs-button-upload.vue +12 -0
  15. package/packages/fs-upload-new/src/fs-drag-upload.vue +12 -0
  16. package/packages/fs-upload-new/src/fs-preview-new.vue +25 -5
  17. package/packages/fs-upload-new/src/fs-upload-new.vue +20 -0
  18. package/packages/super-grid/src/apis.js +4 -0
  19. package/packages/super-grid/src/components/grid-radio-input.vue +104 -0
  20. package/packages/super-grid/src/dynamic-input.vue +48 -25
  21. package/packages/super-grid/src/formValidatorUtil.js +7 -2
  22. package/packages/super-grid/src/normal-column-content.vue +9 -1
  23. package/packages/super-grid/src/row-operation.vue +13 -9
  24. package/packages/super-grid/src/search-form-item.vue +461 -461
  25. package/packages/super-grid/src/super-grid.vue +22 -3
  26. package/packages/super-grid/src/utils.js +16 -2
  27. package/packages/utils/value-set.js +25 -33
  28. package/src/api/sso-service.js +2 -1
  29. package/src/permission.js +2 -1
  30. package/src/store/modules/user.js +4 -1
  31. package/src/utils/common-util.js +1 -0
  32. package/src/utils/permissionAuth.js +7 -5
  33. package/src/utils/util.js +16 -0
  34. package/src/views/dsc-component/Sidebar/Item.vue +15 -4
  35. package/src/views/dsc-component/Sidebar/SidebarItem.vue +10 -2
  36. package/src/views/layout/components/Menubar/Item.vue +14 -3
  37. package/src/views/layout/components/Menubar/SidebarItem.vue +9 -1
  38. package/vite.config.js +1 -2
@@ -1,500 +1,500 @@
1
1
  <template>
2
- <el-form-item
3
- :label-width="labelWidth ?? (column.querySetting ? getLabelWidth(column.querySetting) : '110px')"
4
- :prop="column.prop"
5
- >
6
- <template v-slot:label>
7
- <span :title="(column.searchLabel ?? column.label).replace(/\\n/g, '</br>')" v-html="(column.searchLabel ?? column.label).replace(/\\n/g, '</br>')" />
8
- </template>
9
- <span v-if="customComponent(column) === true">
2
+ <el-form-item
3
+ :label-width="labelWidth ?? (column.querySetting ? getLabelWidth(column.querySetting) : '110px')"
4
+ :prop="column.prop"
5
+ >
6
+ <template v-slot:label>
7
+ <span
8
+ :title="(column.searchLabel ?? column.label).replace(/\\n/g, '</br>')"
9
+ v-html="(column.searchLabel ?? column.label).replace(/\\n/g, '</br>')"
10
+ />
11
+ </template>
12
+ <span v-if="customComponent(column) === true">
10
13
  <component
11
- :is="column.componentName"
12
- :ref="column.componentName"
13
- :entity="searchForm"
14
- :additional-settings="controlConfig"
15
- :model-value="getFormItemValue(column.prop)"
16
- :prop="column.prop"
17
- :row="searchForm"
18
- :select-options="column.valueSet"
19
- class="customComponent"
20
- @change="setValueToModelProp(column.prop,$event, column.componentName)"
14
+ :is="column.componentName"
15
+ :ref="column.componentName"
16
+ :entity="searchForm"
17
+ :additional-settings="controlConfig"
18
+ :model-value="getFormItemValue(column.prop)"
19
+ :prop="column.prop"
20
+ :row="searchForm"
21
+ :select-options="column.valueSet"
22
+ class="customComponent"
23
+ @change="setValueToModelProp(column.prop, $event, column.componentName)"
21
24
  />
22
25
  </span>
23
- <!-- 日期区间-两个输入框方式 -->
24
- <span v-else-if="column.componentType === 'dateSection'">
26
+ <!-- 日期区间-两个输入框方式 -->
27
+ <span v-else-if="column.componentType === 'dateSection'">
25
28
  <el-date-picker
26
- v-model="searchForm[column.prop][0]"
27
- :placeholder="$t('imatrixUIMessage.startDate')"
28
- :style="column.searchControlWidth"
29
- type="date"
30
- @change="setValueToModelProp(column.prop,$event, null, 0)"
29
+ v-model="searchForm[column.prop][0]"
30
+ :placeholder="$t('imatrixUIMessage.startDate')"
31
+ :style="column.searchControlWidth"
32
+ type="date"
33
+ @change="setValueToModelProp(column.prop, $event, null, 0)"
31
34
  />
32
35
  <el-date-picker
33
- v-model="searchForm[column.prop][1]"
34
- :placeholder="$t('imatrixUIMessage.endDate')"
35
- :style="column.searchControlWidth"
36
- type="date"
37
- @change="setValueToModelProp(column.prop,$event, null, 1)"
36
+ v-model="searchForm[column.prop][1]"
37
+ :placeholder="$t('imatrixUIMessage.endDate')"
38
+ :style="column.searchControlWidth"
39
+ type="date"
40
+ @change="setValueToModelProp(column.prop, $event, null, 1)"
38
41
  />
39
42
  </span>
40
- <!--后面再优化年份及年份区间控件--->
41
- <year-range-picker
42
- v-else-if="column.componentType === 'yearRange'"
43
- :value="getFormItemValue(column.prop)"
44
- type="yearRange"
45
- @change="setYearRangeValue(column.prop, $event)"
46
- />
47
- <el-date-picker
48
- v-else-if="column.componentType === 'dateTimePicker'"
49
- :default-time="getDefaultTime(column)"
50
- :end-placeholder="$t('imatrixUIMessage.endDate')"
51
- v-model="searchForm[column.prop]"
52
- :range-separator="$t('imatrixUIPublicModel.to')"
53
- :start-placeholder="$t('imatrixUIMessage.startDate')"
54
- :style="column.searchControlWidth"
55
- type="datetimerange"
56
- unlink-panels
57
- format="YYYY-MM-DD HH:mm:ss"
58
- value-format="YYYY-MM-DD HH:mm:ss"
59
- @change="setValueToModelProp(column.prop,$event)"
60
- />
61
- <!--:model-value="getFormItemValue(column.prop)"改成v-model="searchForm[column.prop]" 是因为新页面查询日期时会无法选中日期-->
62
- <el-date-picker
63
- v-else-if="column.dataType === 'DATE' || column.componentType === 'date'"
64
- :end-placeholder="$t('imatrixUIMessage.endDate')"
65
- v-model="searchForm[column.prop]"
66
- :range-separator="$t('imatrixUIPublicModel.to')"
67
- :start-placeholder="$t('imatrixUIMessage.startDate')"
68
- :style="column.searchControlWidth"
69
- type="daterange"
70
- unlink-panels
71
- format="YYYY-MM-DD"
72
- value-format="YYYY-MM-DD"
73
- @change="setValueToModelProp(column.prop,$event)"
74
- />
75
- <el-date-picker
76
- v-else-if="
77
- column.dataType === 'TIME' && column.componentType === 'timepicker'
78
- "
79
- :end-placeholder="$t('imatrixUIMessage.endDate')"
80
- v-model="searchForm[column.prop]"
81
- :range-separator="$t('imatrixUIPublicModel.to')"
82
- :start-placeholder="$t('imatrixUIMessage.startDate')"
83
- :style="column.searchControlWidth"
84
- type="datetimerange"
85
- unlink-panels
86
- format="HH:mm:ss"
87
- value-format="HH:mm:ss"
88
- @change="setValueToModelProp(column.prop,$event)"
89
- />
90
-
91
- <el-time-picker
92
- v-else-if="
93
- column.componentType === 'timepicker' &&
94
- column.dataType !== 'TIME' &&
95
- column.dataType !== 'DATE'
96
- "
97
- v-model="searchForm[column.prop]"
98
- :placeholder="$t('imatrixUIMessage.selectTime')"
99
- style="width: 100%"
100
- type="fixed-time"
101
- format="HH:mm:ss"
102
- value-format="HH:mm:ss"
103
- @change="setValueToModelProp(column.prop,$event)"
104
- />
43
+ <!--后面再优化年份及年份区间控件--->
44
+ <year-range-picker
45
+ v-else-if="column.componentType === 'yearRange'"
46
+ :value="getFormItemValue(column.prop)"
47
+ type="yearRange"
48
+ @change="setYearRangeValue(column.prop, $event)"
49
+ />
50
+ <el-date-picker
51
+ v-else-if="column.componentType === 'dateTimePicker'"
52
+ :default-time="getDefaultTime(column)"
53
+ :end-placeholder="$t('imatrixUIMessage.endDate')"
54
+ v-model="searchForm[column.prop]"
55
+ :range-separator="$t('imatrixUIPublicModel.to')"
56
+ :start-placeholder="$t('imatrixUIMessage.startDate')"
57
+ :style="column.searchControlWidth"
58
+ type="datetimerange"
59
+ unlink-panels
60
+ format="YYYY-MM-DD HH:mm:ss"
61
+ value-format="YYYY-MM-DD HH:mm:ss"
62
+ @change="setValueToModelProp(column.prop, $event)"
63
+ />
64
+ <!--:model-value="getFormItemValue(column.prop)"改成v-model="searchForm[column.prop]" 是因为新页面查询日期时会无法选中日期-->
65
+ <el-date-picker
66
+ v-else-if="column.dataType === 'DATE' || column.componentType === 'date'"
67
+ :end-placeholder="$t('imatrixUIMessage.endDate')"
68
+ v-model="searchForm[column.prop]"
69
+ :range-separator="$t('imatrixUIPublicModel.to')"
70
+ :start-placeholder="$t('imatrixUIMessage.startDate')"
71
+ :style="column.searchControlWidth"
72
+ type="daterange"
73
+ unlink-panels
74
+ format="YYYY-MM-DD"
75
+ value-format="YYYY-MM-DD"
76
+ @change="setValueToModelProp(column.prop, $event)"
77
+ />
78
+ <el-date-picker
79
+ v-else-if="column.dataType === 'TIME' && column.componentType === 'timepicker'"
80
+ :end-placeholder="$t('imatrixUIMessage.endDate')"
81
+ v-model="searchForm[column.prop]"
82
+ :range-separator="$t('imatrixUIPublicModel.to')"
83
+ :start-placeholder="$t('imatrixUIMessage.startDate')"
84
+ :style="column.searchControlWidth"
85
+ type="datetimerange"
86
+ unlink-panels
87
+ format="HH:mm:ss"
88
+ value-format="HH:mm:ss"
89
+ @change="setValueToModelProp(column.prop, $event)"
90
+ />
105
91
 
106
- <organization-input
107
- v-else-if="componentTypeTypeIsTree(column.componentType)"
108
- :fields="getTreeFields(column.orgTreeSet)"
109
- :models="searchForm"
110
- :multiple="getTreeIsMultiTree(column.componentType)"
111
- :tree-type="getTreeType(column.componentType)"
112
- :value="getFormItemValue(column.prop)"
113
- @clear="clearOrganizationInputEvent"
114
- @setValue="organizationInputEvent"
115
- />
92
+ <el-time-picker
93
+ v-else-if="column.componentType === 'timepicker' && column.dataType !== 'TIME' && column.dataType !== 'DATE'"
94
+ v-model="searchForm[column.prop]"
95
+ :placeholder="$t('imatrixUIMessage.selectTime')"
96
+ style="width: 100%"
97
+ type="fixed-time"
98
+ format="HH:mm:ss"
99
+ value-format="HH:mm:ss"
100
+ @change="setValueToModelProp(column.prop, $event)"
101
+ />
116
102
 
117
- <el-select
118
- v-else-if="
119
- ((column.componentType && column.componentType === 'select') ||
120
- column.dataType === 'BOOLEAN') &&
103
+ <organization-input
104
+ v-else-if="componentTypeTypeIsTree(column.componentType)"
105
+ :fields="getTreeFields(column.orgTreeSet)"
106
+ :models="searchForm"
107
+ :multiple="getTreeIsMultiTree(column.componentType)"
108
+ :tree-type="getTreeType(column.componentType)"
109
+ :value="getFormItemValue(column.prop)"
110
+ @clear="clearOrganizationInputEvent"
111
+ @setValue="organizationInputEvent"
112
+ />
113
+ <el-select
114
+ v-else-if="column?.componentType === 'radio'"
115
+ :model-value="getFormItemValue(column.prop)"
116
+ :placeholder="$t('imatrixUIMessage.pleaseSelect')"
117
+ :style="column.searchControlWidth"
118
+ clearable
119
+ filterable
120
+ @change="setValueToModelProp(column.prop, $event)"
121
+ >
122
+ <el-option v-for="item in column.valueSet" :key="item.value" :label="item.label" :value="item.value" />
123
+ </el-select>
124
+ <el-select
125
+ v-else-if="
126
+ ((column.componentType && column.componentType === 'select') || column.dataType === 'BOOLEAN') &&
121
127
  !isDynamicDataSourceSource(column)
122
128
  "
123
- :model-value="getFormItemValue(column.prop)"
124
- :placeholder="$t('imatrixUIMessage.pleaseSelect')"
125
- :style="column.searchControlWidth"
126
- clearable
127
- filterable
128
- @change="setValueToModelProp(column.prop,$event)"
129
- >
130
- <el-option
131
- v-for="item in column.valueSet"
132
- :key="item.value"
133
- :label="item.label"
134
- :value="item.value"
135
- />
136
- </el-select>
137
- <el-select
138
- v-else-if="
129
+ :model-value="getFormItemValue(column.prop)"
130
+ :placeholder="$t('imatrixUIMessage.pleaseSelect')"
131
+ :style="column.searchControlWidth"
132
+ clearable
133
+ filterable
134
+ @change="setValueToModelProp(column.prop, $event)"
135
+ >
136
+ <el-option v-for="item in column.valueSet" :key="item.value" :label="item.label" :value="item.value" />
137
+ </el-select>
138
+ <el-select
139
+ v-else-if="column.componentType && column.componentType === 'multiselect' && !isDynamicDataSourceSource(column)"
140
+ :model-value="getFormItemValue(column.prop)"
141
+ :placeholder="$t('imatrixUIMessage.pleaseSelect')"
142
+ :style="column.searchControlWidth"
143
+ clearable
144
+ collapse-tags
145
+ filterable
146
+ multiple
147
+ @change="setValueToModelProp(column.prop, $event)"
148
+ >
149
+ <el-option v-for="item in column.valueSet" :key="item.value" :label="item.label" :value="item.value" />
150
+ </el-select>
151
+ <template
152
+ v-else-if="
139
153
  column.componentType &&
140
- column.componentType === 'multiselect' &&
141
- !isDynamicDataSourceSource(column)
142
- "
143
- :model-value="getFormItemValue(column.prop)"
144
- :placeholder="$t('imatrixUIMessage.pleaseSelect')"
145
- :style="column.searchControlWidth"
146
- clearable
147
- collapse-tags
148
- filterable
149
- multiple
150
- @change="setValueToModelProp(column.prop,$event)"
151
- >
152
- <el-option
153
- v-for="item in column.valueSet"
154
- :key="item.value"
155
- :label="item.label"
156
- :value="item.value"
157
- />
158
- </el-select>
159
- <dynamic-source-select
160
- v-else-if="
161
- column.componentType &&
162
- (column.componentType === 'multiselect' ||
163
- column.componentType === 'select') &&
154
+ (column.componentType === 'multiselect' || column.componentType === 'select') &&
164
155
  isDynamicDataSourceSource(column)
165
156
  "
166
- :allow-create="true"
167
- :base-props="{
168
- multiple: column.componentType === 'multiselect' ? true : false,
169
- }"
170
- :entity="searchForm"
171
- :filterable="true"
172
- :is-join-table="isJoinTable"
173
- :list-code="code"
174
- :list-toolbar-form-data="listToolbarFormData"
175
- :options="getDynamicDataSourceOptions(column)"
176
- :table-name="tableName"
177
- :value="getFormItemValue(column.prop)"
178
- @input="setValueToModelProp(column.prop, $event)"
179
- />
180
- <!--
157
+ >
158
+ <dynamic-source-select
159
+ v-model:value="searchForm[column.prop]"
160
+ :allow-create="true"
161
+ :base-props="{
162
+ multiple: column.componentType === 'multiselect' ? true : false
163
+ }"
164
+ :entity="searchForm"
165
+ :filterable="true"
166
+ :is-join-table="isJoinTable"
167
+ :list-code="code"
168
+ :list-toolbar-form-data="listToolbarFormData"
169
+ :options="getDynamicDataSourceOptions(column)"
170
+ :table-name="tableName"
171
+ @change="multiselectChange"
172
+ @input="setValueToModelProp(column.prop, $event)"
173
+ />
174
+ </template>
175
+ <!--
181
176
  <el-input-number
182
177
  v-else-if="column.componentType && column.componentType==='inputNumber'"
183
178
  :value="getFormItemValue(column.prop)"
184
179
  @input="setValueToModelProp(column.prop,$event)"
185
180
  /> -->
186
181
 
187
- <search-form-number
188
- v-else-if="column.componentType && column.componentType === 'inputNumber'"
189
- :item-value="searchForm[column.prop]"
190
- :module-config="moduleConfig"
191
- @setValue="setNumberValue"
192
- />
182
+ <search-form-number
183
+ v-else-if="column.componentType && column.componentType === 'inputNumber'"
184
+ :item-value="searchForm[column.prop]"
185
+ :module-config="moduleConfig"
186
+ @setValue="setNumberValue"
187
+ />
193
188
 
194
- <el-switch
195
- v-else-if="column.componentType && column.componentType === 'switch'"
196
- :model-value="getFormItemValue(column.prop)"
197
- :style="column.searchControlWidth"
198
- active-color="#13ce66"
199
- inactive-color="#ff4949"
200
- @change="setValueToModelProp(column.prop,$event)"
201
- />
202
- <el-slider
203
- v-else-if="column.componentType && column.componentType === 'slider'"
204
- :model-value="getFormItemValue(column.prop)"
205
- :style="column.searchControlWidth"
206
- @change="setValueToModelProp(column.prop,$event)"
207
- />
189
+ <el-switch
190
+ v-else-if="column.componentType && column.componentType === 'switch'"
191
+ :model-value="getFormItemValue(column.prop)"
192
+ :style="column.searchControlWidth"
193
+ active-color="#13ce66"
194
+ inactive-color="#ff4949"
195
+ @change="setValueToModelProp(column.prop, $event)"
196
+ />
197
+ <el-slider
198
+ v-else-if="column.componentType && column.componentType === 'slider'"
199
+ :model-value="getFormItemValue(column.prop)"
200
+ :style="column.searchControlWidth"
201
+ @change="setValueToModelProp(column.prop, $event)"
202
+ />
208
203
 
209
- <el-rate
210
- v-else-if="column.componentType && column.componentType === 'rate'"
211
- :model-value="getFormItemValue(column.prop)"
212
- :style="column.searchControlWidth"
213
- @change="setValueToModelProp(column.prop,$event)"
214
- />
215
- <el-input
216
- v-else
217
- :model-value="getFormItemValue(column.prop)"
218
- :style="column.searchControlWidth"
219
- @keyup.enter="submitForm('searchForm')"
220
- @input="setValueToModelProp(column.prop,$event)"
221
- />
222
- </el-form-item>
204
+ <el-rate
205
+ v-else-if="column.componentType && column.componentType === 'rate'"
206
+ :model-value="getFormItemValue(column.prop)"
207
+ :style="column.searchControlWidth"
208
+ @change="setValueToModelProp(column.prop, $event)"
209
+ />
210
+ <el-input
211
+ v-else
212
+ :model-value="getFormItemValue(column.prop)"
213
+ :style="column.searchControlWidth"
214
+ @keyup.enter="submitForm('searchForm')"
215
+ @input="setValueToModelProp(column.prop, $event)"
216
+ />
217
+ </el-form-item>
223
218
  </template>
224
219
 
225
220
  <script>
226
- import {$emit} from '../../utils/gogocodeTransfer'
221
+ import { $emit } from '../../utils/gogocodeTransfer'
227
222
  import searchMethods from './search-methods'
228
223
  import searchFormNumber from './search-form-number.vue'
229
224
  import store from './store'
230
- import {getDynamicDataSourceOptions, isDynamicDataSourceSource, getControlConfig} from './utils'
225
+ import { getDynamicDataSourceOptions, isDynamicDataSourceSource, getControlConfig } from './utils'
226
+ import { type } from 'os'
231
227
 
232
228
  export default {
233
- name: 'SearchFormItem',
234
- components: {
235
- searchFormNumber,
236
- },
237
- inject: ['getListToolbarFormData'],
238
- props: {
239
- column: {
240
- type: Object,
241
- default: null,
242
- },
243
- code: {
244
- type: String,
245
- default: null,
246
- },
247
- isSql: {
248
- type: Boolean,
249
- default: false,
250
- },
251
- tableName: {
252
- type: String,
253
- default: null,
254
- },
255
- isJoinTable: {
256
- type: Boolean,
257
- default: false,
258
- },
259
- // 查询表单信息
260
- searchForm: {
261
- type: Object,
262
- default: null,
263
- },
264
- index: {
265
- type: Number,
266
- default: 0,
267
- },
268
- length: {
269
- type: Number,
270
- default: 0,
271
- },
272
- loadCompleteQuery: {
273
- type: Boolean,
274
- default: false,
275
- },
276
- labelWidth: {
277
- type: [String, Number, undefined],
278
- default: undefined,
279
- },
280
- },
281
- data() {
282
- const customComponentNames = new Set()
283
- return {
284
- customComponentNames: customComponentNames,
285
- dateOne: null,
286
- dataTwo: null,
287
- moduleConfig: {},
288
- dateVal: this.getFormItemValue(this.column.prop),
289
- controlConfig: getControlConfig(this.column)
290
- }
291
- },
292
- computed: {
293
- listToolbarFormData() {
294
- const data = this.getListToolbarFormData()
295
- if (data && data.listToolbarFormData) {
296
- return data.listToolbarFormData
297
- }
298
- return null
299
- }
300
- },
301
- created() {
302
- if (this.column.valueSetOptions) {
303
- this.moduleConfig = JSON.parse(this.column.valueSetOptions)
304
- }
305
- console.log('searchitem页面', this.column)
306
- },
307
- mounted() {
308
- // 查询页面加载完成
309
- if (this.index + 1 === this.length && this.loadCompleteQuery) {
310
- $emit(this, 'submit-form')
311
- }
312
- },
313
- methods: {
314
- ...searchMethods,
315
- getDynamicDataSourceOptions(column) {
316
- const gridParams = store.get(this.code)
317
- let baseURL = gridParams.options.backendUrl
318
- if (!baseURL) {
319
- baseURL = window.$vueApp.config.globalProperties.baseURL
320
- }
321
- return getDynamicDataSourceOptions(
322
- column,
323
- this.isSql,
324
- gridParams.additionalParamMap,
325
- baseURL
326
- )
327
- },
328
- // 值设置是否是动态数据源类型的数据源
329
- isDynamicDataSourceSource(column) {
330
- return isDynamicDataSourceSource(column)
331
- },
332
- setValueToModelProp(prop, value, componentName, index) {
333
- console.log('%c描述-105004', 'color:#2E3435;background:#F8BB07;padding:3px;border-radius:2px', prop, value, componentName, index);
334
- if (prop && prop.indexOf('.') > 0) {
335
- const parentOjbect = this.getParentObject(prop)
336
- // 嵌套属性中的最后一个属性是属于这个中间父对象的,所有要通过中间父对象来赋值
337
- if (index != null && index !== undefined) {
338
- // parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)][index] = value
339
- parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)][index] = value
340
- } else {
341
- parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)] = value
342
- }
343
- } else {
344
- if (index != null && index !== undefined) {
345
- this.searchForm[prop][index] = value
346
- } else {
347
- this.searchForm[prop] = value
348
- }
349
- }
350
- },
351
- getLabelWidth(querySetting) {
352
- const configData = JSON.parse(querySetting)
353
- if (
354
- configData.labelWidth !== '' &&
355
- configData.labelWidth !== null &&
356
- configData.labelWidth !== undefined
357
- ) {
358
- return configData.labelWidth + 'px'
359
- } else {
360
- return '110px'
361
- }
362
- },
363
- componentTypeTypeIsTree(componentType) {
364
- if (componentType) {
365
- if (componentType.indexOf('DeptManTree') > 0) {
366
- // 说明是部门人员树
367
- return true
368
- }
369
- if (componentType.indexOf('DeptTree') > 0) {
370
- // 说明是部门树
371
- return true
372
- }
373
- if (componentType.indexOf('WgManTree') > 0) {
374
- // 说明是工作组人员树
375
- return true
376
- }
377
- if (componentType.indexOf('WgManTree') > 0) {
378
- // 说明是工作组树
379
- return true
380
- }
381
- }
382
- return false
383
- },
384
- getTreeFields(orgTreeSetJson) {
385
- if (orgTreeSetJson && orgTreeSetJson !== '') {
386
- const orgTreeSet = JSON.parse(orgTreeSetJson)
387
- if (orgTreeSet.length) {
388
- return orgTreeSet
389
- } else {
390
- if (orgTreeSet.orgTreeSetArr) {
391
- return orgTreeSet.orgTreeSetArr
392
- }
393
- }
394
- }
395
- },
396
- getTreeIsMultiTree(componentType) {
397
- if (
398
- componentType &&
399
- componentType.indexOf('single') >= 0 &&
400
- componentType.indexOf('Tree') > 0
401
- ) {
402
- return false
403
- } else {
404
- return true
405
- }
406
- },
407
- getTreeType(componentType) {
408
- if (componentType) {
409
- if (componentType.indexOf('DeptManTree') > 0) {
410
- // 说明是部门人员树
411
- return 'DeptUserTree'
412
- }
413
- if (componentType.indexOf('DeptTree') > 0) {
414
- // 说明是部门树
415
- return 'DeptTree'
416
- }
417
- if (componentType.indexOf('WgTree') > 0) {
418
- // 说明是工作组人员树
419
- return 'WgTree'
420
- }
421
- if (componentType.indexOf('WgManTree') > 0) {
422
- // 说明是工作组树
423
- return 'WgUserTree'
424
- }
425
- }
426
- },
427
- // 组织结构树文本框值改变事件
428
- organizationInputEvent(prop, value) {
429
- if (prop) {
430
- // 必须手动调用一下input事件,否则不会更新组件的值
431
- this.searchForm[prop] = value
432
- }
433
- },
434
- // 组织结构树文本框值清空事件
435
- clearOrganizationInputEvent(prop) {
436
- if (prop) {
437
- // 必须手动调用一下input事件,否则不会更新组件的值
438
- this.searchForm[prop] = null
439
- }
440
- },
441
- customComponent(column) {
442
- const gridParams = store.get(this.code)
443
- if (column.componentName && column.componentName !== '') {
444
- this.customComponentNames.add(column.componentName)
445
- return true
446
- }
447
- if (
448
- (!column.componentName || column.componentName === '') &&
449
- gridParams.options &&
450
- gridParams.options.search &&
451
- gridParams.options.search.customSearchElements
452
- ) {
453
- // 定义了自定义查询组件
454
- const propSearchEle =
455
- gridParams.options.search.customSearchElements[column.prop]
456
- // console.log('customComponent-customSearchElements-propSearchEle-', column.prop)
457
- if (propSearchEle) {
458
- column.componentName = 'custom-' + column.prop
459
- const component = propSearchEle.call(this, column)
460
- // console.log('customComponent-customSearchElements-')
461
- if (component) {
462
- this.customComponentNames.add(column.componentName)
463
- window.$vueApp.component(column.componentName, component)
464
- return true
465
- }
466
- }
467
- }
468
- return false
469
- },
470
- setNumberValue(value, r, n) {
471
- let itemValue = this.getFormItemValue(this.column.prop)
472
- itemValue = value
473
- this.setValueToModelProp(this.column.prop, itemValue)
474
- },
475
- setYearRangeValue(prop, value) {
476
- this.searchForm[prop][0] = value[0]
477
- this.searchForm[prop][1] = value[1]
478
- },
479
- getDefaultTime(column) {
480
- if (column['valueSetOptions']) {
481
- const valueSetOptions = JSON.parse(column['valueSetOptions'])
482
- if (valueSetOptions.defaultTime) {
483
- return [valueSetOptions.defaultTime, valueSetOptions.defaultTime]
484
- } else {
485
- return ['00:00:00']
486
- }
487
- } else {
488
- return ['00:00:00']
489
- }
490
- },
491
- },
492
- emits: ['submit-form'],
229
+ name: 'SearchFormItem',
230
+ components: {
231
+ searchFormNumber
232
+ },
233
+ inject: ['getListToolbarFormData'],
234
+ props: {
235
+ column: {
236
+ type: Object,
237
+ default: null
238
+ },
239
+ code: {
240
+ type: String,
241
+ default: null
242
+ },
243
+ isSql: {
244
+ type: Boolean,
245
+ default: false
246
+ },
247
+ tableName: {
248
+ type: String,
249
+ default: null
250
+ },
251
+ isJoinTable: {
252
+ type: Boolean,
253
+ default: false
254
+ },
255
+ // 查询表单信息
256
+ searchForm: {
257
+ type: Object,
258
+ default: null
259
+ },
260
+ index: {
261
+ type: Number,
262
+ default: 0
263
+ },
264
+ length: {
265
+ type: Number,
266
+ default: 0
267
+ },
268
+ loadCompleteQuery: {
269
+ type: Boolean,
270
+ default: false
271
+ },
272
+ labelWidth: {
273
+ type: [String, Number, undefined],
274
+ default: undefined
275
+ }
276
+ },
277
+ data() {
278
+ const customComponentNames = new Set()
279
+ return {
280
+ customComponentNames: customComponentNames,
281
+ dateOne: null,
282
+ dataTwo: null,
283
+ moduleConfig: {},
284
+ dateVal: this.getFormItemValue(this.column.prop),
285
+ controlConfig: getControlConfig(this.column)
286
+ }
287
+ },
288
+ computed: {
289
+ listToolbarFormData() {
290
+ const data = this.getListToolbarFormData()
291
+ if (data && data.listToolbarFormData) {
292
+ return data.listToolbarFormData
293
+ }
294
+ return null
295
+ }
296
+ },
297
+ created() {
298
+ if (this.column.valueSetOptions) {
299
+ this.moduleConfig = JSON.parse(this.column.valueSetOptions)
300
+ }
301
+ console.log('searchitem页面', this.column)
302
+ },
303
+ mounted() {
304
+ // 查询页面加载完成
305
+ if (this.index + 1 === this.length && this.loadCompleteQuery) {
306
+ $emit(this, 'submit-form')
307
+ }
308
+ },
309
+ methods: {
310
+ ...searchMethods,
311
+ getDynamicDataSourceOptions(column) {
312
+ const gridParams = store.get(this.code)
313
+ let baseURL = gridParams.options.backendUrl
314
+ if (!baseURL) {
315
+ baseURL = window.$vueApp.config.globalProperties.baseURL
316
+ }
317
+ return getDynamicDataSourceOptions(column, this.isSql, gridParams.additionalParamMap, baseURL)
318
+ },
319
+ // 值设置是否是动态数据源类型的数据源
320
+ isDynamicDataSourceSource(column) {
321
+ return isDynamicDataSourceSource(column)
322
+ },
323
+ setValueToModelProp(prop, value, componentName, index) {
324
+ console.log(
325
+ '%c描述-105004',
326
+ 'color:#2E3435;background:#F8BB07;padding:3px;border-radius:2px',
327
+ prop,
328
+ value,
329
+ componentName,
330
+ index
331
+ )
332
+ if (prop && prop.indexOf('.') > 0) {
333
+ const parentOjbect = this.getParentObject(prop)
334
+ // 嵌套属性中的最后一个属性是属于这个中间父对象的,所有要通过中间父对象来赋值
335
+ if (index != null && index !== undefined) {
336
+ // parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)][index] = value
337
+ parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)][index] = value
338
+ } else {
339
+ parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)] = value
340
+ }
341
+ } else {
342
+ if (index != null && index !== undefined) {
343
+ this.searchForm[prop][index] = value
344
+ } else {
345
+ this.searchForm[prop] = value
346
+ }
347
+ }
348
+ },
349
+ getLabelWidth(querySetting) {
350
+ const configData = JSON.parse(querySetting)
351
+ if (configData.labelWidth !== '' && configData.labelWidth !== null && configData.labelWidth !== undefined) {
352
+ return configData.labelWidth + 'px'
353
+ } else {
354
+ return '110px'
355
+ }
356
+ },
357
+ componentTypeTypeIsTree(componentType) {
358
+ if (componentType) {
359
+ if (componentType.indexOf('DeptManTree') > 0) {
360
+ // 说明是部门人员树
361
+ return true
362
+ }
363
+ if (componentType.indexOf('DeptTree') > 0) {
364
+ // 说明是部门树
365
+ return true
366
+ }
367
+ if (componentType.indexOf('WgManTree') > 0) {
368
+ // 说明是工作组人员树
369
+ return true
370
+ }
371
+ if (componentType.indexOf('WgManTree') > 0) {
372
+ // 说明是工作组树
373
+ return true
374
+ }
375
+ }
376
+ return false
377
+ },
378
+ getTreeFields(orgTreeSetJson) {
379
+ if (orgTreeSetJson && orgTreeSetJson !== '') {
380
+ const orgTreeSet = JSON.parse(orgTreeSetJson)
381
+ if (orgTreeSet.length) {
382
+ return orgTreeSet
383
+ } else {
384
+ if (orgTreeSet.orgTreeSetArr) {
385
+ return orgTreeSet.orgTreeSetArr
386
+ }
387
+ }
388
+ }
389
+ },
390
+ getTreeIsMultiTree(componentType) {
391
+ if (componentType && componentType.indexOf('single') >= 0 && componentType.indexOf('Tree') > 0) {
392
+ return false
393
+ } else {
394
+ return true
395
+ }
396
+ },
397
+ getTreeType(componentType) {
398
+ if (componentType) {
399
+ if (componentType.indexOf('DeptManTree') > 0) {
400
+ // 说明是部门人员树
401
+ return 'DeptUserTree'
402
+ }
403
+ if (componentType.indexOf('DeptTree') > 0) {
404
+ // 说明是部门树
405
+ return 'DeptTree'
406
+ }
407
+ if (componentType.indexOf('WgTree') > 0) {
408
+ // 说明是工作组人员树
409
+ return 'WgTree'
410
+ }
411
+ if (componentType.indexOf('WgManTree') > 0) {
412
+ // 说明是工作组树
413
+ return 'WgUserTree'
414
+ }
415
+ }
416
+ },
417
+ // 组织结构树文本框值改变事件
418
+ organizationInputEvent(prop, value) {
419
+ if (prop) {
420
+ // 必须手动调用一下input事件,否则不会更新组件的值
421
+ this.searchForm[prop] = value
422
+ }
423
+ },
424
+ // 组织结构树文本框值清空事件
425
+ clearOrganizationInputEvent(prop) {
426
+ if (prop) {
427
+ // 必须手动调用一下input事件,否则不会更新组件的值
428
+ this.searchForm[prop] = null
429
+ }
430
+ },
431
+ customComponent(column) {
432
+ const gridParams = store.get(this.code)
433
+ if (column.componentName && column.componentName !== '') {
434
+ this.customComponentNames.add(column.componentName)
435
+ return true
436
+ }
437
+ if (
438
+ (!column.componentName || column.componentName === '') &&
439
+ gridParams.options &&
440
+ gridParams.options.search &&
441
+ gridParams.options.search.customSearchElements
442
+ ) {
443
+ // 定义了自定义查询组件
444
+ const propSearchEle = gridParams.options.search.customSearchElements[column.prop]
445
+ // console.log('customComponent-customSearchElements-propSearchEle-', column.prop)
446
+ if (propSearchEle) {
447
+ column.componentName = 'custom-' + column.prop
448
+ const component = propSearchEle.call(this, column)
449
+ // console.log('customComponent-customSearchElements-')
450
+ if (component) {
451
+ this.customComponentNames.add(column.componentName)
452
+ window.$vueApp.component(column.componentName, component)
453
+ return true
454
+ }
455
+ }
456
+ }
457
+ return false
458
+ },
459
+ setNumberValue(value, r, n) {
460
+ let itemValue = this.getFormItemValue(this.column.prop)
461
+ itemValue = value
462
+ this.setValueToModelProp(this.column.prop, itemValue)
463
+ },
464
+ setYearRangeValue(prop, value) {
465
+ this.searchForm[prop][0] = value[0]
466
+ this.searchForm[prop][1] = value[1]
467
+ },
468
+ getDefaultTime(column) {
469
+ if (column['valueSetOptions']) {
470
+ const valueSetOptions = JSON.parse(column['valueSetOptions'])
471
+ if (valueSetOptions.defaultTime) {
472
+ return [valueSetOptions.defaultTime, valueSetOptions.defaultTime]
473
+ } else {
474
+ return ['00:00:00']
475
+ }
476
+ } else {
477
+ return ['00:00:00']
478
+ }
479
+ },
480
+ multiselectChange(arr, selectedItem) {
481
+ if (arr.indexOf('saveAll') !== -1) {
482
+ if (this.searchForm[this.column.prop] && typeof this.searchForm[this.column.prop] === 'string') {
483
+ this.searchForm[this.column.prop] = this.searchForm[this.column.prop].split(',')
484
+ } else {
485
+ this.searchForm[this.column.prop] = []
486
+ }
487
+ } else {
488
+ this.searchForm[this.column.prop] = arr
489
+ }
490
+ }
491
+ },
492
+ emits: ['submit-form']
493
493
  }
494
494
  </script>
495
495
 
496
496
  <style lang="scss" scoped>
497
497
  :deep(.el-range-separator) {
498
- min-width: 20px;
498
+ min-width: 20px;
499
499
  }
500
500
  </style>