imatrix-ui 2.9.24-dw → 2.9.25-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 +6 -6
- package/package.json +1 -1
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +5 -2
- package/packages/super-grid/src/apis.js +20 -3
- package/packages/super-grid/src/dynamic-input.vue +7 -1
- package/packages/super-grid/src/super-grid.vue +51 -21
package/package.json
CHANGED
|
@@ -252,7 +252,9 @@ export default {
|
|
|
252
252
|
}
|
|
253
253
|
this.$emit('set-value', {
|
|
254
254
|
value: targeValue,
|
|
255
|
-
targetColumnName: this.column.prop
|
|
255
|
+
targetColumnName: this.column.prop,
|
|
256
|
+
options: this.optionItems,
|
|
257
|
+
valueAttribute: this.valueAttribute
|
|
256
258
|
})
|
|
257
259
|
}
|
|
258
260
|
}
|
|
@@ -383,7 +385,8 @@ export default {
|
|
|
383
385
|
value: value,
|
|
384
386
|
sourceColumnName: sourceColumnName,
|
|
385
387
|
targetColumnName: targetColumnName,
|
|
386
|
-
options: this.optionItems
|
|
388
|
+
options: this.optionItems,
|
|
389
|
+
valueAttribute: this.valueAttribute
|
|
387
390
|
})
|
|
388
391
|
})
|
|
389
392
|
}
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
isLastEditRowSave,
|
|
6
6
|
isHasEditOption,
|
|
7
7
|
scrollYToBottom,
|
|
8
|
-
getAdditionalParamMap
|
|
8
|
+
getAdditionalParamMap,
|
|
9
|
+
isDynamicDataSourceSource
|
|
9
10
|
} from './utils'
|
|
10
11
|
import formValidatorService from './formValidatorUtil'
|
|
11
12
|
import Vue from 'vue'
|
|
@@ -782,14 +783,30 @@ gridParams.$rowIndex < gridParams.gridData.length) {
|
|
|
782
783
|
listCode = store.get('_list_code')
|
|
783
784
|
}
|
|
784
785
|
const gridParams = store.get(listCode)
|
|
786
|
+
const dynamicSourceSelectOptions = gridParams.dynamicSourceSelectOptions
|
|
785
787
|
const columns = gridParams.columns
|
|
786
788
|
columns.forEach(col => {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
+
const prop = col.prop
|
|
790
|
+
const isDynamicDataSource = isDynamicDataSourceSource(col)
|
|
791
|
+
if (dynamicSourceSelectOptions && isDynamicDataSource && dynamicSourceSelectOptions[prop]) {
|
|
792
|
+
// { options, valueAttribute }
|
|
793
|
+
const optionSet = dynamicSourceSelectOptions[prop]
|
|
794
|
+
result[prop] = this.packageDynamicDataSourceOptions(optionSet.options, optionSet.valueAttribute)
|
|
795
|
+
} else if (col.valueSet && col.valueSet.length > 0) {
|
|
796
|
+
result[prop] = col.valueSet
|
|
789
797
|
}
|
|
790
798
|
})
|
|
791
799
|
return result
|
|
792
800
|
},
|
|
801
|
+
packageDynamicDataSourceOptions(options, valueAttribute) {
|
|
802
|
+
if (options) {
|
|
803
|
+
options.forEach(item => {
|
|
804
|
+
item.value = item[valueAttribute]
|
|
805
|
+
item.label = item['_label_']
|
|
806
|
+
})
|
|
807
|
+
}
|
|
808
|
+
return options
|
|
809
|
+
},
|
|
793
810
|
// 取消列表的编辑状态
|
|
794
811
|
restoreGridEdit(listCode) {
|
|
795
812
|
if (!listCode) {
|
|
@@ -1186,9 +1186,15 @@ export default {
|
|
|
1186
1186
|
this.callCustomEventWithParam('replace', { originalValue, newValue, row: this.row, column: this.column, prop })
|
|
1187
1187
|
}
|
|
1188
1188
|
},
|
|
1189
|
-
setDynamicSourceSelectValue({ value, sourceColumnName, targetColumnName, options }) {
|
|
1189
|
+
setDynamicSourceSelectValue({ value, sourceColumnName, targetColumnName, options, valueAttribute }) {
|
|
1190
1190
|
if (targetColumnName) {
|
|
1191
1191
|
this.setCellValue(targetColumnName, value, 'input')
|
|
1192
|
+
// 动态数据源选项集合存储,导出报告时子表字段值的导出时有使用
|
|
1193
|
+
const gridParams = store.get(this.listCode)
|
|
1194
|
+
if (!gridParams.dynamicSourceSelectOptions) {
|
|
1195
|
+
gridParams.dynamicSourceSelectOptions = {}
|
|
1196
|
+
}
|
|
1197
|
+
gridParams.dynamicSourceSelectOptions[targetColumnName] = { options, valueAttribute }
|
|
1192
1198
|
}
|
|
1193
1199
|
},
|
|
1194
1200
|
multiselectChange(arr) {
|
|
@@ -252,6 +252,7 @@ import headerContextMenu from './header-context-menu'
|
|
|
252
252
|
import { addDynamicProp } from './utils'
|
|
253
253
|
import { updateWithPageValue } from '../../../src/utils/jump-page-utils'
|
|
254
254
|
import { getEntityFieldValueWithOutCase } from '../../../src/utils/util'
|
|
255
|
+
import { isPromise } from '../../../src/utils/common-util'
|
|
255
256
|
import { checkPermission } from '../../../src/utils/permission'
|
|
256
257
|
import Vue from 'vue'
|
|
257
258
|
export default {
|
|
@@ -2619,31 +2620,34 @@ export default {
|
|
|
2619
2620
|
// 表示是表单的子表,点击时需要将当前行设为行编辑状态,并保存上一行的记录(不是保存到数据库,只是把编辑状态改为false)
|
|
2620
2621
|
if (column.property &&
|
|
2621
2622
|
column.property !== 'operation') {
|
|
2622
|
-
|
|
2623
|
-
let editRows
|
|
2623
|
+
let canEdit = true
|
|
2624
2624
|
const gridParams = store.get(this.code)
|
|
2625
|
-
if (this.
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2625
|
+
if (isEditOptionFunction('beforeEdit', this.code)) {
|
|
2626
|
+
const isSubTableShowPage = gridParams.isSubTableShowPage
|
|
2627
|
+
// 每页显示多少条
|
|
2628
|
+
const pageSize = gridParams.pagination && gridParams.pagination.pageSize
|
|
2629
|
+
canEdit = gridParams.options.lineEditOptions.beforeEdit.call(this, {
|
|
2630
|
+
gridData: isSubTableShowPage ? gridParams.subTableData : gridParams.gridData,
|
|
2631
|
+
listCode: this.code,
|
|
2632
|
+
entity: row,
|
|
2633
|
+
columns: gridParams.columns,
|
|
2634
|
+
isMobile: false,
|
|
2635
|
+
pageGridData: isSubTableShowPage ? gridParams.gridData : null,
|
|
2636
|
+
pageSize,
|
|
2637
|
+
additionalParamMap: gridParams.additionalParamMap
|
|
2638
|
+
})
|
|
2633
2639
|
}
|
|
2634
|
-
if (
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
// this.$set(editRow, '$editing', false)
|
|
2640
|
+
if (isPromise(canEdit)) {
|
|
2641
|
+
canEdit.then((result) => {
|
|
2642
|
+
if (result === undefined || result === true) {
|
|
2643
|
+
this.rowDbClickEditRow(gridParams, row)
|
|
2644
|
+
}
|
|
2640
2645
|
})
|
|
2646
|
+
} else {
|
|
2647
|
+
if (canEdit === undefined || canEdit === true) {
|
|
2648
|
+
this.rowDbClickEditRow(gridParams, row)
|
|
2649
|
+
}
|
|
2641
2650
|
}
|
|
2642
|
-
gridParams.isEditRow = false
|
|
2643
|
-
setEntityFieldValue(row, '$editing', true)
|
|
2644
|
-
gridParams.$editRow = row
|
|
2645
|
-
// this.$set(row, '$editing', true)
|
|
2646
|
-
gridParams.isEditRow = true
|
|
2647
2651
|
}
|
|
2648
2652
|
} else {
|
|
2649
2653
|
if (row) {
|
|
@@ -2662,6 +2666,32 @@ export default {
|
|
|
2662
2666
|
}
|
|
2663
2667
|
this.rowDblClick(row, column, event)
|
|
2664
2668
|
},
|
|
2669
|
+
rowDbClickEditRow(gridParams, row) {
|
|
2670
|
+
// 取消上一行的编辑状态
|
|
2671
|
+
let editRows
|
|
2672
|
+
if (this.isSubTableShowPage) {
|
|
2673
|
+
editRows = this.subTableData.filter(
|
|
2674
|
+
row => row.$editing !== undefined && row.$editing === true
|
|
2675
|
+
)
|
|
2676
|
+
} else {
|
|
2677
|
+
editRows = this.gridData.filter(
|
|
2678
|
+
row => row.$editing !== undefined && row.$editing === true
|
|
2679
|
+
)
|
|
2680
|
+
}
|
|
2681
|
+
if (editRows && editRows.length > 0) {
|
|
2682
|
+
editRows.forEach(editRow => {
|
|
2683
|
+
setEntityFieldValue(editRow, '$editing', false)
|
|
2684
|
+
// 取消上一行选中状态时,触发un-edit事件,处理下拉多选选项组问题
|
|
2685
|
+
eventBus.$emit('un-edit', { row: editRow })
|
|
2686
|
+
// this.$set(editRow, '$editing', false)
|
|
2687
|
+
})
|
|
2688
|
+
}
|
|
2689
|
+
gridParams.isEditRow = false
|
|
2690
|
+
setEntityFieldValue(row, '$editing', true)
|
|
2691
|
+
gridParams.$editRow = row
|
|
2692
|
+
// this.$set(row, '$editing', true)
|
|
2693
|
+
gridParams.isEditRow = true
|
|
2694
|
+
},
|
|
2665
2695
|
rowClickEvent(row, column, event) {
|
|
2666
2696
|
// if (
|
|
2667
2697
|
// this.isFormSubTable &&
|