Преглед изворни кода

添加获奖表单人数汇总与小区特色bug

11wqe1 пре 1 недеља
родитељ
комит
e898e4fb90

+ 1 - 2
src/components/schoolArea.vue

@@ -75,8 +75,7 @@ export default {
 	/* max-width: 192px;
     min-width: 192px; */
 	min-height: 600px;
-	width: 267px;
-	min-width: 100px;
+	width: 240px;
 	display: flex;
 	flex-direction: column;
 	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);

+ 18 - 16
src/views/kanBan/components/AschoolFeature.vue

@@ -388,22 +388,24 @@
 		</template>
 		
 		<template v-if="userinfo.role == 1 && userinfo.type == 1">
-			<div class="topTit">
-				<div>
-					<div>添加自定义模块</div>
-					<div
-						style="
-							height: 4px;
-							background-color: #0663fe;
-							width: 2rem;
-							margin-top: 6px;
-						"
-					></div>
+			<div class="feature">
+				<div class="topTit">
+					<div>
+						<div>添加自定义模块</div>
+						<div
+							style="
+								height: 4px;
+								background-color: #0663fe;
+								width: 2rem;
+								margin-top: 6px;
+							"
+						></div>
+					</div>
 				</div>
-			</div>
-			<div class="FedialogJIa" style="display: flex" @click="addTemVisible = true">
-				<div style="width: 100%; border: 1px #000 dashed; cursor: pointer">
-					<img src="../../../assets/kanban/jia.svg" alt="" />
+				<div class="FedialogJIa" style="display: flex" @click="addTemVisible = true">
+					<div style="width: 100%; border: 1px #000 dashed; cursor: pointer">
+						<img src="../../../assets/kanban/jia.svg" alt="" />
+					</div>
 				</div>
 			</div>
 		</template>
@@ -2057,7 +2059,7 @@ export default {
 
 .feature {
 	width: 100%;
-	padding: 36px 27px;
+	padding: 20px;
 	border-radius: 12px;
 	box-sizing: border-box;
 	background: #eeeeee;

+ 1 - 1
src/views/kanBan/components/dataBoardNew/AIApp/index.vue

@@ -154,7 +154,6 @@ export default {
   box-sizing: border-box;
   overflow: hidden;
   position: relative;
-  padding-bottom: 30px;
 }
 .AIAppOne{
   width: 100%;
@@ -216,6 +215,7 @@ export default {
   display: -webkit-box;
   -webkit-box-orient: vertical;
   overflow: hidden;
+  font-size: 14px;
   text-overflow: ellipsis; 
   width: 100%;
 }

+ 3 - 3
src/views/kanBan/components/dataBoardNew/baseData/chartList/teahoop.vue

@@ -79,8 +79,8 @@ export default {
       this.updateChart();
     },
     updateChart() {
-      const xData = this.chartData.map(item => item.lab).reverse();
-      const yData = this.chartData.map(item => item.num).reverse();
+      const xData = this.chartData.map(item => item.lab);
+      const yData = this.chartData.map(item => item.num);
 
       // 计算环比增长率
       const growthRates = this.calculateGrowthRates(yData);
@@ -139,7 +139,7 @@ export default {
     calculateGrowthRates(values) {
       return values.map((value, index) => {
         if (index === 0) return 0; // 第一个值没有增长率
-        return ((value - values[index - 1]) / values[index - 1]) * 100;
+        return ((value - values[index - 1]) / (values[index - 1] ? values[index - 1] : 1)) * 100;
       });
     },
     handleResize() {

+ 7 - 7
src/views/kanBan/components/dataBoardNew/baseData/chartList/tealiveness.vue

@@ -41,10 +41,10 @@ props:['alldata'],
             immediate: true  // 组件创建时立即执行
         }
     },
-  mounted() {
-    this.initChart()
-    window.addEventListener('resize', this.handleResize)
-  },
+  // mounted() {
+  //   this.initChart()
+  //   window.addEventListener('resize', this.handleResize)
+  // },
   beforeDestroy() {
     window.removeEventListener('resize', this.handleResize)
     this.chart && this.chart.dispose()
@@ -83,8 +83,8 @@ props:['alldata'],
       this.updateChart()
     },
     updateChart() {
-      const xData = this.chartData.map(item => item.lab).reverse();
-      const yData = this.chartData.map(item => item.num).reverse();
+      const xData = this.chartData.map(item => item.lab);
+      const yData = this.chartData.map(item => item.num);
 
       const option = {
         tooltip: {
@@ -141,7 +141,7 @@ props:['alldata'],
       this.chart && this.chart.resize()
     },
     completeMonthData(data) {
-        console.log('data',data);
+        // console.log('data',data);
         
         const currentDate = new Date();
         const year = currentDate.getFullYear();

+ 19 - 8
src/views/kanBan/components/dataBoardNew/baseData/index.vue

@@ -43,13 +43,13 @@ export default {
             dataExponentList:[],
         }
     },
-    watch:{
-        oid(newL){
-            console.log(newL);
+    // watch:{
+    //     oid(newL){
+    //         console.log(newL);
 
-            this.getTeaBaseData()
-        }
-    },
+    //         this.getTeaBaseData()
+    //     }
+    // },
     methods: {
         async getTeaBaseData() {
             this.loading = true;
@@ -73,7 +73,7 @@ export default {
                     top[0].value = res.data[0][0].num
                     top[1].value = res.data[1][0].num 
                     top[2].value = res.data[2][0].num
-
+      
                     if (res.data[2][0].num == 0 && res.data[3][0].num == 0) {
                         top[3].value = '0%';
                     }else{
@@ -83,6 +83,17 @@ export default {
 
 
                     this.dataExponentList = top
+                    // console.log('res.data[4][0].lab',res.data[4][0]);
+
+                    // console.log('res.data[4][0].lab',res.data[4][0].lab);
+                    
+                    res.data[4] = Array.from({ length: res.data[4][0].lab * 1}, (_, i) => {
+                        const lab = String(i + 1).padStart(2, '0'); // 生成lab为01到最新日期
+                        const existingEntry = res.data[4].find(entry => entry.lab === lab);
+                        return existingEntry ? existingEntry : { lab, num: 0 };
+                    });
+
+                    // console.log('res.data[4]',res.data[4]);
 
                     this.alldata = res.data.slice(4)
                     
@@ -96,7 +107,7 @@ export default {
         },
     },
     mounted() {
-        console.log('getTeaBaseData',this.oid);
+        // console.log('getTeaBaseData',this.oid);
         // if (!this.oid) {
             this.getTeaBaseData()
         // }

+ 74 - 0
src/views/kanBan/components/dataBoardNew/teaMange/chartList/barChart.vue

@@ -0,0 +1,74 @@
+
+<template>
+  <div ref="chart" style="width: 100%; height: 100%;"></div>
+</template>
+
+<script>
+import * as echarts from 'echarts';
+
+export default {
+  name: 'BarChart',
+  props:['alldata'],
+  data() {
+    return {
+      chart:null,
+      // xAxisData: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
+      // seriesData: [5, 20, 36, 10, 10, 20]
+    }
+  },
+  // mounted() {
+  //   this.initChart();
+  // },
+  watch: {
+    alldata: {
+      handler(val) {
+        console.log('val',val);
+        
+        if (val.length) {
+          let data = val.flat();
+          this.initChart(data);
+        }
+      },
+      deep: true,
+      immediate: true // 组件创建时立即执行
+    }
+  },
+  methods: {
+    initChart(val) {
+      
+      this.chart = echarts.init(this.$refs.chart);
+      const option = {
+        tooltip: {  // 新增tooltip配置
+          trigger: 'axis',  // 触发类型为坐标轴
+          axisPointer: {    // 坐标轴指示器配置
+            type: 'shadow'  // 阴影样式
+          },
+          formatter: function(params) {  // 自定义提示内容
+            return `${params[0].name}<br/>数值: ${params[0].value}人`;
+          }
+        },
+
+        xAxis: {
+          data: val.filter(e => e.title).map(e => e.title)
+        },
+        yAxis: {},
+        series: [{
+          type: 'bar',
+          data: val.filter(e => e.title).map(e => e.total)
+        }]
+      };
+      this.chart.setOption(option);
+      window.addEventListener("resize", this.chart.resize);
+      
+     
+    },
+    handleResize() {
+      this.chart && this.chart.resize();
+    }
+  },
+  beforeDestroy() {
+      window.removeEventListener("resize", this.handleResize);
+      this.chart && this.chart.dispose();
+  }
+}
+</script>

+ 22 - 11
src/views/kanBan/components/dataBoardNew/teaMange/index.vue

@@ -8,12 +8,20 @@
                 <pie2 :alldata="dataJ" :alltest="dataExponentList[0]"/>
             </div>
         </div>
+        <div class="DataDiv">
+            获奖表单人数汇总
+            <div class="imgArea" style="display: flex;height: 100%;">
+                <barChart :alldata="chartsData"/>
+            </div>
+        </div>
            
     </div>
 </template>
 <script>
 import solid from './chartList/solid.vue';
 import pie2 from './chartList/pie2.vue';
+import barChart from './chartList/barChart.vue';
+
 import barList from '../barList.vue';
 import { API_CONFIG } from "@/common/apiConfig";
 
@@ -30,22 +38,24 @@ export default {
     components: {
         solid,
         pie2,
-        barList
+        barList,
+        barChart
     },
     data() {
         return {
             dataExponentList:[],
             dataJ:{},
-            isLoadingData:false
+            isLoadingData:false,
+            chartsData:[]
         }
     },
-    watch:{
-        oid(newL){
-            console.log(newL);
+    // watch:{
+    //     oid(newL){
+    //         console.log(newL);
             
-            this.getData()
-        }
-    },
+    //         this.getData()
+    //     }
+    // },
     mounted() {
         this.getData()
     },
@@ -98,8 +108,6 @@ export default {
                         }
                     }
                     this.dataJ = dataJ
-                    console.log('dataj',dataJ);
-
                     let top = [
                         { label: '表单总量', value: 0 },
                         { label: '表单回收率', value: 0 },
@@ -112,7 +120,10 @@ export default {
 
                     this.dataExponentList = top
                     this.isLoadingData = false;
-
+                    
+                    this.chartsData=res.data.slice(3)
+                    console.log('this.chartsData',this.chartsData);
+                    
 
                 })
                 .catch((err) => {

+ 3 - 3
src/views/kanBan/components/dataBoardNew/teaing/chartList/appUseAss.vue

@@ -77,8 +77,8 @@ export default {
           .filter(num => num === 72).length;
       });
 
-      console.log("val", data);
-      console.log("subject", subject);
+      // console.log("val", data);
+      // console.log("subject", subject);
 
       subject.forEach(e => {
         let course = [];
@@ -100,7 +100,7 @@ export default {
         subject: e.name,
         value: [e.aitoolsum, e.worksum]
       }));
-      console.log("this.chartData", this.chartData);
+      // console.log("this.chartData", this.chartData);
 
       this.initChart();
     },

+ 2 - 2
src/views/kanBan/components/dataBoardNew/teaing/index.vue

@@ -146,7 +146,7 @@ export default {
             return e.tool[0]
           }
         }).filter(num => num === 72).length
-        console.log('alltool',alltool); 
+        // console.log('alltool',alltool); 
 
         return  alltool
     }
@@ -165,7 +165,6 @@ export default {
   box-sizing: border-box;
   overflow: hidden;
   position: relative;
-  padding-bottom: 30px;
 }
 .AIAppOne{
   width: 100%;
@@ -240,6 +239,7 @@ export default {
 .hotConAATxt{
   -webkit-line-clamp: 1;
   display: -webkit-box;
+  font-size: 14px;
   -webkit-box-orient: vertical;
   overflow: hidden;
   text-overflow: ellipsis; 

+ 3 - 1
src/views/kanBan/index.vue

@@ -167,11 +167,13 @@ export default {
         && this.fromL.admin.school.list[0]
         && this.fromL.admin.school.list[0].children
         && this.fromL.admin.school.list[0].children.length) {
+            console.log('111');
             this.schId = this.fromL.admin.school.list[0].children[0].schoolid
             this.schOrg = this.fromL.admin.school.list[0].children[0].orgid
         }else{
+            console.log('222');
             this.schId = this.userinfo.organizeid
-            this.schOrg = this.userinfo.orgid
+            this.schOrg = this.userinfo.org
         }