From a1cb7031485e0c89122c38f711c5e0dd31a468bc Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Wed, 24 Nov 2021 17:20:49 +0800 Subject: [PATCH] zx --- src/lycomponents/iHeaderMa/index.vue | 18 +- src/mixins/index.js | 4 +- src/store/actions.js | 5 +- src/store/getters.js | 3 + src/store/mutations.js | 3 + src/store/state.js | 1 + src/views/BrandInsight/titsopo/index.vue | 34 +- .../marketingComparison.vue | 1 + .../MarketingComparison/mcBeginCompare.vue | 11 +- .../mcChooseModel/index.vue | 525 ++++++++++-------- 10 files changed, 351 insertions(+), 254 deletions(-) diff --git a/src/lycomponents/iHeaderMa/index.vue b/src/lycomponents/iHeaderMa/index.vue index e5bb029..ae460dc 100644 --- a/src/lycomponents/iHeaderMa/index.vue +++ b/src/lycomponents/iHeaderMa/index.vue @@ -24,7 +24,7 @@ 菜单 - + {{ item.key }} @@ -69,6 +69,7 @@ export default { sClock: "", week: "", intDt: null, + timeShow: true, form: { sTimeType: 4, sStartTime: "", @@ -79,6 +80,18 @@ export default { ], }; }, + // watch: { + // $route: { + // handler(val) { + // if (val.path === "/mcIndex") { + // this.timeShow = false; + // } else { + // this.timeShow = true; + // } + // }, + // immediate: true, + // }, + // }, created() { this.getSelect() }, @@ -114,7 +127,8 @@ export default { let obj = this.selDatas[n]; this.form.sStartTime = obj.starttime; this.form.sEndTime = obj.endtime; - this.setCtime(this.form); + this.setCtime(this.form); + this.setChangeSTime(1); this.reload(); }, // 点击个人中心 diff --git a/src/mixins/index.js b/src/mixins/index.js index f7f5541..d17902f 100644 --- a/src/mixins/index.js +++ b/src/mixins/index.js @@ -127,10 +127,10 @@ export default { } }, computed: { - ...mapGetters(['getZoom', 'getLoading','getToken', 'getUser', 'getAccount', 'getCommTime', 'getCtime', 'getCtime2', 'getHeaderType', 'getBrand', 'getModel','getSComparison','getBComparison', 'getMComparison', 'getEComparison','getLevelBtn','getMenu']) + ...mapGetters(['getZoom', 'getLoading','getToken', 'getUser', 'getAccount', 'getCommTime', 'getCtime', 'getCtime2', 'getHeaderType', 'getBrand', 'getModel','getSComparison','getBComparison', 'getMComparison', 'getEComparison','getLevelBtn','getMenu', 'getChangeSTime']) }, methods: { - ...mapActions(["setZoom", 'setLoading', 'setToken', 'setUser', 'setAccount', 'setCommTime', 'setCtime', 'setCtime2', 'setHeaderType', 'setBrand', 'setModel', 'setSComparison','setBComparison', 'setMComparison', 'setEComparison','setLevelBtn','setMenu']), + ...mapActions(["setZoom", 'setLoading', 'setToken', 'setUser', 'setAccount', 'setCommTime', 'setCtime', 'setCtime2', 'setHeaderType', 'setBrand', 'setModel', 'setSComparison','setBComparison', 'setMComparison', 'setEComparison','setLevelBtn','setMenu', 'setChangeSTime']), // 获取当前日期时间 getDatetime() { let now = new Date(); diff --git a/src/store/actions.js b/src/store/actions.js index 3eb3550..9a0e394 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -57,6 +57,9 @@ const actions = { }, setMenu: ({commit}, log) => { commit('setMenu', log) - } + }, + setChangeSTime: ({commit}, log) => { + commit('setChangeSTime', log) + }, } export default actions diff --git a/src/store/getters.js b/src/store/getters.js index d7a3790..d43a793 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -46,6 +46,9 @@ const getters = { getSComparison(state) { return state.sComparison }, + getChangeSTime(state) { + return state.changeSTime + }, getMComparison(state) { return state.mComparison }, diff --git a/src/store/mutations.js b/src/store/mutations.js index 0af758b..189aa62 100644 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -71,6 +71,9 @@ const mutations = { let str = JSON.stringify(log); sessionStorage.setItem('sComparison', str); }, + setChangeSTime: (state, log) => { + state.changeSTime = log; + }, setMComparison: (state, log) => { state.mComparison = log; let str = JSON.stringify(log); diff --git a/src/store/state.js b/src/store/state.js index fb6dfc7..c4fe75d 100644 --- a/src/store/state.js +++ b/src/store/state.js @@ -21,6 +21,7 @@ const state = { model: JSON.parse(sessionStorage.getItem('model')) || {}, bComparison: JSON.parse(sessionStorage.getItem('bComparison')) || [], sComparison: JSON.parse(sessionStorage.getItem('sComparison')) || [], + changeSTime: 1, mComparison: JSON.parse(sessionStorage.getItem('mComparison')) || [], eComparison: JSON.parse(sessionStorage.getItem('eComparison')) || [], levelBtn: JSON.parse(sessionStorage.getItem('levelBtn')) || [], diff --git a/src/views/BrandInsight/titsopo/index.vue b/src/views/BrandInsight/titsopo/index.vue index 26d5f27..393ee97 100644 --- a/src/views/BrandInsight/titsopo/index.vue +++ b/src/views/BrandInsight/titsopo/index.vue @@ -65,9 +65,41 @@ export default { }, // 前往数据表格 goIDE() { - this.$router.push({ + if(!this.btnPrm('btn_brand_datalist')) { + return + } + let startTime = ""; + let endTime = moment(new Date()).format("YYYY-MM-DD HH:mm:ss"); + let cTime2 = this.getCtime2; + let sTimeType = 34; + switch (cTime2.sTimeType) { + case 34: + sTimeType = 34 + break; + case 23: + sTimeType = 23 + break; + case 3: + sTimeType = 3 + break; + case 20: + sTimeType = 20 + break; + case 4: + sTimeType = 4; + startTime = cTime2.sStartTime; + endTime = cTime2.sEndTime; + break; + default: + sTimeType = 34 + break; + } + this.$router.push({ path: "/industryDataExport", query: { + startTime, + endTime, + sTimeType, token: this.getToken, action: "getList", sType: "BrandData", diff --git a/src/views/MarketingComparison/marketingComparison.vue b/src/views/MarketingComparison/marketingComparison.vue index 0d709b2..46ecc0e 100644 --- a/src/views/MarketingComparison/marketingComparison.vue +++ b/src/views/MarketingComparison/marketingComparison.vue @@ -47,6 +47,7 @@ export default { methods: { handlerChangeModel(arr) { this.setSComparison(arr); + this.setChangeSTime(0); this.reload() } } diff --git a/src/views/MarketingComparison/mcBeginCompare.vue b/src/views/MarketingComparison/mcBeginCompare.vue index 753403f..33b7ad7 100644 --- a/src/views/MarketingComparison/mcBeginCompare.vue +++ b/src/views/MarketingComparison/mcBeginCompare.vue @@ -41,6 +41,7 @@ export default { form: { token: "" }, + // chooseArr: [null, null, null, null, null, null], models: [ ], @@ -83,17 +84,19 @@ export default { let filterArr = arr.filter(ele => { return ele.brand && ele.model }); - if(filterArr.length < 2) { + let str = JSON.stringify(filterArr); + let arr1 = JSON.parse(str); + if(arr1.length < 2) { this.$message.warning('至少2个车型进行对比'); return; } - for(let i = 0; i < filterArr.length; i++) { - if(!filterArr[i].startTime || !filterArr[i].endTime) { + for(let i = 0; i < arr1.length; i++) { + if(!arr1[i].startTime || !arr1[i].endTime) { this.$message.warning('请选择时间'); return; } } - this.setSComparison(filterArr); + this.setSComparison(arr1); this.reload() } diff --git a/src/views/MarketingComparison/mcChooseModel/index.vue b/src/views/MarketingComparison/mcChooseModel/index.vue index e1d2131..c4e0e3a 100644 --- a/src/views/MarketingComparison/mcChooseModel/index.vue +++ b/src/views/MarketingComparison/mcChooseModel/index.vue @@ -7,280 +7,317 @@ * @FilePath: /data-show/src/views/MarketingComparison/mcChooseModel/index.vue --> - - - 返回营销分析 - - - - - - - {{item.brand|doStr(4)}} - {{item.model|doStr(10)}} - - - - - - - - - - - - 删除 - 切换车型 - - - - - + + + 返回营销分析 + + + + + + + {{ item.brand | doStr(4) }} + {{ item.model | doStr(10) }} + + + + + + + + + + + + + 删除 + + + 切换车型 + + + - + + +