Bläddra i källkod

Merge remote-tracking branch 'origin/dev4.6.2.15' into dev4.6.2.15

wangkaiyue 3 år sedan
förälder
incheckning
a58e8f38d9

+ 14 - 0
src/jfw/modules/app/src/web/staticres/jyapp/big-member/css/report_analysis.css

@@ -75,6 +75,9 @@
 }
 
 /* j-tag */
+.j-tag {
+  white-space: nowrap;
+}
 .j-tag.tag-orange {
   color: #FF9F3F;
   background-color: rgba(255, 159, 63, 0.1);
@@ -326,7 +329,15 @@
 .search-result .dimension .section-title {
   font-size: .28rem;
   line-height: .28rem;
+  padding: .32rem;
+  padding-bottom: 0;
+  text-align: center;
+}
+.search-result .dimension .section-tip-text {
+  padding-bottom: .32rem;
 }
+
+
 .search-result .dimension-list {
   display: flex;
   align-items: center;
@@ -449,6 +460,7 @@
   display: flex;
   align-items: center;
   justify-content: space-between;
+  width: 100%;
 }
 .project-top-item .p-t-i-hd-r .project-actions {
   display: flex;
@@ -473,6 +485,8 @@
   font-size: .28rem;
   color: #1D1D1D;
   line-height: .48rem;
+  max-width: 4rem;
+  flex: 1;
 }
 .project-top-item .p-t-i-hd-r .project-tags {
   display: flex;

+ 37 - 33
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/components/marketTimeScatter.js

@@ -27,21 +27,21 @@ var marketTimeScatter = {
         return {
           columns: ['日期', '项目规模', '环比增长率(%)'],
           rows: [
-            {
-              日期: '6月',
-              项目规模: 0,
-              '环比增长率(%)': -33
-            },
-            {
-              日期: '7月',
-              项目规模: 736325,
-              '环比增长率(%)': 0
-            },
-            {
-              日期: '8月',
-              项目规模: 73145,
-              '环比增长率(%)': 20
-            }
+            // {
+            //   日期: '6月',
+            //   项目规模: 0,
+            //   '环比增长率(%)': -33
+            // },
+            // {
+            //   日期: '7月',
+            //   项目规模: 736325,
+            //   '环比增长率(%)': 0
+            // },
+            // {
+            //   日期: '8月',
+            //   项目规模: 73145,
+            //   '环比增长率(%)': 20
+            // }
           ]
         }
       }
@@ -185,25 +185,29 @@ var marketTimeScatter = {
       options.xAxis[0].axisLabel.interval = 'auto'
 
       options.yAxis[1].axisLabel.show = true
-      // 设置时间轴
-      Object.assign(options, {
-        // grid解决dataZoom文字被隐藏的问题
-        // https://github.com/apache/echarts/issues/11601
-        grid: {
-          left: '5%',
-          right: '10%'
-        },
-        dataZoom: {
-          show: true, // 显示滚动条
-          realtime: true, // 拖动时,是否实时更新系列的视图
-          type: 'slider',
-          height: 20,
-          bottom: 0,
-          textStyle: {
-            fontSize: 10
+
+      if (this.chartData.rows.length > 8) {
+        // 设置时间轴
+        Object.assign(options, {
+          // grid解决dataZoom文字被隐藏的问题
+          // https://github.com/apache/echarts/issues/11601
+          grid: {
+            left: '5%',
+            right: '13%'
+          },
+          dataZoom: {
+            show: true, // 显示滚动条
+            realtime: true, // 拖动时,是否实时更新系列的视图
+            type: 'slider',
+            height: 20,
+            bottom: 0,
+            textStyle: {
+              fontSize: 10
+            }
           }
-        }
-      })
+        })
+      }
+
       options.legend.bottom = 30
       options.legend.data = [
         { icon: 'rect', name: this.chartData.columns[1] },

+ 1 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/components/marketTop3Table.js

@@ -15,7 +15,7 @@ var marketTop3TableTemplate = `
           }"></div>
         <div class="p-t-i-hd-r">
           <div class="p-t-i-hd-r-top">
-            <div class="project-name" v-text="item.name" :class="{ disabled: !item.id }" @click="toPortrait(item.id, item.type)"></div>
+            <div class="project-name ellipsis" v-text="item.name" :class="{ disabled: !item.id }" @click="toPortrait(item.id, item.type)"></div>
             <div class="project-actions" v-show="item.children.length" :class="{ 'icon-reverse': item.childrenShow }" @click="changeChildrenShow(item)">
               <div v-text="item.actionText"></div>
               <van-icon name="arrow-down"></van-icon>

+ 18 - 11
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/report_analysis.js

@@ -340,11 +340,16 @@ var vm = new Vue({
       return this.$dialog.confirm(defaultConf)
     },
     calcOffsetTop: function () {
+      var sticky = $('.van-sticky')
+      var stickyHeight = 0
+      if (sticky.length) {
+        stickyHeight = sticky[0].clientHeight
+      }
       this.dimensionList.forEach(function (item) {
         var anchor = $('.' + item.anchor)
         var offsetTop = 0
         if (anchor.length) {
-          offsetTop = parseInt(anchor.offset().top)
+          offsetTop = parseInt(anchor[0].offsetTop - stickyHeight)
         }
         item.top = offsetTop
       })
@@ -359,7 +364,7 @@ var vm = new Vue({
       // 2. 具体逻辑
       $scrollDOM.on('scroll', this.checkScrollTopButtonShow)
       setTimeout(function () {
-        // 5s后绑定(尽可能保证top能够被计算完)
+        // 2s后绑定(尽可能保证top能够被计算完)
         $scrollDOM.on('scroll', this.checkAnchorItemActive)
       }.bind(this), 2000)
 
@@ -372,11 +377,11 @@ var vm = new Vue({
       var anchorTopList = this.anchorTopList
       var scrollTop = $scrollDOM.scrollTop()
       var i = 0
-      if (scrollTop > anchorTopList[1] && scrollTop <= anchorTopList[2]) {
+      if (scrollTop >= anchorTopList[1] && scrollTop < anchorTopList[2]) {
         i = 1
-      } else if (scrollTop >= anchorTopList[2]) {
+      } else if (scrollTop > anchorTopList[2]) {
         i = 2
-      } else {
+      } else if (scrollTop < anchorTopList[1]) {
         i = 0
       }
       this.activeDimension = this.dimensionList[i].id
@@ -574,7 +579,7 @@ var vm = new Vue({
       var _this = this
       var dialog = this.filterDialogShow
       if (key === 'keys') {
-        if (this.notSetKey && this.isSubCount) {
+        if (this.notSetKey) {
           return this.setKeyTip()
         }
       } else if (key === 'area') {
@@ -1404,11 +1409,11 @@ var vm = new Vue({
     },
     sortRefineTop3 (data) {
       const tableDataCount = {
-        columns: ['序号', '细分市场:项目数量(个),占比', '前3中标单位:中标数量(个)'], // ,该细分市场占比
+        columns: ['序号', '细分市场:项目数量(个)', '前3中标单位:中标数量(个)'], // ,占比,该细分市场占比
         rows: []
       }
       const tableDataAmount = {
-        columns: ['序号', '细分市场:项目金额(万元),占比', '前3中标单位:中标金额(万元)'], // ,该细分市场占比
+        columns: ['序号', '细分市场:项目金额(万元)', '前3中标单位:中标金额(万元)'], // ,占比,该细分市场占比
         rows: []
       }
 
@@ -1417,7 +1422,7 @@ var vm = new Vue({
         countTop3.forEach((item, index) => {
           item.name = item.name
           item.subInfo1 = `项目数量:${item.total}个`
-          item.subInfo2 = item.prop ? `全部占比:${utils.formatMoney(item.prop * 100, undefined, true)}%` : 0
+          // item.subInfo2 = item.prop ? `全部占比:${utils.formatMoney(item.prop * 100, undefined, true)}%` : 0
           item.actionText = `中标单位 TOP3`
           item.childrenShow = true
           item.children = []
@@ -1442,7 +1447,7 @@ var vm = new Vue({
         amountTop3.forEach((item, index) => {
           item.name = item.name
           item.subInfo1 = `项目金额:${utils.formatMoney(item.amount / 10000, undefined, true)}万元`
-          item.subInfo2 = item.prop ? `全部占比:${utils.formatMoney(item.prop * 100, undefined, true)}%` : 0
+          // item.subInfo2 = item.prop ? `全部占比:${utils.formatMoney(item.prop * 100, undefined, true)}%` : 0
           item.actionText = `中标单位 TOP3`
           item.childrenShow = true
           item.children = []
@@ -1711,7 +1716,9 @@ var vm = new Vue({
       var stickyHeight = $('.dimension-list')[0].clientHeight
       var sTop = offsetTop - headerHeight - tabHeight - stickyHeight
       this.activeDimension = item.id
-      $('.search-result > .j-main').animate({ scrollTop: sTop })
+      this.$nextTick(function () {
+        $('.search-result > .j-main')[0].scrollTop = sTop
+      })
     },
     showSetKeyTip: function () {
       this.notSetKey = true

+ 4 - 4
src/jfw/modules/app/src/web/templates/big-member/page_report_analysis.html

@@ -78,7 +78,7 @@
                             <van-cell center title="分析条件" is-link @click="filtersPageShow = true; rid = ''"></van-cell>
                         </van-cell-group>
                         <div class="height8" v-show="false"></div>
-                        <section class="section bg-white pd-16 dimension">
+                        <section class="section bg-white dimension">
                             <div class="section-title"> - 分析维度 -</div>
                             <van-sticky class="section-sticky" z-index="99999999" :offset-top="stickyOffset">
                                 <div class="section-content dimension-list bg-white">
@@ -98,7 +98,7 @@
                             </div>
                         </section>
                         <!-- 市场概况 -->
-                        <section class="section bg-white market-overview">
+                        <section class="section bg-white market-overview" id="market">
                             <div class="section-title pd-16">市场概况</div>
                             <div class="section-content market-overview-list">
                                 <div
@@ -265,7 +265,7 @@
                             </div>
                         </div>
                         <!-- 采购规模分布 -->
-                        <div class="section bg-white pd-16 buyerclass-scatter" v-if="sections.buyerclass.dataAlready">
+                        <div class="section bg-white pd-16 buyerclass-scatter" id="buyer" v-if="sections.buyerclass.dataAlready">
                             <div class="section-title">采购规模分布</div>
                             <div class="section-content">
                                 <line-chart-scatter :chart-data="sections.buyerclass.chartData"></line-chart-scatter>
@@ -284,7 +284,7 @@
                             </div>
                         </div>
                         <!-- 采购规模分布 -->
-                        <div class="section bg-white pd-16 winner-scatter" v-if="sections.winner.dataAlready">
+                        <div class="section bg-white pd-16 winner-scatter" id="winner" v-if="sections.winner.dataAlready">
                             <div class="section-title">中标规模分布</div>
                             <div class="section-content">
                                 <line-chart-scatter :chart-data="sections.winner.chartData"></line-chart-scatter>

+ 16 - 27
src/jfw/modules/bigmember/src/entity/marketAnalysis/customizad_distribution.go

@@ -386,62 +386,51 @@ func (mae *MarketAnalysisEntity) TimeData(_b bool, thisRow []Buckets) map[string
 }
 
 func amountDistribution(v float64, data map[string]*distributionTrend) {
+	if v <= 0 {
+		return
+	}
 	if v < 100000 {
 		if data["<10万"] == nil {
 			data["<10万"] = new(distributionTrend)
 		}
 		data["<10万"].Amount += v
-		if v != 0 {
-			data["<10万"].Count++
-		}
-	} else if v <= 500000 {
+		data["<10万"].Count++
+	} else if v < 500000 {
 		if data["10万-50万"] == nil {
 			data["10万-50万"] = new(distributionTrend)
 		}
 		data["10万-50万"].Amount += v
-		if v != 0 {
-			data["10万-50万"].Count++
-		}
-	} else if v <= 1000000 {
+		data["10万-50万"].Count++
+	} else if v < 1000000 {
 		if data["50万-100万"] == nil {
 			data["50万-100万"] = new(distributionTrend)
 		}
 		data["50万-100万"].Amount += v
-		if v != 0 {
-			data["50万-100万"].Count++
-		}
-	} else if v <= 1000000*5 {
+		data["50万-100万"].Count++
+	} else if v < 1000000*5 {
 		if data["100万-500万"] == nil {
 			data["100万-500万"] = new(distributionTrend)
 		}
 		data["100万-500万"].Amount += v
-		if v != 0 {
-			data["100万-500万"].Count++
-		}
-	} else if v <= 1000000*10 {
+		data["100万-500万"].Count++
+	} else if v < 1000000*10 {
 		if data["500万-1000万"] == nil {
 			data["500万-1000万"] = new(distributionTrend)
 		}
 		data["500万-1000万"].Amount += v
-		if v != 0 {
-			data["500万-1000万"].Count++
-		}
-	} else if v <= 100000000 {
+		data["500万-1000万"].Count++
+	} else if v < 100000000 {
 		if data["1000万-1亿"] == nil {
 			data["1000万-1亿"] = new(distributionTrend)
 		}
 		data["1000万-1亿"].Amount += v
-		if v != 0 {
-			data["1000万-1亿"].Count++
-		}
-	} else if v > 100000000 {
+		data["1000万-1亿"].Count++
+	} else if v >= 100000000 {
 		if data["≥1亿"] == nil {
 			data["≥1亿"] = new(distributionTrend)
 		}
 		data["≥1亿"].Amount += v
-		if v != 0 {
-			data["≥1亿"].Count++
-		}
+		data["≥1亿"].Count++
 	}
 
 }

+ 10 - 3
src/jfw/modules/bigmember/src/entity/marketAnalysis/customized_analysis.go

@@ -19,13 +19,16 @@ const (
 	aggs_buyerclass_counttop3  = `"buyerclass_count_top3":{"terms":{"field":"buyerclass","exclude":["其它",""],"order":[{"buyerclass_count":"desc"}],"size":3},"aggs":{"buyerclass_count":{"filter":{}},"bidcount_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"buyer_winner_count":"desc"}],"size":3},"aggs":{"buyer_winner_count":{"filter":{}}}}}}`
 	aggs_buyerclass_amounttop3 = `"buyerclass_amount_top3":{"terms":{"field":"buyerclass","exclude":["其它",""],"order":[{"buyerclass_amount":"desc"}],"size":3},"aggs":{"buyerclass_amount":{"sum":{"field":"sortprice"}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"buyer_winner_amount":"desc"}],"size":3},"aggs":{"buyer_winner_amount":{"sum":{"field":"sortprice"}}}}}}`
 	sortprice_str              = `{"key":"<10万","from":0.0000000000001,"to":100000},{"key":"10万-50万","from":100000,"to":500000},{"key":"50万-100万","from":500000,"to":1000000},{"key":"100万-500万","from":1000000,"to":5000000},{"key":"500万-1000万","from":5000000,"to":10000000},{"key":"1000万-1亿","from":10000000,"to":100000000},{"key":"≥1亿","from":100000000}`
-	aggs_all_c_m               = `"project_count": {"filter": {}},"project_amount": {"sum": {"field": "sortprice"}}`
+	aggs_all_c_m               = `"project_count": {"filter": {}},"project_count_not0": {"filter": {"range": {"sortprice": {"gt": 0}}}},"project_amount": {"sum": {"field": "sortprice"}}`
 	query_id                   = `{"query": {"bool": {"must": [{"term": {"entidlist": "%s"}}]}},"size": 1}`
 	query_idto                 = `{"query": {"bool": {"must": [{"terms": {"qyxy.id": [%s]}}],"should": []}},"from": 0,"size": 36}`
 )
 
 type AreaCTop struct {
-	Total  int64 `json:"doc_count"`
+	Total     int64 `json:"doc_count"`
+	CountNot0 struct {
+		Count int64 `json:"doc_count"`
+	} `json:"project_count_not0"`
 	Amount struct {
 		Value float64 `json:"value"`
 	} `json:"project_amount"`
@@ -242,6 +245,10 @@ func (mae *MarketAnalysisEntity) AllData() (rMap map[string]interface{}, err err
 			if json.Unmarshal(bArr, &thisRow) != nil {
 				continue
 			}
+		} else if name == "project_count_not0" {
+			if json.Unmarshal(bArr, &thisRow.CountNot0) != nil {
+				continue
+			}
 		} else if name == "sortprice_ranges" {
 			if json.Unmarshal(bArr, &thisRow.SortpriceRanges) != nil {
 				continue
@@ -288,7 +295,7 @@ func (mae *MarketAnalysisEntity) AllData() (rMap map[string]interface{}, err err
 //项目规模分布
 func ProjectScale(thisRow AreaCTop) (data []interface{}) {
 	ammount := thisRow.Amount.Value
-	total := thisRow.Total
+	total := thisRow.CountNot0.Count
 	buckets := thisRow.SortpriceRanges.Buckets
 	type Scale struct {
 		Name      string