From c7befa21fe89844008c75c572e26596d2ff6932e Mon Sep 17 00:00:00 2001
From: zhengchiliu <857493511@qq.com>
Date: Mon, 14 Sep 2026 01:52:56 +0800
Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E4=BA=A4=E6=98=93=E5=8D=95=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitea/workflows/deploy.yaml | 21 ++++++++++-----------
src/types/order.ts | 2 ++
src/views/order/OrderListView.vue | 9 +++++++++
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml
index 70bddee..0913fc9 100644
--- a/.gitea/workflows/deploy.yaml
+++ b/.gitea/workflows/deploy.yaml
@@ -45,6 +45,7 @@ jobs:
ls -la dist
- name: SSH 部署到生产机(蓝绿原子切换)
+ id: deploy
env:
SSH_KEY: ${{ secrets.ZT_CLOSET_PROD_SSH_KEY }}
SSH_HOST: ${{ vars.ZT_CLOSET_PROD_SSH_HOST }}
@@ -107,22 +108,20 @@ jobs:
if: always()
env:
DINGTALK_TOKEN: ${{ secrets.ZT_CLOSET_DINGTALK_TOKEN }}
- JOB_RESULT: ${{ jobs.build-and-deploy.result }}
+ # 部署步骤的结论:success / failure / skipped / cancelled(部署被跳过或失败均视为失败)
+ DEPLOY_OUTCOME: ${{ steps.deploy.outcome }}
run: |
- if [ "$JOB_RESULT" = "success" ]; then
+ if [ "$DEPLOY_OUTCOME" = "success" ]; then
STATUS="✅ 前端部署成功"
- COLOR="info"
else
STATUS="❌ 前端部署失败"
- COLOR="warning"
fi
+
+ # 单行拼装 payload:避免多行双引号转义导致 shell 语法错误;\n 交由 JSON 解析为换行
+ TEXT="## 前端部署通知\n\n**结果**:${STATUS}\n\n**触发人**:${{ gitea.actor }}\n**分支/标签**:${{ gitea.ref_name }}\n**提交**:[${{ gitea.sha }}](${{ gitea.server_url }}/${{ gitea.repository }}/commit/${{ gitea.sha }})\n**流水线**:[${{ gitea.run_id }}](${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }})"
+ PAYLOAD="{\"msgtype\":\"markdown\",\"markdown\":{\"title\":\"前端部署通知\",\"text\":\"${TEXT}\"}}"
+
curl -s -X POST "https://oapi.dingtalk.com/robot/send?access_token=${DINGTALK_TOKEN}" \
-H 'Content-Type: application/json' \
- -d "{
- \"msgtype\": \"markdown\",
- \"markdown\": {
- \"title\": \"前端部署通知\",
- \"text\": \"## 前端部署通知\n\n**结果**:${STATUS}\n\n**触发人**:${{ gitea.actor }}\n**分支/标签**:${{ gitea.ref_name }}\n**提交**:[${{ gitea.sha }}](${{ gitea.server_url }}/${{ gitea.repository }}/commit/${{ gitea.sha }})\n**流水线**:[${{ gitea.run_id }}](${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }})\n"
- }
- }"
+ -d "$PAYLOAD"
echo "钉钉通知已发送:${STATUS}"
diff --git a/src/types/order.ts b/src/types/order.ts
index c08299d..a57c6c9 100644
--- a/src/types/order.ts
+++ b/src/types/order.ts
@@ -29,6 +29,8 @@ export interface OrderListQuery {
page?: number
page_size?: number
order_no?: string
+ /** 微信交易号(精确) */
+ transaction_id?: string
user_id?: number
status?: number
}
diff --git a/src/views/order/OrderListView.vue b/src/views/order/OrderListView.vue
index e9e961a..6143d28 100644
--- a/src/views/order/OrderListView.vue
+++ b/src/views/order/OrderListView.vue
@@ -16,6 +16,7 @@ const pageSize = ref(10)
const query = reactive({
order_no: '',
+ transaction_id: '',
user_id: undefined as number | undefined,
status: undefined as number | undefined,
})
@@ -27,6 +28,7 @@ async function fetchList() {
page: page.value,
page_size: pageSize.value,
order_no: query.order_no || undefined,
+ transaction_id: query.transaction_id || undefined,
user_id: query.user_id || undefined,
status: query.status,
})
@@ -46,6 +48,7 @@ function handleSearch() {
function handleReset() {
query.order_no = ''
+ query.transaction_id = ''
query.user_id = undefined
query.status = undefined
handleSearch()
@@ -80,6 +83,12 @@ async function openDetail(row: OrderItem) {
clearable
@keyup.enter="handleSearch"
/>
+