Browse Source

样式修改及添加树状图

zengyicheng 2 years ago
parent
commit
457a0c9f2a
2 changed files with 196 additions and 17599 deletions
  1. 1 17519
      package-lock.json
  2. 195 80
      src/components/pages/addCourse.vue

File diff suppressed because it is too large
+ 1 - 17519
package-lock.json


+ 195 - 80
src/components/pages/addCourse.vue

@@ -249,7 +249,7 @@
               <div style="width: 95%; margin: 15px auto">
                 <div
                   style="
-                    width: 55%;
+                    width: 50.4%;
                     display: flex;
                     flex-direction: row;
                     flex-wrap: nowrap;
@@ -327,17 +327,17 @@
                         <div class="type_content">
                           <span
                             :class="{ active: typeMode == 1 }"
-                            @click="typeMode = 1"
+                            @click="OtherMb(1)"
                             >目标树</span
                           >
                           <span
                             :class="{ active: typeMode == 2 }"
-                            @click="typeMode = 2"
+                            @click="OtherMb(2)"
                             >目标罗盘</span
                           >
                           <span
                             :class="{ active: typeMode == 3 }"
-                            @click="typeMode = 3"
+                            @click="OtherMb(3)"
                             >目标看板</span
                           >
                         </div>
@@ -1391,49 +1391,129 @@
                         <div class="line" style="width: 90%"></div>
                       </div>
                     </div>
-                    <div
-                      v-if="itemTask.eList && itemTask.eList.length"
-                      class="elist_input"
-                    >
-                      <div
-                        v-for="(eItem, eIndex) in itemTask.eList"
-                        :key="eIndex"
-                        class="elist_input_box"
-                      >
-                        <span>评价名称:</span>
-                        <input
-                          type="input"
-                          v-model="itemTask.eList[eIndex].value"
-                          placeholder="填写评价名称"
-                        />
-                        <span>评星等级:</span>
-                        <el-rate
-                          v-model="itemTask.eList[eIndex].score"
-                          @change="setEListStar()"
-                          disabled
-                        ></el-rate>
+                    <div class="mbCss">
+                      <div class="pjCss">
                         <div
-                          class="remove"
-                          @click="deletEList(unitIndex, itemTaskIndex, eIndex)"
-                        ></div>
-                        <div class="elist_inptu_text">
-                          <span>评价描述:</span>
-                          <input
-                            type="input"
-                            v-model="itemTask.eList[eIndex].detail"
-                            placeholder="填写评价描述"
-                          />
+                          v-if="itemTask.eList && itemTask.eList.length"
+                          class="elist_input"
+                        >
+                          <div
+                            v-for="(eItem, eIndex) in itemTask.eList"
+                            :key="eIndex"
+                            class="elist_input_box"
+                          >
+                            <span>评价名称:</span>
+                            <input
+                              type="input"
+                              v-model="itemTask.eList[eIndex].value"
+                              placeholder="填写评价名称"
+                            />
+                            <span>评星等级:</span>
+                            <el-rate
+                              v-model="itemTask.eList[eIndex].score"
+                              @change="setEListStar()"
+                              disabled
+                            ></el-rate>
+                            <div
+                              class="remove"
+                              @click="
+                                deletEList(unitIndex, itemTaskIndex, eIndex)
+                              "
+                            ></div>
+                            <div class="elist_inptu_text">
+                              <span>评价描述:</span>
+                              <input
+                                type="input"
+                                v-model="itemTask.eList[eIndex].detail"
+                                placeholder="填写评价描述"
+                              />
+                            </div>
+                          </div>
+                        </div>
+                        <div
+                          class="addToolFun"
+                          @click="addEList(unitIndex, itemTaskIndex)"
+                          style="margin: 35px 35px 0 0"
+                        >
+                          <div class="addToolImg">
+                            <img src="../../assets/icon/add.png" alt />
+                          </div>
+                          <div>添加</div>
                         </div>
                       </div>
-                    </div>
-                    <div
-                      class="addToolFun"
-                      @click="addEList(unitIndex, itemTaskIndex)"
-                    >
-                      <div class="addToolImg">
-                        <img src="../../assets/icon/add.png" alt />
+                      <div
+                        v-if="evalua != ''"
+                        style="
+                          border: 1px solid #e5e5e5;
+                          width: 750px;
+                          margin-top: 20px;
+                          box-shadow: 3px 1px 15px 3px #e0e0e0;
+                        "
+                      >
+                        <div class="e_add_top">
+                          <div class="e_add_title">
+                            <span>当前使用评价体系</span>
+                            <span>{{ eTitle }} </span>
+                            <img
+                              src="../../assets/line.png"
+                              class="cru_line"
+                              style="
+                                width: 125px;
+                                height: 20px;
+                                bottom: -10px;
+                                left: 155px;
+                              "
+                            />
+                            <!-- <el-input
+                        v-model="eTitle"
+                        placeholder="请输入名称"
+                        @change="setMindData"
+                      ></el-input> -->
+                          </div>
+                        </div>
+                        <div class="e_add_content">
+                          <div class="e_add_list_pbox">
+                            <div class="e_add_list_pbox_title">
+                              <span class="type_title">切换模式</span>
+                              <div class="type_content">
+                                <span
+                                  :class="{ active: typeMode == 1 }"
+                                  @click="OtherMb(1)"
+                                  >目标树</span
+                                >
+                                <span
+                                  :class="{ active: typeMode == 2 }"
+                                  @click="OtherMb(2)"
+                                  >目标罗盘</span
+                                >
+                                <span
+                                  :class="{ active: typeMode == 3 }"
+                                  @click="OtherMb(3)"
+                                  >目标看板</span
+                                >
+                              </div>
+                            </div>
+                            <div class="e_add_list_pbox_content">
+                              <Mind
+                                :showBar="false"
+                                :mindData="data"
+                                v-show="typeMode == 1"
+                              ></Mind>
+                              <Sunburst
+                                :Josn="eJson"
+                                :num="eJSONNum"
+                                v-if="typeMode == 2"
+                              ></Sunburst>
+                              <SeeBoard
+                                :Josn="eJson"
+                                :num="eJSONNum"
+                                :ename="eTitle"
+                                v-if="typeMode == 3"
+                              ></SeeBoard>
+                            </div>
+                          </div>
+                        </div>
                       </div>
-                      <div>添加</div>
                     </div>
                   </div>
                   <div class="funBlock" style="padding: 0">
@@ -2223,45 +2303,45 @@ export default {
   },
   watch: {
     unitIndex(newValue, oldValue) {
-      if(this.cid != ""){
+      if (this.cid != "") {
         let _unitIndex = oldValue;
-      for (
-        var j = 0;
-        j < this.unitJson[_unitIndex].chapterInfo[0].taskJson.length;
-        j++
-      ) {
-        if (this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList) {
-          this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
-            this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList.filter(
-              (ele) => {
-                return ele.value != "";
-              }
-            );
+        for (
+          var j = 0;
+          j < this.unitJson[_unitIndex].chapterInfo[0].taskJson.length;
+          j++
+        ) {
+          if (this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList) {
+            this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
+              this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList.filter(
+                (ele) => {
+                  return ele.value != "";
+                }
+              );
+          }
         }
+        let params = [
+          {
+            cid: this.cid,
+            chapters: JSON.stringify(this.unitJson).replaceAll(/%/g, "%25"),
+            uid: this.userid,
+            unitIndex: _unitIndex,
+          },
+        ];
+        this.ajax
+          .post(this.$store.state.api + "updateWorkNew4", params)
+          .then((res) => {
+            // this.$message({
+            //   message: "修改成功",
+            //   type: "success",
+            // });
+            // this.courseId = this.cid;
+          })
+          .catch((err) => {
+            this.$message.error("修改失败");
+            console.error(err);
+          });
       }
-      let params = [
-        {
-          cid: this.cid,
-          chapters: JSON.stringify(this.unitJson).replaceAll(/%/g, "%25"),
-          uid: this.userid,
-          unitIndex: _unitIndex,
-        },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "updateWorkNew4", params)
-        .then((res) => {
-          // this.$message({
-          //   message: "修改成功",
-          //   type: "success",
-          // });
-          // this.courseId = this.cid;
-        })
-        .catch((err) => {
-          this.$message.error("修改失败");
-          console.error(err);
-        });
-      }
-    }
+    },
   },
   methods: {
     handleCheckAllChange(val) {
@@ -2360,6 +2440,9 @@ export default {
           this.cTemplate = this.templateC.content;
           this.dialogVisible2 = false;
           this.steps = 3;
+          setTimeout(() => {
+            this.checkEva();
+          }, 1000);
         }
       } else {
         if (s == 1) {
@@ -2372,6 +2455,9 @@ export default {
           this.cTemplate = this.templateC.content;
           this.dialogVisible2 = false;
           this.steps = 3;
+          setTimeout(() => {
+            this.checkEva();
+          }, 1000);
         }
       }
     },
@@ -2380,6 +2466,9 @@ export default {
         if (this.steps == 1) {
           if (this.courseName != "") {
             this.steps = 3;
+            setTimeout(() => {
+              this.checkEva();
+            }, 1000);
           } else {
             this.$message.error("请将信息填写完整");
             return;
@@ -2421,6 +2510,9 @@ export default {
           }
           this.dialogVisible2 = false;
           this.steps++;
+          setTimeout(() => {
+            this.checkEva();
+          }, 1000);
         } else if (this.steps == 3) {
           if (this.cid == "" || this.cid == undefined) {
             if (this.courseName == "") {
@@ -3770,6 +3862,12 @@ export default {
           console.error(err);
         });
     },
+    OtherMb(type) {
+      this.typeMode = type;
+      setTimeout(() => {
+        this.checkEva();
+      }, 0);
+    },
     checkEva() {
       if (this.evalua != "") {
         for (var i = 0; i < this.evaJuri.length; i++) {
@@ -3778,6 +3876,7 @@ export default {
             this.eJson = JSON.parse(this.evaJuri[i].content);
           }
         }
+        this.data.data = [];
         this.$forceUpdate();
         setTimeout(() => {
           this.setMindData();
@@ -5383,7 +5482,6 @@ ol {
   display: flex;
   width: 750px;
   height: 550px;
-  margin-top: 10px;
 }
 .e_add_list {
   background: #fff;
@@ -5533,4 +5631,21 @@ ol {
   width: 100%;
   background: #fff;
 }
+.mbCss {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-content: center;
+  align-items: flex-start;
+  justify-content: flex-start;
+}
+.pjCss {
+  width: 42%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: flex-end;
+  margin-top: 1.5%;
+}
 </style>

Some files were not shown because too many files changed in this diff