瀏覽代碼

平面图其他分区类型添加

haojianlong 5 年之前
父節點
當前提交
76278fa55b

+ 5 - 1
src/api/scan/request.js

@@ -1899,7 +1899,11 @@ export function getZoneQuery(param,success) {
 let url = `${baseUrl}/datacenter/class-def/query-equip-comm-type`
   http.postJson(url,param,success)
 }
-
+//创建空间分类型
+export function zoneCreateType(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/create-type`
+  http.postJson(url,param,success)
+}
 //创建空间分区对象
 export function zoneCreate(param,success) {
   let url = `${baseUrl}/datacenter/object/zone/create`

文件差異過大導致無法顯示
+ 614 - 617
src/components/business_space/business/handsontable.vue


+ 29 - 17
src/components/business_space/newGraphy/graphy.vue

@@ -12,23 +12,13 @@
       <el-row class="buttons-box">
         <div style="height:50px;width:100%;background:#fff;" v-if="showOtherFlag">
           <!-- 平面图其他分区 -->
-          <el-select v-model="OtherValue" placeholder="请选择">
+          <el-select v-model="OtherValue" placeholder="请选择分区类型" @change="changeOtherZone">
             <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
             </el-option>
           </el-select>
+          <el-button type="promary" @click="addZoneBtn">添加分区</el-button>
         </div>
         <div>
-<!--添加分区-->
-          <el-button @click="addZoneBtn">添加分区</el-button>
-          <el-select v-model="zoneValue" placeholder="请选择">
-            <el-option
-              v-for="item in addZone"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-          &nbsp;&nbsp; | &nbsp;
           <el-autocomplete popper-class="my-autocomplete" v-model="search" :fetch-suggestions="querySearch" placeholder="输入平面图中已有的业务空间名称进行查找"
             width="180px" @select="handleSelect">
             <i class="el-icon-search el-input__icon" slot="suffix" @click="handleSelect"></i>
@@ -113,7 +103,7 @@
         <el-button size="small" type="primary" @click="confirm">确认</el-button>
       </span>
     </el-dialog>
-    <dialogZone ref="zone"/>
+    <dialogZone ref="zone" @createSuccess="getOhterType" />
   </div>
 </template>
 <script>
@@ -134,7 +124,8 @@ import {
   getIspNotInSpace,
   createRelateInZoneAndISp,
   groupCreRelaZoneAndISp,
-  getZoneQuery
+  getZoneQuery,
+  queryAllZoneType, // 定制分区类型
 } from "@/api/scan/request"
 
 export default {
@@ -146,8 +137,6 @@ export default {
   },
   data() {
     return {
-      zoneValue:'',
-      addZone:[],
       canvasWidth: 800,
       canvasHeight: 600,
       type: 1, // 默认操作模式
@@ -182,7 +171,7 @@ export default {
       sourceIdToISP: {},
       areaValue: 40,
       areaMarks: { 0: '0m²', 100: '1m²' },
-      options: [{ value: '选项1', label: '黄金糕' }, { value: '选项2', label: '双皮奶' }], //其他分区类型
+      options: [], //其他分区类型
       OtherValue: '',
       showOtherFlag: false, //是否显示其他分区类型添加
     }
@@ -295,11 +284,34 @@ export default {
       if (tab.code == "OtherZone") {
         // 其他分区
         this.showOtherFlag = true
+        this.getOhterType();
       } else {
         this.showOtherFlag = false;
         this.init(initType);
       }
     },
+    // 其他分区类型查询
+    getOhterType() {
+      let pa = {
+        Cascade: [{ Name: 'zoneType' }],
+        Filters: `Code="OtherZone"`
+      }
+      queryAllZoneType(pa, res => {
+        if (res.Content[0].ZoneType && res.Content[0].ZoneType.length) {
+          this.options = res.Content[0].ZoneType.map(t => {
+            t.value = t.Code;
+            t.label = t.Name;
+            return t;
+          })
+        } else {
+          this.options = []
+        }
+      })
+    },
+    // 其他类型下拉change
+    changeOtherZone(val) {
+      console.log(val)
+    },
     // 获取未绑定业务空间的元空间
     getISPSPUnrelaBSP() {
       let pa = {

+ 47 - 39
src/components/ledger/addDialog/dialogZone.vue

@@ -1,12 +1,12 @@
 <template>
   <!-- Form -->
-  <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
+  <el-dialog title="收货地址" :visible.sync="dialogFormVisible" width="30%">
     <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-      <el-form-item label="分区名称" prop="name">
-        <el-input v-model="ruleForm.name"></el-input>
+      <el-form-item label="分区名称" prop="Name">
+        <el-input v-model="ruleForm.Name"></el-input>
       </el-form-item>
-      <el-form-item label="分区ID" prop="id">
-        <el-input v-model="ruleForm.id"></el-input>
+      <el-form-item label="分区ID" prop="Id">
+        <el-input v-model="ruleForm.Id"></el-input>
       </el-form-item>
       <el-form-item style="float: right;margin-top: 20px">
         <el-button @click="dialogFormVisible = false">取 消</el-button>
@@ -21,44 +21,52 @@
 </template>
 
 <script>
-  export default {
-    name: "dialogZone",
-    data() {
-      return {
-        dialogFormVisible: false,
-        ruleForm: {
-          name: '',
-          id: ''
-
-        },
-        rules: {
-          name: [
-            {required: true, message: '请输入分区名称', trigger: 'blur'},
-            // {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
-          ],
-          id: [
-            {required: true, message: '请输入分区ID', trigger: 'blur'},
-          ],
-        }
-      };
-    },
-    methods: {
-      submitForm(formName) {
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
+import {
+  zoneCreateType
+} from "@/api/scan/request"
+export default {
+  name: "dialogZone",
+  data() {
+    return {
+      dialogFormVisible: false,
+      ruleForm: {
+        Name: '',
+        Id: '',
+        ParentId: "OtherZone"
+      },
+      rules: {
+        Name: [
+          { required: true, message: '请输入分区名称', trigger: 'blur' },
+          // {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
+        ],
+        Id: [
+          { required: true, message: '请输入分区ID', trigger: 'blur' },
+        ],
+      }
+    };
+  },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          let pa = {
+            Content: [this.ruleForm]
+          }
+          zoneCreateType(pa, res=>{
             this.dialogFormVisible = false
             this.ruleForm.name = ''
-            this.ruleForm.id = ''
-          } else {
-            console.log('error submit!!');
-            return false;
-          }
-        });
-      },
-    }
+            this.ruleForm.id = '';
+            this.$emit('createSuccess')
+          })
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
   }
+}
 </script>
 
 <style scoped>
-
 </style>