Forráskód Böngészése

bug fix and release

刘洋 2 éve
szülő
commit
c766cf771a

+ 2 - 2
server.config.ts

@@ -3,10 +3,10 @@ import type { ServerOptions } from 'vite'
 const server: ServerOptions = {
   proxy: {
     '^/?(api|file)/': {
-      target: 'http://192.168.10.41:8200',
+      // target: 'http://192.168.10.41:8200',
       // target: 'http://192.168.10.107:8200',
       // target: 'http://cet-test.markingtool.cn',
-      // target: 'http://192.168.10.136:80',
+      target: 'http://192.168.10.136:80',
       // target: 'http://cet-dev.markingtool.cn:8200',
     },
   },

+ 8 - 1
src/App.vue

@@ -5,6 +5,8 @@ import useMainStore from '@/store/main'
 import useMainLayoutStore from '@/store/layout'
 import LockScreen from '@/layout/LockScreen.vue'
 import { onMounted } from 'vue'
+import { useRoute } from 'vue-router'
+const route = useRoute()
 const mainStore = useMainStore()
 const mainLayoutStore = useMainLayoutStore()
 
@@ -42,7 +44,12 @@ onMounted(() => {
 
 <template>
   <el-config-provider :locale="zhCn">
-    <RouterView></RouterView>
+    <!-- <RouterView></RouterView> -->
+    <router-view #default="{ Component }">
+      <keep-alive :include="mainStore.keepAliveViews">
+        <component :is="Component" />
+      </keep-alive>
+    </router-view>
     <lock-screen v-if="mainStore.lockScreenStatus"></lock-screen>
   </el-config-provider>
 </template>

+ 1 - 1
src/components/element/BaseDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    custom-class="can-resize"
+    :custom-class="props.canResize ? 'can-resize' : ''"
     custom
     align-center
     :close-on-click-modal="false"

+ 1 - 0
src/layout/LockScreen.vue

@@ -8,6 +8,7 @@
             v-model="form.pwd"
             class="pwd-input"
             size="large"
+            type="password"
             placeholder="请输入登录密码解锁"
             clearable
             @keydown="enter"

+ 10 - 3
src/layout/main/index.vue

@@ -13,7 +13,12 @@
     <div class="flex flex-1 direction-column scroll-auto main-layout-right">
       <main-header :reply-user-id="replyUserId" :message-visible="messageVisible" :in-layout="true"></main-header>
       <div class="flex-1 scroll-auto main-layout-right-content">
-        <RouterView></RouterView>
+        <!-- <RouterView></RouterView> -->
+        <router-view #default="{ Component }">
+          <keep-alive :include="mainStore.keepAliveViews">
+            <component :is="Component" />
+          </keep-alive>
+        </router-view>
       </div>
     </div>
   </div>
@@ -24,9 +29,11 @@ import { ref, provide } from 'vue'
 import LeftMenu from './LeftMenu.vue'
 import MainHeader from './MainHeader.vue'
 import useMainLayoutStore from '@/store/layout'
-
+import useMainStore from '@/store/main'
+import { useRoute } from 'vue-router'
+const route = useRoute()
 const mainLayoutStore = useMainLayoutStore()
-
+const mainStore = useMainStore()
 const replyUserId = ref<number>()
 
 const messageVisible = ref<boolean>(false)

+ 1 - 1
src/modules/admin-exam/edit-exam/index.vue

@@ -123,7 +123,7 @@ async function onSubmit() {
 
 /** 跳转开始列表 */
 const toExamMange = () => {
-  replace({ name: 'ExamMange' })
+  replace({ name: 'ExamManage' })
 }
 </script>
 

+ 3 - 3
src/modules/analysis/group-monitoring-detail/index.vue

@@ -11,7 +11,7 @@
       </div>
     </div>
     <div class="flex fill-blank detail-info">
-      <div class="flex p-base detail-info-chart" style="width: 56%">
+      <div class="flex p-base detail-info-chart" style="width: 58%">
         <div class="flex-1">
           <vue-echarts class="full" :option="markerSubjectiveChartsOption"></vue-echarts>
         </div>
@@ -19,7 +19,7 @@
           <vue-echarts class="full" :option="markerObjectiveChartsOption"></vue-echarts>
         </div>
       </div>
-      <div class="flex direction-column p-extra-small" style="width: 44%">
+      <div class="flex direction-column p-extra-small" style="width: 42%">
         <div class="flex items-center justify-between detail-info-table-header m-b-mini">
           <el-button custom-1 size="small" class="detail-info-label">
             <span class="">{{ dataType }}试卷总数:</span>
@@ -78,7 +78,7 @@
   <image-preview v-model="previewModalVisible" :url="current?.filePath"></image-preview>
 </template>
 
-<script setup lang="ts" name="GroupMonitoringDetail">
+<script setup lang="ts" name="AnalysisGroupDetail">
 /** 小组监控数据详情 */
 import { ref, computed, watch } from 'vue'
 import { useRoute, useRouter } from 'vue-router'

+ 1 - 1
src/modules/analysis/group-monitoring/index.vue

@@ -15,7 +15,7 @@
   </div>
 </template>
 
-<script setup lang="tsx" name="GroupMonitoring">
+<script setup lang="tsx" name="AnalysisGroupMonitoring">
 /** 小组监控 */
 import { useRouter } from 'vue-router'
 import { ElButton } from 'element-plus'

+ 1 - 1
src/modules/analysis/marker-statistics/index.vue

@@ -58,7 +58,7 @@
   </div>
 </template>
 
-<script setup lang="tsx" name="MarkerStatistics">
+<script setup lang="tsx" name="AnalysisPersonnelStatisticsMarker">
 /** 评卷员明细统计 */
 import { computed, reactive } from 'vue'
 import { useRouter, useRoute } from 'vue-router'

+ 1 - 1
src/modules/analysis/personnel-statistics/index.vue

@@ -18,7 +18,7 @@
   </div>
 </template>
 
-<script setup lang="ts" name="PersonnelStatistics">
+<script setup lang="ts" name="AnalysisPersonnelStatistics">
 /** 人员数据统计 */
 import { computed } from 'vue'
 import { omit } from 'lodash-es'

+ 1 - 1
src/modules/analysis/statistics/index.vue

@@ -35,7 +35,7 @@
   </div>
 </template>
 
-<script setup lang="tsx" name="Statistics">
+<script setup lang="tsx" name="AnalysisStatistics">
 /** 决策分析-统计 */
 import { computed, reactive, watch } from 'vue'
 import { useRouter } from 'vue-router'

+ 2 - 1
src/modules/analysis/view-marked-detail/index.vue

@@ -75,7 +75,8 @@
   <mark-history-list :id="currentViewHistory?.taskId" v-model="visibleHistory"></mark-history-list>
 </template>
 
-<script setup lang="ts" name="ViewMarkedDetail">
+<script setup lang="ts" name="AnalysisViewMarked">
+// <script setup lang="ts" name="ViewMarkedDetail">
 /** 提取阅卷明细 */
 import { ref, computed } from 'vue'
 import { useRoute } from 'vue-router'

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

@@ -323,7 +323,8 @@ const onConfirmSetExpert = async () => {
 const onSubmit = async () => {
   if (current.value) {
     await useFetch('updateCustomPaperScore').fetch({ taskId: current.value.taskId, scores: modelScore.value })
-    current.value.headerScore = add(...modelScore.value)
+    // current.value.headerScore = add(...modelScore.value)
+    onRefresh()
     ElMessage.success('修改成功')
   }
 }

+ 1 - 1
src/modules/quality/self-check-detail/index.vue

@@ -68,7 +68,7 @@
   ></send-back-mark>
 </template>
 
-<script setup lang="ts" name="SelfCheckDetail">
+<script setup lang="ts" name="QualitySelfCheckDetail">
 /** 自查数据详情 */
 import { ref, computed } from 'vue'
 import { useRoute } from 'vue-router'

+ 1 - 1
src/router/admin.ts

@@ -27,7 +27,7 @@ const routes: RouteRecordRaw[] = [
         },
       },
       {
-        name: 'ExamMange',
+        name: 'ExamManage',
         path: 'manage',
         component: () => import('@/modules/admin-exam/manage/index.vue'),
         meta: {

+ 21 - 0
src/router/index.ts

@@ -34,7 +34,28 @@ const router = createRouter({
   routes: routes,
 })
 
+const pageJumpsMap: any = {
+  SubjectManage: ['StructManage'],
+  StructManage: ['EditStruct'],
+  // ExamManage: ['EditExam'],
+  AnalysisStatistics: ['AnalysisViewMarked'],
+  AnalysisPersonnelStatistics: ['MarkingAssess', 'AnalysisPersonnelStatisticsMarker'],
+  AnalysisGroupMonitoring: ['AnalysisGroupDetail'],
+  MarkingInquiry: ['MarkingInquiryResult'],
+  QualitySelfCheck: ['QualitySelfCheckDetail'],
+}
+const keepAliveJupms = (from: any, to: any) => {
+  const mStore = useMainStore()
+  if (from.name in pageJumpsMap) {
+    if (pageJumpsMap[from.name].includes(to.name)) {
+      mStore.setKeepAliveViews(from.name)
+    } else {
+      mStore.cutKeepAliveViews(from.name)
+    }
+  }
+}
 router.beforeEach(async (to, from, next) => {
+  keepAliveJupms(from, to)
   const mainStore = useMainStore()
   if (to.name === 'Login') {
     mainStore.setLockScreen(false)

+ 15 - 0
src/store/main.ts

@@ -14,6 +14,7 @@ interface MainStoreState {
   newMsgs: { newCount: number; messages: any[] }
   online: boolean
   lockScreenStatus: boolean
+  keepAliveViews: any[]
 }
 
 interface MainStoreActions {
@@ -23,6 +24,8 @@ interface MainStoreActions {
   setNewMsgs: (msgData: { newCount: number; messages: any[] }) => void
   setOnline: (bool: boolean) => void
   setLockScreen: (bool: boolean) => void
+  setKeepAliveViews: (name: string) => void
+  cutKeepAliveViews: (name: string) => void
 }
 
 const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, MainStoreActions>('main', {
@@ -45,9 +48,21 @@ const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, Ma
       newMsgs: { newCount: 0, messages: [] },
       online: true,
       lockScreenStatus: false,
+      keepAliveViews: ['MainLayout'],
     }
   },
   actions: {
+    setKeepAliveViews(name) {
+      if (!this.keepAliveViews.includes(name)) {
+        this.keepAliveViews.push(name)
+      }
+    },
+    cutKeepAliveViews(name) {
+      const index = this.keepAliveViews.indexOf(name)
+      if (index > -1) {
+        this.keepAliveViews.splice(index, 1)
+      }
+    },
     setLockScreen(bool: boolean) {
       this.lockScreenStatus = !!bool
     },