Browse Source

release and bug fix

刘洋 2 years ago
parent
commit
7b298d8de8

+ 1 - 1
src/App.vue

@@ -8,7 +8,7 @@ const mainStore = useMainStore()
 const mainLayoutStore = useMainLayoutStore()
 
 if (mainStore.loginInfo) {
-  mainStore.getMyUserInfo()
+  // mainStore.getMyUserInfo()
   mainStore.getUserMarkConfig()
   mainLayoutStore.getRenderMenuList()
 }

+ 1 - 0
src/api/api-types/user.d.ts

@@ -69,6 +69,7 @@ export namespace User {
     markTotalCount?: number
     updateTime: string
     updaterName: string
+    passwordWeak: boolean
   }
 
   /** 新增修改用户信息 */

+ 1 - 1
src/modules/admin-data/nav/index.vue

@@ -39,7 +39,7 @@ const { hasPermissions } = useNavPermissions()
 
 <style scoped lang="scss">
 .nav-page {
-  padding: 160px;
+  padding: 100px 100px 0 100px;
   .nav-card {
     width: 420px;
     height: 180px;

+ 2 - 2
src/modules/admin-exam/nav/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="full nav-page flex justify-center items-center">
+  <div class="full nav-page">
     <div class="flex flex-wrap">
       <div class="radius-base nav-card">考试管理</div>
       <router-link v-show="hasPermissions('/exam/manage')" to="/exam/manage">
@@ -31,7 +31,7 @@ const { hasPermissions } = useNavPermissions()
 
 <style scoped lang="scss">
 .nav-page {
-  // padding: 160px;
+  padding: 100px 100px 0 100px;
   .nav-card {
     width: 420px;
     height: 180px;

+ 10 - 1
src/modules/analysis/personnel-statistics/components/RightKeyMenu.vue

@@ -3,18 +3,27 @@
   <div ref="rkm" class="right-key-menu">
     <div class="rightKeyMenuItem" @click="emits('onSetWorkload', unref(curRow))">设置工作量</div>
     <div class="rightKeyMenuItem" @click="emits('onSendMessage', unref(curRow))">发送消息</div>
+    <div
+      v-if="curRow.markingStatus === '正评'"
+      class="rightKeyMenuItem"
+      @click="emits('forceAssessment', unref(curRow))"
+    >
+      强制考核分发
+    </div>
   </div>
 </template>
 <script setup lang="ts" name="RightKeyMenu">
 import { ref, onUnmounted, unref } from 'vue'
 let rkm = ref()
-const emits = defineEmits(['rightClick', 'onSetWorkload', 'onSendMessage'])
+const emits = defineEmits(['rightClick', 'onSetWorkload', 'onSendMessage', 'forceAssessment'])
 const fun = () => {
   emits('rightClick')
 }
 const curRow = ref({})
 const onload = (row: any, column: any, event: any) => {
   curRow.value = row
+  console.log('curRow:', curRow)
+
   let betweenHeight = document.body.clientHeight - event.clientY
   if (betweenHeight < 150) {
     rkm.value.style.top = event.clientY - 80 + 'px'

+ 2 - 0
src/modules/analysis/personnel-statistics/components/StatisticsGroup.vue

@@ -61,6 +61,8 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
     },
   },
   { align: 'center', label: '评卷份数', prop: 'markingPaperCount', width: 72 },
+  { align: 'center', label: '当日可阅', prop: 'markDayCount', width: 72 },
+  { align: 'center', label: '剩余可阅', prop: 'todoMarkDayCount', width: 72 },
   { align: 'center', label: '客观题0分量', prop: 'objectiveZero', width: 100 },
   { align: 'center', label: '客观平均分', prop: 'objectiveAvg', width: 90 },
   { align: 'center', label: '客观标准差', prop: 'objectiveStd', width: 80 },

+ 7 - 1
src/modules/analysis/personnel-statistics/components/StatisticsPersonnel.vue

@@ -55,6 +55,7 @@
     @right-click="rightClick"
     @on-set-workload="onSetWorkload"
     @on-send-message="onSendMessage"
+    @force-assessment="forceAssessment"
   ></right-key-menu>
 </template>
 
@@ -174,7 +175,12 @@ function onSendMessage(data: ExtractArrayValue<ExtractApiResponse<'getStatistics
   setReplyUserId?.(data.markerId)
   setMessageVisible?.(true)
 }
-
+function forceAssessment(data: ExtractArrayValue<ExtractApiResponse<'getStatisticsByGroup'>>) {
+  push({
+    name: 'MarkingAssess',
+    query: { markerId: data.markerId },
+  })
+}
 const data = computed(() => {
   return props.data || []
 })

+ 106 - 0
src/modules/bootstrap/change-password/index.vue

@@ -0,0 +1,106 @@
+<template>
+  <div class="grid full change-pwd-view">
+    <div class="change-pwd-modal">
+      <div class="p-l-large change-pwd-modal-header">请修改密码</div>
+      <div class="change-pwd-modal-content">
+        <base-form ref="formRef" :model="userModel" :rules="rules" :items="items" :label-width="useVW(90)" size="large">
+          <template #form-item-confirm>
+            <confirm-button class="m-t-large" size="large" @confirm="onSubmit" @cancel="onCancel"></confirm-button>
+          </template>
+        </base-form>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts" name="ChangePassword">
+import { reactive, watch } from 'vue'
+import { ElMessage } from 'element-plus'
+import useFetch from '@/hooks/useFetch'
+import useVModel from '@/hooks/useVModel'
+import useVW from '@/hooks/useVW'
+import useForm from '@/hooks/useForm'
+import BaseForm from '@/components/element/BaseForm.vue'
+import ConfirmButton from '@/components/common/ConfirmButton.vue'
+import { useRouter, useRoute } from 'vue-router'
+import useMainStore from '@/store/main'
+
+import type { EpFormItem, EpFormRules } from 'global-type'
+const { push, replace } = useRouter()
+const route = useRoute()
+const { formRef, elFormRef } = useForm()
+const mainStore = useMainStore()
+const userModel = reactive<{ password: string; rePassword?: string }>({
+  password: '',
+  rePassword: '',
+})
+
+const rules: EpFormRules = {
+  password: [
+    { required: true, message: '请填写登录密码' },
+    { pattern: /[0-9a-zA-Z~!@#¥%&\*]/, message: '密码限制"数字、字母、~!@#¥%&\*"' },
+  ],
+  rePassword: [
+    {
+      required: true,
+      validator(_, value, cb) {
+        if (!value) {
+          cb(new Error('请确认登录密码'))
+        } else if (value !== userModel.password) {
+          cb(new Error('两次输入密码不一致'))
+        } else {
+          cb()
+        }
+      },
+    },
+  ],
+}
+
+const items: EpFormItem[] = [
+  { label: '新密码', prop: 'password', slotType: 'input', slot: { type: 'password' } },
+  { label: '确认密码', prop: 'rePassword', slotType: 'input', slot: { type: 'password' } },
+  { slotName: 'confirm' },
+]
+const onCancel = () => {
+  push({ name: 'Login' })
+}
+const onSubmit = async () => {
+  try {
+    const valid = await elFormRef?.value?.validate()
+    valid && (await useFetch('updateUserPwd').fetch({ password: userModel.password }))
+    ElMessage.success('修改成功')
+    let rPath: string = route.query.redirectPath?.toString() || ''
+    if (rPath) {
+      await mainStore.getMyUserInfo()
+      replace({ path: decodeURIComponent(rPath) })
+    }
+  } catch (error) {
+    console.error(error)
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.change-pwd-view {
+  place-items: center;
+  .change-pwd-modal {
+    width: 480px;
+    height: 416px;
+    background: $LoginModalBg;
+    border-radius: $LoginModalRadius;
+    overflow: hidden;
+    .change-pwd-modal-header {
+      height: $LoginModalHeaderHeight;
+      line-height: $LoginModalHeaderHeight;
+      background: $LoginModalHeaderBg;
+      font-size: $LoginModalHeaderFontSize;
+      font-weight: normal;
+      color: $LoginModalHeaderFontColor;
+    }
+    .change-pwd-modal-content {
+      height: 336px;
+      padding: 52px 60px;
+    }
+  }
+}
+</style>

+ 1 - 1
src/modules/expert/nav/index.vue

@@ -55,7 +55,7 @@ const { hasPermissions } = useNavPermissions()
 
 <style scoped lang="scss">
 .nav-page {
-  padding: 160px;
+  padding: 100px 100px 0 100px;
   .nav-card {
     width: 420px;
     height: 180px;

+ 11 - 0
src/modules/marking/assess/index.vue

@@ -24,6 +24,9 @@
               ref="treeRef"
               v-model="markerIds"
               show-checkbox
+              node-key="id"
+              :default-checked-keys="defaultCheckedKeys"
+              default-expand-all
               :filter-node-method="filterTree"
               :data="markerTree"
               :props="treeProp"
@@ -60,11 +63,19 @@ import useVW from '@/hooks/useVW'
 
 import type { ExtractApiParams, ExtractApiResponse } from '@/api/api'
 import type { FormGroup, EpFormItem, EpFormRules, EpTableColumn } from 'global-type'
+import { useRoute } from 'vue-router'
+import { TreeKey } from 'element-plus/es/components/tree/src/tree.type'
+const route = useRoute()
 
 const { subjectList, mainQuestionList, dataModel, onOptionInit, changeModelValue } = useOptions(['subject', 'question'])
 
 const markerIds = ref()
+let defaultCheckedKeys = ref<TreeKey[]>([])
+const queryMId: any = route.query.markerId
 
+if (queryMId) {
+  defaultCheckedKeys.value = [queryMId]
+}
 const model = reactive<ExtractApiParams<'handOutForceCheck'>>({
   subjectCode: dataModel.subject || '',
   mainNumber: dataModel.question,

+ 3 - 1
src/modules/marking/inquiry-result/index.vue

@@ -37,9 +37,11 @@
             hide-on-single-page
           ></el-pagination>
         </div>
-        <div class="flex-1 scroll-auto">
+        <div class="flex-1 scroll-auto m-t-mini">
           <base-table
             ref="tableRef"
+            border
+            stripe
             size="small"
             height="100%"
             v-bind="pagination"

+ 1 - 1
src/modules/marking/nav/index.vue

@@ -95,7 +95,7 @@ const { hasPermissions } = useNavPermissions()
 
 <style scoped lang="scss">
 .nav-page {
-  padding: 160px;
+  padding: 100px 100px 0 100px;
   .nav-card {
     width: 420px;
     height: 180px;

+ 1 - 1
src/modules/marking/standard-nav/index.vue

@@ -28,7 +28,7 @@
 
 <style scoped lang="scss">
 .nav-page {
-  padding: 160px;
+  padding: 100px 100px 0 100px;
   .nav-card {
     width: 420px;
     height: 180px;

+ 1 - 0
src/modules/monitor/training-monitoring/index.vue

@@ -42,6 +42,7 @@
         <base-table
           border
           stripe
+          size="small"
           :columns="columns"
           :data="trainingMonitor?.data"
           @selection-change="onSectionChange"

+ 1 - 1
src/modules/quality/nav/index.vue

@@ -47,7 +47,7 @@ const { hasPermissions } = useNavPermissions()
 
 <style scoped lang="scss">
 .nav-page {
-  padding: 160px;
+  padding: 100px 100px 0 100px;
   .nav-card {
     width: 420px;
     height: 180px;

+ 3 - 2
src/modules/quality/self-check/index.vue

@@ -160,8 +160,9 @@ const papers = computed(() => {
 
 const columns3: EpTableColumn[] = [
   { label: '密号', prop: 'secretNumber' },
-  { label: '分数', prop: 'markScore' },
-  { label: '上次分数', prop: 'lastMarkScore' },
+  { label: '自查分', prop: 'markScore' },
+  // { label: '上次分数', prop: 'lastMarkScore' },
+  { label: '分数', prop: 'lastMarkScore' },
   { label: '评卷时间', prop: 'markTime' },
 ]
 

+ 5 - 0
src/router/bootstrap.ts

@@ -29,6 +29,11 @@ const routes: RouteRecordRaw[] = [
         path: 'create-exam',
         component: () => import('@/modules/admin-exam/edit-exam/index.vue'),
       },
+      {
+        name: 'ChangePassword',
+        path: 'change-password',
+        component: () => import('@/modules/bootstrap/change-password/index.vue'),
+      },
     ],
   },
 ]

+ 17 - 2
src/router/index.ts

@@ -8,6 +8,7 @@ import ExampleRoutes from './example'
 import ExpertRoutes from './expert'
 import QualityRoutes from './quality'
 import AdminRoutes from './admin'
+import useMainStore from '@/store/main'
 
 export const routes: RouteRecordRaw[] = [
   ...Bootstrap,
@@ -33,8 +34,22 @@ const router = createRouter({
   routes: routes,
 })
 
-router.beforeEach((to, from, next) => {
-  if (to.meta?.auth === false || to.name === 'Login' || sessionStorage.get('LOGIN_RESULT')) {
+router.beforeEach(async (to, from, next) => {
+  const mainStore = useMainStore()
+  if (!mainStore.myUserInfo && sessionStorage.get('LOGIN_RESULT') && to.name !== 'Login') {
+    await mainStore.getMyUserInfo()
+  }
+  if (
+    sessionStorage.get('LOGIN_RESULT') &&
+    !['Bootstrap', 'Login', 'InitUserName', 'CheckExam', 'InitCreateExam', 'ChangePassword'].includes(
+      to.name?.toString() || ''
+    ) &&
+    mainStore.myUserInfo?.passwordWeak
+  ) {
+    console.log('to:', to)
+
+    next({ name: 'ChangePassword', query: { redirectPath: encodeURIComponent(to.fullPath) } })
+  } else if (to.meta?.auth === false || to.name === 'Login' || sessionStorage.get('LOGIN_RESULT')) {
     next()
   } else {
     next({ name: 'Login' })