Browse Source

系统台账添加页面【设备,竖井,空间】

LXXXY 5 years ago
parent
commit
4248ed5414

+ 64 - 0
src/components/ledger/lib/spaceSelect.vue

@@ -0,0 +1,64 @@
+<template>
+  <div id="spaceSelect">
+    <span class="buildFloor" style="padding-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.Name" :value="item.Code"></el-option>
+    </el-select>
+  </div>
+</template>
+
+<script>
+import { queryDictionaryHead } from '@/api/scan/request';
+export default {
+  props: {
+    isWidth: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data() {
+    return {
+      value:null,
+      spaceVal: null,//值
+      options: [],
+      props: {
+        isWidth:false
+      }
+    }
+  },
+  methods: {
+    //获取下拉框数据
+    getOptionData() {
+      let pa = {
+        Filters: `parentId = 'Space'`
+      }
+      queryDictionaryHead(pa, res => {
+        this.options = res.Content.map(t => {
+          if (t.Name == "元空间") {
+            return undefined;
+          }
+          return t;
+        }).filter(item => item);
+      })
+    },
+    //改变空间
+    changeVal(value) {
+      this.$emit('change', value)
+    }
+  },
+  created() {
+    this.getOptionData();
+  }
+}
+</script>
+
+<style lang="less" scoped>
+#spaceSelect {
+  float: left;
+  margin-left: 10px;
+  .buildFloor {
+    color: #999999;
+    font-size: 14px;
+  }
+}
+</style>

+ 11 - 11
src/components/ledger/system/dialog/addCenoteDialog.vue

@@ -1,19 +1,19 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
-    <el-row class="filters">
-      <el-col :span="9">
+    <el-row class="filters" :gutter="20">
+      <el-col :span="8">
         <el-input placeholder="输入竖井名称或竖井本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>
-      <el-col :span="15">
+      <el-col :span="9">
         <cenote-type @change="changeCenote"></cenote-type>
       </el-col>
     </el-row>
     <div class="table-box">
       <el-table :data="tableData" style="width: 100%" height="350" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
         @selection-change="handleSelectionChange">
-        <el-table-column  type="selection" width="55"></el-table-column>
+        <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
@@ -80,7 +80,7 @@ export default {
     type: String, //选中的tab页
     params: Object //查看的竖井关系信息
   },
-  created() { 
+  created() {
     queryShaftType(res => {
       res.Content.forEach(item => {
         this.shaftType[item.Code] = item.Name
@@ -103,20 +103,20 @@ export default {
     getTableData() {
       let params = {
         data: {
-          Filters: this.cenoteType? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteType}'`: `ProjectId='${this.projectId}'`,
+          Filters: this.cenoteType ? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteType}'` : `ProjectId='${this.projectId}'`,
           Orders: "createTime desc, ShaftID asc",
           PageNumber: this.page.pageNumber,
           PageSize: this.page.pageSize,
         },
         shaftId: this.params.ShaftID
       }
-      if(this.keycode!=''){
+      if (this.keycode != '') {
         params.data.Filters += `;ShaftName contain '${this.keycode}' or ShaftLocalName contain '${this.keycode}' or ShaftLocalID contain '${this.keycode}'`
       }
       unshaftThroughShaft(params, res => {
         this.tableData = res.Content
         this.tableData.forEach(item => {
-          if(item.StructureInfo && item.StructureInfo.ShaftFuncType){
+          if (item.StructureInfo && item.StructureInfo.ShaftFuncType) {
             item.StructureInfo.ShaftFuncType = this.shaftType[item.StructureInfo.ShaftFuncType]
           }
         })
@@ -128,7 +128,7 @@ export default {
       this.selections = val;
     },
     savaRelation() {
-      if(this.selections.length){
+      if (this.selections.length) {
         let params = {
           ShaftId: this.params.ShaftID,
           ShaftOtherIdList: this.selections.map(item => {
@@ -140,7 +140,7 @@ export default {
           this.$message.success('关联成功!')
           this.$emit('refresh')
         })
-      }else {
+      } else {
         this.$message('请选择要关联的设备')
       }
     },
@@ -171,7 +171,7 @@ export default {
   }
   .table-box {
     height: 370px;
-    .fr{
+    .fr {
       margin-top: 10px;
     }
   }

+ 27 - 15
src/components/ledger/system/dialog/addEquipDialog.vue

@@ -1,19 +1,23 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
     <el-row class="filters">
-      <el-col :span="9">
+      <el-col :span="8" style="width:276px">
         <el-input placeholder="输入设备名称或设备本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>
-      <el-col :span="15">
+      <el-col :span="8.5" style="padding:0 0;">
         <floor-cascader @change="changeFloor"></floor-cascader>
       </el-col>
+      <el-col :span="8.5" style="padding-right:0;">
+        <my-cascader @change="changeDevice"></my-cascader>
+      </el-col>
     </el-row>
+
     <div class="table-box">
       <el-table :data="tableData" style="width: 100%" height="350" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
         @selection-change="handleSelectionChange">
-        <el-table-column  type="selection" width="55"></el-table-column>
+        <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
@@ -44,10 +48,12 @@
 <script>
 import { unshaftInEq, linkEqSh } from "@/api/scan/request";
 import floorCascader from "@/components/ledger/lib/floorCascader";
+import myCascader from "@/components/ledger/lib/cascader";
 import { mapGetters } from "vuex";
 export default {
   components: {
-    floorCascader
+    floorCascader,
+    myCascader
   },
   computed: {
     ...mapGetters("layout", ["projectId"])
@@ -57,6 +63,7 @@ export default {
       title: "添加系统内设备",
       keycode: '', //输入查询条件
       Buildfloor: ['all'], // 选中的建筑楼层
+      Equipcategory: null,// 选中的设备类型
       inSpaceType: '设备',
       dialogVisible: false,
       tableData: [],
@@ -86,6 +93,11 @@ export default {
       this.Buildfloor = value
       this.getTableData()
     },
+    //修改设备类别
+    changeDevice(value) {
+      this.Equipcategory = value.code
+      this.getTableData()
+    },
     // 显示弹窗
     showDialog() {
       this.dialogVisible = true
@@ -96,8 +108,8 @@ export default {
     getTableData() {
       let params = {
         data: {
-          Cascade: [{ Name: 'equipCategory' }, {Name: 'shaftList'}],
-          Filters:`not EquipID isNull`,
+          Cascade: [{ Name: 'equipCategory' }, { Name: 'shaftList' }],
+          Filters: `not EquipID isNull`,
           Orders: "createTime desc, EquipID desc",
           PageNumber: this.page.pageNumber,
           PageSize: this.page.pageSize,
@@ -114,15 +126,18 @@ export default {
       } else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
         params.data.Filters += `;floorId='${this.Buildfloor[1]}'`
       }
-      if(this.keycode!=''){
+      if (this.keycode != '') {
         params.data.Filters += `;EquipName contain '${this.keycode}' or EquipLocalName contain '${this.keycode}' or EquipLocalID contain '${this.keycode}'`
       }
+      if (this.Equipcategory) {
+        params.data.Filters += `;category='${this.Equipcategory}'`
+      }
       unshaftInEq(params, res => {
         res.Content.forEach(item => {
           item.ShaftListName = ""
-          if(item.ShaftList && item.ShaftList.length){
+          if (item.ShaftList && item.ShaftList.length) {
             item.ShaftListName = item.ShaftList.map(shaft => {
-              return shaft.ShaftLocalName?shaft.ShaftLocalName:shaft.ShaftName
+              return shaft.ShaftLocalName ? shaft.ShaftLocalName : shaft.ShaftName
             }).join("、")
           }
         })
@@ -135,7 +150,7 @@ export default {
       this.selections = val;
     },
     savaRelation() {
-      if(this.selections.length){
+      if (this.selections.length) {
         let params = {
           ShaftId: this.params.ShaftID,
           EquipIdList: this.selections.map(item => {
@@ -147,7 +162,7 @@ export default {
           this.$message.success('关联成功!')
           this.$emit('refresh')
         })
-      }else {
+      } else {
         this.$message('请选择要关联的设备')
       }
     },
@@ -172,13 +187,10 @@ export default {
 #addEqDialog {
   .filters {
     margin-bottom: 10px;
-    /deep/ .el-input__inner {
-      vertical-align: baseline;
-    }
   }
   .table-box {
     height: 370px;
-    .fr{
+    .fr {
       margin-top: 10px;
     }
   }

+ 36 - 5
src/components/ledger/system/dialog/addSpaceDialog.vue

@@ -1,5 +1,22 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
+    <el-row class="filters" :gutter="20">
+      <el-col :span="8">
+        <el-input placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
+          <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
+        </el-input>
+      </el-col>
+      <el-col :span="8.5" style="padding:0 0;">
+        <floor-cascader @change="changeFloor"></floor-cascader>
+      </el-col>
+       <el-col :span="8.5" style="padding:0 0;">
+         <space-select @change="changeSpace"></space-select>
+      </el-col>
+    </el-row>
+    <el-row class="filters" :gutter="20">
+      
+     
+    </el-row>
     <div class="table-box">
       <el-table :data="tableData" style="width: 100%" height="350" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
         @selection-change="handleSelectionChange">
@@ -34,10 +51,14 @@
 <script>
 import { unshaftInSys, linkSySh } from "@/api/scan/request";
 import floorCascader from "@/components/ledger/lib/floorCascader";
+import dictionaryCas from '@/components/config_point/dictionaryCascader'
+import spaceSelect from '@/components/ledger/lib/spaceSelect'
 import { mapGetters } from "vuex";
 export default {
   components: {
-    floorCascader
+    floorCascader,
+    dictionaryCas,
+    spaceSelect
   },
   computed: {
     ...mapGetters("layout", ["projectId"])
@@ -45,8 +66,11 @@ export default {
   data() {
     return {
       title: "添加系统所在业务空间",
+      keycode: '', //输入查询条件
       inSpaceType: '系统',
       dialogVisible: false,
+      Buildfloor: ['all'], // 选中的建筑楼层
+      Spacecategory: null,// 选中的业务空间类型
       tableData: [],
       loading: false,
       selections: [], // 选中项
@@ -76,6 +100,16 @@ export default {
       this.tableData = []
       this.getTableData()
     },
+    //修改建筑楼层
+    changeFloor(value) {
+      this.Buildfloor = value
+      this.getTableData()
+    },
+    //修改空间类型
+    changeSpace(value) {
+      this.Spacecategory = value.code
+      this.getTableData()
+    },
     getTableData() {
       let params = {
         data: {
@@ -132,10 +166,7 @@ export default {
 <style lang="less" scoped>
 #addEqDialog {
   .filters {
-    margin-bottom: 10px;
-    /deep/ .el-input__inner {
-      vertical-align: baseline;
-    }
+    margin-bottom: 10px; 
   }
   .table-box {
     height: 370px;