浏览代码

参数设置修改

zhangjie 2 年之前
父节点
当前提交
0bc63fb1cd

+ 19 - 5
src/api.js

@@ -118,11 +118,22 @@ export const enableSubject = subjectId => {
   return $post(`/api/marksubjects/${subjectId}/updateEnable`, {});
   return $post(`/api/marksubjects/${subjectId}/updateEnable`, {});
 };
 };
 // param-set
 // param-set
-export const getParamsSet = workId => {
-  return $get("/api/param/getParam", { workId });
+export const getParamsSet = async workId => {
+  const data = await $get("/api/param/getParam", { workId });
+  let result = { ...data };
+  const keys = [
+    "collectConfig",
+    "levelConfig",
+    "coarseLevelConfig",
+    "scoreConfig"
+  ];
+  keys.forEach(key => {
+    result[key] = result[key] ? JSON.parse(result[key]) : {};
+  });
+  return result;
 };
 };
 export const updateCollectParams = datas => {
 export const updateCollectParams = datas => {
-  return $post("/api/param/collect", datas);
+  return $post("/api/param/collect", datas, "json");
 };
 };
 
 
 // grading-set -------------------------->
 // grading-set -------------------------->
@@ -131,10 +142,10 @@ export const updateCollectParams = datas => {
 
 
 // grading-rule-set
 // grading-rule-set
 export const updateLevelParams = datas => {
 export const updateLevelParams = datas => {
-  return $post("/api/param/level", datas);
+  return $post("/api/param/level", datas, "json");
 };
 };
 export const updateCoarseLevelParams = datas => {
 export const updateCoarseLevelParams = datas => {
-  return $post("/api/param/first_level", datas);
+  return $post("/api/param/coarse_level", datas, "json");
 };
 };
 // update-paper
 // update-paper
 // grading-rule-set
 // grading-rule-set
@@ -219,6 +230,9 @@ export const updateGradingGroup = (subjectId, datas) => {
 export const deleteGradingGroup = (subjectId, groupId) => {
 export const deleteGradingGroup = (subjectId, groupId) => {
   return $del(`/api/marksubjects/${subjectId}/markergroups/${groupId}`);
   return $del(`/api/marksubjects/${subjectId}/markergroups/${groupId}`);
 };
 };
+export const deleteGradeGroupStudent = (subject, groupId) => {
+  return $del(`/api/marksubjects/marker_groups_student/${subject}/${groupId}`);
+};
 export const markUserList = ({ workId, subjectId }) => {
 export const markUserList = ({ workId, subjectId }) => {
   return $get("/api/markers", { workId, subject: subjectId });
   return $get("/api/markers", { workId, subject: subjectId });
 };
 };

+ 265 - 265
src/modules/client-set/ClientParamSet.vue

@@ -1,265 +1,265 @@
-<template>
-  <div class="client-param-set">
-    <Row :gutter="20" type="flex">
-      <Col span="12">
-        <div class="part-box">
-          <h2 class="client-param-title">科目名称设置</h2>
-          <table class="table table-noborder">
-            <template v-for="(subject, index) in subjects">
-              <tr :key="index">
-                <td>
-                  <Input
-                    v-model="subject.name"
-                    @on-blur="checkSubjectValidate(subject)"
-                    :disabled="!subject.enable"
-                    :readonly="!subject.canEdit"
-                    :clearable="subject.canEdit"
-                    :ref="subject.id"
-                  ></Input>
-                </td>
-                <td style="width: 220px;">
-                  <Button
-                    size="small"
-                    :disabled="!subject.enable"
-                    @click="toEdit(index)"
-                    >编辑</Button
-                  >
-                  <Button
-                    size="small"
-                    :type="subject.enable ? 'error' : 'success'"
-                    @click="toAble(index)"
-                  >
-                    {{ subject.enable ? "禁用" : "启用" }}</Button
-                  >
-                  <Button
-                    size="small"
-                    :disabled="!subject.enable"
-                    @click="toSave(subject)"
-                    >保存</Button
-                  >
-                </td>
-              </tr>
-              <tr
-                class="tr-tips-error"
-                v-if="subject.errors"
-                :key="index + '1'"
-              >
-                <td>{{ subject.errors.name }}</td>
-                <td></td>
-              </tr>
-            </template>
-          </table>
-        </div>
-      </Col>
-      <Col span="12">
-        <div class="part-box">
-          <h2 class="client-param-title">其他设置</h2>
-          <Form ref="modalFormComp" :model="modalForm" :label-width="120">
-            <FormItem label="是否整包扫描:">
-              <Select
-                v-model="modalForm.packageScan"
-                :disabled="!modalFormCanEdit"
-                placeholder="是否整包扫描"
-              >
-                <Option
-                  v-for="(val, key) in BOOLEAN_TYPE"
-                  :key="key"
-                  :value="key * 1"
-                  :label="val"
-                ></Option>
-              </Select>
-            </FormItem>
-            <FormItem label="图片是否加密:">
-              <Select
-                v-model="modalForm.imageEncrypt"
-                :disabled="!modalFormCanEdit"
-                placeholder="图片是否加密"
-              >
-                <Option
-                  v-for="(val, key) in BOOLEAN_TYPE"
-                  :key="key"
-                  :value="key * 1"
-                  :label="val"
-                ></Option>
-              </Select>
-            </FormItem>
-            <FormItem label="图片命名规则:">
-              <Select
-                v-model="modalForm.nameRule"
-                :disabled="!modalFormCanEdit"
-                placeholder="请选择图片命名规则"
-              >
-                <Option
-                  v-for="(val, key) in IMAGE_NAME_TYPE"
-                  :key="key"
-                  :value="key * 1"
-                  :label="val"
-                ></Option>
-              </Select>
-            </FormItem>
-            <FormItem label="试卷档位:">
-              <Select
-                v-model="modalForm.paperStage"
-                :disabled="!modalFormCanEdit"
-                placeholder="请选择试卷档位"
-              >
-                <Option
-                  v-for="(val, key) in PAPER_LEVEL_KNOWN_TYPE"
-                  :key="key"
-                  :value="key * 1"
-                  :label="val"
-                ></Option>
-              </Select>
-            </FormItem>
-            <FormItem>
-              <Button
-                shape="circle"
-                style="width: 80px;"
-                @click="modalFormCanEdit = true"
-                >编辑</Button
-              >
-              <Button
-                shape="circle"
-                type="primary"
-                style="width: 80px;"
-                :disabled="isSubmit"
-                @click="toSubmit"
-                >保存</Button
-              >
-            </FormItem>
-          </Form>
-        </div>
-      </Col>
-    </Row>
-  </div>
-</template>
-
-<script>
-import {
-  subjectList,
-  updateSubject,
-  enableSubject,
-  getParamsSet,
-  updateCollectParams
-} from "@/api";
-import {
-  BOOLEAN_TYPE,
-  IMAGE_NAME_TYPE,
-  PAPER_LEVEL_KNOWN_TYPE
-} from "@/constants/enumerate";
-import schema from "async-validator";
-schema.warning = function() {};
-
-const initSubject = {
-  id: "",
-  name: "",
-  enable: true,
-  canEdit: false,
-  password: ""
-};
-
-export default {
-  name: "client-param-set",
-  data() {
-    return {
-      BOOLEAN_TYPE,
-      IMAGE_NAME_TYPE,
-      PAPER_LEVEL_KNOWN_TYPE,
-      workId: this.$route.params.workId,
-      subjects: [],
-      // other param
-      isSubmit: false,
-      initModalForm: {
-        workId: "",
-        packageScan: 0,
-        imageEncrypt: 0,
-        nameRule: 0,
-        paperStage: 0
-      },
-      modalFormCanEdit: false,
-      modalForm: {}
-    };
-  },
-  mounted() {
-    this.modalForm = { ...this.initModalForm };
-    this.getList();
-    this.getParamsSetInfo();
-  },
-  methods: {
-    async getList() {
-      const data = await subjectList(this.workId);
-      this.subjects = data.map(item => {
-        return {
-          ...item,
-          canEdit: false
-        };
-      });
-    },
-
-    toAdd() {
-      this.subjects.push({ ...initSubject });
-    },
-    toEdit(index) {
-      const row = this.subjects[index];
-      row.canEdit = true;
-      this.$refs[row.id][0].focus();
-    },
-    async toAble(index) {
-      const row = this.subjects[index];
-      await enableSubject(row.id);
-      row.enable = !row.enable;
-    },
-    checkSubjectValidate(subject) {
-      const descriptor = {
-        name: [
-          {
-            required: true,
-            min: 2,
-            max: 20,
-            message: "科目名称长度只能介于2到20之间"
-          }
-        ]
-      };
-      return new schema(descriptor)
-        .validate(subject)
-        .then(() => {
-          if (subject.errors) subject.errors = null;
-        })
-        .catch(({ errors, fields }) => {
-          let errorMsgs = {};
-          errors.map(error => {
-            errorMsgs[error.field] = error.message;
-          });
-          this.$set(subject, "errors", errorMsgs);
-          return { errors };
-        });
-    },
-    async toSave(row) {
-      const result = await this.checkSubjectValidate(row);
-      if (result) return;
-
-      await updateSubject(row);
-      row.canEdit = false;
-      this.$Message.success("保存成功!");
-    },
-    // param-set
-    async getParamsSetInfo() {
-      const data = await getParamsSet(this.workId);
-      this.modalForm = this.$objAssign(this.modalForm, data);
-    },
-    async toSubmit() {
-      if (this.isSubmit) return;
-      this.isSubmit = true;
-
-      let result = true;
-      await updateCollectParams(this.modalForm).catch(() => {
-        result = false;
-      });
-      this.isSubmit = false;
-      if (!result) return;
-      this.modalFormCanEdit = false;
-      this.$Message.success("保存成功!");
-    }
-  }
-};
-</script>
+<template>
+  <div class="client-param-set">
+    <Row :gutter="20" type="flex">
+      <Col span="12">
+        <div class="part-box">
+          <h2 class="client-param-title">科目名称设置</h2>
+          <table class="table table-noborder">
+            <template v-for="(subject, index) in subjects">
+              <tr :key="index">
+                <td>
+                  <Input
+                    v-model="subject.name"
+                    @on-blur="checkSubjectValidate(subject)"
+                    :disabled="!subject.enable"
+                    :readonly="!subject.canEdit"
+                    :clearable="subject.canEdit"
+                    :ref="subject.id"
+                  ></Input>
+                </td>
+                <td style="width: 220px;">
+                  <Button
+                    size="small"
+                    :disabled="!subject.enable"
+                    @click="toEdit(index)"
+                    >编辑</Button
+                  >
+                  <Button
+                    size="small"
+                    :type="subject.enable ? 'error' : 'success'"
+                    @click="toAble(index)"
+                  >
+                    {{ subject.enable ? "禁用" : "启用" }}</Button
+                  >
+                  <Button
+                    size="small"
+                    :disabled="!subject.enable"
+                    @click="toSave(subject)"
+                    >保存</Button
+                  >
+                </td>
+              </tr>
+              <tr
+                class="tr-tips-error"
+                v-if="subject.errors"
+                :key="index + '1'"
+              >
+                <td>{{ subject.errors.name }}</td>
+                <td></td>
+              </tr>
+            </template>
+          </table>
+        </div>
+      </Col>
+      <Col span="12">
+        <div class="part-box">
+          <h2 class="client-param-title">其他设置</h2>
+          <Form ref="modalFormComp" :model="modalForm" :label-width="120">
+            <FormItem label="是否整包扫描:">
+              <Select
+                v-model="modalForm.packageScan"
+                :disabled="!modalFormCanEdit"
+                placeholder="是否整包扫描"
+              >
+                <Option
+                  v-for="(val, key) in BOOLEAN_TYPE"
+                  :key="key"
+                  :value="key * 1"
+                  :label="val"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="图片是否加密:">
+              <Select
+                v-model="modalForm.imageEncrypt"
+                :disabled="!modalFormCanEdit"
+                placeholder="图片是否加密"
+              >
+                <Option
+                  v-for="(val, key) in BOOLEAN_TYPE"
+                  :key="key"
+                  :value="key * 1"
+                  :label="val"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="图片命名规则:">
+              <Select
+                v-model="modalForm.nameRule"
+                :disabled="!modalFormCanEdit"
+                placeholder="请选择图片命名规则"
+              >
+                <Option
+                  v-for="(val, key) in IMAGE_NAME_TYPE"
+                  :key="key"
+                  :value="key * 1"
+                  :label="val"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem label="试卷档位:">
+              <Select
+                v-model="modalForm.paperStage"
+                :disabled="!modalFormCanEdit"
+                placeholder="请选择试卷档位"
+              >
+                <Option
+                  v-for="(val, key) in PAPER_LEVEL_KNOWN_TYPE"
+                  :key="key"
+                  :value="key * 1"
+                  :label="val"
+                ></Option>
+              </Select>
+            </FormItem>
+            <FormItem>
+              <Button
+                shape="circle"
+                style="width: 80px;"
+                @click="modalFormCanEdit = true"
+                >编辑</Button
+              >
+              <Button
+                shape="circle"
+                type="primary"
+                style="width: 80px;"
+                :disabled="isSubmit"
+                @click="toSubmit"
+                >保存</Button
+              >
+            </FormItem>
+          </Form>
+        </div>
+      </Col>
+    </Row>
+  </div>
+</template>
+
+<script>
+import {
+  subjectList,
+  updateSubject,
+  enableSubject,
+  getParamsSet,
+  updateCollectParams
+} from "@/api";
+import {
+  BOOLEAN_TYPE,
+  IMAGE_NAME_TYPE,
+  PAPER_LEVEL_KNOWN_TYPE
+} from "@/constants/enumerate";
+import schema from "async-validator";
+schema.warning = function() {};
+
+const initSubject = {
+  id: "",
+  name: "",
+  enable: true,
+  canEdit: false,
+  password: ""
+};
+
+export default {
+  name: "client-param-set",
+  data() {
+    return {
+      BOOLEAN_TYPE,
+      IMAGE_NAME_TYPE,
+      PAPER_LEVEL_KNOWN_TYPE,
+      workId: this.$route.params.workId,
+      subjects: [],
+      // other param
+      isSubmit: false,
+      initModalForm: {
+        workId: "",
+        packageScan: 0,
+        imageEncrypt: 0,
+        nameRule: 0,
+        paperStage: 0
+      },
+      modalFormCanEdit: false,
+      modalForm: {}
+    };
+  },
+  mounted() {
+    this.modalForm = { ...this.initModalForm };
+    this.getList();
+    this.getParamsSetInfo();
+  },
+  methods: {
+    async getList() {
+      const data = await subjectList(this.workId);
+      this.subjects = data.map(item => {
+        return {
+          ...item,
+          canEdit: false
+        };
+      });
+    },
+
+    toAdd() {
+      this.subjects.push({ ...initSubject });
+    },
+    toEdit(index) {
+      const row = this.subjects[index];
+      row.canEdit = true;
+      this.$refs[row.id][0].focus();
+    },
+    async toAble(index) {
+      const row = this.subjects[index];
+      await enableSubject(row.id);
+      row.enable = !row.enable;
+    },
+    checkSubjectValidate(subject) {
+      const descriptor = {
+        name: [
+          {
+            required: true,
+            min: 2,
+            max: 20,
+            message: "科目名称长度只能介于2到20之间"
+          }
+        ]
+      };
+      return new schema(descriptor)
+        .validate(subject)
+        .then(() => {
+          if (subject.errors) subject.errors = null;
+        })
+        .catch(({ errors, fields }) => {
+          let errorMsgs = {};
+          errors.map(error => {
+            errorMsgs[error.field] = error.message;
+          });
+          this.$set(subject, "errors", errorMsgs);
+          return { errors };
+        });
+    },
+    async toSave(row) {
+      const result = await this.checkSubjectValidate(row);
+      if (result) return;
+
+      await updateSubject(row);
+      row.canEdit = false;
+      this.$Message.success("保存成功!");
+    },
+    // param-set
+    async getParamsSetInfo() {
+      const data = await getParamsSet(this.workId);
+      this.modalForm = this.$objAssign(this.modalForm, data.collectConfig);
+    },
+    async toSubmit() {
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+
+      let result = true;
+      await updateCollectParams(this.modalForm).catch(() => {
+        result = false;
+      });
+      this.isSubmit = false;
+      if (!result) return;
+      this.modalFormCanEdit = false;
+      this.$Message.success("保存成功!");
+    }
+  }
+};
+</script>

+ 35 - 2
src/modules/grading-set/GradingRuleSet.vue

@@ -143,6 +143,20 @@
             ></Option>
             ></Option>
           </Select>
           </Select>
         </FormItem>
         </FormItem>
+        <FormItem label="是否开启去高去低再加权评卷:">
+          <Select
+            v-model="modalForm.removeHighAndLow"
+            :disabled="!modalFormCanEdit"
+            placeholder="请选择"
+          >
+            <Option
+              v-for="(val, key) in BOOLEAN_TYPE"
+              :key="key"
+              :value="key * 1"
+              :label="val"
+            ></Option>
+          </Select>
+        </FormItem>
         <FormItem label="是否增加粗档位环节:">
         <FormItem label="是否增加粗档位环节:">
           <Select
           <Select
             v-model="modalForm.coarseLevel"
             v-model="modalForm.coarseLevel"
@@ -322,6 +336,20 @@
             ></Option>
             ></Option>
           </Select>
           </Select>
         </FormItem>
         </FormItem>
+        <FormItem label="是否开启去高去低再加权评卷:">
+          <Select
+            v-model="modalFormCoarse.removeHighAndLow"
+            :disabled="!modalFormCoarseCanEdit"
+            placeholder="请选择"
+          >
+            <Option
+              v-for="(val, key) in BOOLEAN_TYPE"
+              :key="key"
+              :value="key * 1"
+              :label="val"
+            ></Option>
+          </Select>
+        </FormItem>
       </Form>
       </Form>
       <div class="rule-part-footer">
       <div class="rule-part-footer">
         <Button
         <Button
@@ -363,7 +391,8 @@ const initModalForm = {
   levelShowAllPaper: 0,
   levelShowAllPaper: 0,
   propDenominator: 1,
   propDenominator: 1,
   showStandardPaperManage: 1,
   showStandardPaperManage: 1,
-  clearData: 0
+  clearData: 0,
+  removeHighAndLow: 0
 };
 };
 
 
 export default {
 export default {
@@ -391,7 +420,11 @@ export default {
   methods: {
   methods: {
     async getParamsSetInfo() {
     async getParamsSetInfo() {
       const data = await getParamsSet(this.workId);
       const data = await getParamsSet(this.workId);
-      this.modalForm = this.$objAssign(this.modalForm, data);
+      this.modalForm = this.$objAssign(this.modalForm, data.levelConfig);
+      this.modalFormCoarse = this.$objAssign(
+        initModalForm,
+        data.coarseLevelConfig
+      );
     },
     },
     coarseLevelChange(val) {
     coarseLevelChange(val) {
       if (val) {
       if (val) {

+ 170 - 164
src/modules/grading/Grading.vue

@@ -1,164 +1,170 @@
-<template>
-  <div class="grading home">
-    <view-header key="1" :show-reset-pwd="false" v-if="IS_ADMIN">
-      <div class="grading-subnav" slot="navSub">
-        <div class="grading-title">
-          <h1>{{ curSubject.name }}</h1>
-          <span>当前阶段:{{ stepName }}</span
-          ><span>进度:{{ stepProgress }}</span>
-        </div>
-        <div class="home-navs">
-          <ul>
-            <li
-              :class="{ act: curNav.name === nav.name }"
-              v-for="(nav, index) in navs"
-              :key="index"
-              @click="switchNav(nav)"
-            >
-              <i
-                :class="[
-                  'icon',
-                  curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
-                ]"
-                v-if="nav.icon"
-              ></i>
-              <span class="nav-item-cont">{{ nav.title }}</span>
-            </li>
-          </ul>
-        </div>
-      </div>
-    </view-header>
-    <view-header key="2" v-else>
-      <div class="home-navs" slot="navSub">
-        <ul>
-          <li
-            :class="{ act: curNav.name === nav.name }"
-            v-for="(nav, index) in navs"
-            :key="index"
-            @click="switchNav(nav)"
-          >
-            <i
-              :class="[
-                'icon',
-                curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
-              ]"
-              v-if="nav.icon"
-            ></i>
-            <span class="nav-item-cont">{{ nav.title }}</span>
-          </li>
-        </ul>
-      </div>
-    </view-header>
-
-    <div class="home-body">
-      <div class="home-main">
-        <router-view />
-
-        <!-- <view-footer></view-footer> -->
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import { subjectDetail, gradingProgressDetail, getParamsSet } from "@/api";
-import { grading, main } from "@/constants/authority";
-import menuMixins from "@/components/homeMenuMixins";
-import { SUBJECT_STAGE } from "@/constants/enumerate";
-import { deepCopy } from "@/plugins/utils";
-
-export default {
-  name: "grading",
-  mixins: [menuMixins],
-  data() {
-    return {
-      subjectId: this.$route.params.subjectId,
-      workId: this.$route.params.workId,
-      navs: [],
-      curNav: {},
-      curSubject: { name: "" },
-      SUBJECT_STAGE,
-      paramsSet: {},
-      IS_ADMIN: true,
-      stepName: "",
-      stepProgress: ""
-    };
-  },
-  watch: {
-    $route: {
-      handler(val) {
-        this.actSubNav();
-      }
-    }
-  },
-  mounted() {
-    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
-    this.IS_ADMIN = curUserRoleType === "ADMIN";
-    this.initData();
-  },
-  methods: {
-    async initData() {
-      if (this.IS_ADMIN) {
-        this.curSubject = await subjectDetail(this.subjectId);
-        if (this.curSubject.stage === "SCORE") {
-          this.$router.replace({
-            name: "Mark",
-            params: {
-              workId: this.subjectId.split("-")[0],
-              subjectId: this.subjectId
-            }
-          });
-          return;
-        }
-        // this.getProgressDetail();
-        this.stepName =
-          this.curSubject.test === 2
-            ? "试评"
-            : this.SUBJECT_STAGE[this.curSubject.stage];
-      } else {
-        await this.getParamsSetInfo();
-        if (
-          this.$route.name === "GradingStandardPaperManage" &&
-          !this.paramsSet.showStandardPaperManage
-        ) {
-          this.$Message.error("非法操作!");
-          this.$router.replace({ name: "Login" });
-          return;
-        }
-      }
-
-      this.buildNavs();
-      this.actSubNav();
-    },
-    async getParamsSetInfo() {
-      this.paramsSet = await getParamsSet(this.workId);
-    },
-    setProgress(progress) {
-      this.stepProgress = progress.toFixed(2) + "%";
-    },
-    async getProgressDetail() {
-      const data = await gradingProgressDetail({
-        workId: this.curSubject.workId,
-        subject: this.curSubject.subject
-      });
-      this.stepProgress = data.totalProgress.progress.toFixed(2) + "%";
-    },
-    buildNavs() {
-      this.navs = deepCopy(grading);
-      if (this.IS_ADMIN) {
-        this.navs = [...main.slice(0, 2), ...this.navs.slice(0, -2)];
-      } else {
-        this.paramsSet.showStandardPaperManage
-          ? this.navs.splice(3, 2)
-          : this.navs.splice(3, 3);
-      }
-    },
-    actSubNav() {
-      const router = this.$route.matched.filter(
-        item => item.name !== "Grading"
-      )[0];
-      this.actCurNav(router);
-    }
-  }
-};
-</script>
+<template>
+  <div class="grading home">
+    <view-header key="1" :show-reset-pwd="false" v-if="IS_ADMIN">
+      <div class="grading-subnav" slot="navSub">
+        <div class="grading-title">
+          <h1>{{ curSubject.name }}</h1>
+          <span>当前阶段:{{ stepName }}</span
+          ><span>进度:{{ stepProgress }}</span>
+        </div>
+        <div class="home-navs">
+          <ul>
+            <li
+              :class="{ act: curNav.name === nav.name }"
+              v-for="(nav, index) in navs"
+              :key="index"
+              @click="switchNav(nav)"
+            >
+              <i
+                :class="[
+                  'icon',
+                  curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
+                ]"
+                v-if="nav.icon"
+              ></i>
+              <span class="nav-item-cont">{{ nav.title }}</span>
+            </li>
+          </ul>
+        </div>
+      </div>
+    </view-header>
+    <view-header key="2" v-else>
+      <div class="home-navs" slot="navSub">
+        <ul>
+          <li
+            :class="{ act: curNav.name === nav.name }"
+            v-for="(nav, index) in navs"
+            :key="index"
+            @click="switchNav(nav)"
+          >
+            <i
+              :class="[
+                'icon',
+                curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
+              ]"
+              v-if="nav.icon"
+            ></i>
+            <span class="nav-item-cont">{{ nav.title }}</span>
+          </li>
+        </ul>
+      </div>
+    </view-header>
+
+    <div class="home-body">
+      <div class="home-main">
+        <router-view />
+
+        <!-- <view-footer></view-footer> -->
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import { subjectDetail, gradingProgressDetail, getParamsSet } from "@/api";
+import { grading, main } from "@/constants/authority";
+import menuMixins from "@/components/homeMenuMixins";
+import { SUBJECT_STAGE } from "@/constants/enumerate";
+import { deepCopy } from "@/plugins/utils";
+
+export default {
+  name: "grading",
+  mixins: [menuMixins],
+  data() {
+    return {
+      subjectId: this.$route.params.subjectId,
+      workId: this.$route.params.workId,
+      navs: [],
+      curNav: {},
+      SUBJECT_STAGE,
+      IS_ADMIN: true,
+      stepName: "",
+      stepProgress: ""
+    };
+  },
+  computed: {
+    ...mapState("marker", ["paramsSet", "curSubject"])
+  },
+  watch: {
+    $route: {
+      handler(val) {
+        this.actSubNav();
+      }
+    }
+  },
+  mounted() {
+    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.IS_ADMIN = curUserRoleType === "ADMIN";
+    this.initData();
+  },
+  methods: {
+    ...mapMutations("marker", ["setParamSet", "setCurSubject"]),
+    async initData() {
+      if (this.IS_ADMIN) {
+        const curSubject = await subjectDetail(this.subjectId);
+        this.setCurSubject(curSubject || {});
+
+        if (this.curSubject.stage === "SCORE") {
+          this.$router.replace({
+            name: "Mark",
+            params: {
+              workId: this.subjectId.split("-")[0],
+              subjectId: this.subjectId
+            }
+          });
+          return;
+        }
+        // this.getProgressDetail();
+        this.stepName =
+          this.curSubject.test === 2
+            ? "试评"
+            : this.SUBJECT_STAGE[this.curSubject.stage];
+      } else {
+        await this.getParamsSetInfo();
+        if (
+          this.$route.name === "GradingStandardPaperManage" &&
+          !this.paramsSet.showStandardPaperManage
+        ) {
+          this.$Message.error("非法操作!");
+          this.$router.replace({ name: "Login" });
+          return;
+        }
+      }
+
+      this.buildNavs();
+      this.actSubNav();
+    },
+    async getParamsSetInfo() {
+      const data = await getParamsSet(this.workId);
+      this.setParamSet(data || {});
+    },
+    setProgress(progress) {
+      this.stepProgress = progress.toFixed(2) + "%";
+    },
+    async getProgressDetail() {
+      const data = await gradingProgressDetail({
+        workId: this.curSubject.workId,
+        subject: this.curSubject.subject
+      });
+      this.stepProgress = data.totalProgress.progress.toFixed(2) + "%";
+    },
+    buildNavs() {
+      this.navs = deepCopy(grading);
+      if (this.IS_ADMIN) {
+        this.navs = [...main.slice(0, 2), ...this.navs.slice(0, -2)];
+      } else {
+        this.paramsSet.showStandardPaperManage
+          ? this.navs.splice(3, 2)
+          : this.navs.splice(3, 3);
+      }
+    },
+    actSubNav() {
+      const router = this.$route.matched.filter(
+        item => item.name !== "Grading"
+      )[0];
+      this.actCurNav(router);
+    }
+  }
+};
+</script>

+ 14 - 5
src/modules/grading/GradingGroupManage.vue

@@ -86,11 +86,13 @@
 </template>
 </template>
 
 
 <script>
 <script>
+import { mapState } from "vuex";
 import {
 import {
   gradingGroupList,
   gradingGroupList,
   markUserList,
   markUserList,
   updateGradingGroup,
   updateGradingGroup,
-  deleteGradingGroup
+  deleteGradingGroup,
+  deleteGradeGroupStudent
 } from "@/api";
 } from "@/api";
 import draggable from "vuedraggable";
 import draggable from "vuedraggable";
 import ImportFile from "@/components/common/ImportFile";
 import ImportFile from "@/components/common/ImportFile";
@@ -102,6 +104,7 @@ export default {
     return {
     return {
       workId: this.$route.params.workId,
       workId: this.$route.params.workId,
       subjectId: this.$route.params.subjectId,
       subjectId: this.$route.params.subjectId,
+      subject: "",
       groups: [],
       groups: [],
       users: [],
       users: [],
       isSubmit: false,
       isSubmit: false,
@@ -114,21 +117,26 @@ export default {
       },
       },
       uploadData: {
       uploadData: {
         workId: this.$route.params.workId,
         workId: this.$route.params.workId,
-        subjectId: this.$route.params.subjectId,
+        subject: "",
+        stage: null,
         groupId: null
         groupId: null
       },
       },
-      uploadStudentUrl: this.GLOBAL.domain + "/api/import/group-students",
+      uploadStudentUrl:
+        this.GLOBAL.domain + "/api/import/students/import_group_student",
       downloadStudentTemplateUrl: "/templates/考生名单表-模板.xlsx",
       downloadStudentTemplateUrl: "/templates/考生名单表-模板.xlsx",
       downloadStudentTemplateFilename: "考生名单表-模板.xlsx"
       downloadStudentTemplateFilename: "考生名单表-模板.xlsx"
     };
     };
   },
   },
   computed: {
   computed: {
+    ...mapState("marker", ["curSubject"]),
     groupListClasses() {
     groupListClasses() {
       const num = this.groups.length;
       const num = this.groups.length;
       return ["group-list", `group-list-${num}`];
       return ["group-list", `group-list-${num}`];
     }
     }
   },
   },
   mounted() {
   mounted() {
+    this.subject = this.subjectId.split("-")[1];
+    this.uploadData.subject = this.subject;
     this.initData();
     this.initData();
   },
   },
   methods: {
   methods: {
@@ -185,7 +193,7 @@ export default {
         id: "",
         id: "",
         name: "评卷组" + (this.groups.length + 1),
         name: "评卷组" + (this.groups.length + 1),
         markers: [],
         markers: [],
-        subject: this.subjectId.split("-")[1],
+        subject: this.subject,
         workId: this.workId
         workId: this.workId
       });
       });
     },
     },
@@ -220,6 +228,7 @@ export default {
     toImportGroupStudent(group) {
     toImportGroupStudent(group) {
       this.uploadTitle = `导入考生名单-${group.name}`;
       this.uploadTitle = `导入考生名单-${group.name}`;
       this.uploadData.groupId = group.id;
       this.uploadData.groupId = group.id;
+      this.uploadData.stage = this.curSubject.stage;
       this.$refs.ExportStudent.open();
       this.$refs.ExportStudent.open();
     },
     },
     uploadSuccess() {
     uploadSuccess() {
@@ -234,7 +243,7 @@ export default {
       this.$Modal.confirm({
       this.$Modal.confirm({
         content: "确定要删除当前分组下的考生吗?",
         content: "确定要删除当前分组下的考生吗?",
         onOk: async () => {
         onOk: async () => {
-          await deleteGradingGroup(this.subjectId, group.id);
+          await deleteGradeGroupStudent(this.subject, group.id);
           this.getGroupList();
           this.getGroupList();
           this.$Message.success("删除成功!");
           this.$Message.success("删除成功!");
         }
         }

+ 2 - 0
src/modules/grading/components/GradeAction.vue

@@ -524,6 +524,8 @@ export default {
   },
   },
   beforeDestroy() {
   beforeDestroy() {
     if (this.setT) clearTimeout(this.setT);
     if (this.setT) clearTimeout(this.setT);
+    if (this.ribbonSet.keyboardMark)
+      document.removeEventListener("click", this.keyEvent);
   }
   }
 };
 };
 </script>
 </script>

+ 3 - 3
src/modules/mark-set/MarkRuleSet.vue

@@ -8,7 +8,7 @@
     >
     >
       <FormItem label="分数计算方式:">
       <FormItem label="分数计算方式:">
         <Select
         <Select
-          v-model="modalForm.calcType"
+          v-model="modalForm.removeHighAndLow"
           :disabled="!modalFormCanEdit"
           :disabled="!modalFormCanEdit"
           placeholder="选择"
           placeholder="选择"
         >
         >
@@ -101,7 +101,7 @@ export default {
       SCORE_CALC_TYPE,
       SCORE_CALC_TYPE,
       initModalForm: {
       initModalForm: {
         workId: "",
         workId: "",
-        calcType: 0,
+        removeHighAndLow: 0,
         roundUp: 0,
         roundUp: 0,
         changeStage: 0,
         changeStage: 0,
         scoreShowAllPaper: 0
         scoreShowAllPaper: 0
@@ -117,7 +117,7 @@ export default {
   methods: {
   methods: {
     async getParamsSetInfo() {
     async getParamsSetInfo() {
       const data = await getParamsSet(this.workId);
       const data = await getParamsSet(this.workId);
-      this.modalForm = this.$objAssign(this.modalForm, data);
+      this.modalForm = this.$objAssign(this.modalForm, data.scoreConfig);
     },
     },
     async submit() {
     async submit() {
       if (this.isSubmit) return;
       if (this.isSubmit) return;

+ 5 - 0
src/modules/mark/components/MarkAction.vue

@@ -549,6 +549,11 @@ export default {
     clearKeyInput() {
     clearKeyInput() {
       this.keyInput = null;
       this.keyInput = null;
     }
     }
+  },
+  beforeDestroy() {
+    if (this.setT) clearTimeout(this.setT);
+    if (this.ribbonSet.keyboardMark)
+      document.removeEventListener("click", this.keyEvent);
   }
   }
 };
 };
 </script>
 </script>