|
@@ -9,13 +9,14 @@ import { Delete, Download, InfoFilled, Plus, Refresh, Upload } from '@element-pl
|
|
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 { useResponse } from '/@/utils/useResponse';
|
|
import { CompetitorMonitorColumns } from '/@/views/product-manage/Columns';
|
|
import { CompetitorMonitorColumns } from '/@/views/product-manage/Columns';
|
|
import DataTableSlot from './DataTableSlot.vue';
|
|
import DataTableSlot from './DataTableSlot.vue';
|
|
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';
|
|
import EditDrawer from './EditDrawer.vue';
|
|
import EditDrawer from './EditDrawer.vue';
|
|
-import CreateDialog from '/@/views/product-manage/product-monitor/component/createDialog.vue';
|
|
|
|
|
|
+import CreateDialog from '/@/views/product-manage/competitor-monitor/component/createDialog.vue';
|
|
import * as api from '../api';
|
|
import * as api from '../api';
|
|
|
|
|
|
|
|
|
|
@@ -117,33 +118,26 @@ function handleRefresh() {
|
|
}
|
|
}
|
|
|
|
|
|
async function handleDownload() {
|
|
async function handleDownload() {
|
|
- const confirmed = await ElMessageBox.confirm('是否确认导出当前时间内所有数据项?', '警告', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- if (confirmed) {
|
|
|
|
gridOptions.loading = true;
|
|
gridOptions.loading = true;
|
|
try {
|
|
try {
|
|
const query = {
|
|
const query = {
|
|
- country_code: queryParameter?.country,
|
|
|
|
- goods__brand: queryParameter?.brand,
|
|
|
|
- goods__tag: queryParameter?.group,
|
|
|
|
- status: queryParameter?.status,
|
|
|
|
- shop_id: queryParameter?.shop,
|
|
|
|
- asin: queryParameter?.asin,
|
|
|
|
- goods__sku: queryParameter?.sku,
|
|
|
|
- platform_number: queryParameter?.platformId,
|
|
|
|
- goods__all_ratings: queryParameter?.scoreNumber,
|
|
|
|
- goods__all_reviews: queryParameter?.commentNumber,
|
|
|
|
- goods__all_score: queryParameter?.displayScore
|
|
|
|
|
|
+ country_code: queryParameter?.country,
|
|
|
|
+ goods__brand: queryParameter?.brand,
|
|
|
|
+ goods__tag: queryParameter?.group,
|
|
|
|
+ status: queryParameter?.status,
|
|
|
|
+ shop_id: queryParameter?.shop,
|
|
|
|
+ asin: queryParameter?.asin,
|
|
|
|
+ goods__sku: queryParameter?.sku,
|
|
|
|
+ platform_number: queryParameter?.platformId,
|
|
|
|
+ goods__all_ratings: queryParameter?.scoreNumber,
|
|
|
|
+ goods__all_reviews: queryParameter?.commentNumber,
|
|
|
|
+ goods__all_score: queryParameter?.displayScore
|
|
};
|
|
};
|
|
const response = await api.exportData(query);
|
|
const response = await api.exportData(query);
|
|
const url = window.URL.createObjectURL(new Blob([ response.data ]));
|
|
const url = window.URL.createObjectURL(new Blob([ response.data ]));
|
|
const link = document.createElement('a');
|
|
const link = document.createElement('a');
|
|
link.href = url;
|
|
link.href = url;
|
|
- link.setAttribute('download', '商品监控数据.xlsx');
|
|
|
|
|
|
+ link.setAttribute('download', '竞品监控数据.xlsx');
|
|
document.body.appendChild(link);
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
link.click();
|
|
ElMessage.success('数据导出成功!');
|
|
ElMessage.success('数据导出成功!');
|
|
@@ -153,7 +147,6 @@ async function handleDownload() {
|
|
} finally {
|
|
} finally {
|
|
gridOptions.loading = false; // 结束加载状态
|
|
gridOptions.loading = false; // 结束加载状态
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
async function batchDelete() {
|
|
async function batchDelete() {
|
|
@@ -271,11 +264,31 @@ defineExpose({ fetchList });
|
|
<Refresh />
|
|
<Refresh />
|
|
</el-icon>
|
|
</el-icon>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button circle class="mr-3 toolbar-btn" @click="handleDownload">
|
|
|
|
- <el-icon>
|
|
|
|
- <Download />
|
|
|
|
- </el-icon>
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
+ width="220"
|
|
|
|
+ :icon="InfoFilled"
|
|
|
|
+ icon-color="#626AEF"
|
|
|
|
+ title="是否确认导出当前时间内所有数据项?"
|
|
|
|
+ @confirm="handleDownload"
|
|
|
|
+ >
|
|
|
|
+ <template #reference>
|
|
|
|
+ <el-button circle class="mr-3 toolbar-btn">
|
|
|
|
+ <el-icon>
|
|
|
|
+ <Download />
|
|
|
|
+ </el-icon>
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template #actions="{ confirm, cancel }">
|
|
|
|
+ <el-button size="small" @click="cancel">No!</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="danger"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="confirm"
|
|
|
|
+ >
|
|
|
|
+ Yes?
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-popconfirm>
|
|
</template>
|
|
</template>
|
|
<template #top>
|
|
<template #top>
|
|
<div class="mb-2"></div>
|
|
<div class="mb-2"></div>
|