Răsfoiți Sursa

报告报表修改

Bella 2 ani în urmă
părinte
comite
0739b80cfd

BIN
src/assets/images/report/报告.png


+ 86 - 74
src/components/business/analysis/all/businessEnergyChart.vue

@@ -23,174 +23,186 @@ export default {
           }
         },
         grid: {
-          left: '1%', //默认10%
-          right: '1%', //默认10%
-          bottom: '20px', //默认60
-          top: '60px',
-          containLabel: true
+          left: "1%", //默认10%
+          right: "1%", //默认10%
+          bottom: "20px", //默认60
+          top: "60px",
+          containLabel: true,
           //grid区域是否包含坐标轴的刻度标签
         },
         xAxis: {
-          data: []
+          data: [],
         },
         yAxis: [
           {
-            type: 'value',
+            type: "value",
             nameTextStyle: {
-              padding: [10, 0, 10, -30]
+              padding: [10, 0, 10, -30],
             },
-          }
+          },
         ],
         dataZoom: this.$constant.ECHARTS_OPTION_DATAZOOM,
         tooltip: {
-          trigger: 'axis',
+          trigger: "axis",
           axisPointer: {
-            type: 'shadow'
+            type: "shadow",
           },
           textStyle: {
-            color: '#fff',
-            align: 'left',
-            fontSize: 14
+            color: "#fff",
+            align: "left",
+            fontSize: 14,
           },
-          axisLine: {//x坐标轴轴线
+          axisLine: {
+            //x坐标轴轴线
             show: true,
-            lineStyle: {//x坐标轴轴线样式
-              color: '#000',//'#ccc' | 'rgb(128, 128, 128)' | 'rgba(128, 128, 128, 0.5)',设置标签颜色
-            }
+            lineStyle: {
+              //x坐标轴轴线样式
+              color: "#000", //'#ccc' | 'rgb(128, 128, 128)' | 'rgba(128, 128, 128, 0.5)',设置标签颜色
+            },
           },
-          backgroundColor: 'rgba(0,0,0,0.8)',
+          backgroundColor: "rgba(0,0,0,0.8)",
         },
         series: [
           {
-            name: '用电(kWh)',
+            name: "用电(kWh)",
             data: [],
-            type: 'line',
-            stack: 'a',
-            yAxisIndex:0,
+            type: "line",
+            stack: "a",
+            yAxisIndex: 0,
             smooth: true,
-            showSymbol:false,
+            showSymbol: false,
             lineStyle: {
               color: "#62CC97",
               width: 1,
             },
             itemStyle: {
-              color: '#62CC97'
+              color: "#62CC97",
             },
             emphasis: {
-              scale:1.5
-            }
+              scale: 1.5,
+            },
           },
           {
-            name: '用水(m³)',
+            name: "用水(m³)",
             data: [],
-            type: 'line',
-            stack: 'a',
-            yAxisIndex:0,
+            type: "line",
+            stack: "a",
+            yAxisIndex: 0,
             smooth: true,
-            showSymbol:false,
+            showSymbol: false,
             itemStyle: {
-              color: '#3AA7E6'
+              color: "#3AA7E6",
             },
             lineStyle: {
               color: "#3AA7E6",
               width: 1,
             },
             emphasis: {
-              scale:1.5
+              scale: 1.5,
             },
           },
           {
-            name: '用热(kWh)',
+            name: "用热(kWh)",
             data: [],
-            type: 'line',
-            stack: 'a',
-            yAxisIndex:0,
+            type: "line",
+            stack: "a",
+            yAxisIndex: 0,
             smooth: true,
-            showSymbol:false,
+            showSymbol: false,
             itemStyle: {
-              color: '#4ACFB8'
+              color: "#4ACFB8",
             },
             lineStyle: {
               color: "#4ACFB8",
               width: 1,
             },
             emphasis: {
-              scale:1.5
+              scale: 1.5,
             },
           },
           {
-            name: '用冷(kWh)',
+            name: "用冷(kWh)",
             data: [],
-            type: 'line',
-            stack: 'a',
-            yAxisIndex:0,
+            type: "line",
+            stack: "a",
+            yAxisIndex: 0,
             smooth: true,
-            showSymbol:false,
+            showSymbol: false,
             itemStyle: {
-              color: '#F4955F'
+              color: "#F4955F",
             },
             lineStyle: {
               color: "#F4955F",
               width: 1,
             },
             emphasis: {
-              scale:1.5
+              scale: 1.5,
             },
           },
           {
-            name: '光伏(kWh)',
+            name: "光伏(kWh)",
             data: [],
-            type: 'line',
-            stack: 'a',
-            yAxisIndex:0,
+            type: "line",
+            stack: "a",
+            yAxisIndex: 0,
             smooth: true,
-            showSymbol:false,
+            showSymbol: false,
             itemStyle: {
-              color: '#F8797E'
+              color: "#F8797E",
             },
             lineStyle: {
               color: "#F8797E",
               width: 1,
             },
             emphasis: {
-              scale:1.5
+              scale: 1.5,
             },
           },
-        ]
+        ],
       },
-    }
+    };
   },
   props: {
     height: Number,
     queryData: Object,
   },
   mounted() {
-    this.$nextTick(()=>{
-      this.init()
-    })
+    this.$nextTick(() => {
+      this.init();
+    });
   },
   methods: {
     init() {
-      let chart = this.$echarts.init(this.$refs.myChart)
+      let chart = this.$echarts.init(this.$refs.myChart);
       this.chart = chart;
       this.$util.chartsResize(this.chart);
-      chart.setOption(this.option)
-      this.getData()
+      chart.setOption(this.option);
+      this.getData();
     },
     getData() {
-      return apiOperationAnalysis.getEnergyTrendsTotal(this.queryData).then(res=>{
-        let data = this.$util.dataUtil.covertDataToEcharts(res, ['power','water','hot','cold','cpv'])
-        this.$util.dataUtil.refreshEchartsData(this.chart, this.option, data)
-      })
-    }
-  }
-}
+      return apiOperationAnalysis
+        .getEnergyTrendsTotal(this.queryData)
+        .then((res) => {
+          let data = this.$util.dataUtil.covertDataToEcharts(res, [
+            "power",
+            "water",
+            "hot",
+            "cold",
+            "cpv",
+          ]);
+          this.$util.dataUtil.refreshEchartsData(this.chart, this.option, data);
+        });
+    },
+  },
+};
 </script>
 
 <template>
-  <div style="width: 100%" :style="{height: height+'px'}" ref="myChart"></div>
+  <div
+    style="width: 100%"
+    :style="{ height: height + 'px' }"
+    ref="myChart"
+  ></div>
 </template>
 
-<style lang="less" scoped>
-
-</style>
+<style lang="less" scoped></style>

+ 37 - 3
src/components/report/data/reportDataRestaurant.vue

@@ -17,7 +17,9 @@
             <a-button type="link" size="small">打印</a-button>
           </div>
         </template>
-        <reportDataTable />
+        <div class="report-box"><div id="myReport"></div></div>
+        <!-- <div id="myReport"></div> -->
+        <!-- <reportDataTable /> -->
       </Card>
     </div>
   </div>
@@ -27,7 +29,9 @@
 import ReportQuery from "@/components/report/common/reportQuery.vue";
 import Card from "@/components/common/card.vue";
 import reportDataTable from "@/components/report/data/tables/reportDataTable.vue";
-
+import * as XLSX from "xlsx";
+import html2canvas from "html2canvas";
+import jsPDF from "jspdf";
 export default {
   components: {
     Card,
@@ -40,7 +44,21 @@ export default {
   mounted() {},
   methods: {
     exportFunc() {
-      console.log("打印报告");
+      // 获取表格的 DOM 节点
+      const table = document.getElementById("myReport");
+      // 使用 html2canvas 将表格转换成图片
+      html2canvas(table, {
+        allowTaint: true,
+        useCORS: true,
+      }).then((canvas) => {
+        // 获取图片的 base64 编码
+        const base64URL = canvas.toDataURL("image/png");
+        // 将图片导出成 PDF 或者图片文件
+        const pdf = new jsPDF("landscape", "px", [canvas.width, canvas.height]);
+        pdf.addImage(base64URL, "PNG", 0, 0, canvas.width, canvas.height);
+        pdf.save("智慧楼宇运营管理中心-报告.pdf"); // 保存为 PDF 文件
+        // window.open(base64URL);  // 在新窗口中打开图片
+      });
     },
   },
 };
@@ -60,5 +78,21 @@ export default {
     height: 690px;
     background-color: #ffffff;
   }
+  .report-data-view {
+    width: 100%;
+    height: 690px;
+
+    .report-box {
+      width: 100%;
+      height: 630px;
+      margin: 0 auto;
+      overflow: auto;
+      #myReport {
+        width: 100%;
+        height: 2416px;
+        background: url("@/assets/images/report/报告.png") no-repeat center;
+      }
+    }
+  }
 }
 </style>

+ 19 - 3
src/components/report/table/reportTableCustom.vue

@@ -62,8 +62,8 @@ import Query from "@/components/common/query.vue";
 import Card from "@/components/common/card.vue";
 import reportDataTable from "@/components/report/data/tables/reportDataTable.vue";
 import * as XLSX from "xlsx";
-import html2canvas from 'html2canvas';
-import jsPDF from 'jspdf';
+import html2canvas from "html2canvas";
+import jsPDF from "jspdf";
 export default {
   components: {
     Card,
@@ -356,7 +356,23 @@ export default {
   },
   methods: {
     exportFunc() {
-      
+      // 获取表格的 DOM 节点
+      const table = document.querySelector(".ant-table-wrapper");
+      // 使用 html2canvas 将表格转换成图片
+      html2canvas(table, {
+        allowTaint: true,
+        useCORS: true,
+      }).then((canvas) => {
+        // 获取图片的 base64 编码
+        const base64URL = canvas.toDataURL("image/png");
+        // 将图片导出成 PDF 或者图片文件
+        const pdf = new jsPDF("landscape", "px", [canvas.width, canvas.height]);
+        pdf.addImage(base64URL, "PNG", 0, 0, canvas.width, canvas.height);
+        pdf.save("告警时段统计单表.pdf"); // 保存为 PDF 文件
+        // window.open(base64URL);  // 在新窗口中打开图片
+      });
+    },
+    exportFunc1() {
       // const data = [
       //   ["姓名", "年龄", "性别", "毕业院校"],
       //   ["张三", 18, "男", "清华大学"],

+ 50 - 4
src/components/report/table/reportTableSecurity.vue

@@ -7,7 +7,7 @@
         :search="search"
       >
         <template #extraItem>
-          <a-form-model-item label="人员姓名">
+          <a-form-model-item label="人员姓名: ">
             <a-input
               style="width: 200px"
               v-model="queryData.name"
@@ -69,6 +69,8 @@
 import ReportQuery from "@/components/report/common/reportQuery.vue";
 import Card from "@/components/common/card.vue";
 import * as XLSX from "xlsx";
+import html2canvas from "html2canvas";
+import jsPDF from "jspdf";
 export default {
   components: {
     Card,
@@ -139,6 +141,12 @@ export default {
           key: "name",
           align: "center",
         },
+        {
+          title: "身份证号",
+          dataIndex: "ID",
+          key: "ID",
+          align: "center",
+        },
         {
           title: "人员类型",
           dataIndex: "people_type",
@@ -146,7 +154,7 @@ export default {
           align: "center",
         },
         {
-          title: "部门",
+          title: "所属部门名称",
           dataIndex: "department",
           key: "department",
           align: "center",
@@ -157,7 +165,7 @@ export default {
           key: "time",
         },
         {
-          title: "通行设备",
+          title: "设备名称",
           dataIndex: "equipment",
           key: "equipment",
           align: "center",
@@ -169,7 +177,7 @@ export default {
           align: "center",
         },
         {
-          title: "行为感知",
+          title: "异常类型",
           key: "operation",
           fixed: "right",
           width: 100,
@@ -180,6 +188,7 @@ export default {
         {
           key: "1",
           name: "潘夏彤",
+          ID:"332987********8765",
           people_type: "自有员工",
           department: "业务一部",
           time: "2023-03-11 12:00:00",
@@ -191,6 +200,7 @@ export default {
         {
           key: "2",
           name: "庞慧",
+          ID:"332987********8765",
           people_type: "协作员工",
           department: "业务二部",
           time: "2023-03-15 12:00:00",
@@ -202,6 +212,7 @@ export default {
         {
           key: "3",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务二部",
           time: "2023-03-24 12:00:00",
@@ -213,6 +224,7 @@ export default {
         {
           key: "4",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务二部",
           time: "2022-09-11 12:00:00",
@@ -224,6 +236,7 @@ export default {
         {
           key: "5",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务二部",
           time: "2022-09-11 12:00:00",
@@ -235,6 +248,7 @@ export default {
         {
           key: "6",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务二部",
           time: "2022-09-11 12:00:00",
@@ -246,6 +260,7 @@ export default {
         {
           key: "7",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务三部",
           time: "2022-08-26 12:00:00",
@@ -257,6 +272,7 @@ export default {
         {
           key: "8",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务三部",
           time: "2022-08-26 12:00:00",
@@ -268,6 +284,7 @@ export default {
         {
           key: "9",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务三部",
           time: "2022-08-26 12:00:00",
@@ -279,6 +296,7 @@ export default {
         {
           key: "10",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务三部",
           time: "2022-08-26 12:00:00",
@@ -290,6 +308,7 @@ export default {
         {
           key: "11",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -301,6 +320,7 @@ export default {
         {
           key: "12",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -312,6 +332,7 @@ export default {
         {
           key: "13",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -323,6 +344,7 @@ export default {
         {
           key: "14",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -334,6 +356,7 @@ export default {
         {
           key: "15",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -345,6 +368,7 @@ export default {
         {
           key: "16",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -356,6 +380,7 @@ export default {
         {
           key: "17",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -367,6 +392,7 @@ export default {
         {
           key: "18",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务一部",
           time: "2022-08-26 12:00:00",
@@ -378,6 +404,7 @@ export default {
         {
           key: "19",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务三部",
           time: "2022-08-26 12:00:00",
@@ -389,6 +416,7 @@ export default {
         {
           key: "20",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务三部",
           time: "2022-08-26 12:00:00",
@@ -400,6 +428,7 @@ export default {
         {
           key: "21",
           name: "李天泽",
+          ID:"332987********8765",
           people_type: "访客",
           department: "业务三部",
           time: "2022-08-26 12:00:00",
@@ -420,6 +449,23 @@ export default {
       this.tableData = JSON.parse(JSON.stringify(this.originalData));
     },
     exportFunc() {
+      // 获取表格的 DOM 节点
+      const table = document.querySelector(".ant-table-wrapper");
+      // 使用 html2canvas 将表格转换成图片
+      html2canvas(table, {
+        allowTaint: true,
+        useCORS: true,
+      }).then((canvas) => {
+        // 获取图片的 base64 编码
+        const base64URL = canvas.toDataURL("image/png");
+        // 将图片导出成 PDF 或者图片文件
+        const pdf = new jsPDF("landscape", "px", [canvas.width, canvas.height]);
+        pdf.addImage(base64URL, "PNG", 0, 0, canvas.width, canvas.height);
+        pdf.save("智慧安防-安防人员.pdf"); // 保存为 PDF 文件
+        // window.open(base64URL);  // 在新窗口中打开图片
+      });
+    },
+    exportFunc1() {
       console.log("打印报表");
       const data = [
         ["姓名", "年龄", "性别", "毕业院校"],

+ 201 - 36
src/components/report/table/reportTableWork.vue

@@ -6,6 +6,33 @@
         :query-data.sync="queryData"
         :search="search"
       >
+        <template #extraItem>
+          <a-form-model-item label="会议名称: ">
+            <a-input
+              style="width: 200px"
+              v-model="queryData.conferenceName"
+              placeholder="请输入会议名称"
+            />
+          </a-form-model-item>
+          <a-form-model-item label="预定人: ">
+            <a-input
+              style="width: 200px"
+              v-model="queryData.booker"
+              placeholder="请输入预订人姓名"
+            />
+          </a-form-model-item>
+          <a-form-model-item label="所属部门名称: ">
+            <a-select v-model="queryData.dept" style="width: 200px">
+              <a-select-option
+                v-for="(item, index) in deptData"
+                :key="index"
+                :value="item.value"
+              >
+                {{ item.label }}
+              </a-select-option>
+            </a-select>
+          </a-form-model-item>
+        </template>
       </ReportQuery>
     </div>
 
@@ -38,6 +65,8 @@
 import ReportQuery from "@/components/report/common/reportQuery.vue";
 import Card from "@/components/common/card.vue";
 import * as XLSX from "xlsx";
+import html2canvas from "html2canvas";
+import jsPDF from "jspdf";
 export default {
   components: {
     Card,
@@ -49,60 +78,179 @@ export default {
       timeRange: "",
       queryData: {
         timeRange: timeRange,
+        conferenceName: "",
+        dept: "0",
+        booker: "",
       },
       oriTableData: [],
-      tableContainerHeight: 500,
-      tableColumns: [
+      deptData: [
+        {
+          label: "全部",
+          value: "0",
+        },
         {
-          title: "序号",
-          dataIndex: "index",
-          key: "index",
-          align: "center",
-          width: 80,
-          customRender: (text, record, index) => `${index + 1}`,
+          label: "业务一部",
+          value: "1",
         },
         {
-          title: "姓名",
-          dataIndex: "name",
-          key: "name",
-          align: "center",
+          label: "业务二部",
+          value: "2",
         },
         {
-          title: "人员类型",
-          dataIndex: "people_type",
-          key: "people_type",
-          align: "center",
+          label: "业务三部",
+          value: "3",
         },
+      ],
+      bookerOptions: [
         {
-          title: "部门",
-          dataIndex: "department",
-          key: "department",
-          align: "center",
+          label: "全部",
+          value: "0",
         },
         {
-          title: "通行时间",
-          dataIndex: "time",
-          key: "time",
+          label: "自有员工",
+          value: "1",
         },
         {
-          title: "通行设备",
-          dataIndex: "equipment",
-          key: "equipment",
-          align: "center",
+          label: "协作员工",
+          value: "2",
         },
         {
-          title: "通行方向",
-          dataIndex: "direction",
-          key: "direction",
-          align: "center",
+          label: "访客",
+          value: "3",
         },
+      ],
+      tableContainerHeight: 500,
+      tableColumns: [
         {
-          title: "行为感知",
-          key: "operation",
-          fixed: "right",
-          width: 100,
-          scopedSlots: { customRender: "action" },
+          title: "会议预约总体分析",
+          dataIndex: "totalAnalysis",
+          key: "totalAnalysis",
+          children: [
+            {
+              title: "会议室: 全部",
+              dataIndex: "meeting",
+              key: "meeting",
+              children: [
+                {
+                  title: "开始时间: 2023-02-01",
+                  dataIndex: "startDateTitle",
+                  key: "startDateTitle",
+                  align: "center",
+                  children: [
+                    {
+                      title: "会议名称",
+                      dataIndex: "conferenceName",
+                      key: "conferenceName",
+                    },
+                    {
+                      title: "会议室名称",
+                      dataIndex: "roomName",
+                      key: "roomName",
+                    },
+                    {
+                      title: "会议日期",
+                      dataIndex: "conferenceDate",
+                      key: "conferenceDate",
+                    },
+                    {
+                      title: "开始时间",
+                      dataIndex: "startDate",
+                      key: "startDate",
+                    },
+                    {
+                      title: "结束时间",
+                      dataIndex: "endDate",
+                      key: "endDate",
+                    },
+                  ],
+                },
+                {
+                  title: "结束时间: 2023-04-30",
+                  dataIndex: "endDateTitle",
+                  key: "endDateTitle",
+                  align: "center",
+                  children: [
+                    {
+                      title: "预订人",
+                      dataIndex: "booker",
+                      key: "booker",
+                    },
+                    {
+                      title: "部门",
+                      dataIndex: "department",
+                      key: "department",
+                    },
+                    {
+                      title: "会议时数",
+                      dataIndex: "totalTime",
+                      key: "totalTime",
+                    },
+                    {
+                      title: "实际会议时数",
+                      dataIndex: "realTime",
+                      key: "realTime",
+                    },
+                    {
+                      title: "释放会议时数",
+                      dataIndex: "releasingTime",
+                      key: "releasingTime",
+                    },
+                  ],
+                },
+              ],
+            },
+          ],
         },
+        // {
+        //   title: "序号",
+        //   dataIndex: "index",
+        //   key: "index",
+        //   align: "center",
+        //   width: 80,
+        //   customRender: (text, record, index) => `${index + 1}`,
+        // },
+        // {
+        //   title: "姓名",
+        //   dataIndex: "name",
+        //   key: "name",
+        //   align: "center",
+        // },
+        // {
+        //   title: "人员类型",
+        //   dataIndex: "people_type",
+        //   key: "people_type",
+        //   align: "center",
+        // },
+        // {
+        //   title: "部门",
+        //   dataIndex: "department",
+        //   key: "department",
+        //   align: "center",
+        // },
+        // {
+        //   title: "通行时间",
+        //   dataIndex: "time",
+        //   key: "time",
+        // },
+        // {
+        //   title: "通行设备",
+        //   dataIndex: "equipment",
+        //   key: "equipment",
+        //   align: "center",
+        // },
+        // {
+        //   title: "通行方向",
+        //   dataIndex: "direction",
+        //   key: "direction",
+        //   align: "center",
+        // },
+        // {
+        //   title: "行为感知",
+        //   key: "operation",
+        //   fixed: "right",
+        //   width: 100,
+        //   scopedSlots: { customRender: "action" },
+        // },
       ],
       originalData: [
         {
@@ -343,6 +491,23 @@ export default {
   mounted() {},
   methods: {
     exportFunc() {
+      // 获取表格的 DOM 节点
+      const table = document.querySelector(".ant-table-wrapper");
+      // 使用 html2canvas 将表格转换成图片
+      html2canvas(table, {
+        allowTaint: true,
+        useCORS: true,
+      }).then((canvas) => {
+        // 获取图片的 base64 编码
+        const base64URL = canvas.toDataURL("image/png");
+        // 将图片导出成 PDF 或者图片文件
+        const pdf = new jsPDF("landscape", "px", [canvas.width, canvas.height]);
+        pdf.addImage(base64URL, "PNG", 0, 0, canvas.width, canvas.height);
+        pdf.save("智慧办公-会议管理.pdf"); // 保存为 PDF 文件
+        // window.open(base64URL);  // 在新窗口中打开图片
+      });
+    },
+    exportFunc1() {
       console.log("打印报表");
       const data = [
         ["姓名", "年龄", "性别", "毕业院校"],

+ 67 - 47
src/components/scene/meeting/chart/meetingTimeCharts.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="myChart" ref="myChart" :style="{height: height+'px'}"></div>
+  <div class="myChart" ref="myChart" :style="{ height: height + 'px' }"></div>
 </template>
 
 <script>
@@ -9,88 +9,108 @@ export default {
   data() {
     return {
       option: {
-        color: ['#80B2FF','#FFDF80'],
+        color: ["#80B2FF", "#FFDF80"],
         grid: {
-          left: '2%', //默认10%
-          right: '2%', //默认10%
-          bottom: '0%', //默认60
-          top: '15%',
-          containLabel: true
+          left: "2%", //默认10%
+          right: "2%", //默认10%
+          bottom: "0%", //默认60
+          top: "15%",
+          containLabel: true,
           //grid区域是否包含坐标轴的刻度标签
+        },
+        legend:{
+          
         },
         xAxis: {
-          type: 'category',
-          data: ['4月1日', '4月2日', '4月3日', '4月4日', '4月5日', '4月6日', '4月7日', '4月8日', '4月9日', '4月10日', '4月11日', '4月12日']
+          type: "category",
+          data: [
+            "4月1日",
+            "4月2日",
+            "4月3日",
+            "4月4日",
+            "4月5日",
+            "4月6日",
+            "4月7日",
+            "4月8日",
+            "4月9日",
+            "4月10日",
+            "4月11日",
+            "4月12日",
+          ],
         },
         yAxis: [
           {
-            name: '分钟',
-            type: 'value',
+            name: "使用时长(分钟)",
+            type: "value",
             nameTextStyle: {
-              padding: [0, 20, 0, 0]
+              padding: [0, 20, 0, 0],
             },
           },
         ],
         tooltip: {
-          trigger: 'axis',
+          trigger: "axis",
           axisPointer: {
-            type: 'shadow'
+            type: "shadow",
           },
           textStyle: {
-            color: '#fff',
-            align: 'left',
-            fontSize: 14
+            color: "#fff",
+            align: "left",
+            fontSize: 14,
           },
-          axisLine: {//x坐标轴轴线
+          axisLine: {
+            //x坐标轴轴线
             show: true,
-            lineStyle: {//x坐标轴轴线样式
-              color: '#000',//'#ccc' | 'rgb(128, 128, 128)' | 'rgba(128, 128, 128, 0.5)',设置标签颜色
-            }
+            lineStyle: {
+              //x坐标轴轴线样式
+              color: "#000", //'#ccc' | 'rgb(128, 128, 128)' | 'rgba(128, 128, 128, 0.5)',设置标签颜色
+            },
           },
-          backgroundColor: 'rgba(0,0,0,0.8)',
+          backgroundColor: "rgba(0,0,0,0.8)",
         },
         series: [
           {
             data: [32, 39, 54, 55, 101, 76, 60, 42, 36, 57, 40, 85],
-            type: 'bar',
-            stack: 'A',
-            barWidth: '30px',
+            type: "bar",
+            stack: "A",
+            barWidth: "30px",
             backgroundStyle: {
-              color: 'rgba(180, 180, 180, 0.2)'
-            }
-          }
-        ]
+              color: "rgba(180, 180, 180, 0.2)",
+            },
+          },
+        ],
       },
-    }
+    };
   },
   props: {
     height: Number,
-    queryData: Object
+    queryData: Object,
   },
   mounted() {
-    this.init()
+    this.init();
   },
   methods: {
     init() {
-      let chart = this.$echarts.init(this.$refs.myChart)
+      let chart = this.$echarts.init(this.$refs.myChart);
       this.chart = chart;
       this.$util.chartsResize(this.chart);
-      chart.setOption(this.option)
-      this.$store.loadingStore().loadingWithApi(this.getData())
+      chart.setOption(this.option);
+      this.$store.loadingStore().loadingWithApi(this.getData());
     },
     getData() {
       this.loading = true;
-      return apiSceneMeeting.getMeetingMinutes(this.queryData.timeRange).then(res=>{
-        let data = this.$util.dataUtil.covertDataToEcharts(res, ['times'])
-        this.$util.dataUtil.refreshEchartsData(this.chart, this.option, data)
-        this.loading = false;
-      }).catch(err=>{
-        this.loading = false;
-      })
-    }
-  }
-}
+      return apiSceneMeeting
+        .getMeetingMinutes(this.queryData.timeRange)
+        .then((res) => {
+          let data = this.$util.dataUtil.covertDataToEcharts(res, ["times"]);
+          this.$util.dataUtil.refreshEchartsData(this.chart, this.option, data);
+          this.loading = false;
+        })
+        .catch((err) => {
+          this.loading = false;
+        });
+    },
+  },
+};
 </script>
 
-<style lang="less" scoped>
-</style>
+<style lang="less" scoped></style>

+ 2 - 2
src/components/work/meeting/workMeeting.vue

@@ -230,8 +230,8 @@
             class="workMeeting-left ioc-card-content"
             style="margin-bottom: 15px"
           >
-            <card title="会议室时长">
-              <MeetingTimeCharts :height="300"></MeetingTimeCharts>
+            <card>
+              <MeetingTimeCharts v-if="queryData.floorId==='0'" :height="300"></MeetingTimeCharts>
             </card>
           </div>
         </a-col>