zengyicheng 1 éve
szülő
commit
e8b4011136
1 módosított fájl, 228 hozzáadás és 75 törlés
  1. 228 75
      src/components/pages/evaluation.vue

+ 228 - 75
src/components/pages/evaluation.vue

@@ -86,10 +86,11 @@
                   >复制</el-button
                 >
                 <el-button
+                  v-if="$route.query.userid == scope.row.userid"
                   class="de_button"
                   type="primary"
                   size="small"
-                  @click="deleteE(scope.row.id, scope.row.userid)"
+                  @click="deleteE(scope.row.id)"
                   >删除</el-button
                 >
               </div>
@@ -115,9 +116,9 @@
       :append-to-body="true"
       width="100%"
       :before-close="handleClose1"
-      class="dialog_diy mubiao_diy"
+      class="dialog_diy mubiao_diy fullStyle"
     >
-      <div>
+      <div style="width: 100%; height: calc(100% - 80px)">
         <div class="e_add_top">
           <div class="e_add_title">
             <span>目标管理名称</span>
@@ -146,36 +147,54 @@
               <img src="../../assets/add.png" @click="addE(1)" alt />
             </div>
             <div class="e_add_list_body">
+              <div class="e_add_input">
+                <el-input v-model="evaObject.fName" />
+                <el-button @click="addInputName(1)" type="primary"
+                  >确 定</el-button
+                >
+              </div>
               <div
                 class="e_add_list_child"
                 v-for="(item, index) in eJson"
                 :key="index"
               >
-                <span
-                  :class="{ active: item.id == fid }"
-                  v-if="item.name.length < 8"
-                  @click="checkF(item.id)"
-                  >{{ item.name }}</span
-                >
-                <el-tooltip
-                  v-else
-                  class="item"
-                  effect="dark"
-                  :content="item.name"
-                  placement="top-start"
-                >
+                <div v-if="!evaObject.isFInput">
                   <span
                     :class="{ active: item.id == fid }"
+                    v-if="item.name.length < 8"
                     @click="checkF(item.id)"
                     >{{ item.name }}</span
                   >
-                </el-tooltip>
-                <img
-                  style="right: 40px"
-                  src="../../assets/autorUp.png"
-                  @click="updateF(item.id, item.name, 1)"
-                  alt
-                />
+                  <el-tooltip
+                    v-else
+                    class="item"
+                    effect="dark"
+                    :content="item.name"
+                    placement="top-start"
+                  >
+                    <span
+                      :class="{ active: item.id == fid }"
+                      @click="checkF(item.id)"
+                      >{{ item.name }}</span
+                    >
+                  </el-tooltip>
+                  <img
+                    style="right: 40px"
+                    src="../../assets/autorUp.png"
+                    @click="
+                      (evaObject.isFInput = true),
+                        (evaObject.fName1 = item.name)
+                    "
+                    alt
+                  />
+                  <!-- @click="updateF(item.id, item.name, 1)" -->
+                </div>
+                <div v-else>
+                  <el-input
+                    v-model="evaObject.fName1"
+                    @change="noInput(item.id, evaObject.fName1, 1)"
+                  />
+                </div>
                 <img
                   src="../../assets/delete.png"
                   @click="deleteF(item.id)"
@@ -202,36 +221,53 @@
               />
             </div>
             <div class="e_add_list_body">
+              <div class="e_add_input" v-if="fid != ''">
+                <el-input v-model="evaObject.sName" />
+                <el-button @click="addInputName(2)" type="primary"
+                  >确 定</el-button
+                >
+              </div>
               <div
                 class="e_add_list_child"
                 v-for="(item, index) in fid && eJson[fid].child"
                 :key="index"
               >
-                <span
-                  :class="{ active: item.id == sid }"
-                  v-if="item.name.length < 8"
-                  @click="checkS(item.id)"
-                  >{{ item.name }}</span
-                >
-                <el-tooltip
-                  v-else
-                  class="item"
-                  effect="dark"
-                  :content="item.name"
-                  placement="top-start"
-                >
+                <div v-if="!evaObject.isSInput">
                   <span
                     :class="{ active: item.id == sid }"
+                    v-if="item.name.length < 8"
                     @click="checkS(item.id)"
                     >{{ item.name }}</span
                   >
-                </el-tooltip>
-                <img
-                  style="right: 40px"
-                  src="../../assets/autorUp.png"
-                  @click="updateF(item.id, item.name, 2)"
-                  alt
-                />
+                  <el-tooltip
+                    v-else
+                    class="item"
+                    effect="dark"
+                    :content="item.name"
+                    placement="top-start"
+                  >
+                    <span
+                      :class="{ active: item.id == sid }"
+                      @click="checkS(item.id)"
+                      >{{ item.name }}</span
+                    >
+                  </el-tooltip>
+                  <img
+                    style="right: 40px"
+                    src="../../assets/autorUp.png"
+                    @click="
+                      (evaObject.isSInput = true),
+                        (evaObject.sName1 = item.name)
+                    "
+                    alt
+                  />
+                </div>
+                <div v-else>
+                  <el-input
+                    v-model="evaObject.sName1"
+                    @change="noInput(item.id, evaObject.sName1, 2)"
+                  />
+                </div>
                 <img
                   src="../../assets/delete.png"
                   @click="deleteS(item.id)"
@@ -258,6 +294,12 @@
               />
             </div>
             <div class="e_add_list_body">
+              <div class="e_add_input" v-if="sid != ''">
+                <el-input v-model="evaObject.tName" />
+                <el-button @click="addInputName(3)" type="primary"
+                  >确 定</el-button
+                >
+              </div>
               <div
                 class="e_add_list_child"
                 v-for="(item, index) in fid &&
@@ -265,31 +307,42 @@
                 eJson[fid].child[sid].child"
                 :key="index"
               >
-                <span
-                  :class="{ active: item.id == tid }"
-                  v-if="item.name.length < 8"
-                  @click="checkT(item.id)"
-                  >{{ item.name }}</span
-                >
-                <el-tooltip
-                  v-else
-                  class="item"
-                  effect="dark"
-                  :content="item.name"
-                  placement="top-start"
-                >
+                <div v-if="!evaObject.isTInput">
                   <span
                     :class="{ active: item.id == tid }"
+                    v-if="item.name.length < 8"
                     @click="checkT(item.id)"
                     >{{ item.name }}</span
                   >
-                </el-tooltip>
-                <img
-                  style="right: 40px"
-                  src="../../assets/autorUp.png"
-                  @click="updateF(item.id, item.name, 3)"
-                  alt
-                />
+                  <el-tooltip
+                    v-else
+                    class="item"
+                    effect="dark"
+                    :content="item.name"
+                    placement="top-start"
+                  >
+                    <span
+                      :class="{ active: item.id == tid }"
+                      @click="checkT(item.id)"
+                      >{{ item.name }}</span
+                    >
+                  </el-tooltip>
+                  <img
+                    style="right: 40px"
+                    src="../../assets/autorUp.png"
+                    @click="
+                      (evaObject.isTInput = true),
+                        (evaObject.tName1 = item.name)
+                    "
+                    alt
+                  />
+                </div>
+                <div v-else>
+                  <el-input
+                    v-model="evaObject.tName1"
+                    @change="noInput(item.id, evaObject.tName1, 3)"
+                  />
+                </div>
                 <img
                   src="../../assets/delete.png"
                   @click="deleteT(item.id)"
@@ -315,7 +368,10 @@
                 <span :class="{ active: typeMode == 2 }" @click="typeMode = 2"
                   >目标罗盘</span
                 >
-                <span :class="{ active: typeMode == 3 }" @click="typeMode = 3"
+                <span
+                  :class="{ active: typeMode == 3 }"
+                  @click="typeMode = 3"
+                  v-if="!update"
                   >目标看板</span
                 >
               </div>
@@ -456,6 +512,17 @@ export default {
       eid: "",
       typeMode: 1,
       eJSONNum: 0,
+      evaObject: {
+        fName: "",
+        fName1: "",
+        isFInput: false,
+        sName: "",
+        sName1: "",
+        isSInput: false,
+        tName: "",
+        tName1: "",
+        isTInput: false,
+      },
     };
   },
   methods: {
@@ -514,6 +581,61 @@ export default {
       this.type = type;
       this.dialogVisible3 = true;
     },
+    addInputName(t) {
+      let _id = this.guid();
+      if (t == 1) {
+        if (this.evaObject.fName == "") {
+          this.$message.error("请输入目标");
+          return;
+        }
+        this.eJson[_id] = {
+          id: _id,
+          name: this.evaObject.fName,
+          detail: "",
+          child: {},
+        };
+        this.evaObject.fName = "";
+        this.checkF(_id);
+      } else if (t == 2) {
+        if (this.evaObject.sName == "") {
+          this.$message.error("请输入目标");
+          return;
+        }
+        this.eJson[this.fid].child[_id] = {
+          id: _id,
+          name: this.evaObject.sName,
+          detail: "",
+          child: {},
+        };
+        this.evaObject.sName = "";
+        this.checkS(_id);
+      } else if (t == 3) {
+        this.eJson[this.fid].child[this.sid].child[_id] = {
+          id: _id,
+          name: this.evaObject.tName,
+          detail: "",
+          child: [],
+        };
+        this.evaObject.tName = "";
+        this.checkT(_id);
+      }
+      this.eJSONNum++;
+      this.setMindData();
+    },
+    noInput(id, n, t) {
+      if (t == 1) {
+        this.eJson[id].name = n;
+        this.evaObject.isFInput = false;
+      } else if (t == 2) {
+        this.eJson[this.fid].child[id].name = n;
+        this.evaObject.isSInput = false;
+      } else if (t == 3) {
+        this.eJson[this.fid].child[this.sid].child[id].name = n;
+        this.evaObject.isTInput = false;
+      }
+      this.eJSONNum++;
+      this.setMindData();
+    },
     addEName() {
       if (this.eName == "") {
         this.$message.error("请输入目标");
@@ -599,6 +721,7 @@ export default {
         this.tid = id;
       }
     },
+
     updateF(id, n, t) {
       this.eName1 = n;
       this.mid = id;
@@ -757,11 +880,7 @@ export default {
           console.error(err);
         });
     },
-    deleteE(id, uid) {
-      if (this.$route.query.userid != uid) {
-        this.$message.error("不可以删除他人创建的目标!");
-        return;
-      }
+    deleteE(id) {
       let params = {
         eid: id,
       };
@@ -1004,13 +1123,12 @@ export default {
 .e_add_content {
   display: flex;
   width: 100%;
-  overflow: auto;
-  height: 530px;
+  height: 100%;
 }
 .e_add_list {
   background: #fff;
-  height: 500px;
-  width: 210px;
+  height: 100%;
+  width: calc(50% / 3);
   position: relative;
   margin: 15px 10px 0 0;
   flex-shrink: 0;
@@ -1048,6 +1166,20 @@ export default {
   height: calc(100% - 187px);
   overflow: auto;
 }
+.e_add_input {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  justify-content: center;
+  padding: 10px 0;
+}
+.e_add_input > .el-input {
+  width: 200px;
+}
+.e_add_input > .el-button {
+  margin-left: 10px;
+}
 .e_add_list_child {
   width: 100%;
   display: flex;
@@ -1115,9 +1247,10 @@ export default {
 
 .e_add_list_pbox {
   margin: 15px 0 0 0;
-  width: 500px;
+  width: 50%;
   min-width: 500px;
-  height: 500px;
+  height: 100%;
+  min-height: 500px;
 }
 .e_add_list_pbox_title {
   height: 50px;
@@ -1162,4 +1295,24 @@ export default {
 .el-table >>> .even_row {
   background-color: #f1f1f1 !important;
 }
+
+.fullStyle >>> .el-dialog__body {
+  height: calc(100% - 125px) !important;
+  box-sizing: border-box;
+  min-height: 500px;
+}
+
+.fullStyle >>> .el-dialog {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 !important;
+}
+
+.fullStyle {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 auto !important;
+}
 </style>