Ver Fonte

bug fix

刘洋 há 1 ano atrás
pai
commit
64331132f8

+ 2 - 2
src/modules/paper/components/QuestionGroupStruct.vue

@@ -24,9 +24,9 @@
           :value="item.id"
         ></el-option>
       </el-select> -->
-      <span v-if="useProperty"
+      <!-- <span v-if="useProperty"
         >(一级属性试题数包含一级属性及子属性的总试题数)</span
-      >
+      > -->
     </div>
     <div v-if="!USE_NONE_SET" class="struct-box">
       <div v-if="useClassify" class="struct-folder">

+ 7 - 2
src/modules/question/components/AuditQuestionWait.vue

@@ -113,6 +113,7 @@
       ref="QuestionPreviewDialog"
       :propQuestion="curQuestion"
       :table-data="tableData"
+      @update="updateData"
     ></question-preview-dialog>
   </div>
 </template>
@@ -146,6 +147,10 @@ export default {
     this.getAllList();
   },
   methods: {
+    updateData() {
+      this.getList();
+      // this.getAllList();
+    },
     toPage(page) {
       this.currentPage = page;
       this.getList();
@@ -161,7 +166,7 @@ export default {
       if (!res) return;
       this.dataList = res.data.content;
       this.total = res.data.totalElements;
-      this.$refs.QuestionPreviewDialog.cancel();
+      // this.$refs.QuestionPreviewDialog.cancel();
     },
     async getAllList() {
       const res = await auditQuestionWaitPageListApi({
@@ -170,7 +175,7 @@ export default {
         pageSize: 1000,
       }).catch(() => {});
       if (!res) return;
-      this.tableData = res.data.content;
+      this.tableData = res.data.content || [];
     },
     handleSizeChange(val) {
       this.pageSize = val;

+ 40 - 10
src/modules/question/components/QuestionPreviewLoopDialog.vue

@@ -162,19 +162,20 @@
 <script>
 import QuestionAnswer from "./QuestionAnswer.vue";
 import { auditQuestionApi } from "../api";
+import { cloneDeep } from "lodash";
 export default {
   name: "QuestionPreviewLoopDialog",
   components: { QuestionAnswer },
   computed: {
     prevDisabled() {
-      let id = this.propQuestion.id;
-      return this.tableData.findIndex((item) => item.id == id) == 0;
+      let id = this.question.id;
+      return this.privateTableData.findIndex((item) => item.id == id) == 0;
     },
     nextDisabled() {
-      let id = this.propQuestion.id;
+      let id = this.question.id;
       return (
-        this.tableData.findIndex((item) => item.id == id) ==
-        this.tableData.length - 1
+        this.privateTableData.findIndex((item) => item.id == id) ==
+        this.privateTableData.length - 1
       );
     },
   },
@@ -215,6 +216,7 @@ export default {
           },
         ],
       },
+      privateTableData: [],
     };
   },
   watch: {
@@ -224,22 +226,25 @@ export default {
     modalIsShow(val) {
       val && (this.modalForm.auditRemark = "");
     },
+    tableData(val) {
+      this.privateTableData = cloneDeep(val);
+    },
   },
   methods: {
     toPrev() {
-      let index = this.tableData.findIndex(
+      let index = this.privateTableData.findIndex(
         (item) => item.id == this.question.id
       );
       if (index != -1) {
-        this.question = this.tableData[index - 1];
+        this.question = this.privateTableData[index - 1];
       }
     },
     toNext() {
-      let index = this.tableData.findIndex(
+      let index = this.privateTableData.findIndex(
         (item) => item.id == this.question.id
       );
       if (index != -1) {
-        this.question = this.tableData[index + 1];
+        this.question = this.privateTableData[index + 1];
       }
     },
     cancel() {
@@ -274,8 +279,33 @@ export default {
       if (!res) return;
 
       this.$message.success("操作成功!");
-      this.cancel();
+      this.$emit("update");
+      // this.cancel();
       this.$bus.emit("updateBadge");
+
+      let index = this.privateTableData.findIndex(
+        (item) => item.id == this.question.id
+      );
+      if (index == -1) {
+        if (!this.privateTableData.length) {
+          this.question = {};
+          this.cancel();
+        } else {
+          this.question = this.privateTableData[0];
+        }
+      } else {
+        if (index === this.privateTableData.length - 1) {
+          this.question = {};
+          this.cancel();
+        } else {
+          this.privateTableData.splice(index, 1);
+          this.question = this.privateTableData[index];
+        }
+      }
+      this.modalForm.auditRemark = "";
+      this.$nextTick(() => {
+        this.$refs.modalFormComp.clearValidate();
+      });
     },
   },
 };

+ 8 - 0
src/modules/question/views/QuestionManage.vue

@@ -691,6 +691,14 @@ export default {
 </script>
 <style lang="scss" scoped>
 .question-manage {
+  .question-list {
+    :deep(.row-question-body) {
+      img {
+        max-height: 100px;
+        width: auto !important;
+      }
+    }
+  }
   .collapse-icon-box {
     width: 0;
     position: relative;

+ 8 - 8
src/modules/questions/views/user.vue

@@ -305,7 +305,7 @@
     <!-- 添加用户信息弹出框 -->
     <el-dialog
       title="新增用户"
-      width="620px"
+      width="423px"
       :visible.sync="addingDialog"
       :modal="true"
       :close-on-click-modal="false"
@@ -324,7 +324,7 @@
         <el-form-item label="姓名" prop="name">
           <el-input
             v-model="userForm.name"
-            class="dialog-input-width"
+            style="width: 290px"
             auto-complete="off"
             placeholder="请输入姓名"
             maxlength="20"
@@ -333,7 +333,7 @@
         <el-form-item label="登录名" prop="loginName">
           <el-input
             v-model="userForm.loginName"
-            class="dialog-input-width"
+            style="width: 290px"
             auto-complete="off"
             placeholder="请输入登录名"
             maxlength="20"
@@ -341,16 +341,16 @@
         </el-form-item>
         <el-form-item label="密码" prop="password">
           <el-input
-            v-model="userForm.password"
+            style="width: 290px"
             class="dialog-input-width"
             auto-complete="off"
             placeholder="请输入密码"
           />
         </el-form-item>
-        <!-- <el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
+        <el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
           <el-select
             v-model="userForm.rootOrgId"
-            class="dialog-input-width"
+            style="width: 290px"
             placeholder="请选择"
             :disabled="!isSuperAdmin"
             filterable
@@ -364,11 +364,11 @@
             >
             </el-option>
           </el-select>
-        </el-form-item> -->
+        </el-form-item>
         <el-form-item label="角色" prop="role">
           <el-select
             v-model="userForm.role"
-            class="dialog-input-width"
+            style="width: 290px"
             placeholder="请选择"
           >
             <el-option