first commit

This commit is contained in:
2026-09-20 15:46:34 +08:00
parent 72fb5eae10
commit e558339dcc
3340 changed files with 671310 additions and 251 deletions
@@ -0,0 +1,350 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年&emsp;&emsp;度</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
type="year"
value-format="yyyy" style="width: 100%"
placeholder="选择年">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动名称</div>
<div class="search-item-option">
<!--<el-input v-model="pageForm.name" placeholder="请输入活动名称" clearable></el-input>-->
<el-select v-model="pageForm.activityId" placeholder="请选择活动名称" filterable clearable
style="width: 100%">
<el-option
v-for="item in activities"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动级别</div>
<div class="search-item-option">
<!-- <el-select v-model="pageForm.gameStyle" placeholder="请选择活动类型" filterable clearable
style="width: 100%">
<el-option
v-for="(k,v) in activity.school.gameStyle"
:key="v"
:label="k"
:value="v">
</el-option>
</el-select>-->
<el-select v-model="pageForm.activityLevel" placeholder="请选择活动级别"
clearable
style="width: 100%">
<el-option
v-for="item in activityTypeList"
:key="item.code"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
<div class="search-item" style="width: 80vw">
<div class="search-item-label">一键查询</div>
<div class="search-item-option">
<el-radio-group v-model="pageForm.query" @change="doSearch">
<el-radio-button v-for="it in queryOptions" :label="it.key" :key="it.key">
{{it.value}}
</el-radio-button>
</el-radio-group>
</div>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="活动列表" :app="this">
<template #func>
<el-button type="primary" icon="el-icon-edit-outline" size="small"
@click="openAdd">
创建活动
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
show-overflow-tooltip
:sortable="column.sortable">
<template v-if="column.prop=='events'" scope="{row}">
<span>{{row.allName}}</span>
</template>
<template v-else-if="column.prop=='gameStyle'" scope="{row}">
<span>{{activity.school.gameStyle[row.gameStyle]}}</span>
</template>
<template v-else-if="column.prop=='foundUnit'" scope="{row}">
<span v-if="row.activityLevel===40001">校工会</span>
<span v-if="row.activityLevel===40002">{{row.unionname}}</span>
<span v-if="row.activityLevel===40003">{{row.clubName}}</span>
</template>
<template v-else-if="column.prop=='startTime'" scope="{row}">
{{moment(row.startTime).format('YYYY-MM-DD')}} -
{{moment(row.endTime).format('YYYY-MM-DD')}}
</template>
<template v-else-if="column.prop=='state'"
scope="{row:{close,applyStartTime,applyEndTime,startTime,endTime,isSave}}">
<div v-html="activity.school.getStatus(close,applyStartTime,applyEndTime,startTime,endTime,isSave)"></div>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="150px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini" :loading="row.loading">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',row}">
查看
</el-dropdown-item>
<!-- <el-dropdown-item :command="{type:'export',row}">
导出名单docx
</el-dropdown-item>-->
<el-dropdown-item :command="{type:'exportXlsx',row}">
导出名单
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',row}">
编辑
</el-dropdown-item>
<!--#if(@shiro.hasRole('sysadmin')){#-->
<el-dropdown-item :command="{type:'delete',row}">
删除
</el-dropdown-item>
<!--#}#-->
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" @click="doSave">保 存</el-button>
<el-button type="primary" @click="doOperate">提 交</el-button>
</template>
<template #edit>
<add-activity :form="formData" ref="activity" @flip="flip" @flush="flush" :is_club="is_club"
:is_union="is_union" :is_sysadmin="is_sysadmin" :is_a06="is_A06"></add-activity>
</template>
<template #view>
<info ref="info"></info>
</template>
</guava>
</div>
<script>
let E = window.wangEditor
const editors = {}
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
is_club: false,
is_union: false,
is_sysadmin: false,
is_A06: false,
activities: [],
unitOptions: [],
activityTypeList: [],
planList: [],
typeList: [],
types: [],
events: [],
submitDisabled: false,
formData: {
activityGroupId: null,
personType: 1,
activityLevel: 1,
gameStyle: 1,
applyWay: [2],
awardsMode: [],
combinationMethod: []
},
tableColumns: [
{prop: 'name', label: '活动名称'},
{prop: 'activityCode', label: '活动编号', sortable: true},
{prop: 'address', label: '活动地点'},
{prop: 'foundUnit', label: '创建单位', sortable: true},
{prop: 'activityLevelName', label: '活动级别', sortable: true},
{prop: 'startTime', label: '活动日期', sortable: true},
{prop: 'state', label: '活动状态', sortable: true},
{prop: 'applyNum', label: '已报名人数', sortable: true},
{prop: 'foundDate', label: '创建时间', sortable: true},
],
pageForm: {
query: 'zero'
},
queryOptions: [
{key: 'zero', value: '全部'},
{key: 'one', value: '正在报名'},
{key: 'two', value: '报名结束'},
{key: 'three', value: '活动进行中'},
{key: 'four', value: '活动已结束'},
],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'info': httpVueLoader('/components/activity/school/Info.vue?v=' + new Date().getTime()),
'add-activity': httpVueLoader('/components/activity/school/AddActivity.vue?v=' + new Date().getTime())
},
methods: {
flip() {
this.pageData()
this.$refs.guava.index()
},
flush() {
this.pageData()
},
dropdownCommand(command) {
const {type, row} = command
if (type === 'view') {
this.openView(row)
} else if (type === 'edit') {
this.openEdit(row)
} else if (type === 'delete') {
this.doDelete(row)
} else if (type === 'export') {
window.open("/platform/activity/common/export?id=" + row.id)
} else if (type === 'exportXlsx') {
location.href = "/platform/activity/common/exportXlsx?id=" + row.id
}
},
openView(row) {
const {id} = row
this.$refs.info.getInfo(id)
this.$refs.guava.view()
},
async openAdd() {
this.$refs.activity.openAdd()
this.$refs.guava.edit()
},
async openEdit(row) {
const {id, applyStartTime, isSave} = row
this.formData.id = id
const now = moment().valueOf()
/* if (!isSave && now > moment(applyStartTime).valueOf()) {
/!* this.$confirm('该活动已开始报名,现在编辑将会删除所有已报名的记录!是否确认编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.$refs.activity.openEdit(row)
this.$refs.guava.edit()
}).catch(() => {
});*!/
this.$refs.activity.openEdit(row)
this.$refs.guava.edit()
} else {
this.$refs.activity.openEdit(row, true)
this.$refs.guava.edit()
}*/
this.$refs.activity.openEdit(row, true)
this.$refs.guava.edit()
},
doDelete(row) {
const {id} = row
this.$confirm('确定要删除该活动吗?', '提示', {type: 'warning'}).then(async () => {
this.$set(row, "loading", true)
const resp = await $.post(loc() + "/doDelete", {id});
requestLaterMsgFun(vue, resp, async () => {
this.pageData()
}, () => {
}, () => {
this.$set(row, "loading", false)
})
}
);
},
async getActivitys() {
const {data} = await $.get("/platform/activity/remind/getActivitys")
return data;
},
async getActivityTypeList(code) {
const {data} = await $.get("/platform/activity/basic/basic/settings/getActivityTwoLevelType", {code: code})
return data;
},
async doOperate() {
await this.$refs.activity.operate()
},
async doSave() {
this.$refs.activity.doSave()
}
},
async created() {
if ("${@shiro.hasRole('H02')}" === "true") {
this.is_club = true
}
if ("${@shiro.hasRole('H04')}" === "true") {
this.is_union = true
}
if ("${@shiro.hasRole('sysadmin')}" === "true") {
this.is_sysadmin = true
}
if ("${@shiro.hasRole('A06')}" === "true") {
this.is_A06 = true
}
this.pageData()
this.activities = await this.getActivitys()
this.unitOptions = await getUnits(null)
this.activityTypeList = await this.getActivityTypeList("40000")
}
})
</script>
<!--#
}
#-->