南昌市物联网技防平台-前端
liuyg
2021-04-26 3fbef64591ee92b966e9d958a86c4709c69cf35b
修改
5 files modified
395 ■■■■■ changed files
public/map/widgets/supervisoryMap/SupervisoryMap.js 31 ●●●● patch | view | raw | blame | history
src/api/client/client.js 12 ●●●●● patch | view | raw | blame | history
src/router/page/index.js 11 ●●●●● patch | view | raw | blame | history
src/views/clientManagement/clientManagement.vue 5 ●●●●● patch | view | raw | blame | history
src/views/system/cs.vue 336 ●●●●● patch | view | raw | blame | history
public/map/widgets/supervisoryMap/SupervisoryMap.js
@@ -205,6 +205,7 @@
        dataType: 'JSON',
        success: function (res) {
          var datas = res.data;
          console.log(datas)
          var heatmapRenderer = null;
          that.entityData = [];
          for (var i = 0; i < datas.length; i++) {
@@ -215,7 +216,8 @@
              lttd: Number(datas[i].wd)
            })
          }
          that.flareClusterLayer(datas);
          // that.flareClusterLayer(datas);
          console.log(datas)
          that.heatmapfeatureLayer = that.heatmFeaLayers();
          that._map.addLayer(that.heatmapfeatureLayer);
          // that.checkBoxSelect();//左侧控制热力图重复
@@ -256,7 +258,7 @@
          });
        });
        that.getArea($('#policeArea'));
        that.getPoliceTableAnalysis($('.analysis-container-police').find('.tbody tbody'), time.tomorrow, time.current, '', '');
        // that.getPoliceTableAnalysis($('.analysis-container-police').find('.tbody tbody'), time.tomorrow, time.current, '', '');
        that.clickHand();
      }
@@ -267,7 +269,7 @@
      objThis._map.addLayer(objThis._siteLayer);
      var that = this;
      // console.log(mySelf.clusterLayer)
      that.getEquipmentTable($('.analysis-container-equipment').find('.tbody tbody'), '');
      that.getEquipmentTable($('.analysis-container-equipment').find('.tbody tbody'), '','once');
      // 顶部tab得切换事件
      $('.analysis-and-judgment-tab li').click(function () {
        // if (that.tabIndex == $(this).index()) return;
@@ -850,6 +852,7 @@
          var oldData = data.data.records
          var result = oldData;
          that.Pdata = oldData;
          console.log(that.Pdata);//警情筛选
          var str = '';
          that.entitysData = [];
          that.analysisAddEntitys.clear();
@@ -949,7 +952,7 @@
        success: function (data) {
          // var result = data.data;
          var oldData = data.data;
          console.log(oldData)
          // console.log(oldData)
          var result = oldData;
          that.Ydata = oldData;
          var str = '';
@@ -986,11 +989,14 @@
            }
          }
          console.log(that.Ydata);//业主筛选
        }
      })
    },
    // 获取设备信息列表
    getEquipmentTable: function (dom, deviceType) {
    getEquipmentTable: function (dom, deviceType,once) {
      dom.empty();
      var that = this;
      // console.log(that.clusterLayer)
@@ -1014,7 +1020,7 @@
          var oldData = data.data;
          var result = [];
          that.Sdata = oldData;
          // console.log(result)
          var str = '';
          that.entitysData = [];
          that.analysisAddEntitys.clear();
@@ -1051,7 +1057,18 @@
              }
            }
          }
          if(once != 'once'){
            for (var i = 0; i < result.length; i++) {
              result[i].x = Number(result[i].jd);
              result[i].y = Number(result[i].wd);
              that.entityData.push({
                lgtd: Number(result[i].jd),
                lttd: Number(result[i].wd)
              })
            }
            console.log(result);//设备筛选
          that.flareClusterLayer(result);
          }
          for (var a, i = 0; i < result.length; i++) {
            that.createEntitysAnalysis(that.analysisAddEntitys, that.entitysData, '设备信息', {
src/api/client/client.js
@@ -13,6 +13,18 @@
  })
}
export const getListliu = (current, size, params,pid) => {
  return request({
    url: '/api/blade-jfpts/equipment/equipment/pageDept',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      pid,
    }
  })
}
export const getAll = () => {
  return request({
    url: '/api/blade-jfpts/equipment/equipment/listAll',
src/router/page/index.js
@@ -108,6 +108,17 @@
  },
  {
    path: '/datalOnce',
    name: '详情单页',
    component: () =>
      import( /* webpackChunkName: "page" */ '@/views/dataL/dataL'),
    meta: {
      keepAlive: true,
      isTab: false,
      isAuth: false
    }
  },
  {
    path: '*',
    redirect: '/404'
  }
src/views/clientManagement/clientManagement.vue
@@ -836,6 +836,7 @@
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        console.log(params,done)
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
@@ -919,6 +920,10 @@
        this.loading = true;
        getList(page.currentPage, page.pageSize, values, this.treeDeptId).then(res => {
          // debugger;
          console.log(page.currentPage)
          console.log(page.pageSize)
          console.log(values)
          console.log(this.treeDeptId)
          const data = res.data.data;
          this.page.total = data.total;
src/views/system/cs.vue
@@ -91,9 +91,9 @@
    </el-dialog>
    <!-- 右侧弹窗,业主的设备 -->
    <el-dialog
      :title="onceData.tenantName"
      :title="onceData.tenantName"
      :visible.sync="dialogVisible"
      width="620px"
      width="780px"
      :before-close="handleClose"
      modal-append-to-body="false"
      append-to-body="true"
@@ -101,47 +101,26 @@
    >
      <el-divider content-position="left">点击查看详情</el-divider>
      <div class="r-o-our">
        <!-- <avue-crud :data="datas" :option="options" @row-click="rowClicks">
          <template slot-scope="{ row }" slot="devicestate">
            <el-tag
              >{{
                row.devicestate == "0"
                  ? "撤防"
                  : row.devicestate == "1"
                  ? "布防"
                  : "无"
              }}
            </el-tag>
          </template>
          <template slot-scope="{ row }" slot="dxzt">
            <el-tag
              >{{ row.dxzt == "0" ? "掉线" : row.dxzt == "1" ? "在线" : "无" }}
            </el-tag>
          </template>
        </avue-crud> -->
        <el-table
        <avue-crud
          :option="options"
          :data="datas"
          style="width: 603px; height: auto"
          stripe="true"
          :table-loading="loadings"
          :page="pages"
          @on-load="onLoads"
          @search-change="searchChanges"
          @search-reset="searchResets"
          @row-click="rowClicks"
          class="r-o-o-table"
          border="true"
          @current-change="currentChanges"
          @size-change="sizeChanges"
        >
          <el-table-column prop="deviceName" label="设备名称" width="300">
          </el-table-column>
          <el-table-column prop="deviceNumber" label="设备编号" width="120">
          </el-table-column>
          <el-table-column prop="stateSevicestate" label="布撤防状态" width="100">
          </el-table-column>
          <el-table-column prop="stateOnline" ref="stateOnline" label="设备状态" width="80"> </el-table-column>
        </el-table>
        </avue-crud>
      </div>
    </el-dialog>
  </basic-container>
</template>
<script>
import { getAll } from "@/api/client/client";
import { getAll, getListliu } from "@/api/client/client";
import {
  getList,
  getDetail,
@@ -180,67 +159,108 @@
      datasourceBox: false,
      dialogVisible: false, //右侧弹窗
      onceData: {}, //数据
      win: {}, //样式
      datas: "", //cc
      // options: {
      //   addBtn: false,
      //   height: 'auto',
      //   menu: false,
      //   header: false,
      //   calcHeight: 80,
      //   stripe:true,
      //   title: "表格的标题",
      //   titleSize: "h3",
      //   titleStyle: {
      //     color: "red",
      //   },
      //   page: false,
      //   align: "center",
      //   menuAlign: "center",
      //   column: [
      //     {
      //       label: "设备名称",
      //       prop: "deviceName",
      //       width: 180,
      //     },
      //     {
      //       label: "设备编号",
      //       prop: "deviceNumber",
      //       width: 150,
      //     },
      //     {
      //       label: "布撤防状态",
      //       prop: "devicestate",
      //       type: "select",
      //       slot: true,
      //       width: 100,
      //       rules: [
      //         {
      //           required: true,
      //           message: "请选择布撤防状态",
      //           trigger: "blur",
      //         },
      //       ],
      //       dicData: [
      //         {
      //           label: "撤防",
      //           value: "0",
      //         },
      //         {
      //           label: "布防",
      //           value: "1",
      //         },
      //       ],
      //     },
      //     {
      //       label: "设备状态",
      //       prop: "dxzt",
      //       slot: true,
      //       addDisplay: false,
      //       editDisplay: false,
      //     },
      //   ],
      // },
      loadings: true, //等待
      querys: {}, //搜索
      pages: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      options: {
        //表格数据
        addBtn: false,
        height: "auto",
        indexLabel: "序号",
        index: true,
        menu: false,
        header: false,
        searchShow: true,
        searchMenuSpan: 8,
        searchSpan: 8,
        searchEnter: true,
        calcHeight: 80,
        stripe: true,
        title: "表格的标题",
        titleSize: "h3",
        titleStyle: {
          color: "red",
        },
        align: "center",
        menuAlign: "center",
        column: [
          {
            label: "设备名称",
            width: 200,
            prop: "deviceName",
            searchPlaceholder: "设备名称/编号",
            search: true,
            sortable: false,
            rules: [
              {
                required: true,
                message: "请输入设备名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "设备编号",
            prop: "deviceNumber",
            width: 110,
          },
          // {
          //   label: "使用方",
          //   search: true,
          //   // searchValue: this.getAnimalType(),
          //   prop: "deptId",
          //   width: 200,
          //   type: "select",
          //   dicUrl: "/api/blade-system/dept/trees",
          //   dicData: [], //getUser中直接赋值
          //   // [
          //   //   {
          //   //     label: "正常",
          //   //     value: 0
          //   //   },
          //   //   {
          //   //     label: "异常",
          //   //     value: 1
          //   //   }
          //   // ],
          // },
          {
              label: "使用方",
              prop: "deptId",
              width: 200,
              type: "tree",
              dicUrl: "/api/blade-system/dept/trees",
              multiple: true,
              dicData: [],
              checkStrictly:true,
              props: {
                label: "title"
              },
              rules: [
                {
                  required: true,
                  message: "请选择使用方",
                  trigger: "click"
                }
              ]
            },
          {
            label: "布撤防状态",
            prop: "stateSevicestate",
            width: 110,
          },
          {
            label: "设备状态",
            prop: "states",
            width: 90,
          },
        ],
      },
      page: {
        pageSize: 10,
        currentPage: 1,
@@ -1065,7 +1085,7 @@
        Object.assign(params, this.query)
      ).then((res) => {
        // console.log(res);
        this.onceData = res.data.data.records[0];
        // this.onceData = res.data.data.records[0];
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
@@ -1075,32 +1095,123 @@
    },
    rowClick(val) {
      //行点击事件 //右侧弹窗事件
      // console.log(val);
      this.onceData = val;
      this.dialogVisible = true;
    },
    rowClicks(val) {
      //弹窗行点击事件
      // console.log(val);
      this.$router.push({ path: "/dataL/dataL", query: val });
      // this.$router.push({ path: "/dataL/dataL", query: val });
      let routeData = this.$router.resolve({
        path: "/datalOnce",
        query: val,
      });
      window.open(routeData.href, "_blank");
    },
    changeDataOpen(det){
      if(det.length > 0){
        for(var key in det){
          det[key].stateOnline = det[key].onlineStatus == "0" ? "掉线" : det[key].onlineStatus == "1" ? "在线" : "无"
          det[key].stateSevicestate = det[key].devicestate == "0" ? "撤防" : det[key].devicestate == "1" ? "布防" : "无"
    changeDataOpen(dat) {
      //处理弹出框数据
      if (dat.length > 0) {
        for (var key in dat) {
          let states;
          if (dat[key].state != "") {
            states = "故障";
          } else {
            if (dat[key].jtype != 1) {
              if (dat[key].onlineStatus == 1) {
                states = "在线";
              } else {
                states = "掉线";
              }
            } else {
              states = "预警";
            }
          }
          // console.log(states);
          dat[key].states = states;
          dat[key].stateSevicestate =
            dat[key].devicestate == "0"
              ? "撤防"
              : dat[key].devicestate == "1"
              ? "布防"
              : "无";
        }
      }
    }
    },
    getUser(dat) {
      //建立使用方搜索关键词
      if (dat.length > 0) {
        this.users = [];
        var a = null;
        for (var key in dat) {
          if (a != dat[key].ownership) {
            this.users.push({
              label: dat[key].ownership,
              value: dat[key].ownership,
            });
          }
          a = dat[key].ownership;
        }
      }
      this.options.column[2].dicData = this.users;
    },
    searchResets() {
      //清空搜索框中的内容
      this.querys = {};
      //清空this.$route.query
      this.$router.push({ querys: {} });
      this.onLoads(this.pages);
    },
    searchChanges(params, done) {
      //搜索
      console.log(params, done, 222);
      this.querys = params;
      this.pages.currentPage = 1;
      this.onLoads(this.pages, params);
      done();
    },
    currentChanges(currentPage) {
      //分页改变时候触发
      this.pages.currentPage = currentPage;
    },
    sizeChanges(pageSize) {
      this.pages.pageSize = pageSize;
    },
    onLoads(pages, params = {}) {
      // this.$message.success("分页信息:" + JSON.stringify(pages));
      // this.pages.total = 40;
      this.loadings = true;
      let values = {
        ...params,
      };
      // getListliu(1, 10, {}, val.id).then((res) => {
      var useId = this.onceData.deptId;
      getListliu(pages.currentPage, pages.pageSize, values, useId).then(
        (res) => {
          // getListliu('1', '10', {}, '1353972967828533249').then((res) => {
          //拿到数据
          this.datas = res.data.data.records;
          console.log(res);
          console.log(pages.currentPage);
          console.log(pages.pageSize);
          console.log(values);
          console.log(this.onceData);
          const data = res.data.data;
          this.pages.total = data.total;
          this.changeDataOpen(this.datas);
          this.getUser(this.datas);
          this.loadings = false;
        }
      );
    },
  },
  mounted() {
    getAll().then((res) => {
      //测试数据
      this.datas = res.data.data;
      this.changeDataOpen(this.datas)
      console.log(this.datas);
    });
    // getAll().then((res) => {
    //   //测试数据
    //   this.datas = res.data.data;
    //   this.changeDataOpen(this.datas);
    //   this.getUser(this.datas)
    //   console.log(this.datas);
    // });
  },
};
</script>
@@ -1271,10 +1382,5 @@
    // border: hotpink 1px solid;
    overflow: auto;
  }
}
.r-o-o-table{
  // border: rgb(69, 36, 146) 1px solid;
  position: relative;
  left: 8px;
}
</style>