Procházet zdrojové kódy

Merge branch 'master' into liua

* master:
  ...
  ~
  ~
  ~
  ~
  路径修改
  提交
la před 2 roky
rodič
revize
e2190d2471

+ 3 - 1
components.d.ts

@@ -11,11 +11,12 @@ declare module '@vue/runtime-core' {
   export interface GlobalComponents {
     Bjqk: typeof import('./src/components/step/link/bjqk.vue')['default']
     BreadCrumb: typeof import('./src/components/BreadCrumb/index.vue')['default']
-    Cjfb: typeof import('./src/components/step/btn/cjfb.vue')['default']
     CommonFooter: typeof import('./src/components/commonFooter/index.vue')['default']
     ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
     ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCarousel: typeof import('element-plus/es')['ElCarousel']
+    ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
@@ -39,6 +40,7 @@ declare module '@vue/runtime-core' {
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+    ElUpload: typeof import('element-plus/es')['ElUpload']
     'I:mdi:horizontalLine': typeof import('~icons/mdi/horizontal-line')['default']
     'I:mdi:tick': typeof import('~icons/mdi/tick')['default']
     LeftSider: typeof import('./src/components/leftSider/index.vue')['default']

+ 9 - 6
public/config.js

@@ -5,10 +5,11 @@ const local = {
   web_pc: 'https://yzy.dev.bozedu.net/',
   qqyxt: 'https://qqyxt.dev.bozedu.net/',
   yzy: 'https://yzy.dev.bozedu.net/',
-  api:'https://openapi.dev.bozedu.net/',
+  api: 'https://openapi.dev.bozedu.net/',
   uc: 'https://uc.dev.bozedu.net/',
   origin: window.location.origin,
-  base:'/'
+  base: '',
+  build: ''
 }
 
 // 测试服环境
@@ -17,9 +18,10 @@ const development = {
   origin: window.location.origin,
   qqyxt: 'https://qqyxt.dev.bozedu.net/',
   yzy: 'https://yzy.dev.bozedu.net/',
-  api:'https://openapi.dev.bozedu.net/',
+  api: 'https://openapi.dev.bozedu.net/',
   uc: 'https://uc.dev.bozedu.net/',
-  base:'/webapps/page/'
+  base: '/webapps/page',
+  build: '/webapps/page/liankao'
 }
 
 // // 正式服环境
@@ -28,9 +30,10 @@ const production = {
   origin: window.location.origin,
   qqyxt: 'https://qqyxt.bozedu.net/',
   yzy: 'https://yzy.bozedu.net/',
-  api:'https://openapi.bozedu.net/',
+  api: 'https://openapi.bozedu.net/',
   uc: 'https://uc.bozedu.net/',
-  base:'/webapps/page/'
+  base: 'webapps/page',
+  build: '/webapps/page/liankao'
 }
 
 function isWhich() {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
public/dtk/assets/index.26656681.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
public/dtk/assets/index.5dd05d2c.js


+ 1 - 1
public/dtk/index.html

@@ -6,7 +6,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>自定义答题卡</title>
     <script src="./config.js"></script>
-    <script type="module" crossorigin src="./assets/index.5dd05d2c.js"></script>
+    <script type="module" crossorigin src="./assets/index.26656681.js"></script>
     <link rel="modulepreload" href="./assets/vendor.fb7751d4.js">
     <link rel="stylesheet" href="./assets/vendor.e1b158b3.css">
     <link rel="stylesheet" href="./assets/index.cb418333.css">

+ 1 - 0
shims.d.ts

@@ -22,6 +22,7 @@ declare interface Window {
     yzy: string
     uc: string
     base: string
+    build: string
   }
   // handleCompleteTask: (gid: number, pid: number, idy: number) => void
   // handleAutoCompleteTask: () => void

+ 1 - 1
src/pages/process/index.vue

@@ -367,7 +367,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;
+  window.location.href = window.GLOBAL_CONFIG.yzy+'webapps/page/single-review-liankao.html?ze_id='+item.ze_id;
 }
 </script>
 <style lang="scss" scoped>

+ 120 - 48
src/pages/step/[id].vue

@@ -47,7 +47,7 @@ const steps = reactive(
             {
               title: '预划流程完成',
               children: [
-                { title: '预划流程完成', optional: false, description: '试卷内容和答题卡已确认,可进行考试' },
+                { title: '预划流程完成', optional: false, description: '试卷内容和答题卡已确认,可进行下一步' },
               ],
             },
           ],
@@ -155,7 +155,7 @@ const steps = reactive(
             {
               title: '组卷流程完成',
               children: [
-                { title: '组卷流程完成', optional: false, description: '试卷内容和答题卡已确认,可进行考试' },
+                { title: '组卷流程完成', optional: false, description: '试卷内容和答题卡已确认,可进行下一步' },
               ],
             },
           ],
@@ -266,7 +266,7 @@ const lineList: any[][][] = []
 //   })
 // })
 
-function handleSwitchGid(id: number) {
+function handleSwitchCurrentStep(id: number) {
   currentStep = id
 }
 
@@ -319,7 +319,10 @@ function routerPush(path: RouteLocationRaw) {
   router.push(path)
 }
 function windowPushState(path: string) {
-  window.open(`${location.origin}/${path}`, '_self')
+  // 采取如下方式主要由于chrome下history.back()不会重新load页面
+  sessionStorage.setItem('historyLocation', location.href)
+  // window.open(`${location.origin}/${path}`, '_self')
+  location.replace(`${location.origin}/${path}`)
 }
 
 function handleValidTask(currentStep: number, idx: number, idy: number) {
@@ -387,10 +390,10 @@ function judgeStepCompleted(val: unknown) {
   return (!!val) || (typeof val === 'object' && !!(val?.value))
 }
 
-function handleCompleteTask(gid: number, pid: number, cid: number, val?: unknown) {
+function handleCompleteTask(gid: number, pid: number, cid: number, val?: unknown): Promise<any> {
   const _ykl_lc_ = JSON.parse(sessionStorage.getItem('ykl_lc')!)
   _ykl_lc_.processList[gid][pid][cid] = val || 1
-  request({
+  return request({
     url: '/yzy/kmksyjlc/save',
     data: {
       ykl_id,
@@ -406,8 +409,8 @@ function handleCompleteTask(gid: number, pid: number, cid: number, val?: unknown
         grouping: true,
       })
       sessionStorage.setItem('ykl_lc', JSON.stringify(_ykl_lc_))
-
       stepsReactiveMap[gid][pid][cid] = val || 1
+      return res
     }
   }).catch(() => {
     ElMessage({
@@ -418,7 +421,7 @@ function handleCompleteTask(gid: number, pid: number, cid: number, val?: unknown
   })
 }
 
-function handleJumpTask(gid: number, pid: number, idy: number) {
+async function handleJumpTask(gid: number, pid: number, idy: number) {
   // todo: 验证任务是否完成
   if (judgeStepCompleted(stepsReactiveMap[gid][pid][idy])) {
     return ElMessage({
@@ -428,12 +431,15 @@ function handleJumpTask(gid: number, pid: number, idy: number) {
     })
   }
   // stepsReactiveMap[gid][pid][idy] = 1
-  handleCompleteTask(gid, pid, idy)
-  if (pid === stepsReactiveMap[gid].length - 1)
-    return
-  const line = lineList[gid][pid][idy]
-  line.setOptions({ color: '#003eee' })
-  document.querySelectorAll('.leader-line')[line._id - 1]?.classList.add('z10')
+  const res = await handleCompleteTask(gid, pid, idy)
+  if (res.code === '1') {
+    if (pid !== stepsReactiveMap[gid].length - 1) {
+      const line = lineList[gid][pid][idy]
+      line.setOptions({ color: '#003eee' })
+      document.querySelectorAll('.leader-line')[line._id - 1]?.classList.add('z10')
+    }
+  }
+  return res
 }
 
 onBeforeRouteLeave(() => {
@@ -442,7 +448,7 @@ onBeforeRouteLeave(() => {
 
 function handleCompleteTaskAuto() {
   const { gid, pid, cid } = JSON.parse(sessionStorage.getItem('StepId')!)
-  handleJumpTask(gid, pid, cid)
+  return handleJumpTask(gid, pid, cid)
 }
 
 const TaskEventMap: { [key: string]: () => void } = {
@@ -450,14 +456,22 @@ const TaskEventMap: { [key: string]: () => void } = {
     routerPush({ name: 'process-fjct-ze_id-zs_id', params: { ze_id: ykl_lc.ze_id, zs_id: ykl_lc.zs_id } })
   },
   '预划考号区域': () => {
-    windowPushState(`${window.GLOBAL_CONFIG.base}/liankao/dtk/index.html`)
+    windowPushState(`${window.GLOBAL_CONFIG.build}/dtk/index.html`)
   },
   '制作答题卡': () => {
-    windowPushState(`${window.GLOBAL_CONFIG.base}/liankao/dtk/index.html`)
+    windowPushState(`${window.GLOBAL_CONFIG.build}/dtk/index.html`)
   },
   '考场设置(可选)': () => {
     windowPushState(`${window.GLOBAL_CONFIG.base}/exam-room-set.html?id=${ykl_lc.ze_id}`)
   },
+  '预划流程完成': async () => {
+    await handleCompleteTaskAuto()
+    currentStep = 1
+  },
+  '组卷流程完成': async () => {
+    await handleCompleteTaskAuto()
+    currentStep = 1
+  },
   // 先上传后划块
   '答题卡扫描': () => {
     window.open(`BozeduYuejuan://${user.value.token},${ykl_lc.ze_id},${window.GLOBAL_CONFIG.yzy},upload_papers`, '_blank')
@@ -472,48 +486,88 @@ const TaskEventMap: { [key: string]: () => void } = {
     window.open(`BozeduYuejuan://${user.value.token},${ykl_lc.ze_id},${window.GLOBAL_CONFIG.yzy}`, '_blank')
     handleCompleteTaskAuto()
   },
-  '平台接收试卷确认': () => {
-    handleCompleteTaskAuto()
+  '平台接收试卷确认': async () => {
+    await handleCompleteTaskAuto()
+    windowPushState(`${window.GLOBAL_CONFIG.base}/marking-answer-sheet-liankao.html?ze_id=${ykl_lc.ze_id}`)
   },
   '批阅任务分配': () => {
+    windowPushState(`${window.GLOBAL_CONFIG.base}/taskassignment-liankao.html`)
   },
   '阅卷': () => {
+    windowPushState(`${window.GLOBAL_CONFIG.base}/single-review-liankao.html?ze_id=${ykl_lc.ze_id}`)
   },
   '成绩发布': () => {
+    let loading = false
+
     ElMessageBox.confirm('选择实时发布时需等待浏览器处理结束;正常发布则无需等待', '选择发布成绩的方式', {
       confirmButtonText: '实时发布',
       cancelButtonText: '正常发布',
       type: 'info',
-    }).then(() => {
-      request({
-        url: '/yzy/kmksyjlc/save',
-        data: {
-          ykl_id,
-          yk: {
-            ykl_lc: JSON.stringify({
-              ...ykl_lc,
-              ykl_lc_cjfb: 1,
-            }),
-          },
-        },
-      }).then((res) => {
-        if (res.code === '1') {
-          ElMessage({
-            message: '操作成功',
-            type: 'success',
-            grouping: true,
-          })
-          ykl_lc.ykl_lc_cjfb = 1
+      distinguishCancelAndClose: true,
+      beforeClose: async (action, instance, done) => {
+        if (action === 'confirm') {
+          // 实时发布
+          console.log('实时发布')
+          instance.confirmButtonLoading = loading = true
+          try {
+            const res0 = await request({
+              url: '/openapi/crontab/datamaker.php',
+              data: {
+                ykl_id,
+              },
+            })
+            if (res0.code !== '1')
+              throw new Error(res0.msg)
+            const res1 = await handleCompleteTaskAuto()
+            if (res1.code !== '1')
+              throw new Error(res1.msg)
+            ykl_lc.ykl_stat_ready = 2
+            ElMessage.success('发布成功')
+          }
+          catch (error) {
+            console.error('发布失败', error)
+          }
+
+          instance.confirmButtonLoading = loading = false
         }
-      }).catch(() => {
-        ElMessage({
-          message: '操作失败',
-          type: 'error',
-          grouping: true,
-        })
-      })
+        else if (action === 'cancel') {
+          // 正常发布
+          console.log('正常发布')
+          instance.cancelButtonLoading = loading = true
+          try {
+            const res0 = await request({
+              url: '/yzy/kmksyjlc/save',
+              data: {
+                ykl_id,
+                yk: {
+                  ykl_sffbcj: 1,
+                },
+              },
+            })
+            if (res0.code !== '1')
+              throw new Error(res0.msg)
+            const res1 = await handleCompleteTaskAuto()
+            if (res1.code !== '1')
+              throw new Error(res1.msg)
+            ykl_lc.ykl_stat_ready = 1
+            ElMessage.success('发布中...')
+          }
+          catch (error) {
+            console.error('发布失败', error)
+          }
+          instance.cancelButtonLoading = loading = false
+        }
+        else {
+          console.log('取消发布')
+          return loading ? ElMessage.warning('发布中,请勿关闭弹窗') : done()
+        }
+      },
     })
   },
+  '修改成绩': async () => {
+    await handleCompleteTaskAuto()
+    routerPush({ name: 'process-xgcj-id', params: { id: ykl_lc.ze_id } })
+  },
   '考试关闭': () => {
     ElMessageBox({
       title: '提示',
@@ -537,10 +591,10 @@ const TaskEventMap: { [key: string]: () => void } = {
     <div class="flex-auto w-1200px m-auto">
       <div class="flex flex-auto justify-start divide-x-4 divide-blue-700">
         <div class="h-full w-220px">
-          <el-steps direction="vertical" :active="gid">
+          <el-steps direction="vertical" :active="currentStep">
             <el-step
               v-for="({ title, children }, idx) in steps" :key="title" class="cursor-pointer hover:bg-light-600"
-              :class="idx === currentStep && 'bg-light-400'" @click="handleSwitchGid(idx)"
+              :class="idx === currentStep && 'bg-light-400'" @click="handleSwitchCurrentStep(idx)"
             >
               <template #title>
                 <div class="mb-4 font-normal">
@@ -587,6 +641,15 @@ const TaskEventMap: { [key: string]: () => void } = {
                       {{ '跳过' }}
                     </div>
                   </template>
+                  <template v-else-if="task.title === '成绩发布'">
+                    <div
+                      class="min-w-60px cursor-pointer rounded bg-light-50 py-3px text-center text-xs"
+                      @click="beforeClickTask(currentStep, idx, idy) && (TaskEventMap[task.title] ? TaskEventMap[task.title]() : handleCompleteTaskAuto())"
+                    >
+                      {{ judgeStepCompleted(stepsReactiveMap[currentStep][idx][idy])
+                        ? (ykl_lc.ykl_stat_ready === 1 ? '发布中…' : '已发布') : '成绩发布' }}
+                    </div>
+                  </template>
                   <template v-else>
                     <div
                       class="min-w-60px cursor-pointer rounded bg-light-50 py-3px text-center text-xs"
@@ -625,3 +688,12 @@ const TaskEventMap: { [key: string]: () => void } = {
   display: none;
 }
 </style>
+
+<route>
+  {
+    meta: {
+      title: '考试流程',
+      breadcrumb: true,
+    },
+  }
+</route>