Kaynağa Gözat

Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop

YaolongHan 3 yıl önce
ebeveyn
işleme
487cae7592

+ 3 - 0
src/App.vue

@@ -35,4 +35,7 @@ html {
     display: none;
   }
 }
+.cololorSelect {
+  border: 1px solid #e6e6e6;
+}
 </style>

+ 12 - 7
src/components/homeView/createGraphDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog class="create-dialog" title="新建拓扑图" width="600px" :visible.sync="outerVisible" :close-on-click-modal="false" custom-class="createDialog"
-    @close="closeModal">
+    @close="closeModal" @closed="closed">
     <graphTypeDialog ref="graphTypeDialog" @selectNode="selectNode"></graphTypeDialog>
     <div class="dialog-bodys">
       <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" label-position="top">
@@ -11,7 +11,7 @@
           </el-button>
         </el-form-item>
         <el-form-item label="名称" prop="name">
-          <el-input v-model="ruleForm.name" placeholder="请输入名称" size="small"></el-input>
+          <el-input v-model="ruleForm.name" placeholder="请输入名称" size="small"  :maxlength="20"></el-input>
         </el-form-item>
         <el-form-item label="标签" prop="resource">
           <div class="tagContainer">
@@ -19,7 +19,7 @@
               {{tag}}
             </el-tag>
             <el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
-              @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm" >
+              @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
             </el-input>
             <el-button v-else class="button-new-tag" size="small" @click="showInput">+ 添加</el-button>
           </div>
@@ -109,7 +109,7 @@ export default {
     },
     resetForm(formName) {
       this.dynamicTags = [];
-      this.buttonStr= '';
+      this.buttonStr = '';
       this.$refs[formName].resetFields();
       this.outerVisible = false
     },
@@ -125,8 +125,8 @@ export default {
       createGraph(pa).then(res => {
         if (res.result == "success") {
           this.outerVisible = false;
-          this.$message.success('创建成功');
-          const routeUrl = this.$router.resolve({
+          // this.$message.success('创建成功');
+          this.routeUrl = this.$router.resolve({
             name: 'Editer',
             query: {
               graphId: res.entityList[0].graphId,
@@ -136,7 +136,6 @@ export default {
               isPub: 0
             }
           })
-          window.open(routeUrl.href, "_blank");
         } else {
           this.$message(res.message)
         }
@@ -144,6 +143,12 @@ export default {
     },
     closeModal() {
       this.resetForm('ruleForm');
+    },
+    closed() {
+      if (this.routeUrl) {
+        window.open(this.routeUrl.href, "_blank");
+      }
+      this.routeUrl = ''
     }
   },
 }

+ 4 - 0
src/components/homeView/move.vue

@@ -64,6 +64,10 @@ export default {
         return
       }
       const categoryId = this.value[this.value.length - 1]
+      if (categoryId == this.data[0].categoryId) {
+        this.$message.warning('目标位置与当前位置一致')
+        return
+      }
       const pa = {
         content: [],
         projection: ['categoryId']

+ 1 - 1
src/components/homeView/recycle.vue

@@ -12,7 +12,7 @@
     </div>
     <div class="main-body" :class="{'no-data': !cardList.length}" v-loading="recycleLoading">
       <template v-for="t in cardList">
-        <topoImageCard :isRecycle="true" :data="t" :key="t.graphId" @recover="recover" @deleteRecycle="deleteRecycle"></topoImageCard>
+        <topoImageCard :isRecycle="true" :data="t" :key="t.id" @recover="recover" @deleteRecycle="deleteRecycle"></topoImageCard>
       </template>
       <div v-if="!cardList.length" style="margin-top: 112px;">
         <img :src="require('@/assets/images/no-data.png')" style="width: 116px;height:116px;">

+ 2 - 1
src/components/homeView/recycleDialog.vue

@@ -35,7 +35,8 @@ export default {
   watch: {
     categoryGraph: {
       handler: function(v) {
-        changeArr(v, this.codeToName)
+        const temp = JSON.parse(JSON.stringify(v))
+        changeArr(temp, this.codeToName)
       },
       immediate: true,
       deep: true

+ 3 - 2
src/components/homeView/rename.vue

@@ -1,7 +1,7 @@
 <template>
   <el-dialog title="重命名" :visible.sync="dialogVisible" width="480px" :close-on-click-modal="false" custom-class="renameDialog">
     <div>
-      <el-input v-model="input" placeholder="请输入名称" size="small"></el-input>
+      <el-input v-model="input" placeholder="请输入名称" size="small" :maxlength="20"></el-input>
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button @click="dialogVisible = false">取 消</el-button>
@@ -47,7 +47,8 @@ export default {
         content: [{
           id: this.data.id,
           graphId: this.data.graphId,
-          name: newName
+          name: newName,
+          categoryId: this.data.categoryId
         }],
         projection: ['name']
       }

+ 1 - 1
src/views/home.vue

@@ -108,7 +108,7 @@
               <topoImageCard
                 :isPub="isPub"
                 :data="t"
-                :key="t.graphId"
+                :key="t.id"
                 @changeCheck="changeCheck"
                 @rename="rename"
                 @publishSuc="updateSuc"