From 2d69633660710fe966f26338e4f4baf7599a0151 Mon Sep 17 00:00:00 2001 From: lxy <10179281+lxy0722@user.noreply.gitee.com> Date: Mon, 6 Jan 2025 20:06:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E9=97=AE=E9=A2=98=20=EF=BC=88cherry=20picked=20commit?= =?UTF-8?q?=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/stores/userInfo.ts | 3 ++- web/src/views/system/personal/index.vue | 2 +- web/src/views/system/user/crud.tsx | 13 +++++++------ web/src/views/system/user/index.vue | 11 +++++++++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/web/src/stores/userInfo.ts b/web/src/stores/userInfo.ts index 04d296ae..13dbf2ef 100644 --- a/web/src/stores/userInfo.ts +++ b/web/src/stores/userInfo.ts @@ -2,6 +2,7 @@ import { defineStore } from 'pinia'; import { UserInfosStates } from './interface'; import { Session } from '/@/utils/storage'; import { request } from '../utils/service'; +import { getBaseURL } from '../utils/baseUrl'; /** * 用户信息 * @methods setUserInfos 设置用户信息 @@ -72,7 +73,7 @@ export const useUserInfo = defineStore('userInfo', { method: 'get', }).then((res:any)=>{ this.userInfos.username = res.data.name; - this.userInfos.avatar = res.data.avatar; + this.userInfos.avatar = getBaseURL(res.data.avatar); this.userInfos.name = res.data.name; this.userInfos.email = res.data.email; this.userInfos.mobile = res.data.mobile; diff --git a/web/src/views/system/personal/index.vue b/web/src/views/system/personal/index.vue index 79f29d34..216ae770 100644 --- a/web/src/views/system/personal/index.vue +++ b/web/src/views/system/personal/index.vue @@ -32,7 +32,7 @@
角色:
- {{ item.name }} + {{ item.name }}
diff --git a/web/src/views/system/user/crud.tsx b/web/src/views/system/user/crud.tsx index dd24c406..4e8b41c9 100644 --- a/web/src/views/system/user/crud.tsx +++ b/web/src/views/system/user/crud.tsx @@ -257,10 +257,10 @@ export const createCrudOptions = function ({crudExpose}: CreateCrudOptionsProps) }), column: { minWidth: 200, //最小列宽 - formatter({value,row,index}){ - const values = row.role_info.map((item:any) => item.name); - return values.join(',') - } + // formatter({value,row,index}){ + // const values = row.role_info.map((item:any) => item.name); + // return values.join(',') + // } }, form: { rules: [ @@ -382,12 +382,13 @@ export const createCrudOptions = function ({crudExpose}: CreateCrudOptionsProps) }, avatar: { title: '头像', - type: 'avatar-cropper', + type: 'avatar-uploader', + align: 'center', form: { show: false, }, column: { - minWidth: 400, //最小列宽 + minWidth: 100, //最小列宽 }, }, ...commonCrudConfig({ diff --git a/web/src/views/system/user/index.vue b/web/src/views/system/user/index.vue index 71085d1b..117a5597 100644 --- a/web/src/views/system/user/index.vue +++ b/web/src/views/system/user/index.vue @@ -33,6 +33,15 @@ + @@ -50,6 +59,8 @@ import {ref, onMounted, watch, toRaw, h} from 'vue'; import XEUtils from 'xe-utils'; import {getElementLabelLine} from 'element-tree-line'; import importExcel from '/@/components/importExcel/index.vue' +import {getBaseURL} from '/@/utils/baseUrl'; + const ElementTreeLine = getElementLabelLine(h); -- Gitee From e8f5edd9c3404660ecd51a13506fda2e2f914ded Mon Sep 17 00:00:00 2001 From: lxy <10179281+lxy0722@user.noreply.gitee.com> Date: Mon, 6 Jan 2025 20:36:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/dept/components/DeptUserCom/crud.tsx | 12 ++++++------ .../system/dept/components/DeptUserCom/index.vue | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/web/src/views/system/dept/components/DeptUserCom/crud.tsx b/web/src/views/system/dept/components/DeptUserCom/crud.tsx index bcee5b09..bf2f9d6a 100644 --- a/web/src/views/system/dept/components/DeptUserCom/crud.tsx +++ b/web/src/views/system/dept/components/DeptUserCom/crud.tsx @@ -263,10 +263,10 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp }), column: { minWidth: 200, //最小列宽 - formatter({value,row,index}){ - const values = row.role_info.map((item:any) => item.name); - return values.join(',') - } + // formatter({value,row,index}){ + // const values = row.role_info.map((item:any) => item.name); + // return values.join(',') + // } }, form: { rules: [ @@ -385,12 +385,12 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp }, avatar: { title: '头像', - type: 'avatar-cropper', + type: 'avatar-uploader', form: { show: false, }, column:{ - width:150, + width:100, showOverflowTooltip: true, } }, diff --git a/web/src/views/system/dept/components/DeptUserCom/index.vue b/web/src/views/system/dept/components/DeptUserCom/index.vue index f52db556..689bb1a9 100644 --- a/web/src/views/system/dept/components/DeptUserCom/index.vue +++ b/web/src/views/system/dept/components/DeptUserCom/index.vue @@ -42,6 +42,15 @@ + @@ -69,6 +78,7 @@ import { ECharts, EChartsOption, init } from 'echarts'; import { getDeptInfoById, resetPwd } from './api'; import { warningNotification, successNotification } from '/@/utils/message'; import { HeadDeptInfoType } from '../../types'; +import {getBaseURL} from '/@/utils/baseUrl'; let deptCountChart: ECharts; let deptSexChart: ECharts; -- Gitee From 73edafb95fd00591942c3da78ad1d410a995b510 Mon Sep 17 00:00:00 2001 From: lxy <10179281+lxy0722@user.noreply.gitee.com> Date: Tue, 7 Jan 2025 10:29:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=B4=E5=83=8F=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/stores/userInfo.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/stores/userInfo.ts b/web/src/stores/userInfo.ts index 13dbf2ef..01aea201 100644 --- a/web/src/stores/userInfo.ts +++ b/web/src/stores/userInfo.ts @@ -3,6 +3,8 @@ import { UserInfosStates } from './interface'; import { Session } from '/@/utils/storage'; import { request } from '../utils/service'; import { getBaseURL } from '../utils/baseUrl'; +import headerImage from '/@/assets/img/headerImage.png'; + /** * 用户信息 * @methods setUserInfos 设置用户信息 @@ -73,7 +75,7 @@ export const useUserInfo = defineStore('userInfo', { method: 'get', }).then((res:any)=>{ this.userInfos.username = res.data.name; - this.userInfos.avatar = getBaseURL(res.data.avatar); + this.userInfos.avatar = (res.data.avatar && getBaseURL(res.data.avatar)) || headerImage; this.userInfos.name = res.data.name; this.userInfos.email = res.data.email; this.userInfos.mobile = res.data.mobile; -- Gitee