|
@@ -5,13 +5,12 @@
|
|
* @Author: xinyan
|
|
* @Author: xinyan
|
|
*/
|
|
*/
|
|
|
|
|
|
-import { Delete, Download, InfoFilled, Plus, Refresh, Upload } from '@element-plus/icons-vue';
|
|
|
|
|
|
+import { Download, Plus, Refresh, Upload } from '@element-plus/icons-vue';
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
import { usePagination } from '/@/utils/usePagination';
|
|
import { usePagination } from '/@/utils/usePagination';
|
|
import { useTableData } from '/@/utils/useTableData';
|
|
import { useTableData } from '/@/utils/useTableData';
|
|
-import { ProductColumns } from '/@/views/product-manage/Columns';
|
|
|
|
import DataTableSlot from './DataTableSlot.vue';
|
|
import DataTableSlot from './DataTableSlot.vue';
|
|
-import { downloadFile } from '/@/utils/service';
|
|
|
|
|
|
+import { uesDownloadFile } from '/@/utils/useDownload';
|
|
import PermissionButton from '/src/components/PermissionButton/index.vue';
|
|
import PermissionButton from '/src/components/PermissionButton/index.vue';
|
|
import ImportButton from '/src/components/ImportButton/index.vue';
|
|
import ImportButton from '/src/components/ImportButton/index.vue';
|
|
import VerticalDivider from '/src/components/VerticalDivider/index.vue';
|
|
import VerticalDivider from '/src/components/VerticalDivider/index.vue';
|
|
@@ -19,7 +18,6 @@ import EditDrawer from '/src/views/product-manage/product-list/component/EditDra
|
|
import NoticeDialog from '/src/views/product-manage/product-list/component/NoticeDialog.vue';
|
|
import NoticeDialog from '/src/views/product-manage/product-list/component/NoticeDialog.vue';
|
|
import * as api from '../api';
|
|
import * as api from '../api';
|
|
import { useResponse } from '/@/utils/useResponse';
|
|
import { useResponse } from '/@/utils/useResponse';
|
|
-import DownloadError from '/@/views/product-manage/product-list/component/DownloadError.vue';
|
|
|
|
import { CostDetailColumns } from '/@/views/price-approval/Columns';
|
|
import { CostDetailColumns } from '/@/views/price-approval/Columns';
|
|
|
|
|
|
interface Parameter {
|
|
interface Parameter {
|
|
@@ -114,27 +112,22 @@ function handleRefresh() {
|
|
}
|
|
}
|
|
|
|
|
|
async function handleDownload() {
|
|
async function handleDownload() {
|
|
- gridOptions.loading = true;
|
|
|
|
- try {
|
|
|
|
- const query = {
|
|
|
|
- description: queryParameter?.description,
|
|
|
|
- platform: queryParameter?.platform,
|
|
|
|
- station: queryParameter?.station,
|
|
|
|
- };
|
|
|
|
- const response = await api.exportData(query);
|
|
|
|
- const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
|
|
- const link = document.createElement('a');
|
|
|
|
- link.href = url;
|
|
|
|
- link.setAttribute('download', '商品列表数据.xlsx');
|
|
|
|
- document.body.appendChild(link);
|
|
|
|
- link.click();
|
|
|
|
- ElMessage.success('数据导出成功!');
|
|
|
|
- } catch (error) {
|
|
|
|
- ElMessage.error('数据导出失败,请重试!');
|
|
|
|
- console.error(error);
|
|
|
|
- } finally {
|
|
|
|
- gridOptions.loading = false; // 结束加载状态
|
|
|
|
- }
|
|
|
|
|
|
+ // gridOptions.loading = true;
|
|
|
|
+ // try {
|
|
|
|
+ // await uesDownloadFile({
|
|
|
|
+ // apiMethod: api.exportData, // 调用的 API 方法
|
|
|
|
+ // queryParams: {
|
|
|
|
+ // description: queryParameter?.description,
|
|
|
|
+ // platform: queryParameter?.platform,
|
|
|
|
+ // station: queryParameter?.station,
|
|
|
|
+ // },
|
|
|
|
+ // fileName: '成本查看数据.xlsx', // 自定义文件名
|
|
|
|
+ // successMessage: () => ElMessage.success('数据导出成功!'),
|
|
|
|
+ // errorMessage: () => ElMessage.error('数据导出失败,请重试!'),
|
|
|
|
+ // });
|
|
|
|
+ // } finally {
|
|
|
|
+ // gridOptions.loading = false; // 结束加载状态
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
function selectChangeEvent({ checked, row }: any) {
|
|
function selectChangeEvent({ checked, row }: any) {
|
|
@@ -159,9 +152,7 @@ function selectAllChangeEvent({ checked }: any) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-function handleCreate() {
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
|
|
+function handleCreate() {}
|
|
|
|
|
|
function handleEdit(row: any) {
|
|
function handleEdit(row: any) {
|
|
editOpen.value = true;
|
|
editOpen.value = true;
|
|
@@ -176,7 +167,6 @@ async function singleDelete(row: any) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
function downloadTemplate() {
|
|
function downloadTemplate() {
|
|
const url = '/api/choice/reviews_monitor/import_data/';
|
|
const url = '/api/choice/reviews_monitor/import_data/';
|
|
const fileName = '商品监控模板.xlsx';
|
|
const fileName = '商品监控模板.xlsx';
|
|
@@ -200,17 +190,24 @@ const gridEvents = {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
-function cellStyle(){
|
|
|
|
- return{
|
|
|
|
- fontWeight:500,
|
|
|
|
- }
|
|
|
|
|
|
+function cellStyle() {
|
|
|
|
+ return {
|
|
|
|
+ fontWeight: 500,
|
|
|
|
+ };
|
|
}
|
|
}
|
|
|
|
|
|
defineExpose({ fetchList });
|
|
defineExpose({ fetchList });
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
- <vxe-grid ref="gridRef" v-bind="gridOptions" v-on="gridEvents" @checkbox-change="selectChangeEvent" @checkbox-all="selectAllChangeEvent" :cell-style="cellStyle">
|
|
|
|
|
|
+ <vxe-grid
|
|
|
|
+ ref="gridRef"
|
|
|
|
+ :cell-style="cellStyle"
|
|
|
|
+ v-bind="gridOptions"
|
|
|
|
+ v-on="gridEvents"
|
|
|
|
+ @checkbox-change="selectChangeEvent"
|
|
|
|
+ @checkbox-all="selectAllChangeEvent"
|
|
|
|
+ >
|
|
<!-- 工具栏左侧 -->
|
|
<!-- 工具栏左侧 -->
|
|
<template #toolbar_buttons>
|
|
<template #toolbar_buttons>
|
|
<div class="flex gap-2">
|
|
<div class="flex gap-2">
|