فهرست منبع

fix:表格数据刷新或下一页后,前端排序的箭头还亮着。

刘洋 10 ماه پیش
والد
کامیت
e901c6be1a

+ 2 - 1
server.config.ts

@@ -3,11 +3,12 @@ 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.178:8200',
       // target: 'http://192.168.10.108:8200',
       // target: 'http://cet-test.markingtool.cn',
       // target: 'http://192.168.10.136:80',
+      target: 'http://192.168.10.123:8200',
       // target: 'http://cet-dev.markingtool.cn:8200',
     },
   },

+ 6 - 2
src/modules/analysis/group-monitoring/index.vue

@@ -9,7 +9,7 @@
     </div>
     <div class="flex-1 p-base">
       <div class="radius-base p-l-base p-r-base p-t-mini fill-blank p-b-mini">
-        <base-table border stripe size="small" :columns="columns" :data="tableData">
+        <base-table :key="tableKey" border stripe size="small" :columns="columns" :data="tableData">
           <template #column-leader="{ row }">
             <div style="text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
               <span
@@ -46,7 +46,7 @@
 
 <script setup lang="tsx" name="AnalysisGroupMonitoring">
 /** 小组监控 */
-import { computed, ref } from 'vue'
+import { computed, ref, watch } from 'vue'
 import { useRouter } from 'vue-router'
 import { ElButton, ElPagination } from 'element-plus'
 import BaseForm from '@/components/element/BaseForm.vue'
@@ -125,6 +125,10 @@ const currentPage = ref(1)
 const tableData = computed(() => {
   return (result.value || []).slice((currentPage.value - 1) * 10, (currentPage.value - 1) * 10 + 10)
 })
+const tableKey = ref(Math.random() + '')
+watch(tableData, () => {
+  tableKey.value = Math.random() + ''
+})
 /** 刷新按钮 */
 function onSearch() {
   let markingGroupNumbers: any = formModel.value.markingGroupNumbers

+ 7 - 0
src/modules/analysis/marker-statistics/index.vue

@@ -97,6 +97,7 @@
               </div>
               <div class="flex-1 scroll-auto m-t-mini">
                 <base-table
+                  :key="tableKey"
                   ref="tableRef"
                   border
                   stripe
@@ -304,6 +305,12 @@ const {
   elTableRef,
   isMult,
 } = useTableCheck(data, true, null, false)
+
+const tableKey = ref(Math.random() + '')
+watch(tableData, () => {
+  tableKey.value = Math.random() + ''
+})
+
 /** 确定给分 */
 const { fetch: updatePersonalMarkDetailScore } = useFetch('updatePersonalMarkDetailScore')
 const onSubmit = async () => {

+ 6 - 1
src/modules/analysis/marking-progress/components/GroupProgress.vue

@@ -21,7 +21,7 @@
         >
       </template>
     </base-form>
-    <base-table border stripe size="small" :columns="columns" :data="result"></base-table>
+    <base-table :key="tableKey" border stripe size="small" :columns="columns" :data="result"></base-table>
   </div>
 </template>
 
@@ -59,6 +59,11 @@ const model = reactive<ExtractApiParams<'getMarkProgressByMarker'>>({
 
 const { fetch, result } = useFetch('getMarkProgressByMarker')
 
+const tableKey = ref(Math.random() + '')
+watch(result, () => {
+  tableKey.value = Math.random() + ''
+})
+
 const onSearch = () => {
   fetch({ ...model })
 }

+ 6 - 0
src/modules/analysis/marking-progress/components/TotalProgress.vue

@@ -10,6 +10,7 @@
 
       <div class="flex m-t-base">
         <base-table
+          :key="tableKey"
           class="left-table"
           border
           stripe
@@ -223,6 +224,11 @@ const totalProgressData = computed(() => {
   return arr
 })
 
+const tableKey = ref(Math.random() + '')
+watch(totalProgressData, () => {
+  tableKey.value = Math.random() + ''
+})
+
 const topChartHeight = computed(() => {
   return ((markProgressResult.value as any) || []).length * 44 + 60
 })

+ 9 - 0
src/modules/analysis/personnel-compare/index.vue

@@ -16,6 +16,7 @@
       <div class="m-t-small">
         <base-table
           v-if="dataType !== 'segmentScores'"
+          :key="tableKey1"
           ref="tableRef1"
           border
           stripe
@@ -29,6 +30,7 @@
         </base-table>
         <base-table
           v-else
+          :key="tableKey2"
           ref="tableRef2"
           border
           stripe
@@ -168,6 +170,13 @@ const allTableData = computed(() => {
   }
 })
 
+const tableKey1 = ref(Math.random() + '')
+const tableKey2 = ref(Math.random() + '')
+watch(allTableData, () => {
+  tableKey1.value = Math.random() + ''
+  tableKey2.value = Math.random() + ''
+})
+
 watch(dataType, () => {
   multipleSelection.value = []
   curRow.value = null

+ 6 - 0
src/modules/marking/arbitration/index.vue

@@ -57,6 +57,7 @@
           <div class="flex-1 scroll-y-auto m-t-mini">
             <base-table
               ref="tableRef"
+              :key="tableKey"
               border
               stripe
               size="small"
@@ -259,6 +260,11 @@ const {
   onCurrentChange,
 } = useTableCheck(data)
 
+const tableKey = ref(Math.random() + '')
+watch(tableData, () => {
+  tableKey.value = Math.random() + ''
+})
+
 const { fetch: viewArbitrationPaper } = useFetch('viewArbitrationPaper')
 
 watch(currentArbitration, () => {

+ 6 - 0
src/modules/marking/inquiry-result/index.vue

@@ -91,6 +91,7 @@
           </div>
           <div class="flex-1 scroll-auto m-t-mini">
             <base-table
+              :key="tableKey"
               ref="tableRef"
               v-loading="loading"
               border
@@ -402,6 +403,11 @@ const {
   multToggle,
 } = useTableCheck(data, true, null, false)
 
+const tableKey = ref(Math.random() + '')
+watch(tableData, () => {
+  tableKey.value = Math.random() + ''
+})
+
 watch(current, () => {
   if (current.value) {
     useFetch('viewCustomQuery')

+ 6 - 0
src/modules/marking/problem/index.vue

@@ -70,6 +70,7 @@
           <div class="flex-1 scroll-auto m-t-mini">
             <base-table
               ref="tableRef"
+              :key="tableKey"
               border
               stripe
               size="small"
@@ -303,6 +304,11 @@ const {
   onCurrentChange,
 } = useTableCheck(data)
 
+const tableKey = ref(Math.random() + '')
+watch(tableData, () => {
+  tableKey.value = Math.random() + ''
+})
+
 const showScoreBoard = ref(false)
 watch(currentProblem, () => {
   if (currentProblem.value) {

+ 7 - 0
src/modules/marking/repeat/index.vue

@@ -65,6 +65,7 @@
           <div class="flex-1 scroll-auto m-t-mini">
             <base-table
               ref="tableRef"
+              :key="tableKey"
               border
               stripe
               size="small"
@@ -277,6 +278,12 @@ const {
   onDbClick,
   onCurrentChange,
 } = useTableCheck(data)
+
+const tableKey = ref(Math.random() + '')
+watch(tableData, () => {
+  tableKey.value = Math.random() + ''
+})
+
 watch(currentReMarkPaper, () => {
   if (currentReMarkPaper.value) {
     nextTick(() => {

+ 6 - 0
src/modules/monitor/system-check/index.vue

@@ -86,6 +86,7 @@
           <div class="flex-1 scroll-auto m-t-mini">
             <base-table
               ref="tableRef"
+              :key="tableKey"
               border
               stripe
               size="small"
@@ -356,6 +357,11 @@ const {
   // } = useTableCheck(systemSpotList)
 } = useTableCheck(data)
 
+const tableKey = ref(Math.random() + '')
+watch(tableData, () => {
+  tableKey.value = Math.random() + ''
+})
+
 watch(currentSystemCheckPaper, () => {
   if (currentSystemCheckPaper.value) {
     useFetch('viewSystemSpotPaper')