From 4481fa90dfcf540f9ad0b070f800d77ea1cb8083 Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Thu, 6 Feb 2025 14:30:55 +0800
Subject: [PATCH] up
---
src/utils/downloadRequest.js | 35 +++++++++++-
src/views/application/index.vue | 4 +-
src/views/customer/index.vue | 14 ++---
src/views/order/index.vue | 62 +++++++++++++++------
src/views/parameter/index.vue | 8 +--
src/views/product/components/addProduct.vue | 10 ++--
src/views/product/index.vue | 22 ++++----
src/views/system/components/Account.vue | 10 ++--
src/views/system/password.vue | 14 ++---
vue.config.js | 2 +-
10 files changed, 122 insertions(+), 59 deletions(-)
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 @@
-
+
-
-
-
+
@@ -45,7 +41,7 @@
-
+
@@ -54,7 +50,7 @@
-
+
@@ -86,7 +82,10 @@
import {
index,
destroy
- } from "@/api/order/index.js"
+ } from "@/api/order/index.js"
+ import {
+ download
+ } from "@/utils/downloadRequest";
export default {
components: {},
data() {
@@ -98,7 +97,8 @@
},
total: 0,
list: [],
- table_item: [{
+ table_item: [{
+ prop:'index',
type: 'index',
width: 50,
fixed: 'left'
@@ -108,7 +108,7 @@
align: 'left',
width: 240
}, {
- prop: 'product',
+ prop: 'order_product',
label: 'Product',
align: 'left',
minWidth: 360,
@@ -136,6 +136,11 @@
label: 'Address',
align: 'left',
width: 360
+ }, {
+ prop: 'created_at',
+ label: 'Created At',
+ align: 'left',
+ width: 240
}]
}
},
@@ -156,6 +161,31 @@
this.select.page = 1
this.select.number = ''
this.getList()
+ },
+ exportExcel() {
+ let _export = {}
+ this.table_item.map(item => {
+ if (item.prop === 'index') {
+
+ }else {
+ _export[item.prop] = item.label
+ }
+ })
+ download(
+ '/api/admin/order/index',
+ 'get', {
+ export_fields: _export,
+ show_relation: ['orderProducts.product', 'user'],
+ filter: [{
+ key: 'number',
+ op: 'like',
+ value: this.select.number
+ }],
+ is_export: 1,
+ page: 1,
+ page_size: 99999
+ },
+ `Orders.xlsx`)
},
async getList() {
const res = await index({
diff --git a/src/views/parameter/index.vue b/src/views/parameter/index.vue
index 874e9d6..18c4681 100644
--- a/src/views/parameter/index.vue
+++ b/src/views/parameter/index.vue
@@ -69,23 +69,23 @@
fixed: 'left'
}, {
prop: 'number',
- label: 'Parameter Encoding(参数编码)',
+ label: 'Parameter Encoding',
align: 'left',
width:240,
}, {
prop: 'name',
- label: 'Parameter Name(参数名称)',
+ label: 'Parameter Name',
align: 'left',
width:240,
},
{
prop: 'remark',
- label: 'Remark(备注)',
+ label: 'Remark',
align: 'left'
},
{
prop: 'sort',
- label: 'Sort(排序)',
+ label: 'Sort',
align: 'left',
width: 120
}
diff --git a/src/views/product/components/addProduct.vue b/src/views/product/components/addProduct.vue
index f8c0328..0714e67 100644
--- a/src/views/product/components/addProduct.vue
+++ b/src/views/product/components/addProduct.vue
@@ -61,7 +61,7 @@
- Visible(前台是否显示):
+ Visible:
@@ -74,7 +74,7 @@
- Active(当前是否售卖):
+ Active:
@@ -87,13 +87,13 @@
- Web Visibility:(是否显示价格)
+ Web Visibility:
- Need to log in(需要登录)
- Need to contact sales(需要联系销售)
+ Need to log in
+ Need to contact sales
diff --git a/src/views/product/index.vue b/src/views/product/index.vue
index 9fbefe5..139d209 100644
--- a/src/views/product/index.vue
+++ b/src/views/product/index.vue
@@ -122,11 +122,11 @@
// },
{
id:0,
- value:'Need to log in(需要登录)'
+ value:'Need to log in'
},
{
id:1,
- value:'Need to contact sales(需要联系销售)'
+ value:'Need to contact sales'
}],
table_item: [{
type: 'index',
@@ -134,28 +134,28 @@
fixed: 'left'
}, {
prop: 'category',
- label: 'Product Phase(产品项)',
+ label: 'Product Phase',
align: 'left',
}, {
prop: 'name',
- label: 'Product Name(产品名称)',
+ label: 'Product Name',
align: 'left',
width: 360
}, {
prop: 'number',
- label: 'Part Number(产品编号)',
+ label: 'Part Number',
align: 'left',
width: 360
}, {
prop: 'list_price',
- label: 'List Price(产品价格)',
+ label: 'List Price',
align: 'left',
width: 240
},
{
prop: 'is_visible',
- label: 'Visible(前台是否显示)',
+ label: 'Visible',
align: 'center',
width: 120,
formatter: (cell, data, value) => {
@@ -164,7 +164,7 @@
},
{
prop: 'is_sell',
- label: 'Active(当前是否售卖)',
+ label: 'Active',
align: 'center',
width: 120,
formatter: (cell, data, value) => {
@@ -173,14 +173,14 @@
},
{
prop: 'show_price',
- label: 'Web Visibility(是否显示价格)',
+ label: 'Web Visibility',
align: 'center',
width: 180,
formatter: (cell, data, value) => {
if(value==1){
- return 'Need to contact sales(需要联系销售)'
+ return 'Need to contact sales'
}else{
- return 'Need to log in(需要登录)'
+ return 'Need to log in'
}
}
}
diff --git a/src/views/system/components/Account.vue b/src/views/system/components/Account.vue
index cb0d2f6..5554e9b 100644
--- a/src/views/system/components/Account.vue
+++ b/src/views/system/components/Account.vue
@@ -1,13 +1,13 @@
-
+
-
+
- 保存
+ Confirm
@@ -32,12 +32,12 @@
rules: {
name: [{
required: true,
- message: '请输入姓名',
+ message: 'Please Input Username',
trigger: 'blur'
}],
password: [{
required: true,
- message: '请输入密码',
+ message: 'Please Input Password',
trigger: 'blur',
}]
},
diff --git a/src/views/system/password.vue b/src/views/system/password.vue
index 3b1e7b6..7ba2639 100644
--- a/src/views/system/password.vue
+++ b/src/views/system/password.vue
@@ -3,17 +3,17 @@
-
+
-
+
-
+
+
@@ -47,7 +47,7 @@
data() {
return {
user: {},
- activeTab: 'timeline'
+ activeTab: 'account'
}
},
computed: {
diff --git a/vue.config.js b/vue.config.js
index e1ec061..2e40aa3 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
- outputDir: '/Users/mac/Documents/朗业/2024/s-美国赛分/saifen/public/admin_test',
+ outputDir: '/Users/mac/Documents/朗业/2024/s-美国赛分/saifen/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项