Compare commits

..

No commits in common. "b02d678dea092efac655ba86b4af19731a0ba400" and "6911b502186ec466c2c2130548185d302a0c7621" have entirely different histories.

3 changed files with 20 additions and 24 deletions

View File

@ -18,9 +18,6 @@ jobs:
- name: Install git & node 22 (npmmirror)
run: |
set -e
# apt 换腾讯云源deb.debian.org 国内直连超时)
sed -i 's|deb.debian.org|mirrors.cloud.tencent.com|g; s|security.debian.org|mirrors.cloud.tencent.com|g' /etc/apt/sources.list 2>/dev/null || true
sed -i 's|deb.debian.org|mirrors.cloud.tencent.com|g; s|security.debian.org|mirrors.cloud.tencent.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || true
apt-get update -qq
apt-get install -y -qq git xz-utils >/dev/null
# node 22 二进制解压到 /optPATH 前置(覆盖镜像自带 node 20

View File

@ -1,8 +1,6 @@
# admin.xpcool.com 变更记录
> 倒序最新在上。格式YYYY-MM-DD | 类型 | 摘要
2026-08-26 | CFG | 安装 TDesign MCP~/.workbuddy/mcp.json 新增 tdesign-mcp-server: `npx -y tdesign-mcp-server@latest`v0.2.4 启动验证通过);约定:后续后台界面开发优先用 TDesign MCP 查官方文档get-component-docs 等)
2026-08-26 | FIX+CHG | 修复前端编译错误access.ts layoutMap 重复声明致 vite Transform PARSE_ERROR菜单管理树形改用 tdesign 官方方案:`t-enhanced-table`t-table 不支持 tree+ tree{childrenKey/treeNodeColumnIndex/defaultExpandAll/indent} + 异步数据后 `ref.expandAll()`defaultExpandAll 仅首次渲染生效)——替代先前扁平化+缩进的自造方案
2026-08-26 | CFG | 新增 .gitea/workflows/deploy.ymlGitea act_runner 自动部署push main/dev → 下载 node22 二进制npmmirror覆盖镜像 node20pnpm11 需 node:sqlite→ corepack pnpm@11.16.0 → pnpm install → 直接 vite build避开 turbo 卡死)→ cp dist 到 /data/www/admin.xpcool.com/YAML 已校验
2026-08-26 | CHG | 看房 house 模块前端落地api/house.ts + views/house/{community,listing,dashboard,data}/index.vue小区 CRUD、房源多维筛选+多选批量标记笋盘/低可信、看板 echarts 概览卡片/区域均价柱状/挂牌vs成交趋势菜单走后端动态路由011 种子 component=house/xxx/index图表复用 @vben/plugins/echarts 的 EchartsUI/useEcharts
2026-08-26 | DEP | 线上 dist 更新为「无下拉版」vite build 产物index-index-B-XlZ2uN.js并部署 /data/www/admin.xpcool.com/,修复登录 no rows根因=线上仍是 19:32 旧版(默认 admin/admin123admin 已删故报错;验证:线上 index 新版 + xxcool 登录成功 + js 无 admin123 webhook 自动部署未生效deploy-webhook.service disabled/inactive8/22 11:52 停止9000 未监听),提交代码不会自动部署,需 `sudo systemctl enable --now deploy-webhook` + Gitea 仓库 webhook 配置

View File

@ -18,13 +18,20 @@ import {
const { hasAccessByCodes } = useAccess();
const loading = ref(false);
// children t-enhanced-table
const tree = ref<MenuNode[]>([]);
// t-enhanced-table
const tableRef = ref<any>(null);
// depth t-table tree
const flatList = ref<(MenuNode & { depth: number })[]>([]);
const dialogOpen = ref(false);
const editing = ref<null | MenuNode>(null);
/** 递归将树扁平化为数组,按层级加 depth 字段用于 UI 缩进 */
function flatten(nodes: MenuNode[], depth: number, acc: (MenuNode & { depth: number })[] = []): (MenuNode & { depth: number })[] {
for (const n of nodes) {
acc.push({ ...n, depth });
if (n.children?.length) flatten(n.children, depth + 1, acc);
}
return acc;
}
const form = reactive({
parentId: 0,
name: '',
@ -42,10 +49,8 @@ async function load() {
loading.value = true;
try {
const data = await getMenuTree();
tree.value = data.tree ?? [];
// defaultExpandAll
await nextTick();
tableRef.value?.expandAll?.();
// td-table tree TDesign depth
flatList.value = flatten(data.tree ?? [], 0);
} finally {
loading.value = false;
}
@ -133,22 +138,18 @@ onMounted(load);
</t-button>
</div>
<t-enhanced-table
ref="tableRef"
<t-table
row-key="id"
:data="tree"
:data="flatList"
:columns="columns"
:loading="loading"
:pagination="false"
:tree="{
childrenKey: 'children',
treeNodeColumnIndex: 0,
defaultExpandAll: true,
indent: 20,
}"
>
<template #name="{ row }">
{{ row.name }}
<span :style="{ paddingLeft: `${row.depth * 20}px` }">
<span v-if="row.depth > 0" class="mr-1 text-gray-400"></span>
{{ row.name }}
</span>
</template>
<template #typeText="{ row }">{{ row.type === 1 ? '菜单' : '按钮' }}</template>
<template #op="{ row }">
@ -180,7 +181,7 @@ onMounted(load);
删除
</t-button>
</template>
</t-enhanced-table>
</t-table>
<t-dialog
v-model:visible="dialogOpen"