|
@@ -18,6 +18,7 @@ import VerticalDivider from '/src/components/VerticalDivider/index.vue';
|
|
|
import EditDrawer from './EditDrawer.vue';
|
|
|
import CreateDialog from '/@/views/product-manage/competitor-monitor/component/createDialog.vue';
|
|
|
import * as api from '../api';
|
|
|
+import { downloadFile } from '/@/utils/service';
|
|
|
|
|
|
|
|
|
interface Parameter {
|
|
@@ -82,7 +83,7 @@ const rowData = ref({});
|
|
|
|
|
|
const dialogVisible = ref(false);
|
|
|
|
|
|
-const templateType = ref();
|
|
|
+const templateType = ref('monitor');
|
|
|
|
|
|
onMounted(() => {
|
|
|
fetchList();
|
|
@@ -199,7 +200,18 @@ function handleCreate() {
|
|
|
}
|
|
|
|
|
|
function downloadTemplate() {
|
|
|
- // console.log('111=> ');
|
|
|
+ const url = '/api/choice/competitor_monitor/import_data/';
|
|
|
+ const fileName = '竞品监控模板.xlsx';
|
|
|
+
|
|
|
+ if (url) {
|
|
|
+ downloadFile({
|
|
|
+ url,
|
|
|
+ method: 'GET',
|
|
|
+ filename: fileName,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.error('未知的模板类型:', templateType.value);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
defineExpose({ fetchList });
|
|
@@ -249,9 +261,7 @@ defineExpose({ fetchList });
|
|
|
<VerticalDivider style="margin-left: 7px" />
|
|
|
</div>
|
|
|
</template>
|
|
|
- <el-option label="商品通知模板" value="item1" />
|
|
|
- <el-option label="商品模板" value="item2" />
|
|
|
- <el-option label="指导价格模板" value="item3" />
|
|
|
+ <el-option label="竞品监控模板" value="monitor" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<VerticalDivider class="px-1" style="margin-left: 7px;" />
|