浏览代码

+ 桩点聚合到视野功能

chen.cheng 3 月之前
父节点
当前提交
fe9d207c0a
共有 2 个文件被更改,包括 27 次插入16 次删除
  1. 7 0
      src/utils/EnumConst.js
  2. 20 16
      src/views/cons/consUnit/index.vue

+ 7 - 0
src/utils/EnumConst.js

@@ -21,6 +21,13 @@ export const MachineStatus = {
   }
 }
 
+export const NodeType = {
+  desFile: {
+    label: "desFile",
+    color: "#5cb85c",
+    code: 2
+  }
+}
 export const PileHoleStatus = {
   DIC: {
     NotStated: {

+ 20 - 16
src/views/cons/consUnit/index.vue

@@ -204,7 +204,9 @@
           <!--          </el-col>-->
           <el-col :span="12">
             <el-form-item :label="$t('cons.nodeType')" prop="type">
-              <el-select v-model="form.type" :placeholder="$t('common.select',{
+              <el-select
+                v-model="form.type"
+                :placeholder="$t('common.select',{
                             name: $t('cons.nodeType')
                           })">
                 <el-option
@@ -216,11 +218,15 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <el-col :span="12" v-if="form.type == NodeType.desFile.code">
             <el-form-item :label="$t('cons.designFileType')" prop="classifyType">
-              <el-select v-model="form.classifyType+''" :placeholder="$t('common.select',{
+              <el-select
+                v-model="form.classifyType"
+                :placeholder="$t('common.select',{
                             name: $t('cons.designFileType')
-                          })">
+                          })"
+                clearable
+              >
                 <el-option
                   v-for="dict in dict.type.classify_type"
                   :key="dict.value"
@@ -231,18 +237,8 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <!--        <el-row>-->
-        <!--          <el-col :span="12">-->
-        <!--            <el-form-item label="设计文件类型" prop="classifyType">-->
-        <!--              <el-input v-model="form.classifyType" placeholder="请输入设计文件类型"/>-->
-        <!--            </el-form-item>-->
-        <!--          </el-col>-->
-        <!--          <el-col :span="12">-->
-
-        <!--          </el-col>-->
-        <!--        </el-row>-->
         <el-row>
-          <el-col :span="24">
+          <el-col :span="24" v-if="form.type == NodeType.desFile.code">
             <el-form-item :label="$t('cons.machine')" prop="toMachineId">
               <el-select style="width: 100%" v-model="form.machineId" multiple
                          :placeholder="$t('common.select',{name:$t('cons.machine')})">
@@ -339,9 +335,15 @@ import {
 } from "@/api/cons/consUnitInfo";
 import {listAllPileMachineInfo} from "@/api/cons/pileMachineInfo";
 import {getToken} from "@/utils/auth";
+import {NodeType} from "@/utils/EnumConst";
 
 export default {
   name: "cons-unit",
+  computed: {
+    NodeType() {
+      return NodeType
+    }
+  },
   dicts: ['cons_unit_type', 'classify_type'],
   components: {Treeselect},
   data() {
@@ -489,7 +491,7 @@ export default {
         type: "0",
         parentId: null,
         createType: 1,
-        classifyType: "1",
+        classifyType: null,
         name: null,
       };
       this.resetForm("form");
@@ -528,6 +530,8 @@ export default {
       this.reset();
       getConsUnitInfo(row.id).then(response => {
         this.form = response.data;
+        const {classifyType} = response.data;
+        this.form.classifyType = classifyType && classifyType + '';
         this.open = true;
         this.title = this.$t("common.modifyDialog", {name: this.$t("cons.consUnit")});
         listAllConsUnitExcludeChild(row.id).then(response => {