USER-20230908AJ\Administrator před 1 rokem
rodič
revize
948fe002a9

+ 3 - 2
common/chart/circle_chart.vue

@@ -33,6 +33,7 @@ export default {
   },
   data() {
     return {
+      bgColor:["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
       isCanvas2d:process.uniEnv.isCanvas2d,
       chartData: {},
       //这里的 opts 是图表类型 type="arcbar" 的全部配置参数,您可以将此配置复制到 config-ucharts.js 文件中下标为 ['arcbar'] 的节点中来覆盖全局默认参数。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
@@ -95,7 +96,7 @@ export default {
             series: [
               {
                 name:  "0%",
-                color: this.bgColor,
+                // color: this.bgColor,
                 data: 0
               }
             ]
@@ -110,7 +111,7 @@ export default {
         let res = {
           series: [
             {
-              color: this.bgColor,
+              // color: this.bgColor,
               data: data
             }
           ]

+ 3 - 41
common/chart/mixture_chart.vue

@@ -178,47 +178,7 @@
 		},
 		methods: {
 			getServerData() {
-				//模拟从服务器获取数据时的延时
-				setTimeout(() => {
-					//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
-					let res = {
-						categories: ["2018", "2019", "2020", "2021", "2022"],
-						series: [{
-								name: "柱1",
-								index: 1,
-								type: "column",
-								data: [160, {
-									"value": 90,
-								}, 100, 150, 90]
-							},
-							{
-								name: "柱2",
-								index: 1,
-								type: "column",
-								data: [160, {
-									"value": 90,
-								}, 100, 150, 90]
-							},
-							{
-								name: "曲线",
-								type: "line",
-								style: "curve",
-								color: "#FFD023",
-								disableLegend: true,
-								data: [70, 50, 85, 130, 64]
-							},
-							{
-								name: "曲线",
-								type: "line",
-								style: "curve",
-								color: "#0CAF60",
-								disableLegend: true,
-								data: [50, 20, 60, 100, 20]
-							}
-						]
-					};
-					this.chartData = JSON.parse(JSON.stringify(res));
-				}, 500);
+
 			},
 			setServerData(data) {
 				setTimeout(() => {
@@ -229,12 +189,14 @@
 								name: "金额(男)",
 								index: 1,
 								type: "column",
+                color: "#FFD023",
 								data: data.oneMoney
 							},
 							{
 								name: "金额(女)",
 								index: 2,
 								type: "column",
+                color: "#0CAF60",
 								data: data.twoMoney
 							},
 							{

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

@@ -11,7 +11,7 @@
 				:tabulate-data="sysCapitalMoney">
 			</StatCapital>
 		</view>
-		<stat-industry></stat-industry>
+		<stat-industry ref="industryRef" :industry-list="industryList"></stat-industry>
 		<stat-age-chart ref="ageRef"></stat-age-chart>
 	</view>
 </template>
@@ -188,6 +188,7 @@
 				getSysIndustry(this.dateTypeObj).then((res) => {
 					if (res.code === 1) {
 						this.industryList = res.data
+            this.$refs.industryRef.setData(res.data.roseData)
 						// let ret = {
 						//   series:[{data:res.data.roseData}]
 						// }

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

@@ -1,7 +1,7 @@
 <template>
 	<view class="page-box-bg-fff m-t20 r-30 p-30">
 		<!-- 模块title -->
-		<StatisticsTitle :genre="0" :leftText="'财务汇总占比'" :rightText="'同比环比'" @onHandle="onHandle"></StatisticsTitle>
+		<StatisticsTitle :genre="0" :leftText="'财务汇总占比'" :rightText="'同比环比'" ></StatisticsTitle>
 		<view class="content_chart row-justify-sb center">
 			<view class="chart_item column-c sys-from-background-color m-r30 r-20 p-tb20">
 				<CircleChart ref="outObj" :bgColor="'#2B7DFA'"></CircleChart>

+ 31 - 5
pages/statistics/module/stat_industry.vue

@@ -4,12 +4,12 @@
 		</StatisticsTitle>
 		<view class="page-box-bg-fff row-justify-sb center r-30">
 			<view class="chart_item column-c m-lr20">
-				<CircleChart :bgColor="'#2B7DFA'"></CircleChart>
+				<CircleChart ref="circleChart" :bgColor="'#2B7DFA'"></CircleChart>
 			</view>
 			<view class="row industry-box m-l30">
-				<view class="row-c p-tb10 industry-item" v-for="(item,index) in list" :key="index">
-					<view class="wh-14 m-r10" :style="{background:item.color}"></view>
-					<text class="size-24 text-color-576">{{item.name}}</text>
+				<view class="row-c p-tb10 industry-item" v-if="index<=5" v-for="(item,index) in industryList.titles" :key="index">
+					<view class="wh-14 m-r10" :class="'industry-icon+'+index"></view>
+					<text class="size-24 text-color-576">{{item}}</text>
 				</view>
 			</view>
 		</view>
@@ -64,7 +64,14 @@
 		methods: {
 			onChange(e) {
 				this.current = e
-			}
+			},
+      methods: {
+        setData(data){
+          console.log(data)
+
+          this.$refs.circleChart.setServerData(data)
+        }
+      },
 		}
 	}
 </script>
@@ -75,6 +82,25 @@
 
 		.industry-item {
 			width: 180rpx;
+      .industry-icon-0{
+        background-color: #2C7DF9;
+      }
+      .industry-icon-1{
+        background-color: #2C7DF9;
+      }
+      .industry-icon-2{
+        background-color: #00BF8A;
+      }
+      .industry-icon-3{
+        background-color: #00BF8A;
+      }
+      .industry-icon-4{
+        background-color: #ED9A2C;
+      }
+      .industry-icon-5{
+        background-color: #ED9A2C;
+      }
+
 		}
 	}
 </style>