From 84f2c86492f9e5448250d14805456a687a79fbbe Mon Sep 17 00:00:00 2001 From: zhanglei Date: Fri, 27 Mar 2026 13:27:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/vue/api.ts.j2 | 2 +- templates/vue/index.vue.j2 | 31 +- .../apps/web-antd/mock/Health_device.ts | 86 ++- .../apps/web-antd/src/api/device.ts | 69 -- .../src/router/routes/modules/device.ts | 31 - .../apps/web-antd/src/views/device/data.ts | 352 --------- .../apps/web-antd/src/views/device/form.ts | 384 ---------- .../apps/web-antd/src/views/device/index.vue | 684 ------------------ 8 files changed, 81 insertions(+), 1558 deletions(-) delete mode 100644 vue-vben-admin/apps/web-antd/src/api/device.ts delete mode 100644 vue-vben-admin/apps/web-antd/src/router/routes/modules/device.ts delete mode 100644 vue-vben-admin/apps/web-antd/src/views/device/data.ts delete mode 100644 vue-vben-admin/apps/web-antd/src/views/device/form.ts delete mode 100644 vue-vben-admin/apps/web-antd/src/views/device/index.vue diff --git a/templates/vue/api.ts.j2 b/templates/vue/api.ts.j2 index b1fd6ec..9df1d2a 100644 --- a/templates/vue/api.ts.j2 +++ b/templates/vue/api.ts.j2 @@ -62,7 +62,7 @@ export namespace {{entity}}Api { * 上传图片 */ export function upload(params: any) { - return requestClient.post(applicationConfig.javaURL+'/file/upImg', params, + return requestClient.post(applicationConfig.javaURL+'/file/up', params, { headers: {'Content-Type': 'multipart/form-data', Token: useAccessStore().accessToken, version: '1.0.1'}}); } diff --git a/templates/vue/index.vue.j2 b/templates/vue/index.vue.j2 index 2b1ce43..328c3dd 100644 --- a/templates/vue/index.vue.j2 +++ b/templates/vue/index.vue.j2 @@ -140,10 +140,14 @@ function getFullUrl(url: string) { const gridOptions = { columns: [ ...columns.map(col => { + const baseCol = { + ...col, + fixed: col.fixed ?? null, + }; // ✅ 如果是图片字段 (包含 img, face, picture),使用图片渲染 + 上传按钮 if (isImageField(col.field)) { return { - ...col, + ...baseCol, width: 200, align: 'center', slots: { @@ -174,7 +178,7 @@ const gridOptions = { } }; } - return col; + return baseCol; }), { field: 'action', @@ -184,6 +188,10 @@ const gridOptions = { slots: {default: 'action'}, }, ], + customConfig: { + storage: true, // 已有功能:列显示/隐藏缓存 + allowFixed: true, // 🔥 开启“冻结列”功能(关键) + }, proxyConfig: { ajax: { query: async ({page}) => { @@ -564,6 +572,12 @@ function handleReset() { queryFormApi.resetForm(); gridApi.reload(); } + +// ========== 列设置 ========== +function openColumnSetting() { + const $grid = gridApi?.grid || gridApi?.getVxeGrid?.(); + $grid?.openCustom(); +} @@ -593,8 +607,17 @@ function handleReset() {