diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index bd057ae..e0f6d38 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -1517,7 +1517,7 @@ export default class CommonComponent extends Component { }, /* 数据改变回带到父组件 */ parser: (oldValue) => { const value = this.handleCheckNumberInnerInput(oldValue); - return value.replace(/\$\s?|(,*)/g, ''); + return value?.replace(/\$\s?|(,*)/g, ''); }, formatter: (value) => { if (value === '' || value === undefined || value === null || location.pathname.includes("indexPad")) { diff --git a/src/components/Common/CommonHooks/useCommonBase.js b/src/components/Common/CommonHooks/useCommonBase.js index 3c652d2..3715069 100644 --- a/src/components/Common/CommonHooks/useCommonBase.js +++ b/src/components/Common/CommonHooks/useCommonBase.js @@ -251,7 +251,6 @@ const useCommonBase = props => { item.sName = configReturnModelData?.sName }) } - return formData; }; @@ -346,7 +345,7 @@ const useCommonBase = props => { } const configDataId = configData?.sId; - const sId = JSON.parse(JSON.stringify(configDataId|| '')) + const sId = JSON.parse(JSON.stringify(condition?.sId || '')) // 主表id let pageRoute = props.sModelType; // 如果是弹窗且没有pageLayout,则认为是commonBill if (commonUtils.isNotEmptyObject(props.parentProps)) { @@ -358,16 +357,15 @@ const useCommonBase = props => { condition.pageSize = '' delete condition.sSqlCondition } - if (name.includes('slave') && pageRoute.includes('indexPage/commonBill')) { + if (name.includes('slave') && pageRoute.includes('indexPage/commonBill') ) { delete condition.sSqlCondition delete condition.sId condition.sSqlCondition = { sParentId: sId } } - if (name === 'master' && sId === '') { - return - } + // 只有弹窗没有不查询 + if (name === 'master' && sId === '' && props.parentProps && pageRoute.includes('indexPage/commonBill') ) return const dataUrl = `${commonConfig.server_host }business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; const dataReturn = (await commonServices.postValueService( @@ -2977,6 +2975,7 @@ const useCommonBase = props => { } const newData = bAddFirst ? [addRowData, ...data] : [...data, addRowData]; + console.log("🚀 ~ handleMesTableLineAdd ~ newData:", newData,masterData,state,props) const selectedRowKeys = [newSid]; const addState = {}; if (location.pathname.includes("indexPad")) { diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index d9a9764..2a6fc1b 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from "react"; import moment from "moment"; import { cloneDeep } from "lodash"; -import { Tabs, Modal, Space, Button, DatePicker, Radio, message , Avatar} from "antd"; +import { Tabs, Modal, Space, Button, DatePicker, Radio, message, Avatar } from "antd"; import * as commonUtils from "@/utils/utils"; import * as commonConfig from "@/utils/config"; import * as commonServices from "@/services/services"; @@ -1587,7 +1587,7 @@ const CommonModel = baseProps => { }; const CommonModelComponent = props => { - const { tabConfig = [], level, modelStyle, app, bMesBill, enabled ,masterData, sModelsType} = props; + const { tabConfig = [], level, modelStyle, app, bMesBill, enabled, masterData, sModelsType } = props; const { userinfo } = app; const sLanguage = userinfo.sLanguage; const getComponent = (config, index = 0) => { @@ -1605,7 +1605,7 @@ const CommonModelComponent = props => { if (!children.length) return ""; const footerComponent = useFooterComponent({ ...props, sTabName }); const modelStyle = footerComponent ? { height: "calc(100% - 50px)" } : {}; - + return ( <> @@ -1940,8 +1940,8 @@ const CommonViewTableComponent = props => { sName, belongsToForm: true, }; - const {masterData, sModelsType, app} = props - const {bCheck = false} = masterData || {} + const { masterData, sModelsType, app } = props + const { bCheck = false } = masterData || {} const imgSrc = commonBusiness.handleAddIcon(masterData, sModelsType, app); return ( <> @@ -2204,14 +2204,18 @@ const CommonTableComponent = props => { ...props, sName }; - if (tableProps.data && tableProps.data.length === 0) { - const bEmptyAddLine = tableProps.config.gdsconfigformslave.find(x => x.sControlName.includes('bEmptyAddLine')) - if ((commonUtils.isNotEmptyObject(bEmptyAddLine) && bEmptyAddLine.bVisible)) { - props.onMesTableLineAdd({ - tableName: tableProps.name, - }) + + useEffect(() => { + if (commonUtils.isEmptyObject(props.masterData)) return; + if (tableProps.data && tableProps.data.length === 0) { + const bEmptyAddLine = tableProps.config.gdsconfigformslave.find(x => x.sControlName.includes('bEmptyAddLine')) + if ((commonUtils.isNotEmptyObject(bEmptyAddLine) && bEmptyAddLine.bVisible)) { + props.onMesTableLineAdd({ + tableName: tableProps.name, + }) + } } - } + }, [props.masterData]) return ( <> diff --git a/src/mes/common/commonOperationBarComponent/index.js b/src/mes/common/commonOperationBarComponent/index.js index 15fb79e..d2ce9ad 100644 --- a/src/mes/common/commonOperationBarComponent/index.js +++ b/src/mes/common/commonOperationBarComponent/index.js @@ -1006,6 +1006,7 @@ const CommonOperationBarComponent = basProps => { if (searchField.sName.substring(0, 1) == "t") { searchField.sDateFormat = "YYYY-MM-DD"; } + showTypeProps = { app, record: {}, @@ -1034,7 +1035,8 @@ const CommonOperationBarComponent = basProps => { showTypeProps.componentStyle = { width: 180 }; } } - + console.log(showTypeProps, 'showTypeProps'); + let searchProductProps = {}; const searchProductConfig = gdsconfigformslave.filter( item => item.sName === "sSearchProductName" @@ -1131,6 +1133,7 @@ const CommonOperationBarComponent = basProps => { searchProductProps.componentStyle = { width: 230 }; } } +console.log(searchProductProps, 'searchProductProps'); const handleBtnSearch = () => { const { sModelsId } = props; diff --git a/src/utils/config.js b/src/utils/config.js index d0dfeb8..72efcee 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -6,7 +6,7 @@ export const webSite = { // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', fileAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址 faceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyFace' : '//' + location.host + '/xlyFace', - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:43920/xlyEntry/' : '//' + location.host + '/xlyEntry/', + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:47400/xlyEntry/' : '//' + location.host + '/xlyEntry/', interfaceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址