Commit 0745d91241242700ec5c36f37ae0fb9426294079
1 parent
198ee074
init
Showing
67 changed files
with
3401 additions
and
9395 deletions
Too many changes to show.
To preserve performance only 9 of 67 files are displayed.
.prettierrc
0 → 100644
| 1 | +{ | |
| 2 | + "printWidth": 150, | |
| 3 | + "eslintIntegration": true, | |
| 4 | + "stylelintIntegration": true, | |
| 5 | + "tabWidth": 2, | |
| 6 | + "semi": true, | |
| 7 | + "singleQuote": false, | |
| 8 | + "quoteProps": "as-needed", | |
| 9 | + "jsxSingleQuote": false, | |
| 10 | + "bracketSpacing": true, | |
| 11 | + "arrowParens": "avoid", | |
| 12 | + "htmlWhitespaceSensitivity": "css", | |
| 13 | + "javascript.format.insertSpaceBeforeFunctionParenthesis": true, | |
| 14 | + "files.insertFinalNewline": true, | |
| 15 | + "useTabs": false, | |
| 16 | + "endOfLine": "lf", | |
| 17 | + "ignorePath": ".gnore", | |
| 18 | + "trailingComma": "es5", | |
| 19 | + "jsxBracketSameLine": false, | |
| 20 | + "bracketSameLine": false | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
package.json
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | "version": "1.0.5", |
| 4 | 4 | "private": true, |
| 5 | 5 | "scripts": { |
| 6 | - "start": "set port=8543&roadhog server --progress --watch --colors --profile", | |
| 6 | + "start": "set port=9005&roadhog server --progress --watch --colors --profile", | |
| 7 | 7 | "build": "roadhog build", |
| 8 | 8 | "lint": "eslint --ext .js src test", |
| 9 | 9 | "precommit": "npm run lint" | ... | ... |
public/favicon.ico
No preview for this file type
public/数字工厂MES系统操作指引.pdf
No preview for this file type
src/components/Common/CommonBase.js
| ... | ... | @@ -592,7 +592,7 @@ export default (ChildComponent) => { |
| 592 | 592 | const returnFilterData = returnData.filter(item => commonUtils.isNotEmptyObject(item.sDivRow) && item.sDivRow !== ''); |
| 593 | 593 | if (commonUtils.isNotEmptyArr(returnFilterData)) { |
| 594 | 594 | returnFilterData.forEach((tableDataRow, index) => { |
| 595 | - /* 找到白班与晚班区间的汇总条数与工时 */ | |
| 595 | + /* 找到早班与晚班区间的汇总条数与工时 */ | |
| 596 | 596 | let startIndex = 0; /* 找到开始下标 */ |
| 597 | 597 | let endindex = 0; /* 找到结束下标 */ |
| 598 | 598 | let sliceData = []; | ... | ... |
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -310,7 +310,7 @@ export default class CommonComponent extends Component { |
| 310 | 310 | onBlurText = (event, timeout = 0) => { |
| 311 | 311 | const currentValue = event?.target?.value; |
| 312 | 312 | if (currentValue == this.lastValue) { |
| 313 | - this.props.app.globalFun?.onSetMask(false); | |
| 313 | + this.props.app?.globalFun?.onSetMask(false); | |
| 314 | 314 | return; |
| 315 | 315 | } |
| 316 | 316 | if (this.onExecInstructSet('blur')) { |
| ... | ... | @@ -1029,6 +1029,8 @@ export default class CommonComponent extends Component { |
| 1029 | 1029 | } else if (this.firstDataIndex === 's') { /* 文本输入框(文本s) */ |
| 1030 | 1030 | if (this.props.textArea) { /* 大文本输入框 */ |
| 1031 | 1031 | return <TextAreaA {...innerInputProps} />; |
| 1032 | + } else if (this.props.bPassWord) { | |
| 1033 | + return <Input.Password {...innerInputProps} /> | |
| 1032 | 1034 | } else { /* 普通文本输入框 */ |
| 1033 | 1035 | if (this.isReportInfo && this.props.enabled) { |
| 1034 | 1036 | innerInputProps.addonAfter = <PlusOutlined |
| ... | ... | @@ -1423,7 +1425,7 @@ export default class CommonComponent extends Component { |
| 1423 | 1425 | |
| 1424 | 1426 | /* 获取日期innerinputprops对象(从) */ |
| 1425 | 1427 | getDateInnerInputPropsSlave = () => { |
| 1426 | - let { sDateFormat, iTag } = this.props.showConfig; | |
| 1428 | + let { sDateFormat } = this.props.showConfig; | |
| 1427 | 1429 | if (commonUtils.isEmptyStr(sDateFormat)) { |
| 1428 | 1430 | if (this.firstDataIndex === 'm') { |
| 1429 | 1431 | sDateFormat = 'YYYY-MM'; |
| ... | ... | @@ -1472,14 +1474,6 @@ export default class CommonComponent extends Component { |
| 1472 | 1474 | if (this.bTbTime) { |
| 1473 | 1475 | obj.open = false; |
| 1474 | 1476 | } |
| 1475 | - | |
| 1476 | - if (iTag === 88) { | |
| 1477 | - obj.open = false; | |
| 1478 | - obj.onClick = () => { | |
| 1479 | - this.handleSelectOptionEvent('', moment().format(sDateFormat)) | |
| 1480 | - } | |
| 1481 | - } | |
| 1482 | - | |
| 1483 | 1477 | /* 值填充 */ |
| 1484 | 1478 | obj.value = commonUtils.isEmpty(this.state.dataValue) ? null : moment(this.state.dataValue); |
| 1485 | 1479 | /* 返回值 */ |
| ... | ... | @@ -1519,7 +1513,7 @@ export default class CommonComponent extends Component { |
| 1519 | 1513 | return value.replace(/\$\s?|(,*)/g, ''); |
| 1520 | 1514 | }, |
| 1521 | 1515 | formatter: (value) => { |
| 1522 | - if (value === '' || value === undefined || value === null || location.pathname.includes("indexPad")) { | |
| 1516 | + if (value === '' || value === undefined || value === null) { | |
| 1523 | 1517 | return value; |
| 1524 | 1518 | } |
| 1525 | 1519 | // if (this.props.showConfig.iTag === 10000) { |
| ... | ... | @@ -2705,7 +2699,7 @@ export default class CommonComponent extends Component { |
| 2705 | 2699 | /** 渲染 */ |
| 2706 | 2700 | render() { |
| 2707 | 2701 | /* 获取innerinput控件参数 */ |
| 2708 | - let innerInputProps = this.getInnerInputProps(); | |
| 2702 | + const innerInputProps = this.getInnerInputProps(); | |
| 2709 | 2703 | |
| 2710 | 2704 | const { slaveConfig = { gdsconfigformslave: [] }, bSColorSerialMemo } = this.props; |
| 2711 | 2705 | const { gdsconfigformslave } = slaveConfig; |
| ... | ... | @@ -2713,101 +2707,6 @@ export default class CommonComponent extends Component { |
| 2713 | 2707 | const btPopIndex = gdsconfigformslave.findIndex(item => item.sControlName === `BtnPopup.${sName}`); |
| 2714 | 2708 | const btCostomIndex = gdsconfigformslave.findIndex(item => item.sControlName === `BtnCustom.${sName}`); |
| 2715 | 2709 | |
| 2716 | - | |
| 2717 | - // 登记取样特殊处理 | |
| 2718 | - if(slaveConfig.sId=='12710101117346647176280'){ | |
| 2719 | - | |
| 2720 | - if(innerInputProps.id.includes('bReturn')){ | |
| 2721 | - window.$xlyStorage = this.props.dataValue; | |
| 2722 | - } | |
| 2723 | - | |
| 2724 | - if(innerInputProps.id.includes('sQrcode') && this.myRef.current){ | |
| 2725 | - | |
| 2726 | - this.myRef.current.querySelector('input').addEventListener('keydown',(event)=>{ | |
| 2727 | - if (event.code === 'NumpadEnter' || event.code === 'Enter') { // 或者使用 event.keyCode === 13 | |
| 2728 | - | |
| 2729 | - event.preventDefault(); // 阻止默认行为 | |
| 2730 | - // console.log(this.value) | |
| 2731 | - // const inputValue = this.value; | |
| 2732 | - // document.getElementById('output').innerText = '你输入的内容是: ' + inputValue; | |
| 2733 | - // 在这里添加你想要执行的其他代码 | |
| 2734 | - setTimeout(()=>{ | |
| 2735 | - let takeBtn = gdsconfigformslave.find(e=>e.sId=='17351987980002636428040338706000'); | |
| 2736 | - let returnBtn = gdsconfigformslave.find(e=>e.sId=='17346700000002938271207713181700'); | |
| 2737 | - | |
| 2738 | - if(window.$xlyStorage==0 && takeBtn){ | |
| 2739 | - // 取样 | |
| 2740 | - this.props.onExecInstructSet({ | |
| 2741 | - nextProps: { ...this.props}, | |
| 2742 | - btnConfig: { | |
| 2743 | - showName: "条码取样", | |
| 2744 | - sInstruct: takeBtn.sInstruct, | |
| 2745 | - error:(er)=>{ | |
| 2746 | - this.setState({ dataValue: '' }); | |
| 2747 | - }, | |
| 2748 | - }, | |
| 2749 | - callback: () => {}, | |
| 2750 | - }) | |
| 2751 | - }else if(window.$xlyStorage==1 && returnBtn){ | |
| 2752 | - // 归还 | |
| 2753 | - this.props.onExecInstructSet({ | |
| 2754 | - nextProps: { ...this.props}, | |
| 2755 | - btnConfig: { | |
| 2756 | - showName: "条码归还", | |
| 2757 | - sInstruct: returnBtn.sInstruct, | |
| 2758 | - error:(er)=>{ | |
| 2759 | - this.setState({ dataValue: '' }); | |
| 2760 | - }, | |
| 2761 | - }, | |
| 2762 | - callback: () => {}, | |
| 2763 | - }) | |
| 2764 | - } | |
| 2765 | - },300) | |
| 2766 | - } | |
| 2767 | - }) | |
| 2768 | - | |
| 2769 | - | |
| 2770 | - | |
| 2771 | - // debugger | |
| 2772 | - // innerInputProps.onPressEnter = (event2)=>{ | |
| 2773 | - // setTimeout(()=>{ | |
| 2774 | - // let takeBtn = gdsconfigformslave.find(e=>e.sId=='17351987980002636428040338706000'); | |
| 2775 | - // let returnBtn = gdsconfigformslave.find(e=>e.sId=='17346700000002938271207713181700'); | |
| 2776 | - | |
| 2777 | - // if(window.$xlyStorage==0 && takeBtn){ | |
| 2778 | - // // 取样 | |
| 2779 | - // this.props.onExecInstructSet({ | |
| 2780 | - // nextProps: { ...this.props}, | |
| 2781 | - // btnConfig: { | |
| 2782 | - // showName: "条码取样", | |
| 2783 | - // sInstruct: takeBtn.sInstruct, | |
| 2784 | - // error:(er)=>{ | |
| 2785 | - // this.setState({ dataValue: '' }); | |
| 2786 | - // }, | |
| 2787 | - // }, | |
| 2788 | - // callback: () => {}, | |
| 2789 | - // }) | |
| 2790 | - // }else if(window.$xlyStorage==1 && returnBtn){ | |
| 2791 | - // // 归还 | |
| 2792 | - // this.props.onExecInstructSet({ | |
| 2793 | - // nextProps: { ...this.props}, | |
| 2794 | - // btnConfig: { | |
| 2795 | - // showName: "条码归还", | |
| 2796 | - // sInstruct: returnBtn.sInstruct, | |
| 2797 | - // error:(er)=>{ | |
| 2798 | - // this.setState({ dataValue: '' }); | |
| 2799 | - // }, | |
| 2800 | - // }, | |
| 2801 | - // callback: () => {}, | |
| 2802 | - // }) | |
| 2803 | - // } | |
| 2804 | - // },300) | |
| 2805 | - // } | |
| 2806 | - } | |
| 2807 | - } | |
| 2808 | - | |
| 2809 | - | |
| 2810 | - | |
| 2811 | 2710 | /* 获取innerinput控件 */ |
| 2812 | 2711 | const innerInput = btPopIndex !== -1 ? ( |
| 2813 | 2712 | <Space className={styles.commonAntSpace} size={3}> |
| ... | ... | @@ -2821,10 +2720,6 @@ export default class CommonComponent extends Component { |
| 2821 | 2720 | {this.getInnerButtonCostom(gdsconfigformslave[btCostomIndex])} |
| 2822 | 2721 | <div /> |
| 2823 | 2722 | </Space> |
| 2824 | - ) : this.props.showTooltip ? ( | |
| 2825 | - <Tooltip title={<span style={{ fontSize: 18 }}>{this.props.dataValue}</span>}> | |
| 2826 | - {this.getInnerInput({ ...innerInputProps, disabled: false, readOnly: true })} | |
| 2827 | - </Tooltip> | |
| 2828 | 2723 | ) : this.getInnerInput(innerInputProps); |
| 2829 | 2724 | |
| 2830 | 2725 | let viewInfo = ''; |
| ... | ... | @@ -3065,27 +2960,6 @@ export default class CommonComponent extends Component { |
| 3065 | 2960 | const fieldDecoratorProps = this.getFieldDecoratorProps(); |
| 3066 | 2961 | /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */ |
| 3067 | 2962 | |
| 3068 | - | |
| 3069 | - // 班组报工,产量上报信息,label文字颜色特殊处理 | |
| 3070 | - if(slaveConfig.sId=='17087428780006438414984564455000'){ | |
| 3071 | - // 计件 | |
| 3072 | - if(innerInputProps.id.includes('dWageHour')){ | |
| 3073 | - outFormItemProps.label = <span style={{color:'#FF5722',fontWeight: 800,display:'flex',alignItems:'center'}}> | |
| 3074 | - <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="#FF5722" d="M2 3a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1zm6 0H3v2h5zM2 9a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1zm6 0H3v2h5zm-5 5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1zm0 1h5v2H3zm8-12a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1zm6 0h-5v2h5zm-5 5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1zm0 1h5v2h-5z"/></svg> | |
| 3075 | - {this.props.showConfig.showName} | |
| 3076 | - </span> | |
| 3077 | - } | |
| 3078 | - // 计时 | |
| 3079 | - if(innerInputProps.id.includes('dTimeHour')){ | |
| 3080 | - outFormItemProps.label = <span style={{color:'#9c27b0',fontWeight: 800,display:'flex',alignItems:'center'}}> | |
| 3081 | - <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="#9c27b0" d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 2a8 8 0 1 0 0 16a8 8 0 0 0 0-16m0 2a1 1 0 0 1 .993.883L13 7v4.586l2.707 2.707a1 1 0 0 1-1.32 1.497l-.094-.083l-3-3a1 1 0 0 1-.284-.576L11 12V7a1 1 0 0 1 1-1"/></g></svg> | |
| 3082 | - {this.props.showConfig.showName} | |
| 3083 | - </span> | |
| 3084 | - } | |
| 3085 | - } | |
| 3086 | - | |
| 3087 | - | |
| 3088 | - | |
| 3089 | 2963 | const commonAssembly = this.props.bNewForm ? innerInput: ( |
| 3090 | 2964 | <FormItem {...outFormItemProps}> |
| 3091 | 2965 | {viewInfo} | ... | ... |
src/components/Common/CommonHooks/useCommonBase.js
| ... | ... | @@ -113,11 +113,6 @@ const useCommonBase = props => { |
| 113 | 113 | */ |
| 114 | 114 | const handleGetModelConfig = async params => { |
| 115 | 115 | const { sModelsId } = params; |
| 116 | - !window.xlyFormDataCache && (window.xlyFormDataCache = {}); | |
| 117 | - if (window.xlyFormDataCache[sModelsId]) { | |
| 118 | - return window.xlyFormDataCache[sModelsId]; | |
| 119 | - } | |
| 120 | - | |
| 121 | 116 | const { token, formSrcRoute } = state; |
| 122 | 117 | const configUrl = `${ |
| 123 | 118 | commonConfig.server_host |
| ... | ... | @@ -128,7 +123,6 @@ const useCommonBase = props => { |
| 128 | 123 | if (configReturn.code === 1) { |
| 129 | 124 | const [configData] = configReturn.dataset.rows; |
| 130 | 125 | formData = configData.formData; |
| 131 | - window.xlyFormDataCache[sModelsId] = formData; | |
| 132 | 126 | } else { |
| 133 | 127 | getServiceError(configReturn); |
| 134 | 128 | } |
| ... | ... | @@ -2483,27 +2477,13 @@ const useCommonBase = props => { |
| 2483 | 2477 | }; |
| 2484 | 2478 | |
| 2485 | 2479 | // 表格行删除 |
| 2486 | - const handleMesTableLineDel = ({ | |
| 2487 | - tableName, | |
| 2488 | - record, | |
| 2489 | - index: indexOld, | |
| 2490 | - callback | |
| 2491 | - }) => { | |
| 2480 | + const handleMesTableLineDel = ({ tableName, record, index, callback }) => { | |
| 2492 | 2481 | const { |
| 2493 | 2482 | [`${tableName}Data`]: data = [], |
| 2494 | 2483 | [`${tableName}DelData`]: delData = [], |
| 2495 | 2484 | [`${tableName}Config`]: config = {} |
| 2496 | 2485 | } = state; |
| 2497 | 2486 | |
| 2498 | - let index = indexOld; | |
| 2499 | - if ( | |
| 2500 | - record.sRev && | |
| 2501 | - record.sRev?.startsWith("第") && | |
| 2502 | - record.sRev?.endsWith("转") | |
| 2503 | - ) { | |
| 2504 | - index = data.findIndex(item => item.sId === record.sId); | |
| 2505 | - } | |
| 2506 | - | |
| 2507 | 2487 | const { gdsconfigformslave = [] } = config; |
| 2508 | 2488 | const btnTableDelConfig = |
| 2509 | 2489 | gdsconfigformslave.find( |
| ... | ... | @@ -2721,11 +2701,7 @@ const useLoadSubscriptNum = props => { |
| 2721 | 2701 | useEffect( |
| 2722 | 2702 | async () => { |
| 2723 | 2703 | if (sModelsId !== sModelsId1) return; |
| 2724 | - if ( | |
| 2725 | - currentContent !== "scheduledTasks" && | |
| 2726 | - currentContent !== "productionExec" | |
| 2727 | - ) | |
| 2728 | - return; | |
| 2704 | + if (currentContent !== "scheduledTasks") return; | |
| 2729 | 2705 | |
| 2730 | 2706 | instructSet({ |
| 2731 | 2707 | ...props, |
| ... | ... | @@ -2769,10 +2745,10 @@ const useLoadSubscriptNum = props => { |
| 2769 | 2745 | inscallback: nextProps => { |
| 2770 | 2746 | const { counterData = [] } = nextProps; |
| 2771 | 2747 | const [counterRow = {}] = counterData; |
| 2772 | - const { table0 = 0, table1 = 0, table2 = 0, table3 = 0 } = counterRow; | |
| 2748 | + const { table0 = 0, table1 = 0, table2 = 0 } = counterRow; | |
| 2773 | 2749 | props.dispatch({ |
| 2774 | 2750 | type: "app/setCounter", |
| 2775 | - payload: { table0, table1, table2, table3 } | |
| 2751 | + payload: { table0, table1, table2 } | |
| 2776 | 2752 | }); |
| 2777 | 2753 | } |
| 2778 | 2754 | }); |
| ... | ... | @@ -2813,7 +2789,7 @@ const useGetMonitorFields = props => { |
| 2813 | 2789 | |
| 2814 | 2790 | props.onSaveState({ monitorFieldsMap }); |
| 2815 | 2791 | }, |
| 2816 | - [!!bFinish] | |
| 2792 | + [bFinish] | |
| 2817 | 2793 | ); |
| 2818 | 2794 | }; |
| 2819 | 2795 | ... | ... |
src/components/Common/CommonInstructSet.js
| ... | ... | @@ -59,7 +59,6 @@ const getOprFun = instruct => { |
| 59 | 59 | |
| 60 | 60 | calcprocedure: handleCalcprocedure, |
| 61 | 61 | clearrowkey: handleClearRowKey, |
| 62 | - selectfirstline: handleSelectFirstLine, | |
| 63 | 62 | refreshpage: handleRefreshPage, |
| 64 | 63 | "": () => ({}) |
| 65 | 64 | }; |
| ... | ... | @@ -199,7 +198,7 @@ const instructSet = async props => { |
| 199 | 198 | window.instructSetLock = true; |
| 200 | 199 | await instructSetInit(props); |
| 201 | 200 | } catch (error) { |
| 202 | - window.debugger && console.log("=====", error); | |
| 201 | + console.log("=====", error); | |
| 203 | 202 | window.instructSetLock = false; |
| 204 | 203 | props.app.globalFun.onSetMask(false); |
| 205 | 204 | props.onSaveState({ pageLoading: false, loadingBtnConfig: {} }); |
| ... | ... | @@ -238,27 +237,19 @@ const instructSetInit = async props => { |
| 238 | 237 | |
| 239 | 238 | let addState = {}; |
| 240 | 239 | |
| 241 | - try { | |
| 242 | - for (let i = 0; i < sInstruct.length; i++) { | |
| 243 | - const instruct = sInstruct[i]; | |
| 244 | - const operationFun = getOprFun(instruct); | |
| 245 | - const resultData = await operationFun({ ...props, ...addState }, instruct); | |
| 246 | - if (resultData.stop) { | |
| 247 | - throw new Error("人脸识别取消!"); | |
| 248 | - } | |
| 249 | - addState = { | |
| 250 | - ...addState, | |
| 251 | - ...resultData | |
| 252 | - }; | |
| 240 | + for (let i = 0; i < sInstruct.length; i++) { | |
| 241 | + const instruct = sInstruct[i]; | |
| 242 | + const operationFun = getOprFun(instruct); | |
| 243 | + const resultData = await operationFun({ ...props, ...addState }, instruct); | |
| 244 | + if (resultData.stop) { | |
| 245 | + throw new Error("人脸识别取消!"); | |
| 253 | 246 | } |
| 254 | - | |
| 255 | - } catch (error) { | |
| 256 | - props.btnConfig.error? props.btnConfig.error(error) : ''; | |
| 257 | - throw new Error(error); | |
| 247 | + addState = { | |
| 248 | + ...addState, | |
| 249 | + ...resultData | |
| 250 | + }; | |
| 258 | 251 | } |
| 259 | 252 | |
| 260 | - | |
| 261 | - | |
| 262 | 253 | // 是否要关闭弹窗 |
| 263 | 254 | const bClosePop = addState.closePop; |
| 264 | 255 | |
| ... | ... | @@ -467,7 +458,7 @@ const handleCopy = (props, instruct) => { |
| 467 | 458 | let srcData = dataList[0] || []; |
| 468 | 459 | |
| 469 | 460 | // 如果数据源是循环的那条数据 |
| 470 | - const { fordosetName, fordosetData, datasetList = [] } = props; | |
| 461 | + const { fordosetName, fordosetData } = props; | |
| 471 | 462 | if (fordosetName && srcDataset === fordosetName && fordosetData) { |
| 472 | 463 | srcData = [fordosetData]; |
| 473 | 464 | } |
| ... | ... | @@ -498,14 +489,7 @@ const handleCopy = (props, instruct) => { |
| 498 | 489 | |
| 499 | 490 | const resultData = [...srcDataNew]; |
| 500 | 491 | |
| 501 | - const datasetListNew = datasetList.includes(newDataset) | |
| 502 | - ? datasetList | |
| 503 | - : [...datasetList, newDataset]; | |
| 504 | - | |
| 505 | - const result = { | |
| 506 | - [`${newDataset}Data`]: resultData, | |
| 507 | - datasetList: datasetListNew | |
| 508 | - }; | |
| 492 | + const result = { [`${newDataset}Data`]: resultData }; | |
| 509 | 493 | |
| 510 | 494 | outputResult(result); |
| 511 | 495 | return result; |
| ... | ... | @@ -1559,31 +1543,15 @@ const handleOpenSql = async (props, instruct) => { |
| 1559 | 1543 | resultData.forEach((item = {}) => { |
| 1560 | 1544 | const itemNew = {}; |
| 1561 | 1545 | Object.keys(item).forEach(key => { |
| 1562 | - const itemName = !key.endsWith("Data") ? `${key}Data` : key; | |
| 1563 | - itemNew[itemName] = item[key]; | |
| 1546 | + if (!key.endsWith("Data")) { | |
| 1547 | + itemNew[`${key}Data`] = item[key]; | |
| 1548 | + } else { | |
| 1549 | + itemNew[key] = item[key]; | |
| 1550 | + } | |
| 1564 | 1551 | }); |
| 1565 | 1552 | |
| 1566 | 1553 | result = { ...result, ...itemNew }; |
| 1567 | 1554 | }); |
| 1568 | - | |
| 1569 | - const { handleType, newDataset } = item; | |
| 1570 | - if (handleType) { | |
| 1571 | - const { datasetList = [] } = props; | |
| 1572 | - const datasetListNew = datasetList.includes(newDataset) | |
| 1573 | - ? datasetList | |
| 1574 | - : [...datasetList, newDataset]; | |
| 1575 | - result = { | |
| 1576 | - ...result, | |
| 1577 | - datasetList: datasetListNew | |
| 1578 | - }; | |
| 1579 | - const itemName = !newDataset.endsWith("Data") | |
| 1580 | - ? `${newDataset}Data` | |
| 1581 | - : newDataset; | |
| 1582 | - result[itemName].forEach(item => { | |
| 1583 | - item.sId = commonUtils.createSid(); | |
| 1584 | - item.handleType = "add"; | |
| 1585 | - }); | |
| 1586 | - } | |
| 1587 | 1555 | } |
| 1588 | 1556 | |
| 1589 | 1557 | outputResult(result); |
| ... | ... | @@ -1730,15 +1698,6 @@ const handleProcedure = async (props, instruct) => { |
| 1730 | 1698 | if (iIndex !== -1) { |
| 1731 | 1699 | Object.keys(columnconfig[iIndex]).forEach(key => { |
| 1732 | 1700 | item[key] = columnconfig[iIndex][key]; |
| 1733 | - if (key === "bNotEmpty") { | |
| 1734 | - if ( | |
| 1735 | - (item.sName?.startsWith("i") || | |
| 1736 | - item.sName?.startsWith("d")) && | |
| 1737 | - item.bNotEmpty | |
| 1738 | - ) { | |
| 1739 | - item.bNotZero = true; | |
| 1740 | - } | |
| 1741 | - } | |
| 1742 | 1701 | }); |
| 1743 | 1702 | } |
| 1744 | 1703 | }); |
| ... | ... | @@ -2238,22 +2197,6 @@ const handleClearRowKey = async (props, instruct) => { |
| 2238 | 2197 | return {}; |
| 2239 | 2198 | }; |
| 2240 | 2199 | |
| 2241 | -/************************* 选中第一行 selectfirstline ************************/ | |
| 2242 | -const handleSelectFirstLine = async (props, instruct) => { | |
| 2243 | - const { dataset = "" } = instruct; | |
| 2244 | - const tableList = dataset.split(","); | |
| 2245 | - const addState = {}; | |
| 2246 | - tableList.forEach(tablename => { | |
| 2247 | - const { [`${tablename}Data`]: data = [] } = props; | |
| 2248 | - if (data.length) { | |
| 2249 | - addState[`${tablename}SelectedRowKeys`] = [data[0].sId]; | |
| 2250 | - } | |
| 2251 | - }); | |
| 2252 | - | |
| 2253 | - globalAddState = { ...globalAddState, ...addState }; | |
| 2254 | - return {}; | |
| 2255 | -}; | |
| 2256 | - | |
| 2257 | 2200 | /************************* 页面重新加载 refreshpage ************************/ |
| 2258 | 2201 | const handleRefreshPage = () => { |
| 2259 | 2202 | bRefreshPage = true; |
| ... | ... | @@ -2501,7 +2444,7 @@ const utils = { |
| 2501 | 2444 | // todo |
| 2502 | 2445 | return tableData[0]; |
| 2503 | 2446 | } else if (filterType === "last") { |
| 2504 | - return tableData[tableData.length - 1]; | |
| 2447 | + return [tableData[tableData.length - 1]]; | |
| 2505 | 2448 | } |
| 2506 | 2449 | |
| 2507 | 2450 | return tableData; |
| ... | ... | @@ -2635,9 +2578,10 @@ const utils = { |
| 2635 | 2578 | // 如果是 赋值字段名称:数据集名称.数据集字段名称 格式 |
| 2636 | 2579 | const [assignField, tableValues] = partValue.split(":"); |
| 2637 | 2580 | const [tableName, fieldName] = tableValues.split("."); |
| 2581 | + const tableNewData = Array.isArray(dataOneObj[tableName]) && dataOneObj[tableName].length > 0 ? dataOneObj[tableName][0] : dataOneObj[tableName]; | |
| 2638 | 2582 | rowData = { |
| 2639 | 2583 | ...rowData, |
| 2640 | - [assignField]: dataOneObj[tableName][fieldName] | |
| 2584 | + [assignField]: tableNewData[fieldName] | |
| 2641 | 2585 | }; |
| 2642 | 2586 | } else if (regex2.test(partValue)) { |
| 2643 | 2587 | // 如果是 赋值字段名称:数据集字段名称 格式 |
| ... | ... | @@ -3149,9 +3093,9 @@ const utils = { |
| 3149 | 3093 | let result = ""; |
| 3150 | 3094 | try { |
| 3151 | 3095 | // 调试模式 |
| 3152 | - if (window.debuggerValue && stringValue.includes(window.debuggerValue)) { | |
| 3153 | - debugger; | |
| 3154 | - } | |
| 3096 | + // if (window.debuggerValue && stringValue.includes(window.debuggerValue)) { | |
| 3097 | + // debugger; | |
| 3098 | + // } | |
| 3155 | 3099 | |
| 3156 | 3100 | // 第一遍运算(将变量转换成对应的值) |
| 3157 | 3101 | const evalStr = eval("`" + strNew + "`"); | ... | ... |
src/components/Common/CommonListSelect/index.js
| ... | ... | @@ -96,14 +96,7 @@ class CommonList extends Component { |
| 96 | 96 | slaveSelectedData, app, slaveSelectedRowKeys, slaveData, |
| 97 | 97 | } = this.props; |
| 98 | 98 | let newSlaveSelectedData = []; |
| 99 | - if (location.pathname.includes("indexPad") && commonUtils.isEmptyArr(slaveSelectedData) && this.tableRef) { | |
| 100 | - const dataRowKeys = this.tableRef.querySelectorAll('tr[data-row-key]'); | |
| 101 | - if (dataRowKeys.length === 1) { | |
| 102 | - const dataRowKey = dataRowKeys[0].getAttribute('data-row-key'); | |
| 103 | - const slaveDataOne = slaveData.filter(item => item.sSlaveId === dataRowKey); | |
| 104 | - newSlaveSelectedData = slaveDataOne; | |
| 105 | - } | |
| 106 | - } else if (commonUtils.isNotEmptyArr(slaveSelectedData)) { | |
| 99 | + if (commonUtils.isNotEmptyArr(slaveSelectedData)) { | |
| 107 | 100 | newSlaveSelectedData = slaveSelectedData; |
| 108 | 101 | } else if (commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) { |
| 109 | 102 | newSlaveSelectedData = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sSlaveId)); |
| ... | ... | @@ -181,7 +174,6 @@ class CommonList extends Component { |
| 181 | 174 | onEject={this.handleEject.bind(this)} |
| 182 | 175 | onSelectTree={this.handleTreeSelect} |
| 183 | 176 | onCopyTo={this.copyTo} |
| 184 | - setTableRef={(ref) => { this.tableRef = ref; }} | |
| 185 | 177 | /> |
| 186 | 178 | </div> |
| 187 | 179 | </Spin> |
| ... | ... | @@ -292,7 +284,6 @@ const CommonListComponent = Form.create({ |
| 292 | 284 | <Content |
| 293 | 285 | className={`${realizeHeight <= 0 ? 'xly-normal-list' : 'xly-normal-list resize-container-select'}`} |
| 294 | 286 | style={{ height: realizeHeight > 0 ? `${500 + realizeHeight}px` : 'auto', paddingLeft: '10px' }} |
| 295 | - ref={ref => { props.setTableRef(ref); }} | |
| 296 | 287 | > |
| 297 | 288 | <StaticEditTable {...tableProps} footer="hidden" showConfig={props.showConfig} {...rowSelectionProps} /> |
| 298 | 289 | </Content> | ... | ... |