imatrix-ui 2.9.12-dw-export1 → 2.9.14-dw
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.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +7 -7
- package/package.json +1 -1
- package/packages/plugins/export-data-new.js +5 -6
- package/packages/super-grid/src/search-form-item.vue +19 -1
- package/packages/super-grid/src/search-form-open.vue +8 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +8 -0
- package/packages/super-grid/src/search-form.vue +10 -2
- package/packages/super-grid/src/search-methods.js +73 -12
- package/packages/super-grid/src/super-grid-service.js +40 -8
- package/packages/super-grid/src/super-grid.vue +9 -0
- package/packages/super-grid/src/utils.js +7 -8
- package/src/i18n/langs/cn.js +2 -1
- package/src/i18n/langs/en.js +2 -1
- package/src/utils/jump-page-utils.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Message
|
|
3
|
-
} from '
|
|
3
|
+
} from 'element-ui'
|
|
4
4
|
import Vue from 'vue'
|
|
5
5
|
import {
|
|
6
6
|
getI18n
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
* @param {*} listCode 如果是九宫格组件导出时,如果页面中有多个九宫格时,该属性需要传“listCode~gridId”,例如:
|
|
21
21
|
* @param {*} exportOptions
|
|
22
22
|
*/
|
|
23
|
-
function exportData(
|
|
23
|
+
function exportData(dataParam, excelName, listCode, functionCode, uuid, exportOptions, isAsync, pageCode) {
|
|
24
24
|
return new Promise((resolve, reject) => {
|
|
25
|
-
exportResultData(
|
|
25
|
+
exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid, isAsync, pageCode).then(result => {
|
|
26
26
|
// 表示导出成功,需要执行导出成功回调方法
|
|
27
27
|
if (isHasTheOption('afterExport', exportOptions) && typeof (exportOptions.afterExport) === 'function') {
|
|
28
28
|
exportOptions.afterExport.call(this)
|
|
@@ -39,7 +39,7 @@ function exportData(isAsync, pageCode, dataParam, excelName, listCode, functionC
|
|
|
39
39
|
/**
|
|
40
40
|
* 导出数据
|
|
41
41
|
*/
|
|
42
|
-
function exportResultData(
|
|
42
|
+
function exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid, isAsync, pageCode) {
|
|
43
43
|
return new Promise((resolve, reject) => {
|
|
44
44
|
// 从store缓存中取出列表信息
|
|
45
45
|
if (store.get(listCode + 'basicInfo')) {
|
|
@@ -426,7 +426,7 @@ function getExportData(data, excelName) {
|
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
function isHasTheOption(event, exportOptions) {
|
|
429
|
-
if (typeof (exportOptions) !== 'undefined' && typeof (exportOptions[event]) !== 'undefined') {
|
|
429
|
+
if (exportOptions !== null && typeof (exportOptions) !== 'undefined' && typeof (exportOptions[event]) !== 'undefined') {
|
|
430
430
|
return true
|
|
431
431
|
}
|
|
432
432
|
return false
|
|
@@ -464,4 +464,3 @@ export default {
|
|
|
464
464
|
exportData,
|
|
465
465
|
download
|
|
466
466
|
}
|
|
467
|
-
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
type="yearRange"
|
|
42
42
|
@change="setYearRangeValue(column.prop,$event)"
|
|
43
43
|
/>
|
|
44
|
-
<el-
|
|
44
|
+
<el-date-picker
|
|
45
45
|
v-else-if="column.componentType==='dateTimePicker'"
|
|
46
46
|
:value="getFormItemValue(column.prop)"
|
|
47
47
|
:default-time="getDefaultTime(column)"
|
|
@@ -219,6 +219,18 @@ export default {
|
|
|
219
219
|
searchForm: {
|
|
220
220
|
type: Object,
|
|
221
221
|
default: null
|
|
222
|
+
},
|
|
223
|
+
index: {
|
|
224
|
+
type: Number,
|
|
225
|
+
default: 0
|
|
226
|
+
},
|
|
227
|
+
length: {
|
|
228
|
+
type: Number,
|
|
229
|
+
default: 0
|
|
230
|
+
},
|
|
231
|
+
loadCompleteQuery: {
|
|
232
|
+
type: Boolean,
|
|
233
|
+
default: false
|
|
222
234
|
}
|
|
223
235
|
},
|
|
224
236
|
data() {
|
|
@@ -229,6 +241,12 @@ export default {
|
|
|
229
241
|
dataTwo: null
|
|
230
242
|
}
|
|
231
243
|
},
|
|
244
|
+
mounted() {
|
|
245
|
+
// 查询页面加载完成
|
|
246
|
+
if ((this.index + 1) === this.length && this.loadCompleteQuery) {
|
|
247
|
+
this.$emit('submit-form')
|
|
248
|
+
}
|
|
249
|
+
},
|
|
232
250
|
methods: {
|
|
233
251
|
...searchMethods,
|
|
234
252
|
getDynamicDataSourceOptions(column) {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
:is-sql="isSql"
|
|
14
14
|
:table-name="tableName"
|
|
15
15
|
:is-join-table="isJoinTable"
|
|
16
|
+
:index="fieldNum*(r-1)+(n-1)"
|
|
17
|
+
:length="searchableColumns.length"
|
|
18
|
+
:load-complete-query="loadCompleteQuery"
|
|
19
|
+
@submit-form="$emit('submit-form')"
|
|
16
20
|
/>
|
|
17
21
|
</template>
|
|
18
22
|
<!--初始进入台账页面时 或 展开时显示按钮--->
|
|
@@ -98,6 +102,10 @@ export default {
|
|
|
98
102
|
isOpen: {
|
|
99
103
|
type: Boolean,
|
|
100
104
|
default: false
|
|
105
|
+
},
|
|
106
|
+
loadCompleteQuery: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: false
|
|
101
109
|
}
|
|
102
110
|
},
|
|
103
111
|
data() {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
:field-num="fieldNum"
|
|
14
14
|
:row-num="rowNum"
|
|
15
15
|
:is-open="isOpen"
|
|
16
|
+
:load-complete-query="loadCompleteQuery"
|
|
16
17
|
@submit-form="$emit('submit-form')"
|
|
17
18
|
@reset-form="$emit('reset-form')"
|
|
18
19
|
@save-condition="$emit('save-condition')"
|
|
@@ -100,6 +101,10 @@ export default {
|
|
|
100
101
|
spanNum: {
|
|
101
102
|
type: Number,
|
|
102
103
|
default: 8
|
|
104
|
+
},
|
|
105
|
+
loadCompleteQuery: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
},
|
|
@@ -166,11 +171,14 @@ export default {
|
|
|
166
171
|
} else {
|
|
167
172
|
this.searchForm[column.prop] = null
|
|
168
173
|
}
|
|
174
|
+
this.setDefaultQueryValue(column, this.searchForm)
|
|
169
175
|
}
|
|
170
176
|
})
|
|
171
177
|
// 取消当前选中的条件列表的信息
|
|
172
178
|
// this.$refs.searchConditionList.editConditionId = null
|
|
173
179
|
// this.$emit('reset')
|
|
180
|
+
// 重置条件后查询列表
|
|
181
|
+
this.$emit('submit-form')
|
|
174
182
|
},
|
|
175
183
|
openFold(isOpen) {
|
|
176
184
|
this.isOpen = isOpen
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
:span-num="spanNum"
|
|
22
22
|
:rules="rules"
|
|
23
23
|
:is-sql="isSql"
|
|
24
|
+
:load-complete-query="loadCompleteQuery"
|
|
24
25
|
@submit-form="submitForm('searchForm')"
|
|
25
26
|
@reset-form="resetForm('searchForm')"
|
|
26
27
|
@save-condition="saveCondition()"
|
|
@@ -133,6 +134,10 @@ export default {
|
|
|
133
134
|
default: () => {
|
|
134
135
|
return {}
|
|
135
136
|
}
|
|
137
|
+
},
|
|
138
|
+
loadCompleteQuery: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: false
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
},
|
|
@@ -168,6 +173,7 @@ export default {
|
|
|
168
173
|
} else {
|
|
169
174
|
searchForm[column.prop] = null
|
|
170
175
|
}
|
|
176
|
+
this.setDefaultQueryValue(column, searchForm)
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
})
|
|
@@ -435,8 +441,10 @@ export default {
|
|
|
435
441
|
this.$refs.searchFormOrdinarySearch.resetForm()
|
|
436
442
|
} else if (this.searchType === 'advanced') {
|
|
437
443
|
this.$refs.searchFormAdvancedQuery.resetForm()
|
|
444
|
+
this.$emit('reset')
|
|
438
445
|
}
|
|
439
|
-
|
|
446
|
+
// 子组件重置完成后调用reset方法 同步执行
|
|
447
|
+
// this.$emit('reset')
|
|
440
448
|
},
|
|
441
449
|
setNumberValue(value, r, n) {
|
|
442
450
|
let itemValue = this.getFormItemValue(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop)
|
|
@@ -571,7 +579,7 @@ export default {
|
|
|
571
579
|
}
|
|
572
580
|
}
|
|
573
581
|
if (isRangeQueryValue) {
|
|
574
|
-
searchForm[prop] = [item.startValue, item.endValue]
|
|
582
|
+
searchForm[prop] = [new Date(item.startValue), new Date(item.endValue)]
|
|
575
583
|
} else {
|
|
576
584
|
if (searchForm[prop]) {
|
|
577
585
|
if (searchForm[prop] instanceof Array) {
|
|
@@ -11,7 +11,7 @@ const searchMethods = {
|
|
|
11
11
|
// sql查询时,会把点“.”改为两个下划线"__"
|
|
12
12
|
const replaceDot = '__'
|
|
13
13
|
if (orgProp && orgProp.indexOf(replaceDot) > 0) {
|
|
14
|
-
|
|
14
|
+
// 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
|
|
15
15
|
orgProp = orgProp.replace(replaceDot, '.')
|
|
16
16
|
}
|
|
17
17
|
param.propName = orgProp
|
|
@@ -22,7 +22,7 @@ const searchMethods = {
|
|
|
22
22
|
param.formatter = column.formatter ? JSON.parse(JSON.stringify(column.formatter)) : column.formatter
|
|
23
23
|
const values = this.getFormItemValue(column.prop)
|
|
24
24
|
if (column.dataType === 'DATE' || column.dataType === 'TIME') {
|
|
25
|
-
|
|
25
|
+
// 日期 或 时间类型
|
|
26
26
|
// console.log('values==', values, column.prop)
|
|
27
27
|
if (values !== null && values.length === 2 && values[0] !== null && values[1] !== null) {
|
|
28
28
|
const format = this.getDateTimeSearchFormatter(column, column.dataType, column.formatter)
|
|
@@ -40,8 +40,8 @@ const searchMethods = {
|
|
|
40
40
|
searchParams.push(param)
|
|
41
41
|
}
|
|
42
42
|
} else if ((column.dataType === 'INTEGER' || column.dataType === 'LONG' || column.dataType === 'DOUBLE') &&
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
Array.isArray(values)) {
|
|
44
|
+
// 日期 或 时间类型
|
|
45
45
|
// const values1 = this.getFormItemValue(column.prop)
|
|
46
46
|
if (values) {
|
|
47
47
|
if (column.componentType === 'yearRange') {
|
|
@@ -118,7 +118,7 @@ const searchMethods = {
|
|
|
118
118
|
this.packageValueWithArray(propValue, searchParams, param)
|
|
119
119
|
} else {
|
|
120
120
|
if (column.componentType === 'multiselect') {
|
|
121
|
-
|
|
121
|
+
// 表示是多选下拉框选择器选择的值
|
|
122
122
|
const values = this.getFormItemValue(column.prop)
|
|
123
123
|
// console.log('values==', values, column.prop)
|
|
124
124
|
this.packageValueWithArray(values, searchParams, param)
|
|
@@ -141,14 +141,14 @@ const searchMethods = {
|
|
|
141
141
|
// sql查询时,会把点“.”改为两个下划线"__"
|
|
142
142
|
const replaceDot = '__'
|
|
143
143
|
if (orgProp && orgProp.indexOf(replaceDot) > 0) {
|
|
144
|
-
|
|
144
|
+
// 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
|
|
145
145
|
orgProp = orgProp.replace(replaceDot, '.')
|
|
146
146
|
}
|
|
147
147
|
newParam.propName = orgProp
|
|
148
148
|
newParam.operator = this.getOperator(param)
|
|
149
149
|
newParam.matchingType = param.queryMatching
|
|
150
150
|
if (newParam.dataType === 'DATE' || newParam.dataType === 'TIME') {
|
|
151
|
-
|
|
151
|
+
// 日期 或 时间类型
|
|
152
152
|
const values = newParam.value
|
|
153
153
|
// console.log('values==', values, column.prop)
|
|
154
154
|
if (values !== null && values.length === 2 && values[0] !== null && values[1] !== null) {
|
|
@@ -159,7 +159,7 @@ const searchMethods = {
|
|
|
159
159
|
const values1 = newParam.value
|
|
160
160
|
if (values1) {
|
|
161
161
|
if (!Array.isArray(values1) || values1.length < 2 || values1[0] === null && values1[1] === null) {
|
|
162
|
-
|
|
162
|
+
// 填写了一个有效值
|
|
163
163
|
if (!Array.isArray(values1)) {
|
|
164
164
|
newParam.propValue = values1
|
|
165
165
|
} else if (values1.length < 2) {
|
|
@@ -170,7 +170,7 @@ const searchMethods = {
|
|
|
170
170
|
newParam.propValue = values1[0]
|
|
171
171
|
}
|
|
172
172
|
} else {
|
|
173
|
-
|
|
173
|
+
// 填写了两个有效值
|
|
174
174
|
newParam.startValue = values1[0]
|
|
175
175
|
newParam.endValue = values1[1]
|
|
176
176
|
}
|
|
@@ -209,7 +209,7 @@ const searchMethods = {
|
|
|
209
209
|
this.packageValueWithArray(propValue, newSearchFormList, param)
|
|
210
210
|
} else {
|
|
211
211
|
if (newParam.componentType === 'multiselect') {
|
|
212
|
-
|
|
212
|
+
// 表示是多选下拉框选择器选择的值
|
|
213
213
|
const values = newParam.value
|
|
214
214
|
// console.log('values==', values, column.prop)
|
|
215
215
|
this.packageValueWithArray(values, newSearchFormList, param)
|
|
@@ -258,6 +258,9 @@ const searchMethods = {
|
|
|
258
258
|
// 根据日期字符串获得日期毫秒值
|
|
259
259
|
getDateTimeMillsByDateStr(dateStr, format) {
|
|
260
260
|
if (typeof (dateStr) === 'string' && format) {
|
|
261
|
+
if (dateStr.indexOf('T') !== -1) {
|
|
262
|
+
return new Date(dateStr).getTime()
|
|
263
|
+
}
|
|
261
264
|
// 表示是格式化后的值,转成date毫秒值传给后台,解决时区问题
|
|
262
265
|
format = format.toLowerCase()
|
|
263
266
|
if (format.indexOf('h') > 0 && format.indexOf('m') > 0 && format.indexOf('s') > 0) {
|
|
@@ -288,8 +291,8 @@ const searchMethods = {
|
|
|
288
291
|
},
|
|
289
292
|
getOperator(column) {
|
|
290
293
|
if ((column.dataType === 'TEXT' || column.dataType === 'CLOB') && column.fuzzy &&
|
|
291
|
-
|
|
292
|
-
|
|
294
|
+
(!column.componentType || (column.componentType && ((column.componentType !== 'select' && column.componentType !== 'multiselect') ||
|
|
295
|
+
(column.componentType === 'multiselect' && column.ifMultiData !== undefined && column.ifMultiData === true))))) {
|
|
293
296
|
// 是否是文本类型的字段,且启用了模糊查询,则表示操作符为contains模糊查询
|
|
294
297
|
return 'CONTAIN'
|
|
295
298
|
} else if (Array.isArray(this.getFormItemValue(column.prop))) {
|
|
@@ -382,6 +385,64 @@ const searchMethods = {
|
|
|
382
385
|
// 查询条件
|
|
383
386
|
getSearchCondition(conditionId) {
|
|
384
387
|
return this.$http.get(Vue.prototype.baseAPI + '/component/super-grids/search-conditions/' + conditionId)
|
|
388
|
+
},
|
|
389
|
+
// 设置默认查询值
|
|
390
|
+
setDefaultQueryValue(column, searchForm) {
|
|
391
|
+
if (column.componentType === 'date' || column.componentType === 'dateSection' ||
|
|
392
|
+
column.componentType === 'timePicker' || column.componentType === 'dateTimePicker') {
|
|
393
|
+
const formatList = { 'date': 'YYYYMMDD', 'dateSection': 'YYYYMMDDHHMMSS', 'timePicker': 'YYYYMMDD', 'dateTimePicker': 'YYYYMMDDHHMMSS' }
|
|
394
|
+
const valueTypeList = { 'date': 'String', 'dateSection': 'Date', 'timePicker': 'String', 'dateTimePicker': 'String' }
|
|
395
|
+
const rowControlConfig = column['controlConfig']
|
|
396
|
+
if (rowControlConfig !== null && rowControlConfig !== undefined && rowControlConfig !== '') {
|
|
397
|
+
const controlConfig = JSON.parse(rowControlConfig)
|
|
398
|
+
if (controlConfig.timeDefaultQueryRange) {
|
|
399
|
+
const format = formatList[column.componentType]
|
|
400
|
+
const valueType = valueTypeList[column.componentType]
|
|
401
|
+
if (format && valueType) {
|
|
402
|
+
const queryRange = this.getDateQueryRange(column.componentType, format, controlConfig.timeDefaultQueryRange, valueType)
|
|
403
|
+
searchForm[column.prop] = queryRange
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
// 获取近一周,近两周,近一个月的时间范围
|
|
410
|
+
// componentType组件类型 date time
|
|
411
|
+
// format 格式 年月日/年月日时分秒
|
|
412
|
+
// queryRangeType 查询范围类型 近一周nearlyWeek/近两周nearlyTwoWeeks/近一个月nearlyMonth
|
|
413
|
+
// valueType 返回对象类型 String Date
|
|
414
|
+
getDateQueryRange(componentType, format, timeDefaultQueryRange, valueType) {
|
|
415
|
+
const queryRange = []
|
|
416
|
+
const nowDate = new Date() // 当前时间
|
|
417
|
+
let startDate// 开始时间
|
|
418
|
+
const endDate = new Date()// 结束时间
|
|
419
|
+
if (timeDefaultQueryRange !== null && timeDefaultQueryRange > 0) {
|
|
420
|
+
startDate = new Date(nowDate.setDate(nowDate.getDate() - parseInt(timeDefaultQueryRange)))
|
|
421
|
+
}
|
|
422
|
+
if (format === 'YYYYMMDD') {
|
|
423
|
+
queryRange[0] = startDate.getFullYear() + '-' + (startDate.getMonth() + 1) + '-' + startDate.getDate()
|
|
424
|
+
queryRange[1] = endDate.getFullYear() + '-' + (endDate.getMonth() + 1) + '-' + endDate.getDate()
|
|
425
|
+
} else {
|
|
426
|
+
queryRange[0] = startDate.getFullYear() + '-' + (startDate.getMonth() + 1) + '-' + startDate.getDate() + ' 00:00:00'
|
|
427
|
+
queryRange[1] = endDate.getFullYear() + '-' + (endDate.getMonth() + 1) + '-' + endDate.getDate() + ' 23:59:59'
|
|
428
|
+
}
|
|
429
|
+
if (valueType === 'Date') {
|
|
430
|
+
const queryRangeFormat = []
|
|
431
|
+
queryRange.forEach(date => {
|
|
432
|
+
var tempStrs = date.split(' ')
|
|
433
|
+
var dateStrs = tempStrs[0].split('-')
|
|
434
|
+
var year = parseInt(dateStrs[0], 10)
|
|
435
|
+
var month = parseInt(dateStrs[1], 10) - 1
|
|
436
|
+
var day = parseInt(dateStrs[2], 10)
|
|
437
|
+
var timeStrs = tempStrs[1].split(':')
|
|
438
|
+
var hour = parseInt(timeStrs[0], 10)
|
|
439
|
+
var minute = parseInt(timeStrs[1], 10)
|
|
440
|
+
var second = parseInt(timeStrs[2], 10)
|
|
441
|
+
queryRangeFormat.push(new Date(year, month, day, hour, minute, second))
|
|
442
|
+
})
|
|
443
|
+
return queryRangeFormat
|
|
444
|
+
}
|
|
445
|
+
return queryRange
|
|
385
446
|
}
|
|
386
447
|
}
|
|
387
448
|
export default searchMethods
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
|
-
import Vue from 'vue'
|
|
3
2
|
import Sortable from 'sortablejs'
|
|
4
|
-
import
|
|
3
|
+
import Vue from 'vue'
|
|
5
4
|
import {
|
|
6
5
|
packageEnumAndBeanColumnValueSets
|
|
7
6
|
} from '../../utils/value-set'
|
|
7
|
+
import store from './store'
|
|
8
8
|
import {
|
|
9
9
|
isHasOptionFunction
|
|
10
10
|
} from './utils'
|
|
@@ -72,6 +72,8 @@ const superGridService = {
|
|
|
72
72
|
// 初始化组件时先获取元信息再获取数据,以后翻页、排序、查询不再去获取元数据了
|
|
73
73
|
this.$http.post(url, param).then(data => {
|
|
74
74
|
const p1 = new Date().getTime()
|
|
75
|
+
// 判断是否查询组件渲染完之后查询
|
|
76
|
+
this.isLoadCompleteQuery(data.columns)
|
|
75
77
|
// 行编辑设置所有字段的默认值null时使用,优化行编辑性能
|
|
76
78
|
let allColumns = []
|
|
77
79
|
allColumns = allColumns.concat(JSON.parse(JSON.stringify(data.columns)))
|
|
@@ -189,10 +191,20 @@ const superGridService = {
|
|
|
189
191
|
// 表示是页面展示模式
|
|
190
192
|
} else if (typeof (this.options.initSearch) === 'undefined') {
|
|
191
193
|
if (typeof (gridParams.basicInfo.initializationQuery) === 'undefined' || gridParams.basicInfo.initializationQuery) {
|
|
192
|
-
|
|
194
|
+
// 判断是否初始化完查询条件后再查询数据
|
|
195
|
+
if (this.loadCompleteQuery) {
|
|
196
|
+
this.isLoading = false
|
|
197
|
+
} else {
|
|
198
|
+
this.fetchData()
|
|
199
|
+
}
|
|
193
200
|
}
|
|
194
201
|
} else if (this.options.initSearch !== false) {
|
|
195
|
-
|
|
202
|
+
// 判断是否初始化完查询条件后再查询数据
|
|
203
|
+
if (this.loadCompleteQuery) {
|
|
204
|
+
this.isLoading = false
|
|
205
|
+
} else {
|
|
206
|
+
this.fetchData()
|
|
207
|
+
}
|
|
196
208
|
}
|
|
197
209
|
}
|
|
198
210
|
this.createBackgroundColorMap()
|
|
@@ -211,6 +223,26 @@ const superGridService = {
|
|
|
211
223
|
console.log('初始化所耗时间', a1 - a)
|
|
212
224
|
})
|
|
213
225
|
},
|
|
226
|
+
isLoadCompleteQuery(columns) {
|
|
227
|
+
if (columns !== null) {
|
|
228
|
+
let queryParameterSize = 0
|
|
229
|
+
columns.forEach(column => {
|
|
230
|
+
if (column.hasOwnProperty('queryType') && column.hasOwnProperty('prop')) {
|
|
231
|
+
if (column.prop !== '$index' && column.prop !== '$selection') {
|
|
232
|
+
if (column.queryType && column.queryType !== 'no') {
|
|
233
|
+
// 配置了默认值
|
|
234
|
+
if (column.controlConfig) {
|
|
235
|
+
queryParameterSize++
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
if (queryParameterSize > 0) {
|
|
242
|
+
this.loadCompleteQuery = true
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
214
246
|
packageColumnOptionMap(gridParams) {
|
|
215
247
|
const columnOptionMap = {}
|
|
216
248
|
if (gridParams.columns && gridParams.columns.length > 0) {
|
|
@@ -268,13 +300,13 @@ const superGridService = {
|
|
|
268
300
|
const watchParentAttrs = dynamicColumnInfo.watchParentAttr.split(',')
|
|
269
301
|
watchParentAttrs.forEach(watchParentAttr => {
|
|
270
302
|
if (watchParentAttr) {
|
|
271
|
-
|
|
303
|
+
// 存储属性对应的值
|
|
272
304
|
if (!param.watchParentAttrValues) {
|
|
273
305
|
param.watchParentAttrValues = {}
|
|
274
306
|
}
|
|
275
307
|
param.watchParentAttrValues[watchParentAttr] = this.parentFormData[watchParentAttr]
|
|
276
|
-
const unWatch = this.$watch('parentFormData.' + watchParentAttr, function(newValue, oldValue) {
|
|
277
|
-
|
|
308
|
+
const unWatch = this.$watch('parentFormData.' + watchParentAttr, function (newValue, oldValue) {
|
|
309
|
+
// 重新加载表格及表格数据
|
|
278
310
|
if (!gridParams.dynamicTemp) {
|
|
279
311
|
gridParams.dynamicTemp = {}
|
|
280
312
|
}
|
|
@@ -284,7 +316,7 @@ const superGridService = {
|
|
|
284
316
|
}
|
|
285
317
|
gridParams.dynamicTemp.watchParentAttrValues[watchParentAttr] = newValue
|
|
286
318
|
if (this.$refs && this.$refs.superGrid) {
|
|
287
|
-
|
|
319
|
+
// 手动注销watch,否则会调用多次watch
|
|
288
320
|
unWatch()
|
|
289
321
|
// 重新加载表格及表格数据
|
|
290
322
|
this.$emit('reload-grid')
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:search-form-info="searchFormInfo"
|
|
12
12
|
:search-param="searchFormContent"
|
|
13
13
|
:init-search-props="initSearchProps"
|
|
14
|
+
:load-complete-query="loadCompleteQuery"
|
|
14
15
|
@search="doSearch"
|
|
15
16
|
@reset="resetSearch"
|
|
16
17
|
@open-fold="openFold"
|
|
@@ -352,6 +353,7 @@ export default {
|
|
|
352
353
|
summary: 'no'
|
|
353
354
|
},
|
|
354
355
|
columns: [],
|
|
356
|
+
loadCompleteQuery: false,
|
|
355
357
|
pagination: null,
|
|
356
358
|
query: null,
|
|
357
359
|
lineEdit: null,
|
|
@@ -2654,6 +2656,7 @@ export default {
|
|
|
2654
2656
|
// api方法,super-pages中有调用该方法
|
|
2655
2657
|
closePageDialog(popParams) {
|
|
2656
2658
|
// popParams格式为:{ entity, pageCode }
|
|
2659
|
+
console.log('列表组件--closePageDialog---this.jumpPageSetting=', this.jumpPageSetting )
|
|
2657
2660
|
if (this.jumpPageSetting) {
|
|
2658
2661
|
// 调用关闭弹框事件
|
|
2659
2662
|
const gridParams = store.get(this.code)
|
|
@@ -2684,6 +2687,12 @@ export default {
|
|
|
2684
2687
|
}
|
|
2685
2688
|
closeEvent.call(this, params)
|
|
2686
2689
|
}
|
|
2690
|
+
const isRefreshWhenClosePopup = this.jumpPageSetting.isRefreshWhenClosePopup
|
|
2691
|
+
if (isRefreshWhenClosePopup !== undefined && isRefreshWhenClosePopup === true) {
|
|
2692
|
+
// 关闭弹框时,刷新父页面列表
|
|
2693
|
+
const gridParams = store.get(this.code)
|
|
2694
|
+
this.search(gridParams.searchForm)
|
|
2695
|
+
}
|
|
2687
2696
|
}
|
|
2688
2697
|
this.isShowPageDialog = false
|
|
2689
2698
|
this.jumpPageSetting = null
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import store from './store'
|
|
2
1
|
import Vue from 'vue'
|
|
3
|
-
import {
|
|
4
|
-
isShowMenuRoute,
|
|
5
|
-
isPlateSys
|
|
6
|
-
} from '../../../src/utils/common-util'
|
|
7
2
|
import {
|
|
8
3
|
getToken
|
|
9
|
-
}
|
|
10
|
-
|
|
4
|
+
} from '../../../src/utils/auth'
|
|
5
|
+
import {
|
|
6
|
+
isPlateSys,
|
|
7
|
+
isShowMenuRoute
|
|
8
|
+
} from '../../../src/utils/common-util'
|
|
11
9
|
import {
|
|
12
10
|
getEntityFieldValue
|
|
13
11
|
} from '../../../src/utils/util'
|
|
12
|
+
import store from './store'
|
|
14
13
|
export function getColumnValues(data, prop) {
|
|
15
14
|
const values = []
|
|
16
15
|
for (const obj of data) {
|
|
@@ -390,7 +389,7 @@ export function getGridParams() {
|
|
|
390
389
|
'isRestoreByEsc': true, // 点击ESC时,是否撤销编辑,
|
|
391
390
|
'aftersaveIsCancelEditState': true, // 保存后,是否取消编辑状态
|
|
392
391
|
'afterRestoreIsCancelEditState': true, // 撤销编辑后,是否取消编辑状态
|
|
393
|
-
'input': function() {} // 数据改变时触发
|
|
392
|
+
'input': function () { } // 数据改变时触发
|
|
394
393
|
// 'beforeSave': function() { return true }, // 保存行数据前的回调
|
|
395
394
|
// 'saveSuccess': function() {}, // 保存行数据成功的回调
|
|
396
395
|
// 'saveError': function() {}, // 保存行数据发生异常的回调
|
package/src/i18n/langs/cn.js
CHANGED
|
@@ -73,7 +73,8 @@ const cn = {
|
|
|
73
73
|
selectYear: '选择年',
|
|
74
74
|
search: '查询',
|
|
75
75
|
forbiddenException: '您没有权限访问该资源',
|
|
76
|
-
theButtonIsNotBoundToAResource: '该按钮未绑定资源,请先绑定资源'
|
|
76
|
+
theButtonIsNotBoundToAResource: '该按钮未绑定资源,请先绑定资源',
|
|
77
|
+
asyncExport: '正在异步导出,请等待消息通知!'
|
|
77
78
|
},
|
|
78
79
|
// 列表组件
|
|
79
80
|
superGrid: {
|
package/src/i18n/langs/en.js
CHANGED
|
@@ -73,7 +73,8 @@ const en = {
|
|
|
73
73
|
selectYear: 'Select Year',
|
|
74
74
|
search: 'Search',
|
|
75
75
|
forbiddenException: 'You do not have permission to access this resource',
|
|
76
|
-
theButtonIsNotBoundToAResource: 'The button is not bound to a resource, Bind the resource first'
|
|
76
|
+
theButtonIsNotBoundToAResource: 'The button is not bound to a resource, Bind the resource first',
|
|
77
|
+
asyncExport: 'Asynchronous export, please wait for message notification!'
|
|
77
78
|
},
|
|
78
79
|
superGrid: {
|
|
79
80
|
columnConfig: 'Column Config',
|
|
@@ -427,6 +427,7 @@ function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode
|
|
|
427
427
|
popPageSetting.valueMappings = jumpPageSetting.valueMappings
|
|
428
428
|
popPageSetting.updateValueEvent = jumpPageSetting.updateValueEvent
|
|
429
429
|
popPageSetting.closeEvent = jumpPageSetting.closeEvent
|
|
430
|
+
popPageSetting.isRefreshWhenClosePopup = jumpPageSetting.isRefreshWhenClosePopup
|
|
430
431
|
}
|
|
431
432
|
// 是否是自定义系统
|
|
432
433
|
let isDsc = false
|