This commit is contained in:
Paidax
2025-04-05 14:58:07 +08:00
parent 7f48fd423c
commit 3603a1da77
3 changed files with 113 additions and 57 deletions
@@ -824,9 +824,9 @@ public class ActivityApplyController {
@At
@ViReturn
@RequiresPermissions("activity.apply")
public Object dshApplyUserList(
@Param(value = "activityId", required = false) String activityId,
@Param(value = "eventId", required = false) String eventId) {
public Object dshApplyUserList(@Param(value = "activityId", required = false) String activityId,
@Param(value = "eventId", required = false) String eventId,
@Param(value = "activityIsAudit", required = false) String activityIsAudit) {
Sql sql = Sqls.create("""
SELECT
asa.id,
@@ -840,9 +840,23 @@ public class ActivityApplyController {
FROM
`activity_school_apply` asa
LEFT JOIN sys_user us ON asa.applyUser = us.id
WHERE asa.activityId=@activityId and asa.eventId=@eventId and asa.activityUnionId=@activityUnionId
ORDER BY asa.applyUser
""").setParam("activityId", activityId).setParam("eventId", eventId).setParam("activityUnionId", getUnionId());
$condition
""");
// WHERE
// asa.activityId=@activityId and asa.eventId=@eventId and asa.activityUnionId=@activityUnionId
// ORDER BY asa.applyUser
// .setParam("activityId", activityId).setParam("eventId", eventId).setParam("activityUnionId", getUnionId());
Cnd cnd = Cnd.NEW();
cnd.and("asa.activityId", "=", activityId);
cnd.and("asa.eventId", "=", eventId);
cnd.and("asa.activityUnionId", "=", getUnionId());
if ("false".equals(activityIsAudit)) {
cnd.and("asa.status", "=", 1);
} else {
cnd.and("asa.status", "!=", 1);
}
cnd.asc("asa.applyUser");
sql.setCondition(cnd);
return activitySchoolApplyService.listMap(sql);
}
@@ -18,73 +18,64 @@ layout("/mobile/platform.html"){
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="活动列表" left-arrow placeholder fixed
@click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearList"
@change="getActivityData"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isActivity" :options="activityList"
@change="getActivityData"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.year" :options="yearList" @change="getActivityData"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isActivity" :options="activityList" @change="getActivityData"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''">
<div v-for="o in tableData" class="list-card"
@click="openInfo(o)">
<div v-for="o in tableData" class="list-card" @click="openInfo(o)">
<van-cell-group inset>
<van-cell :border="false" title="活动名称">
<span class="van-ellipsis" style="font-size: 16px"
:style="{color:themeColor}">{{o.NAME}}</span>
<span class="van-ellipsis" style="font-size: 16px" :style="{color:themeColor}">{{o.NAME}}</span>
</van-cell>
<van-cell :border="false" title="活动地址">{{o.address}}</van-cell>
<van-cell :border="false" title="报名开始时间">
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}}
</van-cell>
<van-cell :border="false" title="报名结束时间">
{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
<van-cell :border="false" title="报名时间">
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}}至{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</van-cell>
<!-- <van-cell :border="false" title="报名结束时间">{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}</van-cell>-->
<!-- <van-cell :border="false" title="活动时间">
<span style="font-size: 12px">
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
</span>
</van-cell>-->
<van-cell :border="false" title="活动状态">
<van-tag type="warning"
v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始
</van-tag>
<van-tag
type="primary"
v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
>
报名中
</van-tag>
<van-tag
type="success"
v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
>
进行中
</van-tag>
<van-tag type="danger"
v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束
</van-tag>
<div style="display: flex; justify-content: space-between">
<div>
<van-tag type="warning" v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始</van-tag>
<van-tag
type="primary"
v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
>
报名中
</van-tag>
<van-tag
type="success"
v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
>
进行中
</van-tag>
<van-tag type="danger" v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束</van-tag>
</div>
<van-button type="info" style="width: 90px" plain size="small" round @click="openInfo">查看详情</van-button>
</div>
</van-cell>
</van-cell-group>
</div>
</van-list>
</div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
description="暂无数据"></van-empty>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
<van-action-sheet v-model="show" title="活动通知">
<div v-html="activityInfo.eventNotification" style="padding-bottom: 30px"></div>
<div v-html="activityInfo.eventNotification" style="padding: 1px 15px 30px 15px"></div>
<van-button type="primary" block @click="openApply"
style="position: fixed; bottom: 0; ">进入报名
</van-button>
<van-button type="primary" block @click="openApply" style="position: fixed; bottom: 0">进入报名</van-button>
</van-action-sheet>
</div>
@@ -133,7 +124,6 @@ layout("/mobile/platform.html"){
openInfo(data) {
this.activityInfo = data
this.show = true
}
},
async created() {
@@ -142,6 +142,26 @@ layout("/layouts/platform.html"){
padding-top: 0;
}
.el-table .yellow-row {
background: rgba(255, 255, 0, 0.10);
}
.el-table .blue-row {
background: rgba(0, 0, 255, 0.10);
}
.el-table .green-row {
background: rgba(0, 128, 0, 0.10);
}
.el-table .red-row {
background: rgba(255, 0, 0, 0.10);
}
.el-table .purple-row {
background: rgba(128, 0, 128, 0.19);
}
</style>
<div class="platform" id="app" v-cloak>
@@ -748,6 +768,10 @@ layout("/layouts/platform.html"){
<template #public>
<vi-title2 title="批量审核">
<template #func>
<el-radio-group v-model="activityIsAudit" @change="openAuditApplyUser(null)" size="small" style="margin-right: 10px">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
<el-button
icon="el-icon-check"
type="primary"
@@ -781,6 +805,7 @@ layout("/layouts/platform.html"){
row-key="id"
:size="tableSize"
class="vi-table"
:row-class-name="tableRowClassName"
@selection-change="dshHandleSelectionChange"
>
<el-table-column
@@ -814,6 +839,13 @@ layout("/layouts/platform.html"){
label="性别"
>
</el-table-column>
<el-table-column
align="center"
header-align="center"
prop="applyUserName"
label="报名人"
>
</el-table-column>
<el-table-column align="center" header-align="center" prop="identity" label="身份">
<template scope="{row}">
<el-tag v-if="row.identity.includes('1')" effect="dark">运动员</el-tag>
@@ -832,13 +864,6 @@ layout("/layouts/platform.html"){
<el-tag v-if="row.identity.includes('7')">工作人员</el-tag>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
prop="applyUserName"
label="报名人"
>
</el-table-column>
<el-table-column
align="center"
header-align="center"
@@ -1165,6 +1190,8 @@ layout("/layouts/platform.html"){
</div>
<script>
// 颜色数组
const colors = ["yellow-row", "blue-row", "green-row", "red-row", "purple-row"];
//分组
const groupBy = (list, fn) => {
const groups = {}
@@ -1288,7 +1315,10 @@ layout("/layouts/platform.html"){
promiseBookFileList: [],
isPromiseBookFileView: true,
promiseBookDialogVisible: false
promiseBookDialogVisible: false,
// 活动审核相关
activityIsAudit: false
}
},
filters: {
@@ -1304,6 +1334,10 @@ layout("/layouts/platform.html"){
"delete_info": httpVueLoader("/components/activity/school/DeleteInfo.vue")
},
methods: {
tableRowClassName({ row }) {
debugger
return row.color;
},
doExport(){
window.open("/platform/activity/apply/doExport?activityId=" + this.activityData2.id)
},
@@ -1370,12 +1404,30 @@ layout("/layouts/platform.html"){
this.dshSelectionIds = val.map(v => v.id)
},
async openAuditApplyUser(data) {
this.eventData = data
if (data) {
this.eventData = data
}
const resp = await $.get("/platform/activity/apply/dshApplyUserList", {
activityId: data.activityId,
eventId: data.eventId
activityId: this.eventData.activityId,
eventId: this.eventData.eventId,
activityIsAudit: this.activityIsAudit
})
if (resp.code === 0) {
let colorIndex = 0; // 当前颜色索引
// 为每个item设置type和color
resp.data.forEach((item, index) => {
// 如果是第一个元素,或者当前applyUserName与前一个不同
if (index === 0 || item.applyUserName !== resp.data[index - 1].applyUserName) {
// 分配颜色
item.color = colors[colorIndex % colors.length];
colorIndex++;
} else {
// 如果当前applyUserName与前一个相同,使用相同的颜色
item.color = resp.data[index - 1].color;
}
});
this.dshApplyUserList = resp.data
this.$refs.guava.public()
}