|  | @@ -13,7 +13,7 @@ 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 { productColumns } from '../ColumnsTsx';
 |  |  import { productColumns } from '../ColumnsTsx';
 | 
											
												
													
														|  |  import DataTableSlot from '/@/views/product-manage/product-monitor/component/DataTableSlot.vue';
 |  |  import DataTableSlot from '/@/views/product-manage/product-monitor/component/DataTableSlot.vue';
 | 
											
												
													
														|  | -import { deleteRow } from '../api';
 |  | 
 | 
											
												
													
														|  | 
 |  | +import CreateDialog from '/@/views/product-manage/product-monitor/component/createDialog.vue';
 | 
											
												
													
														|  |  import { ElMessage } from 'element-plus';
 |  |  import { ElMessage } from 'element-plus';
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -74,6 +74,7 @@ const gridOptions: any = reactive({
 | 
											
												
													
														|  |  const checkedList = ref<Set<number>>(new Set());
 |  |  const checkedList = ref<Set<number>>(new Set());
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  const editOpen = ref(false);
 |  |  const editOpen = ref(false);
 | 
											
												
													
														|  | 
 |  | +const createOpen = ref(false);
 | 
											
												
													
														|  |  const rowData = ref({});
 |  |  const rowData = ref({});
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  const dialogVisible = ref(false);
 |  |  const dialogVisible = ref(false);
 | 
											
										
											
												
													
														|  | @@ -113,6 +114,46 @@ function handleRefresh() {
 | 
											
												
													
														|  |    fetchList();
 |  |    fetchList();
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +async function handleDownload() {
 | 
											
												
													
														|  | 
 |  | +	const confirmed = await ElMessageBox.confirm('是否确认导出当前时间内所有数据项?', '警告', {
 | 
											
												
													
														|  | 
 |  | +		confirmButtonText: '确定',
 | 
											
												
													
														|  | 
 |  | +		cancelButtonText: '取消',
 | 
											
												
													
														|  | 
 |  | +		type: 'warning'
 | 
											
												
													
														|  | 
 |  | +	});
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +	if (confirmed) {
 | 
											
												
													
														|  | 
 |  | +		gridOptions.loading = true;
 | 
											
												
													
														|  | 
 |  | +		try {
 | 
											
												
													
														|  | 
 |  | +			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
 | 
											
												
													
														|  | 
 |  | +			};
 | 
											
												
													
														|  | 
 |  | +			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; // 结束加载状态
 | 
											
												
													
														|  | 
 |  | +		}
 | 
											
												
													
														|  | 
 |  | +	}
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  async function batchOpen() {
 |  |  async function batchOpen() {
 | 
											
												
													
														|  |    const ids = Array.from(checkedList.value);
 |  |    const ids = Array.from(checkedList.value);
 | 
											
												
													
														|  |    await useResponse(api.updateShopDetail, { ids, status: 1 });
 |  |    await useResponse(api.updateShopDetail, { ids, status: 1 });
 | 
											
										
											
												
													
														|  | @@ -153,6 +194,13 @@ async function singleDelete(row: any) {
 | 
											
												
													
														|  |      ElMessage.success({ message: '删除成功', plain: true });
 |  |      ElMessage.success({ message: '删除成功', plain: true });
 | 
											
												
													
														|  |      handleRefresh();
 |  |      handleRefresh();
 | 
											
												
													
														|  |    }
 |  |    }
 | 
											
												
													
														|  | 
 |  | +function handleCreate() {
 | 
											
												
													
														|  | 
 |  | +	createOpen.value = true;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +function singleDelete(row: any) {
 | 
											
												
													
														|  | 
 |  | +  // dialogVisible.value = true;
 | 
											
												
													
														|  | 
 |  | +  rowData.value = row;
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  function downloadTemplate() {
 |  |  function downloadTemplate() {
 | 
											
										
											
												
													
														|  | @@ -164,9 +212,9 @@ defineExpose({ fetchList });
 | 
											
												
													
														|  |  </script>
 |  |  </script>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  <template>
 |  |  <template>
 | 
											
												
													
														|  | -  <vxe-grid ref="gridRef" :auto-resize="true"
 |  | 
 | 
											
												
													
														|  | 
 |  | +  <vxe-grid ref="gridRef" v-bind="gridOptions"
 | 
											
												
													
														|  | 
 |  | +            :auto-resize="true"
 | 
											
												
													
														|  |              :sync-resize="true"
 |  |              :sync-resize="true"
 | 
											
												
													
														|  | -            v-bind="gridOptions"
 |  | 
 | 
											
												
													
														|  |              @checkbox-change="selectChangeEvent"
 |  |              @checkbox-change="selectChangeEvent"
 | 
											
												
													
														|  |              @checkbox-all="selectAllChangeEvent">
 |  |              @checkbox-all="selectAllChangeEvent">
 | 
											
												
													
														|  |      <template #toolbar_buttons>
 |  |      <template #toolbar_buttons>
 | 
											
										
											
												
													
														|  | @@ -174,7 +222,7 @@ defineExpose({ fetchList });
 | 
											
												
													
														|  |          <PermissionButton :disabled="!checkedList.size" :icon="Delete" plain round type="danger" @click="batchOpen">
 |  |          <PermissionButton :disabled="!checkedList.size" :icon="Delete" plain round type="danger" @click="batchOpen">
 | 
											
												
													
														|  |            批量删除
 |  |            批量删除
 | 
											
												
													
														|  |          </PermissionButton>
 |  |          </PermissionButton>
 | 
											
												
													
														|  | -        <PermissionButton :icon="Plus" plain round type="primary" @click="batchOpen">
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <PermissionButton :icon="Plus" plain round type="primary" @click="handleCreate">
 | 
											
												
													
														|  |            新 增
 |  |            新 增
 | 
											
												
													
														|  |          </PermissionButton>
 |  |          </PermissionButton>
 | 
											
												
													
														|  |          <div class="custom-el-input">
 |  |          <div class="custom-el-input">
 | 
											
										
											
												
													
														|  | @@ -194,7 +242,7 @@ defineExpose({ fetchList });
 | 
											
												
													
														|  |            </el-select>
 |  |            </el-select>
 | 
											
												
													
														|  |          </div>
 |  |          </div>
 | 
											
												
													
														|  |          <VerticalDivider class="px-1" style="margin-left: 7px;" />
 |  |          <VerticalDivider class="px-1" style="margin-left: 7px;" />
 | 
											
												
													
														|  | -        <ImportButton :icon="Upload" bg text>导 入</ImportButton>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <ImportButton :uploadFunction="api.upload" :icon="Upload" bg text>导 入</ImportButton>
 | 
											
												
													
														|  |        </div>
 |  |        </div>
 | 
											
												
													
														|  |      </template>
 |  |      </template>
 | 
											
												
													
														|  |      <template #toolbar_tools>
 |  |      <template #toolbar_tools>
 | 
											
										
											
												
													
														|  | @@ -203,7 +251,7 @@ defineExpose({ fetchList });
 | 
											
												
													
														|  |            <Refresh />
 |  |            <Refresh />
 | 
											
												
													
														|  |          </el-icon>
 |  |          </el-icon>
 | 
											
												
													
														|  |        </el-button>
 |  |        </el-button>
 | 
											
												
													
														|  | -      <el-button circle class="mr-3 toolbar-btn">
 |  | 
 | 
											
												
													
														|  | 
 |  | +      <el-button circle class="mr-3 toolbar-btn" @click="handleDownload">
 | 
											
												
													
														|  |          <el-icon>
 |  |          <el-icon>
 | 
											
												
													
														|  |            <Download />
 |  |            <Download />
 | 
											
												
													
														|  |          </el-icon>
 |  |          </el-icon>
 | 
											
										
											
												
													
														|  | @@ -227,6 +275,7 @@ defineExpose({ fetchList });
 | 
											
												
													
														|  |      </template>
 |  |      </template>
 | 
											
												
													
														|  |    </vxe-grid>
 |  |    </vxe-grid>
 | 
											
												
													
														|  |    <EditDrawer v-if="editOpen" v-model="editOpen" :row-data="rowData" @refresh="handleRefresh" />
 |  |    <EditDrawer v-if="editOpen" v-model="editOpen" :row-data="rowData" @refresh="handleRefresh" />
 | 
											
												
													
														|  | 
 |  | +	<CreateDialog v-if="createOpen" v-model="createOpen" @refresh="fetchList" />
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  <style scoped>
 |  |  <style scoped>
 |