Bladeren bron

修改批量关联资产弹窗

zhangyu 5 jaren geleden
bovenliggende
commit
af1b222688

+ 0 - 153
src/components/ledger/lib/buildFloor.vue

@@ -1,153 +0,0 @@
-<template>
-  <div id="buildFloor">
-    <span class="buildFloor" style="margin-right: 12px;">建筑楼层:</span>
-    <el-cascader placeholder="请选择建筑楼层" :options="options" v-model="value" filterable size="small" :style="isWidth ? '' : 'width:160px;'" @change="changeCascader"></el-cascader>
-  </div>
-</template>
-<script>
-import tools from "@/utils/scan/tools"
-import { floorQuery, buildingQuery } from '@/api/scan/request'
-import { mapGetters, mapActions } from "vuex"
-
-export default {
-  props: {
-    isWidth: {
-      type: Boolean,
-      default: true
-    },
-    type: {
-      type: String,
-      default: "yes"
-    }
-  },
-  computed: {
-    ...mapGetters("layout", [ "projectId", "secret", "userId" ])
-  },
-  data() {
-    return {
-      options: [],
-      param: {
-        ProjId: '',
-        secret: ''
-      },
-      value: ['all']
-    };
-  },
-  created() {
-    this.param.ProjId = this.projectId
-    this.param.secret = this.secret
-    this.getData()
-  },
-  watch: {
-    projectId() {
-      this.value = ['all'];
-      this.options = [];
-      this.param.ProjId = this.projectId
-      this.param.secret = this.secret
-      this.getData()
-      this.changeCascader(['all'])
-    }
-  },
-  methods: {
-    //设置默认选项
-    setValue(val) {
-      if (val && val.length) {
-        this.value = val
-      }
-    },
-    //获取数据
-    getData() {
-      let data, buildParams = {
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-          "BuildID",
-          "BuildLocalName"
-        ]
-      }, floorParams = {
-        Orders: "FloorSequenceID desc",
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-          "BuildID",
-          "FloorID",
-          "FloorLocalName",
-          "FloorSequenceID"
-        ]
-      }
-      let promise1 = new Promise((resolve, reject) => {
-        buildingQuery(buildParams, res => {
-          resolve(res)
-        })
-      })
-      let promise2 = new Promise((resolve, reject) => {
-        floorQuery(floorParams, res => {
-          resolve(res)
-        })
-      })
-      Promise.all([promise1, promise2]).then(values => {
-        let builData = values[0].Content, floorData = values[1].Content
-        data = builData.map(build => {
-          return {
-            value: build.BuildID,
-            label: build.BuildLocalName
-          }
-        })
-        data.unshift({
-          value: "all",
-          label: "全部"
-        }, {
-            value: "noKnow",
-            label: "不在建筑内"
-          })
-        data.forEach(build => {
-          floorData.forEach(floor => {
-            if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName && this.type == "yes") {
-              if (build.children) {
-                build.children.push({
-                  value: floor.FloorID,
-                  label: floor.FloorLocalName,
-                  FloorSequenceID: floor.FloorSequenceID
-                })
-              } else {
-                build.children = []
-                build.children.push({
-                  value: "all",
-                  label: "全部"
-                }, {
-                    value: 'noKnow',
-                    label: "不在楼层内"
-                  }, {
-                    value: floor.FloorID,
-                    label: floor.FloorLocalName,
-                    FloorSequenceID: floor.FloorSequenceID
-                  })
-              }
-            }
-          })
-        })
-        this.options = data
-      })
-    },
-    //改变item
-    changeCascader(value) {
-      this.$emit("change", value)
-    }
-  }
-};
-</script>
-<style lang="less">
-.el-cascader .el-input .el-input__inner {
-  vertical-align: bottom;
-}
-</style>
-<style lang="less" scoped>
-#buildFloor {
-  margin-left: 10px;
-  float: left;
-  .buildFloor {
-    color: #999999;
-    font-size: 14px;
-  }
-}
-</style>

+ 0 - 142
src/components/ledger/lib/deviceParts.vue

@@ -1,142 +0,0 @@
-<template>
-  <div id="cascaderMap">
-    <span class="buildFloor" style="margin-right: 12px;">设备类型:</span>
-    <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
-      <el-option  v-for="item in options" :key="item.code" :label="item.facility" :value="item.code"></el-option>
-    </el-select>
-  </div>
-</template>
-<script>
-import { mapGetters } from 'vuex';
-import { getEquipBelongs, queryEquip } from "@/api/scan/request";
-export default {
-  name: "getCode",
-  props: {
-    isWidth: {
-      type: Boolean,
-      default: true
-    },
-    all: {
-      type: Boolean,
-      default: false,
-    }
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId"])
-  },
-  data() {
-    return {
-      value: "",
-      options: [],
-      props: {
-        value: "code",
-        label: "facility"
-      },
-      falg: true,
-      content: []
-    };
-  },
-  created() {
-    this.getData();
-  },
-  watch: {
-    projectId() {
-      this.value = '';
-      this.getData();
-    }
-  },
-  methods: {
-    setValue(val) {
-      this.value = val
-    },
-    //修改val
-    changeVal(val) {
-      let value = {}
-      this.options.map(item => {
-        if (item.code == val) {
-          value = item
-        }
-      })
-      this.value = val
-      this.$emit("change", value)
-    },
-    //获取当前项目下的设备类型(只拿到编码-需要过滤)
-    getData() {
-      let param2 = {
-        Distinct: true,
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-          "Category"
-        ]
-      }
-      let param1 = {
-        data: {
-          Distinct: true,
-          Orders: "EquipName asc",
-          PageNumber: 1,
-          PageSize: 500,
-          Projection: [
-            "EquipCode", "EquipName"
-          ]
-        }
-      }
-      let promise2 = new Promise((resolve, reject) => {
-        queryEquip(param2, res => {
-          resolve(res)
-        })
-      })
-      let promise1 = new Promise((resolve, reject) => {
-        getEquipBelongs(param1, res => {
-          resolve(res)
-        })
-      })
-      Promise.all([promise1,promise2]).then((res) => {
-        let allData = res[0], data = res[1]
-        this.options = this.formatOptions(allData.Content)
-        if (this.value) {
-          this.changeVal(this.value)
-        }
-        if(!this.all) {
-          this.content = data.Content.map(t => {
-            return t.Category
-          });
-          this.filterForOptions();
-          if (this.value) {
-            this.changeVal(this.value)
-          }
-        }
-      })
-    },
-    //格式化options数据
-    formatOptions(arr) {
-      let data = [];
-      arr.map(t => {
-        let temp = {};
-        temp.code = t.EquipCode;
-        temp.facility = t.EquipName;
-        data.push(temp)
-      })
-      return data;
-    },
-    //过滤
-    filterForOptions() {
-      this.options = this.options.filter(item => {
-        if (this.content.indexOf(item.code) > -1) {
-          return item
-        }
-      })
-    }
-  }
-};
-</script>
-<style lang="less" scoped>
-#cascaderMap {
-  float: left;
-  margin-left: 10px;
-  .buildFloor {
-    color: #999999;
-    font-size: 14px;
-  }
-}
-</style>

+ 40 - 19
src/components/ledger/lib/linkassets.vue

@@ -1,19 +1,22 @@
 <template>
-  <el-dialog title="批量关联资产" :visible.sync="dialog.linkAssets" width="900px">
+  <el-dialog title="批量关联资产" :visible.sync="dialog.linkAssets" width="700px">
     <el-row>
-      <device-parts></device-parts>
+      <span class="condition-title">设备类型:</span>
+      <el-select v-model="deviceType" filterable size="small" @change="handleChangeDevice" style="width:250px;">
+        <el-option  v-for="item in deviceTypeList" :key="item.code" :label="item.facility" :value="item.code"></el-option>
+      </el-select>
     </el-row>
     <el-row style="margin-top:30px;">
-      <!-- <build-floor></build-floor> -->
       <span class="condition-title">建筑楼层:</span>
-      <el-cascader placeholder="请选择建筑楼层" :options="bfoptions" v-model="buildFloor" filterable size="small" @change="handleChangeBf"></el-cascader>
+      <el-cascader :options="bfoptions" v-model="buildFloor" filterable size="small" @change="handleChangeBf" style="width:250px;"></el-cascader>
     </el-row>
     <el-row style="margin-top:30px;">
-      <zone-space :isWidth="false"></zone-space>
+      <span class="condition-title">分区类型空间实例:</span>
+      <el-cascader v-model="space" filterable clearable collapse-tags size="small" :options="spaceList" :props="props" @change="handleChangeSpace" style="width:250px;"></el-cascader>
     </el-row>
     <span slot="footer" class="dialog-footer">
       <el-button @click="handleClickClose">取 消</el-button>
-      <el-button type="primary" @click="toAddDevice">确 认</el-button>
+      <el-button type="primary" @click="toLinkAssets">确 认</el-button>
     </span>
   </el-dialog>
 </template>
@@ -22,15 +25,7 @@
 import { floorQuery, buildingQuery } from '@/api/scan/request'
 
 import { mapGetters } from "vuex"
-import buildFloor from "@/components/ledger/lib/buildFloor"
-import zoneSpace from "@/components/ledger/lib/zoneSpace"
-import deviceParts from "@/components/ledger/lib/deviceParts"
 export default {
-  components: {
-    buildFloor,
-    zoneSpace,
-    deviceParts
-  },
   props: {
     dialog: {
       type: Object,
@@ -48,18 +43,24 @@ export default {
     return {
       bfoptions: [], //建筑楼层列表
       buildFloor: ['all'], //选择的建筑楼层
+      deviceTypeList: [], //未关联资产的设备或部件列表
+      deviceType: '', //选择的设备类型
+      spaceList: [], //空间实例列表
+      space: [], //选择的空间实例
+      props: { multiple: true }, //多选级联配置
+
     };
   },
   created() {
-    this.getData()
+    this.getData() //获取建筑楼层数据
   },
   mounted() { },
   methods: {
-    //获取数据
+    //获取建筑楼层数据
     getData() {
       let data, buildParams = {
         PageNumber: 1,
-        PageSize: 500,
+        PageSize: 1000,
         Projection: [
           "BuildID",
           "BuildLocalName"
@@ -67,7 +68,7 @@ export default {
       }, floorParams = {
         Orders: "FloorSequenceID desc",
         PageNumber: 1,
-        PageSize: 500,
+        PageSize: 1000,
         Projection: [
           "BuildID",
           "FloorID",
@@ -102,7 +103,7 @@ export default {
           })
         data.forEach(build => {
           floorData.forEach(floor => {
-            if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName && this.type == "yes") {
+            if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName) {
               if (build.children) {
                 build.children.push({
                   value: floor.FloorID,
@@ -129,12 +130,25 @@ export default {
         this.bfoptions = data
       })
     },
+    // 修改设备类型
+    handleChangeDevice() {
+
+    },
     // 修改建筑楼层
     handleChangeBf() {
 
     },
+    // 修改空间实例
+    handleChangeSpace() {
+
+    },
+    // 点击取消关闭弹窗
     handleClickClose() {
       this.dialog.linkAssets = false
+    },
+    // 批量关联资产详情页
+    toLinkAssets() {
+
     }
   },
   watch: {
@@ -145,9 +159,16 @@ export default {
 
 <style lang="less" scoped>
   .condition-title{
+    width: 200px;
+    display: inline-block;
+    text-align: right;
     margin-left: 10px;
     margin-right: 12px;
     color: #999999;
     font-size: 14px;
   }
+  /deep/ .el-dialog__body {
+    max-height: 420px;
+    overflow-y: auto;
+  }
 </style>

+ 0 - 164
src/components/ledger/lib/zoneSpace.vue

@@ -1,164 +0,0 @@
-<template>
-  <div id="buildFloor">
-    <span class="buildFloor" style="margin-right: 12px;">分区类型空间实例:</span>
-    <el-cascader 
-    v-model="value"
-    filterable
-    clearable
-    collapse-tags
-    size="small"
-    :options="options"
-    :props="props" 
-    :style="isWidth ? '' : 'width:400px;'" 
-    @change="changeCascader">
-    </el-cascader>
-  </div>
-</template>
-<script>
-import tools from "@/utils/scan/tools"
-import { floorQuery, buildingQuery } from '@/api/scan/request'
-import { mapGetters, mapActions } from "vuex"
-
-export default {
-  props: {
-    isWidth: {
-      type: Boolean,
-      default: true
-    },
-    type: {
-      type: String,
-      default: "yes"
-    }
-  },
-  computed: {
-    ...mapGetters("layout", [ "projectId", "secret", "userId" ])
-  },
-  data() {
-    return {
-      props: { multiple: true },
-      options: [],
-      param: {
-        ProjId: '',
-        secret: ''
-      },
-      value: ['all']
-    };
-  },
-  created() {
-    this.param.ProjId = this.projectId
-    this.param.secret = this.secret
-    this.getData()
-  },
-  watch: {
-    projectId() {
-      this.value = ['all'];
-      this.options = [];
-      this.param.ProjId = this.projectId
-      this.param.secret = this.secret
-      this.getData()
-      this.changeCascader(['all'])
-    }
-  },
-  methods: {
-    //设置默认选项
-    setValue(val) {
-      if (val && val.length) {
-        this.value = val
-      }
-    },
-    //获取数据
-    getData() {
-      let data, buildParams = {
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-          "BuildID",
-          "BuildLocalName"
-        ]
-      }, floorParams = {
-        Orders: "FloorSequenceID desc",
-        PageNumber: 1,
-        PageSize: 500,
-        Projection: [
-          "BuildID",
-          "FloorID",
-          "FloorLocalName",
-          "FloorSequenceID"
-        ]
-      }
-      let promise1 = new Promise((resolve, reject) => {
-        buildingQuery(buildParams, res => {
-          resolve(res)
-        })
-      })
-      let promise2 = new Promise((resolve, reject) => {
-        floorQuery(floorParams, res => {
-          resolve(res)
-        })
-      })
-      Promise.all([promise1, promise2]).then(values => {
-        let builData = values[0].Content, floorData = values[1].Content
-        data = builData.map(build => {
-          return {
-            value: build.BuildID,
-            label: build.BuildLocalName
-          }
-        })
-        data.unshift({
-          value: "all",
-          label: "全部"
-        }, {
-            value: "noKnow",
-            label: "不在建筑内"
-          })
-        data.forEach(build => {
-          floorData.forEach(floor => {
-            if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName && this.type == "yes") {
-              if (build.children) {
-                build.children.push({
-                  value: floor.FloorID,
-                  label: floor.FloorLocalName,
-                  FloorSequenceID: floor.FloorSequenceID
-                })
-              } else {
-                build.children = []
-                build.children.push({
-                  value: "all",
-                  label: "全部"
-                }, {
-                    value: 'noKnow',
-                    label: "未明确楼层的设备"
-                  }, {
-                    value: floor.FloorID,
-                    label: floor.FloorLocalName,
-                    FloorSequenceID: floor.FloorSequenceID
-                  })
-              }
-            }
-          })
-        })
-        this.options = data
-      })
-    },
-    //改变item
-    changeCascader(value) {
-      this.$emit("change", value)
-    }
-  }
-};
-</script>
-<style lang="less">
-.el-cascader .el-input .el-input__inner {
-  vertical-align: bottom;
-}
-</style>
-<style lang="less" scoped>
-#buildFloor {
-  margin-left: 10px;
-  float: left;
-  .buildFloor {
-    color: #999999;
-    font-size: 14px;
-  }
-}
-</style>

+ 1 - 1
src/views/ledger/cenotelist/index.vue

@@ -109,7 +109,7 @@ export default {
     showTypes () {
       return this.onlyRead?
         [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
-        [{value: "partInfo", label: '隐藏信息点'}, {value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
+        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
     }
   },
   created() {

+ 1 - 1
src/views/ledger/rentlist/index.vue

@@ -123,7 +123,7 @@ export default {
     showTypes () {
       return this.onlyRead?
         [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
-        [{value: "partInfo", label: '隐藏信息点'}, {value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
+        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
     }
   },
   created() {