diff --git a/src/utils/downloadRequest.js b/src/utils/downloadRequest.js index 5489be5..d3d86ef 100644 --- a/src/utils/downloadRequest.js +++ b/src/utils/downloadRequest.js @@ -8,11 +8,39 @@ import { Loading, Message } from "element-ui"; */ let loading; +function customParamsSerializer(params) { + let result = ''; + for (let key in params) { + if (params.hasOwnProperty(key)) { + if (Array.isArray(params[key])) { + params[key].forEach((item,index) => { + if(item.key){ + result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`; + + }else{ + result +=`${key}[${index}]=${item}&` + } + }); + }else if( typeof params[key] === 'object' ){ + for(var k in params[key]){ + result +=`${key}[${k}]=${params[key][k]}&` + } + } else { + result += `${key}=${params[key]}&`; + } + } + } + + // result += 'token='+getToken() + console.log("result",result, result.slice(0, -1)) + return result.slice(0, -1); +} + export async function download(url, method = "get", info, filename) { loading = Loading.service({ lock: true, background: "rgba(0,0,0,0.4)", - text: "文件正在生成中...", + text: "Loading...", }); let options = { @@ -29,6 +57,7 @@ export async function download(url, method = "get", info, filename) { }, }; if (method === "get") { + // options.url = url+'?'+customParamsSerializer(info) Object.defineProperty(options, "params", { value: info, enumerable: true, @@ -44,6 +73,10 @@ export async function download(url, method = "get", info, filename) { } try { + if(options.method==='get'){ + options.paramsSerializer = customParamsSerializer + } + console.log("options",options) const response = await axios.request(options); loading.close(); diff --git a/src/views/application/index.vue b/src/views/application/index.vue index 9b17fb5..f6c9df0 100644 --- a/src/views/application/index.vue +++ b/src/views/application/index.vue @@ -74,12 +74,12 @@ fixed: 'left' }, { prop: 'number', - label: 'Application Id(应用id)', + label: 'Application Id', align: 'left', width:360 }, { prop: 'title', - label: 'Title(标题)', + label: 'Title', align: 'left', } ] diff --git a/src/views/customer/index.vue b/src/views/customer/index.vue index 116149b..f4306a0 100644 --- a/src/views/customer/index.vue +++ b/src/views/customer/index.vue @@ -72,42 +72,42 @@ fixed: 'left' }, { prop: 'first_name', - label: 'First Name(名)', + label: 'First Name', align: 'left', width: 240, }, { prop: 'last_name', - label: 'Last Name(姓)', + label: 'Last Name', align: 'left', width: 240, }, { prop: 'origination', - label: 'Organization(组织)', + label: 'Organization', align: 'left', width: 240 }, { prop: 'email', - label: 'Email(邮箱)', + label: 'Email', align: 'left', width: 240 }, { prop: 'country', - label: 'Country/Region(国家)', + label: 'Country/Region', align: 'left', width: 240 }, { prop: 'shipping_address', - label: 'Address(地址)', + label: 'Address', align: 'left', width: 360 }, { prop: 'Created At', - label: 'created_at(创建时间)', + label: 'created_at', align: 'left', width: 240 } diff --git a/src/views/order/index.vue b/src/views/order/index.vue index c35d9ed..aeaae53 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -14,7 +14,11 @@
reset -
+ +
+ export +
+ @@ -26,17 +30,9 @@ -