Commit 6101d36b888d8067a6408cbcbcb8ce330b381dfa

Authored by chenxt
1 parent 396cf7cd

根据配置增加行数据

src/components/Common/CommonHooks/useCommonBase.js
... ... @@ -3070,7 +3070,6 @@ const useCommonBase = props => {
3070 3070 formRoute,
3071 3071 slaveSelectedRowKeys,
3072 3072 } = props;
3073   - console.log("🚀 ~ handleCopyTo ~ props:", props, nextProps)
3074 3073 const { sActiveName } = nextProps.config;
3075 3074 let sParentConditions = {};
3076 3075 props.onOpenCommonModal({
... ...
src/mes/common/commonModelComponent/index.js
... ... @@ -83,8 +83,6 @@ const useCommonModelEvent = props => {
83 83 };
84 84 }
85 85 });
86   - console.log('界面addstate', addState);
87   -
88 86 return addState;
89 87 };
90 88  
... ... @@ -418,24 +416,8 @@ const useCommonModelEvent = props => {
418 416 sFormId: sModelsId,
419 417 ...masterDataCopyTo
420 418 };
421   - const addState = {}; // 始终初始化为对象
422   - // if (Array.isArray(copyToConfig) && copyToConfig.length > 0) {
423   - // copyToConfig.forEach(item => {
424   - // if (item?.sControlName) {
425   - // const name = item.sControlName.split('.').pop();
426   - // if (name && name.includes('slave')) {
427   - // addState[`${name}Data`] = {
428   - // ...commonFunc.getDefaultData(`${name}Config`),
429   - // handleType: "add",
430   - // sId: commonUtils.createSid(),
431   - // sFormId: sModelsId,
432   - // ...commonFunc.getAssignFieldValue(item.sAssignField, record)
433   - // };
434   - // }
435   - // }
436   - // });
437   - // }
438   - props.onSaveState({ masterData: masterDataNew, enabled: true, ...addState });
  419 +
  420 + props.onSaveState({ masterData: masterDataNew, enabled: true, });
439 421 },
440 422 [props.bFinish]
441 423 );
... ... @@ -455,6 +437,7 @@ const useCommonModelEvent = props => {
455 437 ...commonFunc.getDefaultData(`${name}Config`),
456 438 handleType: "add",
457 439 sId: commonUtils.createSid(),
  440 + sParentId: props.masterData.sId,
458 441 ...commonFunc.getAssignFieldValue(item.sAssignField, record)
459 442 }];
460 443 }
... ... @@ -1306,7 +1289,6 @@ const CommonModelComponent = props => {
1306 1289 tableBtnsConfig, // 表格按钮配置
1307 1290 bFirstComponent: level === 0 && index === -1
1308 1291 };
1309   - console.log("🚀 ~ getComponent ~ componentProps:", componentProps)
1310 1292 const commonDivHeight = useComputedCommonDivHeight(componentProps);
1311 1293 return (
1312 1294 <div
... ... @@ -1610,7 +1592,7 @@ const CommonViewTableComponent = props =&gt; {
1610 1592 );
1611 1593 }
1612 1594 });
1613   -
  1595 +
1614 1596 const operationBarProps = {
1615 1597 ...props,
1616 1598 sName,
... ... @@ -1875,10 +1857,12 @@ const CommonTableComponent = props =&gt; {
1875 1857 sName
1876 1858 };
1877 1859 if (tableProps.data && tableProps.data.length === 0) {
1878   - props.onMesTableLineAdd({
1879   - tableName: tableProps.name,
1880   - // tableClassName: state.tableClassName
1881   - })
  1860 + const bEmptyAddLine = tableProps.config.gdsconfigformslave.find(x => x.sControlName.includes('bEmptyAddLine'))
  1861 + if ((commonUtils.isNotEmptyObject(bEmptyAddLine) && bEmptyAddLine.bVisible)) {
  1862 + props.onMesTableLineAdd({
  1863 + tableName: tableProps.name,
  1864 + })
  1865 + }
1882 1866 }
1883 1867  
1884 1868 return (
... ...
src/mes/common/commonOperationBarComponent/MesToolbar.js
... ... @@ -134,15 +134,17 @@ const handleScanFace = (props) =&gt; {
134 134 const { [`${addData}Data`]: tableData = [], [`${addData}Config`]: config = {} } = props;
135 135 const copyConfig = config?.gdsconfigformslave?.find(item => item.sControlName.toLowerCase().includes('btnscanface'))
136 136 proData.forEach(item => {
137   - const data = commonFunc.getAssignFieldValue(copyConfig?.sAssignField, item)
  137 + const data = commonFunc.getAssignFieldValue(copyConfig?.sAssignField, item)
138 138 tableData.push({
139 139 ...item,
140 140 ...data,
141 141 sId: commonUtils.createSid(),
142 142 handleType: "add",
143 143 sParentId: props.masterData.sId,
  144 + slaveId: props?.slaveData ? props?.slaveData[0].sId : ''
144 145 })
145 146 });
  147 +
146 148 props.onSaveState({
147 149 [`${addData}Data`]: tableData
148 150 });
... ...
src/mes/scheduledTasks/machineTasks/index.js
... ... @@ -494,7 +494,6 @@ const MachineTasks = baseProps =&gt; {
494 494 slave2Column,
495 495 slave2Data = []
496 496 } = props;
497   - console.log("🚀 ~ MachineTasks ~ props:", props)
498 497  
499 498 const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
500 499  
... ...