vue2-client 1.8.374 → 1.8.377
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/package.json
CHANGED
|
@@ -347,6 +347,8 @@ export default {
|
|
|
347
347
|
})
|
|
348
348
|
this.$refs.xTable.init({
|
|
349
349
|
formItems: res.formJson,
|
|
350
|
+
primaryKey: res.primaryKey,
|
|
351
|
+
createdQuery: res.createdQuery,
|
|
350
352
|
queryParams: setQueryParams ? res : null,
|
|
351
353
|
tableColumns: res.columnJson,
|
|
352
354
|
buttonState: Object.assign(res.buttonState, this.buttonState),
|
|
@@ -297,7 +297,8 @@ export default {
|
|
|
297
297
|
summaryDrawerVisible: false,
|
|
298
298
|
// 汇总更新标志
|
|
299
299
|
summaryUpdate: false,
|
|
300
|
-
|
|
300
|
+
// 定义主键
|
|
301
|
+
primaryKey: ''
|
|
301
302
|
}
|
|
302
303
|
},
|
|
303
304
|
props: {
|
|
@@ -412,10 +413,11 @@ export default {
|
|
|
412
413
|
serviceName,
|
|
413
414
|
tableSummaryMap = {},
|
|
414
415
|
viewMode,
|
|
415
|
-
|
|
416
|
+
primaryKey,
|
|
417
|
+
createdQuery = true,
|
|
416
418
|
env = 'prod'
|
|
417
419
|
} = params
|
|
418
|
-
this.
|
|
420
|
+
this.primaryKey = primaryKey
|
|
419
421
|
this.showSummary = Object.keys(tableSummaryMap).length > 0
|
|
420
422
|
this.queryParams = queryParams
|
|
421
423
|
this.tableColumns = JSON.parse(JSON.stringify(tableColumns))
|
|
@@ -447,7 +449,7 @@ export default {
|
|
|
447
449
|
this.scrollXWidth = totalWidth
|
|
448
450
|
// 加载筛选列完成
|
|
449
451
|
this.columnSelectLoaded = true
|
|
450
|
-
this.setQueryForm(form || {})
|
|
452
|
+
this.setQueryForm(form || {}, createdQuery)
|
|
451
453
|
},
|
|
452
454
|
/**
|
|
453
455
|
* 加载表格数据
|
|
@@ -504,9 +506,11 @@ export default {
|
|
|
504
506
|
/**
|
|
505
507
|
* 为表格附加查询条件
|
|
506
508
|
*/
|
|
507
|
-
setQueryForm (form = {}) {
|
|
509
|
+
setQueryForm (form = {}, createdQuery = true) {
|
|
508
510
|
this.form = form
|
|
509
|
-
|
|
511
|
+
if (createdQuery) {
|
|
512
|
+
this.refresh(true)
|
|
513
|
+
}
|
|
510
514
|
},
|
|
511
515
|
/**
|
|
512
516
|
* 表格重新加载方法
|
|
@@ -577,11 +581,8 @@ export default {
|
|
|
577
581
|
* 获取主键列名称
|
|
578
582
|
*/
|
|
579
583
|
getPrimaryKeyName () {
|
|
580
|
-
if (this.
|
|
581
|
-
|
|
582
|
-
if (primaryKeyData.length) {
|
|
583
|
-
return primaryKeyData[0].model
|
|
584
|
-
}
|
|
584
|
+
if (this.primaryKey) {
|
|
585
|
+
return this.primaryKey
|
|
585
586
|
}
|
|
586
587
|
const realColumns = this.tableColumns.filter(i => i?.slotType !== 'index')
|
|
587
588
|
return realColumns[0].dataIndex
|