feat:职工福利PC端系统默认选择改为复选框组件;职代会PC端投票统计结果显示不正确问题修复;体育活动h5分工会报名权限提示;品牌活动h5联系人字段超长样式适配修复;

This commit is contained in:
2026-09-01 16:00:11 +08:00
parent a92f75730d
commit 982065c424
4 changed files with 100 additions and 13 deletions
@@ -109,15 +109,27 @@ layout("/layouts/platform.html"){
if (!value) return []
try {
const data = typeof value === "string" ? JSON.parse(value) : value
return Array.isArray(data) ? data : []
if (Array.isArray(data)) return data
if (data && typeof data === "object") {
return Object.keys(data).map(item => ({item, result: data[item]}))
}
return []
} catch (e) {
return []
}
},
voteOptionText(item) {
const value = item.result || item.vote || item.selected || item.option || item.value
if (Array.isArray(value)) return value.join("、")
if (value && typeof value === "object") {
return value.label || value.name || value.value || "-"
}
return value || "-"
},
voteResultText(value) {
return this.parseVoteResult(value).map(item => {
return (item.item || item.itemName || "投票项") + "" +
(item.selected || item.option || item.value || "-")
this.voteOptionText(item)
}).join("")
},
buildSummary(records) {
@@ -125,7 +137,7 @@ layout("/layouts/platform.html"){
records.forEach(record => {
this.parseVoteResult(record.voteResult).forEach(item => {
const itemName = item.item || item.itemName || "投票项"
const option = item.selected || item.option || item.value || "-"
const option = this.voteOptionText(item)
if (!counter[itemName]) counter[itemName] = {}
counter[itemName][option] = (counter[itemName][option] || 0) + 1
})
@@ -14,12 +14,11 @@ const welfareOption = {
<el-table-column align="center" header-align="center" label="系统默认选择" width="140">
<template slot-scope="{row}">
<el-radio
v-model="systemDefaultOption"
:label="row"
@change="setSystemDefault(row)">
<el-checkbox
:value="!!row.isSystemDefault"
@change="setSystemDefault(row, $event)">
&nbsp;
</el-radio>
</el-checkbox>
</template>
</el-table-column>
@@ -124,9 +123,10 @@ const welfareOption = {
},
// 每个福利项目只允许配置一个系统默认选项,保存时会随福利选项一并提交。
setSystemDefault(defaultOption) {
setSystemDefault(defaultOption, checked = true) {
this.systemDefaultOption = checked ? defaultOption : null;
this.welfareList.forEach((item) => {
this.$set(item, 'isSystemDefault', item === defaultOption);
this.$set(item, 'isSystemDefault', checked && item === defaultOption);
});
},
@@ -200,7 +200,7 @@ const welfareOption = {
transform: translate(-50%, -50%);
}
/deep/ .welfare-option .el-radio__label {
/deep/ .welfare-option .el-checkbox__label {
padding-left: 0;
}
@@ -397,6 +397,19 @@ layout("/layouts/platform_h5.html"){
justify-content: flex-end;
}
.sports-event-union-action-hint {
display: inline-flex;
align-items: center;
color: #ed6a0c;
font-size: 12px;
line-height: 18px;
text-align: right;
}
.sports-event-union-action-hint.is-authorized {
color: #1989fa;
}
.sports-event-page .table-card .table-card-footer .van-cell__value {
display: flex;
align-items: center;
@@ -700,6 +713,12 @@ layout("/layouts/platform_h5.html"){
取消报名
</van-button>
</div>
<span
v-if="row.applyWay.includes(2) && !row.applyWay.includes(1)"
class="sports-event-union-action-hint"
:class="{'is-authorized': canUnionApplyOnPc}">
{{ canUnionApplyOnPc ? '分工会报名请在PC端进行' : '该活动为分工会报名,暂无权限' }}
</span>
</div>
</div>
</div>
@@ -731,6 +750,12 @@ layout("/layouts/platform_h5.html"){
<i class="fa fa-trash"></i>取消报名
</van-button>
</div>
<span
v-if="row.applyWay.includes(2) && !row.applyWay.includes(1)"
class="sports-event-union-action-hint"
:class="{'is-authorized': canUnionApplyOnPc}">
{{ canUnionApplyOnPc ? '分工会报名请在PC端进行' : '该活动为分工会报名,暂无权限' }}
</span>
</div>
</div>
</div>
@@ -768,6 +793,16 @@ layout("/layouts/platform_h5.html"){
}
},
components: {},
computed: {
canUnionApplyOnPc() {
return this.$auth.hasRoleOr([
"SYSADMIN",
"SCHOOL_UNION_ADMIN",
"BRANCH_UNION_CHAIRMAN",
"BRANCH_UNION_WENTI_SPORTS"
]) && this.$auth.hasPermission("activity.apply")
}
},
methods: {
toggleViewMode() {
this.viewMode = this.viewMode === "card" ? "list" : "card"
@@ -324,11 +324,37 @@ layout("/layouts/platform_h5.html"){
}
.brand-course-card__detail:nth-child(-n + 2) .brand-course-card__detail-label,
.brand-course-card__detail:nth-child(-n + 2) .brand-course-card__detail-value {
.brand-course-card__detail:nth-child(2) .brand-course-card__detail-value {
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: normal;
white-space: nowrap;
}
.brand-course-card__detail:first-child .brand-course-card__detail-value {
display: block;
max-width: 100%;
overflow: hidden;
overflow-wrap: normal;
text-overflow: ellipsis;
white-space: nowrap;
}
.brand-course-contact-popover {
display: block;
min-width: 0;
max-width: 100%;
}
.brand-course-contact-popover__content {
max-width: 240px;
padding: 8px 12px;
overflow-wrap: anywhere;
color: #33445a;
font-size: 12px;
line-height: 18px;
}
.brand-course-card__links {
display: flex;
min-width: 0;
@@ -913,7 +939,17 @@ layout("/layouts/platform_h5.html"){
<van-icon name="friends-o"></van-icon>
<div class="brand-course-card__detail-copy">
<div class="brand-course-card__detail-label">联系人</div>
<div class="brand-course-card__detail-value">{{row.courseInstructor}}</div>
<van-popover
class="brand-course-contact-popover"
:value="contactPopoverIndex === index"
placement="top-start"
trigger="click"
@input="setContactPopover(index, $event)">
<div class="brand-course-contact-popover__content">{{row.courseInstructor || '暂无'}}</div>
<template #reference>
<div class="brand-course-card__detail-value">{{row.courseInstructor || '暂无'}}</div>
</template>
</van-popover>
</div>
</div>
<div class="brand-course-card__detail">
@@ -1009,6 +1045,7 @@ layout("/layouts/platform_h5.html"){
activeAssort: null,
filterOpened: false,
viewMode: 'card',
contactPopoverIndex: -1,
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
}
@@ -1017,6 +1054,9 @@ layout("/layouts/platform_h5.html"){
toggleViewMode() {
this.viewMode = this.viewMode === 'card' ? 'list' : 'card'
},
setContactPopover(index, visible) {
this.contactPopoverIndex = visible ? index : -1
},
onAssortChange(name) {
this.pageForm.assortTypes = name ? JSON.stringify([name]) : []
this.doSearch()