USER-20230908AJ\Administrator 1 éve
szülő
commit
59eb0f88af

+ 49 - 3
common/chart/mixture_chart.vue

@@ -95,7 +95,7 @@
 							{
 								position: "right",
 								min: 0,
-								max: 200,
+								// max: 99999,
 								title: "柱状图",
 								textAlign: "left",
 								disabled: false,
@@ -104,7 +104,7 @@
 							{
 								position: "right",
 								min: 0,
-								max: 200,
+								// max: 99999,
 								title: "点",
 								textAlign: "left",
 								calibration: false,
@@ -173,7 +173,7 @@
 			};
 		},
 		onReady() {
-			this.getServerData();
+			// this.getServerData();
 		},
 		methods: {
 			getServerData() {
@@ -190,6 +190,14 @@
 									"value": 90,
 								}, 100, 150, 90]
 							},
+              {
+                name: "柱2",
+                index: 1,
+                type: "column",
+                data: [160, {
+                  "value": 90,
+                }, 100, 150, 90]
+              },
 							{
 								name: "曲线",
 								type: "line",
@@ -211,6 +219,44 @@
 					this.chartData = JSON.parse(JSON.stringify(res));
 				}, 500);
 			},
+      setServerData(data){
+        setTimeout(() => {
+          //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
+          let res = {
+            categories: data.titles,
+            series: [{
+              name: "金额(男)",
+              index: 1,
+              type: "column",
+              data: data.oneMoney
+            },
+              {
+                name: "金额(女)",
+                index: 2,
+                type: "column",
+                data: data.twoMoney
+              },
+              {
+                name:  "数量(男)",
+                type: "line",
+                style: "curve",
+                color: "#FFD023",
+                disableLegend: true,
+                data:  data.oneNum
+              },
+              {
+                name:  "数量(女)",
+                type: "line",
+                style: "curve",
+                color: "#0CAF60",
+                disableLegend: true,
+                data:  data.twoNum
+              }
+            ]
+          };
+          this.chartData = JSON.parse(JSON.stringify(res));
+        }, 50);
+      }
 		}
 	};
 </script>

+ 4 - 2
pages/statistics/components/general_stat.vue

@@ -2,7 +2,7 @@
 	<view class="">
 		<HeadData :money-data="moneyData"></HeadData>
 		<stat_finance_chart :money-data="moneyData"></stat_finance_chart>
-		<stat-finance :date-type-obj="dateTypeObj"></stat-finance>
+		<stat-finance ref="financeObj" :date-type-obj="dateTypeObj"></stat-finance>
 		<view class="sys-background-fff r-30">
 			<StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'" :tabulate-data="sysPassageData">
 			</StatCapital>
@@ -12,7 +12,7 @@
 			</StatCapital>
 		</view>
 		<stat-industry></stat-industry>
-		<stat-age-chart></stat-age-chart>
+		<stat-age-chart ref="ageRef"></stat-age-chart>
 	</view>
 </template>
 
@@ -134,6 +134,7 @@
 						this.getCapitalMoney()
 						this.getSysIndustry()
 						this.getSysAge()
+            this.$refs.financeObj.startList()
 					}
 				}
 			},
@@ -203,6 +204,7 @@
 				getSysAge(this.dateTypeObj).then((res) => {
 					if (res.code === 1) {
 						this.ageList = res.data
+            this.$refs.ageRef.setData( res.data)
 						// this.$refs.chartsAdminThree.show = true
 						// this.$refs.chartsAdminThree.chartData4 = JSON.parse(JSON.stringify(ret));
 					} else {

+ 9 - 4
pages/statistics/module/stat_age_chart.vue

@@ -1,11 +1,10 @@
 <template>
 	<view class="page-box-bg-fff m-t20 r-30 p-b30">
 		<view class="p-lr30 p-t30">
-			<StatisticsTitle :is_right="false" is_age :genre="0" :leftText="'年龄分部'" :rightText="'同比环比'"
-				@onHandle="onHandle">
+			<StatisticsTitle :is_right="false" is_age :genre="0" :leftText="'年龄分部'" :rightText="'同比环比'">
 			</StatisticsTitle>
 		</view>
-		<MixtureChart></MixtureChart>
+		<MixtureChart ref="mixtureChart"></MixtureChart>
 	</view>
 </template>
 
@@ -32,7 +31,13 @@
 					color: '#ED9A2C'
 				}, ]
 			};
-		}
+		},
+    methods: {
+      setData(data){
+        console.log(data)
+        this.$refs.mixtureChart.setServerData(data)
+      }
+    },
 	}
 </script>
 

+ 1 - 1
pages/statistics/module/stat_industry.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="page-box-bg-fff m-t20 r-30 p-30">
-		<StatisticsTitle :is_right="false" :genre="0" :leftText="'行业占比(金额排行)'" :rightText="'同比环比'" @onHandle="onHandle">
+		<StatisticsTitle :is_right="false" :genre="0" :leftText="'行业占比(金额排行)'" :rightText="'同比环比'" >
 		</StatisticsTitle>
 		<view class="page-box-bg-fff row-justify-sb center r-30 p-r60">
 			<view class="chart_item column-c m-lr20">

+ 3 - 1
pages/statistics/module/statistics_title.vue

@@ -52,10 +52,12 @@
 			return {
 				bgColor: ['#0FB160', '#FE7F37', '#10A2B0', '#DE2519'],
 				list: [{
+          color: '#2B7DFA'
+        },{
 					name: '数量',
 					color: '#2B7DFA'
 				}, {
-					name: '年龄',
+					name: '金额',
 					color: '#00BF8A'
 				}, {
 					name: '金额',