Browse Source

Merge branch 'master' into liua

* master:
  ~
  ~
  缺考修改
  提交
  ~
  ~
  流程进度更新
  提交
  提交
  教师批阅进度数据接入
  ~
la 2 years ago
parent
commit
b7ae76f5d6

+ 4 - 0
auto-imports.d.ts

@@ -12,6 +12,8 @@ declare global {
   const $shallowRef: typeof import('vue/macros')['$shallowRef']
   const $toRef: typeof import('vue/macros')['$toRef']
   const EffectScope: typeof import('vue')['EffectScope']
+  const ElMessage: typeof import('element-plus/es')['ElMessage']
+  const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
   const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
   const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
   const computed: typeof import('vue')['computed']
@@ -298,6 +300,8 @@ declare module 'vue' {
     readonly $shallowRef: UnwrapRef<typeof import('vue/macros')['$shallowRef']>
     readonly $toRef: UnwrapRef<typeof import('vue/macros')['$toRef']>
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
+    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
+    readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
     readonly computed: UnwrapRef<typeof import('vue')['computed']>

+ 42 - 12
src/components/step/link/bjqk.vue

@@ -45,14 +45,43 @@ async function handleQuery() {
   }
 }
 
-function handleClickSign(id?: string) {
-  request({
-    url: '/yzy/kcgl/onekey2fill',
-    data: {
-      ze_id: _ykl_lc_.ze_id,
-      stuid: id,
-    },
-  }).then((res) => {
+function handleClickSign(row?: any) {
+  let req
+  if (row) {
+    if (['3', '4'].includes(row.dtk.statue)) {
+      req = request({
+        url: '/yzy/kcgl/onekey2fill',
+        data: {
+          ze_id: _ykl_lc_.ze_id,
+          stuid: row.user_id,
+        },
+      })
+    }
+    else if (['1', '2', '5'].includes(row.dtk.statue)) {
+      req = request({
+        url: '/yzy/kcgl/cancel_qk',
+        data: {
+          ysk_id: row.dtk.ysk_id,
+        },
+      })
+    }
+    else {
+      return ElMessage({
+        message: '正常的试卷,不应该参与按钮状态',
+        type: 'error',
+        grouping: true,
+      })
+    }
+  }
+  else {
+    req = request({
+      url: '/yzy/kcgl/onekey2fill',
+      data: {
+        ze_id: _ykl_lc_.ze_id,
+      },
+    })
+  }
+  req.then((res) => {
     if (res.code === '1') {
       ElMessage({
         message: res.msg,
@@ -71,7 +100,7 @@ function handleClickSign(id?: string) {
   }).catch((err) => {
     console.error(err)
     ElMessage({
-      message: '标记缺考失败',
+      message: '操作失败',
       type: 'success',
       grouping: true,
     })
@@ -107,10 +136,11 @@ function handleClickSign(id?: string) {
       <el-table-column prop="name" label="操作" width="120">
         <template #default="{ row }">
           <el-button
-            :type="row.dtk.ysk_id === '0' ? 'primary' : 'danger'" size="small"
-            @click="handleClickSign(row.user_id)"
+            :type="['3', '4'].includes(row.dtk.statue) ? 'primary' : 'danger'" size="small"
+            @click="handleClickSign(row)"
           >
-            {{ row.dtk.ysk_id === '0' ? '标记为缺考' : '取消标记缺考' }}
+            {{ ['3', '4'].includes(row.dtk.statue) ? '标记为缺考' : ['1', '2', '5'].includes(row.dtk.statue) ? '取消标记缺考' : '错误'
+            }}
           </el-button>
         </template>
       </el-table-column>

+ 7 - 6
src/components/step/link/szcjckqx.vue

@@ -21,13 +21,14 @@ const RoleList = [
   { user_role_id: '69', user_role_name: '县级管理员' },
   { user_role_id: '72', user_role_name: '校级管理员' },
   { user_role_id: '75', user_role_name: '所有教师' },
-  { user_role_id: 'pyjs', user_role_name: '批阅教师' },
-  { user_role_id: 'pyzz', user_role_name: '批阅组长' },
+  // { user_role_id: 'pyjs', user_role_name: '批阅教师' },
+  // { user_role_id: 'pyzz', user_role_name: '批阅组长' },
+  { user_role_id: 'jyy', user_role_name: '教研员' },
   { user_role_id: 'jczz', user_role_name: '检查组长' },
   { user_role_id: '76', user_role_name: '学生' },
 ]
 
-interface MemberItem { user_id: string; user_realname: string; user_role_name: string }
+interface MemberItem { user_id: string; user_realname: string; user_role_name: string; user_name: string }
 let MemberList = $ref<MemberItem[]>([])
 
 function handleClickLink() {
@@ -124,7 +125,7 @@ function queryMember(keyword: string) {
       },
     }).then((res) => {
       if (res.code === '1') {
-        MemberList = (res.data.page_data as MemberItem[]).map(({ user_id, user_realname, user_role_name }) => ({ user_id, user_realname, user_role_name }))
+        MemberList = (res.data.page_data as MemberItem[]).map(({ user_id, user_realname, user_role_name, user_name }) => ({ user_id, user_realname, user_role_name, user_name }))
         memberLoading = false
       }
     })
@@ -171,8 +172,8 @@ function queryMember(keyword: string) {
           placeholder="请输入账号,手机号或用户名" :remote-method="queryMember" :loading="memberLoading" value-key="user_id"
         >
           <el-option
-            v-for="item in MemberList" :key="item.user_id"
-            :label="`${item.user_role_name} - ${item.user_realname}`" :value="item"
+            v-for="item in MemberList" :key="item.user_id" :label="`${item.user_name} - ${item.user_realname}`"
+            :value="item"
           />
         </el-select>
       </el-form-item>

+ 13 - 3
src/pages/process/detail/[id].vue

@@ -53,10 +53,10 @@
              <span class="inline-block align-middle">进行中</span>
              <div class="inline-block align-middle ml-10px process-state">
                <h3 class="state-line">
-                 <span style="width: 11%;"></span>
+                 <span :style="{width: detail_percent}"></span>
                </h3>
              </div>
-             <span class="ml-10px inline-block align-middle">11%</span>
+             <span class="ml-10px inline-block align-middle">{{detail_percent}}</span>
            </div>
          </div>
        </div>
@@ -82,6 +82,7 @@ const linkTo = (name) => {
 };
 let ykj_id = $ref('');
 let ykj_detail = $ref({});
+let detail_percent = $ref('');
 function getDetail() {
   request({
     url: "/yzy/ksjh/detail",
@@ -91,10 +92,19 @@ function getDetail() {
   }).then((res) => {
     if (res.code === "1") {
       ykj_detail= res.data.one_info;
+      let total = 0;
+      for(let j in ykj_detail.lc) {
+        ykj_detail.lc[j].percent = getPercentage(JSON.parse(ykj_detail.lc[j].ykl_lc).processList) + '%'
+        total += getPercentage(JSON.parse(ykj_detail.lc[j].ykl_lc).processList)
+      }
+      detail_percent = Math.round(total/ykj_detail.lc.length) + '%';
     }
   });
 }
-
+function getPercentage(arr) {
+  const flatOne = arr.flat(1)
+  return Math.round(((flatOne.findLastIndex(l => l.includes(1)) + 1) / flatOne.length * 100))
+}
 if (route.params.id) {
   ykj_id = route.params.id;
   getDetail();

+ 86 - 11
src/pages/process/index.vue

@@ -63,10 +63,10 @@
                 <span class="inline-block align-middle">进行中</span>
                 <div class="inline-block align-middle ml-10px process-state">
                   <h3 class="state-line">
-                    <span style="width: 11%;"></span>
+                    <span :style="{width: item.percent}"></span>
                   </h3>
                 </div>
-                <span class="ml-10px inline-block align-middle">11%</span>
+                <span class="ml-10px inline-block align-middle">{{item.percent}}</span>
               </div>
               <div class="w-130px text-left">
                 <span v-if="item.ykj_kslx === '1'">周考</span>
@@ -79,15 +79,17 @@
               </div>
               <div class="w-220px text-left">{{item.ykj_ksrq}}~{{item.ykj_jsrq}}</div>
               <div class="w-300px">
-                <button type="button" class="op-btn" :disabled="item.create_user_id != user.user_id" @click="linkTo({name:'process-edit-id',params:{id:item.ykj_id}})">编辑</button>
+                <button type="button" class="op-btn" :disabled="item.btn_check.btn_edit != '1'" @click="linkTo({name:'process-edit-id',params:{id:item.ykj_id}})">编辑</button>
                 <button type="button" class="op-btn ml-10px" @click="linkTo({name:'process-detail-id',params:{id:item.ykj_id}})">详情</button>
                 <div class="ml-10px relative op-btn cursor-pointer">
                   <span class="inline-block align-middle leading-28px">更多</span>
                   <div class="more-list">
                     <ul>
-                      <li @click="linkTo({name:'process-smpyjd-ykj_id',params:{ykj_id:item.ykj_id}})">扫描批阅进度</li>
-                      <li>考试分析</li>
-                      <li v-if="item.create_user_id == user.user_id" @click="delProject(item)">删除</li>
+                      <li :class="item.btn_check.btn_jyysz != '1'?'disabled':''">教研员设置</li>
+                      <li :class="item.btn_check.btn_jsgzsz != '1'?'disabled':''">分数计算规则设置</li>
+                      <li :class="item.btn_check.btn_smpyjd != '1'?'disabled':''" @click="linkTo({name:'process-smpyjd-ykj_id',params:{ykj_id:item.ykj_id}})">扫描批阅进度</li>
+                      <li :class="item.btn_check.btn_ksfx != '1'?'disabled':''" @click="linkTo({name:'ksfx-cjfx_cjd-ykj_id',params:{ykj_id:item.ykj_id}})">考试分析</li>
+                      <li :class="item.btn_check.btn_sc != '1'?'disabled':''" @click="delProject(item)">删除</li>
                     </ul>
                   </div>
                 </div>
@@ -103,10 +105,10 @@
                     <div class="mt-5px">
                       <div class="inline-block align-middle process-state">
                         <h3 class="state-line">
-                          <span style="width: 11%;"></span>
+                          <span :style="{width: items.percent}"></span>
                         </h3>
                       </div>
-                      <span class="ml-10px text-14px inline-block align-middle">11%</span>
+                      <span class="ml-10px text-14px inline-block align-middle">{{items.percent}}</span>
                     </div>
                     <div class="mt-5px text-center">
                       <button type="button" class="op-btn" @click="toReview(items)">批阅任务</button>
@@ -160,6 +162,38 @@
     </template>
 
   </el-dialog>
+  <div class="score-set" v-if="set_pop">
+    <div class="score-set-box">
+      <h3 class="set-nav text-16px text-center leading-45px font-bold">分数计算规则设置</h3>
+      <h4 class="pl-70px mt-30px text-14px font-bold">分数区间设置</h4>
+      <div class="flex pl-80px mt-10px items-center">
+        <h4 class="text-14px leading-40px">优秀分数:</h4>
+        <h4 class="ml-10px text-14px leading-40px">总分的</h4>
+        <input type="text" class="ml-10px mr-5px set-in w-50px">
+        <h4 class="text-14px leading-40px">% {{'<='}}  学生分数 {{'<='}} 总分的</h4>
+        <input type="text" class="ml-10px mr-5px set-in w-50px">
+        %
+      </div>
+      <div class="mt-10px flex pl-80px mt-10px items-center">
+        <h4 class="text-14px leading-40px">及格分数:</h4>
+        <h4 class="ml-10px text-14px leading-40px">总分的</h4>
+        <input type="text" class="ml-10px mr-5px set-in w-50px">
+        <h4 class="text-14px leading-40px">% {{'<='}}  学生分数 {{'<='}} 总分的</h4>
+        <input type="text" class="ml-10px mr-5px set-in w-50px">
+        %
+      </div>
+      <div class="mt-10px flex pl-80px mt-10px items-center">
+        <h4 class="text-14px leading-40px">低分分数:</h4>
+        <h4 class="ml-10px text-14px leading-40px">总分的</h4>
+        <input type="text" class="ml-10px mr-5px set-in w-50px">
+        <h4 class="text-14px leading-40px">% {{'<='}}  学生分数 {{'<='}} 总分的</h4>
+        <input type="text" class="ml-10px mr-5px set-in w-50px">
+        %
+      </div>
+      <h4 class="pl-70px mt-40px text-14px font-bold">实考成绩分析规则设置</h4>
+
+    </div>
+  </div>
   <commonFooter/>
 </template>
 <route lang="json">
@@ -253,6 +287,12 @@ function getListData() {
         } else {
           listData[i].showSub = false;
         }
+        let total = 0;
+        for(let j in listData[i].lc) {
+          listData[i].lc[j].percent = getPercentage(JSON.parse(listData[i].lc[j].ykl_lc).processList) + '%'
+          total += getPercentage(JSON.parse(listData[i].lc[j].ykl_lc).processList)
+        }
+        listData[i].percent = Math.round(total/listData[i].lc.length) + '%';
 
       }
       // console.log(listData,87)
@@ -262,7 +302,10 @@ function getListData() {
   })
 }
 getListData();
-
+function getPercentage(arr) {
+  const flatOne = arr.flat(1)
+  return Math.round(((flatOne.findLastIndex(l => l.includes(1)) + 1) / flatOne.length * 100))
+}
 function filterData() {
   cur_page = 1;
   getListData();
@@ -369,6 +412,7 @@ function delProject(item) {
 function toReview(item) {
   window.location.href = window.GLOBAL_CONFIG.yzy+'webapps/page/single-review-liankao.html?ze_id='+item.ze_id;
 }
+let set_pop = $ref(false)
 </script>
 <style lang="scss" scoped>
 $color: #0048e5;
@@ -574,9 +618,9 @@ $color: #0048e5;
     position: absolute;
     left: 50%;
     top: 30px;
-    margin-left: -50px;
+    margin-left: -65px;
     z-index: 50;
-    width: 100px;
+    width: 130px;
     padding-top: 5px;
 
     ul {
@@ -678,4 +722,35 @@ $color: #0048e5;
   text-align: center;
 
 }
+.score-set{
+  position: fixed;
+  left: 0;
+  top: 0;
+  z-index: 2000;
+  width: 100%;
+  height: 100%;
+  background: rgba(0,0,0,.7);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.score-set-box{
+  width: 647px;
+  height: 721px;
+  background: #fff;
+  border-radius: 6px;
+  .set-nav{
+    width: 100%;
+    border-bottom: 1px solid #F3F3F3;
+  }
+  .set-in{
+    outline: none;
+    height: 40px;
+    background: #fff;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    font-size: 14px;
+    text-align: center;
+  }
+}
 </style>

+ 33 - 0
src/pages/process/pyjd/[id]/[bh].vue

@@ -0,0 +1,33 @@
+<script setup>
+import request from "~/utils/request";
+import {REQUEST} from "~/utils/request";
+import {user} from "~/store";
+import {useRouter} from "vue-router";
+const router = useRouter();
+const route = useRoute();
+const linkTo = (obj) => {
+  router.push(obj);
+};
+let ykj_id = $ref('');
+</script>
+<route lang="json">
+{
+"meta":{
+"title":"教师批阅进度详情",
+"breadcrumb":true
+}
+}
+</route>
+<template>
+  <NavHeader/>
+  <bread-crumb/>
+  <div class="w-1200px m-auto">
+    <div class="relative -mt-40px flex justify-end">
+      <button type="button" class="back-btn" @click="linkTo({name:'process'})">返回</button>
+    </div>
+  </div>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 28 - 23
src/pages/process/pyjd/[ykj_id].vue

@@ -15,8 +15,9 @@ let sm_id = $ref('');
 let subject_id = $ref('')
 let school_list = $ref([])
 let subject_list = $ref([])
-let tableData = $ref([])
-let barSubject = $ref([]);
+let teacherData = $ref([])
+let subjectData = $ref([]);
+let barTeacher = $ref([]);
 let barPercent = $ref([]);
 let barUnusual = $ref(['缺考','学号异常','页码异常','缺考异常','客观题异常','选择题异常','判断题异常','填空题异常']);
 let barUnData = $ref([40,70,100,70,70,70,80,90])
@@ -52,21 +53,25 @@ function getData() {
     subject_id: subject_id,
   };
   request({
-    url: "/yzy/scan/km",
+    url: "/yzy/jspyjd/main",
     data: data,
   }).then((res) => {
     if (res.code === '1') {
-      ykj_name = res.data.ksjh.ykj_ksrwmc;
-      tableData = res.data.list;
-      barSubject = [];
-      barPercent = [];
-      tableData.forEach(item =>{
-        barSubject.push(item.ze_xueke_name);
-        barPercent.push(item.scan_percent);
-      })
-      nextTick(()=>{
-        initChart();
-      })
+      ykj_name = res.data.data1.ksjh.ykj_ksrwmc;
+      teacherData = res.data.data1.list;
+      barTeacher = res.data.data1.users;
+      barPercent = res.data.data1.values;
+      if (cur_sub.id === '1') {
+        nextTick(() => {
+          initChart();
+        })
+
+      } else {
+        nextTick(() => {
+          initUnChart();
+        })
+
+      }
 
     }
   })
@@ -91,7 +96,7 @@ function initChart() {
       {
         type: 'category',
         name: '教师',
-        data: barSubject,
+        data: barTeacher,
         axisTick: {
           alignWithLabel: true
         },
@@ -263,14 +268,14 @@ onMounted(() => {
             <th>平均分</th>
             <th>操作</th>
           </tr>
-          <tr v-for="item in tableData">
-            <td>{{item.ze_xueke_name}}</td>
-            <td>{{item.scan_percent}}</td>
-            <td>{{item.student_num}}</td>
-            <td>{{item.scan_num}}</td>
-            <td>{{item.qks}}</td>
+          <tr v-for="item in teacherData">
+            <td>{{item.user_name}}</td>
+            <td>{{item.jd}}%</td>
+            <td>{{item.wcl}}</td>
+            <td>{{item.zfs}}</td>
+            <td>{{item.pjf}}</td>
             <td>
-              <button type="button" class="op-btn">查看详情</button>
+              <button type="button" class="op-btn" @click="linkTo({name:'process-pyjd-id-bh',params:{id:ykj_id,bh:item.ysdt_pyyhbh}})">查看详情</button>
             </td>
           </tr>
         </table>
@@ -289,7 +294,7 @@ onMounted(() => {
             <th>在线人数</th>
             <th>操作</th>
           </tr>
-          <tr v-for="item in tableData">
+          <tr v-for="item in subjectData">
             <td>{{item.ze_xueke_name}}</td>
             <td>{{item.scan_percent}}</td>
             <td>{{item.student_num}}</td>

+ 22 - 9
src/pages/step/[id].vue

@@ -32,8 +32,8 @@ const steps = reactive(
             {
               title: '出题组卷',
               children: [
-                { title: '章节知识点出题', optional: true, description: '选择相应的章节知识点从题库中选取题目组成试卷' },
-                { title: '智能出题', optional: true, description: '填写题型数量难易度等信息系统自动生成试卷' },
+                { title: '章节知识点出题', optional: true, disabled: true, description: '选择相应的章节知识点从题库中选取题目组成试卷' },
+                { title: '智能出题', optional: true, disabled: true, description: '填写题型数量难易度等信息系统自动生成试卷' },
                 { title: '附件出题', optional: true, description: '根据上传附件试卷进行考试' },
               ],
             },
@@ -62,9 +62,9 @@ const steps = reactive(
               ],
             },
             {
-              title: '平台接收试卷确认',
+              title: '压缩包上传情况',
               children: [
-                { title: '平台接收试卷确认', optional: false, description: '时间及试题均接收并识别入库完成' },
+                { title: '压缩包上传情况', optional: false, description: '启动客户端扫描试卷形成压缩包打包上传平台' },
               ],
             },
             {
@@ -140,8 +140,8 @@ const steps = reactive(
             {
               title: '出题组卷',
               children: [
-                { title: '章节知识点出题', optional: true, description: '选择相应的章节知识点从题库中选取题目组成试卷' },
-                { title: '智能出题', optional: true, description: '填写题型数量难易度等信息系统自动生成试卷' },
+                { title: '章节知识点出题', optional: true, disabled: true, description: '选择相应的章节知识点从题库中选取题目组成试卷' },
+                { title: '智能出题', optional: true, disabled: true, description: '填写题型数量难易度等信息系统自动生成试卷' },
                 { title: '附件出题', optional: true, description: '根据上传附件试卷进行考试' },
               ],
             },
@@ -429,7 +429,7 @@ function handleCompleteTask(gid: number, pid: number, cid: number, val?: unknown
 }
 
 async function handleJumpTask(gid: number, pid: number, idy: number) {
-  // todo: 验证任务是否完成
+  // 验证任务是否完成
   if (judgeStepCompleted(stepsReactiveMap[gid][pid][idy])) {
     return ElMessage({
       message: '该任务已完成',
@@ -459,6 +459,12 @@ function handleCompleteTaskAuto() {
 }
 
 const TaskEventMap: { [key: string]: () => void } = {
+  '章节知识点出题': () => {
+    ElMessage.info('暂未开放')
+  },
+  '智能出题': () => {
+    ElMessage.info('暂未开放')
+  },
   '附件出题': () => {
     routerPush({ name: 'process-fjct-ze_id-zs_id', params: { ze_id: ykl_lc.ze_id, zs_id: ykl_lc.zs_id } })
   },
@@ -484,6 +490,11 @@ const TaskEventMap: { [key: string]: () => void } = {
     window.open(`BozeduYuejuan://${user.value.token},${ykl_lc.ze_id},${window.GLOBAL_CONFIG.yzy},upload_papers`, '_blank')
     handleCompleteTaskAuto()
   },
+  '压缩包上传情况': () => {
+    // todo: 需调整【压缩包】上传情况
+    routerPush(`/process/ysb/${ykl_lc.ykl_id}/${ykl_lc.ze_id}`)
+    handleCompleteTaskAuto()
+  },
   '答题卡二次扫描': () => {
     window.open(`BozeduYuejuan://${user.value.token},${ykl_lc.ze_id},${window.GLOBAL_CONFIG.yzy},review_papers`, '_blank')
     handleCompleteTaskAuto()
@@ -659,10 +670,12 @@ const TaskEventMap: { [key: string]: () => void } = {
                   </template>
                   <template v-else>
                     <div
-                      class="min-w-60px cursor-pointer rounded bg-light-50 py-3px text-center text-xs"
+                      class="min-w-60px rounded bg-light-50 py-3px text-center text-xs"
+                      :class="task.disabled ? 'cursor-not-allowed' : 'cursor-pointer'"
                       @click="beforeClickTask(currentStep, idx, idy) && (TaskEventMap[task.title] ? TaskEventMap[task.title]() : handleCompleteTaskAuto())"
                     >
-                      {{ judgeStepCompleted(stepsReactiveMap[currentStep][idx][idy]) ? '已经完成' : '立即开始' }}
+                      {{ judgeStepCompleted(stepsReactiveMap[currentStep][idx][idy]) ? '已经完成' : task.disabled ? '暂未开放' : '立即开始'
+                      }}
                     </div>
                   </template>
                 </template>