diff --git a/pages/ems/base/GdIdxMngPage.vue b/pages/ems/base/GdIdxMngPage.vue index c4e36e5..6a9bb00 100644 --- a/pages/ems/base/GdIdxMngPage.vue +++ b/pages/ems/base/GdIdxMngPage.vue @@ -112,7 +112,7 @@ export default { myPrgmId: myPrgmId, initedFlag: false, gridName: 'rowGrid', - loadGrid: true, + loadGrid: false, detailList: myDetail, selectValue01: null, selectValueList01: [], @@ -125,102 +125,102 @@ export default { // pysclQtyId3 : null, // pysclQtyId4 : null // } - dataPathExample: { - "rowGrid": { - data: [ + // dataPathExample: { + // "rowGrid": { + // data: [ - { - gdIdxId: 'GD001', - gdIdxNm: '온도 가이드', - eqpmGrpId: 'EQ001', - upTotMeth: 'AVG', - careStndVal: 50, - warnStndVal: 70, - alrmMsg: '온도가 기준치를 초과했습니다.', - }, - { - gdIdxId: 'GD002', - gdIdxNm: '습도 가이드', - eqpmGrpId: 'EQ002', - upTotMeth: 'MAX', - careStndVal: 30, - warnStndVal: 60, - alrmMsg: '습도가 기준치를 초과했습니다.', - }, - { - gdIdxId: 'GD003', - gdIdxNm: '압력 가이드', - eqpmGrpId: 'EQ003', - upTotMeth: 'SUM', - careStndVal: 100, - warnStndVal: 150, - alrmMsg: '압력이 기준치를 초과했습니다.', - } + // { + // gdIdxId: 'GD001', + // gdIdxNm: '온도 가이드', + // eqpmGrpId: 'EQ001', + // upTotMeth: 'AVG', + // careStndVal: 50, + // warnStndVal: 70, + // alrmMsg: '온도가 기준치를 초과했습니다.', + // }, + // { + // gdIdxId: 'GD002', + // gdIdxNm: '습도 가이드', + // eqpmGrpId: 'EQ002', + // upTotMeth: 'MAX', + // careStndVal: 30, + // warnStndVal: 60, + // alrmMsg: '습도가 기준치를 초과했습니다.', + // }, + // { + // gdIdxId: 'GD003', + // gdIdxNm: '압력 가이드', + // eqpmGrpId: 'EQ003', + // upTotMeth: 'SUM', + // careStndVal: 100, + // warnStndVal: 150, + // alrmMsg: '압력이 기준치를 초과했습니다.', + // } - ], - column: [ - { - header: '가이드', - name: 'gdIdxId', - width: 100, - align: 'center', - }, - { - header: '가이드명', - name: 'gdIdxNm', - width: 210, - align: 'left', - }, - { - header: '설비그룹ID', - name: 'eqpmGrpId', - width: 100, - align: 'center', - // formatter({ value }) { - // let retVal = ''; - // const newValue = _this.pageData.eqpmGrpList.filter(item => item.value == value); - // if (newValue.length > 0) { - // retVal = newValue[0].text; - // } - // return retVal; - // }, - }, - { - header: '상위집계방법', - name: 'upTotMeth', - width: 100, - align: 'center', - // formatter({ value }) { - // let retVal = ''; - // const newValue = _this.pageData.upTotMethList.filter(item => item.commCd == value); - // if (newValue.length > 0) { - // retVal = newValue[0].commCdNm; - // } - // return retVal; - // }, - }, - { - header: '주의기준', - name: 'careStndVal', - width: 100, - align: 'right', - }, - { - header: '경고기준', - name: 'warnStndVal', - width: 100, - align: 'right', - }, - { - header: '알람메세지', - name: 'alrmMsg', - minWidth: 860, - align: 'left', - } - ] + // ], + // column: [ + // { + // header: '가이드', + // name: 'gdIdxId', + // width: 100, + // align: 'center', + // }, + // { + // header: '가이드명', + // name: 'gdIdxNm', + // width: 210, + // align: 'left', + // }, + // { + // header: '설비그룹ID', + // name: 'eqpmGrpId', + // width: 100, + // align: 'center', + // // formatter({ value }) { + // // let retVal = ''; + // // const newValue = _this.pageData.eqpmGrpList.filter(item => item.value == value); + // // if (newValue.length > 0) { + // // retVal = newValue[0].text; + // // } + // // return retVal; + // // }, + // }, + // { + // header: '상위집계방법', + // name: 'upTotMeth', + // width: 100, + // align: 'center', + // // formatter({ value }) { + // // let retVal = ''; + // // const newValue = _this.pageData.upTotMethList.filter(item => item.commCd == value); + // // if (newValue.length > 0) { + // // retVal = newValue[0].commCdNm; + // // } + // // return retVal; + // // }, + // }, + // { + // header: '주의기준', + // name: 'careStndVal', + // width: 100, + // align: 'right', + // }, + // { + // header: '경고기준', + // name: 'warnStndVal', + // width: 100, + // align: 'right', + // }, + // { + // header: '알람메세지', + // name: 'alrmMsg', + // minWidth: 860, + // align: 'left', + // } + // ] - } - } + // } + // } }; }, computed: { @@ -352,60 +352,46 @@ export default { }); }, async getEqpmKind() { - // let res = await this.postApiReturn({ - // apiKey: 'selectEqpmKindCodeList', - // resKey: 'eqpmKindCodeLists', - // sendParam: {}, - // }); - // if (res.length > 0) { - // this.selectValueList01 = await res.map(item => { - // return { - // text: item.eqpmKindNm, - // value: item.eqpmKindId, - // }; - // }); - // this.selectValue01 = this.selectValueList01[0].value; - // } else { - // this.selectValueList01 = []; - // this.selectValue01 = null; - // } - - this.selectValueList01 = [ - { label: 'Etcher', value: 'EQK001' }, - { label: 'Deposition', value: 'EQK002' }, - { label: 'Inspection', value: 'EQK003' }, - ]; - - this.selectValue01 = 'EQK001'; + let res = await this.postApiReturn({ + apiKey: 'selectEqpmKindCodeList', + resKey: 'eqpmKindCodeLists', + sendParam: {}, + }); + if (res.length > 0) { + this.selectValueList01 = await res.map(item => { + return { + text: item.eqpmKindNm, + value: item.eqpmKindId, + }; + }); + this.selectValue01 = this.selectValueList01[0].value; + } else { + this.selectValueList01 = []; + this.selectValue01 = null; + } this.setPageData({ eqpmKindList: this.selectValueList01, eqpmKindId: this.selectValue01, }); }, async getEqpmGrp() { - // let res = await this.postApiReturn({ - // apiKey: 'selectEqpmGrpCodeList', - // resKey: 'eqpmGrpCodeLists', - // sendParam: { eqpmKindId: this.selectValue01 }, - // }); - // if (res.length > 0) { - // this.selectValueList02 = await res.map(item => { - // return { - // text: item.eqpmGrpNm, - // value: item.eqpmGrpId, - // }; - // }); - // this.selectValue02 = this.selectValueList02[0].value; - // } else { - // this.selectValueList02 = []; - // this.selectValue02 = null; - // } - this.selectValueList02 = [ - { label: '냉동기고온', value: '냉동기고온' }, - { label: '냉동기저온', value: '냉동기저온' }, - { label: '공조기', value: '공조기' }, - { label: '보일러', value: '보일러' } - ]; + let res = await this.postApiReturn({ + apiKey: 'selectEqpmGrpCodeList', + resKey: 'eqpmGrpCodeLists', + sendParam: { eqpmKindId: this.selectValue01 }, + }); + if (res.length > 0) { + this.selectValueList02 = await res.map(item => { + return { + text: item.eqpmGrpNm, + value: item.eqpmGrpId, + }; + }); + this.selectValue02 = this.selectValueList02[0].value; + } else { + this.selectValueList02 = []; + this.selectValue02 = null; + } this.setPageData({ eqpmGrpList: this.selectValueList02, @@ -636,100 +622,100 @@ export default { async getRowGridData() { this.loadGrid = false; let res = []; - const newRes = [ - { - comId: 'COM001', - gdIdxId: 'GD001', - gdIdxNm: '온도 가이드', - eqpmGrpId: 'EQ001', - upTotMeth: 'AVG', - sortSeq: 1, - pysclQtyId1: 'TEMP', - pysclQtyId2: null, - pysclQtyId3: null, - pysclQtyId4: null, - ctgr1: '환경', - ctgr2: '내부', - careStndVal: 50, - warnStndVal: 70, - gdMeth: '자동', - useFg: '1', - alrmMsg: '온도가 기준치를 초과했습니다.', - calcProc: 'PROC001', - calcDesc: '평균 계산', - calcMeth: '(A+B)/2', - unit: 'C', - argCnt: 2, - rowStat: null, - }, - { - comId: 'COM002', - gdIdxId: 'GD002', - gdIdxNm: '습도 가이드', - eqpmGrpId: 'EQ002', - upTotMeth: 'MAX', - sortSeq: 2, - pysclQtyId1: 'HUMID', - pysclQtyId2: null, - pysclQtyId3: null, - pysclQtyId4: null, - ctgr1: '환경', - ctgr2: '외부', - careStndVal: 30, - warnStndVal: 60, - gdMeth: '수동', - useFg: '0', - alrmMsg: '습도가 기준치를 초과했습니다.', - calcProc: 'PROC002', - calcDesc: '최대값 계산', - calcMeth: 'MAX(A,B)', - unit: '%', - argCnt: 2, - rowStat: null, - }, - ]; - - // res = await this.postApiReturn({ - // apiKey: 'selectEqpmGdIdxDataList', - // resKey: 'eqpmGdIdxDataList', - // sendParam: { - // eqpmGrpId: this.selectValue02, - // gdIdxNmLike: this.pageData.gdIdxNm, - // }, - // }); - // const newRes = res.map(item => { - // const newObj = { - // ...item, + // const newRes = [ + // { + // comId: 'COM001', + // gdIdxId: 'GD001', + // gdIdxNm: '온도 가이드', + // eqpmGrpId: 'EQ001', + // upTotMeth: 'AVG', + // sortSeq: 1, + // pysclQtyId1: 'TEMP', + // pysclQtyId2: null, + // pysclQtyId3: null, + // pysclQtyId4: null, + // ctgr1: '환경', + // ctgr2: '내부', + // careStndVal: 50, + // warnStndVal: 70, + // gdMeth: '자동', + // useFg: '1', + // alrmMsg: '온도가 기준치를 초과했습니다.', + // calcProc: 'PROC001', + // calcDesc: '평균 계산', + // calcMeth: '(A+B)/2', + // unit: 'C', + // argCnt: 2, // rowStat: null, - // }; - // return newObj; - // }); + // }, + // { + // comId: 'COM002', + // gdIdxId: 'GD002', + // gdIdxNm: '습도 가이드', + // eqpmGrpId: 'EQ002', + // upTotMeth: 'MAX', + // sortSeq: 2, + // pysclQtyId1: 'HUMID', + // pysclQtyId2: null, + // pysclQtyId3: null, + // pysclQtyId4: null, + // ctgr1: '환경', + // ctgr2: '외부', + // careStndVal: 30, + // warnStndVal: 60, + // gdMeth: '수동', + // useFg: '0', + // alrmMsg: '습도가 기준치를 초과했습니다.', + // calcProc: 'PROC002', + // calcDesc: '최대값 계산', + // calcMeth: 'MAX(A,B)', + // unit: '%', + // argCnt: 2, + // rowStat: null, + // }, + // ]; + + res = await this.postApiReturn({ + apiKey: 'selectEqpmGdIdxDataList', + resKey: 'eqpmGdIdxDataList', + sendParam: { + eqpmGrpId: this.selectValue02, + gdIdxNmLike: this.pageData.gdIdxNm, + }, + }); + const newRes = res.map(item => { + const newObj = { + ...item, + rowStat: null, + }; + return newObj; + }); this.setGridData({ gridKey: this.gridName, value: newRes, }); //this.loadGrid = true; - // this.$nextTick(() => { - // if (newRes.length > 0) { - // try { - // this.$refs[this.gridName].focus({ - // //rowKey: 0, - // rowKey: - // this.pageData.rowGridSelectKey == '' || - // this.pageData.rowGridSelectKey == null - // ? 0 - // : this.pageData.rowGridSelectKey == - // this.$refs[this.gridName].getData().length - 1 - // ? this.pageData.rowGridSelectKey - // : 0, - // columnName: 'gdIdxId', - // setScroll: true, - // }); - // } catch (error) { } - // } else { - // this.detailDataInit(); - // } - // }); + this.$nextTick(() => { + if (newRes.length > 0) { + try { + this.$refs[this.gridName].focus({ + //rowKey: 0, + rowKey: + this.pageData.rowGridSelectKey == '' || + this.pageData.rowGridSelectKey == null + ? 0 + : this.pageData.rowGridSelectKey == + this.$refs[this.gridName].getData().length - 1 + ? this.pageData.rowGridSelectKey + : 0, + columnName: 'gdIdxId', + setScroll: true, + }); + } catch (error) { } + } else { + this.detailDataInit(); + } + }); this.loadGrid = true; }, async getRowData(data) {