feat: 同步地大更新

This commit is contained in:
2026-10-22 18:24:14 +08:00
parent 57d84724cb
commit 5d160f660f
6 changed files with 52 additions and 11 deletions
@@ -68,7 +68,8 @@ public class PersonApiConfigServiceImpl extends BaseServiceImpl<PersonApiConfig>
public Pagination pageData(PageForm pageForm, String configName, String sourceType, Boolean enabled) {
CndPlus cnd = CndPlus.create();
cnd.andEX("configName", "like", Strings.isBlank(configName) ? null : "%" + configName + "%");
cnd.andEX("sourceType", "=", Strings.isBlank(sourceType) ? null : sourceType);
// 兼容其他调用方传入空字符串,空来源类型表示不按来源筛选。
cnd.andEX("sourceType", "=", Strings.isBlank(sourceType) ? null : sourceType.trim());
cnd.andEX("enabled", "=", enabled);
// 历史保存可能将删除标记写为NULL;仅明确标记为true的配置不在列表展示。
cnd.and(Cnd.exps("delFlag", "=", false).or("delFlag", "is", null)).desc("updatedAt");
+1 -1
View File
@@ -4,7 +4,7 @@ server:
nutz:
profiles:
active: dev
active: prd
application:
name: '${framework.nutz.application.name}'
mvc:
@@ -12,7 +12,10 @@ $.ajaxSetup({
contentType: "application/x-www-form-urlencoded;charset=utf-8",
success: function (response, textStatus, jqXHR) {
if (response.code !== 0) {
this.$message.error(response.msg)
// AJAX全局回调没有Vue实例上下文,使用Element全局消息组件展示业务错误。
if (window.ELEMENT && ELEMENT.Message) {
ELEMENT.Message.error(response.msg)
}
} else {
return response
}
@@ -1,5 +1,5 @@
const user = {
template: /*language=Vue*/ `
template: /*language=HTML*/ `
<div class="user-wrapper">
<!-- 用户容器:左右布局 -->
<div class="user-container">
@@ -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">${@auth.getPrincipalProperty('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">${@auth.getPrincipalProperty('loginname')}</span>
</div>
</div>
@@ -27,11 +27,11 @@ const user = {
<span class="meta-label">单位信息</span>
<span class="meta-value">
<!--#if(!isEmpty(@auth.getPrincipalProperty('unit'))){#-->
` + "${@auth.getPrincipalProperty('unit').getName()}" + `
${@auth.getPrincipalProperty('unit').getName()}
<!--#}#-->
(
<!--#if(!isEmpty(@auth.getPrincipalProperty('union'))){#-->
` + "${@auth.getPrincipalProperty('union').getName()}" + `
${@auth.getPrincipalProperty('union').getName()}
<!--#}#-->
)
</span>
@@ -41,7 +41,7 @@ const user = {
<span class="meta-icon"><i class="fa fa-shield" aria-hidden="true"></i></span>
<div>
<span class="meta-label">角色</span>
<div class="portal-member-roles"><span v-for="(role, index) in roleTags" :key="index" class="portal-member-role">{{ role }}</span><span v-if="!roleTags.length" class="meta-value">—</span></div>
<div class="portal-member-roles" tabindex="0" role="region" aria-label="角色列表,可滚动查看全部角色"><span v-for="(role, index) in roleTags" :key="index" class="portal-member-role">{{ role }}</span><span v-if="!roleTags.length" class="meta-value">—</span></div>
</div>
</div>
</div>
@@ -318,7 +318,10 @@ const user = {
#v4-home-app .portal-member .meta-label { margin: 0; color: #8995a5; font-size: 12px; line-height: 20px; }
#v4-home-app .portal-member .meta-value { color: #283c54; font-size: 12px; font-weight: 400; line-height: 20px; overflow-wrap: anywhere; }
#v4-home-app .portal-member .meta-row-roles > div { display: block; }
#v4-home-app .portal-member-roles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
/* 角色最多占用三行标签的高度,超出时内部滚动,避免撑高首页横幅。 */
#v4-home-app .portal-member-roles { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; margin-top: 5px; max-height: 88px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #c5d9ee transparent; }
#v4-home-app .portal-member-roles::-webkit-scrollbar { width: 4px; }
#v4-home-app .portal-member-roles::-webkit-scrollbar-thumb { background: #c5d9ee; border-radius: 4px; }
#v4-home-app .portal-member-role { max-width: 100%; display: inline-block; padding: 3px 8px; border: 1px solid #e1ebf7; border-radius: 5px; background: #f3f7fc; color: #46617f; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
#v4-home-app .portal-member .weather-section { margin-top: auto; padding: 8px 10px; border-radius: 8px; background: #f0f7ff; color: #527494; }
#v4-home-app .portal-member .weather-header { gap: 6px; }
@@ -108,7 +108,15 @@
methods: {
pageData() {
this.$set(this, 'tableLoading', true)
return $.post(loc() + '/pageData', this.pageForm)
const params = {
pageNumber: this.pageForm.pageNumber,
pageSize: this.pageForm.pageSize,
}
// 未选择的查询条件不提交,避免空来源类型被后端拼成 sourceType=''。
if (this.pageForm.configName) params.configName = this.pageForm.configName
if (this.pageForm.sourceType) params.sourceType = this.pageForm.sourceType
if (this.pageForm.enabled !== '') params.enabled = this.pageForm.enabled
return $.post(loc() + '/pageData', params)
.then((res) => {
if (res.code === 0) {
this.$set(this, 'tableData', res.data.list)
@@ -511,11 +511,37 @@
this.$set(row, 'matchValue', '')
}
},
// 保存前递归检查两类规则树,避免无效规则进入后端后才返回校验异常。
validateRuleGroups(groups, ruleName) {
let message = ''
this.walkGroups(groups, (group) => {
if (message) return
;(group.conditions || []).some((condition) => {
if (!condition.mappedField) {
message = ruleName + '规则请选择映射字段'
return true
}
if (!condition.operator) {
message = ruleName + '规则请选择匹配方式'
return true
}
return false
})
})
return message
},
save() {
if (!this.form.configName || !this.form.apiConfigId) {
this.notifyWarning('请填写配置名称并选择API配置')
return
}
const ruleMessage =
this.validateRuleGroups(this.ruleGroups.UNION_MEMBER, '工会会员') ||
this.validateRuleGroups(this.ruleGroups.WELFARE_MEMBER, '福利会员')
if (ruleMessage) {
this.notifyWarning(ruleMessage)
return
}
this.$set(this, 'formLoading', true)
$.post(memberBase + '/save', {
data: JSON.stringify({