Browse Source

Merge branch 'zz-test' into master

LAPTOP-U5GOA5HA\zz 1 year ago
parent
commit
ab77328a19

+ 10 - 0
app/src/views/Detail/components/YhModalContent.vue

@@ -76,6 +76,7 @@ export default {
   props: {
     qy: String,
     default: Object,
+    yhles:Array
   },
   watch: {
     default: {
@@ -93,6 +94,15 @@ export default {
       immediate: true,
       deep: true,
     },
+    yhles: {
+      handler(val) {
+        this.params.zdqx = val;
+        this.funList();
+      },
+      immediate: true,
+      deep: true,
+    },
+
   },
   methods: {
     funList() {

+ 90 - 43
app/src/views/Home/components/BasicInfo.vue

@@ -4,54 +4,57 @@ import BasicTotal from "@/components/BasicTotal.vue";
 import { getInfo } from "@/api/index.js";
 export default {
   name: "BasicInfo",
-  props:{
-    qy:String
+  props: {
+    qy: String,
   },
   components: {
     FirstHight,
     BasicTotal,
   },
-  data(){
-    return{
-      list:[],
-      BasicLsit:[],
-          // 传参
-          params:{
-        pageSize:100,
-        pageNum:1,
+  data() {
+    return {
+      list: [],
+      BasicLsit: [],
+      // 传参
+      params: {
+        pageSize: 100,
+        pageNum: 1,
       },
-      unitcNum:'',
-      unitgNum:'',
-      unitjNum:'',
-      allNum:0
-    }
+      unitcNum: "",
+      unitgNum: "",
+      unitjNum: "",
+      allNum: 0,
+    };
   },
-  watch:{
-    qy(){
-      this.BasicInfo()
-    }
+  watch: {
+    qy() {
+      this.BasicInfo();
+    },
   },
-  methods:{
+  methods: {
     // 基础信息
-    BasicInfo(){
-      getInfo({...this.params,qy:this.qy==="重庆市"?"":this.qy}).then(res=>{
-      
-        if(res.data.code==200){
-        this.BasicLsit=res.data.rows
-        res.data.rows.map(item=>{
-          this.unitcNum=item.cggjz
-          this.unitgNum=item.ljzzgc
-          this.unitjNum=item.ljgcszhht
-          this.allNum=item.gyjz+item.zzjz+item.ggjz
-        })
-       }
-      })
-    }
+    BasicInfo() {
+      getInfo({ ...this.params, qy: this.qy === "重庆市" ? "" : this.qy }).then(
+        (res) => {
+          if (res.data.code == 200) {
+            this.BasicLsit = res.data.rows;
+            res.data.rows.map((item) => {
+              this.unitcNum = item.cggjz;
+              this.unitgNum = item.ljzzgc;
+              this.unitjNum = item.ljgcszhht;
+              this.allNum = item.gyjz + item.zzjz + item.ggjz;
+            });
+          }
+        }
+      );
+    },
+    showModlus(name) {
+      this.$emit("showTc", name);
+    },
+  },
+  created() {
+    this.BasicInfo();
   },
-  created(){
-    this.BasicInfo()
-  }
-  
 };
 </script>
 
@@ -59,7 +62,46 @@ export default {
   <div class="basic-info">
     <div class="__left">
       <FirstHight :BasicLsit="BasicLsit" :allNum="allNum" />
+      <ul style="display: flex">
+        <li @click="showModlus('居民建筑')">
+          <span
+            style="
+              display: inline-block;
+              width: 10px;
+              height: 10px;
+              background: #6dd400;
+              margin: 0 4px;
+            "
+          ></span>
+          <span>居民建筑</span>
+        </li>
+        <li @click="showModlus('公共建筑')">
+          <span
+            style="
+              display: inline-block;
+              width: 10px;
+              height: 10px;
+              background: #0060ff;
+              margin: 0 4px;
+            "
+          ></span>
+          <span>公共建筑</span>
+        </li>
+        <li @click="showModlus('工业建筑')">
+          <span
+            style="
+              display: inline-block;
+              width: 10px;
+              height: 10px;
+              background: #ffa600;
+              margin: 0 4px;
+            "
+          ></span>
+          <span>工业建筑</span>
+        </li>
+      </ul>
     </div>
+
     <div class="__right">
       <linear-text
         startColor="#00FFE0"
@@ -74,7 +116,12 @@ export default {
           label="超高层建筑"
           unit="栋"
         />
-        <BasicTotal style="width: 187px"  :number="Number(this.unitgNum)" label="" unit="栋">
+        <BasicTotal
+          style="width: 187px"
+          :number="Number(this.unitgNum)"
+          label=""
+          unit="栋"
+        >
           <template #label>
             <span class="label">
               <span class="sub-label">2000年底前</span>
@@ -104,10 +151,10 @@ export default {
 .basic-info {
   padding: 4px;
   display: flex;
-  .__left {
-    display: flex;
-    justify-content: space-around;
-  }
+  // .__left {
+  //   display: flex;
+  //   justify-content: space-around;
+  // }
   .__right {
     margin-top: 20px;
     margin-left: 5px;

+ 18 - 0
app/src/views/Home/components/BasicInfoModalContent.vue

@@ -29,6 +29,8 @@ export default {
   },
   props: {
     qy: String,
+    typeName:String,
+    fxdjs:String
   },
   watch: {
     qy: {
@@ -40,6 +42,22 @@ export default {
       immediate: true,
       deep: true,
     },
+    typeName: {
+      handler(val) {
+        this.params.dl = val;
+        this.funUnitList();
+      },
+      immediate: true,
+      deep: true,
+    },
+    fxdjs: {
+      handler(val) {
+        this.params.fxdj = val;
+        this.funUnitList();
+      },
+      immediate: true,
+      deep: true,
+    },
     value: {
       handler() {
         this.handUnitList();

+ 14 - 11
app/src/views/Home/components/FirstHight.vue

@@ -1,10 +1,13 @@
 <template>
+ <div>
   <div ref="chart" class="item" style="width: 220px; height: 200px" />
+ </div>
 </template>
 
 <script>
 import * as echarts from "echarts";
 import toolUtils from "@/utils/echartsTooltip";
+
 export default {
   props: {
     BasicLsit: Array,
@@ -61,17 +64,17 @@ export default {
             },
           },
         ],
-        legend: {
-          right: "0",
-          bottom: "-10px",
-          itemWidth: 10,
-          itemGap: 8,
-          textStyle: {
-            color: "#FFFFFF",
-            fontSize: 12,
-            lineHeight: 20,
-          },
-        },
+        // legend: {
+        //   right: "0",
+        //   bottom: "-10px",
+        //   itemWidth: 10,
+        //   itemGap: 8,
+        //   textStyle: {
+        //     color: "#FFFFFF",
+        //     fontSize: 12,
+        //     lineHeight: 20,
+        //   },
+        // },
         tooltip: {
           show: true,
           extraCssText: "z-index: 1000;"

+ 70 - 17
app/src/views/Home/components/HiddenDangerDetection/HiddenDangerType.vue

@@ -4,12 +4,62 @@
       <span>隐患类型</span>
       <span>单位:条</span>
     </div>
-    <div @click="showYh" style="cursor: pointer">
-      <div ref="chart" class="item" style="width: 230px; height: 251px" />
+    <div style="cursor: pointer">
+      <div ref="chart" class="item" style="width: 230px; height: 221px" />
+      <ul style="display: flex; flex-wrap: wrap; justify-content: space-between; width: 160px; margin: auto; margin-bottom: 30px; font-size: 14px;">
+        <li @click="showModlus('消防设施')" style="margin-bottom: 5px;">
+          <span
+            style="
+              display: inline-block;
+              width: 12px;
+              height: 12px;
+              background: #00a2ff;
+              margin: 0 4px;
+            "
+          ></span>
+          <span>消防设施</span>
+        </li>
+        <li @click="showModlus('生命通道')">
+          <span
+            style="
+              display: inline-block;
+              width: 12px;
+              height: 12px;
+              background: #00eaff;
+              margin: 0 4px;
+            "
+          ></span>
+          <span>生命通道</span>
+        </li>
+        <li @click="showModlus('用电用气')">
+          <span
+            style="
+              display: inline-block;
+              width: 12px;
+              height: 12px;
+              background: #16c843;
+              margin: 0 4px;
+            "
+          ></span>
+          <span>用电用气</span>
+        </li>
+        <li @click="showModlus('消防管理')">
+          <span
+            style="
+              display: inline-block;
+              width: 12px;
+              height: 12px;
+              background: #C3C71B;
+              margin: 0 4px;
+            "
+          ></span>
+          <span>消防管理</span>
+        </li>
+      </ul>
     </div>
     <!-- 隐患 -->
     <basic-modal top="120px" ref="yhModal" name="“一楼一策”隐患整治清单">
-      <YhModalContent :default="yhModal" />
+      <YhModalContent :default="yhModal" :yhles="yhles" />
     </basic-modal>
   </div>
 </template>
@@ -28,6 +78,7 @@ export default {
       chart: null,
       timer: "",
       yhModal: {},
+      yhles:[]
     };
   },
   watch: {
@@ -69,19 +120,19 @@ export default {
           formatter: "{c} <br/>{b}",
           extraCssText: "z-index: 1000;"
         },
-        legend: {
-          show: true,
-          right: 30,
-          bottom: 0,
-          itemWidth: 10,
-          itemHeight: 10,
-          itemGap: 8,
-          textStyle: {
-            color: "#fff",
-            fontSize: 14,
-          },
-          data: ["消防设施", "生命通道", "用电用气", "消防管理"],
-        },
+        // legend: {
+        //   show: true,
+        //   right: 30,
+        //   bottom: 0,
+        //   itemWidth: 10,
+        //   itemHeight: 10,
+        //   itemGap: 8,
+        //   textStyle: {
+        //     color: "#fff",
+        //     fontSize: 14,
+        //   },
+        //   data: ["消防设施", "生命通道", "用电用气", "消防管理"],
+        // },
         color: ["#00a2ff", "#00eaff", "#16c843", "#C3C71B"],
         series: [
           // 数据展示层
@@ -214,7 +265,9 @@ export default {
       }
       return dataArr;
     },
-    showYh() {
+    showModlus(val) {
+      this.yhles.push(val)
+      console.log('------=www',this.yhles);
       this.showModal("yhModal");
     },
   },

+ 75 - 22
app/src/views/Home/components/RiskWarning.vue

@@ -1,6 +1,56 @@
 <template>
-  <div>
-    <div ref="chart" class="item" style="width: 440px; height: 259px" />
+  <div style="display: flex;" >
+    <div ref="chart" class="item" style="width: 280px; height: 259px" />
+    <ul style="margin: auto; font-size: 16px;">
+      <li @click="showStice('重大风险')" style="margin-bottom: 12px;">
+        <span
+          style="
+            display: inline-block;
+            width: 12px;
+            height: 12px;
+            background: #FF0B0B;
+            margin: 0 4px;
+          "
+        ></span>
+        <span>重大风险</span>
+      </li>
+      <li @click="showStice('较大风险')" style="margin-bottom: 12px;">
+        <span
+          style="
+            display: inline-block;
+            width: 12px;
+            height: 12px;
+            background: #ff833d;
+            margin: 0 4px;
+          "
+        ></span>
+        <span>较大风险</span>
+      </li>
+      <li @click="showStice('一般风险')" style="margin-bottom: 12px;">
+        <span
+          style="
+            display: inline-block;
+            width: 12px;
+            height: 12px;
+            background: #fbff3d;
+            margin: 0 4px;
+          "
+        ></span>
+        <span>一般风险</span>
+      </li>
+      <li @click="showStice('低风险')">
+        <span
+          style="
+            display: inline-block;
+            width: 12px;
+            height: 12px;
+            background: #35c2ff;
+            margin: 0 4px;
+          "
+        ></span>
+        <span>低风险</span>
+      </li>
+    </ul>
   </div>
 </template>
 
@@ -150,34 +200,34 @@ export default {
 
       console.log(data);
       const option = {
-        backgroundColor: "#0d3059",
+        // backgroundColor: "#0d3059",
         color,
         series: [
           {
             type: "funnel",
             sort: "ascending",
             data: data,
-            maxSize: "30%",
-            left: -80,
+            maxSize: "120%",
+            left: 70,
           },
         ],
-        legend: {
-          show: true,
-          // right: 50,
-          // top: 70,
-          // x: 'right',
-          y: "center",
-          right: 30,
-          itemWidth: 10,
-          itemHeight: 10,
-          itemGap: 20,
-          orient: "vertical",
-          textStyle: {
-            color: "#fff",
-            fontSize: 18,
-          },
-          data: data.map((p) => p.name),
-        },
+        // legend: {
+        //   show: true,
+        //   // right: 50,
+        //   // top: 70,
+        //   // x: 'right',
+        //   y: "center",
+        //   right: 30,
+        //   itemWidth: 10,
+        //   itemHeight: 10,
+        //   itemGap: 20,
+        //   orient: "vertical",
+        //   textStyle: {
+        //     color: "#fff",
+        //     fontSize: 18,
+        //   },
+        //   data: data.map((p) => p.name),
+        // },
       };
       // console.log(option.legend);
       this.chart.setOption(option);
@@ -213,6 +263,9 @@ export default {
       }
       return dataArr;
     },
+    showStice(val){
+      this.$emit("showFxyj", val);
+    }
   },
 };
 </script>

+ 124 - 81
app/src/views/Home/index.vue

@@ -5,22 +5,32 @@
         height="302px"
         style="margin-bottom: 6px; cursor: pointer"
         title="基础信息"
-        @click="openBasicModal" 
+        @click="openBasicModal"
       >
-        <BasicInfo :qy="qy"  />
+        <BasicInfo :qy="qy" @showTc="showTc" />
       </border-panel>
       <border-panel height="346px" style="margin-bottom: 6px" title="隐患排查">
         <HiddenDangerDetection :qy="qy" />
       </border-panel>
-      <border-panel height="296px" header-cursor="pointer" title="自主管理" @click-header="openAutoManageModal">
+      <border-panel
+        height="296px"
+        header-cursor="pointer"
+        title="自主管理"
+        @click-header="openAutoManageModal"
+      >
         <AutonomousManagement :qy="qy" />
       </border-panel>
     </div>
     <div class="display: flex;">
-      <div class="map" style="position: relative;">
-        <MapCharts :mapHeatData="heatMap" :formatter="showLabel" :qx="qy" @selectArea="area => qy = area" />
-        <div style="position: absolute; top:10px; width: 500px;">
-          <SearchBox :area.sync="qy"/>
+      <div class="map" style="position: relative">
+        <MapCharts
+          :mapHeatData="heatMap"
+          :formatter="showLabel"
+          :qx="qy"
+          @selectArea="(area) => (qy = area)"
+        />
+        <div style="position: absolute; top: 10px; width: 500px">
+          <SearchBox :area.sync="qy" />
         </div>
       </div>
       <div>
@@ -35,24 +45,37 @@
       </div>
     </div>
     <div>
-      <border-panel height="311px" style="margin-bottom: 6px;  cursor: pointer; " header-cursor="pointer" title="风险预警" @click-header="openBasicModal">
-        <RiskWarning :riskList="riskList"  />
+      <border-panel
+        height="311px"
+        style="margin-bottom: 6px; cursor: pointer"
+        header-cursor="pointer"
+        title="风险预警"
+        @click-header="openBasicModal"
+      >
+        <RiskWarning :riskList="riskList" @showFxyj="showFxyj" />
       </border-panel>
-      <border-panel height="331px" style="margin-bottom: 6px; cursor: pointer;" title="智慧消防" >
+      <border-panel
+        height="331px"
+        style="margin-bottom: 6px; cursor: pointer"
+        title="智慧消防"
+      >
         <WisdomFire :frieList="frieList" :iotList="iotList" :qy="qy" />
       </border-panel>
       <border-panel height="298px" title="火灾指标">
         <FireIndex :type="fireIndexType" :qx="qy" />
         <template #ext-header>
-          <button-block :items="['月', '年']" @select-item="selectItemHandler" />
+          <button-block
+            :items="['月', '年']"
+            @select-item="selectItemHandler"
+          />
         </template>
       </border-panel>
     </div>
     <basic-modal top="120px" ref="basicInfoModal" name="基础信息">
-      <BasicInfoModalContent :qy="qy" />
+      <BasicInfoModalContent :qy="qy" :typeName="typeName" :fxdjs="fxdjs" />
     </basic-modal>
-  
-    <basic-modal top="120px" ref="autoManageModal"  name="自主管理">
+
+    <basic-modal top="120px" ref="autoManageModal" name="自主管理">
       <zzglModul :qy="qy" />
     </basic-modal>
   </div>
@@ -67,14 +90,11 @@ import RiskWarning from "./components/RiskWarning.vue";
 import WisdomFire from "./components/WisdomFire.vue";
 import FireIndex from "./components/FireIndex/index.vue";
 import BasicInfoModalContent from "./components/BasicInfoModalContent.vue";
-import SearchBox from '@/components/SearchBox.vue';
+import SearchBox from "@/components/SearchBox.vue";
 import zzglModul from "./components/zzglModul.vue";
-import { totaldata,getJqdt,getZxgjtj ,getJrjzsbs} from "@/api/index.js";
+import { totaldata, getJqdt, getZxgjtj, getJrjzsbs } from "@/api/index.js";
 import { fxfb } from "@/api/risk";
-import {
-		formatCityData,
-    createMapChartWindowInfo
-	} from '@/utils'
+import { formatCityData, createMapChartWindowInfo } from "@/utils";
 
 export default {
   name: "HomePage",
@@ -89,75 +109,98 @@ export default {
     FireIndex,
     BasicInfoModalContent,
     SearchBox,
-    zzglModul
+    zzglModul,
   },
-  data(){
-    return{
-      riskList:[],
+  data() {
+    return {
+      riskList: [],
       // 传参
-      qy:'重庆市',
-      params:{
-        pageSize:100,
-        pageNum:1,
+      qy: "重庆市",
+      params: {
+        pageSize: 100,
+        pageNum: 1,
       },
-      PoliceList:[],
-      frieList:{},
-      iotList:{},
+      PoliceList: [],
+      frieList: {},
+      iotList: {},
       fireIndexType: 0,
-      heatMap:[]
-    }
+      heatMap: [],
+      typeName: "",
+      fxdjs:''
+    };
   },
-  watch:{
-    qy(){
-      this.getList()
-      this.getFireList()
-      this.getIotList()
-    }
+  watch: {
+    qy() {
+      this.getList();
+      this.getFireList();
+      this.getIotList();
+    },
   },
   methods: {
     showLabel(params) {
-     return createMapChartWindowInfo({
-      title: params.name
-     }, () => {
-      let res = `风险栋数 <span style="font-size: 24px;color:red;font-weight:bold;">${params.value}</span>栋`;
-      return res;
-     });
+      return createMapChartWindowInfo(
+        {
+          title: params.name,
+        },
+        () => {
+          let res = `风险栋数 <span style="font-size: 24px;color:red;font-weight:bold;">${params.value}</span>栋`;
+          return res;
+        }
+      );
+    },
+    showTc(val) {
+      if (val) {
+        this.typeName = val;
+        this.showModal("basicInfoModal");
+      }
+    },
+    showFxyj(val){
+      this.fxdjs=val
+      this.showModal("basicInfoModal");
     },
     openBasicModal() {
       this.showModal("basicInfoModal");
     },
     // 风险预警
-    getList(){
-      totaldata({...this.params,qy:this.qy==="重庆市"?"":this.qy}).then(res=>{
-        if(res.data.code==200){
-        this.riskList=res.data.rows
-        }
-      }).catch(error=>{
-        this.$message({
+    getList() {
+      totaldata({ ...this.params, qy: this.qy === "重庆市" ? "" : this.qy })
+        .then((res) => {
+          if (res.data.code == 200) {
+            this.riskList = res.data.rows;
+          }
+        })
+        .catch((error) => {
+          this.$message({
             message: res.data.msg,
-            type: "error"
+            type: "error",
           });
-      })
+        });
     },
     selectItemHandler(idx) {
-      this.fireIndexType = idx
+      this.fireIndexType = idx;
     },
-    getStaic(){
-      getJqdt(this.params).then(res=>{
-        this.PoliceList=res.data.rows
-      })
+    getStaic() {
+      getJqdt(this.params).then((res) => {
+        this.PoliceList = res.data.rows;
+      });
     },
     //智慧消防
-    getFireList(){
-      getZxgjtj({...this.params,name:this.qy==="重庆市"?"":this.qy}).then(res=>{
-       this.frieList=res.data.rows[0]
-      })
+    getFireList() {
+      getZxgjtj({
+        ...this.params,
+        name: this.qy === "重庆市" ? "" : this.qy,
+      }).then((res) => {
+        this.frieList = res.data.rows[0];
+      });
     },
     // 物联网栋数
-    getIotList(){
-      getJrjzsbs({...this.params,name:this.qy==="重庆市"?"":this.qy}).then(res=>{
-        this.iotList=res.data.rows[0]
-      })
+    getIotList() {
+      getJrjzsbs({
+        ...this.params,
+        name: this.qy === "重庆市" ? "" : this.qy,
+      }).then((res) => {
+        this.iotList = res.data.rows[0];
+      });
     },
 
     openAutoManageModal() {
@@ -168,24 +211,24 @@ export default {
         pageNum: 1,
         pageSize: 100,
       }).then((res) => {
-        let tempData = res.data.rows.filter(
-          (item) => item.fxdj === '较大风险'
+        let tempData = res.data.rows.filter((item) => item.fxdj === "较大风险");
+        console.log(tempData);
+        this.heatMap = formatCityData(
+          tempData.map((item) => ({
+            name: item.qy,
+            value: item.sl,
+          }))
         );
-        console.log(tempData)
-        this.heatMap = formatCityData(tempData.map(item => ({
-          name: item.qy,
-          value: item.sl
-        })))
       });
-    }
+    },
   },
-  created(){
-    this.getList()
-    this.getStaic()
-    this.getFireList()
-    this.getIotList()
+  created() {
+    this.getList();
+    this.getStaic();
+    this.getFireList();
+    this.getIotList();
     this.loadMapData();
-  }
+  },
 };
 </script>
 <style scoped>