Browse Source

feat: 评卷参数设置

zhangjie 10 months ago
parent
commit
7b27fa4f8b

+ 3 - 0
src/assets/styles/base.scss

@@ -525,6 +525,9 @@ body {
 .ml-2 {
   margin-left: 10px;
 }
+.ml-4 {
+  margin-left: 20px;
+}
 .mr-1 {
   margin-right: 5px;
 }

+ 9 - 3
src/modules/mark/components/markParam/ModifyMarkGroup.vue

@@ -80,13 +80,13 @@
           </div>
           <div class="user-types">
             <div
-              :class="['user-type', { 'is-active': userType === 'org' }]"
+              :class="['user-type', { 'is-active': isOrgTab }]"
               @click="switchUserType('org')"
             >
               组织架构
             </div>
             <div
-              :class="['user-type', { 'is-active': userType === 'course' }]"
+              :class="['user-type', { 'is-active': !isOrgTab }]"
               @click="switchUserType('course')"
             >
               课程
@@ -99,7 +99,8 @@
               node-key="id"
               :default-checked-keys="selectedUserIds"
               :props="defaultProps"
-              default-expand-all
+              :default-expand-all="!isOrgTab"
+              :default-expanded-keys="isOrgTab ? userOrgKeys : []"
             >
               <span class="custom-tree-node" slot-scope="{ node, data }">
                 <el-checkbox
@@ -276,6 +277,7 @@ export default {
       selectedQuestions: [],
       selectedQuestionNos: [],
       paperStructs: [],
+      userOrgKeys: [],
       defaultProps: {
         children: "children",
         label: "label",
@@ -328,8 +330,12 @@ export default {
     isEdit() {
       return !this.instance.isNew;
     },
+    isOrgTab() {
+      return this.userType === "org";
+    },
   },
   mounted() {
+    this.userOrgKeys = [this.$ls.get("orgId")];
     this.getOrgData();
   },
   methods: {

+ 1 - 0
src/modules/mark/components/markParam/ModifyMarkParams.vue

@@ -15,6 +15,7 @@
       <span
         >课程名称:{{ instance.courseName }}({{ instance.courseCode }})</span
       >
+      <span class="ml-4">{{ instance.paperType }}卷</span>
       <button class="el-dialog__headerbtn" @click="cancel"></button>
     </div>
 

+ 26 - 2
src/modules/mark/views/MarkSetting.vue

@@ -31,11 +31,26 @@
         </el-form-item>
       </el-form>
       <div class="box-justify">
-        <div></div>
+        <div>
+          <upload-button
+            v-if="checkPrivilege('button', 'CardJsonImport')"
+            btn-content="导入数据包"
+            btn-type="primary"
+            btn-icon="el-icon-upload2"
+            upload-url="/api/admin/mark/setting/card_json/import"
+            :upload-data="{ examId: filter.examId }"
+            :format="['zip']"
+            style="margin: 0"
+            @valid-error="validError"
+            @upload-success="uploadJsonSuccess"
+          >
+          </upload-button>
+        </div>
         <div>
           <el-button
             v-if="checkPrivilege('button', 'BatchMarkConfig')"
             type="primary"
+            icon="el-icon-setting"
             :disabled="!multipleSelection.length"
             @click="toBatchModifySetting"
           >
@@ -219,10 +234,11 @@ import ModifyMarkSetting from "../components/ModifyMarkSetting.vue";
 import ModifyMarkParams from "../components/markParam/ModifyMarkParams.vue";
 import ImportFile from "@/components/ImportFile.vue";
 import templateDownload from "@/mixins/templateDownload";
+import UploadButton from "@/components/UploadButton.vue";
 
 export default {
   name: "mark-setting",
-  components: { ModifyMarkSetting, ModifyMarkParams, ImportFile },
+  components: { ModifyMarkSetting, ModifyMarkParams, ImportFile, UploadButton },
   mixins: [templateDownload],
   data() {
     return {
@@ -311,6 +327,14 @@ export default {
       this.questionType = type;
       this.$refs.DataTaskDialog.open();
     },
+    // upload
+    validError(errorData) {
+      this.$message.error(errorData.message);
+    },
+    uploadJsonSuccess() {
+      this.$message.success("上传成功!");
+      this.getList();
+    },
   },
 };
 </script>