cnhis-design-vue 3.0.1 → 3.0.4
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/CHANGELOG.md +26 -0
- package/env.d.ts +0 -2
- package/es/big-table/index.css +13 -211
- package/es/big-table/index.js +216 -839
- package/es/button-print/index.css +45 -243
- package/es/button-print/index.js +4920 -18073
- package/es/drag-layout/index.css +45 -243
- package/es/field-set/index.css +1044 -0
- package/es/field-set/index.js +351 -0
- package/es/grid/index.css +242 -242
- package/es/grid/index.js +3 -4
- package/es/index.css +41 -41
- package/es/index.js +138 -7211
- package/package.json +2 -6
- package/packages/big-table/index.ts +0 -5
- package/packages/big-table/src/BigTable.vue +31 -46
- package/packages/big-table/src/assets/iconfont/iconfont.less +3 -2
- package/packages/big-table/src/assets/style/table-global.less +4 -0
- package/packages/big-table/src/bigTableEmits.ts +2 -1
- package/packages/big-table/src/components/edit-form/edit-input.vue +27 -7
- package/packages/big-table/src/components/edit-form/edit-select.vue +1 -1
- package/packages/big-table/src/hooks/useBatchEditing.ts +123 -123
- package/packages/big-table/src/hooks/useEdit.ts +42 -23
- package/packages/button-print/src/ButtonPrint.vue +11 -144
- package/packages/button-print/src/components/IdentityVerification.vue +14 -43
- package/packages/field-set/index.ts +15 -0
- package/packages/{big-table → field-set}/src/FieldSet.vue +0 -6
- package/packages/grid/index.ts +5 -2
- package/packages/grid/src/Grid.tsx +1 -5
- package/packages/grid/src/hooks.ts +1 -2
- package/packages/index.ts +16 -14
- package/tsconfig.node.json +1 -1
- package/packages/big-table/src/components/edit-form3/EditForm.vue +0 -426
- package/packages/big-table/src/components/edit-form3/edit-component/edit-date-picker/edit-date-picker.vue +0 -66
- package/packages/big-table/src/components/edit-form3/edit-component/edit-digital/edit-digital.vue +0 -60
- package/packages/big-table/src/components/edit-form3/edit-component/edit-input/edit-input.vue +0 -38
- package/packages/big-table/src/components/edit-form3/edit-component/edit-input-password/edit-input-password.vue +0 -89
- package/packages/big-table/src/components/edit-form3/edit-component/edit-month-picker/edit-month-picker.vue +0 -38
- package/packages/big-table/src/components/edit-form3/edit-component/edit-search/edit-search.vue +0 -63
- package/packages/big-table/src/components/edit-form3/edit-component/edit-search-more/edit-search-more.vue +0 -69
- package/packages/big-table/src/components/edit-form3/edit-component/edit-select/edit-select.vue +0 -51
- package/packages/big-table/src/components/edit-form3/edit-component/edit-select-multiple/edit-select-multiple.vue +0 -60
- package/packages/big-table/src/components/edit-form3/edit-component/edit-textarea/edit-textarea.vue +0 -34
- package/packages/big-table/src/components/edit-form3/edit-component/edit-time-picker/edit-time-picker.vue +0 -42
- package/packages/big-table/src/components/edit-form3/edit-component/editFormProps.ts +0 -91
- package/packages/big-table/src/components/edit-form3/edit-component/register-com.ts +0 -18
- package/packages/big-table/src/components/edit-form3/hooks/useConfigData.ts +0 -79
- package/packages/big-table/src/components/edit-form3/hooks/useDateType.ts +0 -184
- package/packages/big-table/src/components/edit-form3/hooks/useFormCommon.ts +0 -373
- package/packages/big-table/src/components/edit-form3/hooks/useItemDefault.ts +0 -638
- package/packages/big-table/src/components/edit-form3/hooks/useSearch.ts +0 -910
- package/packages/big-table/src/components/edit-form3/hooks/useValidateRules.ts +0 -387
- package/packages/big-table/src/components/edit-form3/interface.ts +0 -53
- package/packages/big-table/src/components/edit-form3/types.ts +0 -3
- package/packages/big-table/src/components/edit-form3/utils.ts +0 -247
- package/packages/big-table/src/components/svg/index.vue +0 -49
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.4",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -15,17 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@vicons/ionicons5": "^0.12.0",
|
|
18
|
-
"
|
|
19
|
-
"naive-ui": "^2.28.1",
|
|
20
|
-
"qs": "^6.10.3"
|
|
18
|
+
"naive-ui": "^2.28.1"
|
|
21
19
|
},
|
|
22
20
|
"dependencies": {
|
|
23
21
|
"@vicons/ionicons5": "^0.12.0",
|
|
24
|
-
"axios": "^0.26.1",
|
|
25
22
|
"crypto-js": "^4.1.1",
|
|
26
23
|
"moment": "^2.29.1",
|
|
27
24
|
"naive-ui": "^2.28.1",
|
|
28
|
-
"qs": "^6.10.3",
|
|
29
25
|
"vue": "^3.2.25",
|
|
30
26
|
"vue-router": "^4.0.13",
|
|
31
27
|
"vuedraggable": "^4.1.0",
|
|
@@ -2,21 +2,16 @@ import type { App } from "vue";
|
|
|
2
2
|
// import XEUtils from "xe-utils";
|
|
3
3
|
// 导入组件
|
|
4
4
|
import BigTable from "./src/BigTable.vue"
|
|
5
|
-
import FieldSet from './src/FieldSet.vue'
|
|
6
5
|
|
|
7
6
|
// type SFCWithInstall<T> = T & { install(app: App): void }; // vue 安装
|
|
8
7
|
|
|
9
8
|
// 为组件提供 install 安装方法,供按需引入
|
|
10
9
|
BigTable.install = function(app: App) {
|
|
11
10
|
app.component(BigTable.name, BigTable);
|
|
12
|
-
app.component(FieldSet.name, FieldSet)
|
|
13
11
|
// app.config.globalProperties.$utils = XEUtils;
|
|
14
12
|
};
|
|
15
13
|
|
|
16
14
|
// const CBigTable: SFCWithInstall<typeof BigTable> = BigTable; // 增加类型
|
|
17
15
|
|
|
18
|
-
Object.assign(BigTable, {
|
|
19
|
-
FieldSet
|
|
20
|
-
});
|
|
21
16
|
// 默认导出组件
|
|
22
17
|
export default BigTable;
|
|
@@ -175,8 +175,7 @@ import { useEdit } from './hooks/useEdit';
|
|
|
175
175
|
import { SettingsSharp, SyncOutline, CopyOutline, CaretDown, CaretForward } from "@vicons/ionicons5";
|
|
176
176
|
import NoData from "./components/NoData.vue";
|
|
177
177
|
import TextOverTooltip from "./components/TextOverTooltip.vue";
|
|
178
|
-
|
|
179
|
-
import SvgIcon from './components/svg/index.vue'
|
|
178
|
+
import SvgIcon from '@/component/svg/index.vue';
|
|
180
179
|
import EditSelectTable from './components/edit-form/edit-select-table.vue'
|
|
181
180
|
import EditInput from './components/edit-form/edit-input.vue'
|
|
182
181
|
import EditSelect from './components/edit-form/edit-select.vue'
|
|
@@ -272,7 +271,7 @@ const {
|
|
|
272
271
|
recordClickBtnInfo,
|
|
273
272
|
getInlineOpreateRow
|
|
274
273
|
}: any = useBatchEditing(props, state, emit, xGrid);
|
|
275
|
-
const { initEditTable, activeMethod, deleteRow, onClickSelectTable } = useEdit(props, state, emit, xGrid)
|
|
274
|
+
const { initEditTable, activeMethod, deleteRow, onClickSelectTable, onUpdateInput, getDefaultValue } = useEdit(props, state, emit, xGrid)
|
|
276
275
|
|
|
277
276
|
const {
|
|
278
277
|
isAboutNestTable,
|
|
@@ -378,8 +377,7 @@ const unBindDocumentClick = () => {
|
|
|
378
377
|
}
|
|
379
378
|
onMounted(() => {
|
|
380
379
|
bindDocumentClick();
|
|
381
|
-
|
|
382
|
-
state.tableHeight = '520px'
|
|
380
|
+
state.tableHeight = handleTableHeight(state, props);
|
|
383
381
|
|
|
384
382
|
// // 子列表在mounted后初始化 直接watch无法触发
|
|
385
383
|
if (!props.isNestTable) return;
|
|
@@ -456,7 +454,7 @@ const loadData = async (data: any) => {
|
|
|
456
454
|
// 还是用loadData较好,树表展开需要在更新数据后保留上一次的状态
|
|
457
455
|
// table.clearSort(); // <-- table.loadData 不会清空sort选项,导致sortChange重复触发
|
|
458
456
|
await table.loadData(formatList);
|
|
459
|
-
initEditTable()
|
|
457
|
+
// initEditTable()
|
|
460
458
|
|
|
461
459
|
|
|
462
460
|
table.setCurrentRow({});
|
|
@@ -520,9 +518,9 @@ const formatColumns = (map: any) => {
|
|
|
520
518
|
let { isBatchSelect, fieldList = [], showButtonTop, isScanMultiTable, isEdit = false, editConfig = {} } = map;
|
|
521
519
|
if (isEdit) {
|
|
522
520
|
state.editConfig = Object.assign(state.editConfig, editConfig, {
|
|
523
|
-
mode: 'cell',
|
|
524
|
-
autoClear: true,
|
|
525
|
-
activeMethod
|
|
521
|
+
// mode: 'cell',
|
|
522
|
+
// autoClear: true,
|
|
523
|
+
// activeMethod
|
|
526
524
|
})
|
|
527
525
|
}
|
|
528
526
|
if (selectType) {
|
|
@@ -627,24 +625,6 @@ const formatColumns = (map: any) => {
|
|
|
627
625
|
type = "";
|
|
628
626
|
}
|
|
629
627
|
|
|
630
|
-
const getDefaultValue = (params: any) => {
|
|
631
|
-
const value = params.row[item.columnName]
|
|
632
|
-
if (item.formType === 'select') {
|
|
633
|
-
// console.log('rowrowrow', params.row, value, item)
|
|
634
|
-
if (item.options) {
|
|
635
|
-
return item.options.find((v: any) => v.value === value)?.label || ''
|
|
636
|
-
}
|
|
637
|
-
if (item.queryOptions) {
|
|
638
|
-
return value
|
|
639
|
-
// setTimeout(() => {
|
|
640
|
-
// return (params.row[`${col.columnName}_options`]?.find((v: any) => v.value === value)?.label) || ''
|
|
641
|
-
// }, 1500)
|
|
642
|
-
}
|
|
643
|
-
return value
|
|
644
|
-
}
|
|
645
|
-
return value
|
|
646
|
-
}
|
|
647
|
-
|
|
648
628
|
const col = Object.assign(item, {
|
|
649
629
|
visible: item.columnName == "operatorColumn" ? showButtonTop == 0 : item.isShow == 1,
|
|
650
630
|
field: item.columnName,
|
|
@@ -678,7 +658,7 @@ const formatColumns = (map: any) => {
|
|
|
678
658
|
if(!isEdit || item.columnName === 'operatorColumn' || !item.isEdit) {
|
|
679
659
|
return formatter(params, item)
|
|
680
660
|
} else {
|
|
681
|
-
return <span>{getDefaultValue(params)}</span>
|
|
661
|
+
return <span>{getDefaultValue(params, item)}</span>
|
|
682
662
|
}
|
|
683
663
|
}
|
|
684
664
|
},
|
|
@@ -725,30 +705,34 @@ const formatColumns = (map: any) => {
|
|
|
725
705
|
};
|
|
726
706
|
const formatterEdit = (params: any, col: any) => {
|
|
727
707
|
let { row, column, $rowIndex, rowIndex } = params
|
|
728
|
-
let formType = column.formType || col.formType
|
|
729
|
-
if (formType === 'selectTable') {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
708
|
+
let formType = column.formType || col.formType || ''
|
|
709
|
+
// if (formType === 'selectTable') {
|
|
710
|
+
// const propsData = {
|
|
711
|
+
// row,
|
|
712
|
+
// col
|
|
713
|
+
// }
|
|
714
|
+
// return <EditSelectTable {...propsData} v-model={[row[col.columnName], 'value']} onClickSelectTable={onClickSelectTable} />
|
|
715
|
+
// }
|
|
716
|
+
if (formType === 'custom') {
|
|
717
|
+
return col.slotFn(params)
|
|
718
|
+
}
|
|
719
|
+
const propsData = {
|
|
720
|
+
col,
|
|
721
|
+
row,
|
|
722
|
+
index: $rowIndex
|
|
735
723
|
}
|
|
736
|
-
if (formType === 'input') {
|
|
737
|
-
return <EditInput v-model={[row[col.columnName], 'value']} />
|
|
724
|
+
if (formType === 'input' || formType === 'number') {
|
|
725
|
+
return <EditInput {...propsData} type={formType} v-model={[row[col.columnName], 'value']} onUpdateInput={onUpdateInput} />
|
|
738
726
|
}
|
|
739
727
|
if (formType === 'select') {
|
|
740
|
-
const propsData = {
|
|
741
|
-
col,
|
|
742
|
-
row
|
|
743
|
-
}
|
|
744
728
|
return <EditSelect {...propsData} v-model={[row[col.columnName], 'value']} onSetOptions={(options: any[]) => row[`${col.columnName}_options`] = options} />
|
|
745
729
|
}
|
|
746
730
|
}
|
|
747
|
-
const getEditBtn = (row: any, col: any) => {
|
|
748
|
-
return col.tileBtnList
|
|
731
|
+
const getEditBtn = (row: any, col: any, index: number) => {
|
|
732
|
+
return col.tileBtnList?.map((btn: any) => {
|
|
749
733
|
if (btn.settingObj[0].trigger_type === 'DELETE') {
|
|
750
734
|
return <NPopconfirm
|
|
751
|
-
onPositiveClick={() => deleteRow(row)}
|
|
735
|
+
onPositiveClick={() => deleteRow(row, col, index)}
|
|
752
736
|
>
|
|
753
737
|
{{
|
|
754
738
|
trigger: () => <NButton color={btn.settingObj[0].color || '#999'} text>{btn.name}</NButton>,
|
|
@@ -842,8 +826,9 @@ const formatter = (params: any, col: any) => {
|
|
|
842
826
|
return getOrCode(row, own, attrType);
|
|
843
827
|
}
|
|
844
828
|
if (column.property === "operatorColumn") {
|
|
845
|
-
if (props.columnConfig.isEdit && !row.initRow) {
|
|
846
|
-
|
|
829
|
+
// if (props.columnConfig.isEdit && !row.initRow) {
|
|
830
|
+
if (props.columnConfig.isEdit) {
|
|
831
|
+
return getEditBtn(row, col, $rowIndex)
|
|
847
832
|
}
|
|
848
833
|
|
|
849
834
|
if (state.showButtonTop != 0 || props.isBatchEditing) return;
|
|
@@ -41,9 +41,11 @@
|
|
|
41
41
|
display: inline-block;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/*
|
|
44
45
|
.sort-icon-asc {
|
|
45
46
|
background-image: url('../img/icon-asc.png');
|
|
46
47
|
}
|
|
48
|
+
*/
|
|
47
49
|
|
|
48
50
|
.sort-text {
|
|
49
51
|
margin-left: 11px;
|
|
@@ -52,9 +54,11 @@
|
|
|
52
54
|
color: rgba(0, 0, 0, 0.8);
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
/*
|
|
55
58
|
.sort-icon-desc {
|
|
56
59
|
background-image: url('../img/icon-desc.png');
|
|
57
60
|
}
|
|
61
|
+
*/
|
|
58
62
|
|
|
59
63
|
.filter-header {
|
|
60
64
|
padding: 0 13px;
|
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
<script lang="tsx">
|
|
2
|
-
import { defineComponent, ref, reactive } from 'vue'
|
|
3
|
-
import { NInput } from 'naive-ui'
|
|
2
|
+
import { defineComponent, ref, reactive, resolveComponent } from 'vue'
|
|
3
|
+
import { NInput, NInputNumber } from 'naive-ui'
|
|
4
4
|
|
|
5
5
|
export default defineComponent({
|
|
6
6
|
name: 'EditInput',
|
|
7
7
|
inheritAttrs: false,
|
|
8
8
|
components: {
|
|
9
|
-
NInput
|
|
9
|
+
NInput,
|
|
10
|
+
NInputNumber
|
|
10
11
|
},
|
|
12
|
+
props: {
|
|
13
|
+
type: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'input'
|
|
16
|
+
},
|
|
17
|
+
col: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: () => ({})
|
|
20
|
+
},
|
|
21
|
+
row: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default: () => ({})
|
|
24
|
+
},
|
|
25
|
+
index: {
|
|
26
|
+
type: [Number, Object],
|
|
27
|
+
default: 0
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: ['updateInput'],
|
|
11
31
|
setup (props, { attrs, slots, emit }) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
32
|
+
const onUpdateValue = (value: number | string | null) => {
|
|
33
|
+
emit('updateInput', { value, row: props.row, column: props.col, index: props.index })
|
|
34
|
+
}
|
|
35
|
+
return () => props.type === 'input' ? <NInput {...attrs} onUpdateValue={onUpdateValue } /> : <NInputNumber {...attrs} onUpdateValue={onUpdateValue} />
|
|
16
36
|
}
|
|
17
37
|
})
|
|
18
38
|
</script>
|
|
@@ -31,7 +31,7 @@ export default defineComponent({
|
|
|
31
31
|
// 此处需要缓存第一次请求到的options,不需要每次都请求,
|
|
32
32
|
// 此处的row参数应当是selectTable的row
|
|
33
33
|
const optionsName = `${props.col.columnName}_options`
|
|
34
|
-
state.options = props.row[optionsName] || await props.col.queryOptions(
|
|
34
|
+
state.options = props.row[optionsName] || await props.col.queryOptions()
|
|
35
35
|
if (!props.row[optionsName]) {
|
|
36
36
|
emit('setOptions', state.options)
|
|
37
37
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, ref, reactive, watch, onMounted } from 'vue'
|
|
2
|
-
import axios from 'axios'
|
|
2
|
+
// import axios from 'axios'
|
|
3
3
|
|
|
4
4
|
export const useBatchEditing = (props: any, state: any, emit: any, xGrid: any) => {
|
|
5
5
|
|
|
@@ -67,15 +67,15 @@ export const useBatchEditing = (props: any, state: any, emit: any, xGrid: any) =
|
|
|
67
67
|
/**
|
|
68
68
|
* 校验提交
|
|
69
69
|
*/
|
|
70
|
-
watch(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
70
|
+
// watch(
|
|
71
|
+
// () => props.batchEditDoneNumber,
|
|
72
|
+
// obj => {
|
|
73
|
+
// if (!obj || !Object.keys(obj).length || props.isNestTable) return;
|
|
74
|
+
// if (state.isTree != 0 || !props.isMatchComponent) return false;
|
|
75
|
+
// if (!checkOperateCurrentTable()) return false;
|
|
76
|
+
// submitBatchInlineForm(obj);
|
|
77
|
+
// }
|
|
78
|
+
// )
|
|
79
79
|
|
|
80
80
|
const checkOperateCurrentTable = () => {
|
|
81
81
|
if (props.isNestTable) return false;
|
|
@@ -382,62 +382,62 @@ export const useBatchEditing = (props: any, state: any, emit: any, xGrid: any) =
|
|
|
382
382
|
return arr;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
const savaForm = (formId: any, params: any) => {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
385
|
+
// const savaForm = (formId: any, params: any) => {
|
|
386
|
+
// let url = `/form/editRows/update/${formId}`;
|
|
387
|
+
// return axios({
|
|
388
|
+
// method: 'post',
|
|
389
|
+
// url,
|
|
390
|
+
// headers: { 'Content-Type': 'application/json; charset=utf-8' },
|
|
391
|
+
// data: params
|
|
392
|
+
// });
|
|
393
|
+
// }
|
|
394
394
|
|
|
395
395
|
/**
|
|
396
396
|
* 批量提交form
|
|
397
397
|
* @param {*} obj
|
|
398
398
|
* @returns
|
|
399
399
|
*/
|
|
400
|
-
const submitBatchInlineForm = (obj: any) => {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
}
|
|
400
|
+
// const submitBatchInlineForm = (obj: any) => {
|
|
401
|
+
// if (props.batchError) {
|
|
402
|
+
// props.resetBatchEditRowStatus();
|
|
403
|
+
// emit('triggerSpinning', false);
|
|
404
|
+
// return;
|
|
405
|
+
// }
|
|
406
|
+
// let isBatchDoneAll = handleIsBatchDoneAll(obj);
|
|
407
|
+
// if (!isBatchDoneAll) {
|
|
408
|
+
// props.resetBatchEditRowStatus();
|
|
409
|
+
// emit('triggerSpinning', false);
|
|
410
|
+
// return;
|
|
411
|
+
// }
|
|
412
|
+
// let { formId } = props.listFormUnionSetting;
|
|
413
|
+
// let params = handleSubmitParams(props.batchFormData);
|
|
414
|
+
// if (!formId || !params) {
|
|
415
|
+
// props.resetBatchEditRowStatus();
|
|
416
|
+
// emit('triggerSpinning', false);
|
|
417
|
+
// return;
|
|
418
|
+
// }
|
|
419
|
+
// if (state.isSaveForm) return false;
|
|
420
|
+
// state.isSaveForm = true;
|
|
421
|
+
// savaForm(formId, params)
|
|
422
|
+
// .then(async ({ data }) => {
|
|
423
|
+
// emit('triggerSpinning', false);
|
|
424
|
+
// if (data.result !== 'SUCCESS') {
|
|
425
|
+
// state.isSaveForm = false;
|
|
426
|
+
// (window as any).$message.error(data.resultMsg);
|
|
427
|
+
// props.resetBatchEditRowStatus();
|
|
428
|
+
// return false;
|
|
429
|
+
// }
|
|
430
|
+
|
|
431
|
+
// await props.resetInlineBatchEdit();
|
|
432
|
+
// handleClickBatchCancelBtnByInline();
|
|
433
|
+
// emit('pubTableReload');
|
|
434
|
+
// })
|
|
435
|
+
// .finally(() => {
|
|
436
|
+
// state.isSaveForm = false;
|
|
437
|
+
// emit('triggerSpinning', false);
|
|
438
|
+
// props.resetBatchEditRowStatus();
|
|
439
|
+
// });
|
|
440
|
+
// }
|
|
441
441
|
|
|
442
442
|
const formatFieldItem = (fieldItem: any) => {
|
|
443
443
|
return Object.assign({}, fieldItem, {
|
|
@@ -483,79 +483,79 @@ export const useBatchEditing = (props: any, state: any, emit: any, xGrid: any) =
|
|
|
483
483
|
return fieldLength;
|
|
484
484
|
}
|
|
485
485
|
|
|
486
|
-
const handleRequestedUniqueKey = (id: any) => {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
}
|
|
486
|
+
// const handleRequestedUniqueKey = (id: any) => {
|
|
487
|
+
// return axios
|
|
488
|
+
// .get('tableList/getPrimaryKey', { params: { tableId: id } })
|
|
489
|
+
// .then(({ data }) => {
|
|
490
|
+
// let result;
|
|
491
|
+
// if (data.result == 'SUCCESS') {
|
|
492
|
+
// const { map = {} } = data;
|
|
493
|
+
// result = map.primaryKey || undefined;
|
|
494
|
+
// } else {
|
|
495
|
+
// result = undefined;
|
|
496
|
+
// }
|
|
497
|
+
// state.cacheUniqueKey[id] = { value: result, status: true };
|
|
498
|
+
// return result;
|
|
499
|
+
// })
|
|
500
|
+
// .catch(err => {
|
|
501
|
+
// console.log(err);
|
|
502
|
+
// state.cacheUniqueKey[id] = { value: undefined, status: true };
|
|
503
|
+
// return undefined;
|
|
504
|
+
// });
|
|
505
|
+
// }
|
|
506
506
|
|
|
507
507
|
/**
|
|
508
508
|
* 获取编辑的field
|
|
509
509
|
*/
|
|
510
|
-
const handleFieldTheUniqueKey = () => {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
}
|
|
510
|
+
// const handleFieldTheUniqueKey = () => {
|
|
511
|
+
// return new Promise<void>((resolve, reject) => {
|
|
512
|
+
// let { paramsList = [] } = props.listFormUnionSetting || {};
|
|
513
|
+
// let { fieldList = [] } = props.inlineEditFormConfig;
|
|
514
|
+
// fieldList = JSON.parse(JSON.stringify(fieldList));
|
|
515
|
+
// _batchFieldList = [];
|
|
516
|
+
// let batchFieldList = fieldList
|
|
517
|
+
// .map((item: any) => {
|
|
518
|
+
// let matchItem = paramsList.find((v: any) => item.val_key === v.tableField);
|
|
519
|
+
// if (matchItem) {
|
|
520
|
+
// let NOWORDBOOK = item.wordbook && (item?.wordbook?.type || '') != 'WORDBOOK';
|
|
521
|
+
// let id = item.wordbook?.id;
|
|
522
|
+
// if (NOWORDBOOK && id && !state.theUniqueKeyListObj[id]) {
|
|
523
|
+
// state.theUniqueKeyListObj[id] = id;
|
|
524
|
+
// }
|
|
525
|
+
// return item;
|
|
526
|
+
// }
|
|
527
|
+
// return null;
|
|
528
|
+
// })
|
|
529
|
+
// .filter(Boolean);
|
|
530
|
+
// if (!batchFieldList || !batchFieldList.length) return resolve();
|
|
531
|
+
// // 缓存行编辑需要的column配置
|
|
532
|
+
// state.editColumnMap = handleColumnMap(batchFieldList, paramsList);
|
|
533
|
+
// _batchFieldList = batchFieldList;
|
|
534
|
+
// _fieldLength = handleFieldLength();
|
|
535
|
+
// let keyList = Object.keys(state.theUniqueKeyListObj || {});
|
|
536
|
+
// if (!keyList.length) return resolve();
|
|
537
|
+
// keyList.forEach(async item => {
|
|
538
|
+
// await handleRequestedUniqueKey(item);
|
|
539
|
+
// });
|
|
540
|
+
// resolve();
|
|
541
|
+
// });
|
|
542
|
+
// }
|
|
543
543
|
|
|
544
544
|
/**
|
|
545
545
|
* 避免每次点击都查询
|
|
546
546
|
* 初始化查一次 行编辑 表单search用
|
|
547
547
|
*/
|
|
548
548
|
// 避免每次点击都查询
|
|
549
|
-
const handleFormTheUniqueKey = async () => {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
549
|
+
// const handleFormTheUniqueKey = async () => {
|
|
550
|
+
// emit('initInlineEditFormConfig', { listFormUnionSetting: props.listFormUnionSetting, inlineEditFormConfig: props.inlineEditFormConfig });
|
|
551
|
+
// let hasEditRow = props.btnList?.find((item: any) => {
|
|
552
|
+
// let trigger_type = item.settingObj && item.settingObj[0]?.trigger_type;
|
|
553
|
+
// if (item.isShow == 1 && trigger_type == 'EDIT_ROW') return true;
|
|
554
|
+
// return false;
|
|
555
|
+
// });
|
|
556
|
+
// if (!hasEditRow) return;
|
|
557
|
+
// await handleFieldTheUniqueKey();
|
|
558
|
+
// }
|
|
559
559
|
|
|
560
560
|
return {
|
|
561
561
|
allSelectedLength,
|