Browse Source

重名问题

haojianlong 3 years ago
parent
commit
8403517591

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

@@ -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">

+ 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"