cnhis-design-vue 3.0.0 → 3.0.3

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +27 -4
  2. package/env.d.ts +2 -0
  3. package/es/big-table/index.css +0 -4
  4. package/es/big-table/index.js +300 -474
  5. package/es/button-print/index.css +1 -5
  6. package/es/button-print/index.js +4920 -18073
  7. package/es/drag-layout/index.css +1 -5
  8. package/es/grid/index.css +0 -4
  9. package/es/grid/index.js +3 -4
  10. package/es/index.css +0 -4
  11. package/es/index.js +257 -7227
  12. package/package.json +2 -8
  13. package/packages/big-table/src/BigTable.vue +40 -41
  14. package/packages/big-table/src/bigTableEmits.ts +3 -1
  15. package/packages/big-table/src/components/edit-form/edit-input.vue +27 -7
  16. package/packages/big-table/src/components/edit-form/edit-select-table.vue +2 -2
  17. package/packages/big-table/src/components/edit-form/edit-select.vue +1 -1
  18. package/packages/big-table/src/hooks/useBatchEditing.ts +123 -123
  19. package/packages/big-table/src/hooks/useEdit.ts +45 -18
  20. package/packages/button-print/src/ButtonPrint.vue +11 -144
  21. package/packages/button-print/src/components/IdentityVerification.vue +14 -43
  22. package/packages/grid/index.ts +5 -2
  23. package/packages/grid/src/Grid.tsx +1 -5
  24. package/packages/grid/src/hooks.ts +1 -2
  25. package/packages/index.ts +13 -14
  26. package/tsconfig.node.json +1 -1
  27. package/packages/big-table/src/components/edit-form3/EditForm.vue +0 -426
  28. package/packages/big-table/src/components/edit-form3/edit-component/edit-date-picker/edit-date-picker.vue +0 -66
  29. package/packages/big-table/src/components/edit-form3/edit-component/edit-digital/edit-digital.vue +0 -60
  30. package/packages/big-table/src/components/edit-form3/edit-component/edit-input/edit-input.vue +0 -38
  31. package/packages/big-table/src/components/edit-form3/edit-component/edit-input-password/edit-input-password.vue +0 -89
  32. package/packages/big-table/src/components/edit-form3/edit-component/edit-month-picker/edit-month-picker.vue +0 -38
  33. package/packages/big-table/src/components/edit-form3/edit-component/edit-search/edit-search.vue +0 -63
  34. package/packages/big-table/src/components/edit-form3/edit-component/edit-search-more/edit-search-more.vue +0 -69
  35. package/packages/big-table/src/components/edit-form3/edit-component/edit-select/edit-select.vue +0 -51
  36. package/packages/big-table/src/components/edit-form3/edit-component/edit-select-multiple/edit-select-multiple.vue +0 -60
  37. package/packages/big-table/src/components/edit-form3/edit-component/edit-textarea/edit-textarea.vue +0 -34
  38. package/packages/big-table/src/components/edit-form3/edit-component/edit-time-picker/edit-time-picker.vue +0 -42
  39. package/packages/big-table/src/components/edit-form3/edit-component/editFormProps.ts +0 -91
  40. package/packages/big-table/src/components/edit-form3/edit-component/register-com.ts +0 -18
  41. package/packages/big-table/src/components/edit-form3/hooks/useConfigData.ts +0 -79
  42. package/packages/big-table/src/components/edit-form3/hooks/useDateType.ts +0 -184
  43. package/packages/big-table/src/components/edit-form3/hooks/useFormCommon.ts +0 -373
  44. package/packages/big-table/src/components/edit-form3/hooks/useItemDefault.ts +0 -638
  45. package/packages/big-table/src/components/edit-form3/hooks/useSearch.ts +0 -910
  46. package/packages/big-table/src/components/edit-form3/hooks/useValidateRules.ts +0 -387
  47. package/packages/big-table/src/components/edit-form3/interface.ts +0 -53
  48. package/packages/big-table/src/components/edit-form3/types.ts +0 -3
  49. package/packages/big-table/src/components/edit-form3/utils.ts +0 -247
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
3
  "private": false,
4
- "version": "3.0.0",
4
+ "version": "3.0.3",
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
- "axios": "^0.26.1",
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",
@@ -50,12 +46,10 @@
50
46
  "rollup-plugin-delete": "^2.0.0",
51
47
  "rollup-plugin-esbuild": "^4.9.1",
52
48
  "rollup-plugin-external-globals": "^0.6.1",
53
- "rollup-plugin-jsx": "^1.0.3",
54
49
  "rollup-plugin-postcss": "^4.0.2",
55
50
  "rollup-plugin-terser": "^7.0.2",
56
51
  "rollup-plugin-typescript2": "^0.31.2",
57
52
  "rollup-plugin-vue": "^6.0.0",
58
- "rollup-plugin-vue-jsx-compat": "0.0.6",
59
53
  "standard-version": "^9.3.2",
60
54
  "typescript": "^4.5.4",
61
55
  "vite": "^2.8.0",
@@ -163,7 +163,7 @@ export default create({
163
163
 
164
164
  <script lang="tsx" setup>
165
165
  import { computed, nextTick, onMounted, reactive, ref, useAttrs, watch, isReactive, shallowReactive, onActivated, onUnmounted } from "vue";
166
- import { useRoute } from 'vue-router';
166
+ // import { useRoute } from 'vue-router';
167
167
  import bigTableState from "./bigTableState";
168
168
  import bigTableProps from "./bigTableProps";
169
169
  import bigTableEmits from "./bigTableEmits";
@@ -176,8 +176,6 @@ import { SettingsSharp, SyncOutline, CopyOutline, CaretDown, CaretForward } from
176
176
  import NoData from "./components/NoData.vue";
177
177
  import TextOverTooltip from "./components/TextOverTooltip.vue";
178
178
  import SvgIcon from '@/component/svg/index.vue';
179
- // import SvgIcon from "./components/SvgIcon.vue";
180
- // import EditForm from './components/edit-form/EditForm.vue';
181
179
  import EditSelectTable from './components/edit-form/edit-select-table.vue'
182
180
  import EditInput from './components/edit-form/edit-input.vue'
183
181
  import EditSelect from './components/edit-form/edit-select.vue'
@@ -195,13 +193,10 @@ import {
195
193
  NSwitch,
196
194
  NPopover,
197
195
  NDropdown,
198
- NPopconfirm,
199
- NSelect,
200
- NPagination,
201
- NEmpty
196
+ NPopconfirm
202
197
  } from "naive-ui";
203
198
  import { useMessage } from 'naive-ui'
204
- import CGrid from '~/grid/index.ts';
199
+ import CGrid from '~/grid';
205
200
  import vexutils from '@/utils/vexutils.js';
206
201
  import {
207
202
  getEvaluate,
@@ -248,7 +243,7 @@ let addInlineEditPrimaryKey: any = '';
248
243
 
249
244
  const GROUP_TITLE_KEY = "group-show-title";
250
245
 
251
- const route = useRoute();
246
+ // const route = useRoute();
252
247
 
253
248
  (window as any).$message = useMessage()
254
249
 
@@ -276,7 +271,7 @@ const {
276
271
  recordClickBtnInfo,
277
272
  getInlineOpreateRow
278
273
  }: any = useBatchEditing(props, state, emit, xGrid);
279
- const { initEditTable, activeMethod, deleteRow, onClickSelectTable } = useEdit(props, state, emit, xGrid)
274
+ const { initEditTable, activeMethod, deleteRow, onClickSelectTable, onUpdateInput, getDefaultValue } = useEdit(props, state, emit, xGrid)
280
275
 
281
276
  const {
282
277
  isAboutNestTable,
@@ -382,8 +377,7 @@ const unBindDocumentClick = () => {
382
377
  }
383
378
  onMounted(() => {
384
379
  bindDocumentClick();
385
- // state.tableHeight = handleTableHeight(state, props);
386
- state.tableHeight = '520px'
380
+ state.tableHeight = handleTableHeight(state, props);
387
381
 
388
382
  // // 子列表在mounted后初始化 直接watch无法触发
389
383
  if (!props.isNestTable) return;
@@ -460,7 +454,7 @@ const loadData = async (data: any) => {
460
454
  // 还是用loadData较好,树表展开需要在更新数据后保留上一次的状态
461
455
  // table.clearSort(); // <-- table.loadData 不会清空sort选项,导致sortChange重复触发
462
456
  await table.loadData(formatList);
463
- initEditTable()
457
+ // initEditTable()
464
458
 
465
459
 
466
460
  table.setCurrentRow({});
@@ -521,12 +515,12 @@ const formatColumns = (map: any) => {
521
515
  */
522
516
  // 配置列表
523
517
  let { selectType } = getOtherConfigInit() || {};
524
- let { isBatchSelect, fieldList, showButtonTop, isScanMultiTable, isEdit = false, editConfig = {} } = map;
518
+ let { isBatchSelect, fieldList = [], showButtonTop, isScanMultiTable, isEdit = false, editConfig = {} } = map;
525
519
  if (isEdit) {
526
520
  state.editConfig = Object.assign(state.editConfig, editConfig, {
527
- mode: 'cell',
528
- autoClear: true,
529
- activeMethod
521
+ // mode: 'cell',
522
+ // autoClear: true,
523
+ // activeMethod
530
524
  })
531
525
  }
532
526
  if (selectType) {
@@ -664,7 +658,7 @@ const formatColumns = (map: any) => {
664
658
  if(!isEdit || item.columnName === 'operatorColumn' || !item.isEdit) {
665
659
  return formatter(params, item)
666
660
  } else {
667
- return <span>{params.row[item.columnName]}</span>
661
+ return <span>{getDefaultValue(params, item)}</span>
668
662
  }
669
663
  }
670
664
  },
@@ -711,30 +705,34 @@ const formatColumns = (map: any) => {
711
705
  };
712
706
  const formatterEdit = (params: any, col: any) => {
713
707
  let { row, column, $rowIndex, rowIndex } = params
714
- let formType = column.formType || col.formType
715
- if (formType === 'selectTable') {
716
- const propsData = {
717
- row,
718
- col
719
- }
720
- return <EditSelectTable {...propsData} v-model={[row[col.columnName], 'value']} onClickSelectTable={onClickSelectTable} />
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)
721
718
  }
722
- if (formType === 'input') {
723
- return <EditInput v-model={[row[col.columnName], 'value']} />
719
+ const propsData = {
720
+ col,
721
+ row,
722
+ index: $rowIndex
723
+ }
724
+ if (formType === 'input' || formType === 'number') {
725
+ return <EditInput {...propsData} type={formType} v-model={[row[col.columnName], 'value']} onUpdateInput={onUpdateInput} />
724
726
  }
725
727
  if (formType === 'select') {
726
- const propsData = {
727
- col,
728
- row
729
- }
730
728
  return <EditSelect {...propsData} v-model={[row[col.columnName], 'value']} onSetOptions={(options: any[]) => row[`${col.columnName}_options`] = options} />
731
729
  }
732
730
  }
733
- const getEditBtn = (row: any, col: any) => {
731
+ const getEditBtn = (row: any, col: any, index: number) => {
734
732
  return col.tileBtnList.map((btn: any) => {
735
733
  if (btn.settingObj[0].trigger_type === 'DELETE') {
736
734
  return <NPopconfirm
737
- onPositiveClick={() => deleteRow(row)}
735
+ onPositiveClick={() => deleteRow(row, col, index)}
738
736
  >
739
737
  {{
740
738
  trigger: () => <NButton color={btn.settingObj[0].color || '#999'} text>{btn.name}</NButton>,
@@ -828,8 +826,9 @@ const formatter = (params: any, col: any) => {
828
826
  return getOrCode(row, own, attrType);
829
827
  }
830
828
  if (column.property === "operatorColumn") {
831
- if (props.columnConfig.isEdit && !row.initRow) {
832
- return getEditBtn(row, col)
829
+ // if (props.columnConfig.isEdit && !row.initRow) {
830
+ if (props.columnConfig.isEdit) {
831
+ return getEditBtn(row, col, $rowIndex)
833
832
  }
834
833
 
835
834
  if (state.showButtonTop != 0 || props.isBatchEditing) return;
@@ -2514,12 +2513,12 @@ watch(
2514
2513
  handleClickCancelBtnByInline();
2515
2514
  }
2516
2515
  )
2517
- watch(
2518
- () => route,
2519
- val => {
2520
- resetTableInlineEditStatus();
2521
- }
2522
- )
2516
+ // watch(
2517
+ // () => route,
2518
+ // val => {
2519
+ // resetTableInlineEditStatus();
2520
+ // }
2521
+ // )
2523
2522
  watch(
2524
2523
  () => props.tableRefreshCache,
2525
2524
  (val, oldVal) => {
@@ -40,7 +40,9 @@ const bigTableEmits: string[] = [
40
40
  "setNestLastClickTable",
41
41
  "selectionChangeLocal",
42
42
  "switchBtnOnChange",
43
- "asyncTableChange"
43
+ "asyncTableChange",
44
+ // "clickSelectTable"
45
+ "updateInput"
44
46
  ];
45
47
 
46
48
  export default bigTableEmits;
@@ -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
- return () => [
14
- <NInput {...attrs} />
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>
@@ -1,7 +1,7 @@
1
1
  <script lang="tsx">
2
2
  import { defineComponent, ref, reactive } from 'vue'
3
3
  import { NSelect, NPagination, NEmpty, NSpin, NSpace } from 'naive-ui'
4
- import CGrid from '~/grid/index.ts'
4
+ import CGrid from '~/grid'
5
5
  import vexutils from '@/utils/vexutils.js'
6
6
 
7
7
  export default defineComponent({
@@ -77,7 +77,7 @@ export default defineComponent({
77
77
  showHeaderOverflow: true,
78
78
  highlightHoverRow: true,
79
79
  highlightCurrentRow: true,
80
- maxHeight: '500',
80
+ maxHeight: (props.col.tableHeight || 200),
81
81
  align: 'center',
82
82
  columns: state.columns,
83
83
  data: state.data
@@ -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(props.row.row)
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
- () => 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
- )
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
- 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
- }
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
- 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
- }
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
- 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
- }
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
- 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
- }
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
- 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
- }
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,