人员管理

This commit is contained in:
2026-10-30 14:02:26 +08:00
parent fad8a37dfb
commit 7dacfd7e5a
21 changed files with 110 additions and 50 deletions
@@ -120,6 +120,18 @@ layout("/layouts/v4/baseLayout.html"){
<link rel="stylesheet" href="${base!}/assets/platform/css/home-portal.css?v=20261028-2" />
<!-- 登录资料仅在 HTML 属性中输出并转义;放在 Vue 挂载区域外,避免名称被当作模板表达式解析。 -->
<div id="v4-home-profile-data" hidden
data-username="${@auth.getPrincipalProperty('username'),escape}"
data-loginname="${@auth.getPrincipalProperty('loginname'),escape}"
<!--#if(!isEmpty(@auth.getPrincipalProperty('unit'))){#-->
data-unit-name="${@auth.getPrincipalProperty('unit').getName(),escape}"
<!--#}#-->
<!--#if(!isEmpty(@auth.getPrincipalProperty('union'))){#-->
data-union-name="${@auth.getPrincipalProperty('union').getName(),escape}"
<!--#}#-->
></div>
<div class="v4-container home-portal" id="v4-home-app">
<!-- 首页banner -->
<div class="portal-top">
@@ -140,7 +152,7 @@ layout("/layouts/v4/baseLayout.html"){
</div>
</div>
</div>
<user class="portal-member" :profile-only="true"></user>
<user class="portal-member" :profile-only="true" :profile="memberProfile"></user>
</div>
<div class="portal-content">
@@ -181,7 +193,15 @@ layout("/layouts/v4/baseLayout.html"){
new Vue({
el: '#v4-home-app',
data(){
// 浏览器读取属性时还原 HTML 转义;未配置单位或工会时使用空字符串,不访问空对象。
const profileData = document.getElementById('v4-home-profile-data').dataset
return{
memberProfile: {
username: profileData.username || '',
loginname: profileData.loginname || '',
unitName: profileData.unitName || '',
unionName: profileData.unionName || ''
},
websiteNews: [],
activityBrowse: {enabled: false, label: '活动加载中'}
}
@@ -9,7 +9,7 @@ const user = {
<div class="user-details">
<div class="portal-member-heading">
<span class="portal-member-avatar"><i class="fa fa-user" aria-hidden="true"></i></span>
<div><div class="portal-member-welcome">欢迎回来</div><div class="user-name">${@auth.getPrincipalProperty('username')}</div></div>
<div><div class="portal-member-welcome">欢迎回来</div><div class="user-name">{{ profile.username }}</div></div>
</div>
<div class="user-meta-grid">
@@ -17,7 +17,7 @@ const user = {
<span class="meta-icon"><i class="fa fa-id-card-o" aria-hidden="true"></i></span>
<div>
<span class="meta-label">工号</span>
<span class="meta-value">${@auth.getPrincipalProperty('loginname')}</span>
<span class="meta-value">{{ profile.loginname }}</span>
</div>
</div>
@@ -26,14 +26,7 @@ const user = {
<div>
<span class="meta-label">单位信息</span>
<span class="meta-value">
<!--#if(!isEmpty(@auth.getPrincipalProperty('unit'))){#-->
${@auth.getPrincipalProperty('unit').getName()}
<!--#}#-->
(
<!--#if(!isEmpty(@auth.getPrincipalProperty('union'))){#-->
${@auth.getPrincipalProperty('union').getName()}
<!--#}#-->
)
{{ profile.unitName }} ({{ profile.unionName }})
</span>
</div>
</div>
@@ -108,7 +101,12 @@ const user = {
mixins: [initTableMixins],
// 同一组件分别承载会员卡和待办卡,各自只加载需要的数据。
props: {
profileOnly: { type: Boolean, default: false }
profileOnly: { type: Boolean, default: false },
// 首页传入显示资料:username 姓名、loginname 工号、unitName 单位、unionName 工会;缺项显示空文本。
profile: {
type: Object,
default: () => ({username: '', loginname: '', unitName: '', unionName: ''})
}
},
data() {
return {