zengyicheng 1 年之前
父節點
當前提交
0f6b646a9c
共有 3 個文件被更改,包括 300 次插入45 次删除
  1. 二進制
      src/assets/icon/new/evaIsChoose.png
  2. 二進制
      src/assets/icon/new/evaTemItem.png
  3. 300 45
      src/components/pages/evaluation.vue

二進制
src/assets/icon/new/evaIsChoose.png


二進制
src/assets/icon/new/evaTemItem.png


+ 300 - 45
src/components/pages/evaluation.vue

@@ -129,15 +129,15 @@
             ></el-input>
             ></el-input>
           </div>
           </div>
           <div>
           <div>
+            <el-button v-show="false" type="primary" @click="addTemplate">新增模板</el-button>
+            <el-button type="primary" @click="openTemplate">资源</el-button>
             <el-button @click="addEJson" type="primary" v-if="!update"
             <el-button @click="addEJson" type="primary" v-if="!update"
               >保存</el-button
               >保存</el-button
             >
             >
             <el-button @click="updateEJson" type="primary" v-else
             <el-button @click="updateEJson" type="primary" v-else
               >保存</el-button
               >保存</el-button
             >
             >
-            <el-button @click="clearAll()" type="primary"
-              >不保存</el-button
-            >
+            <el-button @click="clearAll()" type="primary">不保存</el-button>
           </div>
           </div>
         </div>
         </div>
         <div class="e_add_content">
         <div class="e_add_content">
@@ -188,21 +188,33 @@
                   <!-- @click="updateF(item.id, item.name, 1)" -->
                   <!-- @click="updateF(item.id, item.name, 1)" -->
                 </div>
                 </div>
                 <div v-else>
                 <div v-else>
-                  <textarea rows="2" v-autoHeight="30" v-model="evaObject.fName1" class="binfo_textarea"
-                    @change="noInput(item.id, evaObject.fName1, 1)"></textarea>
+                  <textarea
+                    rows="2"
+                    v-autoHeight="30"
+                    v-model="evaObject.fName1"
+                    class="binfo_textarea"
+                    @change="noInput(item.id, evaObject.fName1, 1)"
+                  ></textarea>
                 </div>
                 </div>
                 <img
                 <img
-                  style="width: 24px;"
+                  style="width: 24px"
                   src="../../assets/delete.png"
                   src="../../assets/delete.png"
                   @click="deleteF(item.id)"
                   @click="deleteF(item.id)"
                   alt
                   alt
                 />
                 />
               </div>
               </div>
               <div class="e_add_input">
               <div class="e_add_input">
-                <textarea rows="2" v-autoHeight="30" v-model="evaObject.fName" class="binfo_textarea" placeholder="请添加内容.." @focus="setDetail(1)"></textarea>
+                <textarea
+                  rows="2"
+                  v-autoHeight="30"
+                  v-model="evaObject.fName"
+                  class="binfo_textarea"
+                  placeholder="请添加内容.."
+                  @focus="setDetail(1)"
+                ></textarea>
                 <img
                 <img
                   src="../../assets/icon/new/addInput.png"
                   src="../../assets/icon/new/addInput.png"
-                   @click="addInputName(1)"
+                  @click="addInputName(1)"
                   alt
                   alt
                 />
                 />
               </div>
               </div>
@@ -272,21 +284,33 @@
                   />
                   />
                 </div>
                 </div>
                 <div v-else>
                 <div v-else>
-                  <textarea rows="2" v-autoHeight="30" v-model="evaObject.sName1" class="binfo_textarea"
-                    @change="noInput(item.id, evaObject.sName1, 2)"></textarea>
+                  <textarea
+                    rows="2"
+                    v-autoHeight="30"
+                    v-model="evaObject.sName1"
+                    class="binfo_textarea"
+                    @change="noInput(item.id, evaObject.sName1, 2)"
+                  ></textarea>
                 </div>
                 </div>
                 <img
                 <img
-                  style="width: 24px;"
+                  style="width: 24px"
                   src="../../assets/delete.png"
                   src="../../assets/delete.png"
                   @click="deleteS(item.id)"
                   @click="deleteS(item.id)"
                   alt
                   alt
                 />
                 />
               </div>
               </div>
               <div class="e_add_input" v-if="fid != ''">
               <div class="e_add_input" v-if="fid != ''">
-                <textarea rows="2" v-autoHeight="30" v-model="evaObject.sName" class="binfo_textarea" placeholder="请添加内容.." @focus="setDetail(2)"></textarea>
+                <textarea
+                  rows="2"
+                  v-autoHeight="30"
+                  v-model="evaObject.sName"
+                  class="binfo_textarea"
+                  placeholder="请添加内容.."
+                  @focus="setDetail(2)"
+                ></textarea>
                 <img
                 <img
                   src="../../assets/icon/new/addInput.png"
                   src="../../assets/icon/new/addInput.png"
-                   @click="addInputName(2)"
+                  @click="addInputName(2)"
                   alt
                   alt
                 />
                 />
               </div>
               </div>
@@ -358,21 +382,33 @@
                   />
                   />
                 </div>
                 </div>
                 <div v-else>
                 <div v-else>
-                  <textarea rows="2" v-autoHeight="30" v-model="evaObject.tName1" class="binfo_textarea"
-                    @change="noInput(item.id, evaObject.tName1, 3)"></textarea>
+                  <textarea
+                    rows="2"
+                    v-autoHeight="30"
+                    v-model="evaObject.tName1"
+                    class="binfo_textarea"
+                    @change="noInput(item.id, evaObject.tName1, 3)"
+                  ></textarea>
                 </div>
                 </div>
                 <img
                 <img
-                  style="width: 24px;"
+                  style="width: 24px"
                   src="../../assets/delete.png"
                   src="../../assets/delete.png"
                   @click="deleteT(item.id)"
                   @click="deleteT(item.id)"
                   alt
                   alt
                 />
                 />
               </div>
               </div>
               <div class="e_add_input" v-if="sid != ''">
               <div class="e_add_input" v-if="sid != ''">
-                <textarea rows="2" v-autoHeight="30" v-model="evaObject.tName" class="binfo_textarea" placeholder="请添加内容.." @focus="setDetail(3)"></textarea>
+                <textarea
+                  rows="2"
+                  v-autoHeight="30"
+                  v-model="evaObject.tName"
+                  class="binfo_textarea"
+                  placeholder="请添加内容.."
+                  @focus="setDetail(3)"
+                ></textarea>
                 <img
                 <img
                   src="../../assets/icon/new/addInput.png"
                   src="../../assets/icon/new/addInput.png"
-                   @click="addInputName(3)"
+                  @click="addInputName(3)"
                   alt
                   alt
                 />
                 />
               </div>
               </div>
@@ -439,6 +475,38 @@
         <!-- <el-button @click="dialogVisible = false">关 闭</el-button> -->
         <!-- <el-button @click="dialogVisible = false">关 闭</el-button> -->
       </span>
       </span>
     </el-dialog>
     </el-dialog>
+    <el-dialog
+      title="选择目标模板"
+      :visible.sync="temDialogVisible"
+      :append-to-body="true"
+      width="600px"
+      :before-close="handleClose"
+      class="look_evaTem"
+    >
+      <div class="evaTemBox">
+        <div
+          v-for="(item, index) in templateArray"
+          :key="index"
+          class="evaTemItem"
+          @click="chooseEva(item.id)"
+        >
+          <div class="evaItem">
+            <div class="evaItemImg">
+              <img src="../../assets/icon/new/evaTemItem.png" alt="" />
+            </div>
+            <div class="evaItemTitle">{{ item.title }}</div>
+          </div>
+          <div v-if="cEvaId == item.id" class="evaIsChoose">
+            <img src="../../assets/icon/new/evaIsChoose.png" alt="" />
+          </div>
+          <div class="evaNoChoose" v-else></div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeEvaTem">取 消</el-button>
+        <el-button @click="addEvaByTem" type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
     <el-dialog
     <el-dialog
       title="添加子级"
       title="添加子级"
       :visible.sync="dialogVisible3"
       :visible.sync="dialogVisible3"
@@ -526,6 +594,7 @@ export default {
       dialogVisible2: false,
       dialogVisible2: false,
       dialogVisible3: false,
       dialogVisible3: false,
       dialogVisible4: false,
       dialogVisible4: false,
+      temDialogVisible: false,
       userid: this.$route.query.userid,
       userid: this.$route.query.userid,
       oid: this.$route.query.oid,
       oid: this.$route.query.oid,
       eTitle: "",
       eTitle: "",
@@ -541,6 +610,7 @@ export default {
       type: 1,
       type: 1,
       sn: "",
       sn: "",
       dataArray: [],
       dataArray: [],
+      templateArray: [],
       update: false,
       update: false,
       eid: "",
       eid: "",
       typeMode: 1,
       typeMode: 1,
@@ -556,12 +626,13 @@ export default {
         tName1: "",
         tName1: "",
         isTInput: "",
         isTInput: "",
       },
       },
-      isFold:false,
-      isFoldDetail:"",
-      isSold:false,
-      isSoldDetail:"",
-      isTold:false,
-      isToldDetail:"",
+      isFold: false,
+      isFoldDetail: "",
+      isSold: false,
+      isSoldDetail: "",
+      isTold: false,
+      isToldDetail: "",
+      cEvaId: "",
     };
     };
   },
   },
   methods: {
   methods: {
@@ -620,16 +691,16 @@ export default {
       this.type = type;
       this.type = type;
       this.dialogVisible3 = true;
       this.dialogVisible3 = true;
     },
     },
-    setDetail(t){
-      if(t == 1){
+    setDetail(t) {
+      if (t == 1) {
         this.isFold = true;
         this.isFold = true;
-      }else if(t == 2){
+      } else if (t == 2) {
         this.isSold = true;
         this.isSold = true;
-      }else if(t == 3){
+      } else if (t == 3) {
         this.isTold = true;
         this.isTold = true;
       }
       }
     },
     },
-    clearAll(){
+    clearAll() {
       this.dialogVisible = false;
       this.dialogVisible = false;
       this.isFold = false;
       this.isFold = false;
       this.isSold = false;
       this.isSold = false;
@@ -801,11 +872,15 @@ export default {
       //   );
       //   );
       //   return;
       //   return;
       // }
       // }
-      this.$confirm("删除该目标将会同步删除该目标下所有内容,是否继续操作?", "提示", {
-        confirmButtonText: "删除",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
+      this.$confirm(
+        "删除该目标将会同步删除该目标下所有内容,是否继续操作?",
+        "提示",
+        {
+          confirmButtonText: "删除",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
         .then(() => {
         .then(() => {
           if (this.fid == id) {
           if (this.fid == id) {
             this.fid = "";
             this.fid = "";
@@ -826,11 +901,15 @@ export default {
       //   );
       //   );
       //   return;
       //   return;
       // }
       // }
-      this.$confirm("删除该目标将会同步删除该目标下所有内容,是否继续操作?", "提示", {
-        confirmButtonText: "删除",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
+      this.$confirm(
+        "删除该目标将会同步删除该目标下所有内容,是否继续操作?",
+        "提示",
+        {
+          confirmButtonText: "删除",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
         .then(() => {
         .then(() => {
           if (this.sid == id) {
           if (this.sid == id) {
             this.sid = "";
             this.sid = "";
@@ -888,6 +967,30 @@ export default {
           console.error(err);
           console.error(err);
         });
         });
     },
     },
+    addTemplate() {
+      if (this.eTitle == "") {
+        this.$message.error("请填写目标管理标题");
+        return;
+      }
+      let params = {
+        t: this.eTitle,
+        c: JSON.stringify(this.eJson),
+        uid: this.$route.query.userid,
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "addEvaTemplate", params)
+        .then((res) => {
+          this.$message.success("新增模板成功");
+          this.init();
+          this.clearAll();
+          this.getData();
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     updateEJson() {
     updateEJson() {
       if (this.eTitle == "") {
       if (this.eTitle == "") {
         this.$message.error("请填写目标管理标题");
         this.$message.error("请填写目标管理标题");
@@ -1006,6 +1109,35 @@ export default {
       this.clearAll();
       this.clearAll();
       this.dialogVisible = true;
       this.dialogVisible = true;
     },
     },
+    openTemplate() {
+      this.templateArray = [];
+      this.selectEvaTem("1", () => {
+        this.selectEvaTem(this.oid, () => {
+          this.selectEvaTem(this.org);
+        });
+      });
+      this.temDialogVisible = true;
+    },
+    selectEvaTem(oid, callback) {
+      let params = {
+        oid: oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectEvaTemplate", params)
+        .then((res) => {
+          if (res.data[0].length) {
+            this.templateArray = [...res.data[0], ...this.templateArray];
+          }
+          this.templateArray.sort(
+            (a, b) =>
+              new Date(b.createTime).getTime() -
+              new Date(a.createTime).getTime()
+          );
+          this.$forceUpdate();
+          callback ? callback() : "";
+        })
+        .catch((err) => {});
+    },
     checkE(res) {
     checkE(res) {
       this.init();
       this.init();
       this.eJson = JSON.parse(res.content);
       this.eJson = JSON.parse(res.content);
@@ -1021,6 +1153,19 @@ export default {
         this.setMindData();
         this.setMindData();
       }, 0);
       }, 0);
     },
     },
+    checkE1(res) {
+      this.init();
+      this.eJson = JSON.parse(res.chapters);
+      this.eJson1 = JSON.parse(res.chapters);
+      this.eTitle1 = res.title;
+      this.eTitle = res.title;
+      this.eid = res.courseId;
+      this.typeMode = 1;
+      this.$forceUpdate();
+      setTimeout(() => {
+        this.setMindData();
+      }, 0);
+    },
     setMindData() {
     setMindData() {
       this.data.data = [];
       this.data.data = [];
       this.data.data.push({ id: "root", isroot: true, topic: this.eTitle });
       this.data.data.push({ id: "root", isroot: true, topic: this.eTitle });
@@ -1056,6 +1201,22 @@ export default {
       }
       }
       this.$forceUpdate();
       this.$forceUpdate();
     },
     },
+    chooseEva(id) {
+      this.cEvaId = "";
+      this.cEvaId = id;
+    },
+    closeEvaTem() {
+      this.temDialogVisible = false;
+      this.cEvaId = "";
+    },
+    addEvaByTem() {
+      this.temDialogVisible = false;
+      for (var i = 0; i < this.templateArray.length; i++) {
+        if (this.cEvaId == this.templateArray[i].id) {
+          this.checkE1(this.templateArray[i]);
+        }
+      }
+    },
     copyEva(eid) {
     copyEva(eid) {
       let params = [
       let params = [
         {
         {
@@ -1107,6 +1268,23 @@ export default {
   background: #e6eaf0;
   background: #e6eaf0;
 }
 }
 
 
+.look_evaTem >>> .el-dialog {
+  border-radius: 5px;
+}
+
+.look_evaTem >>> .el-dialog__header {
+  background: #fff;
+  border-top-left-radius: 5px;
+  border-top-right-radius: 5px;
+}
+
+.look_evaTem >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #000;
+}
+.look_evaTem >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #000;
+}
+
 .tips_diy >>> .el-dialog__body,
 .tips_diy >>> .el-dialog__body,
 .tips_diy >>> .el-dialog__footer {
 .tips_diy >>> .el-dialog__footer {
   background: #fff;
   background: #fff;
@@ -1257,7 +1435,7 @@ export default {
 .e_add_input > .el-button {
 .e_add_input > .el-button {
   margin-left: 10px;
   margin-left: 10px;
 }
 }
-.e_add_input>img{
+.e_add_input > img {
   width: 35px;
   width: 35px;
   height: 35px;
   height: 35px;
   margin: 0 5px;
   margin: 0 5px;
@@ -1404,7 +1582,7 @@ export default {
   height: 100% !important;
   height: 100% !important;
   margin: 0 auto !important;
   margin: 0 auto !important;
 }
 }
-.binfo_textarea{
+.binfo_textarea {
   width: 100%;
   width: 100%;
   margin: 0;
   margin: 0;
   padding: 12px 14px;
   padding: 12px 14px;
@@ -1418,13 +1596,13 @@ export default {
   background: #fff;
   background: #fff;
   font-size: 16px;
   font-size: 16px;
   resize: none;
   resize: none;
-  font-family: 'Microsoft YaHei';
+  font-family: "Microsoft YaHei";
   min-height: 48px;
   min-height: 48px;
-  border: 1.5px solid #CAD1DC;
+  border: 1.5px solid #cad1dc;
 }
 }
 
 
 .binfo_textarea:focus-visible {
 .binfo_textarea:focus-visible {
-  border: 1.5px solid #3681FC !important;
+  border: 1.5px solid #3681fc !important;
 }
 }
 
 
 .binfo_textarea::-webkit-scrollbar {
 .binfo_textarea::-webkit-scrollbar {
@@ -1447,7 +1625,84 @@ export default {
   background-color: rgba(0, 0, 0, 0.1);
   background-color: rgba(0, 0, 0, 0.1);
 }
 }
 
 
-.text_tooltip2{
+.text_tooltip2 {
   max-width: 400px;
   max-width: 400px;
 }
 }
+
+.evaTemBox {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  align-items: center;
+  width: 100%;
+}
+
+.evaTemItem {
+  width: 100px;
+  height: 100px;
+  background: #f0f4fa;
+  border-radius: 6px;
+  border: 1px solid #cad1dc;
+  cursor: pointer;
+  position: relative;
+  margin: 0 10px 10px 0;
+}
+
+.evaItem {
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+  width: 100%;
+  height: 100%;
+  justify-content: center;
+}
+
+.evaItemImg {
+  width: 30px;
+  height: 30px;
+  min-width: 30px;
+  min-height: 30px;
+}
+
+.evaItemImg > img {
+  width: 100%;
+  height: 100%;
+}
+
+.evaItemTitle {
+  margin-top: 10px;
+  max-width: 85px;
+  text-align: center;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  word-break: break-word;
+}
+
+.evaNoChoose {
+  position: absolute;
+  top: 5px;
+  right: 5px;
+  width: 15px;
+  height: 15px;
+  background: #ffffff;
+  border: 1px solid #3681fc;
+  border-radius: 50%;
+  cursor: pointer;
+}
+
+.evaIsChoose {
+  position: absolute;
+  top: 5px;
+  right: 5px;
+  width: 15px;
+  height: 15px;
+  cursor: pointer;
+}
+
+.evaIsChoose > img {
+  width: 100%;
+  height: 100%;
+}
 </style>
 </style>