|
@@ -8,21 +8,15 @@
|
|
|
import { Edit, Monitor, Picture as IconPicture, RefreshLeft, Timer } from '@element-plus/icons-vue';
|
|
|
import { useResponse } from '/@/utils/useResponse';
|
|
|
import * as api from '/@/views/shop-information/api';
|
|
|
-import {
|
|
|
- computerColumns,
|
|
|
- historyColumns,
|
|
|
- shopCurrentColumns,
|
|
|
- companySelect
|
|
|
-} from '/@/views/shop-information/useColumns';
|
|
|
+import { companySelect, computerColumns, historyColumns, shopCurrentColumns } from '/@/views/shop-information/useColumns';
|
|
|
import { useTableData } from '/@/utils/useTableData';
|
|
|
import { usePagination } from '/@/utils/usePagination';
|
|
|
import EditDrawer from './EditDrawer.vue';
|
|
|
-import { getOperator } from '/@/views/shop-information/api';
|
|
|
import { useTableHeight } from '/@/utils/useTableHeight';
|
|
|
|
|
|
-const cardContainer: Ref<HTMLElement | null> = useTemplateRef('cardContainer');
|
|
|
-const { tableHeight } = useTableHeight(cardContainer );
|
|
|
|
|
|
+const cardContainer: Ref<HTMLElement | null> = useTemplateRef('cardContainer');
|
|
|
+const { tableHeight } = useTableHeight(cardContainer);
|
|
|
|
|
|
const route = useRoute();
|
|
|
const platformNumber = route.query.platformNumber as string;
|
|
@@ -96,14 +90,22 @@ async function fetchShopDetailOverview() {
|
|
|
}
|
|
|
|
|
|
async function handleTabChange(tabValue: any) {
|
|
|
- gridOptions.pagerConfig.page = 1;
|
|
|
- gridOptions.pagerConfig.limit = 10;
|
|
|
+ const isTabSwitch = tabValue === selectedTab.value;
|
|
|
+
|
|
|
+ // 如果是切换标签,重置分页
|
|
|
+ if (isTabSwitch) {
|
|
|
+ gridOptions.pagerConfig.page = 1;
|
|
|
+ }
|
|
|
+
|
|
|
const query = {
|
|
|
platformNumber,
|
|
|
page: gridOptions.pagerConfig.page,
|
|
|
limit: gridOptions.pagerConfig.limit
|
|
|
};
|
|
|
- switch (tabValue) {
|
|
|
+
|
|
|
+ const temp = tabValue ?? selectedTab.value;
|
|
|
+
|
|
|
+ switch (temp) {
|
|
|
case '1':
|
|
|
gridOptions.columns = shopCurrentColumns;
|
|
|
await useTableData(api.getCurrentInfo, query, gridOptions);
|
|
@@ -262,7 +264,7 @@ async function fetchOperator() {
|
|
|
</template>
|
|
|
</vxe-grid>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</el-card>
|
|
|
<EditDrawer
|
|
|
v-if="isOpen"
|