刘洋 1 year ago
parent
commit
b9da1a1ec9

+ 4 - 0
src/App.vue

@@ -15,6 +15,10 @@ const route = useRoute()
 const mainStore = useMainStore()
 const mainLayoutStore = useMainLayoutStore()
 
+if (location.pathname == '/marking/mark') {
+  mainStore.setIsRefreshInMarkerPage(true)
+}
+
 const onlineCheckInterval = () => {
   useFetch('onlineCheck').fetch()
 }

+ 4 - 12
src/components/shared/message/MessageList.vue

@@ -148,18 +148,10 @@ const sendCurrentPaper = () => {
 /** 消息内容 */
 const messageContent = ref<string>('')
 watch(messageContent, (val: string) => {
-  // let reg = /<span class=\"pointer inline link-button\" contenteditable=\"false\" data-path=.*>查看试卷<\/span>/g
-  // let arr = messageContent.value.match(reg)
-  // let text = messageContent.value.replace(reg, '【查看试卷临时替换字符】')
-  // text = transHtmlContent(text)
-  // if (arr && arr.length) {
-  //   text = text.replace('【查看试卷临时替换字符】', arr[0])
-  // }
-  // messageContent.value = text
-  nextTick(() => {
-    const paperButton = document.querySelector(`.content-edit-able [data-path="${props.paperPath}"]`)
-    sendedPaper.value = !!paperButton
-  })
+  // nextTick(() => {
+  //   const paperButton = document.querySelector(`.content-edit-able [data-path="${props.paperPath}"]`)
+  //   sendedPaper.value = !!paperButton
+  // })
   if (sendTargetId.value) {
     let config: any = getUserConfigByType('draft')
     config[sendTargetId.value] = val || ''

+ 3 - 3
src/components/shared/message/MessageSend.vue

@@ -255,9 +255,9 @@ watch(messageContent, (val: string) => {
     const paperButton = document.querySelector(`.content-edit-able [data-path="${props.paperPath}"]`)
     sendedPaper.value = !!paperButton
   })
-  let config: any = getUserConfigByType('draft')
-  config.other = val || ''
-  setUserConfigByType('draft', config)
+  // let config: any = getUserConfigByType('draft')
+  // config.other = val || ''
+  // setUserConfigByType('draft', config)
 })
 // onMounted(() => {
 //   const draft = getUserConfigByType('draft')?.other

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

@@ -157,7 +157,7 @@ const rules: EpFormRules = {
   ],
   dayNumber: [
     { required: true, message: '请设置计划评卷天数' },
-    { type: 'number', min: 0, max: 999999, message: '计划评卷天数限制0-999999之间' },
+    { type: 'number', min: 0, max: 20, message: '计划评卷天数限制0-20之间' },
   ],
   separator: [{ required: true, message: '请设置分隔符' }],
   file: [{ required: true, message: '请选择导入文件' }],

+ 1 - 1
src/modules/bootstrap/login/index.vue

@@ -114,7 +114,7 @@ function loginSuccess(loginInfo: ExtractApiResponse<'userLogin'>) {
     localStorage.set('USER_CONFIG', { [loginInfo.id]: initConfigModelData() })
   } else {
     if (!config[loginInfo.id]) {
-      config[loginInfo.id] = {}
+      config[loginInfo.id] = initConfigModelData()
       localStorage.set('USER_CONFIG', config)
     }
   }

+ 11 - 1
src/store/main.ts

@@ -21,6 +21,7 @@ interface MainStoreState {
   showRowNextBottomDialog: boolean
   markerPausedLimit: number
   markerPausedWorker: any
+  isRefreshInMarkerPage: boolean
 }
 
 interface MainStoreActions {
@@ -36,6 +37,7 @@ interface MainStoreActions {
   setPaneSizeConfig: (path: string, size: number) => void
   setRowNextBottomDialogStatus: (bool: boolean) => void
   setMarkerPausedLimit: (time: number) => void
+  setIsRefreshInMarkerPage: (bool: boolean) => void
 }
 const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, MainStoreActions>('main', {
   state() {
@@ -65,9 +67,13 @@ const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, Ma
       showRowNextBottomDialog: false,
       markerPausedLimit: 0,
       markerPausedWorker: null,
+      isRefreshInMarkerPage: false,
     }
   },
   actions: {
+    setIsRefreshInMarkerPage(bool: boolean) {
+      this.isRefreshInMarkerPage = bool
+    },
     setMarkerPausedLimit(time: number) {
       if (time > 0 && this.markerPausedLimit == 0 && !this.markerPausedWorker) {
         this.markerPausedLimit = time
@@ -80,6 +86,7 @@ const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, Ma
           if (data == 0) {
             //暂停时间结束时,页面解锁,同时销毁worker
             this.markerPausedWorker && this.markerPausedWorker.terminate()
+            this.markerPausedWorker = null
           }
         }
       }
@@ -114,8 +121,11 @@ const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, Ma
     },
     setNewMsgs(msgData) {
       this.newMsgs = msgData
-      if (this.markerPausedLimit == 0 && location.pathname !== '/marking/mark') {
+      if (this.markerPausedLimit == 0 && (location.pathname !== '/marking/mark' || this.isRefreshInMarkerPage)) {
         this.setMarkerPausedLimit(msgData.markerPausedLimit || 0)
+        if (this.isRefreshInMarkerPage) {
+          this.setIsRefreshInMarkerPage(false)
+        }
       }
     },
     async getMyUserInfo() {

+ 2 - 1
src/utils/common.ts

@@ -311,6 +311,7 @@ export const initConfigModelData = (): any => {
     draft: { other: '' }, //消息草稿信息
     expandByPerson: '0', //人员数据统计-按人员展开
     includeLeaderScore: '0', //人员数据统计-是否包含组长给分
+    personnelStatisticsColumns: null,
   }
 }
 
@@ -318,7 +319,7 @@ export const getUserConfigByType = (type: string) => {
   const userConfig = localStorage.get('USER_CONFIG')
   const userInfo = sessionStorage.get('LOGIN_RESULT')
   if (userInfo?.id) {
-    return userConfig[userInfo.id][type]
+    return userConfig[userInfo.id][type] || initConfigModelData()[type]
   } else {
     return initConfigModelData()[type]
   }