This commit is contained in:
van
2026-04-07 02:23:46 +08:00
parent 1ad851fb6f
commit 0d261efd49
5 changed files with 90 additions and 89 deletions

View File

@@ -1,12 +1,16 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = Jarvis VUE_APP_TITLE=Jarvis
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV=development
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES=true
# 前端请求前缀(与 axios baseURL 一致);由 vue.config.js devServer 代理到下方后端
VUE_APP_BASE_API=/jarvis-api VUE_APP_BASE_API=/jarvis-api
# VUE_APP_BASE_API = 'http://127.0.0.1:30313'
port = 8888 # 仅 npm run dev 时生效webpack 将 /jarvis-api 代理到该地址(可改为本机或其它局域网 IP
VUE_APP_DEV_PROXY_TARGET=http://192.168.8.88:30313
port=8888

View File

@@ -1,10 +1,10 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = Jarvis VUE_APP_TITLE=Jarvis
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV=production
# Jarvis/生产环境
# 打包后接口前缀:浏览器请求「当前站点域名 + 此前缀」,由部署机 Nginx 反代到公网/内网后端(勿写死 IP
VUE_APP_BASE_API=/jarvis-api VUE_APP_BASE_API=/jarvis-api
port = 8888
port=8888

View File

@@ -6,6 +6,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"prod": "vue-cli-service build",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview" "preview": "node build/index.js --preview"

View File

@@ -506,79 +506,62 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注/状态" prop="status" min-width="100" show-overflow-tooltip/>
<el-table-column label="下单人" prop="buyer" width="80"/> <el-table-column label="下单人" prop="buyer" width="80"/>
<!-- 退款状态拆分为多列避免行高被撑大 --> <!-- 退款/到账/价保/专票/评价合并为一列 -->
<el-table-column label="退款" prop="isRefunded" width="70" align="center"> <el-table-column label="状态" align="center" width="200" class-name="order-status-flags-cell">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="order-status-flags">
<el-tag <el-tag
:type="scope.row.isRefunded === 1 ? 'warning' : 'info'" :type="scope.row.isRefunded === 1 ? 'warning' : 'info'"
size="small" size="mini"
:title="scope.row.isRefunded === 1 && scope.row.refundDate ? '退款日期:' + parseTime(scope.row.refundDate) : ''" :title="scope.row.isRefunded === 1 && scope.row.refundDate ? '退款日期:' + parseTime(scope.row.refundDate) : '退款'"
@click.native="toggleRefunded(scope.row)" @click.native="toggleRefunded(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
{{ scope.row.isRefunded === 1 ? '已退款' : '未退款' }} {{ scope.row.isRefunded === 1 ? '已退款' : '未退款' }}
</el-tag> </el-tag>
</template>
</el-table-column>
<el-table-column label="退款到账" prop="isRefundReceived" width="80" align="center">
<template slot-scope="scope">
<el-tag <el-tag
:type="scope.row.isRefundReceived === 1 ? 'success' : 'info'" :type="scope.row.isRefundReceived === 1 ? 'success' : 'info'"
size="small" size="mini"
:title="scope.row.isRefundReceived === 1 && scope.row.refundReceivedDate ? '退款到账日期:' + parseTime(scope.row.refundReceivedDate) : ''" :title="scope.row.isRefundReceived === 1 && scope.row.refundReceivedDate ? '退款到账日期:' + parseTime(scope.row.refundReceivedDate) : '退款到账'"
@click.native="toggleRefundReceived(scope.row)" @click.native="toggleRefundReceived(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
{{ scope.row.isRefundReceived === 1 ? '已到账' : '未到账' }} {{ scope.row.isRefundReceived === 1 ? '已到账' : '未到账' }}
</el-tag> </el-tag>
</template>
</el-table-column>
<el-table-column label="后返到账" prop="isRebateReceived" width="76" align="center">
<template slot-scope="scope">
<el-tag <el-tag
:type="scope.row.isRebateReceived === 1 ? 'success' : 'info'" :type="scope.row.isRebateReceived === 1 ? 'success' : 'info'"
size="small" size="mini"
:title="scope.row.isRebateReceived === 1 && scope.row.rebateReceivedDate ? '后返到账日期:' + parseTime(scope.row.rebateReceivedDate) : ''" :title="scope.row.isRebateReceived === 1 && scope.row.rebateReceivedDate ? '后返到账日期:' + parseTime(scope.row.rebateReceivedDate) : '后返到账'"
@click.native="toggleRebateReceived(scope.row)" @click.native="toggleRebateReceived(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
{{ scope.row.isRebateReceived === 1 ? '已到账' : '未到账' }} {{ scope.row.isRebateReceived === 1 ? '已到账' : '未到账' }}
</el-tag> </el-tag>
</template>
</el-table-column>
<el-table-column label="价保" prop="isPriceProtected" width="66" align="center">
<template slot-scope="scope">
<el-tag <el-tag
:type="scope.row.isPriceProtected === 1 ? 'warning' : 'info'" :type="scope.row.isPriceProtected === 1 ? 'warning' : 'info'"
size="small" size="mini"
:title="scope.row.isPriceProtected === 1 && scope.row.priceProtectedDate ? '价保日期:' + parseTime(scope.row.priceProtectedDate) : ''" :title="scope.row.isPriceProtected === 1 && scope.row.priceProtectedDate ? '价保日期:' + parseTime(scope.row.priceProtectedDate) : ''"
@click.native="togglePriceProtected(scope.row)" @click.native="togglePriceProtected(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
{{ scope.row.isPriceProtected === 1 ? '是' : '否' }} {{ scope.row.isPriceProtected === 1 ? '是' : '否' }}
</el-tag> </el-tag>
</template>
</el-table-column>
<el-table-column label="专票" prop="isInvoiceOpened" width="60" align="center">
<template slot-scope="scope">
<el-tag <el-tag
:type="scope.row.isInvoiceOpened === 1 ? 'success' : 'info'" :type="scope.row.isInvoiceOpened === 1 ? 'success' : 'info'"
size="small" size="mini"
:title="scope.row.isInvoiceOpened === 1 && scope.row.invoiceOpenedDate ? '开票日期:' + parseTime(scope.row.invoiceOpenedDate) : ''" :title="scope.row.isInvoiceOpened === 1 && scope.row.invoiceOpenedDate ? '开票日期:' + parseTime(scope.row.invoiceOpenedDate) : ''"
@click.native="toggleInvoiceOpened(scope.row)" @click.native="toggleInvoiceOpened(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
{{ scope.row.isInvoiceOpened === 1 ? '是' : '否' }} {{ scope.row.isInvoiceOpened === 1 ? '是' : '否' }}
</el-tag> </el-tag>
</template>
</el-table-column>
<el-table-column label="评价" prop="isReviewPosted" width="60" align="center">
<template slot-scope="scope">
<el-tag <el-tag
:type="scope.row.isReviewPosted === 1 ? 'success' : 'info'" :type="scope.row.isReviewPosted === 1 ? 'success' : 'info'"
size="small" size="mini"
:title="scope.row.isReviewPosted === 1 && scope.row.reviewPostedDate ? '评价日期:' + parseTime(scope.row.reviewPostedDate) : ''" :title="scope.row.isReviewPosted === 1 && scope.row.reviewPostedDate ? '评价日期:' + parseTime(scope.row.reviewPostedDate) : ''"
@click.native="toggleReviewPosted(scope.row)" @click.native="toggleReviewPosted(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
{{ scope.row.isReviewPosted === 1 ? '是' : '否' }} {{ scope.row.isReviewPosted === 1 ? '是' : '否' }}
</el-tag> </el-tag>
</div>
</template> </template>
</el-table-column> </el-table-column>
@@ -591,7 +574,6 @@
</el-table-column> </el-table-column>
<!-- 其他信息列可折叠 --> <!-- 其他信息列可折叠 -->
<el-table-column label="备注/状态" prop="status" min-width="100" show-overflow-tooltip/>
<el-table-column label="订单状态" prop="orderStatus" width="80" align="center"> <el-table-column label="订单状态" prop="orderStatus" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag <el-tag
@@ -2917,6 +2899,19 @@ export default {
padding: 8px 0; padding: 8px 0;
} }
/* 合并列:退款/到账/价保等标签换行排列 */
.order-status-flags {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 4px;
max-width: 100%;
}
.order-status-flags .el-tag {
margin: 0;
}
/* 优化地址列显示,防止过长换行 */ /* 优化地址列显示,防止过长换行 */
.order-table ::v-deep .el-table .address-cell { .order-table ::v-deep .el-table .address-cell {
max-width: 280px; max-width: 280px;

View File

@@ -9,12 +9,13 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || 'Jarvis' // 网页标题 const name = process.env.VUE_APP_TITLE || 'Jarvis' // 网页标题
// 后端接口地址(仅用于开发环境代理) // 后端接口地址:开发/打包时 axios 的 baseURL一般为相对路径如 /jarvis-api由浏览器访问同域或 devServer 代理)
// 生产环境应该使用相对路径(如 /dev-api通过nginx代理 // 生产环境请保持相对路径,由部署机 Nginx 反代到公网后端;勿在构建里写死公网 IP
// 开发环境可以使用相对路径通过devServer代理或绝对URL const baseUrl = process.env.VUE_APP_BASE_API || (process.env.NODE_ENV === 'production' ? '/dev-api' : '/jarvis-api')
const baseUrl = process.env.VUE_APP_BASE_API || (process.env.NODE_ENV === 'production' ? '/dev-api' : 'http://127.0.0.1:30313') // 开发环境代理路径(与 VUE_APP_BASE_API 一致,例如 /jarvis-api
// 开发环境代理路径如果未设置VUE_APP_BASE_API使用默认代理路径
const devApiPath = process.env.VUE_APP_BASE_API || '/dev-api' const devApiPath = process.env.VUE_APP_BASE_API || '/dev-api'
// 仅 npm run devwebpack-dev-server把上述前缀代理到该后端默认局域网 Jarvis
const devProxyTarget = process.env.VUE_APP_DEV_PROXY_TARGET || 'http://192.168.8.88:30313'
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口
@@ -43,7 +44,7 @@ module.exports = {
// 如果VUE_APP_BASE_API是相对路径如/dev-api则使用代理 // 如果VUE_APP_BASE_API是相对路径如/dev-api则使用代理
// 如果是绝对URL则直接使用该URL不配置代理 // 如果是绝对URL则直接使用该URL不配置代理
[devApiPath]: { [devApiPath]: {
target: baseUrl.startsWith('http') ? baseUrl : 'http://127.0.0.1:30313', target: baseUrl.startsWith('http') ? baseUrl : devProxyTarget,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + devApiPath]: '' ['^' + devApiPath]: ''
@@ -51,7 +52,7 @@ module.exports = {
}, },
// springdoc proxy // springdoc proxy
'^/v3/api-docs/(.*)': { '^/v3/api-docs/(.*)': {
target: baseUrl.startsWith('http') ? baseUrl : 'http://127.0.0.1:30313', target: baseUrl.startsWith('http') ? baseUrl : devProxyTarget,
changeOrigin: true changeOrigin: true
} }
}, },