From 91b16ec6c344f2d3139d695c3d034e9489b86d64 Mon Sep 17 00:00:00 2001 From: bot_dev2 Date: Thu, 6 Aug 2026 12:51:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=20issue=20#164=20[A1?= =?UTF-8?q?]=20FBA=20UI=20=E9=AA=A8=E6=9E=B6=E5=AE=9A=E5=88=B6=E2=80=94?= =?UTF-8?q?=E2=80=94iAOP=20=E5=93=81=E7=89=8C+=E9=BB=98=E8=AE=A4=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5+=E6=B8=85=E7=90=86=20demo+=E6=9E=84=E5=BB=BA=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/fba/build-ui.sh | 43 +++ .../apps/web-antdv-next/.env.production | 14 +- .../apps/web-antdv-next/src/preferences.ts | 15 +- .../src/router/routes/modules/dashboard.ts | 38 --- .../src/router/routes/modules/demos.ts | 28 -- .../dashboard/analytics/analytics-trends.vue | 98 ------- .../analytics/analytics-visits-data.vue | 82 ------ .../analytics/analytics-visits-sales.vue | 46 --- .../analytics/analytics-visits-source.vue | 65 ----- .../dashboard/analytics/analytics-visits.vue | 55 ---- .../src/views/dashboard/analytics/index.vue | 90 ------ .../src/views/dashboard/workspace/index.vue | 266 ------------------ .../src/views/demos/antd/index.vue | 66 ----- 13 files changed, 66 insertions(+), 840 deletions(-) create mode 100644 deploy/fba/build-ui.sh delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/dashboard.ts delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/demos.ts delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-trends.vue delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-data.vue delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-sales.vue delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-source.vue delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits.vue delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/index.vue delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/workspace/index.vue delete mode 100644 deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/demos/antd/index.vue diff --git a/deploy/fba/build-ui.sh b/deploy/fba/build-ui.sh new file mode 100644 index 0000000..804dc26 --- /dev/null +++ b/deploy/fba/build-ui.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# ============================================================================= +# iAOP FBA UI 构建流水线(Epic #163 / issue #164 [A1]) +# +# 用法: +# ./deploy/fba/build-ui.sh [--src DIR] [--out DIR] +# --src FBA UI 工程目录(默认 deploy/fba/fba-ui-src) +# --out 产物输出目录(默认 deploy/fba/artifacts) +# +# 流程:pnpm install → 生产构建 → 打 tar 到 artifacts/ +# 产物:artifacts/fba-ui-dist.tar.gz(解压后 dist/ 即 nginx 站点目录) +# +# 环境要求:Node.js >= 18.18、pnpm >= 9(Vben5 monorepo) +# ============================================================================= +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +SRC="${SRC_DIR:-$ROOT/deploy/fba/fba-ui-src}" +OUT="${OUT_DIR:-$ROOT/deploy/fba/artifacts}" +APP_DIR="$SRC/apps/web-antdv-next" + +# 1) 参数校验 +[ -d "$APP_DIR" ] || { echo "[fail] 未找到 UI 工程: $APP_DIR"; exit 1; } +mkdir -p "$OUT" + +# 2) 环境检查 +command -v node >/dev/null || { echo "[fail] 缺少 node(>=18.18)"; exit 1; } +command -v pnpm >/dev/null || { echo "[fail] 缺少 pnpm(>=9),请先安装: npm i -g pnpm"; exit 1; } + +echo "[1/4] 依赖安装(pnpm install)..." +cd "$SRC" +pnpm install --frozen-lockfile=false + +echo "[2/4] 生产构建(web-antdv-next)..." +cd "$APP_DIR" +pnpm run build + +echo "[3/4] 打包 dist/ -> $OUT/fba-ui-dist.tar.gz" +cd "$APP_DIR" +tar -czf "$OUT/fba-ui-dist.tar.gz" dist/ + +echo "[4/4] 完成:$OUT/fba-ui-dist.tar.gz" +ls -lh "$OUT/fba-ui-dist.tar.gz" diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/.env.production b/deploy/fba/fba-ui-src/apps/web-antdv-next/.env.production index 403946b..6210ad5 100644 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/.env.production +++ b/deploy/fba/fba-ui-src/apps/web-antdv-next/.env.production @@ -1,10 +1,16 @@ -VITE_BASE=/ +# ===== Epic #163 / #164:构建参数模板化 ===== +# 构建/部署时按环境替换(部署见 deploy/fba/build-ui.sh) +# 1) VITE_BASE:FBA UI 挂载前缀(nginx /fba-admin/ 反代) +VITE_BASE=/fba-admin/ -# 接口地址 -VITE_GLOB_API_URL=https://fba.wu-clan.site +# 2) VITE_GLOB_API_URL:后端 API 基础地址(nginx 反代 /fba/ → fba_server:8001) +VITE_GLOB_API_URL=http://39.101.182.167:8090/fba + +# 3) VITE_APP_TITLE:浏览器标题(iAOP 品牌,preferences.ts 已固定,可覆盖) +VITE_APP_TITLE=iAOP 云美工业AI优化平台 # 是否开启压缩,可以设置为 none, brotli, gzip -VITE_COMPRESS=gzip +VITE_COMPRESS=none # 是否开启 PWA VITE_PWA=false diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/preferences.ts b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/preferences.ts index 9300d45..f34c713 100644 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/preferences.ts +++ b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/preferences.ts @@ -9,14 +9,25 @@ export const overridesPreferences = defineOverridesPreferences({ // overrides app: { accessMode: 'backend', - name: import.meta.env.VITE_APP_TITLE, + name: 'iAOP 云美工业AI优化平台', enableRefreshToken: true, + // Epic #163:登录后默认落驾驶舱(路由由后端菜单下发,views/iaop/cockpit) + defaultHomePath: '/iaop/cockpit', }, footer: { enable: false, }, logo: { - source: 'https://wu-clan.github.io/picx-images-hosting/logo/fba.png', + // iAOP 文字徽标(内联 SVG,避免外部图片依赖) + source: + 'data:image/svg+xml;utf8,' + + encodeURIComponent( + `` + + `` + + `i` + + `` + + ``, + ), }, shortcutKeys: { enable: false, diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/dashboard.ts b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/dashboard.ts deleted file mode 100644 index 5254dc6..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/dashboard.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { RouteRecordRaw } from 'vue-router'; - -import { $t } from '#/locales'; - -const routes: RouteRecordRaw[] = [ - { - meta: { - icon: 'lucide:layout-dashboard', - order: -1, - title: $t('page.dashboard.title'), - }, - name: 'Dashboard', - path: '/dashboard', - children: [ - { - name: 'Analytics', - path: '/analytics', - component: () => import('#/views/dashboard/analytics/index.vue'), - meta: { - affixTab: true, - icon: 'lucide:area-chart', - title: $t('page.dashboard.analytics'), - }, - }, - { - name: 'Workspace', - path: '/workspace', - component: () => import('#/views/dashboard/workspace/index.vue'), - meta: { - icon: 'carbon:workspace', - title: $t('page.dashboard.workspace'), - }, - }, - ], - }, -]; - -export default routes; diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/demos.ts b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/demos.ts deleted file mode 100644 index 4605d91..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/router/routes/modules/demos.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { RouteRecordRaw } from 'vue-router'; - -import { $t } from '#/locales'; - -const routes: RouteRecordRaw[] = [ - { - meta: { - icon: 'ic:baseline-view-in-ar', - keepAlive: true, - order: 1000, - title: $t('demos.title'), - }, - name: 'Demos', - path: '/demos', - children: [ - { - meta: { - title: $t('demos.antd'), - }, - name: 'AntDesignDemos', - path: '/demos/ant-design-next', - component: () => import('#/views/demos/antd/index.vue'), - }, - ], - }, -]; - -export default routes; diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-trends.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-trends.vue deleted file mode 100644 index f1f0b23..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-trends.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-data.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-data.vue deleted file mode 100644 index 190fb41..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-data.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-sales.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-sales.vue deleted file mode 100644 index 6ff5208..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-sales.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-source.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-source.vue deleted file mode 100644 index 0915c7a..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits-source.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits.vue deleted file mode 100644 index 7e0f101..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/analytics-visits.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/index.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/index.vue deleted file mode 100644 index e794c99..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/analytics/index.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/workspace/index.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/workspace/index.vue deleted file mode 100644 index b95d613..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/dashboard/workspace/index.vue +++ /dev/null @@ -1,266 +0,0 @@ - - - diff --git a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/demos/antd/index.vue b/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/demos/antd/index.vue deleted file mode 100644 index 6fb1998..0000000 --- a/deploy/fba/fba-ui-src/apps/web-antdv-next/src/views/demos/antd/index.vue +++ /dev/null @@ -1,66 +0,0 @@ - - -