瀏覽代碼

Merge remote-tracking branch 'origin/master'

WANG 6 年之前
父節點
當前提交
fb5af1907e

+ 3 - 8
src/modules/basic/view/campus.vue

@@ -348,7 +348,6 @@ export default {
   name: "Campus",
   data() {
     return {
-      isSuperAdmin: false,
       paginationShow: false,
       rootOrgList: [],
       formSearch: {
@@ -412,6 +411,9 @@ export default {
     },
     noBatchSelected() {
       return this.selectedOrgIds.length === 0;
+    },
+    isSuperAdmin() {
+      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
     }
   },
   methods: {
@@ -701,13 +703,6 @@ export default {
         this.user.token;
     },
     init() {
-      for (let role of this.user.roleList) {
-        if (role.roleCode == "SUPER_ADMIN") {
-          this.isSuperAdmin = true;
-          break;
-        }
-      }
-
       this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
         this.rootOrgList = response.data;
         if (this.formSearch.parentId === null)

+ 86 - 50
src/modules/basic/view/role_privilege_settings.vue

@@ -71,9 +71,9 @@
             ref="tree"
             highlight-current
             :check-strictly="true"
-            :default-expanded-keys="[-1]"
+            :default-expanded-keys="checkedKeys"
             :default-checked-keys="checkedKeys"
-            @check-change="treeChange"
+            @check="nodeCheck"
             :expand-on-click-node="true"
           />
         </div>
@@ -90,8 +90,6 @@ export default {
   name: "RolePrivilegeSettings",
   data() {
     return {
-      completed: false,
-      isSuperAdmin: false,
       form: {
         orgId: null,
         roleId: null,
@@ -111,18 +109,14 @@ export default {
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: state => state.user }),
+    isSuperAdmin() {
+      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+    }
   },
   methods: {
     /*初始化*/
     init() {
-      for (let role of this.user.roleList) {
-        if (role.roleCode == "SUPER_ADMIN") {
-          this.isSuperAdmin = true;
-          break;
-        }
-      }
-
       var url1 = CORE_API + "/org/getRootOrgList";
       var url2 =
         CORE_API + "/rolePrivilege/getRoles?includeSuperAdmin=" + false;
@@ -167,15 +161,10 @@ export default {
         console.log("initTree(). checkedKeys:", resp2.data);
         this.treeData = resp1.data.children;
         this.checkedKeys = resp2.data;
-        this.completed = true;
       });
     },
     /*change事件*/
     change() {
-      if (!this.completed) {
-        return;
-      }
-
       this.initTree(
         this.form.orgId,
         this.form.roleId,
@@ -183,10 +172,6 @@ export default {
       );
     },
     rootOrgChanged() {
-      if (!this.completed) {
-        return;
-      }
-
       var url =
         CORE_API +
         "/rolePrivilege/getRoles?includeSuperAdmin=false&rootOrgId=" +
@@ -196,45 +181,96 @@ export default {
         if (0 < this.roleList.length) {
           this.form.roleId = this.roleList[0].roleId;
         }
-      });
 
-      this.initTree(
-        this.form.orgId,
-        this.form.roleId,
-        this.form.privilegeGroupId
-      );
+        this.initTree(
+          this.form.orgId,
+          this.form.roleId,
+          this.form.privilegeGroupId
+        );
+      });
     },
-    treeChange(node, checked) {
-      console.log("[tree change] node:", node);
-      if (checked && !this.checkedKeys.includes(node.id)) {
-        this.checkedKeys.push(node.id);
-      }
-      if (!checked && this.checkedKeys.includes(node.id)) {
-        this.checkedKeys = this.checkedKeys.filter(v => v != node.id);
-      }
+    nodeCheck({ id, parentId, children }, { checkedKeys }) {
+      // console.log("[tree change] node:", node);
 
-      var checkChildren = this.uncheckChildren_nodeId != node.id;
-      this.uncheckChildren_nodeId = null;
+      const checked = checkedKeys.includes(id);
+      // 当前node的状态
       if (checked) {
-        if (node.parentId) {
-          this.uncheckChildren_nodeId = node.parentId;
-          this.$refs.tree.setChecked(node.parentId, true, false);
-        }
-        if (checkChildren) {
-          if (node.children && 0 < node.children.length) {
-            for (const cur of node.children) {
-              this.$refs.tree.setChecked(cur.id, true, false);
-            }
+        this.checkedKeys = [...this.checkedKeys, id];
+      } else {
+        this.checkedKeys = this.checkedKeys.filter(id0 => id0 !== id);
+      }
+      // 选中状态下对子节点的影响:递归选中所有子孙节点
+      if (checked && children) {
+        this.checkedKeys = [...this.checkedKeys, ...children.map(v => v.id)];
+        for (const child of children) {
+          this.checkedKeys = [...this.checkedKeys, child.id];
+          for (const child of child.children || []) {
+            // 树最多只有三个层级,这里就不写递归了
+            this.checkedKeys = [...this.checkedKeys, child.id];
           }
         }
-      } else {
-        if (node.children && 0 < node.children.length) {
-          for (const cur of node.children) {
-            this.$refs.tree.setChecked(cur.id, false, false);
+      }
+
+      // 选中状态下对父节点的影响:递归选中所有父辈节点
+      if (checked && parentId) {
+        this.checkedKeys = [...this.checkedKeys, parentId];
+        const parent1 = this.$refs.tree.getNode(parentId).data;
+        // this.$refs.tree.setChecked(parentId, true, false);
+        if (parent1.parentId) {
+          // 第二个父节点
+          this.checkedKeys = [...this.checkedKeys, parent1.parentId];
+          // this.$refs.tree.setChecked(parent1.parentId, true, false);
+        }
+      }
+
+      // 取消选中状态下对子节点的影响:递归取消选中所有子孙节点
+      if (!checked && children) {
+        this.checkedKeys = this.checkedKeys.filter(id0 => id0 !== id);
+        // console.log(this.checkedKeys);
+        for (const child of children) {
+          this.checkedKeys = this.checkedKeys.filter(id => id !== child.id);
+          // console.log(this.checkedKeys);
+          for (const child of child.children || []) {
+            // 树最多只有三个层级,这里就不写递归了
+            this.checkedKeys = this.checkedKeys.filter(id => id !== child.id);
           }
         }
       }
 
+      this.checkedKeys = [...new Set(this.checkedKeys)];
+      this.$refs.tree.setCheckedKeys(this.checkedKeys);
+
+      // 取消选中状态下对父节点的影响:无影响
+
+      // if (checked && !this.checkedKeys.includes(node.id)) {
+      //   this.checkedKeys.push(node.id);
+      // }
+      // if (!checked && this.checkedKeys.includes(node.id)) {
+      //   this.checkedKeys = this.checkedKeys.filter(v => v != node.id);
+      // }
+
+      // var checkChildren = this.uncheckChildren_nodeId != node.id;
+      // this.uncheckChildren_nodeId = null;
+      // if (checked) {
+      //   if (node.parentId) {
+      //     this.uncheckChildren_nodeId = node.parentId;
+      //     this.$refs.tree.setChecked(node.parentId, true, false);
+      //   }
+      //   if (checkChildren) {
+      //     if (node.children && 0 < node.children.length) {
+      //       for (const cur of node.children) {
+      //         this.$refs.tree.setChecked(cur.id, true, false);
+      //       }
+      //     }
+      //   }
+      // } else {
+      //   if (node.children && 0 < node.children.length) {
+      //     for (const cur of node.children) {
+      //       this.$refs.tree.setChecked(cur.id, false, false);
+      //     }
+      //   }
+      // }
+
       this.treeChanged = true;
     },
     save() {

+ 3 - 8
src/modules/basic/view/user.vue

@@ -493,7 +493,6 @@ export default {
     return {
       loading: false,
       orgLoading4InsertOrUpdate: false,
-      isSuperAdmin: false,
       roleList4Search: [],
       roleList4InsertOrUpdate: [],
       rootOrgList: [],
@@ -592,6 +591,9 @@ export default {
       return this.roleList4InsertOrUpdate.filter(
         item => item.roleCode != "SUPER_ADMIN"
       );
+    },
+    isSuperAdmin() {
+      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
     }
   },
   methods: {
@@ -986,13 +988,6 @@ export default {
 
     /*初始化*/
     init() {
-      for (let role of this.user.roleList) {
-        if (role.roleCode == "SUPER_ADMIN") {
-          this.isSuperAdmin = true;
-          break;
-        }
-      }
-
       this.searchForm.rootOrgId = this.user.rootOrgId;
       this.userForm.rootOrgId = this.user.rootOrgId;
 

+ 1 - 5
src/modules/examwork/view/examStudent.vue

@@ -871,7 +871,6 @@ export default {
         update_examStudent: false,
         change_exam_student_availability: false
       },
-      isSuperAdmin: false,
       pureLC: false,
       lc_id: null,
       lc_code: null,
@@ -1670,10 +1669,7 @@ export default {
     },
     init() {
       for (let role of this.user.roleList) {
-        if (role.roleCode == "SUPER_ADMIN") {
-          this.isSuperAdmin = true;
-          continue;
-        } else if (role.roleCode == "LC_USER") {
+        if (role.roleCode == "LC_USER") {
           this.pureLC = true;
           continue;
         }

+ 3 - 8
src/modules/examwork/view/student.vue

@@ -489,7 +489,6 @@ export default {
         unbind_student_code: false,
         unbind_security_phone: false
       },
-      isSuperAdmin: false,
       rootOrgList: null,
       stuExamLoading: false,
       button: {},
@@ -566,6 +565,9 @@ export default {
     },
     noBatchSelected() {
       return this.selectedStuIds.length === 0;
+    },
+    isSuperAdmin() {
+      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
     }
   },
   methods: {
@@ -910,13 +912,6 @@ export default {
     init() {
       this.initPrivileges();
 
-      for (let role of this.user.roleList) {
-        if (role.roleCode == "SUPER_ADMIN") {
-          this.isSuperAdmin = true;
-          break;
-        }
-      }
-
       var url = CORE_API + "/org/getRootOrgList";
 
       this.$httpWithMsg.get(url).then(response => {

+ 1 - 2
src/modules/marking/views/MarkPaperCheck.vue

@@ -368,8 +368,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning",
-          duration: 1000
+          type: "warning"
         });
         return false;
       }

+ 11 - 33
src/modules/marking/views/MarkWorkOverview.vue

@@ -135,7 +135,6 @@
           </el-table>
           <div class="page pull-right">
             <el-pagination
-              background
               @current-change="handleSettingCurrentChange"
               @size-change="handleSizeChange"
               :current-page="currentPage"
@@ -384,47 +383,21 @@ export default {
       this.pageSize = val;
       this.searchSetting();
     },
-    pagingSetting() {
-      var start = (this.currentPage - 1) * this.pageSize;
-      var end =
-        this.currentPage * this.pageSize < this.total
-          ? this.currentPage * this.pageSize
-          : this.total;
-      var tempData = [];
-      console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
-      for (let i = start; i < end; i++) {
-        tempData.push(this.tableData[i]);
-      }
-      this.tableData = tempData;
-    },
-    initSetting() {
-      this.loading = true;
-      this.$http
-        .get(
-          MARKING_API +
-            "/markCourses/all/0/" +
-            this.pageSize +
-            "?workId=" +
-            this.workId
-        )
-        .then(response => {
-          this.tableData = response.data.content;
-          this.total = response.data.totalElements;
-          this.loading = false;
-        });
-    },
     searchSetting() {
       if (!this.markWorkSearchForm.markId) {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning",
-          duration: 1000
+          type: "warning"
         });
         return false;
       }
       this.quertTemp["markId"] = this.markWorkSearchForm.markId;
       this.quertTemp["courseCode"] = this.formSearch.courseCode;
+      this.quertTemp["examId"] = this.examId;
+      this.quertTemp["markWorkName"] = this.markWorkName;
+      this.quertTemp["currentPage"] = this.currentPage;
+      this.quertTemp["pageSize"] = this.pageSize;
       this.loading = true;
       this.$http
         .get(
@@ -585,7 +558,7 @@ export default {
         this.markWorkName = obj.name;
         this.workId = this.markWorkSearchForm.markId;
         this.doPie();
-        this.initSetting();
+        this.searchSetting();
         this.getCourses();
       }
     },
@@ -611,7 +584,12 @@ export default {
             }
           }
         }
+        this.currentPage = parseInt(formData.currentPage);
+        this.pageSize = parseInt(formData.pageSize);
+        this.examId = parseInt(formData.examId);
+        this.markWorkName = formData.markWorkName;
         this.searchSetting();
+        this.getCourses();
       }
     }
   },

+ 1 - 2
src/modules/marking/views/Marker.vue

@@ -185,8 +185,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning",
-          duration: 1000
+          type: "warning"
         });
         return false;
       }

+ 5 - 6
src/modules/marking/views/Marking.vue

@@ -7,7 +7,7 @@
             <span>课程:{{ task.courseName }}</span>
           </small>
           <small class="marktitle titlefont">
-            <span>试卷编号:{{ task.paperName }}</span>
+            <span>试卷编号:{{ task.basePaperName }}</span>
           </small>
           <small class="marktitle titlefont">
             <span>待评:{{ task.leftCount }}</span>
@@ -144,9 +144,6 @@
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="状态">
-                  <div><span style="margin-left: 10px">已评</span></div>
-                </el-table-column>
                 <el-table-column label="问题卷">
                   <template slot-scope="scope">
                     <div>
@@ -201,7 +198,7 @@
             </span>
           </small>
           <small class="marktitle titlefont marksign">
-            <el-button type="success" @click="backIndex" size="small">
+            <el-button type="success" @click="backIndex" size="small" icon="el-icon-arrow-left">
               <!-- <v-icon name="sign-out-alt" scale="0.5"/> -->
               <span class="titlefont">返回</span>
             </el-button>
@@ -495,8 +492,9 @@ export default {
           if (!response.data) {
             self.$notify({
               message: "该任务下试卷已评完,如有剩余任务将自动切换任务",
-              type: "info"
+              type: "warning"
             });
+            this.resultItems.splice(0, this.resultItems.length);
             self.studentPaper = { id: "" };
             self.paperMark = false;
             return false;
@@ -586,6 +584,7 @@ export default {
       this.answerHtml = null;
       //试卷全部评完且回评时不继续获取试卷
       if (this.backMark && this.allMarked) {
+        this.$loading().close();
         return;
       }
       this.initMarkItem();

+ 3 - 3
src/modules/marking/views/TpScoreBoard.vue

@@ -349,8 +349,7 @@ export default {
       this.$message({
         showClose: true,
         message: "当前选择题目为" + title,
-        type: "info",
-        duration: 1000
+        type: "warning"
       });
     },
     checkSignScore(score) {
@@ -516,8 +515,9 @@ export default {
             resultItem.markItem.orders +
             ")";
           this.$notify({
+            title: "警告",
             message: itemName + "没有打分,请打分",
-            type: "error"
+            type: "warning"
           });
           return false;
         } else {

+ 1 - 1
src/modules/oe/views/captureDetail.vue

@@ -1,7 +1,7 @@
 <template>
   <el-container>
     <el-header> <LinkTitlesCustom :currentPaths="currentPaths" /> </el-header>
-    <el-main>
+    <el-main style="overflow: unset;">
       <el-row>
         <el-col :span="6">
           <img :src="studentBasePhotoPath" alt width="180" />

+ 1 - 1
src/modules/oe/views/examDetail.vue

@@ -271,7 +271,7 @@
                             @click="redoAudit(scope.row.dataId, 'pass')"
                             icon="el-icon-success"
                           >
-                            通 &nbsp;&nbsp;过
+                            通&nbsp;&nbsp;过
                           </el-button>
                         </el-dropdown-item>
                         <el-dropdown-item>

+ 1 - 3
src/modules/oe/views/examScheduling.vue

@@ -169,9 +169,7 @@
             </el-table-column>
             <el-table-column sortable label="完成状态" width="120">
               <template slot-scope="scope">
-                <span>
-                  <el-tag> {{ scope.row.finishedStatus }} </el-tag>
-                </span>
+                <span> {{ scope.row.finishedStatus }} </span>
               </template>
             </el-table-column>
             <el-table-column fixed="right" label="操作" width="120">

+ 0 - 11
src/modules/portal/views/home/Home.vue

@@ -202,17 +202,6 @@ export default {
     resetForm() {
       this.$refs.passForm.resetFields();
     },
-    isSuperAdmin() {
-      if (!this.user.roleList) {
-        return false;
-      }
-      for (let role of this.user.roleList) {
-        if (role.roleCode == "SUPER_ADMIN") {
-          return true;
-        }
-      }
-      return false;
-    },
     logout() {
       this.$http
         .post(CORE_API + "/auth/logout")

+ 1 - 1
src/modules/questions/views/EditPaper.vue

@@ -52,7 +52,7 @@
             size="small"
             ><i class="el-icon-upload2"></i> 上传音频文件
           </el-button>
-          <el-button @click="back" size="small"
+          <el-button @click="back" size="small" type="primary"
             ><i class="el-icon-arrow-left"></i> 返回</el-button
           >
         </div>

+ 1 - 1
src/modules/questions/views/ExtractPaperRule.vue

@@ -330,7 +330,7 @@ export default {
       if (!this.formSearch.examId) {
         this.$notify({
           message: "请选择考试",
-          type: "info"
+          type: "warning"
         });
         return false;
       }

+ 6 - 1
src/modules/questions/views/GenPaper.vue

@@ -418,7 +418,12 @@ export default {
       var courseNo = this.formSearch.courseNo;
       this.getCourseName(courseNo);
       var level = this.formSearch.level;
-      if (!courseNo) {
+      if (!level) {
+        this.$notify({
+          message: "请选择课程层次",
+          type: "error"
+        });
+      } else if (!courseNo) {
         this.$notify({
           message: "请选择课程",
           type: "error"

+ 47 - 24
src/modules/questions/views/InsertPaperStructureInfo.vue

@@ -43,9 +43,12 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="题目数量" prop="count">
-              <el-button @click="propertyDialog = true">
-                {{ paperUnitForm.count }}
-              </el-button>
+              <el-input 
+                class="search_width"
+                v-model.number="paperUnitForm.count" 
+                :disabled="true">
+              </el-input>
+              <el-button @click="propertyDialog = true" icon="el-icon-plus"></el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -883,7 +886,7 @@ export default {
           }
           unitStruct.id = maxId + 1;
           this.unitStructs.push(unitStruct);
-          this.resetForm();
+          this.resetForm(formData);
           this.setUnits();
           sessionStorage.setItem(
             "paperStruct",
@@ -928,26 +931,28 @@ export default {
       });
     },
     //重置
-    resetForm() {
-      this.paperUnitForm = {
-        id: "",
-        questionType: "",
-        count: 0,
-        score: "",
-        totalScore: "",
-        quesNames: [],
-        publicSimple: 0,
-        publicMedium: 0,
-        publicDifficulty: 0,
-        noPublicSimple: 0,
-        noPublicMedium: 0,
-        noPublicDifficulty: 0,
-        publicSum: 0,
-        noPublicSum: 0,
-        simpleSum: 0,
-        mediumSum: 0,
-        difficultySum: 0
-      };
+    resetForm(formData) {
+      this.$refs[formData].resetFields();
+      //this.$refs[formData].clearValidate();
+      // this.paperUnitForm = {
+      //   id: "",
+      //   questionType: "",
+      //   count: 0,
+      //   score: "",
+      //   totalScore: "",
+      //   quesNames: [],
+      //   publicSimple: 0,
+      //   publicMedium: 0,
+      //   publicDifficulty: 0,
+      //   noPublicSimple: 0,
+      //   noPublicMedium: 0,
+      //   noPublicDifficulty: 0,
+      //   publicSum: 0,
+      //   noPublicSum: 0,
+      //   simpleSum: 0,
+      //   mediumSum: 0,
+      //   difficultySum: 0
+      // };
     },
     //返回
     back() {
@@ -1119,6 +1124,24 @@ export default {
         paperUnitForm.totalScore =
           (paperUnitForm.score * 1000 * paperUnitForm.count) / 1000;
       }, 5);
+      if(this.clearCheck(paperUnitForm.count)){
+        this.$refs['paperUnitForm'].clearValidate('count');
+      }
+    },
+    clearCheck(value){
+      var reg = /^\d+(?=\.{0,1}\d+$|$)/;
+      if (!value) {
+        return true;
+      }
+      if (!reg.test(value)) {
+        return true;
+      } else {
+        if (value < 0) {
+          return true;
+        } else {
+          return false;
+        }
+      }
     }
   },
   computed: {

+ 9 - 1
src/modules/questions/views/InsertPaperTitle.vue

@@ -199,6 +199,8 @@ export default {
         .get(QUESTION_API + "/paperDetail/paper/" + this.paperTitleForm.paperId)
         .then(response => {
           this.detailsData = response.data;
+          console.log("response.data:", response.data);
+          console.log("this.detailsData:", this.detailsData);
           for (var i = 0; i < this.detailsData.length; i++) {
             if (!this.detailsData[i].name) {
               this.detailsData[i].name = "默认大题";
@@ -234,7 +236,6 @@ export default {
                 this.paperForm.name
             )
             .then(response => {
-              console.log("需要查到的课程id:", response);
               var paperId = response.data.paper.id;
               this.$http
                 .get(
@@ -246,6 +247,7 @@ export default {
                   this.tableData = response.data.content;
                   this.paperTitleForm.paperDetailId = "";
                   this.paperTitleForm.paperId = paperId;
+                  this.searchPaperDetail();
                 });
               this.paperDialog = false;
             })
@@ -303,6 +305,12 @@ export default {
       }
     },
     paperDetailDisable() {
+      console.log(
+        "this.paperTitleForm.courseNo:",
+        this.paperTitleForm.courseNo
+      );
+      console.log("this.paperTitleForm.paperId:", this.paperTitleForm.paperId);
+      console.log("this.detailsData.length:", this.detailsData.length);
       if (
         this.paperTitleForm.courseNo &&
         this.paperTitleForm.paperId &&

+ 0 - 1
src/modules/questions/views/SelectQuestion.vue

@@ -73,7 +73,6 @@
                 size="small"
                 type="primary"
                 icon="el-icon-arrow-left"
-                :plain="true"
                 @click="back()"
                 >返回</el-button
               >