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() {