Commit 3bea7e769946b5eda88de5bb3f515bee7477860b

Authored by chenxt
1 parent 35f62cd8

弹窗保存

src/components/Common/CommonComponent/index.js
@@ -1517,7 +1517,7 @@ export default class CommonComponent extends Component { @@ -1517,7 +1517,7 @@ export default class CommonComponent extends Component {
1517 }, /* 数据改变回带到父组件 */ 1517 }, /* 数据改变回带到父组件 */
1518 parser: (oldValue) => { 1518 parser: (oldValue) => {
1519 const value = this.handleCheckNumberInnerInput(oldValue); 1519 const value = this.handleCheckNumberInnerInput(oldValue);
1520 - return value.replace(/\$\s?|(,*)/g, ''); 1520 + return value?.replace(/\$\s?|(,*)/g, '');
1521 }, 1521 },
1522 formatter: (value) => { 1522 formatter: (value) => {
1523 if (value === '' || value === undefined || value === null || location.pathname.includes("indexPad")) { 1523 if (value === '' || value === undefined || value === null || location.pathname.includes("indexPad")) {
src/components/Common/CommonHooks/useCommonBase.js
@@ -251,7 +251,6 @@ const useCommonBase = props => { @@ -251,7 +251,6 @@ const useCommonBase = props => {
251 item.sName = configReturnModelData?.sName 251 item.sName = configReturnModelData?.sName
252 }) 252 })
253 } 253 }
254 -  
255 return formData; 254 return formData;
256 }; 255 };
257 256
@@ -346,7 +345,7 @@ const useCommonBase = props => { @@ -346,7 +345,7 @@ const useCommonBase = props => {
346 } 345 }
347 346
348 const configDataId = configData?.sId; 347 const configDataId = configData?.sId;
349 - const sId = JSON.parse(JSON.stringify(configDataId|| '')) 348 + const sId = JSON.parse(JSON.stringify(condition?.sId || '')) // 主表id
350 let pageRoute = props.sModelType; 349 let pageRoute = props.sModelType;
351 // 如果是弹窗且没有pageLayout,则认为是commonBill 350 // 如果是弹窗且没有pageLayout,则认为是commonBill
352 if (commonUtils.isNotEmptyObject(props.parentProps)) { 351 if (commonUtils.isNotEmptyObject(props.parentProps)) {
@@ -358,16 +357,15 @@ const useCommonBase = props => { @@ -358,16 +357,15 @@ const useCommonBase = props => {
358 condition.pageSize = '' 357 condition.pageSize = ''
359 delete condition.sSqlCondition 358 delete condition.sSqlCondition
360 } 359 }
361 - if (name.includes('slave') && pageRoute.includes('indexPage/commonBill')) { 360 + if (name.includes('slave') && pageRoute.includes('indexPage/commonBill') ) {
362 delete condition.sSqlCondition 361 delete condition.sSqlCondition
363 delete condition.sId 362 delete condition.sId
364 condition.sSqlCondition = { 363 condition.sSqlCondition = {
365 sParentId: sId 364 sParentId: sId
366 } 365 }
367 } 366 }
368 - if (name === 'master' && sId === '') {  
369 - return  
370 - } 367 + // 只有弹窗没有不查询
  368 + if (name === 'master' && sId === '' && props.parentProps && pageRoute.includes('indexPage/commonBill') ) return
371 const dataUrl = `${commonConfig.server_host 369 const dataUrl = `${commonConfig.server_host
372 }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; 370 }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
373 const dataReturn = (await commonServices.postValueService( 371 const dataReturn = (await commonServices.postValueService(
@@ -2977,6 +2975,7 @@ const useCommonBase = props => { @@ -2977,6 +2975,7 @@ const useCommonBase = props => {
2977 } 2975 }
2978 2976
2979 const newData = bAddFirst ? [addRowData, ...data] : [...data, addRowData]; 2977 const newData = bAddFirst ? [addRowData, ...data] : [...data, addRowData];
  2978 + console.log("🚀 ~ handleMesTableLineAdd ~ newData:", newData,masterData,state,props)
2980 const selectedRowKeys = [newSid]; 2979 const selectedRowKeys = [newSid];
2981 const addState = {}; 2980 const addState = {};
2982 if (location.pathname.includes("indexPad")) { 2981 if (location.pathname.includes("indexPad")) {
src/mes/common/commonModelComponent/index.js
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 import React, { useEffect, useRef, useState } from "react"; 2 import React, { useEffect, useRef, useState } from "react";
3 import moment from "moment"; 3 import moment from "moment";
4 import { cloneDeep } from "lodash"; 4 import { cloneDeep } from "lodash";
5 -import { Tabs, Modal, Space, Button, DatePicker, Radio, message , Avatar} from "antd"; 5 +import { Tabs, Modal, Space, Button, DatePicker, Radio, message, Avatar } from "antd";
6 import * as commonUtils from "@/utils/utils"; 6 import * as commonUtils from "@/utils/utils";
7 import * as commonConfig from "@/utils/config"; 7 import * as commonConfig from "@/utils/config";
8 import * as commonServices from "@/services/services"; 8 import * as commonServices from "@/services/services";
@@ -1587,7 +1587,7 @@ const CommonModel = baseProps => { @@ -1587,7 +1587,7 @@ const CommonModel = baseProps => {
1587 }; 1587 };
1588 1588
1589 const CommonModelComponent = props => { 1589 const CommonModelComponent = props => {
1590 - const { tabConfig = [], level, modelStyle, app, bMesBill, enabled ,masterData, sModelsType} = props; 1590 + const { tabConfig = [], level, modelStyle, app, bMesBill, enabled, masterData, sModelsType } = props;
1591 const { userinfo } = app; 1591 const { userinfo } = app;
1592 const sLanguage = userinfo.sLanguage; 1592 const sLanguage = userinfo.sLanguage;
1593 const getComponent = (config, index = 0) => { 1593 const getComponent = (config, index = 0) => {
@@ -1605,7 +1605,7 @@ const CommonModelComponent = props => { @@ -1605,7 +1605,7 @@ const CommonModelComponent = props => {
1605 if (!children.length) return ""; 1605 if (!children.length) return "";
1606 const footerComponent = useFooterComponent({ ...props, sTabName }); 1606 const footerComponent = useFooterComponent({ ...props, sTabName });
1607 const modelStyle = footerComponent ? { height: "calc(100% - 50px)" } : {}; 1607 const modelStyle = footerComponent ? { height: "calc(100% - 50px)" } : {};
1608 - 1608 +
1609 1609
1610 return ( 1610 return (
1611 <> 1611 <>
@@ -1940,8 +1940,8 @@ const CommonViewTableComponent = props =&gt; { @@ -1940,8 +1940,8 @@ const CommonViewTableComponent = props =&gt; {
1940 sName, 1940 sName,
1941 belongsToForm: true, 1941 belongsToForm: true,
1942 }; 1942 };
1943 - const {masterData, sModelsType, app} = props  
1944 - const {bCheck = false} = masterData || {} 1943 + const { masterData, sModelsType, app } = props
  1944 + const { bCheck = false } = masterData || {}
1945 const imgSrc = commonBusiness.handleAddIcon(masterData, sModelsType, app); 1945 const imgSrc = commonBusiness.handleAddIcon(masterData, sModelsType, app);
1946 return ( 1946 return (
1947 <> 1947 <>
@@ -2204,14 +2204,18 @@ const CommonTableComponent = props =&gt; { @@ -2204,14 +2204,18 @@ const CommonTableComponent = props =&gt; {
2204 ...props, 2204 ...props,
2205 sName 2205 sName
2206 }; 2206 };
2207 - if (tableProps.data && tableProps.data.length === 0) {  
2208 - const bEmptyAddLine = tableProps.config.gdsconfigformslave.find(x => x.sControlName.includes('bEmptyAddLine'))  
2209 - if ((commonUtils.isNotEmptyObject(bEmptyAddLine) && bEmptyAddLine.bVisible)) {  
2210 - props.onMesTableLineAdd({  
2211 - tableName: tableProps.name,  
2212 - }) 2207 +
  2208 + useEffect(() => {
  2209 + if (commonUtils.isEmptyObject(props.masterData)) return;
  2210 + if (tableProps.data && tableProps.data.length === 0) {
  2211 + const bEmptyAddLine = tableProps.config.gdsconfigformslave.find(x => x.sControlName.includes('bEmptyAddLine'))
  2212 + if ((commonUtils.isNotEmptyObject(bEmptyAddLine) && bEmptyAddLine.bVisible)) {
  2213 + props.onMesTableLineAdd({
  2214 + tableName: tableProps.name,
  2215 + })
  2216 + }
2213 } 2217 }
2214 - } 2218 + }, [props.masterData])
2215 2219
2216 return ( 2220 return (
2217 <> 2221 <>
src/mes/common/commonOperationBarComponent/index.js
@@ -1006,6 +1006,7 @@ const CommonOperationBarComponent = basProps =&gt; { @@ -1006,6 +1006,7 @@ const CommonOperationBarComponent = basProps =&gt; {
1006 if (searchField.sName.substring(0, 1) == "t") { 1006 if (searchField.sName.substring(0, 1) == "t") {
1007 searchField.sDateFormat = "YYYY-MM-DD"; 1007 searchField.sDateFormat = "YYYY-MM-DD";
1008 } 1008 }
  1009 +
1009 showTypeProps = { 1010 showTypeProps = {
1010 app, 1011 app,
1011 record: {}, 1012 record: {},
@@ -1034,7 +1035,8 @@ const CommonOperationBarComponent = basProps =&gt; { @@ -1034,7 +1035,8 @@ const CommonOperationBarComponent = basProps =&gt; {
1034 showTypeProps.componentStyle = { width: 180 }; 1035 showTypeProps.componentStyle = { width: 180 };
1035 } 1036 }
1036 } 1037 }
1037 - 1038 + console.log(showTypeProps, 'showTypeProps');
  1039 +
1038 let searchProductProps = {}; 1040 let searchProductProps = {};
1039 const searchProductConfig = gdsconfigformslave.filter( 1041 const searchProductConfig = gdsconfigformslave.filter(
1040 item => item.sName === "sSearchProductName" 1042 item => item.sName === "sSearchProductName"
@@ -1131,6 +1133,7 @@ const CommonOperationBarComponent = basProps =&gt; { @@ -1131,6 +1133,7 @@ const CommonOperationBarComponent = basProps =&gt; {
1131 searchProductProps.componentStyle = { width: 230 }; 1133 searchProductProps.componentStyle = { width: 230 };
1132 } 1134 }
1133 } 1135 }
  1136 +console.log(searchProductProps, 'searchProductProps');
1134 1137
1135 const handleBtnSearch = () => { 1138 const handleBtnSearch = () => {
1136 const { sModelsId } = props; 1139 const { sModelsId } = props;
src/utils/config.js
@@ -6,7 +6,7 @@ export const webSite = { @@ -6,7 +6,7 @@ export const webSite = {
6 // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', 6 // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace',
7 fileAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址 7 fileAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址
8 faceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyFace' : '//' + location.host + '/xlyFace', 8 faceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyFace' : '//' + location.host + '/xlyFace',
9 - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:43920/xlyEntry/' : '//' + location.host + '/xlyEntry/', 9 + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:47400/xlyEntry/' : '//' + location.host + '/xlyEntry/',
10 interfaceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 10 interfaceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址
11 // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', 11 // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/',
12 // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 12 // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址