zhangjie hace 5 años
padre
commit
95aae5d5bc

+ 3 - 0
src/assets/styles/common-component.less

@@ -257,6 +257,9 @@
 .cc-upload-button {
   display: inline-block;
   vertical-align: middle;
+  .ivu-upload {
+    display: inline-block;
+  }
 }
 
 // rich-editor

+ 0 - 4
src/assets/styles/iview-style-choosable.less

@@ -63,7 +63,3 @@
 .ivu-btn + .ivu-btn {
   margin-left: 10px;
 }
-// .ivu-upload
-.ivu-upload {
-  display: inline-block;
-}

+ 10 - 1
src/components/ViewHeader.vue

@@ -9,19 +9,25 @@
       <span class="user-name"
         ><Icon type="md-person" size="16" /> {{ username }}</span
       >
-      <span class="user-logout" @click="logout">
+      <span class="user-name" @click="toResetPwd">修改密码</span>
+      <span class="user-logout" title="退出登录" @click="logout">
         <Icon type="md-power" size="20" />
       </span>
     </div>
     <div class="head-info">
       <slot name="info"></slot>
     </div>
+
+    <reset-pwd ref="ResetPwd"></reset-pwd>
   </div>
 </template>
 
 <script>
+import ResetPwd from "../modules/login/ResetPwd";
+
 export default {
   name: "view-header",
+  components: { ResetPwd },
   data() {
     return {};
   },
@@ -31,6 +37,9 @@ export default {
     }
   },
   methods: {
+    toResetPwd() {
+      this.$refs.ResetPwd.open();
+    },
     logout() {
       this.$ls.clear();
       this.$router.push({ name: "Login" });

+ 11 - 11
src/constants/apiTempData.js

@@ -246,7 +246,7 @@ export const levels = [
     name: "A",
     range: [0, 9],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 1,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -256,7 +256,7 @@ export const levels = [
     name: "B",
     range: [10, 19],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 3,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -266,7 +266,7 @@ export const levels = [
     name: "C",
     range: [20, 29],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 8,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -276,7 +276,7 @@ export const levels = [
     name: "D",
     range: [30, 39],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 15,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -286,7 +286,7 @@ export const levels = [
     name: "E",
     range: [40, 49],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 24,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -296,7 +296,7 @@ export const levels = [
     name: "F",
     range: [50, 59],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 30,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -306,7 +306,7 @@ export const levels = [
     name: "G",
     range: [60, 69],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 24,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -316,7 +316,7 @@ export const levels = [
     name: "H",
     range: [70, 79],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 15,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -326,7 +326,7 @@ export const levels = [
     name: "I",
     range: [80, 89],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 8,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -336,7 +336,7 @@ export const levels = [
     name: "J",
     range: [90, 94],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 3,
     pt: 12,
     count: 100,
     percent: 8.1,
@@ -346,7 +346,7 @@ export const levels = [
     name: "K",
     range: [95, 99],
     gcount: 100,
-    gpercent: 10.1,
+    gpercent: 1,
     pt: 12,
     count: 100,
     percent: 8.1,

+ 5 - 1
src/constants/chartOptions.js

@@ -2,6 +2,10 @@ function getLineOption(datas, title) {
   if (!datas.chartLabels.length) return;
 
   return {
+    title: {
+      text: title,
+      left: 0
+    },
     grid: {
       top: "15%",
       bottom: "18%"
@@ -43,7 +47,7 @@ function getLineOption(datas, title) {
         name: "数量",
         type: "line",
         smooth: true,
-        data: datas.chartData[0],
+        data: datas.chartData,
         areaStyle: {
           color: "#b23f3a",
           opacity: 0.3

+ 15 - 0
src/constants/enumerate.js

@@ -83,11 +83,26 @@ export const IMAGE_NAME_TYPE = {
   0: "按考号命名",
   1: "随机码命名"
 };
+export const EXPORT_IMAGE_NAME_TYPE = {
+  0: "考号+姓名",
+  1: "流水号"
+};
+// image-type
+export const IMAGE_TYPE = {
+  0: "原图",
+  1: "裁切图"
+};
+
 // paper-level-known-type
 export const PAPER_LEVEL_KNOWN_TYPE = {
   0: "未知",
   1: "已知"
 };
+// paper-upload-type
+export const PAPER_UPLOAD_TYPE = {
+  0: "未上传",
+  1: "已上传"
+};
 
 // score-handle-type
 export const SCORE_HANDLE_TYPE = {

+ 7 - 7
src/modules/client-set/ClientAccountSet.vue

@@ -85,14 +85,14 @@ export default {
                 action: () => {
                   this.toEdit(param.row);
                 }
-              },
-              {
-                name: "删除",
-                type: "error",
-                action: () => {
-                  this.toDelete(param.row);
-                }
               }
+              // {
+              //   name: "删除",
+              //   type: "error",
+              //   action: () => {
+              //     this.toDelete(param.row);
+              //   }
+              // }
             ];
             return h("div", this.$tableAction(h, actions));
           }

+ 35 - 36
src/modules/client-set/ClientParamSet.vue

@@ -4,40 +4,39 @@
       <Col span="12">
         <div class="part-box">
           <h2 class="client-param-title">科目名称设置</h2>
-          <div class="part-box-top">
-            <Button type="success" icon="md-add" @click="toAdd">新增</Button>
-          </div>
-
           <table class="table table-noborder">
-            <tr>
-              <th>序号</th>
-              <th>科目名称</th>
-              <th>科目代码</th>
-              <th>操作</th>
-            </tr>
             <template v-for="(subject, index) in subjects">
               <tr :key="index">
-                <td>{{ index + 1 }}</td>
                 <td>
                   <Input
                     v-model="subject.subjectName"
                     @on-blur="checkSubjectValidate(subject)"
+                    :disabled="!subject.enable"
+                    :readonly="!subject.canEdit"
                     clearable
                   ></Input>
                 </td>
-                <td>
-                  <Input
-                    v-model="subject.subjectCode"
-                    @on-blur="checkSubjectValidate(subject)"
-                    clearable
-                  ></Input>
-                </td>
-                <td style="width: 120px;">
-                  <Button size="small" type="primary" @click="toSave(subject)"
-                    >保存</Button
+                <td style="width: 180px;">
+                  <Button
+                    size="small"
+                    type="primary"
+                    :disabled="!subject.enable"
+                    @click="toEdit(index)"
+                    >编辑</Button
+                  >
+                  <Button
+                    size="small"
+                    :type="subject.enable ? 'error' : 'primary'"
+                    @click="toAble(index)"
                   >
-                  <Button size="small" type="error" @click="toDelete(index)"
-                    >删除</Button
+                    {{ subject.enable ? "禁用" : "启用" }}</Button
+                  >
+                  <Button
+                    size="small"
+                    type="primary"
+                    :disabled="!subject.enable"
+                    @click="toSave(subject)"
+                    >保存</Button
                   >
                 </td>
               </tr>
@@ -46,9 +45,7 @@
                 v-if="subject.errors"
                 :key="index + '1'"
               >
-                <td></td>
                 <td>{{ subject.errors.subjectName }}</td>
-                <td>{{ subject.errors.subjectCode }}</td>
                 <td></td>
               </tr>
             </template>
@@ -130,7 +127,8 @@ schema.warning = function() {};
 const initSubject = {
   id: "",
   subjectName: "",
-  subjectCode: "",
+  enable: true,
+  canEdit: false,
   password: ""
 };
 
@@ -168,6 +166,10 @@ export default {
     toAdd() {
       this.subjects.push({ ...initSubject });
     },
+    toEdit(index) {
+      const row = this.subjects[index];
+      row.canEdit = true;
+    },
     checkSubjectValidate(subject) {
       const descriptor = {
         subjectName: [
@@ -177,13 +179,6 @@ export default {
             max: 20,
             message: "科目名称长度只能介于2到20之间"
           }
-        ],
-        subjectCode: [
-          {
-            required: true,
-            pattern: /^[a-zA-Z0-9_]{3,20}$/,
-            message: "科目代码只能由数字、字母和下划线组成,长度2-20个字符"
-          }
         ]
       };
       return new schema(descriptor)
@@ -205,12 +200,16 @@ export default {
       if (result) return;
 
       await updateSubject(row);
+      row.canEdit = false;
       this.$Message.success("保存成功!");
-      this.getList();
+    },
+    toAble(index) {
+      const row = this.subjects[index];
+      row.enable = !row.enable;
+      // TODO:
+      console.log(row);
     },
     toDelete(index) {
-      console.log(index);
-
       const row = this.subjects[index];
       if (!row.id) {
         this.subjects.splice(index, 1);

+ 4 - 4
src/modules/client-set/components/ModifyClientUser.vue

@@ -13,17 +13,17 @@
       :key="modalForm.id"
       :label-width="100"
     >
-      <FormItem prop="name" label="姓名">
+      <FormItem prop="loginName" label="账号">
         <Input
           v-model.trim="modalForm.loginName"
-          placeholder="请输入姓名"
+          placeholder="请输入账号"
           clearable
         ></Input>
       </FormItem>
-      <FormItem prop="examNumber" label="考号">
+      <FormItem prop="password" label="密码">
         <Input
           v-model.trim="modalForm.password"
-          placeholder="请输入考号"
+          placeholder="请输入密码"
           clearable
         ></Input>
       </FormItem>

+ 1 - 1
src/modules/grading-set/GradingRuleSet.vue

@@ -77,7 +77,7 @@ export default {
       workId: this.$route.params.workId,
       BOOLEAN_TYPE,
       initModalForm: {
-        arbitrateGradeIntervel: null,
+        arbitrateGradeIntervel: 3,
         refuseTotalCount: null,
         autoRefuse: 0,
         isOverHalfConfirm: 0,

+ 7 - 7
src/modules/grading/GradingDetail.vue

@@ -61,13 +61,13 @@
       <!-- detail-aciton -->
       <div class="detail-action">
         <grade-action
-          :paper="curPage"
+          :paper="curPaper"
           :levels="levels"
           :step="curStep"
           :user-role="curUserRoleType"
           @on-confirm="gradeCurPaper"
           ref="GradeAction"
-          v-if="curPage.id && curStep.name"
+          v-if="curPaper.id && curStep.name"
         ></grade-action>
       </div>
     </div>
@@ -133,7 +133,7 @@ export default {
       steps: [],
       levels: levels,
       papers: [],
-      curPage: {},
+      curPaper: {},
       curPaperIndex: 0
     };
   },
@@ -203,7 +203,7 @@ export default {
         }
       ];
       this.$refs.GradeStep.selectStep(this.steps[0]);
-      this.curPage = { ...this.papers[0] };
+      this.curPaper = { ...this.papers[0] };
       this.curPaperIndex = 0;
     },
     async getList() {
@@ -245,16 +245,16 @@ export default {
       this.curStep = step;
     },
     toReview(index) {
-      this.curPage = { ...this.papers[index] };
+      this.curPaper = { ...this.papers[index] };
       this.curPaperIndex = index;
       this.$refs.ImagePreview.open();
     },
     paperPrev(index) {
-      this.curPage = { ...this.papers[index] };
+      this.curPaper = { ...this.papers[index] };
       this.curPaperIndex = index;
     },
     paperNext(index) {
-      this.curPage = { ...this.papers[index] };
+      this.curPaper = { ...this.papers[index] };
       this.curPaperIndex = index;
     },
     prevPage() {

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

@@ -176,9 +176,6 @@ export default {
     }
   },
   watch: {
-    step(val) {
-      this.rebuildRight();
-    },
     paper(val) {
       this.rebuildRight();
     }

+ 92 - 13
src/modules/grading/components/GradeAnalysis.vue

@@ -1,19 +1,82 @@
 <template>
-  <div class="grade-analysis part-box">
-    <div class="analysis-part">
+  <div class="grade-analysis">
+    <div class="part-box">
+      <div class="part-box-top">
+        <Button type="success" icon="md-download" @click="toExport"
+          >导出</Button
+        >
+      </div>
+      <Table
+        ref="TableList"
+        :columns="columns"
+        :data="levelData"
+        :span-method="handleSpan"
+        disabled-hover
+        border
+        v-if="levelData.length"
+      ></Table>
+    </div>
+    <div class="part-box">
       <v-chart :options="barOption" v-if="barOption" autoresize></v-chart>
     </div>
   </div>
 </template>
 
 <script>
+import { levels } from "@/constants/apiTempData";
 import chartOption from "@/constants/chartOptions";
 
 export default {
   name: "grade-analysis",
   data() {
     return {
-      barOption: {}
+      barOption: {},
+      levelData: [],
+      columns: [
+        {
+          title: "科目",
+          key: "subject"
+        },
+        {
+          title: "档位",
+          key: "name"
+        },
+        {
+          title: "范围",
+          key: "range",
+          render: (h, param) => {
+            return h("div", `${param.row.range[0]}~${param.row.range[1]}`);
+          }
+        },
+        {
+          title: "数量",
+          key: "count"
+        },
+        {
+          title: "占比",
+          key: "percent"
+        },
+        {
+          title: "预设占比",
+          key: "pt"
+        },
+        {
+          title: "差值",
+          key: "ptDis"
+        },
+        {
+          title: "累计数量",
+          key: "gcount"
+        },
+        {
+          title: "累计占比",
+          key: "percent"
+        },
+        {
+          title: "调整",
+          key: "justify"
+        }
+      ]
     };
   },
   mounted() {
@@ -41,18 +104,34 @@ export default {
       };
     },
     initData() {
-      const data = [
-        {
-          data: [{ prop: 37.5, markerId: 98, markerName: "pj001" }],
-          name: "A"
-        },
-        { data: [{ prop: 62.5, markerId: 98, markerName: "pj001" }], name: "B" }
-      ];
-      this.barOption = chartOption.getBarGroupOption(
-        this.parseGroupBarData(data),
+      let chartLabels = [],
+        chartData = [];
+      levels.map(item => {
+        chartLabels.push(item.name);
+        chartData.push(item.gpercent);
+      });
+      this.barOption = chartOption.getLineOption(
+        { chartData, chartLabels },
         "档位分布图"
       );
-    }
+
+      this.levelData = levels.map(item => {
+        return {
+          ...item,
+          subject: "速写",
+          ptDis: 2,
+          justify: 200
+        };
+      });
+    },
+    handleSpan({ row, column, rowIndex, columnIndex }) {
+      if (rowIndex === 0 && columnIndex === 0) {
+        return { rowspan: this.levelData.length, colspan: 1 };
+      } else if (rowIndex > 0 && columnIndex === 0) {
+        return { rowspan: 0, colspan: 0 };
+      }
+    },
+    toExport() {}
   }
 };
 </script>

+ 26 - 8
src/modules/inspection/InspectionGrading.vue

@@ -73,13 +73,17 @@
           <p>原档位:{{ curPaper.orgGrade }}</p>
           <p>申请档位:{{ curPaper.applyGrade }}</p>
         </div>
-        <Button
-          type="primary"
-          @click="confirm"
-          :disabled="curPaper.status"
-          v-if="curPaper.id"
-          >{{ curPaper.status ? "已同意" : "同意改档" }}</Button
-        >
+        <div class="check-grade-result" v-if="curPaper.id">
+          <p>{{ curPaper.status ? "已同意" : "未同意" }}</p>
+        </div>
+        <div class="check-grade-btn" v-if="curPaper.id">
+          <Button type="primary" @click="confirm(1)" :disabled="curPaper.status"
+            >同意改档</Button
+          >
+          <Button type="error" @click="confirm(0)" :disabled="curPaper.status"
+            >不同意改档</Button
+          >
+        </div>
       </div>
     </div>
 
@@ -173,7 +177,21 @@ export default {
       this.current = page;
       this.getList();
     },
-    async confirm() {
+    async confirm(isAgree) {
+      if (isAgree) {
+        this.updateCheckGradeState(status);
+        return;
+      }
+
+      this.$Modal.confirm({
+        title: "操作警告",
+        content: "确定不同意当前改档吗?",
+        onOk: () => {
+          this.updateCheckGradeState(status);
+        }
+      });
+    },
+    async updateCheckGradeState(status) {
       // TODO:
       await inspectionConfirmCheckGrade(this.curPaper.id);
       this.$refs.ImagePreview.showNext();

+ 99 - 6
src/modules/login/ResetPwd.vue

@@ -1,15 +1,108 @@
 <template>
-  <div class="reset-pwd">
-    reset-pwd
-  </div>
+  <Modal
+    class="reset-pswd"
+    v-model="modalIsShow"
+    title="修改密码"
+    :mask-closable="false"
+    @on-visible-change="visibleChange"
+  >
+    <Form ref="resetForm" :model="reset" :rules="resetRules">
+      <FormItem prop="password">
+        <Input
+          type="password"
+          v-model="reset.password"
+          placeholder="请输入旧密码"
+          clearable
+        ></Input>
+      </FormItem>
+      <FormItem prop="newpswd">
+        <Input
+          type="password"
+          v-model="reset.newpswd"
+          placeholder="请输入新密码"
+          clearable
+        ></Input>
+      </FormItem>
+      <FormItem prop="renewpswd">
+        <Input
+          type="password"
+          v-model="reset.renewpswd"
+          placeholder="请再次输入新密码"
+          clearable
+        ></Input>
+      </FormItem>
+    </Form>
+    <div slot="footer">
+      <Button type="text" @click="cancel">取消</Button>
+      <Button type="primary" :disabled="isSubmit" @click="submit">确定</Button>
+    </div>
+  </Modal>
 </template>
 
 <script>
+import { resetPwd } from "@/api";
+import { password } from "@/plugins/formRules";
+
+const initModalForm = {
+  password: "",
+  newpswd: "",
+  renewpswd: ""
+};
 export default {
-  name: "reset-pwd",
+  name: "reset-pswd",
   data() {
-    return {};
+    const equalToPswd = (rule, value, callback) => {
+      if (value !== this.reset.newpswd) {
+        callback(new Error("两次输入的密码不一致"));
+      } else {
+        callback();
+      }
+    };
+
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      reset: {
+        ...initModalForm
+      },
+      resetRules: {
+        password,
+        newpswd: password,
+        renewpswd: [
+          ...password,
+          {
+            validator: equalToPswd,
+            trigger: "blur"
+          }
+        ]
+      }
+    };
   },
-  methods: {}
+  methods: {
+    visibleChange(visible) {
+      if (visible) {
+        this.reset = { ...initModalForm };
+      }
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit(name) {
+      const valid = await this.$refs[name].validate();
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      const data = await resetPwd(this.reset).catch(() => {});
+      this.isSubmit = false;
+      if (!data) return;
+
+      this.cancel();
+      this.$emit("confirm", this.reset.newpswd);
+    }
+  }
 };
 </script>

+ 12 - 4
src/modules/login/login.vue

@@ -38,15 +38,19 @@
         </Form>
       </div>
     </div>
+
+    <reset-pwd @confirm="resetSuccess" ref="ResetPwd"></reset-pwd>
   </div>
 </template>
 
 <script>
 import { username, password } from "@/plugins/formRules";
 import { login } from "@/api";
+import ResetPwd from "./ResetPwd";
 
 export default {
   name: "login",
+  components: { ResetPwd },
   data() {
     return {
       loginModel: {
@@ -70,18 +74,22 @@ export default {
 
       if (this.isSubmit) return;
       this.isSubmit = true;
-      const data = await login(this.loginModel).catch(() => {
-        this.isSubmit = false;
-      });
+      const data = await login(this.loginModel).catch(() => {});
+      this.isSubmit = false;
       if (!data) return;
 
-      this.isSubmit = false;
       this.$ls.set("user", data, this.GLOBAL.authTimeout);
       this.$store.commit("setUser", data);
       // TODO:根据角色跳转不同的路由
       this.$router.push({
         name: "WorkManage"
       });
+    },
+    resetSuccess() {
+      this.loginModel = {
+        loginName: "",
+        password: ""
+      };
     }
   }
 };

+ 7 - 7
src/modules/main/PaperManage.vue

@@ -2,31 +2,31 @@
   <div class="papers">
     <div class="part-box">
       <Form ref="FilterForm" label-position="left" inline>
-        <FormItem label="科目">
+        <FormItem label="科目">
           <Select v-model="filter.subject" placeholder="请选择科目">
             <Option value=""></Option>
           </Select>
         </FormItem>
-        <FormItem label="考点">
+        <FormItem label="考点">
           <Select v-model="filter.examRoom" placeholder="请选择考点">
             <Option value=""></Option>
           </Select>
         </FormItem>
-        <FormItem label="开始编号">
+        <FormItem label="开始编号">
           <InputNumber
             v-model="filter.startNumber"
             placeholder="请输入数字"
             clearable
           ></InputNumber>
         </FormItem>
-        <FormItem label="结束编号">
+        <FormItem label="结束编号">
           <InputNumber
             v-model="filter.endNumber"
             placeholder="请输入数字"
             clearable
           ></InputNumber>
         </FormItem>
-        <FormItem label="类型">
+        <FormItem label="类型">
           <Select v-model="filter.isAbsent">
             <Option
               v-for="(val, key) in CAFA_EXCEPTION_TYPE"
@@ -36,14 +36,14 @@
             ></Option>
           </Select>
         </FormItem>
-        <FormItem label="姓名">
+        <FormItem label="姓名">
           <Input
             v-model.trim="filter.name"
             placeholder="工作名称"
             clearable
           ></Input>
         </FormItem>
-        <FormItem label="排列方式">
+        <FormItem label="排列方式">
           <Select v-model="filter.sort">
             <Option
               v-for="(val, key) in SORT_RULE_TYPE"

+ 28 - 15
src/modules/main/StudentManage.vue

@@ -16,55 +16,65 @@
     </div>
     <div class="part-box">
       <Form ref="FilterForm" label-position="left" inline>
-        <FormItem label="考区">
+        <FormItem label="考区">
           <Select v-model="filter.areaCode" placeholder="请选择考区">
             <Option value=""></Option>
           </Select>
         </FormItem>
-        <FormItem label="学校">
+        <FormItem label="学校">
           <Select v-model="filter.schoolId" placeholder="请选择学校">
             <Option value=""></Option>
           </Select>
         </FormItem>
-        <FormItem label="考场">
+        <FormItem label="考场">
           <Select v-model="filter.examRoom" placeholder="请选择考场">
             <Option value=""></Option>
           </Select>
         </FormItem>
-        <FormItem label="科目">
+        <FormItem label="科目">
           <Select v-model="filter.subject" placeholder="请选择科目">
             <Option value=""></Option>
           </Select>
         </FormItem>
-        <FormItem label="起始考号">
+        <FormItem label="起始考号">
           <InputNumber
             v-model="filter.startNumber"
             placeholder="请输入数字"
             clearable
           ></InputNumber>
         </FormItem>
-        <FormItem label="终止考号">
+        <FormItem label="终止考号">
           <InputNumber
             v-model="filter.endNumber"
             placeholder="请输入数字"
             clearable
           ></InputNumber>
         </FormItem>
-        <FormItem label="姓名">
+        <FormItem label="姓名">
           <Input
             v-model.trim="filter.name"
             placeholder="工作名称"
             clearable
           ></Input>
         </FormItem>
-        <FormItem label="是否缺考">
+        <FormItem label="是否缺考">
           <Select v-model="filter.isAbsent" placeholder="请选择是否缺考">
-            <Option value=""></Option>
+            <Option
+              v-for="(val, key) in BOOLEAN_TYPE"
+              :key="key"
+              :value="key * 1"
+              >{{ val }}</Option
+            >
           </Select>
         </FormItem>
-        <FormItem label="状态:">
+        <FormItem label="状态">
           <Select v-model="filter.upload" placeholder="请选择状态">
-            <Option value=""></Option>
+            <Option
+              v-for="(val, key) in PAPER_UPLOAD_TYPE"
+              :key="key"
+              :value="key * 1"
+              >{{ val }}</Option
+            >
           </Select>
         </FormItem>
         <FormItem>
@@ -133,6 +143,7 @@
 import { studentPageList, deleteStudent } from "@/api";
 import ImportFile from "@/components/common/ImportFile";
 import ModifyStudent from "./components/ModifyStudent";
+import { BOOLEAN_TYPE, PAPER_UPLOAD_TYPE } from "@/constants/enumerate";
 
 export default {
   name: "students",
@@ -146,10 +157,10 @@ export default {
         examRoom: "",
         startNumber: null,
         endNumber: null,
-        subject: "",
-        areaCode: "",
-        upload: "",
-        isAbsent: ""
+        subject: null,
+        areaCode: null,
+        upload: null,
+        isAbsent: 0
       },
       current: 1,
       size: this.GLOBAL.pageSize,
@@ -157,6 +168,8 @@ export default {
       students: [],
       curStudent: {},
       isBuildColumn: false,
+      BOOLEAN_TYPE,
+      PAPER_UPLOAD_TYPE,
       columns: [
         {
           type: "index",

+ 23 - 4
src/modules/mark-set/ExportPaper.vue

@@ -7,7 +7,12 @@
       <Form label-position="left" inline>
         <FormItem label="图片类型:">
           <Select v-model="scoreFilter.imageType" placeholder="请选择图片类型">
-            <Option value=""></Option>
+            <Option
+              v-for="(val, key) in IMAGE_TYPE"
+              :key="key"
+              :value="key * 1"
+              >{{ val }}</Option
+            >
           </Select>
         </FormItem>
         <FormItem label="考点:">
@@ -32,7 +37,12 @@
         </FormItem>
         <FormItem label="命名规则:">
           <Select v-model="scoreFilter.nameRule" placeholder="请选择命名规则">
-            <Option value=""></Option>
+            <Option
+              v-for="(val, key) in EXPORT_IMAGE_NAME_TYPE"
+              :key="key"
+              :value="key * 1"
+              >{{ val }}</Option
+            >
           </Select>
         </FormItem>
         <FormItem label="起始分数:">
@@ -64,7 +74,12 @@
       <Form label-position="left" inline>
         <FormItem label="图片类型:">
           <Select v-model="renameFilter.imageType" placeholder="请选择图片类型">
-            <Option value=""></Option>
+            <Option
+              v-for="(val, key) in IMAGE_TYPE"
+              :key="key"
+              :value="key * 1"
+              >{{ val }}</Option
+            >
           </Select>
         </FormItem>
         <FormItem label="考点:">
@@ -88,6 +103,8 @@
 </template>
 
 <script>
+import { IMAGE_TYPE, EXPORT_IMAGE_NAME_TYPE } from "@/constants/enumerate";
+
 export default {
   name: "export-paper",
   data() {
@@ -106,7 +123,9 @@ export default {
         imageType: "",
         areaCode: "",
         subjectId: ""
-      }
+      },
+      IMAGE_TYPE,
+      EXPORT_IMAGE_NAME_TYPE
     };
   },
   methods: {

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

@@ -55,7 +55,7 @@ export default {
       BOOLEAN_TYPE,
       SCORE_HANDLE_TYPE,
       initModalForm: {
-        scoreRule: "",
+        scoreRule: 0,
         changeGradeMarkType: 0,
         isShowAllPaper: 0
       },

+ 8 - 5
src/modules/mark/MarkDetail.vue

@@ -55,7 +55,10 @@
       <!-- detail-aciton -->
       <div class="detail-action">
         <mark-action
-          :paper="curPage"
+          :paper="curPaper"
+          :levels="levels"
+          :step="curStep"
+          :user-role="curUserRoleType"
           @on-confirm="gradeCurPaper"
           ref="GradeAction"
         ></mark-action>
@@ -114,7 +117,7 @@ export default {
       curStandardGradeId: "",
       levels: [],
       papers: [],
-      curPage: {},
+      curPaper: {},
       curPaperIndex: 0
     };
   },
@@ -200,16 +203,16 @@ export default {
       this.curStep = step;
     },
     toReview(index) {
-      this.curPage = { ...this.papers[index] };
+      this.curPaper = { ...this.papers[index] };
       this.curPaperIndex = index;
       this.$refs.ImagePreview.open();
     },
     paperPrev(index) {
-      this.curPage = { ...this.papers[index] };
+      this.curPaper = { ...this.papers[index] };
       this.curPaperIndex = index;
     },
     paperNext(index) {
-      this.curPage = { ...this.papers[index] };
+      this.curPaper = { ...this.papers[index] };
       this.curPaperIndex = index;
     },
     prevPage() {

+ 187 - 19
src/modules/mark/components/MarkAction.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="mark-action grade-action">
-    <div class="action-search">
+    <!-- 查询 -->
+    <div class="action-search" v-if="rights.search">
       <Input v-model.trim="filter.code" placeholder="请输入号码">
         <Select
           v-model="filter.codeType"
@@ -18,15 +19,44 @@
         <Button icon="ios-search" slot="append" @click="search"></Button>
       </Input>
     </div>
-
-    <div class="action-paper-info">
+    <!-- 改档处理状态查询 -->
+    <div class="action-grade-change-search" v-if="rights.gradeChangeSearch">
+      <Select v-model="filter.codeType" placeholder="类型" style="width: 100px">
+        <Option
+          v-for="(val, key) in CODE_TYPE"
+          :key="key"
+          :value="key"
+          :label="val"
+        ></Option>
+      </Select>
+      <Button
+        icon="ios-search"
+        slot="append"
+        @click="gradeChangeSearch"
+      ></Button>
+    </div>
+    <!-- 头部信息 ------ -->
+    <!-- 试卷状态 -->
+    <!-- 状态:已评,待评,改档,改档打分 -->
+    <div class="action-paper-state" v-if="rights.paperState">
+      <p class="paper-state-cont">{{ step.typeName }}</p>
+    </div>
+    <!-- 试卷信息 -->
+    <div class="action-paper-info" v-if="rights.paperInfo">
       <p>{{ curPaper.examNumber }}</p>
       <p>No.{{ curPaper.sn }}</p>
     </div>
-
-    <p class="mark-info">{{ curMark }}</p>
-
-    <div class="action-grade-info">
+    <!-- 改档信息 -->
+    <div class="action-grade-change" v-if="rights.gradeChange">
+      <p>原档位:</p>
+      <p>申请档位:</p>
+    </div>
+    <div class="action-grade-change-status" v-if="rights.gradeChange">
+      <p>已同意</p>
+    </div>
+    <!-- 档位信息 -->
+    <!-- 已评/待评(已评档位),改档打分(已评档位) -->
+    <div class="action-grade-info" v-if="rights.gradeInfo">
       <h3 class="grade-info-name">{{ curLevel.name }}</h3>
       <p class="grade-info-range">
         <span>{{ curLevel.range[0] }}</span>
@@ -34,17 +64,26 @@
         <span>{{ curLevel.range[1] }}</span>
       </p>
     </div>
-    <div class="action-grade-list action-mark-list">
+    <!-- 打分信息 -->
+    <div class="action-mark-info" v-if="rights.markInfo">
+      <p>{{ curPaper.score }}</p>
+    </div>
+    <!-- 选择分数 / 档位 -->
+    <div class="action-grade-list action-mark-list" v-if="rights.gradeList">
       <div
         class="action-grade-list-item"
-        v-for="(level, index) in levels"
+        v-for="(level, index) in levelList"
         :key="index"
       >
-        <p>{{ level }}</p>
+        <p>{{ level.name }}</p>
+        <p>{{ level.range[0] }}~{{ level.range[1] }}</p>
       </div>
     </div>
-
-    <div class="action-grade-history">
+    <div class="action-grade-pass" v-if="rights.gradeList">
+      <Button type="primary" @click="toPass">跳过</Button>
+    </div>
+    <!-- 评卷记录 -->
+    <div class="action-grade-history" v-if="rights.markHis">
       <h3>评卷记录</h3>
       <div class="action-grade-list grade-history-list">
         <div
@@ -62,6 +101,22 @@
 
 <script>
 import { CODE_TYPE } from "@/constants/enumerate";
+// 三种情况:
+// 管理员(ADMIN),科组长(MARK_LEADER),评卷员(MARKER)
+// 管理员:查询,头部信息,评卷记录
+// 科组长:查询,头部信息,选择档位,评卷记录
+// 评卷员:头部信息,选择分数
+const initRights = {
+  search: false,
+  gradeChangeSearch: false,
+  paperState: false,
+  paperInfo: false,
+  gradeChange: false,
+  gradeInfo: false,
+  markInfo: false,
+  gradeList: false,
+  markHis: false
+};
 
 export default {
   name: "mark-action",
@@ -71,10 +126,78 @@ export default {
       default() {
         return {};
       }
+    },
+    levels: {
+      type: Array,
+      default() {
+        return [];
+      }
+    },
+    userRole: {
+      type: String,
+      default: "MARKER"
+    },
+    step: {
+      type: Object,
+      default() {
+        return {};
+      }
     }
   },
   data() {
     return {
+      rights: {
+        ...initRights
+      },
+      roleRight: {
+        ADMIN: {
+          done: [
+            "search",
+            "gradeHis",
+            "paperState",
+            "paperInfo",
+            "gradeInfo",
+            "markInfo"
+          ],
+          editGrade: [
+            "search",
+            "gradeChangeSearch",
+            "paperState",
+            "paperInfo",
+            "gradeChange"
+          ]
+        },
+        MARK_LEADER: {
+          done: [
+            "search",
+            "gradeList",
+            "gradeHis",
+            "paperState",
+            "paperInfo",
+            "gradeInfo",
+            "markInfo"
+          ],
+          editGrade: [
+            "search",
+            "gradeList",
+            "paperState",
+            "paperInfo",
+            "gradeChange"
+          ]
+        },
+        MARKER: {
+          done: [
+            "gradeList",
+            "paperState",
+            "paperInfo",
+            "gradeInfo",
+            "markInfo"
+          ],
+          undo: ["gradeList", "paperState", "paperInfo", "gradeInfo"],
+          editGrade: ["gradeList", "paperState", "paperInfo", "gradeChange"],
+          editGradeMark: ["gradeList", "paperState", "paperInfo", "gradeInfo"]
+        }
+      },
       filter: {
         codeType: "examNumber",
         code: ""
@@ -84,8 +207,8 @@ export default {
         examNumber: "2020105133",
         sn: "2020105133"
       },
+      levelList: [],
       gradingHistory: [],
-      levels: [],
       curLevel: {
         name: "A",
         range: [5, 20]
@@ -93,17 +216,27 @@ export default {
       curMark: 95
     };
   },
+  computed: {
+    IS_ADMIN() {
+      return this.userRole === "ADMIN";
+    },
+    IS_MARKER() {
+      return this.userRole === "MARKER";
+    },
+    IS_MARK_LEADER() {
+      return this.userRole === "MARK_LEADER";
+    }
+  },
+  watch: {
+    paper(val) {
+      this.rebuildRight();
+    }
+  },
   mounted() {
     this.initData();
   },
   methods: {
     initData() {
-      let levels = [];
-      let [start, end] = this.curLevel.range;
-      for (let i = start; i <= end; i++) {
-        levels.push(i);
-      }
-      this.levels = levels;
       this.gradingHistory = "ABCDEFGHIJK".split("").map((item, index) => {
         return {
           id: index,
@@ -112,8 +245,43 @@ export default {
         };
       });
     },
+    rebuildRight() {
+      this.rights = { ...initRights };
+      const rights = this.roleRight[this.userRole][this.step.type] || [];
+      rights.map(key => {
+        this.rights[key] = true;
+      });
+
+      this.updateCurLevel();
+      this.updateLevelList();
+    },
+    updateCurLevel() {
+      if (!this.paper.level) return;
+      const paperLevel = this.levels.find(
+        level => level.name === this.paper.level
+      );
+      this.curLevel = {
+        name: paperLevel.name,
+        range: paperLevel.range
+      };
+    },
+    updateLevelList() {
+      if (!this.curLevel.range) return;
+      let levelList = [];
+      let [start, end] = this.curLevel.range;
+      for (let i = start; i <= end; i++) {
+        levelList.push({ name: i });
+      }
+      this.levelList = levelList;
+    },
     search() {
       this.$emit("code-search", this.filter);
+    },
+    toPass() {
+      this.$emit("on-pass");
+    },
+    gradeChangeSearch() {
+      this.$emit("grade-change-search", this.filter);
     }
   }
 };

+ 1 - 0
src/plugins/VueCharts.js

@@ -14,6 +14,7 @@ import "echarts/lib/component/dataZoom";
 
 // chart
 import "echarts/lib/chart/bar";
+import "echarts/lib/chart/line";
 // import "echarts/lib/chart/pie";
 // import "echarts/lib/chart/map";
 // map