first commit

This commit is contained in:
2026-09-09 09:14:28 +08:00
commit 5343198112
5199 changed files with 1052895 additions and 0 deletions
@@ -0,0 +1,341 @@
<!--#
layout("/layouts/platform.html"){
#-->
<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">计划年份:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
type="year"
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>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工会名称:</div>
<div class="search-item-option">
<el-select v-model="pageForm.tissueId" placeholder="请选择工会" filterable clearable
style="width: 100%">
<el-option
v-for="item in unionList"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">项目名称:</div>
<div class="search-item-option">
<el-select v-model="pageForm.eventId" placeholder="请选择活动项目" filterable clearable
style="width: 100%">
<el-option
v-for="item in eventList"
:key="item.id"
:label="item.allName"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索</el-button>
<more v-model="searchMore"></more>
</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"
:sortable="column.sortable">
<template v-if="column.prop=='carryOut'" scope="{row}">
<span v-if="row.carryOut" class="text-success">已执行</span>
<span v-if="!row.carryOut" class="text-primary">未执行</span>
</template>
<template v-else-if="column.prop=='type'" scope="{row}">
<span v-if="row.type==40001">分工会活动计划</span>
<span v-if="row.type==40003">协会(社团)活动计划</span>
<span v-if="row.type==40003">校工会活动计划</span>
</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>
<!--# if(!@shiro.hasRole('A06')){ #-->
<el-dropdown-item :command="{type:'edit',row}">
编辑
</el-dropdown-item>
<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="operation">确 定</el-button>
</template>
<template #edit>
<vi-title title="填写计划信息"></vi-title>
<el-form :model="formData" ref="form" :rules="formRules" label-width="100px" label-position="left"
label-suffix="" style="padding: 0 2%">
<el-form-item prop="type" label="活动类型">
<el-radio-group v-model="formData.type">
<el-radio label="2" border>分工会活动计划</el-radio>
<el-radio label="3" border>协会(社团)活动计划</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="name" label="计划名称">
<el-input maxlength="50" placeholder="请填写计划名称" v-model="formData.name"
type="text"></el-input>
</el-form-item>
<el-form-item prop="time" label="计划时间">
<el-date-picker
v-model="formData.time"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%">
</el-date-picker>
</el-form-item>
<el-form-item prop="eventId" label="活动项目">
<el-select v-model="formData.eventId" placeholder="请选择活动项目" filterable clearable
style="width: 100%">
<el-option
v-for="item in eventList"
:key="item.id"
:label="item.allName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="content" label="计划内容" class="is-required">
<div id="content"></div>
</el-form-item>
</el-form>
</template>
<template #view>
<plan-info ref="info"></plan-info>
</template>
</guava>
</div>
<script>
let E = window.wangEditor
const editors = {}
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
let validContent = (rule, value, callback) => {
if (!this.formData.content || !dd3s.html2txt(this.formData.content)) {
callback(new Error('请填写计划内容'));
} else {
callback();
}
};
return {
unionList: [],
eventList: [],
flag: false,
formData: {
name: '',
time: '',
eventId: '',
content: ''
},
tableColumns: [
{prop: 'name', label: '计划名称'},
{prop: 'time', label: '计划预计时间'},
{prop: 'allName', label: '活动项目'},
{prop: 'type', label: '类型'},
{prop: 'carryOut', label: '计划状态'}
],
formRules: {
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
eventId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
content: [{validator: validContent, trigger: ['blur', 'change']}]
},
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'plan-info': httpVueLoader('/components/activity/school/planInfo.vue'),
},
methods: {
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)
}
},
openView(row) {
const {id} = row
this.$refs.info.getInfo(id)
this.$refs.guava.view()
},
async openEdit(row) {
this.flag = false
row.type = row.type + ''
this.formData = row
this.$refs.guava.edit()
this.$nextTick(() => {
this.initEditor()
})
},
async openAdd() {
this.formData = {}
this.flag = false
this.$refs.guava.edit()
this.$nextTick(() => {
this.initEditor()
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
this.formData = {
type: '2',
name: '',
time: '',
eventId: '',
content: ''
}
})
},
async operation() {
let url = this.formData.id ? "/doEdit" : "/doAdd"
this.$refs["form"].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(loc() + url, {
data: JSON.stringify(this.formData),
})
loading.close()
if (resp.code === 0) {
this.pageData()
this.$refs.guava.index()
} else {
this.notifyWarning(resp.msg)
}
} else {
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
}
});
},
doDelete(row) {
const {id} = row
this.$confirm('确定要删除该计划吗?', '提示', {type: 'warning'}).then(async () => {
const resp = await $.post(loc() + "/doDelete", {id: id});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
})
},
initEditor() {
let keys = ['content']
keys.forEach(key => {
$("#" + key).html("")
editors[key] = new E('#' + key)
editors[key].config.onchange = (html) => {
this.formData[key] = html
}
editors[key].create()
if (this.formData[key]) {
editors[key].txt.html(this.formData[key])
}
})
}
},
async created() {
this.pageData()
this.eventList = await activity.getEvents()
this.unionList = await getUnions(null);
}
})
</script>
<!--#
}
#-->