imatrix-ui 2.9.12-dw → 2.9.13-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 +31 -18
- package/packages/super-grid/src/search-form-item.vue +14 -0
- package/packages/super-grid/src/search-form-open.vue +3 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +3 -0
- package/packages/super-grid/src/search-form.vue +5 -2
- package/packages/super-grid/src/search-methods.js +79 -12
- package/packages/super-grid/src/super-grid-service.js +8 -7
- package/packages/super-grid/src/super-grid.vue +7 -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,18 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Message
|
|
3
|
+
} from '@gcommon/gcommon-ui'
|
|
1
4
|
import Vue from 'vue'
|
|
5
|
+
import {
|
|
6
|
+
getI18n
|
|
7
|
+
} from '../../src/utils/util'
|
|
2
8
|
import store from '../super-grid/src/store'
|
|
3
9
|
import {
|
|
4
10
|
getExtraParam
|
|
5
11
|
} from '../super-grid/src/utils'
|
|
6
12
|
import nineGridStore from '../super-nine-grid/src/store'
|
|
7
|
-
import {
|
|
8
|
-
Message
|
|
9
|
-
} from '@gcommon/gcommon-ui'
|
|
10
13
|
import {
|
|
11
14
|
packageEnumAndBeanColumnValueSets
|
|
12
15
|
} from '../utils/value-set'
|
|
13
|
-
import {
|
|
14
|
-
getI18n
|
|
15
|
-
} from '../../src/utils/util'
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* @param {*} dataParam
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
* @param {*} listCode 如果是九宫格组件导出时,如果页面中有多个九宫格时,该属性需要传“listCode~gridId”,例如:
|
|
21
21
|
* @param {*} exportOptions
|
|
22
22
|
*/
|
|
23
|
-
function exportData(dataParam, excelName, listCode, functionCode, uuid, exportOptions) {
|
|
23
|
+
function exportData(dataParam, excelName, listCode, functionCode, uuid, exportOptions, isAsync, pageCode) {
|
|
24
24
|
return new Promise((resolve, reject) => {
|
|
25
|
-
exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid).then(result => {
|
|
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(dataParam, excelName, listCode, functionCode, uuid, exportOp
|
|
|
39
39
|
/**
|
|
40
40
|
* 导出数据
|
|
41
41
|
*/
|
|
42
|
-
function exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid) {
|
|
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')) {
|
|
@@ -76,7 +76,7 @@ function exportResultData(dataParam, excelName, listCode, exportOptions, functio
|
|
|
76
76
|
// })
|
|
77
77
|
}
|
|
78
78
|
// 导出台账数据,有查询条件则导出查询条件对应的数据,没有查询条件则导出所有记录
|
|
79
|
-
exportListData(excelName, listCode, dataParam.data, functionCode, uuid).then((result) => {
|
|
79
|
+
exportListData(excelName, listCode, dataParam.data, functionCode, uuid, isAsync, pageCode).then((result) => {
|
|
80
80
|
resolve(result)
|
|
81
81
|
}).catch(error => {
|
|
82
82
|
reject(error)
|
|
@@ -176,8 +176,8 @@ function getExportParamByGridParam(listCode) {
|
|
|
176
176
|
const parentPropSetting = gridParams.options.parentProp
|
|
177
177
|
if (
|
|
178
178
|
typeof parentPropSetting !== 'undefined' &&
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
parentPropSetting !== '' &&
|
|
180
|
+
parentPropSetting !== null
|
|
181
181
|
) {
|
|
182
182
|
parentProp = parentPropSetting
|
|
183
183
|
}
|
|
@@ -190,7 +190,7 @@ function getExportParamByGridParam(listCode) {
|
|
|
190
190
|
return param
|
|
191
191
|
}
|
|
192
192
|
// 导出当前台账数据
|
|
193
|
-
function exportListData(excelName, listCode, data, functionCode, uuid) {
|
|
193
|
+
function exportListData(excelName, listCode, data, functionCode, uuid, isAsync, pageCode) {
|
|
194
194
|
return new Promise((resolve, reject) => {
|
|
195
195
|
const gridParams = getGridParams(listCode)
|
|
196
196
|
if (gridParams === undefined || gridParams === null) {
|
|
@@ -225,12 +225,25 @@ function exportListData(excelName, listCode, data, functionCode, uuid) {
|
|
|
225
225
|
}
|
|
226
226
|
// 用来控制按钮禁止编辑的
|
|
227
227
|
localStorage.setItem(uuid, 'start')
|
|
228
|
+
// 是否异步
|
|
229
|
+
param['async'] = isAsync
|
|
230
|
+
// 页面编码
|
|
231
|
+
param['pageCode'] = pageCode
|
|
228
232
|
Vue.prototype.$http.post(Vue.prototype.baseURL + '/dsc/commons/export-list-data', param).then(data => {
|
|
229
|
-
if (
|
|
233
|
+
if (isAsync) {
|
|
234
|
+
Message({
|
|
235
|
+
message: getI18n().t('imatrixUIMessage.asyncExport'),
|
|
236
|
+
type: 'success',
|
|
237
|
+
showClose: true
|
|
238
|
+
})
|
|
230
239
|
localStorage.setItem(uuid, 'ok')
|
|
231
|
-
return download(Vue.prototype.baseAPI + '/component/super-grids/downloads?fileName=' + encodeURI(data) + '&_t=' + new Date().getTime(), excelName)
|
|
232
240
|
} else {
|
|
233
|
-
|
|
241
|
+
if (data.indexOf('~~') >= 0) {
|
|
242
|
+
localStorage.setItem(uuid, 'ok')
|
|
243
|
+
return download(Vue.prototype.baseAPI + '/component/super-grids/downloads?fileName=' + encodeURI(data) + '&_t=' + new Date().getTime(), excelName)
|
|
244
|
+
} else {
|
|
245
|
+
getFileUuid(data, param, excelName)
|
|
246
|
+
}
|
|
234
247
|
}
|
|
235
248
|
// return download(Vue.prototype.baseAPI + '/component/super-grids/downloads?fileName=' + encodeURI(fileName) + '&_t=' + new Date().getTime(), excelName)
|
|
236
249
|
}).then((result) => {
|
|
@@ -255,7 +268,7 @@ function getFileUuid(uuid, param, excelName) {
|
|
|
255
268
|
if (data) {
|
|
256
269
|
if (data.code && (data.code === 'ok' || data.code === 'error')) {
|
|
257
270
|
if (data.code === 'ok') {
|
|
258
|
-
|
|
271
|
+
// 用来控制按钮禁止编辑的
|
|
259
272
|
localStorage.setItem(uuid, 'ok')
|
|
260
273
|
return download(Vue.prototype.baseAPI + '/component/super-grids/downloads?fileName=' + encodeURI(data.fileName) + '&uuid=' + uuid + '&_t=' + new Date().getTime(), excelName)
|
|
261
274
|
} else {
|
|
@@ -413,7 +426,7 @@ function getExportData(data, excelName) {
|
|
|
413
426
|
}
|
|
414
427
|
|
|
415
428
|
function isHasTheOption(event, exportOptions) {
|
|
416
|
-
if (typeof (exportOptions) !== 'undefined' && typeof (exportOptions[event]) !== 'undefined') {
|
|
429
|
+
if (exportOptions !== null && typeof (exportOptions) !== 'undefined' && typeof (exportOptions[event]) !== 'undefined') {
|
|
417
430
|
return true
|
|
418
431
|
}
|
|
419
432
|
return false
|
|
@@ -219,6 +219,14 @@ 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
|
|
222
230
|
}
|
|
223
231
|
},
|
|
224
232
|
data() {
|
|
@@ -229,6 +237,12 @@ export default {
|
|
|
229
237
|
dataTwo: null
|
|
230
238
|
}
|
|
231
239
|
},
|
|
240
|
+
mounted() {
|
|
241
|
+
// 查询页面加载完成
|
|
242
|
+
if ((this.index + 1) === this.length) {
|
|
243
|
+
this.$emit('submit-form')
|
|
244
|
+
}
|
|
245
|
+
},
|
|
232
246
|
methods: {
|
|
233
247
|
...searchMethods,
|
|
234
248
|
getDynamicDataSourceOptions(column) {
|
|
@@ -166,11 +166,14 @@ export default {
|
|
|
166
166
|
} else {
|
|
167
167
|
this.searchForm[column.prop] = null
|
|
168
168
|
}
|
|
169
|
+
this.setDefaultQueryValue(column, this.searchForm)
|
|
169
170
|
}
|
|
170
171
|
})
|
|
171
172
|
// 取消当前选中的条件列表的信息
|
|
172
173
|
// this.$refs.searchConditionList.editConditionId = null
|
|
173
174
|
// this.$emit('reset')
|
|
175
|
+
// 重置条件后查询列表
|
|
176
|
+
this.$emit('submit-form')
|
|
174
177
|
},
|
|
175
178
|
openFold(isOpen) {
|
|
176
179
|
this.isOpen = isOpen
|
|
@@ -168,6 +168,7 @@ export default {
|
|
|
168
168
|
} else {
|
|
169
169
|
searchForm[column.prop] = null
|
|
170
170
|
}
|
|
171
|
+
this.setDefaultQueryValue(column, searchForm)
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
174
|
})
|
|
@@ -435,8 +436,10 @@ export default {
|
|
|
435
436
|
this.$refs.searchFormOrdinarySearch.resetForm()
|
|
436
437
|
} else if (this.searchType === 'advanced') {
|
|
437
438
|
this.$refs.searchFormAdvancedQuery.resetForm()
|
|
439
|
+
this.$emit('reset')
|
|
438
440
|
}
|
|
439
|
-
|
|
441
|
+
// 子组件重置完成后调用reset方法 同步执行
|
|
442
|
+
// this.$emit('reset')
|
|
440
443
|
},
|
|
441
444
|
setNumberValue(value, r, n) {
|
|
442
445
|
let itemValue = this.getFormItemValue(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop)
|
|
@@ -571,7 +574,7 @@ export default {
|
|
|
571
574
|
}
|
|
572
575
|
}
|
|
573
576
|
if (isRangeQueryValue) {
|
|
574
|
-
searchForm[prop] = [item.startValue, item.endValue]
|
|
577
|
+
searchForm[prop] = [new Date(item.startValue), new Date(item.endValue)]
|
|
575
578
|
} else {
|
|
576
579
|
if (searchForm[prop]) {
|
|
577
580
|
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')) {
|
|
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,70 @@ 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, queryRangeType, valueType) {
|
|
415
|
+
const queryRange = []
|
|
416
|
+
const nowDate = new Date() // 当前时间
|
|
417
|
+
let startDate// 开始时间
|
|
418
|
+
const endDate = new Date()// 结束时间
|
|
419
|
+
if (queryRangeType !== null && queryRangeType !== undefined && queryRangeType !== '') {
|
|
420
|
+
if (queryRangeType === 'nearlyWeek') {
|
|
421
|
+
startDate = new Date(nowDate.setDate(nowDate.getDate() - 7))
|
|
422
|
+
} else if (queryRangeType === 'nearlyTwoWeeks') {
|
|
423
|
+
startDate = new Date(nowDate.setDate(nowDate.getDate() - 14))
|
|
424
|
+
} else {
|
|
425
|
+
startDate = new Date(nowDate.setDate(nowDate.getDate() - 30))
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (format === 'YYYYMMDD') {
|
|
429
|
+
queryRange[0] = startDate.getFullYear() + '-' + (startDate.getMonth() + 1) + '-' + startDate.getDate()
|
|
430
|
+
queryRange[1] = endDate.getFullYear() + '-' + (endDate.getMonth() + 1) + '-' + endDate.getDate()
|
|
431
|
+
} else {
|
|
432
|
+
queryRange[0] = startDate.getFullYear() + '-' + (startDate.getMonth() + 1) + '-' + startDate.getDate() + ' 00:00:00'
|
|
433
|
+
queryRange[1] = endDate.getFullYear() + '-' + (endDate.getMonth() + 1) + '-' + endDate.getDate() + ' 23:59:59'
|
|
434
|
+
}
|
|
435
|
+
if (valueType === 'Date') {
|
|
436
|
+
const queryRangeFormat = []
|
|
437
|
+
queryRange.forEach(date => {
|
|
438
|
+
var tempStrs = date.split(' ')
|
|
439
|
+
var dateStrs = tempStrs[0].split('-')
|
|
440
|
+
var year = parseInt(dateStrs[0], 10)
|
|
441
|
+
var month = parseInt(dateStrs[1], 10) - 1
|
|
442
|
+
var day = parseInt(dateStrs[2], 10)
|
|
443
|
+
var timeStrs = tempStrs[1].split(':')
|
|
444
|
+
var hour = parseInt(timeStrs[0], 10)
|
|
445
|
+
var minute = parseInt(timeStrs[1], 10)
|
|
446
|
+
var second = parseInt(timeStrs[2], 10)
|
|
447
|
+
queryRangeFormat.push(new Date(year, month, day, hour, minute, second))
|
|
448
|
+
})
|
|
449
|
+
return queryRangeFormat
|
|
450
|
+
}
|
|
451
|
+
return queryRange
|
|
385
452
|
}
|
|
386
453
|
}
|
|
387
454
|
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'
|
|
@@ -189,7 +189,8 @@ const superGridService = {
|
|
|
189
189
|
// 表示是页面展示模式
|
|
190
190
|
} else if (typeof (this.options.initSearch) === 'undefined') {
|
|
191
191
|
if (typeof (gridParams.basicInfo.initializationQuery) === 'undefined' || gridParams.basicInfo.initializationQuery) {
|
|
192
|
-
|
|
192
|
+
// 初始化完查询条件后再查询数据
|
|
193
|
+
// this.fetchData()
|
|
193
194
|
}
|
|
194
195
|
} else if (this.options.initSearch !== false) {
|
|
195
196
|
this.fetchData()
|
|
@@ -268,13 +269,13 @@ const superGridService = {
|
|
|
268
269
|
const watchParentAttrs = dynamicColumnInfo.watchParentAttr.split(',')
|
|
269
270
|
watchParentAttrs.forEach(watchParentAttr => {
|
|
270
271
|
if (watchParentAttr) {
|
|
271
|
-
|
|
272
|
+
// 存储属性对应的值
|
|
272
273
|
if (!param.watchParentAttrValues) {
|
|
273
274
|
param.watchParentAttrValues = {}
|
|
274
275
|
}
|
|
275
276
|
param.watchParentAttrValues[watchParentAttr] = this.parentFormData[watchParentAttr]
|
|
276
|
-
const unWatch = this.$watch('parentFormData.' + watchParentAttr, function(newValue, oldValue) {
|
|
277
|
-
|
|
277
|
+
const unWatch = this.$watch('parentFormData.' + watchParentAttr, function (newValue, oldValue) {
|
|
278
|
+
// 重新加载表格及表格数据
|
|
278
279
|
if (!gridParams.dynamicTemp) {
|
|
279
280
|
gridParams.dynamicTemp = {}
|
|
280
281
|
}
|
|
@@ -284,7 +285,7 @@ const superGridService = {
|
|
|
284
285
|
}
|
|
285
286
|
gridParams.dynamicTemp.watchParentAttrValues[watchParentAttr] = newValue
|
|
286
287
|
if (this.$refs && this.$refs.superGrid) {
|
|
287
|
-
|
|
288
|
+
// 手动注销watch,否则会调用多次watch
|
|
288
289
|
unWatch()
|
|
289
290
|
// 重新加载表格及表格数据
|
|
290
291
|
this.$emit('reload-grid')
|
|
@@ -2654,6 +2654,7 @@ export default {
|
|
|
2654
2654
|
// api方法,super-pages中有调用该方法
|
|
2655
2655
|
closePageDialog(popParams) {
|
|
2656
2656
|
// popParams格式为:{ entity, pageCode }
|
|
2657
|
+
console.log('列表组件--closePageDialog---this.jumpPageSetting=', this.jumpPageSetting )
|
|
2657
2658
|
if (this.jumpPageSetting) {
|
|
2658
2659
|
// 调用关闭弹框事件
|
|
2659
2660
|
const gridParams = store.get(this.code)
|
|
@@ -2684,6 +2685,12 @@ export default {
|
|
|
2684
2685
|
}
|
|
2685
2686
|
closeEvent.call(this, params)
|
|
2686
2687
|
}
|
|
2688
|
+
const isRefreshWhenClosePopup = this.jumpPageSetting.isRefreshWhenClosePopup
|
|
2689
|
+
if (isRefreshWhenClosePopup !== undefined && isRefreshWhenClosePopup === true) {
|
|
2690
|
+
// 关闭弹框时,刷新父页面列表
|
|
2691
|
+
const gridParams = store.get(this.code)
|
|
2692
|
+
this.search(gridParams.searchForm)
|
|
2693
|
+
}
|
|
2687
2694
|
}
|
|
2688
2695
|
this.isShowPageDialog = false
|
|
2689
2696
|
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
|