南昌市物联网技防平台-前端
shuishen
2021-04-23 8d837b97ffb27e4e26f067c1febde353bfdf91cf
src/views/clientManagement/clientManagement.vue
@@ -193,10 +193,11 @@
</template>
<script>
  import {getList, remove, update, add, getclient, getDeptLazyTree, getAll, updates} from "@/api/client/client";
  import {getList, remove, update, add, getclient, getDeptLazyTree, getAll, updates,getBaTree} from "@/api/client/client";
  import {mapGetters} from "vuex";
  import axios from "axios";
  import Legend from '../../components/liu-legend/Legend'
  import AvueMap from "avue-plugin-map";
  export default {
    components:{
@@ -210,11 +211,11 @@
        //legend-liu数据
        datalistLIU:[
                {
                    color: 'rgb(233, 39, 25)',
                    color: 'rgb(236, 83, 37)',
                    text: '掉线'
                },
                {
                    color: 'black',
                    color: 'rgb(49, 49, 49)',
                    text: '在线'
                }
            ],
@@ -315,7 +316,6 @@
              label: "设备编号",
              prop: "deviceNumber",
              width: 130,
              editDisabled: true,
              rules: [
                {
                  required: false,
@@ -336,7 +336,7 @@
              rules: [
                {
                  required: false,
                  message: "请选择上级菜单",
                  message: "请选择使用方",
                  trigger: "click"
                }
              ]
@@ -403,25 +403,7 @@
              addDisplay: false,
              editDisplay: false
            },
            {
              label: "设备类型",
              prop: "deviceType",
              width: 100,
              search: true,
              searchSpan: 3,
              searchLabelWidth: 80,
              searchPlaceholder: "请选择",
              type: "select",
              props: {
                label: "dictValue",
                value: "dictValue"
              },
              dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1357568691367661569",
              hide: true,
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
            },
            {
              label: "省份",
              prop: "province",
@@ -437,8 +419,9 @@
              cascaderItem: ["city", "district"],
              dicUrl: "/api/blade-system/region/select",
              span: 6,
              className: "cityClass1",
              className: "city1",
              hide: true,
              // width: 10,
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
@@ -459,7 +442,7 @@
              dicUrl: "/api/blade-system/region/select?code={{key}}",
              span: 3,
              labelWidth: "0",
              className: "cityClass2",
              className: "city2",
              hide: true,
              addDisplay: true,
              editDisplay: true,
@@ -481,7 +464,7 @@
              dicUrl: "/api/blade-system/region/select?code={{key}}",
              span: 3,
              labelWidth: "0",
              className: "cityClass3",
              className: "city3",
              hide: true,
              addDisplay: true,
              editDisplay: true,
@@ -496,8 +479,32 @@
              viewDisplay: true,
            },
            {
              label: "地址",
              prop: "map",
              hide: true,
              span: 24,
              component: "AvueMap",
            },
            {
              label: "经度",
              hide: true,
              addDisplay: false,
              prop: "jd",
            },
            {
              label: "纬度",
              hide: true,
              addDisplay: false,
              prop: "wd",
            },
            {
              label: "负责人",
              prop: "oneContacts",
              prop: "oneId",
              type: "tree",
              dicUrl: "/api/blade-system/dept/Batrees",
              props: {
                label: "title"
              },
              width: 72,
              hide: true,
              addDisplay: true,
@@ -558,6 +565,31 @@
        },
        data: []
      };
    },
    watch: {
      "form.map": {
        // form是表单或者表格绑定的数据集,v-model='form'
        handler(val) {
          debugger
          if (val) {
            this.form.wd = val.latitude;
            this.form.jd = val.longitude;
            this.form.street = val.formattedAddress;
          }
        },
        immediate: true,
      },
      "form.oneId":{
        handler(val) {
          var that = this;
          getBaTree(val).then(res => {
            if (res) {
              that.form.onePhone = res.data.data.records[0].phone;
              that.form.oneContacts = res.data.data.records[0].name;
            }
          });
        },
      }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -833,9 +865,9 @@
        //console.log(document.body.clientHeight,event.clientY,cha)
        // 防止菜单太靠底,根据可视高度调整菜单出现位置
        if (cha < 150) {
          menu.style.top = event.clientY -120 - (70) + 'px'
          menu.style.top = event.clientY -120 - (100) + 'px'
        } else {
          menu.style.top = event.clientY -10 - (70) + 'px'
          menu.style.top = event.clientY -10 - (100) + 'px'
        }
        menu.style.left = event.clientX + 10 - (60) + 'px'
        document.addEventListener('click', this.foo); // 给整个document新增监听鼠标事件,点击任何位置执行foo方法
@@ -844,7 +876,9 @@
  };
</script>
<style>
<style lang="scss" scoped>
$city-m-l: 10px;
  .payWin {
    overflow-y: auto;
    height: 350px;
@@ -855,49 +889,55 @@
  }
  /*页面样式*/
  .el-card__body .cityClass1 {
    width: 155px;
    padding-right: 0px !important;
  }
  // /*页面样式*/   //丢弃  因为不起作用,样式在cs.vue中  city1,2,3  liuyg改
  // .el-card__body .cityClass1 {
  //   width: 50px;
  //   padding-right: 0px !important;
  //   margin-left: $city-m-l;
  // }
  .el-card__body .cityClass2 {
    width: 100px;
    padding-left: 0px !important;
    padding-right: 0px !important;
  }
  // .el-card__body .cityClass2 {
  //   width: 50px;
  //   padding-left: 0px !important;
  //   padding-right: 0px !important;
  //   margin-left: $city-m-l;
  // }
  .el-card__body .cityClass3 {
    width: 100px;
    padding-left: 0px !important;
    padding-right: 0px !important;
  }
  // .el-card__body .cityClass3 {
  //   width: 50px;
  //   padding-left: 0px !important;
  //   padding-right: 0px !important;
  //   margin-left: $city-m-l;
  // }
  /*新增窗体样式*/
  .el-dialog .cityClass1 {
    width: 220px;
    padding-right: 0px !important;
  }
  // /*新增窗体样式*/
  // .el-dialog .city1 {
  //   width: 155px;
  //   padding-right: 0px !important;
  //   margin-left: $city-m-l;
  // }
  .el-dialog .cityClass2 {
    width: 110px;
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
  // .el-dialog .city2 {
  //   width: 100px;
  //   padding-left: 5px !important;
  //   padding-right: 5px !important;
  //   margin-left: $city-m-l;
  // }
  .el-dialog .cityClass3 {
    width: 110px;
    padding-left: 0px !important;
    padding-right: 0px !important;
  }
  // .el-dialog .city3 {
  //   width: 100px;
  //   padding-left: 0px !important;
  //   padding-right: 0px !important;
  //   margin-left: $city-m-l;
  // }
  .cityClass2 div label {
    display: none;
  }
  // .city2 div label {
  //   display: none;
  // }
  .cityClass3 div label {
    display: none;
  }
  // .city3 div label {
  //   display: none;
  // }
  .real-jf-dialog {
    position: absolute !important;