commit
This commit is contained in:
@@ -132,6 +132,16 @@ public class FamilyActivity extends BaseModel implements Serializable, SysHomeCo
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String onlyKey;
|
||||
|
||||
@Column
|
||||
@Comment("主办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> hostUnitIds;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> undertakeUnitIds;
|
||||
|
||||
@Override
|
||||
public Sys_home_activity covertToSysHomeActivity() {
|
||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||
|
||||
@@ -114,6 +114,16 @@ public class FellowshipActivity extends BaseModel implements Serializable, SysHo
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String trainType;
|
||||
|
||||
@Column
|
||||
@Comment("主办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> hostUnitIds;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> undertakeUnitIds;
|
||||
|
||||
@Override
|
||||
public Sys_home_activity covertToSysHomeActivity() {
|
||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||
|
||||
+243
@@ -0,0 +1,243 @@
|
||||
package com.budwk.app.zhgh.activity.statistics;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_unit;
|
||||
import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
|
||||
import com.budwk.app.zhgh.activity.family.models.FamilyActivity;
|
||||
import com.budwk.app.zhgh.activity.fellowship.models.FellowshipActivity;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpActivity;
|
||||
import com.budwk.app.zhgh.activity.workscollection.models.Activity_works_collection;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/10/30 14:32
|
||||
* @description 系统活动统计
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/statistics")
|
||||
public class ActivityStatisticsController {
|
||||
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/zhgh/activity/statistics/index.html")
|
||||
@SaCheckPermission("activity.statistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.statistics")
|
||||
@ApiOperation("每个活动统计图")
|
||||
public Result getChartData(Integer year, String undertakeUnitId, String hostUnitId) {
|
||||
List<NutMap> activityTypeList = this.getData(year, undertakeUnitId, hostUnitId);
|
||||
return Result.success(activityTypeList);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("activity.statistics")
|
||||
@ApiOperation("导出全部的活动")
|
||||
public void doExport(Integer year, String undertakeUnitId, String hostUnitId, HttpServletResponse response) {
|
||||
List<NutMap> activityTypeList = this.getData(year, undertakeUnitId, hostUnitId);
|
||||
|
||||
|
||||
List<Sys_unit> unitList = dao.query(Sys_unit.class, Cnd.NEW());
|
||||
List<SysClub> clubList = dao.query(SysClub.class, Cnd.NEW());
|
||||
|
||||
clubList.forEach(club -> {
|
||||
Sys_unit unit = new Sys_unit();
|
||||
unit.setId(club.getId());
|
||||
unit.setName(club.getClubName());
|
||||
unitList.add(unit);
|
||||
});
|
||||
|
||||
|
||||
List<NutMap> activityList = new ArrayList<>();
|
||||
for (NutMap nutMap : activityTypeList) {
|
||||
List<NutMap> asList = nutMap.getAsList("activityList", NutMap.class);
|
||||
|
||||
if (nutMap.getString("activityType").equals("sports")) {
|
||||
if (Lang.isNotEmpty(asList)) {
|
||||
for (NutMap map : asList) {
|
||||
map.setv("activityName", map.getString("name"));
|
||||
map.setv("activityTypeName", nutMap.getString("activityTypeName"));
|
||||
List<String> hostUnitIds = map.getAsList("unitSponsor", String.class);
|
||||
List<String> undertakeUnitIds = map.getAsList("undertakeUnit", String.class);
|
||||
String hostUnitNames = getUnitNames(hostUnitIds, unitList);
|
||||
String undertakeUnitNames = getUnitNames(undertakeUnitIds, unitList);
|
||||
map.setv("hostUnitNames", hostUnitNames);
|
||||
map.setv("undertakeUnitNames", undertakeUnitNames);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (Lang.isNotEmpty(asList)) {
|
||||
for (NutMap map : asList) {
|
||||
map.setv("activityTypeName", nutMap.getString("activityTypeName"));
|
||||
List<String> hostUnitIds = map.getAsList("hostUnitIds", String.class);
|
||||
List<String> undertakeUnitIds = map.getAsList("undertakeUnitIds", String.class);
|
||||
if (Lang.isNotEmpty(hostUnitIds)) {
|
||||
String hostUnitNames = getUnitNames(hostUnitIds, unitList);
|
||||
map.setv("hostUnitNames", hostUnitNames);
|
||||
}
|
||||
if (Lang.isNotEmpty(undertakeUnitIds)) {
|
||||
String undertakeUnitNames = getUnitNames(undertakeUnitIds, unitList);
|
||||
map.setv("undertakeUnitNames", undertakeUnitNames);
|
||||
}
|
||||
|
||||
if (nutMap.getString("activityType").equals("culture")) {
|
||||
map.setv("activityName", map.getString("name"));
|
||||
} else if (nutMap.getString("activityType").equals("trainSignUp")) {
|
||||
map.setv("startTime", DateUtil.format(map.getTime("activityStartTime"), "yyyy-MM-dd"));
|
||||
map.setv("endTime", DateUtil.format(map.getTime("activityEndTime"), "yyyy-MM-dd"));
|
||||
}else if (nutMap.getString("activityType").equals("worksCollection")){
|
||||
map.setv("activityName", map.getString("name"));
|
||||
map.setv("startTime", DateUtil.format(map.getTime("startDateTime"), "yyyy-MM-dd"));
|
||||
map.setv("endTime", DateUtil.format(map.getTime("endDateTime"), "yyyy-MM-dd"));
|
||||
}else if (nutMap.getString("activityType").equals("family")){
|
||||
map.setv("startTime", DateUtil.format(map.getTime("activityStartTime"), "yyyy-MM-dd"));
|
||||
map.setv("endTime", DateUtil.format(map.getTime("activityEndTime"), "yyyy-MM-dd"));
|
||||
}else if (nutMap.getString("activityType").equals("fellowship")){
|
||||
map.setv("startTime", DateUtil.format(map.getTime("activityStartTime"), "yyyy-MM-dd"));
|
||||
map.setv("endTime", DateUtil.format(map.getTime("activityEndTime"), "yyyy-MM-dd"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Lang.isNotEmpty(asList)) {
|
||||
activityList.addAll(asList);
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
entityList.add(no);
|
||||
entityList.add(new ExcelExportEntity("活动类型", "activityTypeName", 20));
|
||||
entityList.add(new ExcelExportEntity("活动名称", "activityName", 40));
|
||||
entityList.add(new ExcelExportEntity("活动开始时间", "startTime", 40));
|
||||
entityList.add(new ExcelExportEntity("活动结束时间", "endTime", 40));
|
||||
entityList.add(new ExcelExportEntity("主办单位", "hostUnitNames", 40));
|
||||
entityList.add(new ExcelExportEntity("承办单位", "undertakeUnitNames", 40));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, activityList);
|
||||
CommonDownloadUtil.download("活动汇总.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<NutMap> getData(Integer year, String undertakeUnitId, String hostUnitId) {
|
||||
List<NutMap> activityTypeList = new ArrayList<>();
|
||||
activityTypeList.add(NutMap.NEW().setv("activityType", "sports").setv("activityTypeName", "体育活动"));
|
||||
activityTypeList.add(NutMap.NEW().setv("activityType", "culture").setv("activityTypeName", "文化活动"));
|
||||
activityTypeList.add(NutMap.NEW().setv("activityType", "trainSignUp").setv("activityTypeName", "品牌活动"));
|
||||
activityTypeList.add(NutMap.NEW().setv("activityType", "worksCollection").setv("activityTypeName", "作品征集"));
|
||||
activityTypeList.add(NutMap.NEW().setv("activityType", "family").setv("activityTypeName", "亲子活动"));
|
||||
activityTypeList.add(NutMap.NEW().setv("activityType", "fellowship").setv("activityTypeName", "单身联谊"));
|
||||
|
||||
for (NutMap map : activityTypeList) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (map.getString("activityType").equals("sports")) {
|
||||
cnd.andEX("YEAR(startTime)", "=", year);
|
||||
if (StrUtil.isNotBlank(undertakeUnitId)) {
|
||||
cnd.and(new Static("JSON_CONTAINS(undertakeUnit, JSON_ARRAY('%s'))".formatted(undertakeUnitId)));
|
||||
}
|
||||
if (StrUtil.isNotBlank(hostUnitId)) {
|
||||
cnd.and(new Static("JSON_CONTAINS(unitSponsor, JSON_ARRAY('%s'))".formatted(hostUnitId)));
|
||||
}
|
||||
cnd.asc("startTime");
|
||||
List<ActivitySchool> activityList = dao.query(ActivitySchool.class, cnd);
|
||||
map.setv("count", activityList.size());
|
||||
map.setv("activityList", activityList);
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(undertakeUnitId)) {
|
||||
cnd.and(new Static("JSON_CONTAINS(undertakeUnitIds, JSON_ARRAY('%s'))".formatted(undertakeUnitId)));
|
||||
}
|
||||
if (StrUtil.isNotBlank(hostUnitId)) {
|
||||
cnd.and(new Static("JSON_CONTAINS(hostUnitIds, JSON_ARRAY('%s'))".formatted(hostUnitId)));
|
||||
}
|
||||
if (map.getString("activityType").equals("culture")) {
|
||||
cnd.andEX("YEAR(startTime)", "=", year);
|
||||
cnd.asc("startTime");
|
||||
List<ActivityTissue> activityList = dao.query(ActivityTissue.class, cnd);
|
||||
map.setv("count", activityList.size());
|
||||
map.setv("activityList", activityList);
|
||||
|
||||
} else if (map.getString("activityType").equals("trainSignUp")) {
|
||||
cnd.andEX("year", "=", year);
|
||||
cnd.asc("activitySignUpStartTime");
|
||||
List<TrainSignUpActivity> activityList = dao.query(TrainSignUpActivity.class, cnd);
|
||||
map.setv("count", activityList.size());
|
||||
map.setv("activityList", activityList);
|
||||
|
||||
} else if (map.getString("activityType").equals("worksCollection")) {
|
||||
cnd.andEX("YEAR(startDateTime)", "=", year);
|
||||
cnd.asc("startDateTime");
|
||||
List<Activity_works_collection> activityList = dao.query(Activity_works_collection.class, cnd);
|
||||
map.setv("count", activityList.size());
|
||||
map.setv("activityList", activityList);
|
||||
|
||||
} else if (map.getString("activityType").equals("family")) {
|
||||
cnd.andEX("year", "=", year);
|
||||
cnd.asc("activitySignUpStartTime");
|
||||
List<FamilyActivity> activityList = dao.query(FamilyActivity.class, cnd);
|
||||
map.setv("count", activityList.size());
|
||||
map.setv("activityList", activityList);
|
||||
|
||||
} else if (map.getString("activityType").equals("fellowship")) {
|
||||
cnd.andEX("year", "=", year);
|
||||
cnd.asc("activitySignUpStartTime");
|
||||
List<FellowshipActivity> activityList = dao.query(FellowshipActivity.class, cnd);
|
||||
map.setv("count", activityList.size());
|
||||
map.setv("activityList", activityList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return activityTypeList;
|
||||
}
|
||||
|
||||
|
||||
private String getUnitNames(List<String> unitIds, List<Sys_unit> units) {
|
||||
String unitNames = units.stream()
|
||||
.filter(unit -> unitIds.contains(unit.getId())) // 筛选 id 为 '111' 或 '222' 的对象
|
||||
.map(unit -> unit.getName()) // 获取 name 属性
|
||||
.collect(Collectors.joining(",")); // 用逗号连接,你可以根据需要更改分隔符
|
||||
return unitNames;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -100,6 +100,16 @@ public class TrainSignUpActivity extends BaseModel implements Serializable, SysH
|
||||
@ColDefine(type = ColType.VARCHAR, width = 40)
|
||||
private String activityGroupName;
|
||||
|
||||
@Column
|
||||
@Comment("主办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> hostUnitIds;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> undertakeUnitIds;
|
||||
|
||||
/**
|
||||
* 所有的培训班
|
||||
*/
|
||||
|
||||
+10
@@ -107,6 +107,16 @@ public class Activity_works_collection extends BaseModel {
|
||||
@Default(value = "1")
|
||||
private Boolean isSubmit;
|
||||
|
||||
@Column
|
||||
@Comment("主办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> hostUnitIds;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> undertakeUnitIds;
|
||||
|
||||
@Many(field = "activityId")
|
||||
private List<Activity_works_subjectType> subjectTypes;
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="undertakeUnitIds" label="承办单位">
|
||||
<el-select v-model="formData.undertakeUnitIds" clearable filterable multiple
|
||||
placeholder="请选择主办单位"
|
||||
placeholder="请选择承办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
|
||||
@@ -16,16 +16,20 @@ const basicForm = {
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.useHistory">
|
||||
<el-form-item label="往期活动" prop="historicalAct">
|
||||
<el-select v-model="formData.historicalAct" placeholder="请选择往期活动" style="width: 100%" @change="historicalActChange">
|
||||
<el-option v-for="item in historicalActList" :key="item.id" :label="item.activityName" :value="item.id"></el-option>
|
||||
<el-select v-model="formData.historicalAct" placeholder="请选择往期活动"
|
||||
style="width: 100%" @change="historicalActChange">
|
||||
<el-option v-for="item in historicalActList" :key="item.id"
|
||||
:label="item.activityName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请输入活动名称', trigger: 'blur'}" label="活动名称" prop="activityName">
|
||||
<el-input maxlength="50" v-model="formData.activityName" placeholder="请输入活动名称"></el-input>
|
||||
<el-form-item :rules="{required:true,message: '请输入活动名称', trigger: 'blur'}"
|
||||
label="活动名称" prop="activityName">
|
||||
<el-input maxlength="50" v-model="formData.activityName"
|
||||
placeholder="请输入活动名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -39,7 +43,8 @@ const basicForm = {
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请选择活动时间', trigger: 'blur'}" label="活动时间" prop="activityTime">
|
||||
<el-form-item :rules="{required:true,message: '请选择活动时间', trigger: 'blur'}"
|
||||
label="活动时间" prop="activityTime">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
end-placeholder="请选择活动结束日期"
|
||||
@@ -53,7 +58,8 @@ const basicForm = {
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请选择报名时间', trigger: 'blur'}" label="报名时间" prop="activitySignTime">
|
||||
<el-form-item :rules="{required:true,message: '请选择报名时间', trigger: 'blur'}"
|
||||
label="报名时间" prop="activitySignTime">
|
||||
<el-date-picker
|
||||
:disabled="false"
|
||||
end-placeholder="请选择报名结束日期"
|
||||
@@ -67,7 +73,7 @@ const basicForm = {
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面向对象" prop="joinCnd">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
@@ -89,23 +95,58 @@ const basicForm = {
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click="$refs.drawerUserScope.userScopeDialog = true" type="primary">设置</el-button>
|
||||
<el-button @click="$refs.drawerUserScope.userScopeDialog = true" type="primary">
|
||||
设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动类型" prop="trainType" :rules="{required:true,message: '请选择活动类型', trigger: 'blur'}">
|
||||
<el-select @change="typeChange" filterable placeholder="请选择活动类型" style="width: 100%" v-model="formData.trainType">
|
||||
<el-option :label="item.name" :value="item.code" :key="item.code" v-for="item in dict.type.FELLOWSHIP_TYPE"></el-option>
|
||||
<el-form-item label="活动类型" prop="trainType"
|
||||
:rules="{required:true,message: '请选择活动类型', trigger: 'blur'}">
|
||||
<el-select @change="typeChange" filterable placeholder="请选择活动类型"
|
||||
style="width: 100%" v-model="formData.trainType">
|
||||
<el-option :label="item.name" :value="item.code" :key="item.code"
|
||||
v-for="item in dict.type.FELLOWSHIP_TYPE"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="hostUnitIds" label="主办单位">
|
||||
<el-select v-model="formData.hostUnitIds" clearable filterable multiple
|
||||
placeholder="请选择主办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="undertakeUnitIds" label="承办单位">
|
||||
<el-select v-model="formData.undertakeUnitIds" clearable filterable multiple
|
||||
placeholder="请选择承办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍" prop="introduce">
|
||||
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍"
|
||||
prop="introduce">
|
||||
<text-editor v-model="formData.introduce"></text-editor>
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图片" prop="cover" :rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
|
||||
<el-form-item label="封面图片" prop="cover"
|
||||
:rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
|
||||
<el-col :span="12">
|
||||
<file-upload
|
||||
:upload_number="1"
|
||||
@@ -131,7 +172,8 @@ const basicForm = {
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-show="step === 2">
|
||||
<div class="left-span-label" style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div class="left-span-label"
|
||||
style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div>{{trainType + '信息(温馨提示:如不需要人数限制,下方人数框填写0或者不填)'}}</div>
|
||||
<div>
|
||||
<el-button @click="addCourse" size="mini" type="primary">添加{{ trainType }}</el-button>
|
||||
@@ -158,14 +200,17 @@ const basicForm = {
|
||||
|
||||
<el-table-column :label="trainType + '名称'" prop="courseName">
|
||||
<template v-slot="{row}">
|
||||
<el-input size="small" v-model="row.courseName" :placeholder="'请输入' + trainType + '名称'"></el-input>
|
||||
<el-input size="small" v-model="row.courseName"
|
||||
:placeholder="'请输入' + trainType + '名称'"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="类型" prop="courseType" sortable>
|
||||
<template v-slot="{row}">
|
||||
<el-select size="small" v-model="row.courseType" @change="(val) => {courseTypeChange(val, row)}">
|
||||
<el-option :label="c.typeName" :value="c.id" :key="c.id" v-for="c in courseTypeList"></el-option>
|
||||
<el-select size="small" v-model="row.courseType"
|
||||
@change="(val) => {courseTypeChange(val, row)}">
|
||||
<el-option :label="c.typeName" :value="c.id" :key="c.id"
|
||||
v-for="c in courseTypeList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -206,20 +251,23 @@ const basicForm = {
|
||||
<el-table-column label="校区" prop="campus">
|
||||
<template v-slot="{row}">
|
||||
<el-select size="small" v-model="row.campus" style="width: 100%">
|
||||
<el-option :label="item.name" :value="item.name" :key="item.code" v-for="item in dict.type.USER_CAMPUS"></el-option>
|
||||
<el-option :label="item.name" :value="item.name" :key="item.code"
|
||||
v-for="item in dict.type.USER_CAMPUS"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '地点'" prop="courseLocation">
|
||||
<template v-slot="{row}">
|
||||
<el-input size="small" v-model="row.courseLocation" :placeholder="'请输入' + trainType + '地点'"></el-input>
|
||||
<el-input size="small" v-model="row.courseLocation"
|
||||
:placeholder="'请输入' + trainType + '地点'"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '负责人'" prop="courseInstructor">
|
||||
<template v-slot="{row}">
|
||||
<el-input size="small" v-model="row.courseInstructor" :placeholder="'请输入' + trainType + '负责人'"></el-input>
|
||||
<el-input size="small" v-model="row.courseInstructor"
|
||||
:placeholder="'请输入' + trainType + '负责人'"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -231,14 +279,19 @@ const basicForm = {
|
||||
|
||||
<el-table-column :label="trainType + '时间'">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="openSetUpCourseTime(scope.$index)" type="text">设置{{ trainType }}时间</el-button>
|
||||
<el-button @click="openSetUpCourseTime(scope.$index)" type="text">设置{{ trainType
|
||||
}}时间
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="openMoreInfo(scope, scope.$index)" size="mini" type="primary">自定义设置</el-button>
|
||||
<el-button @click="removeTableCourse(scope.$index)" size="mini" type="danger">删除</el-button>
|
||||
<el-button @click="openMoreInfo(scope, scope.$index)" size="mini" type="primary">
|
||||
自定义设置
|
||||
</el-button>
|
||||
<el-button @click="removeTableCourse(scope.$index)" size="mini" type="danger">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -250,16 +303,20 @@ const basicForm = {
|
||||
<el-radio border :label="3">按活动限制</el-radio>
|
||||
</el-radio-group>
|
||||
<div calss="limit_div">
|
||||
<div v-if="formData.restrictLimit === 1" style="color: #c64120; font-size: 12px">注:无限制指对报名的个数不做任何限制</div>
|
||||
<div v-if="formData.restrictLimit === 1" style="color: #c64120; font-size: 12px">
|
||||
注:无限制指对报名的个数不做任何限制
|
||||
</div>
|
||||
<div v-if="formData.restrictLimit === 2" style="color: #c64120; font-size: 12px">
|
||||
<div>
|
||||
<el-button @click="setSignUpCondition" size="mini" type="primary">设置报名限制</el-button>
|
||||
<el-button @click="setSignUpCondition" size="mini" type="primary">设置报名限制
|
||||
</el-button>
|
||||
<span style="color: #c64120; font-size: 12px">注:按类型限制指对每个类型下的个数进行限制</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="formData.restrictLimit === 3">
|
||||
<div>
|
||||
<el-input-number v-model="formData.limitNum" :min="1" :max="100" size="mini" label="限制报名个数"></el-input-number>
|
||||
<el-input-number v-model="formData.limitNum" :min="1" :max="100" size="mini"
|
||||
label="限制报名个数"></el-input-number>
|
||||
<span style="color: #c64120; font-size: 12px">注:按活动限制指只能报{{formData.limitNum}}个,不与类型关联</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -292,12 +349,12 @@ const basicForm = {
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.activityGroupId">
|
||||
</drawer-user-scope>
|
||||
|
||||
|
||||
<course-time ref="courseTimeRef"></course-time>
|
||||
<custom-form ref="customFormRef"></custom-form>
|
||||
</div>
|
||||
@@ -331,6 +388,9 @@ const basicForm = {
|
||||
},
|
||||
campusList: [],
|
||||
courseTypeList: [],
|
||||
|
||||
unitOptions: [],
|
||||
clubOptions: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -537,6 +597,8 @@ const basicForm = {
|
||||
}
|
||||
cloneData.typeLimits = JSON.stringify(this.formData.typeLimits)
|
||||
cloneData.courseList = JSON.stringify(cloneData.courseList)
|
||||
cloneData.undertakeUnitIds = JSON.stringify(cloneData.undertakeUnitIds)
|
||||
cloneData.hostUnitIds = JSON.stringify(cloneData.hostUnitIds)
|
||||
const confirm = await this.$confirm("您确定要" + type + "吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@@ -566,11 +628,22 @@ const basicForm = {
|
||||
}
|
||||
}
|
||||
},
|
||||
async getClubsByRole() {
|
||||
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
|
||||
return resp.data
|
||||
},
|
||||
async initData(row) {
|
||||
this.activityGroupList = await this.getActivityGroup()
|
||||
this.historicalActList = await this.getHistoricalActList()
|
||||
this.courseTypeList = await this.getAllType()
|
||||
await this.init(row)
|
||||
|
||||
this.clubOptions = await this.getClubsByRole()
|
||||
this.clubOptions.map((v) => {
|
||||
v.name = v.clubName
|
||||
})
|
||||
const units = await this.$businessTool.listUnit()
|
||||
this.unitOptions = this.clubOptions.concat(units)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="getChartData">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="请选择年度"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="主办单位">
|
||||
<el-select v-model="pageForm.hostUnitId" clearable filterable
|
||||
placeholder="请选择主办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="承办单位">
|
||||
<el-select v-model="pageForm.undertakeUnitId" clearable filterable
|
||||
placeholder="请选择承办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool label="活动统计">
|
||||
<el-button @click="doExport" icon="el-icon-download" size="small" type="primary">
|
||||
导出活动
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<div id="activityChart" style="width: 100%; height: 400px;"></div>
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
undertakeUnitId: '',
|
||||
hostUnitId: '',
|
||||
year: new Date().getFullYear() + "",
|
||||
},
|
||||
activityChart: null,
|
||||
activityCount: [
|
||||
{
|
||||
activityType: '家具家电',
|
||||
count: 38,
|
||||
},
|
||||
{
|
||||
activityType: '粮油副食',
|
||||
count: 52,
|
||||
},
|
||||
{
|
||||
activityType: '生鲜水果',
|
||||
count: 61,
|
||||
},
|
||||
],
|
||||
|
||||
unitOptions: [],
|
||||
clubOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
window.open("/platform/activity/statistics/doExport?year=" + this.pageForm.year +
|
||||
"&undertakeUnitId=" + this.pageForm.undertakeUnitId +
|
||||
"&hostUnitId=" + this.pageForm.hostUnitId)
|
||||
|
||||
},
|
||||
getChartData() {
|
||||
this.$axios.post("/platform/activity/statistics/getChartData", {
|
||||
year: this.pageForm.year,
|
||||
undertakeUnitId: this.pageForm.undertakeUnitId,
|
||||
hostUnitId: this.pageForm.hostUnitId
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.activityCount = resp.data;
|
||||
this.initChart()
|
||||
}
|
||||
})
|
||||
},
|
||||
initChart() {
|
||||
if (this.activityChart) {
|
||||
this.activityChart.destroy();
|
||||
}
|
||||
|
||||
this.activityChart = new G2Plot.Column('activityChart', {
|
||||
data: this.activityCount,
|
||||
xField: 'activityTypeName',
|
||||
yField: 'count',
|
||||
label: {
|
||||
position: 'middle',
|
||||
style: {
|
||||
fill: '#FFFFFF',
|
||||
opacity: 0.6,
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
label: {
|
||||
autoHide: true,
|
||||
autoRotate: false,
|
||||
},
|
||||
},
|
||||
meta: {
|
||||
activityTypeName: {alias: '活动类型'},
|
||||
count: {alias: '数量'},
|
||||
},
|
||||
color: '#5B8FF9',
|
||||
});
|
||||
this.activityChart.render();
|
||||
},
|
||||
async getClubsByRole() {
|
||||
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
|
||||
return resp.data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.clubOptions = await this.getClubsByRole()
|
||||
this.clubOptions.map((v) => {
|
||||
v.name = v.clubName
|
||||
})
|
||||
const units = await this.$businessTool.listUnit()
|
||||
this.unitOptions = this.clubOptions.concat(units)
|
||||
this.getChartData()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -67,7 +67,7 @@ const basicForm = {
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-row :gutter="20" >
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面向对象" prop="joinCnd">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
@@ -101,6 +101,34 @@ const basicForm = {
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="hostUnitIds" label="主办单位">
|
||||
<el-select v-model="formData.hostUnitIds" clearable filterable multiple
|
||||
placeholder="请选择主办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="undertakeUnitIds" label="承办单位">
|
||||
<el-select v-model="formData.undertakeUnitIds" clearable filterable multiple
|
||||
placeholder="请选择承办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍" prop="introduce">
|
||||
<text-editor v-model="formData.introduce"></text-editor>
|
||||
@@ -331,6 +359,9 @@ const basicForm = {
|
||||
},
|
||||
campusList: [],
|
||||
courseTypeList: [],
|
||||
|
||||
unitOptions: [],
|
||||
clubOptions: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -537,6 +568,8 @@ const basicForm = {
|
||||
}
|
||||
cloneData.typeLimits = JSON.stringify(this.formData.typeLimits)
|
||||
cloneData.courseList = JSON.stringify(cloneData.courseList)
|
||||
cloneData.undertakeUnitIds = JSON.stringify(cloneData.undertakeUnitIds)
|
||||
cloneData.hostUnitIds = JSON.stringify(cloneData.hostUnitIds)
|
||||
const confirm = await this.$confirm("您确定要" + type + "吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@@ -566,11 +599,22 @@ const basicForm = {
|
||||
}
|
||||
}
|
||||
},
|
||||
async getClubsByRole() {
|
||||
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
|
||||
return resp.data
|
||||
},
|
||||
async initData(row) {
|
||||
this.activityGroupList = await this.getActivityGroup()
|
||||
this.historicalActList = await this.getHistoricalActList()
|
||||
this.courseTypeList = await this.getAllType()
|
||||
await this.init(row)
|
||||
|
||||
this.clubOptions = await this.getClubsByRole()
|
||||
this.clubOptions.map((v) => {
|
||||
v.name = v.clubName
|
||||
})
|
||||
const units = await this.$businessTool.listUnit()
|
||||
this.unitOptions = this.clubOptions.concat(units)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -170,6 +170,37 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="hostUnitIds" label="主办单位">
|
||||
<el-select v-model="formData.hostUnitIds" clearable filterable multiple
|
||||
placeholder="请选择主办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="undertakeUnitIds" label="承办单位">
|
||||
<el-select v-model="formData.undertakeUnitIds" clearable filterable multiple
|
||||
placeholder="请选择承办单位"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="活动内容" prop="content">
|
||||
<text-editor v-model="formData.content"></text-editor>
|
||||
</el-form-item>
|
||||
@@ -328,7 +359,10 @@ layout("/layouts/platform.html"){
|
||||
colorList: ["#081776", "#31cab1", "#e54242", "#ff8939", "#ffb712", "#1dc47b", "#4495f7", "#ff5e8b", "#5d6e7f"],
|
||||
pageForm: {
|
||||
activityTime: []
|
||||
}
|
||||
},
|
||||
|
||||
unitOptions: [],
|
||||
clubOptions: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -499,12 +533,22 @@ layout("/layouts/platform.html"){
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async getClubsByRole() {
|
||||
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
|
||||
return resp.data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityGroupList = await this.getActivityGroup()
|
||||
this.pageData()
|
||||
|
||||
this.clubOptions = await this.getClubsByRole()
|
||||
this.clubOptions.map((v) => {
|
||||
v.name = v.clubName
|
||||
})
|
||||
const units = await this.$businessTool.listUnit()
|
||||
this.unitOptions = this.clubOptions.concat(units)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user