Эх сурвалжийг харах

refactor(product-manage): 移除数据表格的按需加载
- 在 competitor-monitor、product-list 和 product-monitor 组件中移除了 DataTable 组件的按需加载逻辑
- 直接导入 DataTable 组件,而不是使用 defineAsyncComponent
- 优化了代码结构,提高了组件的加载效率

WanGxC 6 сар өмнө
parent
commit
165fccff83

+ 1 - 2
src/views/product-manage/competitor-monitor/index.vue

@@ -12,10 +12,9 @@ import * as api from './api';
 import { useTemplateRef } from 'vue';
 import { DictionaryStore } from '/@/stores/dictionary';
 import { useCustomHeight } from '/@/utils/useCustomHeight';
+import DataTable from './component/DataTable.vue';
 
 
-const DataTable = defineAsyncComponent(() => import('./component/DataTable.vue'));
-
 defineOptions({
   name: 'CompetitorMonitor'
 });

+ 2 - 3
src/views/product-manage/product-list/index.vue

@@ -12,10 +12,9 @@ import { useResponse } from '/@/utils/useResponse';
 import { useTemplateRef } from 'vue';
 import * as api from './api';
 import { useCustomHeight } from '/@/utils/useCustomHeight';
+import DataTable from './component/DataTable.vue';
 
 
-const DataTable = defineAsyncComponent(() => import('./component/DataTable.vue'));
-
 defineOptions({
   name: 'ProductList'
 });
@@ -169,7 +168,7 @@ async function resetParameter() {
           <el-button :icon="Search" :loading="btnLoading" class="mb-4" type="primary" @click="handleQuery">
             查 询
           </el-button>
-          <el-button :icon="RefreshLeft" :loading="resetLoading" color="#ECECF1C9" style="width: 88px; color: #3c3c3c;" 
+          <el-button :icon="RefreshLeft" :loading="resetLoading" color="#ECECF1C9" style="width: 88px; color: #3c3c3c;"
                      @click="resetParameter">
             重 置
           </el-button>

+ 2 - 3
src/views/product-manage/product-monitor/index.vue

@@ -12,10 +12,9 @@ import * as api from './api';
 import { useTemplateRef } from 'vue';
 import { DictionaryStore } from '/@/stores/dictionary';
 import { useCustomHeight } from '/@/utils/useCustomHeight';
+import DataTable from './component/DataTable.vue';
 
 
-const DataTable = defineAsyncComponent(() => import('./component/DataTable.vue'));
-
 defineOptions({
   name: 'ProductMonitor'
 });
@@ -197,7 +196,7 @@ async function resetParameter() {
           <el-button :icon="Search" :loading="btnLoading" class="mb-4" type="primary" @click="handleQuery">
             查 询
           </el-button>
-          <el-button :icon="RefreshLeft" :loading="resetLoading" color="#ECECF1C9" style="width: 88px; color: #3c3c3c;" 
+          <el-button :icon="RefreshLeft" :loading="resetLoading" color="#ECECF1C9" style="width: 88px; color: #3c3c3c;"
                      @click="resetParameter">
             重 置
           </el-button>