Browse Source

fix: 定制化分析报告表格修改

cuiyalong 3 years ago
parent
commit
9d87328dff

+ 2 - 1
src/components/selector/PopSelector.vue

@@ -253,8 +253,9 @@ export default {
           a_key: []
           a_key: []
         }
         }
 
 
+        const originItem = this.selectInfo.originMap[cname]
         this.selectInfo.popMap[cname].forEach(key => {
         this.selectInfo.popMap[cname].forEach(key => {
-          if (key.checked) {
+          if (key.checked || originItem.selectAll) {
             classify.a_key.push({
             classify.a_key.push({
               key: key.key.split(' '),
               key: key.key.split(' '),
               notkey: key.notkey ? key.notkey.split(' ') : null,
               notkey: key.notkey ? key.notkey.split(' ') : null,

+ 14 - 4
src/views/analysisReport/MarketAnalysis.vue

@@ -29,7 +29,7 @@
         </IndustrySelector>
         </IndustrySelector>
         <div class="action-button-group flex-r-c center button-group">
         <div class="action-button-group flex-r-c center button-group">
           <button class="button-default" @click="resetFilters">重置</button>
           <button class="button-default" @click="resetFilters">重置</button>
-          <button class="button-submit" @click="confirmSubmit">确定</button>
+          <button class="button-submit" @click="confirmSubmit">开始分析</button>
         </div>
         </div>
       </div>
       </div>
     </el-collapse-transition>
     </el-collapse-transition>
@@ -50,6 +50,7 @@ import MarketAnalysisResult from '@/views/analysisReport/MarketAnalysisResult.vu
 import Empty from '@/components/common/Empty.vue'
 import Empty from '@/components/common/Empty.vue'
 import { mapState } from 'vuex'
 import { mapState } from 'vuex'
 import { doReportAnalysis } from '@/api/modules/'
 import { doReportAnalysis } from '@/api/modules/'
+import qs from 'qs'
 
 
 export default {
 export default {
   name: 'analysis-report-filters',
   name: 'analysis-report-filters',
@@ -66,6 +67,7 @@ export default {
   },
   },
   data () {
   data () {
     return {
     return {
+      analysisDone: false, // 当前页面是否进行自己选择分析过
       showMoreFilters: true,
       showMoreFilters: true,
       loaded: false,
       loaded: false,
       loading: false,
       loading: false,
@@ -87,7 +89,7 @@ export default {
     })
     })
   },
   },
   watch: {
   watch: {
-    bigKeywordsData: function () {
+    bigKeywordsData () {
       this.initKeyMap()
       this.initKeyMap()
     }
     }
   },
   },
@@ -99,6 +101,11 @@ export default {
     this.initDefaultTime()
     this.initDefaultTime()
   },
   },
   methods: {
   methods: {
+    changeUrl (id) {
+      const query = this.$route.query
+      query.id = id
+      history.replaceState({}, '', `?${qs.stringify(query)}`)
+    },
     getUrlQuery () {
     getUrlQuery () {
       const { id } = this.$route.query
       const { id } = this.$route.query
       if (id) {
       if (id) {
@@ -156,6 +163,7 @@ export default {
 
 
       this.loading = true
       this.loading = true
       this.loaded = false
       this.loaded = false
+      this.analysisReportId = ''
 
 
       const { data, error_code: code } = await doReportAnalysis(query)
       const { data, error_code: code } = await doReportAnalysis(query)
 
 
@@ -167,10 +175,12 @@ export default {
       }
       }
     },
     },
     showAnalysisResult (id) {
     showAnalysisResult (id) {
+      this.analysisDone = true
       this.analysisReportId = id
       this.analysisReportId = id
     },
     },
     changeKeys () {
     changeKeys () {
       this.filters.keys = this.$refs.keySelector.getSelectedDetailList()
       this.filters.keys = this.$refs.keySelector.getSelectedDetailList()
+      console.log(this.filters.keys)
     },
     },
     changeTime (item) {
     changeTime (item) {
       let time = parseInt(item.start / 1000)
       let time = parseInt(item.start / 1000)
@@ -227,7 +237,8 @@ export default {
     },
     },
     // 整理数据,并赋值给filters
     // 整理数据,并赋值给filters
     loadedFilters (filters) {
     loadedFilters (filters) {
-      console.log(filters)
+      // 当前页面分析过,则不恢复filters
+      if (this.analysisDone) return
       if (filters.keys) {
       if (filters.keys) {
         this.filters.keys = filters.keys
         this.filters.keys = filters.keys
         this.restoreFilterKeys(filters.keys)
         this.restoreFilterKeys(filters.keys)
@@ -272,7 +283,6 @@ export default {
         end: selectTimeArr[1] * 1000,
         end: selectTimeArr[1] * 1000,
         exact: extra ? extra : 'exact'
         exact: extra ? extra : 'exact'
       }
       }
-      console.log(struct)
       this.$refs.timeSelector.setState(struct)
       this.$refs.timeSelector.setState(struct)
     },
     },
     restoreFilterArea (area) {
     restoreFilterArea (area) {

+ 22 - 6
src/views/analysisReport/MarketAnalysisResult.vue

@@ -599,7 +599,7 @@ export default {
       list[3].ringRatio = profile.winnercount_ratio ? (profile.winnercount_ratio * 100).toFixed(2) : 0
       list[3].ringRatio = profile.winnercount_ratio ? (profile.winnercount_ratio * 100).toFixed(2) : 0
       // 采购单位数
       // 采购单位数
       list[4].count = profile.buyercount ? profile.buyercount : 0
       list[4].count = profile.buyercount ? profile.buyercount : 0
-      list[4].ringRatio = profile.winnercount_ratio ? (profile.winnercount_ratio * 100).toFixed(2) : 0
+      list[4].ringRatio = profile.buyercount_ratio ? (profile.buyercount_ratio * 100).toFixed(2) : 0
 
 
       const totalCount = list.reduce((total, item) => item.count + total, 0)
       const totalCount = list.reduce((total, item) => item.count + total, 0)
 
 
@@ -961,7 +961,7 @@ export default {
                 winner_type: 'winner',
                 winner_type: 'winner',
                 winner_index: i + 1,
                 winner_index: i + 1,
                 winner_name: w.winner,
                 winner_name: w.winner,
-                winner_value: w.winner_amount ? `${formatPrice(w.winner_amount / 10000)}万元` : 0,
+                winner_value: w.winner_amount ? `${formatPrice(w.winner_amount / 10000)}万元` : '-',
                 // winner_percent: w.amount_scale ? `${formatPrice(w.amount_scale * 100)}%` : 0,
                 // winner_percent: w.amount_scale ? `${formatPrice(w.amount_scale * 100)}%` : 0,
                 rowspan: i === 0 ? item.winner.length : 0
                 rowspan: i === 0 ? item.winner.length : 0
               }
               }
@@ -1044,7 +1044,7 @@ export default {
                 winner_type: 'winner', // 用于判断采购单位或者中标单位
                 winner_type: 'winner', // 用于判断采购单位或者中标单位
                 winner_index: i + 1,
                 winner_index: i + 1,
                 winner_name: w.winner,
                 winner_name: w.winner,
-                winner_value: w.winner_amount ? `${formatPrice(w.winner_amount / 10000)}万元` : 0,
+                winner_value: w.winner_amount ? `${formatPrice(w.winner_amount / 10000)}万元` : '-',
                 // winner_percent: w.amount_scale ? `${formatPrice(w.amount_scale * 100)}%` : 0,
                 // winner_percent: w.amount_scale ? `${formatPrice(w.amount_scale * 100)}%` : 0,
                 rowspan: i === 0 ? item.winner.length : 0
                 rowspan: i === 0 ? item.winner.length : 0
               }
               }
@@ -1173,7 +1173,7 @@ export default {
                 winner_type: 'winner',
                 winner_type: 'winner',
                 winner_index: i + 1,
                 winner_index: i + 1,
                 winner_name: w.name,
                 winner_name: w.name,
-                winner_value: w.value ? `${formatPrice(w.value / 10000)}万元` : 0,
+                winner_value: w.value ? `${formatPrice(w.value / 10000)}万元` : '-',
                 // winner_percent: w.prop ? `${formatPrice(w.prop * 100)}%` : 0,
                 // winner_percent: w.prop ? `${formatPrice(w.prop * 100)}%` : 0,
                 rowspan: i === 0 ? item.amountTop.length : 0
                 rowspan: i === 0 ? item.amountTop.length : 0
               }
               }
@@ -1256,6 +1256,8 @@ export default {
               const row = {
               const row = {
                 index: index + 1,
                 index: index + 1,
                 name: item.name,
                 name: item.name,
+                name_type: 'buyer',
+                name_id: item.name,
                 value: item.number + '个',
                 value: item.number + '个',
                 // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
                 // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
                 winner_id: w.id,
                 winner_id: w.id,
@@ -1272,6 +1274,8 @@ export default {
             const row = {
             const row = {
               index: index + 1,
               index: index + 1,
               name: item.name,
               name: item.name,
+              name_type: 'buyer',
+              name_id: item.name,
               value: item.number + '个',
               value: item.number + '个',
               // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
               // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
               rowspan: 1
               rowspan: 1
@@ -1289,13 +1293,15 @@ export default {
               const row = {
               const row = {
                 index: index + 1,
                 index: index + 1,
                 name: item.name,
                 name: item.name,
+                name_type: 'buyer',
+                name_id: item.name,
                 value: formatPrice(item.amount / 10000) + '万元',
                 value: formatPrice(item.amount / 10000) + '万元',
                 // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
                 // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
                 winner_id: w.id,
                 winner_id: w.id,
                 winner_type: 'winner',
                 winner_type: 'winner',
                 winner_index: i + 1,
                 winner_index: i + 1,
                 winner_name: w.name,
                 winner_name: w.name,
-                winner_value: w.amount ? `${formatPrice(w.amount / 10000)}万元` : 0,
+                winner_value: w.amount ? `${formatPrice(w.amount / 10000)}万元` : '-',
                 // winner_percent: w.accounted ? `${formatPrice(w.accounted * 100)}%` : 0,
                 // winner_percent: w.accounted ? `${formatPrice(w.accounted * 100)}%` : 0,
                 rowspan: i === 0 ? item.winnertop3.length : 0
                 rowspan: i === 0 ? item.winnertop3.length : 0
               }
               }
@@ -1305,6 +1311,8 @@ export default {
             const row = {
             const row = {
               index: index + 1,
               index: index + 1,
               name: item.name,
               name: item.name,
+              name_type: 'buyer',
+              name_id: item.name,
               value: formatPrice(item.amount / 10000) + '万元',
               value: formatPrice(item.amount / 10000) + '万元',
               // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
               // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
               rowspan: 1
               rowspan: 1
@@ -1379,6 +1387,8 @@ export default {
               const row = {
               const row = {
                 index: index + 1,
                 index: index + 1,
                 name: item.name,
                 name: item.name,
+                name_type: 'winner',
+                name_id: item.id,
                 value: item.number + '个',
                 value: item.number + '个',
                 // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
                 // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
                 winner_id: w.name,
                 winner_id: w.name,
@@ -1396,6 +1406,8 @@ export default {
               index: index + 1,
               index: index + 1,
               name: item.name,
               name: item.name,
               value: item.number + '个',
               value: item.number + '个',
+              name_type: 'winner',
+              name_id: item.id,
               // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
               // percent: item.accounted ? `${formatPrice(item.accounted * 100)}%` : '',
               rowspan: 1
               rowspan: 1
             }
             }
@@ -1412,13 +1424,15 @@ export default {
               const row = {
               const row = {
                 index: index + 1,
                 index: index + 1,
                 name: item.name,
                 name: item.name,
+                name_type: 'winner',
+                name_id: item.id,
                 value: formatPrice(item.amount / 10000) + '万元',
                 value: formatPrice(item.amount / 10000) + '万元',
                 // percent: formatPrice(item.accounted * 100) + '%',
                 // percent: formatPrice(item.accounted * 100) + '%',
                 winner_id: w.name,
                 winner_id: w.name,
                 winner_type: 'buyer',
                 winner_type: 'buyer',
                 winner_index: i + 1,
                 winner_index: i + 1,
                 winner_name: w.name,
                 winner_name: w.name,
-                winner_value: w.amount ? `${formatPrice(w.amount / 10000)}万元` : 0,
+                winner_value: w.amount ? `${formatPrice(w.amount / 10000)}万元` : '-',
                 // winner_percent: w.accounted ? `${formatPrice(w.accounted * 100)}%` : 0,
                 // winner_percent: w.accounted ? `${formatPrice(w.accounted * 100)}%` : 0,
                 rowspan: i === 0 ? item.buyertop3.length : 0
                 rowspan: i === 0 ? item.buyertop3.length : 0
               }
               }
@@ -1428,6 +1442,8 @@ export default {
             const row = {
             const row = {
               index: index + 1,
               index: index + 1,
               name: item.name,
               name: item.name,
+              name_type: 'winner',
+              name_id: item.id,
               value: formatPrice(item.amount / 10000) + '万元',
               value: formatPrice(item.amount / 10000) + '万元',
               // percent: formatPrice(item.accounted * 100) + '%',
               // percent: formatPrice(item.accounted * 100) + '%',
               rowspan: 1
               rowspan: 1

+ 10 - 8
src/views/analysisReport/components/MarketOverview.vue

@@ -95,6 +95,15 @@ export default {
     .o-item-percent {
     .o-item-percent {
       font-size: 16px;
       font-size: 16px;
       line-height: 20px;
       line-height: 20px;
+      color: #686868;
+      &.color {
+        &-red {
+          color: #FF3A20;
+        }
+        &-green {
+          color: #04B15E;
+        }
+      }
       &-text {
       &-text {
         margin-right: 2px;
         margin-right: 2px;
       }
       }
@@ -113,12 +122,5 @@ export default {
   line-height: 18px;
   line-height: 18px;
   text-align: center;
   text-align: center;
 }
 }
-.color {
-  &-red {
-    color: #FF3A20;
-  }
-  &-green {
-    color: #04B15E;
-  }
-}
+
 </style>
 </style>

+ 8 - 2
src/views/analysisReport/components/MarketTop3Table.vue

@@ -28,7 +28,13 @@
         header-align="center"
         header-align="center"
         :label="tableData.columns[1]">
         :label="tableData.columns[1]">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <div class="area">{{ scope.row.name }}</div>
+          <div class="area" v-if="scope.row.name_type">
+            <el-link
+              :underline="false"
+              :disabled="!scope.row.name_id"
+              @click="toOtherPage(scope.row.name_id, scope.row.name_type)">{{ scope.row.name }}</el-link>
+          </div>
+          <div class="area" v-else>{{ scope.row.name }}</div>
           <div class="area-info">
           <div class="area-info">
             <span class="j-tag tag-lightblue" v-if="scope.row.value">{{ scope.row.value }}</span>
             <span class="j-tag tag-lightblue" v-if="scope.row.value">{{ scope.row.value }}</span>
             <span class="j-tag tag-orange" v-if="scope.row.percent">{{ scope.row.percent }}</span>
             <span class="j-tag tag-orange" v-if="scope.row.percent">{{ scope.row.percent }}</span>
@@ -47,7 +53,7 @@
                 :disabled="!scope.row.winner_id"
                 :disabled="!scope.row.winner_id"
                 @click="toOtherPage(scope.row.winner_id, scope.row.winner_type)">{{ scope.row.winner_name }}</el-link>
                 @click="toOtherPage(scope.row.winner_id, scope.row.winner_type)">{{ scope.row.winner_name }}</el-link>
             </span>
             </span>
-            <span v-if="scope.row.winner_value">&nbsp;{{ scope.row.winner_value }}</span>
+            <span v-if="scope.row.winner_value">{{ scope.row.winner_value }}</span>
             <span v-if="scope.row.winner_value && scope.row.winner_percent">,</span>
             <span v-if="scope.row.winner_value && scope.row.winner_percent">,</span>
             <span v-if="scope.row.winner_percent">{{ scope.row.winner_percent }}</span>
             <span v-if="scope.row.winner_percent">{{ scope.row.winner_percent }}</span>
           </div>
           </div>