瀏覽代碼

新增目标修改功能

zengyicheng 2 年之前
父節點
當前提交
60d41a3a79
共有 1 個文件被更改,包括 71 次插入1 次删除
  1. 71 1
      src/components/pages/evaluation.vue

+ 71 - 1
src/components/pages/evaluation.vue

@@ -123,6 +123,12 @@
                     >{{ item.name }}</span
                   >
                 </el-tooltip>
+                <img
+                  style="right: 40px"
+                  src="../../assets/autorUp.png"
+                  @click="updateF(item.id, item.name, 1)"
+                  alt
+                />
                 <img
                   src="../../assets/delete.png"
                   @click="deleteF(item.id)"
@@ -173,6 +179,12 @@
                     >{{ item.name }}</span
                   >
                 </el-tooltip>
+                <img
+                  style="right: 40px"
+                  src="../../assets/autorUp.png"
+                  @click="updateF(item.id, item.name, 2)"
+                  alt
+                />
                 <img
                   src="../../assets/delete.png"
                   @click="deleteS(item.id)"
@@ -225,6 +237,12 @@
                     >{{ item.name }}</span
                   >
                 </el-tooltip>
+                <img
+                  style="right: 40px"
+                  src="../../assets/autorUp.png"
+                  @click="updateF(item.id, item.name, 3)"
+                  alt
+                />
                 <img
                   src="../../assets/delete.png"
                   @click="deleteT(item.id)"
@@ -303,6 +321,25 @@
         <el-button @click="addEName" type="primary">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+      title="修改子级"
+      :visible.sync="dialogVisible4"
+      :append-to-body="true"
+      width="400px"
+      :before-close="handleClose"
+      class="dialog_diy tips_diy"
+    >
+      <div>
+        <div class="e_add_title2">
+          <span>名称</span>
+          <el-input v-model="eName1" placeholder="请输入名称"></el-input>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible4 = false">关 闭</el-button>
+        <el-button @click="addEName1" type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -350,10 +387,13 @@ export default {
       dialogVisible: false,
       dialogVisible2: false,
       dialogVisible3: false,
+      dialogVisible4: false,
       userid: this.$route.query.userid,
       oid: this.$route.query.oid,
       eTitle: "",
       eName: "",
+      eName1: "",
+      mid: "",
       eJson: {},
       fid: "", //一级
       sid: "", //二级
@@ -429,6 +469,30 @@ export default {
       this.eJSONNum++;
       this.setMindData();
     },
+    addEName1() {
+      if (this.eName1 == "") {
+        this.$message.error("请输入目标");
+        return;
+      }
+      if (this.type == 1) {
+        this.eJson[this.mid].name = this.eName1;
+        this.dialogVisible4 = false;
+        this.eName1 = "";
+        this.mid = "";
+      } else if (this.type == 2) {
+        this.eJson[this.fid].child[this.mid].name = this.eName1;
+        this.dialogVisible4 = false;
+        this.eName1 = "";
+        this.mid = "";
+      } else if (this.type == 3) {
+        this.eJson[this.fid].child[this.sid].child[this.mid].name = this.eName1;
+        this.dialogVisible4 = false;
+        this.eName1 = "";
+        this.mid = "";
+      }
+      this.eJSONNum++;
+      this.setMindData();
+    },
     checkF(id) {
       if (this.fid == id) {
         this.fid = "";
@@ -453,6 +517,12 @@ export default {
         this.tid = id;
       }
     },
+    updateF(id, n, t) {
+      this.eName1 = n;
+      this.mid = id;
+      this.type = t;
+      this.dialogVisible4 = true;
+    },
     deleteF(id) {
       console.log(this.eJson);
       if (JSON.stringify(this.eJson[id].child) != "{}") {
@@ -684,7 +754,7 @@ export default {
   background: #fff;
 }
 
-.mubiao_diy >>> .el-dialog{
+.mubiao_diy >>> .el-dialog {
   max-width: 1200px;
 }