wang_xy 1 год назад
Родитель
Сommit
a4c7b2c991

+ 25 - 42
src/views/zdsz/enginee/material/material_statistics/index.vue

@@ -348,42 +348,39 @@ export default {
           this.currentEnginTypeChangeOptions = res.data
         })
       },
+      getLongestCollectionLength(jsonObj) {
+        let longestLength = 0;
+        for (let key in jsonObj) {
+          if (Array.isArray(jsonObj[key])) {
+            longestLength = Math.max(longestLength, jsonObj[key].length);
+          }
+        }
+        return longestLength;
+      },
       getList()
       {
 
         materialStatistics(this.queryParams).then(res=>{
           this.tableData=res.data;
-          let xData = [];
           let seriesData = [];
-          let seriesMarkPointData = [];
           for (let item in res.data) {
-            xData.push(res.data[item].realityQuality+'-'+res.data[item].realitySpecifications);
-            seriesData.push(res.data[item].realitySize);
-            seriesMarkPointData.push({ value: res.data[item].realitySize, xAxis: parseInt(item), yAxis: res.data[item].realitySize })
+            seriesData.push({
+              name: res.data[item].realityQuality+'-'+res.data[item].realitySpecifications,
+              type: 'bar',
+              stack: res.data[item].realityQuality,
+              label:{
+                show:true,
+                formatter:'{a} {c}米'
+              },
+              data: [res.data[item].realitySize]
+            },);
           }
-          console.log(xData);
-          console.log(seriesData);
-          console.log(seriesMarkPointData);
           let option = {
-            tooltip: {
-              trigger: 'axis',
-              axisPointer: {
-                type: 'shadow'
-              }
-            },
-            grid: {
-              left: '3%',
-              right: '4%',
-              bottom: '6%',
-              containLabel: true
-            },
             xAxis: [
               {
                 type: 'category',
-                data: xData,
-                axisLabel: {
-                  rotate: 45 // 文字倾斜 45 度
-                }
+                data: ['A'],
+                show:false,
               }
             ],
             yAxis: [
@@ -391,26 +388,12 @@ export default {
                 type: 'value'
               }
             ],
-            dataZoom: [
-              {
-                type: 'slider'
-              }
-            ],
-            series: [
-              {
-                type: 'bar',
-                markPoint:{
-                  data: seriesMarkPointData
-                },
-                data:seriesData
-              }
-            ]
-          };
+            series: seriesData
+        };
 
           var myChart = echarts.init(document.getElementById('zhuzhuangtu'));
-          if(option){
-            myChart.setOption(option);
-          }
+          myChart.clear()
+          myChart.setOption(option);
         })
       },
       getAreaCompletionInformationList()

+ 4 - 2
src/views/zdsz/enginee/material/progres_visual/index.vue

@@ -303,6 +303,7 @@ export default {
           color: '#fec880'
         },
       ],
+      areaName:'',
       currentType: null,
       currentCommunity: null,
       areaList: [],
@@ -375,9 +376,9 @@ export default {
             "value": res.data[i].dictValue,
           })
         }
-        console.log(dict)
+        let title = '施工记录  '+this.areaName + "-" + e.unitName + "-" +e.roomName;
         setTimeout(() => {
-          this.$refs.ConstructionDetails.open(dict,this.currentEnginType,null,'民用','施工记录',this.currentEnginClassification)
+          this.$refs.ConstructionDetails.open(dict,this.currentEnginType,null,'民用',title,this.currentEnginClassification)
         })
       })
       this.status = 'read-only'
@@ -437,6 +438,7 @@ export default {
       if (areaId === undefined || areaId == null || areaId === '')
         return
       getBuildingList({areaId: areaId}).then(res => this.buildingList = res.data)
+      this.areaName = this.areaList.find(item => item.id === areaId).name;
     },
     getUnitList1(buildingId) {
       if (buildingId === undefined || buildingId == null || buildingId === '')