From a3d0749a740193087115d167646e76011b88baa2 Mon Sep 17 00:00:00 2001 From: yanyizhou <2311759275@qq.com> Date: Wed, 24 Nov 2021 17:20:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A0=87=E5=87=86=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=AF=95=EF=BC=88=E8=BF=98=E5=B7=AE?= =?UTF-8?q?=E4=B8=80=E7=82=B9=E6=97=A5=E6=9C=9F=E6=98=BE=E7=A4=BA=E6=9C=89?= =?UTF-8?q?=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/localTool/standardWarning.vue | 466 ++++++------------------ 1 file changed, 116 insertions(+), 350 deletions(-) diff --git a/src/pages/localTool/standardWarning.vue b/src/pages/localTool/standardWarning.vue index b3e04056e..6e23fb675 100644 --- a/src/pages/localTool/standardWarning.vue +++ b/src/pages/localTool/standardWarning.vue @@ -4,7 +4,7 @@
-
+
@@ -62,7 +62,7 @@ - + - + @@ -158,19 +158,19 @@ {{ scope.row.putTime ? $moment(scope.row.putTime).format('YYYY-MM-DD') : '' }} - + - + - + @@ -187,173 +187,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @pageChange="page => handlePageChange('page', page)" + @pageSizeChange="pageSize => handlePageSizeChange('pageSize', pageSize)">
@@ -370,6 +209,8 @@ export default { name: "standardWarning", data() { return { + // + warningTableDatas:[], warningTableHeight: '', applyArcticOptions: [], // 适用车型下拉框 isShowBtn: true, @@ -380,8 +221,14 @@ export default { standCode: "", //标准名称 standName: "", + //发布日期 + putTime: [], //实施日期 - putTime: "", + SSRQ: [], + //新车型实施日期 + XCXSSRQ: [], + //在产车实施日期 + ZCCSSRQ: [], //适用车型 applyType: "", }, @@ -402,33 +249,11 @@ export default { oldPolicy: [], tableHeight: 0, pageConfig: { - newItemsPage: 1, - newItemsPageSize: 10, - count1: 0, - newStandPage: 1, - newStandPageSize: 10, - count2: 0, - oldItemsPage: 1, - oldItemsPageSize: 10, - count3: 0, - oldStandPage: 1, - oldStandPageSize: 10, - count4: 0, - newPolicyPage: 1, - newPolicyPageSize: 10, - count5: 0, - oldPolicyPage: 1, - oldPolicyPageSize: 10, - count6: 0, - }, - loading: { - newItems: false, - oldItems: false, - newStand: false, - oldStand: false, - newPolicy: false, - oldPolicy: false, + page: 1, + pageSize: 10, + total: 0, }, + warningTableLoading: false, // 记录当前分页器是哪个预警信息触发 field: '' }; @@ -436,8 +261,8 @@ export default { methods: { // 获取标准预警数据 (type用于区别分页器切换) getEarlyDate() { - this.loading[this.field] = true - this.$http.get('sys/EarlyWarning/StandWarning', { + this.warningTableLoading = true + this.$http.get('sys/EarlyWarning/getStandWarning', { applyType: '', ...this.pageConfig }, { @@ -516,9 +341,7 @@ export default { break } } - for (const loading in this.loading) { - this.loading[loading] = false - } + this.warningTableLoading = false }, e => { }); }, @@ -579,30 +402,56 @@ export default { }, //查找适用车型 searchBtnClick() { - this.$http.get('StandWarning/getStandWarning', { + this.warningTableLoading = true + this.$http.get('sys/EarlyWarning/getStandWarning', { ...this.pageConfig, //标准编号 standCode: this.dynamic.standCode, //标准名称 standName: this.dynamic.standName, + //发布日期 + startPutTime: this.dynamic.putTime[0], + endPutTime: this.dynamic.putTime[1], //实施日期 - putTime: this.dynamic.putTime[0], - lastTime: this.dynamic.putTime[1], + startSSRQ: this.dynamic.SSRQ[0], + endSSRQ: this.dynamic.SSRQ[1], + //新车型实施日期 + startXCXSSRQ: this.dynamic.XCXSSRQ[0], + endXCXSSRQ: this.dynamic.XCXSSRQ[1], + //在产车实施日期 + startZCCSSRQ: this.dynamic.ZCCSSRQ[0], + endZCCSSRQ: this.dynamic.ZCCSSRQ[1], //适用车型 applyType: this.dynamic.applyType }, { _this: this, }, res => { - const result = res.data[0] - for (const type in result) { - this[type] = result[type].records + console.log('608',res) + // 适用车型转换 + for (let a = 0; a < res.data.records.length; a++) { + if (res.data.records[a].applyType !== null) { + let k = (res.data.records[a].applyType || "").split(","); + for (let i in this.energyKindOptions) { + for (let m = 0; m < k.length; m++) { + if (this.energyKindOptions[i].value === k[m]) { + k[m] = this.energyKindOptions[i].label; + } + res.data.records[a].applyType = k.join(","); + } + } + } } - this.newItemsPage = 1 - this.oldItemsPage = 1 - this.newStandPage = 1 - this.oldStandPage = 1 - this.newPolicyPage = 1 - this.oldPolicypage = 1 + this.warningTableDatas = res.data.records + this.pageConfig.page = res.data.current + if ((this.warningTableDatas.length === 0 || this.warningTableDatas === []) && this.pageConfig.page !== 1) { + this.warningTableLoading = true + this.handlePageChange('page', 1) + }else { + this.warningTableLoading = false + } + this.pageConfig.pageSize = res.data.size + this.pageConfig.total = res.data.total + // this.warningTableLoading = false }, e => { }) }, @@ -612,8 +461,14 @@ export default { standCode: "", //标准名称 standName: "", + //发布日期 + putTime: [], //实施日期 - putTime: "", + SSRQ: [], + //新车型实施日期 + XCXSSRQ: [], + //在产车实施日期 + ZCCSSRQ: [], //适用车型 applyType: "", } @@ -714,41 +569,21 @@ export default { return date !== undefined && date != null ? date.split(" ")[0] : ""; }, handlePageChange(field, page) { - switch (field) { - // 新车型实施日期预警 - case 'newItems': - this.pageConfig.newItemsPage = page - break - // 新车型条款预警 - case 'newStand': - this.pageConfig.newStandPage = page - break - // 在产车实施日期预警 - case 'oldItems': - this.pageConfig.oldItemsPage = page - break - // 在产车条款预警 - case 'oldStand': - this.pageConfig.oldStandPage = page - break - // 政策新车型实施日期预警 - case 'newPolicy': - this.pageConfig.newPolicyPage = page - break - //政策 在产车实施日期预警 - case 'oldPolicy': - this.pageConfig.oldPolicyPage = page - break - } + this.pageConfig.page = page + this.searchBtnClick() + console.log('735',this.warningTableDatas) this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate() this.field = field }, //分页每页显示数改变后方法 handlePageSizeChange(field, pageSize) { - const _pageSize = field + 'PageSize' - this.pageConfig[_pageSize] = pageSize - this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate() - this.field = field + // const _pageSize = field + 'PageSize' + // this.pageConfig[_pageSize] = pageSize + this.pageConfig.pageSize = pageSize + this.searchBtnClick() + console.log('771',this.warningTableDatas) + // this.activeName === 'STANDARD' ? this.getEarlyDate() : this.getPolicyDate() + // this.field = field }, ...mapMutations(["setDetailMap"]) }, @@ -759,17 +594,22 @@ export default { }, computed: { containerStyle() { - return this.activeName === 'POLICY' ? { - height: '100%' - } : {} + this.$nextTick(() => { + return this.activeName === 'POLICY' ? { + height: '100%' + } : {} + }) } }, watch: {}, mounted() { - this.warningTableHeight = $(window).height()*0.54 - window.onresize = () => { - this.warningTableHeight = $(window).height()*0.54; - }; + this.warningTableLoading = true + // this.$nextTick(() => { + // this.warningTableHeight = $(window).height()*0.54 + // window.onresize = () => { + // this.warningTableHeight = $(window).height()*0.54; + // }; + // }) // alert(this.warningTableHeight) // this.height = $(".content").height(); // window.onresize = () => { @@ -782,100 +622,25 @@ export default { this.energyKindOptions = res.data.ENERGYTYPES; // 文本状态 this.applyArcticOptions = res.data.ENERGYTYPES // 适用车型 this.zrgcs = res.data.ZRGCSCLASS; - this.loading[this.field] = true - this.$http.get('sys/EarlyWarning/StandWarning', { + this.warningTableLoading = true + this.$http.get('sys/EarlyWarning/getStandWarning', { applyType: '', ...this.pageConfig }, { _this: this }, res => { - const result = res.data[0] - for (const field in result) { - this[field] = result[field].records - this[field].forEach(item => { - // 适用车型转换 - if (item.applyType !== null) { - let k = (item.applyType || "").split(","); - for (let i in this.energyKindOptions) { - for (let m = 0; m < k.length; m++) { - if (this.energyKindOptions[i].value === k[m]) { - k[m] = this.energyKindOptions[i].label; - } - item.applyType = k.join(","); - } - } - } - // 责任工程师转换 - if (item.dutyEngineer !== null) { - let k = (item.dutyEngineer || "").split(","); - for (let i in this.zrgcs) { - for (let m = 0; m < k.length; m++) { - if (this.zrgcs[i].value === k[m]) { - k[m] = this.zrgcs[i].label; - } - item.dutyEngineer = k.join(","); - } - } - } - }) - let arr = result.newItems.records - arr.forEach(item => { - // 适用车型转换 - if (item.applyType !== null) { - let k = (item.applyType || "").split(","); - for (let i in this.energyKindOptions) { - for (let m = 0; m < k.length; m++) { - if (this.energyKindOptions[i].value === k[m]) { - k[m] = this.energyKindOptions[i].label; - } - item.applyType = k.join(","); - } - } - } - // 责任工程师转换 - if (item.dutyEngineer !== null) { - let k = (item.dutyEngineer || "").split(","); - for (let i in this.zrgcs) { - for (let m = 0; m < k.length; m++) { - if (this.zrgcs[i].value === k[m]) { - k[m] = this.zrgcs[i].label; - } - item.dutyEngineer = k.join(","); - } - } - } - }) - this.newItems = arr - //可能还需要调整一下条款或标准的顺序(zyh) - switch (field) { - case 'newItems': - this.pageConfig.count1 = result.newItems.total - break - case 'oldItems': - this.pageConfig.count2 = result.oldItems.total - break - case 'newStand': - this.pageConfig.count3 = result.newStand.total - break - case 'oldStand': - this.pageConfig.count4 = result.oldStand.total - break - } - } - for (const loading in this.loading) { - this.loading[loading] = false - } + console.log('805',res) + this.warningTableDatas = res.data.records + this.pageConfig.page = res.data.current + this.pageConfig.pageSize = res.data.size + this.pageConfig.total = res.data.total + this.getEarlyDate(); + this.warningTableLoading = false }, e => { }); }); - // this.queryNewTypeByPage(); - // this.queryProductionVehicleByPage(); - // 四个预警同时查询,loading全部打开 - for (const loading in this.loading) { - this.loading[loading] = true - } - this.getEarlyDate(); + } }; @@ -998,6 +763,7 @@ export default { } .container { + height: calc(100% - 139px); /deep/ .el-tabs__header { height: 50px; } From a754b3d1654bb0c05d341c8aae04aadf4ea20e88 Mon Sep 17 00:00:00 2001 From: yanyizhou <2311759275@qq.com> Date: Wed, 24 Nov 2021 17:33:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=87=E5=87=86=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=85=A8=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/localTool/standardWarning.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/localTool/standardWarning.vue b/src/pages/localTool/standardWarning.vue index 6e23fb675..ec777f983 100644 --- a/src/pages/localTool/standardWarning.vue +++ b/src/pages/localTool/standardWarning.vue @@ -155,22 +155,22 @@