Commit 7b2453fdc97547702076f2f8ee3d76f4fc622adb

Authored by 陈鑫涛
1 parent 3fbadced

盒型

src/components/Common/BoxDesignCompontent/svg.js
@@ -46,6 +46,7 @@ import { @@ -46,6 +46,7 @@ import {
46 createBoxComponentNewFul5, 46 createBoxComponentNewFul5,
47 } from "../BoxDesign/createAirplaneBox"; 47 } from "../BoxDesign/createAirplaneBox";
48 const SvgBox = props => { 48 const SvgBox = props => {
  49 + console.log("🚀 ~ props:", props)
49 const svgContainerRef = useRef(null); 50 const svgContainerRef = useRef(null);
50 const svgRef = useRef(null); 51 const svgRef = useRef(null);
51 const [boxKey, setBoxKey] = useState(new Date().getTime()); 52 const [boxKey, setBoxKey] = useState(new Date().getTime());
@@ -69,7 +70,7 @@ const SvgBox = props => { @@ -69,7 +70,7 @@ const SvgBox = props => {
69 70
70 // 初始化svg 71 // 初始化svg
71 const initSVG = () => { 72 const initSVG = () => {
72 - setBoxKey(new Date().getTime()); 73 + // setBoxKey(new Date().getTime());
73 const svg = svgRef.current; 74 const svg = svgRef.current;
74 const g = document.createElementNS("http://www.w3.org/2000/svg", "g"); // 创建 <g> 75 const g = document.createElementNS("http://www.w3.org/2000/svg", "g"); // 创建 <g>
75 76
src/components/Common/BoxShowImgMaterial/index.js
@@ -168,7 +168,7 @@ const BoxShowImgMaterial = props =&gt; { @@ -168,7 +168,7 @@ const BoxShowImgMaterial = props =&gt; {
168 // 计算材料利用率 168 // 计算材料利用率
169 const availability = ((((horizontalBoxes * verticalBoxes) * (Number(dMachineLength) * Number(dMachineWidth)) / (Number(dWlcd) * Number(dWlkd)))) * 100).toFixed(2); 169 const availability = ((((horizontalBoxes * verticalBoxes) * (Number(dMachineLength) * Number(dMachineWidth)) / (Number(dWlcd) * Number(dWlkd)))) * 100).toFixed(2);
170 useEffect(() => { 170 useEffect(() => {
171 - setBoxKey(new Date().getTime()); 171 + // setBoxKey(new Date().getTime());
172 setTimeout(() => { 172 setTimeout(() => {
173 if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) { 173 if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) {
174 // 计算父元素的缩放因子 174 // 计算父元素的缩放因子
src/components/Common/CommonViewTable/index.js
@@ -90,7 +90,7 @@ export default class CommonViewTable extends Component { @@ -90,7 +90,7 @@ export default class CommonViewTable extends Component {
90 if (tableConfigType) { 90 if (tableConfigType) {
91 masterShowConfig = commonUtils.isNotEmptyObject(tableConfig) ? tableConfig.gdsconfigformslave.filter(item => item.bVisible && item.sName !== '' && item.sControlName.split('_')[1] === tableConfigType) : []; 91 masterShowConfig = commonUtils.isNotEmptyObject(tableConfig) ? tableConfig.gdsconfigformslave.filter(item => item.bVisible && item.sName !== '' && item.sControlName.split('_')[1] === tableConfigType) : [];
92 } else { 92 } else {
93 - masterShowConfig = commonUtils.isNotEmptyObject(tableConfig) ? tableConfig.gdsconfigformslave.filter(item => item.bVisible && item.sName !== '' && item.sControlName.indexOf('_') === -1) : []; 93 + masterShowConfig = commonUtils.isNotEmptyObject(tableConfig) ? tableConfig.gdsconfigformslave.filter(item => item.bVisible && item.sName !== '' && (item.sControlName?.indexOf('_') === -1)) : [];
94 } 94 }
95 const formItemLayout = { labelCol: { span: 7, style: { color: 'rgba(0, 0, 0, 0.65)', backgroundColor: '#BFEFFF' } }, wrapperCol: { span: 17 } }; 95 const formItemLayout = { labelCol: { span: 7, style: { color: 'rgba(0, 0, 0, 0.65)', backgroundColor: '#BFEFFF' } }, wrapperCol: { span: 17 } };
96 96
src/components/Common/Typesetting/typesetting.js
@@ -416,7 +416,6 @@ const Typesetting = props =&gt; { @@ -416,7 +416,6 @@ const Typesetting = props =&gt; {
416 useEffect( 416 useEffect(
417 () => { 417 () => {
418 // 计算缩放比例 418 // 计算缩放比例
419 - setBoxKey(new Date().getTime());  
420 setTimeout(() => { 419 setTimeout(() => {
421 const scaleX = (clientWidth - 50) / (outerWidth + 110); 420 const scaleX = (clientWidth - 50) / (outerWidth + 110);
422 const scaleY = (clientHeight - 5) / (outerHeight + 90); 421 const scaleY = (clientHeight - 5) / (outerHeight + 90);
@@ -561,7 +560,7 @@ const Typesetting = props =&gt; { @@ -561,7 +560,7 @@ const Typesetting = props =&gt; {
561 560
562 const onClick = () => { 561 const onClick = () => {
563 setIsModalOpen(true); 562 setIsModalOpen(true);
564 - setBoxKeys(new Date().getTime()); 563 + // setBoxKeys(new Date().getTime());
565 setTimeout(() => { 564 setTimeout(() => {
566 const scaleX = 1200 / outerWidth; 565 const scaleX = 1200 / outerWidth;
567 const scaleY = 500 / outerHeight; 566 const scaleY = 500 / outerHeight;
src/components/Common/commonFunc.js
@@ -41,7 +41,6 @@ export function getConfig(type, name, config, gdsformconst, gdsjurisdiction, sDe @@ -41,7 +41,6 @@ export function getConfig(type, name, config, gdsformconst, gdsjurisdiction, sDe
41 } */ 41 } */
42 return returnConfig; 42 return returnConfig;
43 } 43 }
44 -  
45 export function getControlConfig() { 44 export function getControlConfig() {
46 return '' 45 return ''
47 } 46 }
@@ -180,7 +179,7 @@ export function getDefaultData(config, allTableData = {}, extraData = {}) { @@ -180,7 +179,7 @@ export function getDefaultData(config, allTableData = {}, extraData = {}) {
180 if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyObject(config.gdsconfigformslave)) { 179 if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyObject(config.gdsconfigformslave)) {
181 config.gdsconfigformslave.forEach((childConfig) => { 180 config.gdsconfigformslave.forEach((childConfig) => {
182 const { sDefault, sName } = childConfig; 181 const { sDefault, sName } = childConfig;
183 - if (sDefault !== '' && sName && sDefault !== undefined && sDefault.indexOf(':') > -1 && sDefault.indexOf('.') > -1) { 182 + if (typeof sDefault === 'string' && sDefault !== '' && sName && sDefault !== undefined && sDefault.indexOf(':') > -1 && sDefault.indexOf('.') > -1) {
184 const oldFieldName = sDefault.split(':')[1]; 183 const oldFieldName = sDefault.split(':')[1];
185 const tableName = oldFieldName.split('.')[0]; 184 const tableName = oldFieldName.split('.')[0];
186 if (sDefault && sDefault.includes('Fx')) { /* 默认值支持自定义函数 */ 185 if (sDefault && sDefault.includes('Fx')) { /* 默认值支持自定义函数 */