diff --git a/src/api/product/index.js b/src/api/product/index.js index b8ae70c..800ddbf 100644 --- a/src/api/product/index.js +++ b/src/api/product/index.js @@ -55,6 +55,15 @@ export function destroy(params) { }) } +export function imports(params) { + return request({ + method: "get", + url: "​/api​/admin​/product​/import", + params + }) +} + + diff --git a/src/utils/downloadRequest.js b/src/utils/downloadRequest.js index d3d86ef..90294df 100644 --- a/src/utils/downloadRequest.js +++ b/src/utils/downloadRequest.js @@ -48,7 +48,7 @@ export async function download(url, method = "get", info, filename) { url, method, responseType: "blob", - timeout: 10000, + timeout: 30000, headers: { Accept: "application/json", "Content-Type": "application/json; charset=utf-8", diff --git a/src/views/component/imports.vue b/src/views/component/imports.vue index fd62748..4138906 100644 --- a/src/views/component/imports.vue +++ b/src/views/component/imports.vue @@ -17,9 +17,6 @@ style="margin-top: 10px" drag :action="action" - :data="{ - table_name: tableName, - }" :headers="{ Authorization: `Bearer ${getToken()}`, }" @@ -44,6 +41,8 @@ import * as XLSX from "xlsx"; import { saveAs } from "file-saver"; import { getToken } from "@/utils/auth"; import { imports } from "@/api/system/baseForm"; +import { imports as importProduct } from "@/api/product/index"; + export default { props: { formInfo: { @@ -54,10 +53,9 @@ export default { }, data() { return { - action: `${process.env.VUE_APP_BASE_API}/api/admin/base-form/excel-show`, + action: `${process.env.VUE_APP_BASE_API}/api/admin/product/import`, dialogVisible: false, headers: [], - tableList: [], table: [], }; @@ -104,8 +102,7 @@ export default { }, imports() { - imports({ - table_name: this.tableName, + importProduct({ data: this.tableList }).then(res => { console.log(res) diff --git a/src/views/customer/components/addMessage.vue b/src/views/customer/components/addMessage.vue index 8329c13..9211155 100644 --- a/src/views/customer/components/addMessage.vue +++ b/src/views/customer/components/addMessage.vue @@ -59,6 +59,18 @@ + + + + + + + + +