Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1ac3db4bf | ||
|
|
6c6caa2558 | ||
|
|
35877f4b5c | ||
|
|
001d456513 | ||
|
|
65f340e3b0 | ||
|
|
29260423d5 |
@@ -6,6 +6,8 @@ import com.budwk.app.base.exception.BaseException;
|
|||||||
import com.budwk.app.sys.models.Sys_file;
|
import com.budwk.app.sys.models.Sys_file;
|
||||||
import com.budwk.app.sys.models.Sys_office_template;
|
import com.budwk.app.sys.models.Sys_office_template;
|
||||||
import com.budwk.app.sys.utils.SysFileMinIoUtil;
|
import com.budwk.app.sys.utils.SysFileMinIoUtil;
|
||||||
|
import com.deepoove.poi.XWPFTemplate;
|
||||||
|
import com.deepoove.poi.config.Configure;
|
||||||
import com.deepoove.poi.data.ByteArrayPictureRenderData;
|
import com.deepoove.poi.data.ByteArrayPictureRenderData;
|
||||||
import com.deepoove.poi.data.PictureRenderData;
|
import com.deepoove.poi.data.PictureRenderData;
|
||||||
import com.deepoove.poi.data.PictureType;
|
import com.deepoove.poi.data.PictureType;
|
||||||
@@ -18,6 +20,12 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
|||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -66,6 +74,88 @@ public class SysOfficeTemplateUtil {
|
|||||||
return new ByteArrayInputStream(fileBytes);
|
return new ByteArrayInputStream(fileBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一渲染 DOC/DOCX 模板,保留调用方的循环表格等策略;模板输入流由调用方关闭。
|
||||||
|
*/
|
||||||
|
public byte[] renderTemplate(InputStream input, Object data, Configure config, boolean pdf, String context) throws Exception {
|
||||||
|
if (input == null) throw new BaseException("模板文件不存在");
|
||||||
|
byte[] templateBytes = input.readAllBytes();
|
||||||
|
try (ByteArrayInputStream formatInput = new ByteArrayInputStream(templateBytes)) {
|
||||||
|
if (com.aspose.words.FileFormatUtil.detectFileFormat(formatInput).getLoadFormat() != com.aspose.words.LoadFormat.DOCX) {
|
||||||
|
try (ByteArrayInputStream source = new ByteArrayInputStream(templateBytes);
|
||||||
|
ByteArrayOutputStream converted = new ByteArrayOutputStream()) {
|
||||||
|
new com.aspose.words.Document(source).save(converted, com.aspose.words.SaveFormat.DOCX);
|
||||||
|
templateBytes = converted.toByteArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
byte[] wordBytes;
|
||||||
|
try (ByteArrayInputStream templateInput = new ByteArrayInputStream(templateBytes);
|
||||||
|
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||||
|
XWPFTemplate template = XWPFTemplate.compile(templateInput, config == null ? Configure.builder().build() : config)) {
|
||||||
|
template.render(data).write(output);
|
||||||
|
wordBytes = output.toByteArray();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("[Office模板渲染] Word模板渲染失败,context={}", context, e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
log.info("[Office模板渲染] Word渲染完成,context={}, templateBytes={}, outputBytes={}", context, templateBytes.length, wordBytes.length);
|
||||||
|
if (!pdf) return wordBytes;
|
||||||
|
try (ByteArrayInputStream wordInput = new ByteArrayInputStream(wordBytes);
|
||||||
|
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
|
||||||
|
com.aspose.words.Document document = new com.aspose.words.Document(wordInput);
|
||||||
|
configureDocumentFonts(document, context);
|
||||||
|
com.aspose.words.PdfSaveOptions options = new com.aspose.words.PdfSaveOptions();
|
||||||
|
options.setFontEmbeddingMode(com.aspose.words.PdfFontEmbeddingMode.EMBED_ALL);
|
||||||
|
document.save(output, options);
|
||||||
|
log.info("[Office模板渲染] PDF转换完成,context={}, outputBytes={}", context, output.size());
|
||||||
|
return output.toByteArray();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("[Office模板渲染] PDF转换失败,context={}", context, e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void configureDocumentFonts(com.aspose.words.Document document, String context) throws Exception {
|
||||||
|
com.aspose.words.FontSettings settings = new com.aspose.words.FontSettings();
|
||||||
|
List<com.aspose.words.FontSourceBase> sources = new ArrayList<>(List.of(settings.getFontsSources()));
|
||||||
|
Set<String> folders = new LinkedHashSet<>();
|
||||||
|
String windowsDir = System.getenv("WINDIR");
|
||||||
|
if (StrUtil.isNotBlank(windowsDir)) folders.add(new File(windowsDir, "Fonts").getPath());
|
||||||
|
String localAppData = System.getenv("LOCALAPPDATA");
|
||||||
|
if (StrUtil.isNotBlank(localAppData)) folders.add(new File(localAppData, "Microsoft/Windows/Fonts").getPath());
|
||||||
|
folders.add(new File(System.getProperty("user.dir"), "fonts").getPath());
|
||||||
|
for (String folder : folders) {
|
||||||
|
File directory = new File(folder);
|
||||||
|
log.info("[Office模板渲染] 字体目录,context={}, path={}, readable={}", context, folder, directory.isDirectory() && directory.canRead());
|
||||||
|
if (directory.isDirectory() && directory.canRead()) sources.add(new com.aspose.words.FolderFontSource(folder, true));
|
||||||
|
}
|
||||||
|
settings.setFontsSources(sources.toArray(new com.aspose.words.FontSourceBase[0]));
|
||||||
|
Set<String> availableFonts = new LinkedHashSet<>();
|
||||||
|
for (com.aspose.words.FontSourceBase source : sources) {
|
||||||
|
for (com.aspose.words.PhysicalFontInfo font : source.getAvailableFonts()) availableFonts.add(font.getFontFamilyName());
|
||||||
|
}
|
||||||
|
String chineseFont = null;
|
||||||
|
for (String candidate : List.of("SimSun", "宋体", "Microsoft YaHei", "微软雅黑", "DengXian", "等线", "SimHei", "黑体", "FangSong", "仿宋", "Noto Serif CJK SC", "Noto Sans CJK SC")) {
|
||||||
|
if (availableFonts.contains(candidate)) {
|
||||||
|
chineseFont = candidate;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("[Office模板渲染] 中文字体选择,context={}, fontCount={}, chineseFont={}", context, availableFonts.size(), chineseFont);
|
||||||
|
if (chineseFont != null) {
|
||||||
|
settings.getSubstitutionSettings().getDefaultFontSubstitution().setDefaultFontName(chineseFont);
|
||||||
|
for (String name : List.of("宋体", "SimSun", "新宋体", "NSimSun", "黑体", "SimHei", "仿宋", "FangSong", "楷体", "KaiTi", "微软雅黑", "Microsoft YaHei")) {
|
||||||
|
if (!availableFonts.contains(name)) settings.getSubstitutionSettings().getTableSubstitution().setSubstitutes(name, chineseFont);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("[Office模板渲染] 未发现常用中文字体,context={}, availableFonts={}", context, availableFonts);
|
||||||
|
}
|
||||||
|
settings.getFallbackSettings().loadMsOfficeFallbackSettings();
|
||||||
|
document.setFontSettings(settings);
|
||||||
|
document.setWarningCallback(warning -> log.warn("[Office模板渲染] 字体或排版警告,context={}, type={}, detail={}", context, warning.getWarningType(), warning.getDescription()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签字url转换为poi的图片对象
|
* 签字url转换为poi的图片对象
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,27 +1,80 @@
|
|||||||
package com.budwk.app.flow.listenter;
|
package com.budwk.app.flow.listenter;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.budwk.app.flow.constant.FlowConst;
|
||||||
import com.budwk.app.flow.engine.event.ProcessEvent;
|
import com.budwk.app.flow.engine.event.ProcessEvent;
|
||||||
import com.budwk.app.flow.engine.event.ProcessEventListener;
|
import com.budwk.app.flow.engine.event.ProcessEventListener;
|
||||||
|
import com.budwk.app.flow.entity.ProcessInstance;
|
||||||
import com.budwk.app.flow.entity.ProcessTask;
|
import com.budwk.app.flow.entity.ProcessTask;
|
||||||
|
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||||
import com.budwk.app.flow.enums.ProcessEventTypeEnum;
|
import com.budwk.app.flow.enums.ProcessEventTypeEnum;
|
||||||
import com.budwk.app.flow.service.FlowTaskMessageService;
|
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
|
||||||
|
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.json.Json;
|
||||||
|
import org.nutz.lang.util.NutMap;
|
||||||
|
|
||||||
/** 普通节点、首次会签及转办任务统一从开始事件进入待办消息 service。 */
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程任务开始监听器
|
||||||
|
*/
|
||||||
@IocBean
|
@IocBean
|
||||||
|
@Slf4j
|
||||||
public class ProcessTaskStartEventListener implements ProcessEventListener {
|
public class ProcessTaskStartEventListener implements ProcessEventListener {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Dao dao;
|
private Dao dao;
|
||||||
@Inject
|
@Inject
|
||||||
private FlowTaskMessageService flowTaskMessageService;
|
private GlobalMessageSendService globalMessageSendService;
|
||||||
|
@Inject
|
||||||
|
private DifficultHelpCommonService difficultHelpCommonService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(ProcessEvent event) {
|
public void onEvent(ProcessEvent event) {
|
||||||
if (event.getEventType() == ProcessEventTypeEnum.PROCESS_TASK_START) {
|
if (event.getEventType() == ProcessEventTypeEnum.PROCESS_TASK_START) {
|
||||||
ProcessTask task = dao.fetch(ProcessTask.class, event.getSourceId());
|
Long sourceId = event.getSourceId();
|
||||||
flowTaskMessageService.notifyTask(task, false);
|
ProcessTask task = dao.fetch(ProcessTask.class, sourceId);
|
||||||
|
if (task == null) return;
|
||||||
|
sendMessage(task);
|
||||||
|
// 节点及接收人判断集中在业务 service;通知失败不向流程提交接口抛出异常。
|
||||||
|
try {
|
||||||
|
difficultHelpCommonService.notifyOfficeApproval(task);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("困难帮扶企业微信待办通知异常,taskId={}", sourceId, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void sendMessage(ProcessTask task) {
|
||||||
|
// 说明是流程开始 用户首次完成任务
|
||||||
|
if (task.getTaskParentId() == 0 && task.getTaskName().equals("startTask")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 节点名称
|
||||||
|
String taskDisplayName = task.getDisplayName();
|
||||||
|
// 实例名称
|
||||||
|
Long instanceId = task.getProcessInstanceId();
|
||||||
|
ProcessInstance instance = dao.fetch(ProcessInstance.class, instanceId);
|
||||||
|
String instanceName = Json.fromJson(NutMap.class, instance.getVariable()).getString(FlowConst.PROCESS_INSTANCE_NAME);
|
||||||
|
|
||||||
|
// 任务接收人
|
||||||
|
List<ProcessTaskActor> taskActors = dao.query(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
|
||||||
|
|
||||||
|
for (ProcessTaskActor taskActor : taskActors) {
|
||||||
|
// 模拟发送消息
|
||||||
|
String message = StrUtil.format("您有一条待办任务,实例:{},处理环节:{}", taskActor.getActorName(), instanceName, taskDisplayName);
|
||||||
|
log.info(message);
|
||||||
|
globalMessageSendService.sendMessage(taskDisplayName, message, 2, List.of(taskActor.getActorId()), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
package com.budwk.app.flow.service;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.json.JSONObject;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.budwk.app.flow.constant.FlowConst;
|
|
||||||
import com.budwk.app.flow.entity.ProcessDefine;
|
|
||||||
import com.budwk.app.flow.entity.ProcessInstance;
|
|
||||||
import com.budwk.app.flow.entity.ProcessTask;
|
|
||||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
|
||||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
|
||||||
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
|
||||||
import org.nutz.dao.Cnd;
|
|
||||||
import org.nutz.dao.Dao;
|
|
||||||
import org.nutz.ioc.aop.Aop;
|
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/** WF 待办统一消息入口;站内消息、短信和企业微信沿用全局消息渠道。 */
|
|
||||||
@IocBean
|
|
||||||
@Slf4j
|
|
||||||
public class FlowTaskMessageService {
|
|
||||||
private static final String HOME = "/platform/home";
|
|
||||||
private static final Set<String> TASK_PARAMS = Set.of("taskId", "bizId", "taskKey", "tab");
|
|
||||||
@Inject
|
|
||||||
private Dao dao;
|
|
||||||
@Inject
|
|
||||||
private GlobalMessageSendService globalMessageSendService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* task 为参与人已落库的 WF 任务;includeStartTask 仅驳回重建时传 true,
|
|
||||||
* 使退回申请人的 startTask 也收到通知,首次提交的申请节点不通知本人。
|
|
||||||
* 无返回值:仅通知进行中的任务,异常记录 taskId,不中断业务审核。
|
|
||||||
* config 的 wfTaskId 标识流程通知,wfLoginNames 为办理人的 loginname,
|
|
||||||
* wxWorkLink 为卡片地址;微信策略据此切换到官方企业微信接口。
|
|
||||||
*/
|
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
public void notifyTask(ProcessTask task, boolean includeStartTask) {
|
|
||||||
if (task == null || task.getId() == null || task.getProcessInstanceId() == null
|
|
||||||
|| !ProcessTaskStateEnum.DOING.getCode().equals(task.getTaskState())) return;
|
|
||||||
if (!includeStartTask && "startTask".equals(task.getTaskName())
|
|
||||||
&& (task.getTaskParentId() == null || task.getTaskParentId() == 0L)) return;
|
|
||||||
try {
|
|
||||||
ProcessInstance instance = dao.fetch(ProcessInstance.class, task.getProcessInstanceId());
|
|
||||||
if (instance == null) {
|
|
||||||
log.warn("WF 待办通知跳过:实例不存在,taskId={}", task.getId());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ProcessDefine define = instance.getProcessDefineId() == null ? null
|
|
||||||
: dao.fetch(ProcessDefine.class, instance.getProcessDefineId());
|
|
||||||
List<ProcessTaskActor> actors = dao.query(ProcessTaskActor.class,
|
|
||||||
Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
|
|
||||||
List<String> receiverIds = actors.stream().map(ProcessTaskActor::getActorId)
|
|
||||||
.filter(StrUtil::isNotBlank).distinct().toList();
|
|
||||||
if (receiverIds.isEmpty()) {
|
|
||||||
log.warn("WF 待办通知跳过:任务没有实际办理人,taskId={}", task.getId());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 只用实际参与人的账号,不按角色扩大范围,不以内部用户 ID 代替企业微信 userid。
|
|
||||||
List<String> loginNames = actors.stream().filter(actor -> StrUtil.isNotBlank(actor.getActorId()))
|
|
||||||
.map(ProcessTaskActor::getActorAccount).filter(StrUtil::isNotBlank)
|
|
||||||
.map(String::trim).distinct().toList();
|
|
||||||
if (actors.stream().anyMatch(actor -> StrUtil.isBlank(actor.getActorAccount()))) {
|
|
||||||
log.warn("WF 待办存在未绑定 loginname 的办理人,taskId={}", task.getId());
|
|
||||||
}
|
|
||||||
String instanceName = define == null ? "流程审批" : StrUtil.blankToDefault(define.getDisplayName(), "流程审批");
|
|
||||||
if (StrUtil.isNotBlank(instance.getVariable())) {
|
|
||||||
try {
|
|
||||||
instanceName = StrUtil.blankToDefault(JSONUtil.parseObj(instance.getVariable())
|
|
||||||
.getStr(FlowConst.PROCESS_INSTANCE_NAME), instanceName);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("WF 实例名称解析失败,使用流程定义名称,taskId={}", task.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String nodeName = StrUtil.blankToDefault(task.getDisplayName(), "待办审核");
|
|
||||||
String content = "您有一条待办任务,实例:" + instanceName + ",处理环节:" + nodeName;
|
|
||||||
JSONObject config = JSONUtil.createObj().set("wfTaskId", task.getId())
|
|
||||||
.set("wfLoginNames", loginNames).set("wxWorkLink", buildLink(task, instance, define));
|
|
||||||
// 系统发送身份兼容定时推进等没有当前登录会话的流程入口。
|
|
||||||
globalMessageSendService.sendSystemMessage(nodeName, content, 2, receiverIds, config);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("WF 待办通知异常,taskId={}", task.getId(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 优先节点手机表单;缺失或非法时回首页。保留原查询参数和锚点,替换过期任务参数。 */
|
|
||||||
private String buildLink(ProcessTask task, ProcessInstance instance, ProcessDefine define) {
|
|
||||||
String form = task.getH5FormKey();
|
|
||||||
// KNBF 历史定义中的办公室地址过时,沿用已经验证的实际审核入口。
|
|
||||||
if (define != null && "KNBF".equals(define.getName())
|
|
||||||
&& "36ebafda-44c2-4bd3-bd7f-10839a575a0d".equals(task.getTaskName())) {
|
|
||||||
form = "/platform/difficultHelp/branchUnionApproval/h5";
|
|
||||||
}
|
|
||||||
if (StrUtil.isBlank(form) || "null".equalsIgnoreCase(form.trim())
|
|
||||||
|| StrUtil.isBlank(instance.getBusinessNo()) || StrUtil.isBlank(task.getTaskName())) return HOME;
|
|
||||||
try {
|
|
||||||
form = form.trim();
|
|
||||||
URI uri = URI.create(form);
|
|
||||||
if (uri.getUserInfo() != null || (uri.isAbsolute()
|
|
||||||
? !("https".equalsIgnoreCase(uri.getScheme()) || "http".equalsIgnoreCase(uri.getScheme()))
|
|
||||||
|| uri.getHost() == null
|
|
||||||
: !form.startsWith("/") || uri.getRawAuthority() != null)) return HOME;
|
|
||||||
List<String> params = new ArrayList<>();
|
|
||||||
if (StrUtil.isNotBlank(uri.getRawQuery())) {
|
|
||||||
for (String param : uri.getRawQuery().split("&")) {
|
|
||||||
String key = URLDecoder.decode(param.split("=", 2)[0], StandardCharsets.UTF_8);
|
|
||||||
if (!TASK_PARAMS.contains(key)) params.add(param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params.add("taskId=" + task.getId());
|
|
||||||
params.add("bizId=" + URLEncoder.encode(instance.getBusinessNo(), StandardCharsets.UTF_8));
|
|
||||||
params.add("taskKey=" + URLEncoder.encode(task.getTaskName(), StandardCharsets.UTF_8));
|
|
||||||
params.add("tab=todo");
|
|
||||||
String base = form.split("[?#]", 2)[0];
|
|
||||||
return base + "?" + String.join("&", params)
|
|
||||||
+ (uri.getRawFragment() == null ? "" : "#" + uri.getRawFragment());
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
log.warn("WF 手机表单地址无效,卡片回退首页,taskId={}", task.getId());
|
|
||||||
return HOME;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -26,7 +26,6 @@ import com.budwk.app.flow.entity.ProcessInstance;
|
|||||||
import com.budwk.app.flow.entity.ProcessTask;
|
import com.budwk.app.flow.entity.ProcessTask;
|
||||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||||
import com.budwk.app.flow.enums.*;
|
import com.budwk.app.flow.enums.*;
|
||||||
import com.budwk.app.flow.service.FlowTaskMessageService;
|
|
||||||
import com.budwk.app.flow.service.ProcessDefineService;
|
import com.budwk.app.flow.service.ProcessDefineService;
|
||||||
import com.budwk.app.flow.service.ProcessInstanceService;
|
import com.budwk.app.flow.service.ProcessInstanceService;
|
||||||
import com.budwk.app.flow.service.ProcessTaskService;
|
import com.budwk.app.flow.service.ProcessTaskService;
|
||||||
@@ -61,9 +60,6 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
|||||||
@Inject
|
@Inject
|
||||||
private SchoolOaTodoService schoolOaTodoService;
|
private SchoolOaTodoService schoolOaTodoService;
|
||||||
|
|
||||||
@Inject
|
|
||||||
private FlowTaskMessageService flowTaskMessageService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean save(ProcessTask param) {
|
public boolean save(ProcessTask param) {
|
||||||
param.setId(null);
|
param.setId(null);
|
||||||
@@ -296,8 +292,6 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
|||||||
addTaskActor(clone.getId(), CollectionUtil.newArrayList(actor));
|
addTaskActor(clone.getId(), CollectionUtil.newArrayList(actor));
|
||||||
// 并行加签绕过普通节点创建入口,需要为新增的个人任务同步待办。
|
// 并行加签绕过普通节点创建入口,需要为新增的个人任务同步待办。
|
||||||
schoolOaTodoService.createTodo(clone);
|
schoolOaTodoService.createTodo(clone);
|
||||||
// 并行加签不经过 CreateTaskHandler,只为本次新增任务通知一次。
|
|
||||||
flowTaskMessageService.notifyTask(clone, false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -368,8 +362,6 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
|||||||
addTaskActor(task.getId(), CollectionUtil.newArrayList(task.getOperator()));
|
addTaskActor(task.getId(), CollectionUtil.newArrayList(task.getOperator()));
|
||||||
// 驳回创建了新的任务 ID,按新任务推送,避免复用历史待办。
|
// 驳回创建了新的任务 ID,按新任务推送,避免复用历史待办。
|
||||||
schoolOaTodoService.createTodo(task);
|
schoolOaTodoService.createTodo(task);
|
||||||
// 驳回重建不发布开始事件;退回申请节点时也通知申请人重新办理。
|
|
||||||
flowTaskMessageService.notifyTask(task, true);
|
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,12 +441,6 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
|||||||
ProcessInstanceService processInstanceService = ServiceContext.find(ProcessInstanceService.class);
|
ProcessInstanceService processInstanceService = ServiceContext.find(ProcessInstanceService.class);
|
||||||
// 更新会签变量到流程实例参数中
|
// 更新会签变量到流程实例参数中
|
||||||
processInstanceService.updateCountersignVariable(taskModel, execution, taskActors);
|
processInstanceService.updateCountersignVariable(taskModel, execution, taskActors);
|
||||||
// 串行会签后续办理人由 CountersignHandler 直接创建,不经过开始事件;首次会签仍由监听器通知。
|
|
||||||
String counterPrefix = FlowConst.COUNTERSIGN_VARIABLE_PREFIX + taskModel.getName() + "_";
|
|
||||||
if (CountersignTypeEnum.SEQUENTIAL.equals(taskModel.getCountersignType())
|
|
||||||
&& execution.getArgs().get(counterPrefix + FlowConst.LOOP_COUNTER, -1) >= 0) {
|
|
||||||
processTaskList.forEach(task -> flowTaskMessageService.notifyTask(task, false));
|
|
||||||
}
|
|
||||||
return processTaskList;
|
return processTaskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,12 +84,10 @@ public class SchoolOaTodoServiceImpl implements SchoolOaTodoService {
|
|||||||
task.getId(), task.getProcessInstanceId(), task.getTaskState());
|
task.getId(), task.getProcessInstanceId(), task.getTaskState());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 系统参数优先于文件配置,只有明确为 true 才启用;未配置不访问数据库或 OA。 */
|
||||||
* OA 待办接口联调尚未完成,暂时在代码中固定关闭,避免远端异常阻断内部 WF 流转。
|
|
||||||
* 不受 AppSchoolOa 或 enabled 配置影响;恢复对接时需显式恢复配置开关逻辑。
|
|
||||||
*/
|
|
||||||
private boolean isEnabled() {
|
private boolean isEnabled() {
|
||||||
return false;
|
Object enabled = Globals.MyConfig.get("AppSchoolOa");
|
||||||
|
return Boolean.parseBoolean(enabled == null ? conf.get(PREFIX + "enabled", "false") : enabled.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void requireTask(ProcessTask task) {
|
private void requireTask(ProcessTask task) {
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import org.nutz.mvc.annotation.At;
|
|||||||
import org.nutz.mvc.annotation.GET;
|
import org.nutz.mvc.annotation.GET;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
import org.nutz.mvc.annotation.POST;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@@ -500,24 +499,6 @@ public class SysRoleController {
|
|||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 为全部 member=1 的用户设置会员角色,无需传入用户 ID、角色 ID 或列表筛选参数。
|
|
||||||
*
|
|
||||||
* @return JSON Result,data.addedCount 为新增关联数,data.enabledCount 为恢复启用关联数
|
|
||||||
*/
|
|
||||||
@At
|
|
||||||
@POST
|
|
||||||
@Ok("json")
|
|
||||||
@SaCheckPermission("sys.manager.role.user")
|
|
||||||
@SLog(tag = "一键设置会员角色", msg = "为全部member=1的人员补齐会员角色")
|
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
public Result doSettingMemberRole() {
|
|
||||||
NutMap counts = sysRoleService.settingMemberRole();
|
|
||||||
sysRoleService.clearCache();
|
|
||||||
sysUserService.clearCache();
|
|
||||||
return Result.success("会员角色设置完成", counts);
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@Ok("json")
|
@Ok("json")
|
||||||
@SaCheckPermission("sys.manager.role")
|
@SaCheckPermission("sys.manager.role")
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.budwk.app.sys.models.Sys_role;
|
|||||||
import com.budwk.app.sys.models.Sys_unit;
|
import com.budwk.app.sys.models.Sys_unit;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.nutz.lang.util.NutMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by wizzer on 2016/12/22.
|
* Created by wizzer on 2016/12/22.
|
||||||
@@ -129,13 +128,6 @@ public interface SysRoleService extends BaseService<Sys_role> {
|
|||||||
*/
|
*/
|
||||||
List<String> getRoleIdsByCode(List<RoleConstant> roleConstantList);
|
List<String> getRoleIdsByCode(List<RoleConstant> roleConstantList);
|
||||||
|
|
||||||
/**
|
|
||||||
* 为用户表中 member=1 的全部人员补齐启用的 MEMBER 角色,不受列表筛选影响。
|
|
||||||
*
|
|
||||||
* @return addedCount 为新增关联数,enabledCount 为恢复启用的关联数;已有启用关联不重复添加
|
|
||||||
*/
|
|
||||||
NutMap settingMemberRole();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空缓存
|
* 清空缓存
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.budwk.app.sys.services.impl;
|
package com.budwk.app.sys.services.impl;
|
||||||
|
|
||||||
|
import com.budwk.app.base.exception.BaseException;
|
||||||
import com.budwk.app.sys.services.SysHomeNewsService;
|
import com.budwk.app.sys.services.SysHomeNewsService;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Document;
|
||||||
@@ -34,7 +35,7 @@ public class SysHomeNewsServiceImpl implements SysHomeNewsService {
|
|||||||
/**
|
/**
|
||||||
* 无需参数,一次抓取首页中的三个栏目,并保留原有一天有效期的缓存写入。
|
* 无需参数,一次抓取首页中的三个栏目,并保留原有一天有效期的缓存写入。
|
||||||
*
|
*
|
||||||
* @return label/value 栏目列表,文章包含 text/time/href;无文章的栏目保留空列表,抓取失败返回空栏目列表。
|
* @return label/value 栏目列表,文章包含 text/time/href;正常空栏目返回空列表。
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
@@ -50,8 +51,7 @@ public class SysHomeNewsServiceImpl implements SysHomeNewsService {
|
|||||||
return news;
|
return news;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.warn("获取重庆工贸职业技术学院工会首页失败", e);
|
log.warn("获取重庆工贸职业技术学院工会首页失败", e);
|
||||||
// 学校网站连接失败或超时时返回空列表,让首页展示空状态,不向用户报错,也不覆盖已有缓存。
|
throw new BaseException("学校工会网站暂时无法访问,请稍后重试");
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import org.nutz.ioc.aop.Aop;
|
|||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.lang.Strings;
|
import org.nutz.lang.Strings;
|
||||||
import org.nutz.lang.util.NutMap;
|
|
||||||
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
|
||||||
import org.nutz.plugins.wkcache.annotation.CacheRemoveAll;
|
import org.nutz.plugins.wkcache.annotation.CacheRemoveAll;
|
||||||
import org.nutz.plugins.wkcache.annotation.CacheResult;
|
import org.nutz.plugins.wkcache.annotation.CacheResult;
|
||||||
@@ -285,44 +284,4 @@ public class SysRoleServiceImpl extends BaseServiceImpl<Sys_role> implements Sys
|
|||||||
public void clearCache() {
|
public void clearCache() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量补齐会员角色。仅处理 member=1 的用户,保留其他角色及账号禁用状态。
|
|
||||||
*
|
|
||||||
* @return addedCount 为新增关联数,enabledCount 为恢复启用的关联数
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
public NutMap settingMemberRole() {
|
|
||||||
// 锁定同一会员角色,使本接口的并发请求依次执行,避免重复插入用户角色关系。
|
|
||||||
Sql roleSql = Sqls.create("SELECT * FROM sys_role WHERE code=@code FOR UPDATE");
|
|
||||||
roleSql.setParam("code", RoleConstant.MEMBER.name());
|
|
||||||
roleSql.setEntity(dao().getEntity(Sys_role.class));
|
|
||||||
roleSql.setCallback(Sqls.callback.entities());
|
|
||||||
dao().execute(roleSql);
|
|
||||||
List<Sys_role> roles = roleSql.getList(Sys_role.class);
|
|
||||||
if (roles.isEmpty()) {
|
|
||||||
throw new BaseException("会员角色(MEMBER)不存在,请先配置会员角色");
|
|
||||||
}
|
|
||||||
Sys_role role = roles.get(0);
|
|
||||||
if (role.isDisabled()) {
|
|
||||||
throw new BaseException("会员角色(MEMBER)已禁用,请先启用会员角色");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 历史关联可能已停用或未填写 enable;恢复关联即可,无需重新插入。
|
|
||||||
Sql enableSql = Sqls.create("UPDATE sys_user_role SET enable=1 WHERE roleId=@roleId "
|
|
||||||
+ "AND (enable IS NULL OR enable<>1) "
|
|
||||||
+ "AND EXISTS (SELECT 1 FROM sys_user u WHERE u.id=sys_user_role.userId AND u.member=1)");
|
|
||||||
enableSql.setParam("roleId", role.getId());
|
|
||||||
dao().execute(enableSql);
|
|
||||||
|
|
||||||
// 按用户、角色判重,只为缺少会员关联的人员添加记录;不删除任何已有角色。
|
|
||||||
Sql insertSql = Sqls.create("INSERT INTO sys_user_role (userId,roleId,enable) "
|
|
||||||
+ "SELECT u.id,@roleId,1 FROM sys_user u WHERE u.member=1 "
|
|
||||||
+ "AND NOT EXISTS (SELECT 1 FROM sys_user_role ur WHERE ur.userId=u.id AND ur.roleId=@roleId)");
|
|
||||||
insertSql.setParam("roleId", role.getId());
|
|
||||||
dao().execute(insertSql);
|
|
||||||
return NutMap.NEW().addv("addedCount", insertSql.getUpdateCount())
|
|
||||||
.addv("enabledCount", enableSql.getUpdateCount());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -193,8 +193,7 @@ public class GlobalMessageSendService {
|
|||||||
try {
|
try {
|
||||||
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
||||||
request.getReceiverIds(), request.getConfig());
|
request.getReceiverIds(), request.getConfig());
|
||||||
// 策略可能因开关关闭而跳过,实际发送结果由策略日志记录。
|
log.info("异步发送消息成功,渠道:{}", strategy.getChannel().getValue());
|
||||||
log.info("异步消息策略执行完成,渠道:{}", strategy.getChannel().getValue());
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("异步发送消息失败,渠道:{},错误:{}", strategy.getChannel().getValue(), e.getMessage(), e);
|
log.error("异步发送消息失败,渠道:{},错误:{}", strategy.getChannel().getValue(), e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|||||||
-72
@@ -1,23 +1,16 @@
|
|||||||
package com.budwk.app.zhgh.dayofficework.message.strategy.impl;
|
package com.budwk.app.zhgh.dayofficework.message.strategy.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.http.HtmlUtil;
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.budwk.app.base.sms.SmsService;
|
import com.budwk.app.base.sms.SmsService;
|
||||||
import com.budwk.app.base.wxwork.WxWorkMessageService;
|
|
||||||
import com.budwk.app.sys.models.Sys_user;
|
import com.budwk.app.sys.models.Sys_user;
|
||||||
import com.budwk.app.zhgh.dayofficework.message.enums.GlobalMessageChannel;
|
import com.budwk.app.zhgh.dayofficework.message.enums.GlobalMessageChannel;
|
||||||
import com.budwk.app.zhgh.dayofficework.message.strategy.GlobalMessageSendStrategy;
|
import com.budwk.app.zhgh.dayofficework.message.strategy.GlobalMessageSendStrategy;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.ioc.aop.Aop;
|
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.lang.util.NutMap;
|
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,8 +24,6 @@ public class WechatMessageSendStrategy implements GlobalMessageSendStrategy {
|
|||||||
private Dao dao;
|
private Dao dao;
|
||||||
@Inject
|
@Inject
|
||||||
private SmsService smsService;
|
private SmsService smsService;
|
||||||
@Inject
|
|
||||||
private WxWorkMessageService wxWorkMessageService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GlobalMessageChannel getChannel() {
|
public GlobalMessageChannel getChannel() {
|
||||||
@@ -45,13 +36,7 @@ public class WechatMessageSendStrategy implements GlobalMessageSendStrategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
public void send(String title, String content, Integer type, List<String> receiverIds, JSONObject config) {
|
public void send(String title, String content, Integer type, List<String> receiverIds, JSONObject config) {
|
||||||
// WF 的接收账号已在任务事务内取得,异步线程不再反查尚未提交的任务数据。
|
|
||||||
if (config != null && config.getLong("wfTaskId") != null) {
|
|
||||||
sendFlowCard(title, content, config);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
log.info("开始发送微信消息,标题:{},接收人数量:{}", title, receiverIds.size());
|
log.info("开始发送微信消息,标题:{},接收人数量:{}", title, receiverIds.size());
|
||||||
|
|
||||||
@@ -67,12 +52,7 @@ public class WechatMessageSendStrategy implements GlobalMessageSendStrategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
public void sendByLoginName(String title, String content, Integer type, List<String> receiverLoginNames, JSONObject config) {
|
public void sendByLoginName(String title, String content, Integer type, List<String> receiverLoginNames, JSONObject config) {
|
||||||
if (config != null && config.getLong("wfTaskId") != null) {
|
|
||||||
sendFlowCard(title, content, config);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
log.info("开始发送微信消息(按登录名),标题:{},接收人数量:{}", title, receiverLoginNames.size());
|
log.info("开始发送微信消息(按登录名),标题:{},接收人数量:{}", title, receiverLoginNames.size());
|
||||||
|
|
||||||
@@ -87,58 +67,6 @@ public class WechatMessageSendStrategy implements GlobalMessageSendStrategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* WF 专用分支:wfTaskId 为任务ID,wfLoginNames 为实际办理人的 loginname 列表,
|
|
||||||
* wxWorkLink 为非空手机入口。无返回值;关闭开关或无账号时跳过,失败抛给全局异步日志处理,
|
|
||||||
* 不回退旧微信通道,避免双发。非流程消息继续沿用原有通讯平台。
|
|
||||||
*/
|
|
||||||
private void sendFlowCard(String title, String content, JSONObject config) {
|
|
||||||
Long taskId = config.getLong("wfTaskId");
|
|
||||||
List<String> loginNames = config.getJSONArray("wfLoginNames") == null ? List.of()
|
|
||||||
: config.getJSONArray("wfLoginNames").toList(String.class);
|
|
||||||
if (loginNames.isEmpty()) {
|
|
||||||
log.warn("WF 企业微信卡片跳过:办理人 loginname 为空,taskId={}", taskId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String link = StrUtil.blankToDefault(config.getStr("wxWorkLink"), "/platform/home");
|
|
||||||
NutMap result;
|
|
||||||
try {
|
|
||||||
result = wxWorkMessageService.massSend(loginNames, cardText(title, 128, false),
|
|
||||||
cardText(content, 512, true), link);
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
// 异步线程已脱离任务调用栈,保留任务 ID 便于从错误日志定位具体待办。
|
|
||||||
throw new IllegalStateException("WF 企业微信卡片接口异常,taskId=" + taskId, e);
|
|
||||||
}
|
|
||||||
if (result != null && result.getBoolean("skipped", false)) {
|
|
||||||
log.info("WF 企业微信卡片跳过:消息开关关闭,taskId={}", taskId);
|
|
||||||
} else if (result != null && result.getBoolean("success", false)) {
|
|
||||||
log.info("WF 企业微信卡片发送成功,taskId={},接收账号数={}", taskId, loginNames.size());
|
|
||||||
} else {
|
|
||||||
log.error("WF 企业微信卡片发送失败或部分失败,taskId={},result={}", taskId, result);
|
|
||||||
throw new IllegalStateException("WF 企业微信卡片发送失败或部分失败,taskId=" + taskId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 卡片有 UTF-8 字节上限;按 Unicode 码点缩短摘要,并计入正文 HTML 转义后的长度。 */
|
|
||||||
private String cardText(String value, int limit, boolean description) {
|
|
||||||
String text = HtmlUtil.unescape(HtmlUtil.cleanHtmlTag(StrUtil.blankToDefault(value, "流程待办")))
|
|
||||||
.replace('\r', ' ').replace('\n', ' ');
|
|
||||||
if (text.isBlank()) text = "流程待办";
|
|
||||||
StringBuilder result = new StringBuilder();
|
|
||||||
int bytes = 0;
|
|
||||||
for (int offset = 0; offset < text.length();) {
|
|
||||||
int codePoint = text.codePointAt(offset);
|
|
||||||
String character = new String(Character.toChars(codePoint));
|
|
||||||
int size = (description ? HtmlUtil.escape(character) : character).getBytes(StandardCharsets.UTF_8).length;
|
|
||||||
// 留出省略号的三个 UTF-8 字节,避免长流程名称使整条通知发送失败。
|
|
||||||
if (bytes + size > limit - 3) return result.append("…").toString();
|
|
||||||
result.append(character);
|
|
||||||
bytes += size;
|
|
||||||
offset += Character.charCount(codePoint);
|
|
||||||
}
|
|
||||||
return result.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送微信文本消息。
|
* 发送微信文本消息。
|
||||||
* 接收人来自全局消息服务传入的用户ID或登录名,方法内部转换为 Sys_user 后取工号发送;
|
* 接收人来自全局消息服务传入的用户ID或登录名,方法内部转换为 Sys_user 后取工号发送;
|
||||||
|
|||||||
+3
@@ -606,6 +606,9 @@ public class TourMySignupController {
|
|||||||
if (StrUtil.isBlank(ledger.getMobile())) {
|
if (StrUtil.isBlank(ledger.getMobile())) {
|
||||||
return Result.error("手机号不能为空");
|
return Result.error("手机号不能为空");
|
||||||
}
|
}
|
||||||
|
if (!ledger.getMobile().matches("^1[3-9]\\d{9}$")) {
|
||||||
|
return Result.error("请输入正确的11位手机号");
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
@@ -841,6 +841,9 @@ public class TourSignupController {
|
|||||||
if (StrUtil.isBlank(ledger.getMobile())) {
|
if (StrUtil.isBlank(ledger.getMobile())) {
|
||||||
return Result.error("手机号不能为空");
|
return Result.error("手机号不能为空");
|
||||||
}
|
}
|
||||||
|
if (!ledger.getMobile().matches("^1[3-9]\\d{9}$")) {
|
||||||
|
return Result.error("请输入正确的11位手机号");
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -86,8 +86,7 @@ public class GrassrootsCongressMaterialMineController {
|
|||||||
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
// searchKeyword 为资料名称关键词,按资料表的 materialsName 字段模糊匹配。
|
cnd.and(Cnd.likeEX("info.meetingName", pageForm.getSearchKeyword()));
|
||||||
cnd.and(Cnd.likeEX("info.materialsName", pageForm.getSearchKeyword()));
|
|
||||||
}
|
}
|
||||||
cnd.andEX("YEAR(info.createdTime)", "=", pageForm.getYear());
|
cnd.andEX("YEAR(info.createdTime)", "=", pageForm.getYear());
|
||||||
cnd.desc("info.createdTime");
|
cnd.desc("info.createdTime");
|
||||||
|
|||||||
+5
-23
@@ -28,7 +28,6 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
|||||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
||||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
|
||||||
import com.deepoove.poi.data.PictureRenderData;
|
import com.deepoove.poi.data.PictureRenderData;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -48,8 +47,6 @@ import org.nutz.mvc.annotation.Ok;
|
|||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -187,27 +184,12 @@ public class CondolenceMineController {
|
|||||||
log.info("[职工慰问导出] 渲染前图片字段,applyId={}, instanceId={}, field={}, valueType={}", id, instance.getId(), field, value == null ? "null" : value.getClass().getName());
|
log.info("[职工慰问导出] 渲染前图片字段,applyId={}, instanceId={}, field={}, valueType={}", id, instance.getId(), field, value == null ? "null" : value.getClass().getName());
|
||||||
}
|
}
|
||||||
String fileName = "重庆工贸职业技术学院职工慰问申请表_" + StrUtil.nullToEmpty(condolence.getHelpUserName());
|
String fileName = "重庆工贸职业技术学院职工慰问申请表_" + StrUtil.nullToEmpty(condolence.getHelpUserName());
|
||||||
try (InputStream input = getClass().getResourceAsStream("/templates/condolence/重庆工贸职业技术学院职工慰问申请表.doc");
|
try (InputStream input = getClass().getResourceAsStream("/templates/condolence/重庆工贸职业技术学院职工慰问申请表.doc")) {
|
||||||
ByteArrayOutputStream templateOutput = new ByteArrayOutputStream();
|
|
||||||
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
|
|
||||||
if (input == null) throw new BaseException("职工慰问申请表模板不存在");
|
if (input == null) throw new BaseException("职工慰问申请表模板不存在");
|
||||||
com.aspose.words.Document document = new com.aspose.words.Document(input);
|
boolean pdf = Boolean.TRUE.equals(print);
|
||||||
document.save(templateOutput, com.aspose.words.SaveFormat.DOCX);
|
byte[] bytes = sysOfficeTemplateUtil.renderTemplate(input, docData, null, pdf, "condolence:" + id);
|
||||||
log.info("[职工慰问导出] 模板转换完成,applyId={}, templateBytes={}", id, templateOutput.size());
|
log.info("[职工慰问导出] 渲染完成,applyId={}, format={}, outputBytes={}", id, pdf ? "PDF" : "Word", bytes.length);
|
||||||
try (ByteArrayInputStream templateInput = new ByteArrayInputStream(templateOutput.toByteArray())) {
|
CommonDownloadUtil.download(fileName + (pdf ? ".pdf" : ".docx"), bytes, response);
|
||||||
XWPFTemplate.compile(templateInput).render(docData).writeAndClose(output);
|
|
||||||
}
|
|
||||||
log.info("[职工慰问导出] Word渲染完成,applyId={}, outputBytes={}", id, output.size());
|
|
||||||
if (Boolean.TRUE.equals(print)) {
|
|
||||||
try (ByteArrayInputStream wordInput = new ByteArrayInputStream(output.toByteArray());
|
|
||||||
ByteArrayOutputStream pdfOutput = new ByteArrayOutputStream()) {
|
|
||||||
new com.aspose.words.Document(wordInput).save(pdfOutput, com.aspose.words.SaveFormat.PDF);
|
|
||||||
log.info("[职工慰问导出] PDF转换完成,applyId={}, outputBytes={}", id, pdfOutput.size());
|
|
||||||
CommonDownloadUtil.download(fileName + ".pdf", pdfOutput.toByteArray(), response);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
CommonDownloadUtil.download(fileName + ".docx", output.toByteArray(), response);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[职工慰问导出] 模板渲染或文件输出失败,applyId={}, instanceId={}, format={}", id, instance.getId(), Boolean.TRUE.equals(print) ? "PDF" : "Word", e);
|
log.error("[职工慰问导出] 模板渲染或文件输出失败,applyId={}, instanceId={}, format={}", id, instance.getId(), Boolean.TRUE.equals(print) ? "PDF" : "Word", e);
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
+16
-39
@@ -9,7 +9,6 @@ import cn.dev33.satoken.annotation.SaCheckLogin;
|
|||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.io.IoUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
@@ -18,7 +17,6 @@ import com.budwk.app.base.page.Pagination;
|
|||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||||
import com.budwk.app.base.utils.MoneyUtil;
|
import com.budwk.app.base.utils.MoneyUtil;
|
||||||
import com.budwk.app.base.utils.OfficePlusUtil;
|
|
||||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||||
import com.budwk.app.flow.engine.FlowEngine;
|
import com.budwk.app.flow.engine.FlowEngine;
|
||||||
import com.budwk.app.flow.entity.ProcessInstance;
|
import com.budwk.app.flow.entity.ProcessInstance;
|
||||||
@@ -39,7 +37,6 @@ import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommon
|
|||||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.moneyImportVo;
|
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.moneyImportVo;
|
||||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||||
import com.deepoove.poi.XWPFTemplate;
|
|
||||||
import com.deepoove.poi.config.Configure;
|
import com.deepoove.poi.config.Configure;
|
||||||
import com.deepoove.poi.data.PictureRenderData;
|
import com.deepoove.poi.data.PictureRenderData;
|
||||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||||
@@ -74,8 +71,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.StandardOpenOption;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -319,9 +314,9 @@ public class DifficultHelpReadingController {
|
|||||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||||
Configure config = Configure.builder().bind("familyList", policy).build();
|
Configure config = Configure.builder().bind("familyList", policy).build();
|
||||||
|
|
||||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("difficulty_apply"), config)
|
try (InputStream input = sysOfficeTemplateUtil.getTemplate("difficulty_apply")) {
|
||||||
.render(docData)
|
zipOutputStream.write(sysOfficeTemplateUtil.renderTemplate(input, docData, config, false, "difficulthelp:batch:" + record.getString("id")));
|
||||||
.write(zipOutputStream);
|
}
|
||||||
zipOutputStream.closeEntry();
|
zipOutputStream.closeEntry();
|
||||||
}
|
}
|
||||||
zipOutputStream.flush();
|
zipOutputStream.flush();
|
||||||
@@ -379,17 +374,18 @@ public class DifficultHelpReadingController {
|
|||||||
String[] taskKeys = {"36ebafda-44c2-4bd3-bd7f-10839a575a0d", "715ece82-4ae3-433c-ad18-ed875f45d1e3", "e405f96c-5fc0-4f63-b323-e69dfe853253"};
|
String[] taskKeys = {"36ebafda-44c2-4bd3-bd7f-10839a575a0d", "715ece82-4ae3-433c-ad18-ed875f45d1e3", "e405f96c-5fc0-4f63-b323-e69dfe853253"};
|
||||||
String[] fields = {"firstApproval", "secondApproval", "thirdApproval"};
|
String[] fields = {"firstApproval", "secondApproval", "thirdApproval"};
|
||||||
for (String field : fields) {
|
for (String field : fields) {
|
||||||
for (String suffix : List.of("", "Opinion", "User", "Date", "Year", "Month", "Day", "Sign")) docData.put(field + suffix, "");
|
for (String suffix : List.of("", "Opinion", "User", "Date", "Year", "Month", "Day", "Sign")) docData.put(field + suffix, "Sign".equals(suffix) ? null : "");
|
||||||
}
|
}
|
||||||
ProcessInstance instance = dao.fetch(ProcessInstance.class, Cnd.where("businessNo", "=", businessId).desc("id"));
|
ProcessInstance instance = dao.fetch(ProcessInstance.class, Cnd.where("businessNo", "=", businessId).desc("id"));
|
||||||
if (instance == null) return;
|
if (instance == null) return;
|
||||||
List<ProcessTask> tasks = dao.query(ProcessTask.class, Cnd.where("processInstanceId", "=", instance.getId()).asc("id"));
|
List<ProcessTask> tasks = dao.query(ProcessTask.class, Cnd.where("processInstanceId", "=", instance.getId()).asc("id"));
|
||||||
for (ProcessTask task : tasks) {
|
for (ProcessTask task : tasks) {
|
||||||
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(task.getId());
|
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(task.getId());
|
||||||
if ("startTask".equals(task.getTaskName()) || (taskVO.getExt() != null && Boolean.TRUE.equals(taskVO.getExt().getBool("isFirstTaskNode")))) {
|
if ("startTask".equals(task.getTaskName()) || (!List.of(taskKeys).contains(task.getTaskName())
|
||||||
|
&& taskVO.getExt() != null && Boolean.TRUE.equals(taskVO.getExt().getBool("isFirstTaskNode")))) {
|
||||||
// 重新申请后,仅导出本轮审批,避免混入上一次退回或撤销前的意见。
|
// 重新申请后,仅导出本轮审批,避免混入上一次退回或撤销前的意见。
|
||||||
for (String field : fields) {
|
for (String field : fields) {
|
||||||
for (String suffix : List.of("", "Opinion", "User", "Date", "Year", "Month", "Day", "Sign")) docData.put(field + suffix, "");
|
for (String suffix : List.of("", "Opinion", "User", "Date", "Year", "Month", "Day", "Sign")) docData.put(field + suffix, "Sign".equals(suffix) ? null : "");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -453,22 +449,9 @@ public class DifficultHelpReadingController {
|
|||||||
String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" +
|
String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" +
|
||||||
DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".pdf";
|
DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".pdf";
|
||||||
|
|
||||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
try (InputStream input = getApplyTemplate(templateName)) {
|
||||||
XWPFTemplate.compile(getApplyTemplate(templateName),config)
|
byte[] bytes = sysOfficeTemplateUtil.renderTemplate(input, docData, config, true, "difficulthelp:" + difficultHelp.getId());
|
||||||
.render(docData)
|
CommonDownloadUtil.download(fileName, bytes, response);
|
||||||
.writeAndClose(byteArrayOutputStream);
|
|
||||||
byte[] bytes = byteArrayOutputStream.toByteArray();
|
|
||||||
File sourceFile = File.createTempFile("file_convert_origin", ".docx");
|
|
||||||
Files.write(sourceFile.toPath(), bytes, StandardOpenOption.WRITE);
|
|
||||||
|
|
||||||
File pdfFile = File.createTempFile("file_convert", ".pdf");
|
|
||||||
OfficePlusUtil.convert(sourceFile.getPath(), pdfFile.getPath());
|
|
||||||
CommonDownloadUtil.download(fileName, IoUtil.readBytes(FileUtil.getInputStream(pdfFile)), response);
|
|
||||||
// 删除临时文件
|
|
||||||
FileUtil.del(sourceFile);
|
|
||||||
FileUtil.del(pdfFile.toPath());
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("困难慰问申请表导出PDF失败,id:{},错误信息:{}", difficultHelp.getId(), e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,13 +461,9 @@ public class DifficultHelpReadingController {
|
|||||||
String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" +
|
String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" +
|
||||||
DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".docx";
|
DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".docx";
|
||||||
|
|
||||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
try (InputStream input = getApplyTemplate(templateName)) {
|
||||||
XWPFTemplate.compile(getApplyTemplate(templateName),config)
|
byte[] bytes = sysOfficeTemplateUtil.renderTemplate(input, docData, config, false, "difficulthelp:" + difficultHelp.getId());
|
||||||
.render(docData)
|
CommonDownloadUtil.download(fileName, bytes, response);
|
||||||
.writeAndClose(byteArrayOutputStream);
|
|
||||||
CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response);
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("困难慰问申请表导出Word失败,id:{},错误信息:{}", difficultHelp.getId(), e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,15 +541,13 @@ public class DifficultHelpReadingController {
|
|||||||
throw new RuntimeException("导出Excel汇总表失败:" + e.getMessage());
|
throw new RuntimeException("导出Excel汇总表失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
} else if ("docx".equals(flag)) {
|
} else if ("docx".equals(flag)) {
|
||||||
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
try (InputStream input = sysOfficeTemplateUtil.getTemplate(resource)) {
|
||||||
Configure config = Configure.builder()
|
Configure config = Configure.builder()
|
||||||
.bind("da", new LoopRowTableRenderPolicy())
|
.bind("da", new LoopRowTableRenderPolicy())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(resource), config)
|
byte[] bytes = sysOfficeTemplateUtil.renderTemplate(input, result, config, false, "difficulthelp:summary:" + resource);
|
||||||
.render(result)
|
CommonDownloadUtil.download(fileName + ".docx", bytes, response);
|
||||||
.writeAndClose(out);
|
|
||||||
CommonDownloadUtil.download(fileName + ".docx", out.toByteArray(), response);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -1,6 +1,7 @@
|
|||||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.service;
|
package com.budwk.app.zhgh.staffbenefit.difficulthelp.service;
|
||||||
|
|
||||||
import com.budwk.app.base.service.BaseService;
|
import com.budwk.app.base.service.BaseService;
|
||||||
|
import com.budwk.app.flow.entity.ProcessTask;
|
||||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||||
@@ -21,6 +22,14 @@ public interface DifficultHelpCommonService extends BaseService<DifficultHelpInf
|
|||||||
|
|
||||||
void validateApplyUser(DifficultHelpInfo difficultHelpInfo);
|
void validateApplyUser(DifficultHelpInfo difficultHelpInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 困难帮扶进入校工会办公室主任审批时,通知本次任务的实际参与人。
|
||||||
|
* @param task WF 已创建且参与人已落库的任务;仅 KNBF 办公室审批待办触发,
|
||||||
|
* 接收人使用任务参与人的 actorAccount(系统 loginname)
|
||||||
|
* @return 无返回值;开关关闭或非目标节点不发送,发送失败记录日志而不阻断流程
|
||||||
|
*/
|
||||||
|
void notifyOfficeApproval(ProcessTask task);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入实际金额数据处理
|
* 导入实际金额数据处理
|
||||||
* @param file 文件
|
* @param file 文件
|
||||||
|
|||||||
+59
@@ -6,6 +6,12 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||||
import com.budwk.app.base.constant.RoleConstant;
|
import com.budwk.app.base.constant.RoleConstant;
|
||||||
import com.budwk.app.base.exception.BaseException;
|
import com.budwk.app.base.exception.BaseException;
|
||||||
|
import com.budwk.app.base.wxwork.WxWorkMessageService;
|
||||||
|
import com.budwk.app.flow.entity.ProcessDefine;
|
||||||
|
import com.budwk.app.flow.entity.ProcessInstance;
|
||||||
|
import com.budwk.app.flow.entity.ProcessTask;
|
||||||
|
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||||
|
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
import com.budwk.app.base.utils.ManyAddOrRenewUtil;
|
import com.budwk.app.base.utils.ManyAddOrRenewUtil;
|
||||||
@@ -31,6 +37,8 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
|||||||
import org.nutz.lang.Lang;
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.lang.random.R;
|
import org.nutz.lang.random.R;
|
||||||
import org.nutz.lang.util.NutMap;
|
import org.nutz.lang.util.NutMap;
|
||||||
|
import org.nutz.log.Log;
|
||||||
|
import org.nutz.log.Logs;
|
||||||
import org.nutz.mvc.upload.TempFile;
|
import org.nutz.mvc.upload.TempFile;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -46,6 +54,8 @@ import java.util.stream.IntStream;
|
|||||||
*/
|
*/
|
||||||
@IocBean(args = {"refer:dao"})
|
@IocBean(args = {"refer:dao"})
|
||||||
public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHelpInfo> implements DifficultHelpCommonService {
|
public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHelpInfo> implements DifficultHelpCommonService {
|
||||||
|
private static final Log log = Logs.get();
|
||||||
|
private static final String OFFICE_APPROVAL_TASK = "36ebafda-44c2-4bd3-bd7f-10839a575a0d";
|
||||||
|
|
||||||
public DifficultHelpCommonServiceImpl(Dao dao) {
|
public DifficultHelpCommonServiceImpl(Dao dao) {
|
||||||
super(dao);
|
super(dao);
|
||||||
@@ -53,6 +63,55 @@ public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHel
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ManyAddOrRenewUtil manyAddOrRenewUtil;
|
private ManyAddOrRenewUtil manyAddOrRenewUtil;
|
||||||
|
@Inject
|
||||||
|
private WxWorkMessageService wxWorkMessageService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 只通知 KNBF 办公室待办的实际审核人;重新提交生成的新任务沿用同一入口。
|
||||||
|
* task 为任务开始事件对应的 WF 任务,actorAccount 为学校企业微信 userid。
|
||||||
|
* 无返回值;服务返回 skipped 表示开关关闭,success=false 表示接口失败或部分接收人无效。
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
public void notifyOfficeApproval(ProcessTask task) {
|
||||||
|
if (task == null || task.getId() == null || task.getProcessInstanceId() == null
|
||||||
|
|| !OFFICE_APPROVAL_TASK.equals(task.getTaskName())
|
||||||
|
|| !ProcessTaskStateEnum.DOING.getCode().equals(task.getTaskState())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
ProcessInstance instance = dao().fetch(ProcessInstance.class, task.getProcessInstanceId());
|
||||||
|
if (instance == null || instance.getProcessDefineId() == null) return;
|
||||||
|
ProcessDefine define = dao().fetch(ProcessDefine.class, instance.getProcessDefineId());
|
||||||
|
// 使用实例所属定义核验流程 KEY,避免其他流程复用同一个节点 ID 时误发。
|
||||||
|
if (define == null || !"KNBF".equals(define.getName())) return;
|
||||||
|
DifficultHelpInfo info = StrUtil.isBlank(instance.getBusinessNo()) ? null : fetch(instance.getBusinessNo());
|
||||||
|
if (info == null) {
|
||||||
|
log.warnf("困难帮扶企业微信通知跳过:申请不存在,taskId=%s", task.getId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<ProcessTaskActor> actors = dao().query(ProcessTaskActor.class,
|
||||||
|
Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
|
||||||
|
List<String> loginNames = actors.stream().map(ProcessTaskActor::getActorAccount)
|
||||||
|
.filter(StrUtil::isNotBlank).map(String::trim).distinct().toList();
|
||||||
|
// 不按角色扩大接收范围,未绑定工号时不以内部用户 ID 代替企业微信 userid。
|
||||||
|
if (loginNames.isEmpty()) {
|
||||||
|
log.warnf("困难帮扶企业微信通知跳过:审核人 loginname 为空,taskId=%s", task.getId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String content = "您有一条困难帮扶申请待审核,受助人:"
|
||||||
|
+ StrUtil.blankToDefault(info.getUserName(), "未填写") + ",请进入校工会办公室审批页面办理。";
|
||||||
|
// 流程定义中仍保留旧的 unionLeaderApproval 链接,本节点实际办理入口为 branchUnionApproval。
|
||||||
|
NutMap result = wxWorkMessageService.massSend(loginNames, "困难帮扶待办提醒", content,
|
||||||
|
"/platform/difficultHelp/branchUnionApproval/h5");
|
||||||
|
if (!result.getBoolean("skipped", false) && !result.getBoolean("success", false)) {
|
||||||
|
log.warnf("困难帮扶企业微信通知发送失败或部分失败,taskId=%s,result=%s", task.getId(), result);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 外部消息不改变审批结果;日志保留任务 ID,便于定位接口、账号或配置问题。
|
||||||
|
log.error("困难帮扶企业微信通知异常,taskId=" + task.getId(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validateApplyUser(DifficultHelpInfo difficultHelpInfo) {
|
public void validateApplyUser(DifficultHelpInfo difficultHelpInfo) {
|
||||||
|
|||||||
+3
-7
@@ -20,7 +20,6 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
|||||||
import com.budwk.app.web.commons.base.Globals;
|
import com.budwk.app.web.commons.base.Globals;
|
||||||
import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
|
import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
|
||||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCommonService;
|
import com.budwk.app.zhgh.staffmanage.member.service.MemberCommonService;
|
||||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberApplyRecordService;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
@@ -55,8 +54,6 @@ public class MemberApplyController {
|
|||||||
private FlowCommonService flowCommonService;
|
private FlowCommonService flowCommonService;
|
||||||
@Inject
|
@Inject
|
||||||
private MemberCommonService memberCommonService;
|
private MemberCommonService memberCommonService;
|
||||||
@Inject
|
|
||||||
private MemberApplyRecordService memberApplyRecordService;
|
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@Ok("beetl:/platform/zhgh/staffmanage/member/apply/submit/index.html")
|
@Ok("beetl:/platform/zhgh/staffmanage/member/apply/submit/index.html")
|
||||||
@@ -73,14 +70,13 @@ public class MemberApplyController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("保存申请")
|
@ApiOperation("保存申请")
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
@SaCheckPermission("member.apply.submit")
|
@SaCheckPermission("member.apply.submit")
|
||||||
@SLog(tag = "会员入会申请", msg = "保存申请,申请人: ${args[0].username}")
|
@SLog(tag = "会员入会申请", msg = "保存申请,申请人: ${args[0].username}")
|
||||||
public Result save(@Param("data") MemberApplyRecord memberApplyRecord) {
|
public Result save(@Param("data") MemberApplyRecord memberApplyRecord) {
|
||||||
if (StrUtil.isBlank(memberApplyRecord.getId())) {
|
if (StrUtil.isBlank(memberApplyRecord.getId())) {
|
||||||
memberCommonService.validateApplyOrChangeIsDoing(null, "apply");
|
memberCommonService.validateApplyOrChangeIsDoing(null, "apply");
|
||||||
}
|
}
|
||||||
memberApplyRecordService.saveApplyRecord(memberApplyRecord);
|
dao.insertOrUpdate(memberApplyRecord);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +105,7 @@ public class MemberApplyController {
|
|||||||
.and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
.and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
||||||
args.set("type", Lang.isEmpty(group) ? "branch" : "group");
|
args.set("type", Lang.isEmpty(group) ? "branch" : "group");
|
||||||
|
|
||||||
memberApplyRecordService.saveApplyRecord(memberApplyRecord);
|
dao.insertOrUpdate(memberApplyRecord);
|
||||||
|
|
||||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||||
args.set(FlowConst.FORM_DATA, memberApplyRecord);
|
args.set(FlowConst.FORM_DATA, memberApplyRecord);
|
||||||
@@ -147,7 +143,7 @@ public class MemberApplyController {
|
|||||||
.and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
.and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
||||||
dict.set("type", Lang.isEmpty(group) ? "branch" : "group");
|
dict.set("type", Lang.isEmpty(group) ? "branch" : "group");
|
||||||
|
|
||||||
memberApplyRecordService.saveApplyRecord(memberApplyRecord);
|
dao.insertOrUpdate(memberApplyRecord);
|
||||||
|
|
||||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||||
|
|||||||
+2
-4
@@ -64,7 +64,7 @@ public class MemberBranchUnionAuditController {
|
|||||||
info.sex,
|
info.sex,
|
||||||
info.userName,
|
info.userName,
|
||||||
info.loginName,
|
info.loginName,
|
||||||
COALESCE(changeUnit.name, info.unitName) AS unitName,
|
info.unitName,
|
||||||
info.unionName,
|
info.unionName,
|
||||||
info.userState,
|
info.userState,
|
||||||
info.preparedBy,
|
info.preparedBy,
|
||||||
@@ -91,7 +91,6 @@ public class MemberBranchUnionAuditController {
|
|||||||
wf_process_task t
|
wf_process_task t
|
||||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||||
LEFT JOIN member_change_record info ON info.id = ins.businessNo
|
LEFT JOIN member_change_record info ON info.id = ins.businessNo
|
||||||
LEFT JOIN sys_unit changeUnit ON changeUnit.id = info.unitId
|
|
||||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||||
@@ -112,8 +111,7 @@ public class MemberBranchUnionAuditController {
|
|||||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||||
cnd.desc("info.applyDateTime");
|
cnd.desc("info.applyDateTime");
|
||||||
} else {
|
} else {
|
||||||
// 单位列按实际显示名称排序,其他字段保持原有排序规则。
|
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||||
cnd.orderBy("unitName".equals(pageForm.getPageOrderName()) ? "unitName" : "info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
|
||||||
}
|
}
|
||||||
cnd.groupBy("t.id");
|
cnd.groupBy("t.id");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
|
|||||||
+1
-2
@@ -72,7 +72,6 @@ public class MemberChangeApplyController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("保存申请")
|
@ApiOperation("保存申请")
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
@SaCheckPermission("member.apply.submit")
|
@SaCheckPermission("member.apply.submit")
|
||||||
@SLog(tag = "会员变更申请", msg = "保存申请,申请人: ${args[0].username}")
|
@SLog(tag = "会员变更申请", msg = "保存申请,申请人: ${args[0].username}")
|
||||||
public Result save(@Param("data") MemberChangeRecord memberChangeRecord) {
|
public Result save(@Param("data") MemberChangeRecord memberChangeRecord) {
|
||||||
@@ -148,7 +147,7 @@ public class MemberChangeApplyController {
|
|||||||
@ApiModelProperty("根据id查询变更记录")
|
@ApiModelProperty("根据id查询变更记录")
|
||||||
@SaCheckPermission("member.change.apply")
|
@SaCheckPermission("member.change.apply")
|
||||||
public Result findChangeById(String id){
|
public Result findChangeById(String id){
|
||||||
return Result.success().addData(memberCommonService.findChangeRecordWithUnitName(id));
|
return Result.success().addData(dao.fetch(MemberChangeRecord.class, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-5
@@ -76,7 +76,7 @@ public class MemberChangeMineController {
|
|||||||
info.username,
|
info.username,
|
||||||
info.loginname,
|
info.loginname,
|
||||||
info.sex,
|
info.sex,
|
||||||
COALESCE(changeUnit.name, info.unitName) AS unitName,
|
info.unitName,
|
||||||
info.unionName,
|
info.unionName,
|
||||||
info.userState,
|
info.userState,
|
||||||
info.preparedBy,
|
info.preparedBy,
|
||||||
@@ -103,7 +103,6 @@ public class MemberChangeMineController {
|
|||||||
member_change_record info
|
member_change_record info
|
||||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||||
LEFT JOIN sys_unit changeUnit ON changeUnit.id = info.unitId
|
|
||||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
@@ -125,8 +124,7 @@ public class MemberChangeMineController {
|
|||||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||||
cnd.desc("info.applyDateTime");
|
cnd.desc("info.applyDateTime");
|
||||||
} else {
|
} else {
|
||||||
// 单位列按实际显示名称排序,其他字段保持原有排序规则。
|
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||||
cnd.orderBy("unitName".equals(pageForm.getPageOrderName()) ? "unitName" : "info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
|
||||||
}
|
}
|
||||||
cnd.groupBy("t.id");
|
cnd.groupBy("t.id");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
@@ -168,7 +166,7 @@ public class MemberChangeMineController {
|
|||||||
@ApiOperation("根据id查询变更记录")
|
@ApiOperation("根据id查询变更记录")
|
||||||
@SaCheckPermission(value = {"member.change.mine", "member.change.unionGroup.audit"}, mode = SaMode.OR)
|
@SaCheckPermission(value = {"member.change.mine", "member.change.unionGroup.audit"}, mode = SaMode.OR)
|
||||||
public Result findMemberChangeRecord(String id){
|
public Result findMemberChangeRecord(String id){
|
||||||
MemberChangeRecord record = memberCommonService.findChangeRecordWithUnitName(id);
|
MemberChangeRecord record = dao.fetch(MemberChangeRecord.class, id);
|
||||||
NutMap nutMap = Lang.obj2nutmap(record);
|
NutMap nutMap = Lang.obj2nutmap(record);
|
||||||
|
|
||||||
// 变更记录只保存三级单位 ID,查看时补充当前单位名称供页面展示。
|
// 变更记录只保存三级单位 ID,查看时补充当前单位名称供页面展示。
|
||||||
|
|||||||
+2
-4
@@ -92,7 +92,7 @@ public class MemberSchoolUnionAuditController {
|
|||||||
info.sex,
|
info.sex,
|
||||||
info.userName,
|
info.userName,
|
||||||
info.loginName,
|
info.loginName,
|
||||||
COALESCE(changeUnit.name, info.unitName) AS unitName,
|
info.unitName,
|
||||||
info.unionName,
|
info.unionName,
|
||||||
info.userState,
|
info.userState,
|
||||||
info.preparedBy,
|
info.preparedBy,
|
||||||
@@ -119,7 +119,6 @@ public class MemberSchoolUnionAuditController {
|
|||||||
wf_process_task t
|
wf_process_task t
|
||||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||||
LEFT JOIN member_change_record info ON info.id = ins.businessNo
|
LEFT JOIN member_change_record info ON info.id = ins.businessNo
|
||||||
LEFT JOIN sys_unit changeUnit ON changeUnit.id = info.unitId
|
|
||||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||||
@@ -140,8 +139,7 @@ public class MemberSchoolUnionAuditController {
|
|||||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||||
cnd.desc("info.applyDateTime");
|
cnd.desc("info.applyDateTime");
|
||||||
} else {
|
} else {
|
||||||
// 单位列按实际显示名称排序,其他字段保持原有排序规则。
|
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||||
cnd.orderBy("unitName".equals(pageForm.getPageOrderName()) ? "unitName" : "info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
|
||||||
}
|
}
|
||||||
cnd.groupBy("t.id");
|
cnd.groupBy("t.id");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
|
|||||||
+2
-4
@@ -60,7 +60,7 @@ public class MemberUnionGroupAuditController {
|
|||||||
info.sex,
|
info.sex,
|
||||||
info.userName,
|
info.userName,
|
||||||
info.loginName,
|
info.loginName,
|
||||||
COALESCE(changeUnit.name, info.unitName) AS unitName,
|
info.unitName,
|
||||||
info.unionName,
|
info.unionName,
|
||||||
info.userState,
|
info.userState,
|
||||||
info.preparedBy,
|
info.preparedBy,
|
||||||
@@ -87,7 +87,6 @@ public class MemberUnionGroupAuditController {
|
|||||||
wf_process_task t
|
wf_process_task t
|
||||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||||
LEFT JOIN member_change_record info ON info.id = ins.businessNo
|
LEFT JOIN member_change_record info ON info.id = ins.businessNo
|
||||||
LEFT JOIN sys_unit changeUnit ON changeUnit.id = info.unitId
|
|
||||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||||
@@ -108,8 +107,7 @@ public class MemberUnionGroupAuditController {
|
|||||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||||
cnd.desc("info.applyDateTime");
|
cnd.desc("info.applyDateTime");
|
||||||
} else {
|
} else {
|
||||||
// 单位列按实际显示名称排序,其他字段保持原有排序规则。
|
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||||
cnd.orderBy("unitName".equals(pageForm.getPageOrderName()) ? "unitName" : "info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
|
||||||
}
|
}
|
||||||
cnd.groupBy("t.id");
|
cnd.groupBy("t.id");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
|
|||||||
+1
-3
@@ -7,7 +7,6 @@ import com.budwk.app.flow.engine.core.ServiceContext;
|
|||||||
import com.budwk.app.flow.entity.ProcessInstance;
|
import com.budwk.app.flow.entity.ProcessInstance;
|
||||||
import com.budwk.app.web.commons.base.Globals;
|
import com.budwk.app.web.commons.base.Globals;
|
||||||
import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
|
import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
|
||||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberApplyRecordService;
|
|
||||||
import org.nutz.dao.Chain;
|
import org.nutz.dao.Chain;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
@@ -36,8 +35,7 @@ public class MemberApplySaveInterceptor implements FlowInterceptor {
|
|||||||
MemberApplyRecord record = Json.fromJson(MemberApplyRecord.class, formDataStr);
|
MemberApplyRecord record = Json.fromJson(MemberApplyRecord.class, formDataStr);
|
||||||
|
|
||||||
Dao dao = ServiceContext.find(Dao.class);
|
Dao dao = ServiceContext.find(Dao.class);
|
||||||
// WF 保存同样经过日期校验,防止绕过普通申请接口写入无效日期。
|
dao.insertOrUpdate(record);
|
||||||
ServiceContext.find(MemberApplyRecordService.class).saveApplyRecord(record);
|
|
||||||
|
|
||||||
execution.getArgs().set(FlowConst.FORM_DATA, Json.toJson(record));
|
execution.getArgs().set(FlowConst.FORM_DATA, Json.toJson(record));
|
||||||
|
|
||||||
|
|||||||
-6
@@ -8,10 +8,4 @@ import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
|
|||||||
*/
|
*/
|
||||||
public interface MemberApplyRecordService extends BaseService<MemberApplyRecord> {
|
public interface MemberApplyRecordService extends BaseService<MemberApplyRecord> {
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验入职时间并保存入会申请,统一供保存、提交、重新提交及 WF 保存入口调用。
|
|
||||||
* @param record 申请数据,arrivalAtSchoolDate 可为空,非空时必须为有效的 yyyy-MM-dd 日期
|
|
||||||
* @return 无返回值;新增时记录 ID 回填到 record,非空日期非法时抛出业务异常
|
|
||||||
*/
|
|
||||||
void saveApplyRecord(MemberApplyRecord record);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,13 +44,6 @@ public interface MemberCommonService extends BaseService<Sys_user> {
|
|||||||
Pagination memberHistoryRecords(MemberManagePageForm pageForm);
|
Pagination memberHistoryRecords(MemberManagePageForm pageForm);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取变更申请并按申请单位 ID 校准显示名称,不写回历史记录。
|
|
||||||
* @param id 会员变更申请记录 ID
|
|
||||||
* @return 申请记录,unitName 对应本次申请的 unitId;单位不存在时保留原名称
|
|
||||||
*/
|
|
||||||
MemberChangeRecord findChangeRecordWithUnitName(String id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取可变更字段
|
* 获取可变更字段
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
-40
@@ -4,13 +4,6 @@ import com.budwk.app.base.service.impl.BaseServiceImpl;
|
|||||||
import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
|
import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
|
||||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberApplyRecordService;
|
import com.budwk.app.zhgh.staffmanage.member.service.MemberApplyRecordService;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
|
||||||
import org.nutz.ioc.aop.Aop;
|
|
||||||
import com.budwk.app.base.exception.BaseException;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.time.format.DateTimeParseException;
|
|
||||||
import java.time.format.ResolverStyle;
|
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
|
||||||
@IocBean(args = {"refer:dao"})
|
@IocBean(args = {"refer:dao"})
|
||||||
@@ -19,37 +12,4 @@ public class MemberApplyRecordServiceImpl extends BaseServiceImpl<MemberApplyRec
|
|||||||
public MemberApplyRecordServiceImpl(Dao dao) {
|
public MemberApplyRecordServiceImpl(Dao dao) {
|
||||||
super(dao);
|
super(dao);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 入职时间缺失时允许申请并存储为空;有值时拒绝 Invalid date 和不存在的日期。
|
|
||||||
* @param record 入会申请;arrivalAtSchoolDate 可为空或 yyyy-MM-dd,允许首尾空格
|
|
||||||
* @return 无返回值;不通过校验时不执行任何数据库写入
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
|
||||||
public void saveApplyRecord(MemberApplyRecord record) {
|
|
||||||
if (record == null) {
|
|
||||||
throw new BaseException("未获取到入会申请数据");
|
|
||||||
}
|
|
||||||
String value = record.getArrivalAtSchoolDate();
|
|
||||||
if (value == null || value.trim().isEmpty()) {
|
|
||||||
// 数据源未提供入职时间时保留为空,不阻止申请,也不填充虚构日期。
|
|
||||||
record.setArrivalAtSchoolDate(null);
|
|
||||||
} else {
|
|
||||||
value = value.trim();
|
|
||||||
if (!value.matches("[0-9]{4}-[0-9]{2}-[0-9]{2}")) {
|
|
||||||
throw new BaseException("入职时间格式无效,请先核实人员基础信息,日期格式应为yyyy-MM-dd");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
LocalDate date = LocalDate.parse(value,
|
|
||||||
DateTimeFormatter.ofPattern("uuuu-MM-dd").withResolverStyle(ResolverStyle.STRICT));
|
|
||||||
if (date.getYear() < 1) {
|
|
||||||
throw new BaseException("入职时间年份无效,请核实人员基础信息");
|
|
||||||
}
|
|
||||||
record.setArrivalAtSchoolDate(date.toString());
|
|
||||||
} catch (DateTimeParseException e) {
|
|
||||||
throw new BaseException("入职时间不是有效日期,请先核实人员基础信息");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dao().insertOrUpdate(record);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-4
@@ -547,10 +547,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
|||||||
// 获取系统用户
|
// 获取系统用户
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
List<Sys_user> dataUserList = dao().query(Sys_user.class, cnd);
|
List<Sys_user> dataUserList = dao().query(Sys_user.class, cnd);
|
||||||
// 无工号人员保留原有资料和会员身份,仅不参与本次按工号匹配,避免多个空工号导致 Map 键冲突。
|
Map<String, Sys_user> userMap = dataUserList.stream().collect(Collectors.toMap(Sys_user::getLoginname, v -> v));
|
||||||
Map<String, Sys_user> userMap = dataUserList.stream()
|
|
||||||
.filter(user -> StrUtil.isNotBlank(user.getLoginname()))
|
|
||||||
.collect(Collectors.toMap(Sys_user::getLoginname, v -> v));
|
|
||||||
|
|
||||||
List<Sys_unit> unitList = dao().query(Sys_unit.class, Cnd.where("unitTypeCode", "=", "1").groupBy("name"));
|
List<Sys_unit> unitList = dao().query(Sys_unit.class, Cnd.where("unitTypeCode", "=", "1").groupBy("name"));
|
||||||
|
|
||||||
|
|||||||
+4
-37
@@ -159,21 +159,20 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
|
|||||||
his.changeTypes,
|
his.changeTypes,
|
||||||
his.changeOrigin,
|
his.changeOrigin,
|
||||||
his.changeReason,
|
his.changeReason,
|
||||||
|
his.remark,
|
||||||
gh.`name` AS unionName,
|
gh.`name` AS unionName,
|
||||||
COALESCE(unit.name, changeRecord.unitName) AS unitName,
|
unit.`name` AS unitName,
|
||||||
u.id AS userId
|
u.id AS userId
|
||||||
FROM
|
FROM
|
||||||
`sys_user_history` his
|
`sys_user_history` his
|
||||||
LEFT JOIN sys_user u ON u.loginname = his.loginname
|
LEFT JOIN sys_user u ON u.loginname = his.loginname
|
||||||
LEFT JOIN member_change_record changeRecord ON changeRecord.id = his.recordId
|
LEFT JOIN sys_unit unit ON unit.id = u.unitid
|
||||||
LEFT JOIN sys_unit unit ON unit.id = COALESCE(NULLIF(changeRecord.unitId, ''), his.unitId)
|
|
||||||
LEFT JOIN sys_union gh ON gh.id = unit.unionId
|
LEFT JOIN sys_union gh ON gh.id = unit.unionId
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.andEX("gh.id", "=", pageForm.getUnionId());
|
cnd.andEX("gh.id", "=", pageForm.getUnionId());
|
||||||
// 优先使用本次变更目标单位;无关联申请时使用历史记录自身单位,筛选与显示一致。
|
cnd.andEX("his.unitId", "=", pageForm.getUnitId());
|
||||||
cnd.andEX("COALESCE(NULLIF(changeRecord.unitId, ''), his.unitId)", "=", pageForm.getUnitId());
|
|
||||||
cnd.andEX("his.personType", "=", pageForm.getPersonType());
|
cnd.andEX("his.personType", "=", pageForm.getPersonType());
|
||||||
cnd.andEX("his.userState", "=", pageForm.getUserState());
|
cnd.andEX("his.userState", "=", pageForm.getUserState());
|
||||||
// 变更记录查询自行拼接历史表条件,需要单独补充人员属性多选及旧单值兼容。
|
// 变更记录查询自行拼接历史表条件,需要单独补充人员属性多选及旧单值兼容。
|
||||||
@@ -252,8 +251,6 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<NutMap> getChangeInfos(MemberChangeRecord record) {
|
public List<NutMap> getChangeInfos(MemberChangeRecord record) {
|
||||||
// 普通提交、WF 保存拦截器和审核落库均先比较变更,在此统一校准申请单位名称。
|
|
||||||
normalizeChangeUnitName(record);
|
|
||||||
View_user info = dao().fetch(View_user.class, Cnd.where("id", "=", record.getUserId()));
|
View_user info = dao().fetch(View_user.class, Cnd.where("id", "=", record.getUserId()));
|
||||||
|
|
||||||
NutMap map = getDictAllowChangeFields();
|
NutMap map = getDictAllowChangeFields();
|
||||||
@@ -540,36 +537,6 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按申请 ID 读取详情并校准单位名称;仅修正返回对象,不改写历史记录。
|
|
||||||
* @param id 会员变更申请 ID
|
|
||||||
* @return 含一致 unitId、unitName 的申请记录;记录不存在时提示错误
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public MemberChangeRecord findChangeRecordWithUnitName(String id) {
|
|
||||||
MemberChangeRecord record = dao().fetch(MemberChangeRecord.class, id);
|
|
||||||
if (record == null) {
|
|
||||||
throw new BaseException("未找到会员变更申请记录");
|
|
||||||
}
|
|
||||||
normalizeChangeUnitName(record);
|
|
||||||
return record;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 名称以申请目标单位 ID 为准,避免前端残留原单位名称;不改变单位 ID 或所属工会。
|
|
||||||
* 单位已删除或未填写 ID 时保留原名称,避免用人员当前单位覆盖历史申请含义。
|
|
||||||
* @param record 待保存或待展示的申请对象,仅更新内存中的 unitName,不执行数据库更新
|
|
||||||
*/
|
|
||||||
private void normalizeChangeUnitName(MemberChangeRecord record) {
|
|
||||||
if (record == null || StrUtil.isBlank(record.getUnitId())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Sys_unit unit = dao().fetch(Sys_unit.class, record.getUnitId());
|
|
||||||
if (unit != null && unit.getName() != null) {
|
|
||||||
record.setUnitName(unit.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一规范变更记录中的到校日期,避免 Date 对象复制后以英文字符串形式参与比较或直接落库。
|
* 统一规范变更记录中的到校日期,避免 Date 对象复制后以英文字符串形式参与比较或直接落库。
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -735,7 +735,6 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
|
|||||||
entities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
entities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||||
entities.add(new ExcelExportEntity("所属工会", "welfareUnionName", 20));
|
entities.add(new ExcelExportEntity("所属工会", "welfareUnionName", 20));
|
||||||
entities.add(new ExcelExportEntity("所属单位", "welfareUnitName", 20));
|
entities.add(new ExcelExportEntity("所属单位", "welfareUnitName", 20));
|
||||||
entities.add(new ExcelExportEntity("三级单位", "threeUnitName", 20));
|
|
||||||
entities.add(new ExcelExportEntity("备注", "remark", 20));
|
entities.add(new ExcelExportEntity("备注", "remark", 20));
|
||||||
|
|
||||||
// 设置导出参数
|
// 设置导出参数
|
||||||
|
|||||||
@@ -1,207 +0,0 @@
|
|||||||
/* 首页服务门户布局单独限定作用域,避免影响应用中心和其他业务页。 */
|
|
||||||
#v4-home-app.home-portal {
|
|
||||||
width: 100%;
|
|
||||||
max-width: none;
|
|
||||||
margin: 0;
|
|
||||||
color: #20344d;
|
|
||||||
background: #f2f6fb;
|
|
||||||
font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
#v4-home-app.home-portal * { box-sizing: border-box; }
|
|
||||||
#v4-home-app .portal-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; max-width: 1720px; margin: auto; padding: 18px 24px 0; }
|
|
||||||
/* 使用完整不透明背景铺满横幅,会员信息独立成卡,不再覆盖校园景观。 */
|
|
||||||
#v4-home-app .portal-hero { position: relative; min-width: 0; min-height: 260px; overflow: hidden; border-radius: 12px; background: #e8f4ff; }
|
|
||||||
#v4-home-app .portal-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #e8f4ff 0%, #e8f4ff 28%, rgba(232,244,255,.92) 39%, rgba(232,244,255,.35) 54%, rgba(232,244,255,0) 68%); }
|
|
||||||
#v4-home-app .portal-hero-inner { position: relative; z-index: 1; display: flex; align-items: center; min-height: 260px; height: 100%; padding: 32px 40px; }
|
|
||||||
#v4-home-app .portal-hero-copy { max-width: 80%; }
|
|
||||||
#v4-home-app .portal-hero-eyebrow { margin-bottom: 12px; color: #527ca1; font-size: 14px; line-height: 22px; letter-spacing: 2px; }
|
|
||||||
#v4-home-app .portal-hero-copy h1 { margin: 0 0 10px; font-size: 36px; line-height: 1.3; font-weight: 700; color: #083765; }
|
|
||||||
#v4-home-app .portal-hero-copy p { margin: 0; color: #335675; font-size: 17px; line-height: 1.8; }
|
|
||||||
#v4-home-app .portal-values { display: flex; flex-wrap: wrap; gap: 22px 36px; margin-top: 24px; }
|
|
||||||
#v4-home-app .portal-values span { display: inline-flex; align-items: center; gap: 12px; }
|
|
||||||
#v4-home-app .portal-values i { color: #3599f2; font-size: 23px; }
|
|
||||||
/* 首次渲染时分层淡入文字,只改变透明度和位移,不影响卡片布局。 */
|
|
||||||
@keyframes portal-text-enter {
|
|
||||||
from { opacity: 0; transform: translateY(12px); }
|
|
||||||
to { opacity: 1; transform: translateY(0); }
|
|
||||||
}
|
|
||||||
#v4-home-app .portal-hero-eyebrow,
|
|
||||||
#v4-home-app .portal-hero-copy h1,
|
|
||||||
#v4-home-app .portal-hero-copy p,
|
|
||||||
#v4-home-app .portal-values > span,
|
|
||||||
#v4-home-app .portal-member-date,
|
|
||||||
#v4-home-app .portal-member-heading,
|
|
||||||
#v4-home-app .portal-member .meta-row { animation: portal-text-enter .6s cubic-bezier(.22, 1, .36, 1) backwards; }
|
|
||||||
#v4-home-app .portal-hero-copy h1 { animation-delay: .08s; }
|
|
||||||
#v4-home-app .portal-hero-copy p { animation-delay: .16s; }
|
|
||||||
#v4-home-app .portal-values > span:nth-child(1) { animation-delay: .24s; }
|
|
||||||
#v4-home-app .portal-values > span:nth-child(2) { animation-delay: .30s; }
|
|
||||||
#v4-home-app .portal-values > span:nth-child(3) { animation-delay: .36s; }
|
|
||||||
#v4-home-app .portal-values > span:nth-child(4) { animation-delay: .42s; }
|
|
||||||
#v4-home-app .portal-member-date { animation-delay: .10s; }
|
|
||||||
#v4-home-app .portal-member-heading { animation-delay: .18s; }
|
|
||||||
#v4-home-app .portal-member .meta-row:nth-child(1) { animation-delay: .26s; }
|
|
||||||
#v4-home-app .portal-member .meta-row:nth-child(2) { animation-delay: .34s; }
|
|
||||||
#v4-home-app .portal-member .meta-row:nth-child(3) { animation-delay: .42s; }
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
#v4-home-app .portal-hero-eyebrow,
|
|
||||||
#v4-home-app .portal-hero-copy h1,
|
|
||||||
#v4-home-app .portal-hero-copy p,
|
|
||||||
#v4-home-app .portal-values > span,
|
|
||||||
#v4-home-app .portal-member-date,
|
|
||||||
#v4-home-app .portal-member-heading,
|
|
||||||
#v4-home-app .portal-member .meta-row { animation: none; }
|
|
||||||
}
|
|
||||||
#v4-home-app .portal-content { max-width: 1720px; margin: auto; padding: 18px 24px 28px; }
|
|
||||||
/* 同行共用网格行高,统一横纵间距;待办使用紧凑两行信息,避免撑出大块留白。 */
|
|
||||||
#v4-home-app .portal-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; margin-top: 18px; align-items: stretch; }
|
|
||||||
#v4-home-app .portal-columns > * { min-width: 0; }
|
|
||||||
#v4-home-app .portal-news-wide { grid-column: 1 / -1; }
|
|
||||||
#v4-home-app .portal-panel,
|
|
||||||
#v4-home-app .entry-wrapper,
|
|
||||||
#v4-home-app .todo-center,
|
|
||||||
#v4-home-app .work-template-wrapper,
|
|
||||||
#v4-home-app .jcdt-container { background: #fff; border: 0; border-radius: 12px; padding: 20px; box-shadow: 0 3px 14px rgba(30, 66, 108, .035); }
|
|
||||||
#v4-home-app .home-section-header,
|
|
||||||
#v4-home-app .portal-todo-heading,
|
|
||||||
#v4-home-app .work-template-header,
|
|
||||||
#v4-home-app .portal-news-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 28px; margin: 0 0 16px; }
|
|
||||||
#v4-home-app .home-section-title,
|
|
||||||
#v4-home-app .work-template-title,
|
|
||||||
#v4-home-app .portal-news-title,
|
|
||||||
#v4-home-app .portal-todo-heading h3 { display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 0; border: 0; font-size: 20px; line-height: 1.4; font-weight: 600; color: #123356; }
|
|
||||||
#v4-home-app .home-section-title i,
|
|
||||||
#v4-home-app .work-template-title i,
|
|
||||||
#v4-home-app .portal-news-title > i:first-child,
|
|
||||||
#v4-home-app .portal-todo-heading i { color: #1687f5; font-size: 19px; }
|
|
||||||
#v4-home-app .portal-more { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; border: 0; padding: 4px 0; background: transparent; color: #1687f5; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
|
|
||||||
#v4-home-app .portal-more:hover { color: #0565c6; }
|
|
||||||
#v4-home-app button:focus-visible,
|
|
||||||
#v4-home-app a:focus-visible,
|
|
||||||
#v4-home-app [tabindex]:focus-visible { outline: 2px solid #1687f5; outline-offset: 3px; }
|
|
||||||
#v4-home-app .entry-card { min-width: 0; }
|
|
||||||
#v4-home-app .entry-wrapper { padding-bottom: 0; }
|
|
||||||
#v4-home-app .portal-entry-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e9eff6; }
|
|
||||||
#v4-home-app .portal-entry-tabs { display: flex; gap: 34px; }
|
|
||||||
#v4-home-app .portal-entry-tabs button { border: 0; border-bottom: 3px solid transparent; padding: 0 0 13px; background: transparent; font: inherit; font-size: 19px; color: #465d78; font-weight: 600; cursor: pointer; }
|
|
||||||
#v4-home-app .portal-entry-tabs button.active { color: #0784fa; border-bottom-color: #0784fa; }
|
|
||||||
#v4-home-app .entry-section + .entry-section { margin-top: 0; }
|
|
||||||
#v4-home-app .app-grid { display: flex; justify-content: flex-start; align-items: center; gap: 12px; min-height: 0; overflow-x: auto; padding: 20px 0; border: 0; border-radius: 0; box-shadow: none; }
|
|
||||||
#v4-home-app .app-item { flex: 0 0 96px; border: 0; font: inherit; padding: 0 4px; max-width: none; }
|
|
||||||
#v4-home-app .app-item:hover { background: #f4f9ff; box-shadow: none; transform: translateY(-2px); }
|
|
||||||
#v4-home-app .app-icon { background: transparent; }
|
|
||||||
#v4-home-app .app-name { display: block; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; line-height: 20px; min-height: 0; margin-top: 2px; }
|
|
||||||
#v4-home-app .app-empty { padding: 10px 0; }
|
|
||||||
#v4-home-app .act-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
|
|
||||||
#v4-home-app .activity-swiper-container { padding: 0 0 4px; }
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item { display: flex; flex-direction: column; height: 100%; }
|
|
||||||
/* 保留横向卡片比例,海报等比完整居中显示,比例不一致时以浅色背景补齐空白。 */
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item .img-box { flex-shrink: 0; height: auto; aspect-ratio: 1.5; border-radius: 10px; overflow: hidden; clip-path: inset(0 round 10px); background: #f0f5fb; isolation: isolate; }
|
|
||||||
#v4-home-app .img-box .el-image { display: block; width: 100%; height: 100%; position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item .img-box img { height: 100% !important; max-height: none !important; object-fit: contain !important; object-position: center; border-radius: 10px; }
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item .img-box .status { top: 8px; left: 8px; border-radius: 5px; padding: 4px 7px; background: #ed4859; }
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item .img-box .status-ended { background: #8b97a7; }
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item .img-box .status-upcoming { background: #1687f5; }
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item h4 { flex: 1; margin: 10px 0 8px; height: auto; min-height: 22px; max-height: 44px; font-size: 15px; color: #20344d; line-height: 22px; }
|
|
||||||
#v4-home-app .activity-swiper .swiper-slide .item .time p { white-space: normal; font-size: 12px; color: #7b899d; line-height: 1.6; }
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-next,
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-prev { width: 44px; height: 44px; margin-top: 0; padding: 0; transform: translateY(-50%); border: 1px solid #dbeaff; background: rgba(255,255,255,.96); color: #1687f5; box-shadow: 0 3px 12px rgba(30, 66, 108, .18); }
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-next { right: 8px; }
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-prev { left: 8px; }
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-next:hover,
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-prev:hover { transform: translateY(-50%) scale(1.05); background: #1687f5; color: #fff; }
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-next::after,
|
|
||||||
#v4-home-app .activity-swiper-container .swiper-button-prev::after { font-size: 18px; font-weight: 600; }
|
|
||||||
#v4-home-app .portal-cover-empty { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; color: #94a7bd; background: #f0f5fb; }
|
|
||||||
#v4-home-app .portal-cover-empty i { font-size: 28px; }
|
|
||||||
#v4-home-app .user-wrapper { background: transparent; }
|
|
||||||
#v4-home-app .user-container { display: block; width: 100%; height: 100%; margin: 0; }
|
|
||||||
#v4-home-app .todo-center { display: flex; flex-direction: column; min-width: 0; height: 100%; }
|
|
||||||
#v4-home-app .todo-center .header { display: block; margin: 0; }
|
|
||||||
#v4-home-app .todo-center .el-tabs { margin: 0 0 8px; }
|
|
||||||
#v4-home-app .todo-center .el-tabs__header { margin: 0; }
|
|
||||||
#v4-home-app .todo-center .el-tabs__nav { display: flex; width: 100%; border-color: #e9eff6; border-radius: 6px 6px 0 0; }
|
|
||||||
#v4-home-app .todo-center .el-tabs__item { flex: 1; min-width: 0; padding: 0 7px; font-size: 12px; height: 36px; line-height: 36px; text-align: center; }
|
|
||||||
#v4-home-app .todo-center .el-tabs__item.is-active { border-bottom: 2px solid #1687f5; color: #1687f5; }
|
|
||||||
#v4-home-app .portal-task-list { display: flex; flex-direction: column; justify-content: space-evenly; flex: 1; min-height: 180px; }
|
|
||||||
#v4-home-app .portal-task-row { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid #eef3f8; }
|
|
||||||
#v4-home-app .portal-task-row:last-child { border-bottom: 0; }
|
|
||||||
#v4-home-app .portal-task-row:hover { background: #f7fbff; }
|
|
||||||
#v4-home-app .portal-task-icon { width: 34px; height: 40px; display: flex; flex: 0 0 34px; align-items: center; justify-content: center; border-radius: 8px; background: #eef7ff; color: #1687f5; font-size: 22px; }
|
|
||||||
#v4-home-app .portal-task-content { min-width: 0; flex: 1; }
|
|
||||||
#v4-home-app .portal-task-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #263548; font-weight: 600; font-size: 14px; line-height: 22px; }
|
|
||||||
#v4-home-app .portal-task-meta { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: #8390a2; line-height: 21px; }
|
|
||||||
#v4-home-app .portal-task-meta span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
||||||
#v4-home-app .portal-task-meta > span:first-child { max-width: 45%; flex-shrink: 0; }
|
|
||||||
#v4-home-app .portal-task-date { flex-shrink: 0; font-size: 12px; color: #7b899d; }
|
|
||||||
#v4-home-app .portal-task-node { flex: 1; min-width: 0; color: #8b98a9; font-size: 11px; line-height: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
||||||
#v4-home-app .portal-task-row .el-button { flex-shrink: 0; padding: 8px 14px; }
|
|
||||||
#v4-home-app .portal-task-pagination { text-align: right; margin-top: 8px; }
|
|
||||||
#v4-home-app .portal-empty { min-height: 132px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #8a9aac; }
|
|
||||||
#v4-home-app .portal-empty i { font-size: 26px; color: #83b9ee; }
|
|
||||||
#v4-home-app .work-template-wrapper { width: 100%; margin: 0; }
|
|
||||||
#v4-home-app .work-template-card { min-height: 98px; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
|
|
||||||
#v4-home-app .work-template-grid { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 4px 0 10px; scroll-snap-type: x proximity; }
|
|
||||||
#v4-home-app .work-template-item { flex: 0 0 88px; width: 88px; padding: 4px; border: 0; font: inherit; scroll-snap-align: start; }
|
|
||||||
#v4-home-app .work-template-item:hover { background: #f4f9ff; box-shadow: none; }
|
|
||||||
#v4-home-app .work-template-icon,
|
|
||||||
#v4-home-app .work-template-icon .el-image { width: 48px; height: 48px; }
|
|
||||||
#v4-home-app .work-template-icon img { width: 48px !important; height: 48px !important; object-fit: contain; }
|
|
||||||
#v4-home-app .work-template-icon i { font-size: 30px; line-height: 48px; color: #83b9ee; }
|
|
||||||
#v4-home-app .work-template-name { font-size: 13px !important; line-height: 20px; min-height: 40px; max-height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
||||||
#v4-home-app .work-template-wrapper .no-activity-placeholder { padding: 12px; }
|
|
||||||
#v4-home-app .jcdt-container { width: 100%; max-width: none; height: 100%; margin: 0; }
|
|
||||||
#v4-home-app .portal-news-title { background: transparent; cursor: pointer; font-family: inherit; }
|
|
||||||
#v4-home-app .portal-news-title > i:last-child:not(:first-child) { color: #8092a6; font-size: 14px; }
|
|
||||||
#v4-home-app .portal-news-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 0; border: 0; background: transparent; color: #42536a; font: inherit; text-align: left; cursor: pointer; }
|
|
||||||
#v4-home-app .portal-news-row time { flex-shrink: 0; padding: 3px 7px; background: #eff5fc; border-radius: 4px; color: #45698f; font-size: 13px; }
|
|
||||||
#v4-home-app .portal-news-row span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
||||||
#v4-home-app .portal-news-row:hover span { color: #1687f5; }
|
|
||||||
@media (min-width: 1600px) {
|
|
||||||
#v4-home-app .portal-hero-copy h1 { font-size: 42px; }
|
|
||||||
#v4-home-app .app-item { flex-basis: 104px; }
|
|
||||||
}
|
|
||||||
@media (max-width: 1199px) {
|
|
||||||
#v4-home-app .portal-top { grid-template-columns: minmax(0, 1fr) 300px; padding: 18px 18px 0; }
|
|
||||||
#v4-home-app .portal-hero-inner { padding-left: 32px; }
|
|
||||||
#v4-home-app .portal-content { padding: 18px 18px 24px; }
|
|
||||||
#v4-home-app .portal-columns { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
|
|
||||||
#v4-home-app .portal-values { gap: 16px; }
|
|
||||||
#v4-home-app .portal-panel, #v4-home-app .todo-center { padding: 16px; }
|
|
||||||
#v4-home-app .portal-task-row { gap: 8px; padding: 8px 0; }
|
|
||||||
#v4-home-app .portal-task-icon { display: none; }
|
|
||||||
}
|
|
||||||
@media (max-width: 900px) {
|
|
||||||
#v4-home-app .portal-top { grid-template-columns: minmax(0, 1fr); }
|
|
||||||
#v4-home-app .portal-columns { grid-template-columns: minmax(0, 1fr); }
|
|
||||||
#v4-home-app .portal-activities { order: 1; }
|
|
||||||
#v4-home-app .portal-todo { order: 2; }
|
|
||||||
#v4-home-app .portal-templates { order: 3; }
|
|
||||||
#v4-home-app .portal-news { order: 4; }
|
|
||||||
#v4-home-app .portal-hero-copy { max-width: 68%; }
|
|
||||||
#v4-home-app .portal-hero-copy h1 { font-size: 30px; }
|
|
||||||
#v4-home-app .portal-hero-copy p { font-size: 14px; }
|
|
||||||
#v4-home-app .portal-task-icon { display: flex; }
|
|
||||||
#v4-home-app .portal-task-meta { flex-wrap: nowrap; }
|
|
||||||
}
|
|
||||||
@media (max-width: 600px) {
|
|
||||||
#v4-home-app .portal-top { padding: 10px 10px 8px; }
|
|
||||||
#v4-home-app .portal-hero-inner { padding: 24px 20px; }
|
|
||||||
#v4-home-app .portal-hero-copy { max-width: 100%; }
|
|
||||||
#v4-home-app .portal-hero-copy h1 { font-size: 28px; }
|
|
||||||
#v4-home-app .portal-values { gap: 12px 18px; font-size: 12px; }
|
|
||||||
#v4-home-app .portal-values i { font-size: 17px; }
|
|
||||||
#v4-home-app .portal-content { padding: 10px; }
|
|
||||||
#v4-home-app .entry-wrapper { padding: 16px 12px 0; }
|
|
||||||
#v4-home-app .portal-entry-tabs { gap: 20px; }
|
|
||||||
#v4-home-app .portal-entry-tabs button { font-size: 16px; }
|
|
||||||
#v4-home-app .app-item { flex-basis: 84px; }
|
|
||||||
#v4-home-app .home-section-title, #v4-home-app .portal-todo-heading h3, #v4-home-app .work-template-title, #v4-home-app .portal-news-title { font-size: 18px; }
|
|
||||||
#v4-home-app .portal-task-row .el-button { padding: 8px 10px; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 使用参考项目本地横幅图片,文字遮罩保持首页的可读性。 */
|
|
||||||
#v4-home-app .portal-hero-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right bottom; }
|
|
||||||
/* 已展示全部活动时明确禁用入口,避免出现可点击但没有内容切换的按钮。 */
|
|
||||||
#v4-home-app .portal-more:disabled { color: #8a9aac; cursor: default; }
|
|
||||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB |
@@ -52,8 +52,6 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
init() {
|
init() {
|
||||||
this.signatureAddress = origin + "/platform/signature/scanPcCode?id=" + this.id
|
this.signatureAddress = origin + "/platform/signature/scanPcCode?id=" + this.id
|
||||||
// 打印当前二维码的签字入口,便于从控制台复制地址进行签字测试。
|
|
||||||
console.info("signatureAddress:", this.signatureAddress)
|
|
||||||
return this.$axios.post("/platform/signature/get")
|
return this.$axios.post("/platform/signature/get")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (this._isBeingDestroyed || this._isDestroyed) {
|
if (this._isBeingDestroyed || this._isDestroyed) {
|
||||||
|
|||||||
@@ -10,23 +10,22 @@ const act = {
|
|||||||
<div ref="activitySwiper" class="swiper activity-swiper">
|
<div ref="activitySwiper" class="swiper activity-swiper">
|
||||||
<div class="swiper-wrapper">
|
<div class="swiper-wrapper">
|
||||||
<div class="swiper-slide" v-for="(activity, index) in actList" :key="activity.id">
|
<div class="swiper-slide" v-for="(activity, index) in actList" :key="activity.id">
|
||||||
<div class="item" role="button" tabindex="0" @click="go(activity)" @keydown.enter="go(activity)" @keydown.space.prevent="go(activity)">
|
<div class="item" @click="go(activity)">
|
||||||
<div class="img-box">
|
<div class="img-box">
|
||||||
<el-image :src="activity.cover" fit="contain" :alt="activity.name">
|
<img :src="activity.cover || 'https://www.ncu.edu.cn/__local/8/52/2C/644986B4C9A030F7B65300178A6_8679CB08_18467.jpg'"
|
||||||
<div slot="error" class="portal-cover-empty"><i class="fa fa-picture-o" aria-hidden="true"></i><span>暂无图片</span></div>
|
alt="">
|
||||||
</el-image>
|
<span class="status">
|
||||||
<span class="status" :class="{'status-ended': getStatusText(activity) === '已结束', 'status-upcoming': getStatusText(activity) === '未开始'}">
|
|
||||||
{{getStatusText(activity)}}
|
{{getStatusText(activity)}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="title" :title="activity.name">
|
<h4 class="title">
|
||||||
{{ activity.name}}
|
{{ activity.name}}
|
||||||
</h4>
|
</h4>
|
||||||
<!--报名时间-->
|
<!--报名时间-->
|
||||||
<div class="time">
|
<div class="time">
|
||||||
<p :title="[activity.startDate, activity.endDate].filter(Boolean).join(' 至 ')">
|
<p>
|
||||||
<i class="fa fa-clock-o"></i>
|
<i class="fa fa-clock-o"></i>
|
||||||
{{ formatActivityDate(activity.startDate) }} 至 {{ formatActivityDate(activity.endDate) }}
|
时间:{{ activity.startDate }}至{{ activity.endDate }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -35,21 +34,20 @@ const act = {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 导航按钮 -->
|
<!-- 导航按钮 -->
|
||||||
<button type="button" ref="nextButton" class="swiper-button-next" aria-label="下一组活动"></button>
|
<div ref="nextButton" class="swiper-button-next"></div>
|
||||||
<button type="button" ref="prevButton" class="swiper-button-prev" aria-label="上一组活动"></button>
|
<div ref="prevButton" class="swiper-button-prev"></div>
|
||||||
|
|
||||||
<!-- 进度条 -->
|
<!-- 进度条 -->
|
||||||
<div ref="pagination" class="swiper-pagination"></div>
|
<div ref="pagination" class="swiper-pagination"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else class="no-activity-placeholder">
|
<div v-else class="no-activity-placeholder">
|
||||||
<div class="icon"><i class="fa fa-calendar" aria-hidden="true"></i></div>
|
<div class="icon">📅</div>
|
||||||
<p>暂无近期活动</p>
|
<p>暂无近期活动</p>
|
||||||
<p class="subtext">敬请关注后续通知</p>
|
<p class="subtext">敬请关注后续通知</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<slot></slot>
|
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
@@ -59,57 +57,19 @@ const act = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 轮播初始化或尺寸变化后,将左右箭头对齐当前封面的垂直中心。
|
/*查询活动*/
|
||||||
updateNavigationPosition() {
|
|
||||||
this.syncBrowseState()
|
|
||||||
const swiperElement = this.$refs.activitySwiper
|
|
||||||
const cover = swiperElement && swiperElement.querySelector('.img-box')
|
|
||||||
if (!cover) return
|
|
||||||
// 按实际封面高度定位,避免标题换行或响应式列数变化导致箭头偏移。
|
|
||||||
const container = swiperElement.parentElement
|
|
||||||
const top = cover.getBoundingClientRect().top - container.getBoundingClientRect().top + cover.offsetHeight / 2
|
|
||||||
;[this.$refs.prevButton, this.$refs.nextButton].forEach(button => {
|
|
||||||
if (button) button.style.top = top + 'px'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// value 为接口返回的活动日期;无日期时显示待定,避免展示 Invalid date。
|
|
||||||
formatActivityDate(value) {
|
|
||||||
return value ? this.$moment(value).format('YYYY-MM-DD') : '待定'
|
|
||||||
},
|
|
||||||
// 按轮播实际停靠点判断是否还有内容,尺寸改变后同步首页按钮文案和可用状态。
|
|
||||||
syncBrowseState() {
|
|
||||||
const enabled = !!(this.swiper && !this.swiper.destroyed && !this.swiper.isLocked && this.swiper.snapGrid.length > 1)
|
|
||||||
this.$emit('browse-state', {
|
|
||||||
enabled: enabled,
|
|
||||||
label: enabled ? '浏览更多' : (this.actList.length ? '已展示全部活动' : '暂无活动')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 点击前刷新尺寸,避免异步布局导致轮播状态过期;到末组后返回首组。
|
|
||||||
browseNext() {
|
|
||||||
if (!this.swiper || this.swiper.destroyed) this.initSwiper()
|
|
||||||
if (!this.swiper) return
|
|
||||||
this.swiper.update()
|
|
||||||
this.syncBrowseState()
|
|
||||||
if (this.swiper.isLocked || this.swiper.snapGrid.length <= 1) return
|
|
||||||
this.swiper.isEnd ? this.swiper.slideTo(0) : this.swiper.slideNext()
|
|
||||||
},
|
|
||||||
// 无请求参数;data 为当前用户可见且尚未结束的活动数组,保留本校筛选规则。
|
|
||||||
listAct() {
|
listAct() {
|
||||||
this.$axios.post("/platform/home/listHomeActivity").then((res) => {
|
this.$axios.post("/platform/home/listHomeActivity").then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
// for (let i = 0; i < 10; i++) {
|
// for (let i = 0; i < 10; i++) {
|
||||||
// this.actList = this.actList.concat(res.data)
|
// this.actList = this.actList.concat(res.data)
|
||||||
// }
|
// }
|
||||||
this.actList = res.data || []
|
this.actList = res.data
|
||||||
// 数据加载完成后初始化Swiper
|
// 数据加载完成后初始化Swiper
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.initSwiper()
|
this.initSwiper()
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
this.$emit('browse-state', {enabled: false, label: '活动加载失败'})
|
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
|
||||||
this.$emit('browse-state', {enabled: false, label: '活动加载失败'})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/*初始化Swiper*/
|
/*初始化Swiper*/
|
||||||
@@ -120,7 +80,6 @@ const act = {
|
|||||||
}
|
}
|
||||||
const swiperElement = this.$refs.activitySwiper
|
const swiperElement = this.$refs.activitySwiper
|
||||||
if (!swiperElement) {
|
if (!swiperElement) {
|
||||||
this.syncBrowseState()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 仅操作当前组件的轮播节点,避免页面其他轮播或尺寸观察器影响卡片宽度。
|
// 仅操作当前组件的轮播节点,避免页面其他轮播或尺寸观察器影响卡片宽度。
|
||||||
@@ -130,22 +89,13 @@ const act = {
|
|||||||
centeredSlides: false,
|
centeredSlides: false,
|
||||||
loop: false,
|
loop: false,
|
||||||
watchOverflow: true,
|
watchOverflow: true,
|
||||||
// 双栏中的活动按容器宽度排布,避免用整个窗口宽度挤出过多卡片。
|
|
||||||
breakpointsBase: 'container',
|
|
||||||
observer: false,
|
observer: false,
|
||||||
observeParents: false,
|
observeParents: false,
|
||||||
// 页面内容加载后可能出现滚动条,需重新计算列宽,避免末张封面及圆角被裁切。
|
resizeObserver: false,
|
||||||
resizeObserver: true,
|
|
||||||
roundLengths: true,
|
|
||||||
on: {
|
|
||||||
init: () => this.$nextTick(() => this.updateNavigationPosition()),
|
|
||||||
resize: () => this.$nextTick(() => this.updateNavigationPosition()),
|
|
||||||
slidesUpdated: () => this.$nextTick(() => this.updateNavigationPosition()),
|
|
||||||
},
|
|
||||||
// 鼠标停留在活动区域时可横向浏览,到首尾后释放页面滚动。
|
// 鼠标停留在活动区域时可横向浏览,到首尾后释放页面滚动。
|
||||||
mousewheel: {
|
mousewheel: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
forceToAxis: true,
|
forceToAxis: false,
|
||||||
releaseOnEdges: true,
|
releaseOnEdges: true,
|
||||||
sensitivity: 0.8,
|
sensitivity: 0.8,
|
||||||
},
|
},
|
||||||
@@ -158,15 +108,17 @@ const act = {
|
|||||||
type: 'progressbar',
|
type: 'progressbar',
|
||||||
},
|
},
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
480: {
|
768: {
|
||||||
slidesPerView: 2,
|
slidesPerView: 2,
|
||||||
},
|
},
|
||||||
740: {
|
1024: {
|
||||||
slidesPerView: 3,
|
slidesPerView: 4,
|
||||||
|
},
|
||||||
|
1200: {
|
||||||
|
slidesPerView: 5,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.syncBrowseState()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 活动状态
|
// 活动状态
|
||||||
@@ -356,9 +308,12 @@ const act = {
|
|||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
max-width: 100% !important;
|
max-width: 100% !important;
|
||||||
max-height: 128px !important;
|
max-height: 128px !important;
|
||||||
/* 活动海报含有文字,等比完整显示且悬停时不放大,避免内容被裁切。 */
|
object-fit: fill !important;
|
||||||
object-fit: contain !important;
|
transition: transform 0.3s ease;
|
||||||
object-position: center;
|
}
|
||||||
|
|
||||||
|
.activity-swiper .swiper-slide .item:hover .img-box img {
|
||||||
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-swiper .swiper-slide .item h4 {
|
.activity-swiper .swiper-slide .item h4 {
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
const entry = {
|
const entry = {
|
||||||
template: /*language=HTML*/ `
|
template: /*language=HTML*/ `
|
||||||
<div class="entry-wrapper">
|
<div class="entry-wrapper">
|
||||||
<div class="portal-entry-header">
|
<div :class="['entry-section', 'entry-section-' + section.key]" v-for="section in entrySections" :key="section.key">
|
||||||
<div class="portal-entry-tabs" role="tablist" aria-label="推荐入口">
|
<div class="entry-section-header">
|
||||||
<button v-for="section in entrySections" :key="section.key"
|
<div class="entry-section-title">
|
||||||
type="button" role="tab" :aria-selected="activeSection === section.key"
|
<i :class="section.icon"></i>
|
||||||
:class="{active: activeSection === section.key}" @click="switchSection(section.key)">{{ section.title }}</button>
|
<span>{{ section.title }}</span>
|
||||||
|
<em>/Applications</em>
|
||||||
</div>
|
</div>
|
||||||
<a class="portal-more" href="/platform/v4/apps">全部应用 <i class="fa fa-arrow-right" aria-hidden="true"></i></a>
|
|
||||||
</div>
|
</div>
|
||||||
<div :class="['entry-section', 'entry-section-' + section.key]" v-for="section in entrySections" :key="section.key" v-show="activeSection === section.key" role="tabpanel">
|
|
||||||
|
|
||||||
<div class="apps-container">
|
<div class="apps-container">
|
||||||
<div class="app-grid" tabindex="0" :aria-label="section.title + ',可横向滚动浏览'">
|
<div class="app-grid">
|
||||||
<button type="button" class="app-item"
|
<div class="app-item"
|
||||||
v-for="(item, index) in section.list"
|
v-for="(item, index) in section.list"
|
||||||
:key="item.id || index"
|
:key="item.id || index"
|
||||||
@click="openService(item, section.key)">
|
@click="openService(item, section.key)">
|
||||||
@@ -21,8 +20,8 @@ const entry = {
|
|||||||
<img v-if="item.picIcon" class="app-icon-img" :src="item.picIcon" alt="" />
|
<img v-if="item.picIcon" class="app-icon-img" :src="item.picIcon" alt="" />
|
||||||
<i v-else class="fa fa-cube app-icon-fallback"></i>
|
<i v-else class="fa fa-cube app-icon-fallback"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="app-name" :title="item.name">{{ item.name }}</div>
|
<div class="app-name">{{ item.name }}</div>
|
||||||
</button>
|
</div>
|
||||||
<el-empty class="app-empty"
|
<el-empty class="app-empty"
|
||||||
v-if="!section.list || section.list.length === 0"
|
v-if="!section.list || section.list.length === 0"
|
||||||
description="暂无数据"
|
description="暂无数据"
|
||||||
@@ -31,12 +30,10 @@ const entry = {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot></slot>
|
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeSection: 'serv',
|
|
||||||
hasMore: true,
|
hasMore: true,
|
||||||
entries: {
|
entries: {
|
||||||
serv: [],
|
serv: [],
|
||||||
@@ -60,12 +57,8 @@ const entry = {
|
|||||||
this.getFavorite()
|
this.getFavorite()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// sectionKey 为 serv(推荐服务)、app(推荐应用)或 fav(我的收藏);通过组件方法更新栏目,避免内联事件中 this 指向错误。
|
// 查询推荐服务
|
||||||
switchSection(sectionKey) {
|
async getRecommendService() {
|
||||||
this.$set(this, 'activeSection', sectionKey)
|
|
||||||
},
|
|
||||||
// platform 固定传 PC;Result.data 为当前用户有权限的推荐服务数组。
|
|
||||||
getRecommendService() {
|
|
||||||
this.$axios.post('/platform/home/listRecommendService', {platform: "PC"}).then(res => {
|
this.$axios.post('/platform/home/listRecommendService', {platform: "PC"}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.entries.serv = res.data
|
this.entries.serv = res.data
|
||||||
@@ -73,8 +66,8 @@ const entry = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// platform 固定传 PC;Result.data 为当前用户可进入的推荐应用数组。
|
// 获取推荐应用
|
||||||
getRecommendApp() {
|
async getRecommendApp() {
|
||||||
this.$axios.post('/platform/home/listRecommendApp', {platform: "PC"}).then(res => {
|
this.$axios.post('/platform/home/listRecommendApp', {platform: "PC"}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.entries.app = res.data
|
this.entries.app = res.data
|
||||||
@@ -82,8 +75,8 @@ const entry = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// platform 固定传 PC;Result.data 为当前用户收藏且有权限的菜单数组。
|
// 获取我的收藏
|
||||||
getFavorite() {
|
async getFavorite() {
|
||||||
this.$axios.post('/platform/home/listFavorite', {platform: "PC"}).then(res => {
|
this.$axios.post('/platform/home/listFavorite', {platform: "PC"}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.entries.fav = res.data
|
this.entries.fav = res.data
|
||||||
@@ -134,6 +127,11 @@ const entry = {
|
|||||||
margin-top: 22px;
|
margin-top: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 临时屏蔽“我的收藏”分组,保留原节点和数据逻辑便于恢复 */
|
||||||
|
.entry-section-fav {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.entry-section-header {
|
.entry-section-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -118,65 +118,42 @@ layout("/layouts/v4/baseLayout.html"){
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="${base!}/assets/platform/css/home-portal.css?v=20261030-1" />
|
<div class="v4-container" id="v4-home-app">
|
||||||
|
|
||||||
<!-- 登录资料仅在 HTML 属性中输出并转义;放在 Vue 挂载区域外,避免名称被当作模板表达式解析。 -->
|
|
||||||
<div id="v4-home-profile-data" hidden
|
|
||||||
data-username="${@auth.getPrincipalProperty('username'),escape}"
|
|
||||||
data-loginname="${@auth.getPrincipalProperty('loginname'),escape}"
|
|
||||||
<!--#if(!isEmpty(@auth.getPrincipalProperty('unit'))){#-->
|
|
||||||
data-unit-name="${@auth.getPrincipalProperty('unit').getName(),escape}"
|
|
||||||
<!--#}#-->
|
|
||||||
<!--#if(!isEmpty(@auth.getPrincipalProperty('union'))){#-->
|
|
||||||
data-union-name="${@auth.getPrincipalProperty('union').getName(),escape}"
|
|
||||||
<!--#}#-->
|
|
||||||
></div>
|
|
||||||
|
|
||||||
<div class="v4-container home-portal" id="v4-home-app">
|
|
||||||
<!-- 首页banner -->
|
<!-- 首页banner -->
|
||||||
<div class="portal-top">
|
<div class="section-banner">
|
||||||
<div class="portal-hero">
|
<div class="banner-img">
|
||||||
<!-- 使用参考项目的本地背景资源,保留横幅文字及渐变遮罩。 -->
|
<img :src="homeBannerList[0] || ''" alt=""/>
|
||||||
<img class="portal-hero-background" src="${base!}/assets/platform/img/home/service-portal-banner-campus-v4.png" alt="" />
|
<stats></stats>
|
||||||
<div class="portal-hero-inner">
|
|
||||||
<div class="portal-hero-copy">
|
|
||||||
<div class="portal-hero-eyebrow">教职工一站式服务平台</div>
|
|
||||||
<h1>智慧工会系统</h1>
|
|
||||||
<p>情系教职工,服务零距离</p>
|
|
||||||
<div class="portal-values">
|
|
||||||
<span><i class="fa fa-heart" aria-hidden="true"></i>服务职工</span>
|
|
||||||
<span><i class="fa fa-users" aria-hidden="true"></i>凝聚职工</span>
|
|
||||||
<span><i class="fa fa-leaf" aria-hidden="true"></i>关爱职工</span>
|
|
||||||
<span><i class="fa fa-file-text" aria-hidden="true"></i>助力发展</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<user class="portal-member" :profile-only="true" :profile="memberProfile"></user>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="portal-content">
|
<div class="" style="padding-bottom: 20px">
|
||||||
|
<user></user>
|
||||||
|
|
||||||
|
<div class="home-grid">
|
||||||
<div class="entry-card">
|
<div class="entry-card">
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="portal-columns">
|
<div class="home-grid">
|
||||||
<div class="home-section portal-panel portal-activities">
|
<div class="home-section">
|
||||||
<div class="home-section-header">
|
<div class="home-section-header">
|
||||||
<div class="home-section-title">
|
<div class="home-section-title">
|
||||||
<i class="fa fa-calendar"></i>
|
<i class="fa fa-calendar"></i>
|
||||||
<span>最新活动</span>
|
<span>最新活动</span>
|
||||||
|
<em>/Activities</em>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="portal-more" :disabled="!activityBrowse.enabled" @click="$refs.homeActivities.browseNext()">{{ activityBrowse.label }} <i v-if="activityBrowse.enabled" class="fa fa-arrow-right" aria-hidden="true"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="act-card">
|
<div class="act-card">
|
||||||
<act ref="homeActivities" @browse-state="updateActivityBrowse"></act>
|
<act></act>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<user ref="homeTodo" class="portal-todo"></user>
|
|
||||||
<work-template class="portal-templates" v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN'])"></work-template>
|
|
||||||
<jcdt class="portal-news" :class="{'portal-news-wide': !$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN'])}" :list="websiteNews"></jcdt>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<work-template v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN'])"></work-template>
|
||||||
|
|
||||||
|
<jcdt :list="websiteNews"></jcdt>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -193,17 +170,9 @@ layout("/layouts/v4/baseLayout.html"){
|
|||||||
new Vue({
|
new Vue({
|
||||||
el: '#v4-home-app',
|
el: '#v4-home-app',
|
||||||
data(){
|
data(){
|
||||||
// 浏览器读取属性时还原 HTML 转义;未配置单位或工会时使用空字符串,不访问空对象。
|
|
||||||
const profileData = document.getElementById('v4-home-profile-data').dataset
|
|
||||||
return{
|
return{
|
||||||
memberProfile: {
|
|
||||||
username: profileData.username || '',
|
|
||||||
loginname: profileData.loginname || '',
|
|
||||||
unitName: profileData.unitName || '',
|
|
||||||
unionName: profileData.unionName || ''
|
|
||||||
},
|
|
||||||
websiteNews: [],
|
websiteNews: [],
|
||||||
activityBrowse: {enabled: false, label: '活动加载中'}
|
homeBannerList: "${config.AppHomeImg!}".split(",").map(item => item.trim()).filter(item => item)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -218,14 +187,10 @@ layout("/layouts/v4/baseLayout.html"){
|
|||||||
this.getWebSiteNews()
|
this.getWebSiteNews()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// state 由活动组件发布,enabled 表示可以翻页,label 说明加载或全部展示状态。
|
|
||||||
updateActivityBrowse(state) {
|
|
||||||
this.$set(this, 'activityBrowse', state)
|
|
||||||
},
|
|
||||||
getWebSiteNews(){
|
getWebSiteNews(){
|
||||||
this.$axios.post('/platform/home/getNews').then(res => {
|
this.$axios.post('/platform/home/getNews').then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$set(this, 'websiteNews', res.data || [])
|
this.websiteNews = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,72 +2,44 @@ const jcdt = {
|
|||||||
template: /*language=HTML*/ `
|
template: /*language=HTML*/ `
|
||||||
<div class="jcdt-wrapper">
|
<div class="jcdt-wrapper">
|
||||||
<div class="jcdt-container">
|
<div class="jcdt-container">
|
||||||
<div class="portal-news-header">
|
<el-carousel height="360px" :interval="10000" indicator-position="none">
|
||||||
<el-dropdown @command="selectSection" trigger="click">
|
<el-carousel-item v-for="item,index in list" :key="index">
|
||||||
<button type="button" class="portal-news-title"><i class="fa fa-bullhorn" aria-hidden="true"></i> {{ currentNews.label }} <i v-if="list.length > 1" class="fa fa-angle-down" aria-hidden="true"></i></button>
|
<div class="jcdt-title">
|
||||||
<el-dropdown-menu slot="dropdown">
|
<span>{{ item.label }}</span>
|
||||||
<el-dropdown-item v-for="(section, index) in list" :key="index" :command="index">{{ section.label }}</el-dropdown-item>
|
</div>
|
||||||
</el-dropdown-menu>
|
<div class="jcdt-content">
|
||||||
</el-dropdown>
|
<div class="jcdt-list">
|
||||||
<div v-if="pageCount > 1" class="portal-news-pager" aria-label="动态分页">
|
<div class="jcdt-item" v-for="o,i in item.value" :key="i" @click="onLink(o)">
|
||||||
<span class="portal-news-count">共 {{ currentNews.value.length }} 条</span>
|
<div class="date" v-if="o.time">
|
||||||
<button type="button" :disabled="pageNumber === 1" title="上一页动态" aria-label="上一页动态" @click="changePage(-1)"><i class="fa fa-angle-left" aria-hidden="true"></i></button>
|
<i class="el-icon-alarm-clock"></i>
|
||||||
<span class="portal-news-page" aria-live="polite">{{ pageNumber }} / {{ pageCount }}</span>
|
<span>{{o.time}}</span>
|
||||||
<button type="button" :disabled="pageNumber === pageCount" title="下一页动态" aria-label="下一页动态" @click="changePage(1)"><i class="fa fa-angle-right" aria-hidden="true"></i></button>
|
</div>
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="title">{{o.text}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portal-news-list">
|
|
||||||
<button type="button" class="portal-news-row" v-for="(item, index) in visibleNews" :key="index" @click="onLink(item)">
|
|
||||||
<time v-if="item.time" :title="item.time">{{ item.time.slice(5) }}</time>
|
|
||||||
<span :title="item.text">{{ item.text }}</span>
|
|
||||||
</button>
|
|
||||||
<div v-if="!currentNews.value.length" class="portal-empty">暂无动态</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot></slot>
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
return {activeIndex: 0, pageNumber: 1, pageSize: 3}
|
return {}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: []
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
currentNews() {
|
|
||||||
// 默认遵循接口栏目顺序,不再按栏目名称优先选择。
|
|
||||||
const section = this.list[this.activeIndex] || this.list[0]
|
|
||||||
return section ? {label: section.label, value: section.value || []} : {label: '最新动态', value: []}
|
|
||||||
},
|
|
||||||
visibleNews() {
|
|
||||||
const start = (this.pageNumber - 1) * this.pageSize
|
|
||||||
return this.currentNews.value.slice(start, start + this.pageSize)
|
|
||||||
},
|
|
||||||
pageCount() {
|
|
||||||
return Math.max(1, Math.ceil(this.currentNews.value.length / this.pageSize))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
list() {
|
|
||||||
this.selectSection(0)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// step 为翻页方向(-1 上一页、1 下一页);在组件方法中更新页码,避免事件中的 this 指向错误。
|
|
||||||
changePage(step) {
|
|
||||||
const page = Math.max(1, Math.min(this.pageCount, this.pageNumber + step))
|
|
||||||
this.$set(this, 'pageNumber', page)
|
|
||||||
},
|
|
||||||
// index 为接口栏目数组下标;切换栏目时回到第一页,避免沿用上一栏的末页。
|
|
||||||
selectSection(index) {
|
|
||||||
this.activeIndex = index
|
|
||||||
this.pageNumber = 1
|
|
||||||
},
|
|
||||||
onLink(item) {
|
onLink(item) {
|
||||||
// 完整新闻地址直接打开,相对地址仍以重庆工贸工会网站为基准。
|
// 接口返回文章完整地址;相对地址按当前学校工会域名解析。
|
||||||
const url = this.isHttpOrHttps(item.href) ? item.href : new URL(item.href, "https://gh.cqgmy.edu.cn/").href
|
const url = this.isHttpOrHttps(item.href) ? item.href : new URL(item.href, "https://gh.cqgmy.edu.cn/").href
|
||||||
window.open(url)
|
window.open(url)
|
||||||
},
|
},
|
||||||
@@ -76,15 +48,6 @@ const jcdt = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
/* 每页固定三行,不因展开或末页条数变化撑高相邻的模板卡片。 */
|
|
||||||
#v4-home-app .portal-news-list { min-height: 132px; }
|
|
||||||
#v4-home-app .portal-news-list .portal-news-row { height: 44px; padding: 9px 0; }
|
|
||||||
#v4-home-app .portal-news-pager { display: flex; flex-shrink: 0; align-items: center; gap: 8px; }
|
|
||||||
#v4-home-app .portal-news-count { margin-right: 4px; color: #8a9aac; font-size: 12px; }
|
|
||||||
#v4-home-app .portal-news-page { min-width: 32px; color: #637b96; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
|
|
||||||
#v4-home-app .portal-news-pager button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid #e4edf7; border-radius: 6px; background: #fff; color: #1687f5; font-size: 18px; cursor: pointer; }
|
|
||||||
#v4-home-app .portal-news-pager button:hover:not(:disabled) { border-color: #b9d8fb; background: #f0f7ff; }
|
|
||||||
#v4-home-app .portal-news-pager button:disabled { border-color: #eef2f7; background: #f8fafc; color: #c3cedb; cursor: default; }
|
|
||||||
.jcdt-wrapper {
|
.jcdt-wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|||||||
@@ -5,22 +5,21 @@ const workTemplate = {
|
|||||||
<div class="work-template-title">
|
<div class="work-template-title">
|
||||||
<i class="fa fa-clipboard"></i>
|
<i class="fa fa-clipboard"></i>
|
||||||
<span>工作模板</span>
|
<span>工作模板</span>
|
||||||
|
<em>/Templates</em>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="portal-more" @click="browseTemplates">更多模板 <i class="fa fa-arrow-right" aria-hidden="true"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="work-template-card">
|
<div class="work-template-card">
|
||||||
<div ref="templateGrid" v-if="templateList && templateList.length > 0" class="work-template-grid">
|
<div v-if="templateList && templateList.length > 0" class="work-template-grid">
|
||||||
<button type="button" class="work-template-item"
|
<div class="work-template-item"
|
||||||
v-for="template in templateList"
|
v-for="template in templateList"
|
||||||
:key="template.id"
|
:key="template.id"
|
||||||
@click="go(template)">
|
@click="go(template)">
|
||||||
<div class="work-template-icon">
|
<div class="work-template-icon">
|
||||||
<el-image :src="template.templateIcon || template.cover" fit="contain">
|
<img :src="template.templateIcon || template.cover || 'https://www.ncu.edu.cn/__local/8/52/2C/644986B4C9A030F7B65300178A6_8679CB08_18467.jpg'"
|
||||||
<i slot="error" class="fa fa-clipboard" aria-hidden="true"></i>
|
alt="">
|
||||||
</el-image>
|
</div>
|
||||||
|
<div class="work-template-name">{{ template.templateName || template.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="work-template-name" :title="template.templateName || template.name">{{ template.templateName || template.name }}</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else class="no-activity-placeholder">
|
<div v-else class="no-activity-placeholder">
|
||||||
@@ -29,7 +28,6 @@ const workTemplate = {
|
|||||||
<p class="subtext">敬请关注后续更新</p>
|
<p class="subtext">敬请关注后续更新</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot></slot>
|
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
@@ -38,15 +36,6 @@ const workTemplate = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 每次滚动一屏模板,到末尾后回到开头;无模板时不执行。
|
|
||||||
browseTemplates() {
|
|
||||||
const grid = this.$refs.templateGrid
|
|
||||||
if (!grid) return
|
|
||||||
// 模板仍使用全部真实数据,横向翻页不截断管理员可用的入口。
|
|
||||||
const atEnd = grid.scrollLeft + grid.clientWidth >= grid.scrollWidth - 2
|
|
||||||
grid.scrollTo({left: atEnd ? 0 : grid.scrollLeft + grid.clientWidth, behavior: 'smooth'})
|
|
||||||
},
|
|
||||||
// 无请求参数;Result.data 为当前管理员可用的工作模板数组。
|
|
||||||
listTemplate() {
|
listTemplate() {
|
||||||
this.$axios.post("/platform/home/listHomeTemplate").then((res) => {
|
this.$axios.post("/platform/home/listHomeTemplate").then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
|
|||||||
@@ -4,37 +4,40 @@ const user = {
|
|||||||
<!-- 用户容器:左右布局 -->
|
<!-- 用户容器:左右布局 -->
|
||||||
<div class="user-container">
|
<div class="user-container">
|
||||||
<!-- 左侧:用户信息卡片 -->
|
<!-- 左侧:用户信息卡片 -->
|
||||||
<div v-if="profileOnly" class="user-info-card">
|
<div class="user-info-card">
|
||||||
<div class="portal-member-date"><i class="fa fa-calendar-o" aria-hidden="true"></i>{{ $moment().format('YYYY年MM月DD日') }} {{ ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'][$moment().day()] }}</div>
|
|
||||||
<div class="user-details">
|
<div class="user-details">
|
||||||
<div class="portal-member-heading">
|
<div class="user-name">${@auth.getPrincipalProperty('username')}</div>
|
||||||
<span class="portal-member-avatar"><i class="fa fa-user" aria-hidden="true"></i></span>
|
|
||||||
<div><div class="portal-member-welcome">欢迎回来</div><div class="user-name">{{ profile.username }}</div></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="user-meta-grid">
|
<div class="user-meta-grid">
|
||||||
<div class="meta-row">
|
<div class="meta-row">
|
||||||
<span class="meta-icon"><i class="fa fa-id-card-o" aria-hidden="true"></i></span>
|
<span class="meta-icon">🆔</span>
|
||||||
<div>
|
<div>
|
||||||
<span class="meta-label">工号</span>
|
<span class="meta-label">工号</span>
|
||||||
<span class="meta-value">{{ profile.loginname }}</span>
|
<span class="meta-value">${@auth.getPrincipalProperty('loginname')}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="meta-row">
|
<div class="meta-row">
|
||||||
<span class="meta-icon"><i class="fa fa-building-o" aria-hidden="true"></i></span>
|
<span class="meta-icon">🏢</span>
|
||||||
<div>
|
<div>
|
||||||
<span class="meta-label">单位信息</span>
|
<span class="meta-label">单位信息</span>
|
||||||
<span class="meta-value">
|
<span class="meta-value">
|
||||||
{{ profile.unitName }} ({{ profile.unionName }})
|
<!--#if(!isEmpty(@auth.getPrincipalProperty('unit'))){#-->
|
||||||
|
${@auth.getPrincipalProperty('unit').getName()}
|
||||||
|
<!--#}#-->
|
||||||
|
(
|
||||||
|
<!--#if(!isEmpty(@auth.getPrincipalProperty('union'))){#-->
|
||||||
|
${@auth.getPrincipalProperty('union').getName()}
|
||||||
|
<!--#}#-->
|
||||||
|
)
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="meta-row meta-row-roles">
|
<div class="meta-row">
|
||||||
<span class="meta-icon"><i class="fa fa-shield" aria-hidden="true"></i></span>
|
<span class="meta-icon">🎭</span>
|
||||||
<div>
|
<div>
|
||||||
<span class="meta-label">角色</span>
|
<span class="meta-label">角色</span>
|
||||||
<div class="portal-member-roles" tabindex="0" role="region" aria-label="角色列表,可滚动查看全部角色"><span v-for="(role, index) in roleTags" :key="index" class="portal-member-role">{{ role }}</span><span v-if="!roleTags.length" class="meta-value">—</span></div>
|
<span class="meta-value">{{ roleNames || '—' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,13 +63,10 @@ const user = {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 右侧:待办中心 -->
|
<!-- 右侧:待办中心 -->
|
||||||
<div v-if="!profileOnly" class="todo-center">
|
<div class="todo-center">
|
||||||
<!-- 标题和标签 -->
|
<!-- 标题和标签 -->
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="portal-todo-heading">
|
<h3>待办中心</h3>
|
||||||
<h3><i class="fa fa-list-ul" aria-hidden="true"></i> 待办中心</h3>
|
|
||||||
<a class="portal-more" :href="'/flow/todoCenter?status=' + activeTab" target="_blank">全部待办 <i class="fa fa-arrow-right" aria-hidden="true"></i></a>
|
|
||||||
</div>
|
|
||||||
<el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
|
<el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
|
||||||
<el-tab-pane :label="tabLabel('待办事宜', taskStats.todoCount)" name="todo"></el-tab-pane>
|
<el-tab-pane :label="tabLabel('待办事宜', taskStats.todoCount)" name="todo"></el-tab-pane>
|
||||||
<el-tab-pane :label="tabLabel('已办事宜', taskStats.doneCount)" name="done"></el-tab-pane>
|
<el-tab-pane :label="tabLabel('已办事宜', taskStats.doneCount)" name="done"></el-tab-pane>
|
||||||
@@ -75,44 +75,55 @@ const user = {
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="portal-task-list" v-loading="tableLoading">
|
<!-- 表格 -->
|
||||||
<div class="portal-task-row" v-for="(task, index) in tableData" :key="task.taskId || task.instanceId || index">
|
<el-table
|
||||||
<i class="fa fa-file-text-o portal-task-icon" aria-hidden="true"></i>
|
:data="todoList"
|
||||||
<div class="portal-task-content">
|
style="width: 100%"
|
||||||
<div class="portal-task-title" :title="task.instanceName">{{ task.instanceName }}</div>
|
border
|
||||||
<div class="portal-task-meta">
|
stripe
|
||||||
<span :title="task.variable && task.variable.initiatorName">申请人:{{ (task.variable && task.variable.initiatorName) || '—' }}</span>
|
v-loading="loading"
|
||||||
<span class="portal-task-node" :title="[task.categoryName, task.taskName].filter(Boolean).join(' · ')">{{ [task.categoryName, task.taskName].filter(Boolean).join(' · ') }}</span>
|
:cell-style="{ padding: '8px' }"
|
||||||
</div>
|
:header-cell-style="{ background: '#f8f9fa', color: '#444', fontWeight: '500' }"
|
||||||
</div>
|
>
|
||||||
<time class="portal-task-date">{{ task.createdAt ? $moment(task.createdAt).format('YYYY-MM-DD') : '—' }}</time>
|
<el-table-column label="序号" type="index" :index="indexMethod" width="100px"></el-table-column>
|
||||||
<el-button type="primary" size="mini" @click="openView(task)">查看</el-button>
|
<el-table-column prop="categoryName" label="流程分类" width="100"></el-table-column>
|
||||||
</div>
|
<el-table-column prop="title" label="流程名称" min-width="300">
|
||||||
<div v-if="!tableLoading && !tableData.length" class="portal-empty"><i class="fa fa-check-circle-o" aria-hidden="true"></i><span>暂无{{ activeTab === 'todo' ? '待办事项' : '相关记录' }}</span></div>
|
<template slot-scope="scope">
|
||||||
<slot></slot>
|
<el-tooltip effect="dark" :content="scope.row.instanceName" placement="top">
|
||||||
</div>
|
<span class="table-title">{{ scope.row.instanceName }}</span>
|
||||||
<el-pagination v-if="pageForm.totalCount > pageForm.pageSize" class="portal-task-pagination"
|
</el-tooltip>
|
||||||
@current-change="pageNumberChange" :current-page="pageForm.pageNumber" :page-size="pageForm.pageSize"
|
</template>
|
||||||
layout="total, prev, next" :total="pageForm.totalCount"></el-pagination>
|
</el-table-column>
|
||||||
|
<el-table-column prop="sender" label="申请人" width="120">
|
||||||
|
<template slot-scope="{row}">{{row.variable.initiatorName}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="taskName" label="当前流程节点" width="140" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="date" label="发起日期" width="120">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
{{$moment(row.createdAt).format('YYYY-MM-DD')}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="100px" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="openView(scope.row)">查看</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
// 同一组件分别承载会员卡和待办卡,各自只加载需要的数据。
|
|
||||||
props: {
|
|
||||||
profileOnly: { type: Boolean, default: false },
|
|
||||||
// 首页传入显示资料:username 姓名、loginname 工号、unitName 单位、unionName 工会;缺项显示空文本。
|
|
||||||
profile: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({username: '', loginname: '', unitName: '', unionName: ''})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeTab: 'todo',
|
activeTab: 'todo',
|
||||||
|
todoList: [],
|
||||||
|
loading: false,
|
||||||
pageForm: {
|
pageForm: {
|
||||||
pageSize: 3
|
pageNum: 1,
|
||||||
|
pageSize: 5,
|
||||||
|
totalCount: 0
|
||||||
},
|
},
|
||||||
taskStats: {
|
taskStats: {
|
||||||
todoCount: 0,
|
todoCount: 0,
|
||||||
@@ -129,12 +140,6 @@ const user = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
roleTags() {
|
|
||||||
// 兼容角色接口已有的中英文分隔符,仅改变展示,不改变角色权限。
|
|
||||||
return String(this.roleNames || '').split(/[,,、;;]/).map(role => role.trim()).filter(Boolean)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
getWeatherInfo(iconCode, temp) {
|
getWeatherInfo(iconCode, temp) {
|
||||||
const info = {
|
const info = {
|
||||||
@@ -184,60 +189,91 @@ const user = {
|
|||||||
|
|
||||||
return info;
|
return info;
|
||||||
},
|
},
|
||||||
// key 为系统配置名称;返回 Promise,值为 Result.data 中的经度或纬度。
|
async getConfigKey(key) {
|
||||||
getConfigKey(key) {
|
const resp = await this.$axios.post("/open/common/getConfigKey", { key })
|
||||||
return this.$axios.post("/open/common/getConfigKey", {key}).then(res => res.data)
|
return resp.data
|
||||||
},
|
},
|
||||||
// 使用本校配置经纬度查询城市及天气,缺少配置时不请求外部天气接口。
|
// 🔆 获取天气
|
||||||
fetchWeather() {
|
async fetchWeather() {
|
||||||
Promise.all([this.getConfigKey("AppMapCenterPointX"), this.getConfigKey("AppMapCenterPointY")])
|
try {
|
||||||
.then(coordinates => {
|
// 存localStorage 112.13,32.01 广州 113.27,23.14
|
||||||
if (!coordinates[0] || !coordinates[1]) return
|
const AppMapCenterPointX = await this.getConfigKey("AppMapCenterPointX")
|
||||||
return this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/geo/v2/city/lookup?location=" + coordinates.join(",") + "&key=" + this.QWEATHER_KEY)
|
const AppMapCenterPointY = await this.getConfigKey("AppMapCenterPointY")
|
||||||
.then(geoRes => {
|
if (!AppMapCenterPointX || !AppMapCenterPointY){
|
||||||
if (geoRes.code !== '200' || !geoRes.location || !geoRes.location.length) {
|
return
|
||||||
throw new Error('城市未找到')
|
|
||||||
}
|
}
|
||||||
const city = geoRes.location[0]
|
|
||||||
return this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/v7/weather/now?location=" + city.id + "&key=" + this.QWEATHER_KEY)
|
// 1. 先通过城市名获取 locationId
|
||||||
.then(weatherRes => {
|
this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/geo/v2/city/lookup?location=" + AppMapCenterPointX + "," + AppMapCenterPointY + "&key=" + this.QWEATHER_KEY).then((geoRes) => {
|
||||||
if (weatherRes.code !== '200' || !weatherRes.now) throw new Error('天气数据异常')
|
if (geoRes.code !== '200' || !geoRes.location?.[0]) {
|
||||||
this.weatherData = Object.assign({}, this.getWeatherInfo(weatherRes.now.icon, weatherRes.now.temp), {
|
console.log('城市未找到')
|
||||||
temp: weatherRes.now.temp, text: weatherRes.now.text, name: city.name
|
}
|
||||||
|
const locationId = geoRes.location[0].id;
|
||||||
|
|
||||||
|
// 2. 获取当前天气
|
||||||
|
this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/v7/weather/now?location=" + locationId + "&key=" + this.QWEATHER_KEY).then((weatherRes) => {
|
||||||
|
if (weatherRes.code !== '200') {
|
||||||
|
console.warn('天气数据异常:', weatherRes);
|
||||||
|
}
|
||||||
|
const weatherInfo = this.getWeatherInfo(weatherRes.now.icon, weatherRes.now.temp);
|
||||||
|
this.weatherData = {
|
||||||
|
...weatherInfo,
|
||||||
|
temp: weatherRes.now.temp,
|
||||||
|
text: weatherRes.now.text,
|
||||||
|
name: geoRes.location[0].name
|
||||||
|
};
|
||||||
|
this.weatherError = false;
|
||||||
})
|
})
|
||||||
this.weatherError = false
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.weatherError = true
|
|
||||||
this.weatherData = null
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.warn('天气加载失败:', err);
|
||||||
|
this.weatherError = true;
|
||||||
|
this.weatherData = null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 获取任务列表
|
// 获取任务列表
|
||||||
tabLabel(title, count) {
|
tabLabel(title, count) {
|
||||||
return title + "(" + (count || 0) + ")"
|
return title + "(" + (count || 0) + ")"
|
||||||
},
|
},
|
||||||
// 无请求参数;data 的四个 Count 字段分别为当前用户各状态流程数量。
|
async getStatistics() {
|
||||||
getStatistics() {
|
try {
|
||||||
this.$axios.post("/flow/todoCenter/statistics").then(res => {
|
const res = await $.post("/flow/todoCenter/statistics")
|
||||||
if (res.code === 0) this.taskStats = Object.assign({}, this.taskStats, res.data)
|
if (res.code === 0) {
|
||||||
}).catch(() => {
|
this.taskStats = Object.assign({}, this.taskStats, res.data)
|
||||||
this.$message.error("获取待办统计失败")
|
}
|
||||||
})
|
} catch (error) {
|
||||||
|
console.error("获取待办统计失败:", error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getTasks() {
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
const res = await $.post("/flow/todoCenter/" + this.activeTab, this.pageForm)
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.todoList = res.data.list
|
||||||
|
this.pageForm.totalCount = res.data.totalCount
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error("获取任务列表失败")
|
||||||
|
console.error("获取任务列表失败:", error)
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// WF 状态由 activeTab 决定;pageForm 传分页参数,data.list/totalCount 为记录及总数。
|
|
||||||
// 列表加载和翻页由 initTableMixins 统一处理,首页只补充状态地址和数量统计。
|
|
||||||
pageData() {
|
pageData() {
|
||||||
this.pageDataUrl = "/flow/todoCenter/" + this.activeTab
|
this.getTasks()
|
||||||
initTableMixins.methods.pageData.call(this)
|
|
||||||
this.getStatistics()
|
this.getStatistics()
|
||||||
},
|
},
|
||||||
handleTabClick() {
|
handleTabClick(tab) {
|
||||||
this.doSearch()
|
this.pageData()
|
||||||
|
console.log('切换到:', tab.name);
|
||||||
},
|
},
|
||||||
// 处理任务
|
// 处理任务
|
||||||
openView(task) {
|
async openView(task) {
|
||||||
|
console.log(task)
|
||||||
const {taskId, taskKey, taskState, instanceId, businessNo, formKey} = task
|
const {taskId, taskKey, taskState, instanceId, businessNo, formKey} = task
|
||||||
if (!formKey) {
|
if (!formKey) {
|
||||||
this.$message.warning("当前流程没有配置地址")
|
this.$message.warning("当前流程没有配置地址")
|
||||||
@@ -245,9 +281,8 @@ const user = {
|
|||||||
}
|
}
|
||||||
window.open(formKey + "?taskId=" + taskId + "&bizId=" + businessNo + "&taskKey=" + taskKey + "&tab=" + this.activeTab)
|
window.open(formKey + "?taskId=" + taskId + "&bizId=" + businessNo + "&taskKey=" + taskKey + "&tab=" + this.activeTab)
|
||||||
},
|
},
|
||||||
// 无请求参数;Result.data.roleNames 为当前登录人的角色名称字符串。
|
|
||||||
getRoleNames() {
|
getRoleNames() {
|
||||||
this.$axios.post("/platform/sys/role/getRoleNames").then(res => {
|
$.post("/platform/sys/role/getRoleNames").then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.roleNames = res.data.roleNames
|
this.roleNames = res.data.roleNames
|
||||||
}
|
}
|
||||||
@@ -256,45 +291,13 @@ const user = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.profileOnly) {
|
|
||||||
this.getRoleNames()
|
|
||||||
} else {
|
|
||||||
this.pageData()
|
this.pageData()
|
||||||
}
|
this.getRoleNames()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.profileOnly) this.fetchWeather()
|
this.fetchWeather()
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
/* 会员卡样式随组件注入,确保与卡片结构同步加载,避免旧外链样式造成排版缺失。 */
|
|
||||||
#v4-home-app .portal-member { min-width: 0; }
|
|
||||||
#v4-home-app .portal-member .user-info-card { height: 100%; padding: 20px; gap: 14px; border: 1px solid #e3edf8; border-radius: 12px; background: linear-gradient(180deg, #f1f7ff 0, #fff 110px); box-shadow: 0 3px 14px rgba(30,66,108,.035); }
|
|
||||||
#v4-home-app .portal-member-date { display: flex; align-items: center; gap: 8px; color: #71839b; font-size: 12px; line-height: 20px; }
|
|
||||||
#v4-home-app .portal-member-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #eaf0f7; }
|
|
||||||
#v4-home-app .portal-member-heading > div { min-width: 0; }
|
|
||||||
#v4-home-app .portal-member-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 46px; height: 46px; border-radius: 50%; background: #e1eeff; color: #1687f5; font-size: 25px; }
|
|
||||||
#v4-home-app .portal-member-welcome { margin-bottom: 3px; color: #8797a9; font-size: 12px; line-height: 18px; }
|
|
||||||
#v4-home-app .portal-member .user-name { margin: 0; color: #163c61; text-align: left; font-size: 18px; line-height: 24px; overflow-wrap: anywhere; }
|
|
||||||
#v4-home-app .portal-member .user-meta-grid { gap: 12px; margin: 0; }
|
|
||||||
#v4-home-app .portal-member .meta-row { gap: 8px; }
|
|
||||||
#v4-home-app .portal-member .meta-icon { min-width: 18px; color: #81a4c9; font-size: 14px; }
|
|
||||||
#v4-home-app .portal-member .meta-row > div { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 8px; min-width: 0; }
|
|
||||||
#v4-home-app .portal-member .meta-label { margin: 0; color: #8995a5; font-size: 12px; line-height: 20px; }
|
|
||||||
#v4-home-app .portal-member .meta-value { color: #283c54; font-size: 12px; font-weight: 400; line-height: 20px; overflow-wrap: anywhere; }
|
|
||||||
#v4-home-app .portal-member .meta-row-roles > div { display: block; }
|
|
||||||
/* 角色最多占用三行标签的高度,超出时内部滚动,避免撑高首页横幅。 */
|
|
||||||
#v4-home-app .portal-member-roles { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; margin-top: 5px; max-height: 88px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #c5d9ee transparent; }
|
|
||||||
#v4-home-app .portal-member-roles::-webkit-scrollbar { width: 4px; }
|
|
||||||
#v4-home-app .portal-member-roles::-webkit-scrollbar-thumb { background: #c5d9ee; border-radius: 4px; }
|
|
||||||
#v4-home-app .portal-member-role { max-width: 100%; display: inline-block; padding: 3px 8px; border: 1px solid #e1ebf7; border-radius: 5px; background: #f3f7fc; color: #46617f; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
|
|
||||||
#v4-home-app .portal-member .weather-section { margin-top: auto; padding: 8px 10px; border-radius: 8px; background: #f0f7ff; color: #527494; }
|
|
||||||
#v4-home-app .portal-member .weather-header { gap: 6px; }
|
|
||||||
#v4-home-app .portal-member .weather-location,
|
|
||||||
#v4-home-app .portal-member .weather-text { font-size: 12px; }
|
|
||||||
#v4-home-app .portal-member .weather-emoji { font-size: 20px; }
|
|
||||||
#v4-home-app .portal-member .weather-temp { font-size: 18px; }
|
|
||||||
#v4-home-app .portal-member .weather-tip { margin-top: 4px; font-size: 11px; line-height: 18px; }
|
|
||||||
#v4-home-app .portal-member .weather-error { margin-top: auto; padding: 8px; font-size: 12px; }
|
|
||||||
.user-wrapper {
|
.user-wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
|
|||||||
@@ -155,13 +155,14 @@ layout("/layouts/platform.html"){
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="$refs.sortRef.onOpen()" size="medium" type="primary" icon="el-icon-sort">排序
|
<el-button @click="$refs.sortRef.onOpen()" size="medium" type="primary" icon="el-icon-sort">排序
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="$auth.hasPermission('sys.manager.role.user')" size="medium" type="primary"
|
|
||||||
icon="el-icon-user" :loading="memberRoleLoading" @click="doSettingMemberRole">
|
|
||||||
一键设置会员角色
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<!-- <div class="pull-right offscreen-right mt5 ml5">-->
|
||||||
|
<!-- <el-button size="medium" @click="doSettingMemberRole" type="primary"><i class="el-icon-s-tools"></i>-->
|
||||||
|
<!-- 一键设会员角色-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
<!-- <div class="pull-right offscreen-right mt5 ml5">-->
|
<!-- <div class="pull-right offscreen-right mt5 ml5">-->
|
||||||
<!-- <el-button size="medium" @click="doPublic" type="primary">一键设置公共角色</el-button>-->
|
<!-- <el-button size="medium" @click="doPublic" type="primary">一键设置公共角色</el-button>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
@@ -510,7 +511,6 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
memberRoleLoading: false,
|
|
||||||
addDialogVisible: false,
|
addDialogVisible: false,
|
||||||
editDialogVisible: false,
|
editDialogVisible: false,
|
||||||
roleDialogVisible: false,
|
roleDialogVisible: false,
|
||||||
@@ -689,30 +689,18 @@ layout("/layouts/platform.html"){
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
doSettingMemberRole() {
|
doSettingMemberRole() {
|
||||||
if (this.memberRoleLoading) {
|
this.$confirm("是否确定一键设置会员角色?", "提示", {
|
||||||
return
|
|
||||||
}
|
|
||||||
// 操作面向全部会员,忽略当前列表筛选;确认期间也锁定按钮,避免重复提交。
|
|
||||||
this.$set(this, "memberRoleLoading", true)
|
|
||||||
this.$confirm("确定为全部已标记为会员的人员设置会员角色吗?已有角色将保留。", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
return this.$axios.post("/platform/sys/role/doSettingMemberRole").then((res) => {
|
const {code, msg} = await this.$axios.post("/platform/sys/role/doSettingMemberRole")
|
||||||
if (res.code === 0) {
|
if (code === 0) {
|
||||||
this.$message.success("设置完成:新增 " + res.data.addedCount
|
this.$message.success(msg)
|
||||||
+ " 条,恢复启用 " + res.data.enabledCount + " 条会员角色关联")
|
|
||||||
this.pageData()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// 取消确认无需提示;请求异常由全局 axios 拦截器统一提示。
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.$set(this, "memberRoleLoading", false)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
formatAt(val) {
|
formatAt(val) {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-option v-for="item in organizationTypeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
<el-option v-for="item in organizationTypeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属工会" prop="unionId">
|
<el-form-item label="所属工会" prop="unionId" :required="formData.organizationType !== 'schoolUnion'">
|
||||||
<el-select v-model="formData.unionId" clearable filterable placeholder="请选择所属工会" style="width: 100%" :disabled="isUnionDisabled()">
|
<el-select v-model="formData.unionId" clearable filterable placeholder="请选择所属工会" style="width: 100%" :disabled="isUnionDisabled()">
|
||||||
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -255,7 +255,9 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const validatePeople = (rule, value, callback) => {
|
const validatePeople = (rule, value, callback) => {
|
||||||
if (!value || value <= 0) {
|
if (value === null || value === undefined || value === "") {
|
||||||
|
callback(new Error("必填"))
|
||||||
|
} else if (!value || value <= 0) {
|
||||||
callback(new Error("人数必须大于0"))
|
callback(new Error("人数必须大于0"))
|
||||||
} else if (this.batchForm.minGroupPeople && this.batchForm.maxGroupPeople
|
} else if (this.batchForm.minGroupPeople && this.batchForm.maxGroupPeople
|
||||||
&& this.batchForm.minGroupPeople > this.batchForm.maxGroupPeople) {
|
&& this.batchForm.minGroupPeople > this.batchForm.maxGroupPeople) {
|
||||||
@@ -317,15 +319,15 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
batchRules: {
|
batchRules: {
|
||||||
lineId: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
lineId: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
signupStartTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
signupStartTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
signupEndTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
signupEndTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
travelStartTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
travelStartTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
travelEndTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
travelEndTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
contactPhone: [{ validator: validateMobile, trigger: ["blur", "change"] }],
|
contactPhone: [{ required: true, validator: validateMobile, trigger: ["blur", "change"] }],
|
||||||
minGroupPeople: [{ validator: validatePeople, trigger: ["blur", "change"] }],
|
minGroupPeople: [{ required: true, validator: validatePeople, trigger: ["blur", "change"] }],
|
||||||
maxGroupPeople: [{ validator: validatePeople, trigger: ["blur", "change"] }],
|
maxGroupPeople: [{ required: true, validator: validatePeople, trigger: ["blur", "change"] }],
|
||||||
estimatedCost: [{ validator: validateMoney, trigger: ["blur", "change"] }]
|
estimatedCost: [{ required: true, validator: validateMoney, trigger: ["blur", "change"] }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="身份证号">
|
<el-form-item label="身份证号" prop="idCard" :rules="requiredRules" required>
|
||||||
<el-input v-model="signupForm.idCard" readonly></el-input>
|
<el-input v-model="signupForm.idCard" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -233,8 +233,8 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="手机号" required>
|
<el-form-item label="手机号" prop="mobile" :rules="mobileRules" required>
|
||||||
<el-input v-model="signupForm.mobile" maxlength="30" placeholder="请输入手机号"></el-input>
|
<el-input v-model="signupForm.mobile" maxlength="11" placeholder="请输入手机号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -325,17 +325,17 @@ layout("/layouts/platform.html"){
|
|||||||
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属姓名">
|
<el-form-item label="亲属姓名" prop="relativeName" :rules="requiredRules" required>
|
||||||
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="所在单位">
|
<el-form-item label="所在单位" prop="unitName" :rules="requiredRules" required>
|
||||||
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属关系">
|
<el-form-item label="亲属关系" prop="relationshipCode" :rules="requiredRules" required>
|
||||||
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
||||||
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -344,12 +344,12 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="线路名称">
|
<el-form-item label="线路名称" prop="lineName" :rules="requiredRules" required>
|
||||||
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行开始日期">
|
<el-form-item label="出行开始日期" prop="travelStartTime" :rules="requiredRules" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelStartTime"
|
v-model="directRelativeForm.travelStartTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -360,7 +360,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行结束日期">
|
<el-form-item label="出行结束日期" prop="travelEndTime" :rules="requiredRules" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelEndTime"
|
v-model="directRelativeForm.travelEndTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -379,34 +379,48 @@ layout("/layouts/platform.html"){
|
|||||||
<div class="tour-actions">
|
<div class="tour-actions">
|
||||||
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
<el-form :model="{ rows: familyData }" ref="familyForm" label-width="0">
|
||||||
|
<el-table class="tour-family-table" :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
||||||
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
||||||
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 家属姓名</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.familyName'" :rules="requiredRules">
|
||||||
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="性别" width="110" align="center" header-align="center">
|
<el-table-column label="性别" width="110" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 性别</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.gender'" :rules="requiredRules">
|
||||||
<el-select v-model="row.gender" clearable placeholder="请选择">
|
<el-select v-model="row.gender" clearable placeholder="请选择">
|
||||||
<el-option label="男" value="男"></el-option>
|
<el-option label="男" value="男"></el-option>
|
||||||
<el-option label="女" value="女"></el-option>
|
<el-option label="女" value="女"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.idCard'" :rules="[{ required: familyContactRequired(row), validator: validateFamilyIdCard, trigger: ['blur', 'change'] }]">
|
||||||
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.mobile'" :rules="[{ required: familyContactRequired(row), message: '必填', trigger: ['blur', 'change'] }]">
|
||||||
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 年龄</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.age'" :rules="requiredRules">
|
||||||
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
||||||
@@ -427,10 +441,13 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="关系" width="120" align="center" header-align="center">
|
<el-table-column label="关系" width="120" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 关系</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.relationship'" :rules="requiredRules">
|
||||||
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
||||||
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
||||||
@@ -439,6 +456,8 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div v-if="familyValidationAttempted && familyData.length === 0" class="el-form-item__error" style="position: static">必填</div>
|
||||||
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -520,6 +539,10 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
/* 覆盖全局表格 div 文字颜色,保留输入组件下方校验提示的红色。 */
|
||||||
|
.tour-family-table.el-table td.el-table__cell .el-form-item__error {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
.tour-section {
|
.tour-section {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
@@ -763,6 +786,12 @@ layout("/layouts/platform.html"){
|
|||||||
fillBedInfo: true,
|
fillBedInfo: true,
|
||||||
signupForm: {},
|
signupForm: {},
|
||||||
familyData: [],
|
familyData: [],
|
||||||
|
familyValidationAttempted: false,
|
||||||
|
requiredRules: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
|
mobileRules: [
|
||||||
|
{ required: true, message: "必填", trigger: ["blur", "change"] },
|
||||||
|
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的11位手机号", trigger: ["blur", "change"] }
|
||||||
|
],
|
||||||
bedTypeOptions: [],
|
bedTypeOptions: [],
|
||||||
familyRelationshipOptions: [],
|
familyRelationshipOptions: [],
|
||||||
directRelativeOptions: [],
|
directRelativeOptions: [],
|
||||||
@@ -1161,6 +1190,11 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = true
|
this.signupForm.hasFamily = true
|
||||||
}
|
}
|
||||||
this.signupVisible = true
|
this.signupVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
;[this.$refs.signupForm, this.$refs.directRelativeForm, this.$refs.familyForm].forEach(form => {
|
||||||
|
if (form) form.clearValidate()
|
||||||
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.msg || "查询失败")
|
this.$message.warning(res.msg || "查询失败")
|
||||||
}
|
}
|
||||||
@@ -1231,29 +1265,22 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = false
|
this.signupForm.hasFamily = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 家属表格按行校验,缺失项显示在对应输入组件下方。
|
||||||
validateFamilies() {
|
validateFamilies() {
|
||||||
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
||||||
if (this.familyData.length === 0) {
|
this.familyValidationAttempted = true
|
||||||
this.$message.warning("请添加亲属信息")
|
if (this.familyData.length === 0) return false
|
||||||
return false
|
return new Promise(resolve => this.$refs.familyForm.validate(valid => resolve(valid)))
|
||||||
|
},
|
||||||
|
// 未满16岁的家属允许不填身份证,已填写时仍检查格式。
|
||||||
|
validateFamilyIdCard(rule, value, callback) {
|
||||||
|
if (!value) {
|
||||||
|
callback(rule.required ? new Error("必填") : undefined)
|
||||||
|
} else if (!this.isValidIdCard(value)) {
|
||||||
|
callback(new Error("请输入正确的身份证号码"))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
}
|
}
|
||||||
const invalidBase = this.familyData.some(item => !item.familyName || item.age === null || item.age === undefined
|
|
||||||
|| !item.gender || !item.relationship)
|
|
||||||
if (invalidBase) {
|
|
||||||
this.$message.warning("请完善亲属姓名、年龄、性别和与本人关系")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const invalidContact = this.familyData.some(item => this.familyContactRequired(item) && (!item.idCard || !item.mobile))
|
|
||||||
if (invalidContact) {
|
|
||||||
this.$message.warning("年满16周岁的亲属必须填写身份证号码和手机号")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const invalidIdCard = this.familyData.some(item => item.idCard && !this.isValidIdCard(item.idCard))
|
|
||||||
if (invalidIdCard) {
|
|
||||||
this.$message.warning("请输入正确的身份证号码")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
},
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
||||||
@@ -1269,39 +1296,17 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
validateDirectRelative() {
|
validateDirectRelative() {
|
||||||
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
||||||
if (!this.directRelativeForm.relativeName) {
|
return new Promise(resolve => this.$refs.directRelativeForm.validate(valid => resolve(valid)))
|
||||||
this.$message.warning("请输入亲属姓名")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.unitName) {
|
|
||||||
this.$message.warning("请输入亲属所在单位")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.relationshipCode) {
|
|
||||||
this.$message.warning("请选择亲属关系")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.lineName) {
|
|
||||||
this.$message.warning("请输入直系亲属线路名称")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.travelStartTime) {
|
|
||||||
this.$message.warning("请选择出行开始日期")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.travelEndTime) {
|
|
||||||
this.$message.warning("请选择出行结束日期")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
},
|
||||||
submitSignup() {
|
async submitSignup() {
|
||||||
if (!this.signupForm.idCard || !this.signupForm.mobile) {
|
if (this.signupLoading) return
|
||||||
this.$message.warning("请完善报名人身份证号码和手机号")
|
// 同时校验各区域,一次展示所有字段错误,通过后才提交报名。
|
||||||
return
|
const results = await Promise.all([
|
||||||
}
|
new Promise(resolve => this.$refs.signupForm.validate(valid => resolve(valid))),
|
||||||
if (!this.validateFamilies()) return
|
this.validateFamilies(),
|
||||||
if (!this.validateDirectRelative()) return
|
this.validateDirectRelative()
|
||||||
|
])
|
||||||
|
if (results.some(valid => !valid)) return
|
||||||
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
||||||
const form = Object.assign({}, this.signupForm, {
|
const form = Object.assign({}, this.signupForm, {
|
||||||
families: JSON.stringify(families),
|
families: JSON.stringify(families),
|
||||||
@@ -1352,6 +1357,7 @@ layout("/layouts/platform.html"){
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
destroySignup() {
|
destroySignup() {
|
||||||
|
this.familyValidationAttempted = false
|
||||||
this.signupForm = {}
|
this.signupForm = {}
|
||||||
this.familyData = []
|
this.familyData = []
|
||||||
this.directRelativeForm = {}
|
this.directRelativeForm = {}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-if="formData.outProvinceRatioType === '固定人数'" :span="12">
|
<el-col v-if="formData.outProvinceRatioType === '固定人数'" :span="12">
|
||||||
<el-form-item label="固定人数" prop="outProvinceFixedPeople">
|
<el-form-item label="固定人数" prop="outProvinceFixedPeople" :required="formData.outProvinceRatioType === '固定人数'">
|
||||||
<el-input-number v-model="formData.outProvinceFixedPeople" :controls="false" :min="0" :precision="0" placeholder="请输入固定人数" style="width: 100%"></el-input-number>
|
<el-input-number v-model="formData.outProvinceFixedPeople" :controls="false" :min="0" :precision="0" placeholder="请输入固定人数" style="width: 100%"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -366,7 +366,9 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
const checkOutProvinceFixedPeople = (rule, value, callback) => {
|
const checkOutProvinceFixedPeople = (rule, value, callback) => {
|
||||||
if (this.formData.outProvinceRatioType === "固定人数"
|
if (this.formData.outProvinceRatioType === "固定人数"
|
||||||
&& (value === null || value === undefined || value === "" || value < 0)) {
|
&& (value === null || value === undefined || value === "")) {
|
||||||
|
callback(new Error("必填"))
|
||||||
|
} else if (this.formData.outProvinceRatioType === "固定人数" && value < 0) {
|
||||||
callback(new Error("固定人数必须大于等于0"))
|
callback(new Error("固定人数必须大于等于0"))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="身份证号">
|
<el-form-item label="身份证号" prop="idCard" :rules="requiredRules" required>
|
||||||
<el-input v-model="signupForm.idCard" readonly></el-input>
|
<el-input v-model="signupForm.idCard" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -130,8 +130,8 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="手机号" required>
|
<el-form-item label="手机号" prop="mobile" :rules="mobileRules" required>
|
||||||
<el-input v-model="signupForm.mobile" maxlength="30" placeholder="请输入手机号"></el-input>
|
<el-input v-model="signupForm.mobile" maxlength="11" placeholder="请输入手机号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -222,17 +222,17 @@ layout("/layouts/platform.html"){
|
|||||||
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属姓名">
|
<el-form-item label="亲属姓名" prop="relativeName" :rules="requiredRules" required>
|
||||||
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="所在单位">
|
<el-form-item label="所在单位" prop="unitName" :rules="requiredRules" required>
|
||||||
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属关系">
|
<el-form-item label="亲属关系" prop="relationshipCode" :rules="requiredRules" required>
|
||||||
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
||||||
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -241,12 +241,12 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="线路名称">
|
<el-form-item label="线路名称" prop="lineName" :rules="requiredRules" required>
|
||||||
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行开始日期">
|
<el-form-item label="出行开始日期" prop="travelStartTime" :rules="requiredRules" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelStartTime"
|
v-model="directRelativeForm.travelStartTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -257,7 +257,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行结束日期">
|
<el-form-item label="出行结束日期" prop="travelEndTime" :rules="requiredRules" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelEndTime"
|
v-model="directRelativeForm.travelEndTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -276,34 +276,48 @@ layout("/layouts/platform.html"){
|
|||||||
<div class="tour-signup-actions">
|
<div class="tour-signup-actions">
|
||||||
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
<el-form :model="{ rows: familyData }" ref="familyForm" label-width="0">
|
||||||
|
<el-table class="tour-family-table" :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
||||||
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
||||||
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 家属姓名</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.familyName'" :rules="requiredRules">
|
||||||
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="性别" width="110" align="center" header-align="center">
|
<el-table-column label="性别" width="110" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 性别</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.gender'" :rules="requiredRules">
|
||||||
<el-select v-model="row.gender" clearable placeholder="请选择">
|
<el-select v-model="row.gender" clearable placeholder="请选择">
|
||||||
<el-option label="男" value="男"></el-option>
|
<el-option label="男" value="男"></el-option>
|
||||||
<el-option label="女" value="女"></el-option>
|
<el-option label="女" value="女"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.idCard'" :rules="[{ required: familyContactRequired(row), validator: validateFamilyIdCard, trigger: ['blur', 'change'] }]">
|
||||||
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.mobile'" :rules="[{ required: familyContactRequired(row), message: '必填', trigger: ['blur', 'change'] }]">
|
||||||
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 年龄</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.age'" :rules="requiredRules">
|
||||||
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
||||||
@@ -336,10 +350,13 @@ layout("/layouts/platform.html"){
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
-->
|
-->
|
||||||
<el-table-column label="关系" width="120" align="center" header-align="center">
|
<el-table-column label="关系" width="120" align="center" header-align="center">
|
||||||
<template slot-scope="{row}">
|
<template slot="header"><span style="color: #f56c6c">*</span> 关系</template>
|
||||||
|
<template slot-scope="{row, $index}">
|
||||||
|
<el-form-item :prop="'rows.' + $index + '.relationship'" :rules="requiredRules">
|
||||||
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
||||||
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
||||||
@@ -348,6 +365,8 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div v-if="familyValidationAttempted && familyData.length === 0" class="el-form-item__error" style="position: static">必填</div>
|
||||||
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -389,6 +408,10 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
/* 覆盖全局表格 div 文字颜色,保留输入组件下方校验提示的红色。 */
|
||||||
|
.tour-family-table.el-table td.el-table__cell .el-form-item__error {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
.tour-signup-title {
|
.tour-signup-title {
|
||||||
border-left: 4px solid #0079c2;
|
border-left: 4px solid #0079c2;
|
||||||
color: #0079c2;
|
color: #0079c2;
|
||||||
@@ -489,6 +512,12 @@ layout("/layouts/platform.html"){
|
|||||||
fillBedInfo: true,
|
fillBedInfo: true,
|
||||||
signupForm: {},
|
signupForm: {},
|
||||||
familyData: [],
|
familyData: [],
|
||||||
|
familyValidationAttempted: false,
|
||||||
|
requiredRules: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
|
mobileRules: [
|
||||||
|
{ required: true, message: "必填", trigger: ["blur", "change"] },
|
||||||
|
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的11位手机号", trigger: ["blur", "change"] }
|
||||||
|
],
|
||||||
bedTypeOptions: [],
|
bedTypeOptions: [],
|
||||||
familyRelationshipOptions: [],
|
familyRelationshipOptions: [],
|
||||||
directRelativeOptions: [],
|
directRelativeOptions: [],
|
||||||
@@ -791,6 +820,11 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = true
|
this.signupForm.hasFamily = true
|
||||||
}
|
}
|
||||||
this.signupVisible = true
|
this.signupVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
;[this.$refs.signupForm, this.$refs.directRelativeForm, this.$refs.familyForm].forEach(form => {
|
||||||
|
if (form) form.clearValidate()
|
||||||
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.msg || "查询失败")
|
this.$message.warning(res.msg || "查询失败")
|
||||||
}
|
}
|
||||||
@@ -847,29 +881,22 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = false
|
this.signupForm.hasFamily = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 家属表格按行校验,缺失项显示在对应输入组件下方。
|
||||||
validateFamilies() {
|
validateFamilies() {
|
||||||
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
||||||
if (this.familyData.length === 0) {
|
this.familyValidationAttempted = true
|
||||||
this.$message.warning("请添加亲属信息")
|
if (this.familyData.length === 0) return false
|
||||||
return false
|
return new Promise(resolve => this.$refs.familyForm.validate(valid => resolve(valid)))
|
||||||
|
},
|
||||||
|
// 未满16岁的家属允许不填身份证,已填写时仍检查格式。
|
||||||
|
validateFamilyIdCard(rule, value, callback) {
|
||||||
|
if (!value) {
|
||||||
|
callback(rule.required ? new Error("必填") : undefined)
|
||||||
|
} else if (!this.isValidIdCard(value)) {
|
||||||
|
callback(new Error("请输入正确的身份证号码"))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
}
|
}
|
||||||
const invalidBase = this.familyData.some(item => !item.familyName || item.age === null || item.age === undefined
|
|
||||||
|| !item.gender || !item.relationship)
|
|
||||||
if (invalidBase) {
|
|
||||||
this.$message.warning("请完善亲属姓名、年龄、性别和与本人关系")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const invalidContact = this.familyData.some(item => this.familyContactRequired(item) && (!item.idCard || !item.mobile))
|
|
||||||
if (invalidContact) {
|
|
||||||
this.$message.warning("年满16周岁的亲属必须填写身份证号码和手机号")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const invalidIdCard = this.familyData.some(item => item.idCard && !this.isValidIdCard(item.idCard))
|
|
||||||
if (invalidIdCard) {
|
|
||||||
this.$message.warning("请输入正确的身份证号码")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
},
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
||||||
@@ -885,39 +912,17 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
validateDirectRelative() {
|
validateDirectRelative() {
|
||||||
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
||||||
if (!this.directRelativeForm.relativeName) {
|
return new Promise(resolve => this.$refs.directRelativeForm.validate(valid => resolve(valid)))
|
||||||
this.$message.warning("请输入亲属姓名")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.unitName) {
|
|
||||||
this.$message.warning("请输入亲属所在单位")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.relationshipCode) {
|
|
||||||
this.$message.warning("请选择亲属关系")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.lineName) {
|
|
||||||
this.$message.warning("请输入直系亲属线路名称")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.travelStartTime) {
|
|
||||||
this.$message.warning("请选择出行开始日期")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.directRelativeForm.travelEndTime) {
|
|
||||||
this.$message.warning("请选择出行结束日期")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
},
|
||||||
submitSignup() {
|
async submitSignup() {
|
||||||
if (!this.signupForm.idCard || !this.signupForm.mobile) {
|
if (this.signupLoading) return
|
||||||
this.$message.warning("请完善报名人身份证号码和手机号")
|
// 同时校验各区域,一次展示所有字段错误,通过后才提交报名。
|
||||||
return
|
const results = await Promise.all([
|
||||||
}
|
new Promise(resolve => this.$refs.signupForm.validate(valid => resolve(valid))),
|
||||||
if (!this.validateFamilies()) return
|
this.validateFamilies(),
|
||||||
if (!this.validateDirectRelative()) return
|
this.validateDirectRelative()
|
||||||
|
])
|
||||||
|
if (results.some(valid => !valid)) return
|
||||||
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
||||||
const form = Object.assign({}, this.signupForm, {
|
const form = Object.assign({}, this.signupForm, {
|
||||||
families: JSON.stringify(families),
|
families: JSON.stringify(families),
|
||||||
@@ -966,6 +971,7 @@ layout("/layouts/platform.html"){
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
destroySignup() {
|
destroySignup() {
|
||||||
|
this.familyValidationAttempted = false
|
||||||
this.signupForm = {}
|
this.signupForm = {}
|
||||||
this.familyData = []
|
this.familyData = []
|
||||||
this.directRelativeForm = {}
|
this.directRelativeForm = {}
|
||||||
|
|||||||
@@ -138,14 +138,14 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="联系人手机" prop="contactPhone">
|
<el-form-item label="联系人手机" prop="contactPhone" required>
|
||||||
<el-input v-model="formData.contactPhone" maxlength="30" placeholder="请输入联系人手机"></el-input>
|
<el-input v-model="formData.contactPhone" maxlength="30" placeholder="请输入联系人手机"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="邮箱" prop="email">
|
<el-form-item label="邮箱" prop="email" required>
|
||||||
<el-input v-model="formData.email" maxlength="100" placeholder="请输入邮箱"></el-input>
|
<el-input v-model="formData.email" maxlength="100" placeholder="请输入邮箱"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -221,8 +221,8 @@ layout("/layouts/platform.html"){
|
|||||||
agencyName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
agencyName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
agencyCode: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
agencyCode: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
contactPhone: [{ validator: validateMobile, trigger: ["blur", "change"] }],
|
contactPhone: [{ required: true, validator: validateMobile, trigger: ["blur", "change"] }],
|
||||||
email: [{ validator: validateEmail, trigger: ["blur", "change"] }]
|
email: [{ required: true, validator: validateEmail, trigger: ["blur", "change"] }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,6 +41,30 @@ layout("/layouts/platform.html"){
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.qsv-online-answer-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-quiz-timer {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: #e6a23c;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-description {
|
||||||
|
line-height: 1.8;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-description img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.qsv-online-preview-title {
|
.qsv-online-preview-title {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -90,6 +114,33 @@ layout("/layouts/platform.html"){
|
|||||||
min-width: 72px;
|
min-width: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.qsv-online-result-score {
|
||||||
|
color: #409eff;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-result-tags {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-result-option {
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-result-option.is-correct {
|
||||||
|
color: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-subject-result {
|
||||||
|
margin-top: 12px;
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qsv-online-subject-result.is-correct {
|
||||||
|
color: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
.qsv-online-option-fill {
|
.qsv-online-option-fill {
|
||||||
width: 520px;
|
width: 520px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -495,8 +546,22 @@ layout("/layouts/platform.html"){
|
|||||||
size="1145px"
|
size="1145px"
|
||||||
custom-class="qsv-online-drawer"
|
custom-class="qsv-online-drawer"
|
||||||
append-to-body
|
append-to-body
|
||||||
@closed="stopVoteCountdown">
|
@close="stopAnswerTimers">
|
||||||
|
<div slot="title" class="qsv-online-answer-header">
|
||||||
|
<span>{{answerDialog.title}}</span>
|
||||||
|
<span v-if="answerDialog.activity.category === 'QUIZ' && answerDialog.activity.timeLimit > 0 && !answerDialog.readonly" class="qsv-online-quiz-timer">
|
||||||
|
<i class="el-icon-time"></i> 剩余时间:{{quizRemainingText}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<div class="qsv-online-preview-body" v-loading="answerDialog.loading">
|
<div class="qsv-online-preview-body" v-loading="answerDialog.loading">
|
||||||
|
<div v-if="answerDialog.activity.description" class="qsv-online-subject">
|
||||||
|
<div class="qsv-online-subject-title">说明</div>
|
||||||
|
<div class="qsv-online-description" v-html="answerDialog.activity.description"></div>
|
||||||
|
</div>
|
||||||
|
<div v-if="showQuizResult" class="qsv-online-subject">
|
||||||
|
<div class="qsv-online-subject-title">{{answerDialog.activity.title}}</div>
|
||||||
|
<div class="qsv-online-result-score">总分:{{quizTotalScore}} 分</div>
|
||||||
|
</div>
|
||||||
<div v-if="isVoteActivity" class="qsv-online-vote">
|
<div v-if="isVoteActivity" class="qsv-online-vote">
|
||||||
<div class="qsv-online-vote-header">
|
<div class="qsv-online-vote-header">
|
||||||
<h2 class="qsv-online-vote-title">{{answerDialog.activity.title}}</h2>
|
<h2 class="qsv-online-vote-title">{{answerDialog.activity.title}}</h2>
|
||||||
@@ -573,6 +638,11 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
<el-empty v-if="!isVoteActivity && visibleSubjects.length === 0 && !answerDialog.loading" description="暂无题目"></el-empty>
|
<el-empty v-if="!isVoteActivity && visibleSubjects.length === 0 && !answerDialog.loading" description="暂无题目"></el-empty>
|
||||||
<div v-if="!isVoteActivity" v-for="(subject, index) in visibleSubjects" :key="subject.id" class="qsv-online-subject">
|
<div v-if="!isVoteActivity" v-for="(subject, index) in visibleSubjects" :key="subject.id" class="qsv-online-subject">
|
||||||
|
<div v-if="showQuizResult" class="qsv-online-result-tags">
|
||||||
|
<el-tag v-if="subject.type === 'radio'" size="small">单选</el-tag>
|
||||||
|
<el-tag v-else-if="subject.type === 'checkbox'" size="small">多选</el-tag>
|
||||||
|
<el-tag v-if="subject.score !== undefined && subject.score !== null" size="small">{{subject.score}}分</el-tag>
|
||||||
|
</div>
|
||||||
<div class="qsv-online-subject-title">
|
<div class="qsv-online-subject-title">
|
||||||
<span v-if="answerDialog.showIndex" class="qsv-online-subject-index">{{index + 1}}.</span>
|
<span v-if="answerDialog.showIndex" class="qsv-online-subject-index">{{index + 1}}.</span>
|
||||||
<span>{{subject.title}}</span>
|
<span>{{subject.title}}</span>
|
||||||
@@ -585,7 +655,7 @@ layout("/layouts/platform.html"){
|
|||||||
:value="getRadioValue(subject)"
|
:value="getRadioValue(subject)"
|
||||||
@input="setRadioValue(subject, $event)">
|
@input="setRadioValue(subject, $event)">
|
||||||
<template v-for="option in subject.options">
|
<template v-for="option in subject.options">
|
||||||
<el-radio :key="option.id" :label="option.id">{{option.text}}</el-radio>
|
<el-radio :key="option.id" :label="option.id"><span :class="{ 'qsv-online-result-option': showQuizResult, 'is-correct': showQuizResult && option.isCorrect }">{{option.text}}<span v-if="showQuizResult && option.isCorrect">(正确答案)</span></span></el-radio>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="isOptionFillVisible(subject, option)"
|
v-if="isOptionFillVisible(subject, option)"
|
||||||
:key="option.id + '-fill'"
|
:key="option.id + '-fill'"
|
||||||
@@ -604,7 +674,7 @@ layout("/layouts/platform.html"){
|
|||||||
:disabled="answerDialog.readonly"
|
:disabled="answerDialog.readonly"
|
||||||
@change="onCheckboxChange(subject)">
|
@change="onCheckboxChange(subject)">
|
||||||
<template v-for="option in subject.options">
|
<template v-for="option in subject.options">
|
||||||
<el-checkbox :key="option.id" :label="option.id">{{option.text}}</el-checkbox>
|
<el-checkbox :key="option.id" :label="option.id"><span :class="{ 'qsv-online-result-option': showQuizResult, 'is-correct': showQuizResult && option.isCorrect }">{{option.text}}<span v-if="showQuizResult && option.isCorrect">(正确答案)</span></span></el-checkbox>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="isOptionFillVisible(subject, option)"
|
v-if="isOptionFillVisible(subject, option)"
|
||||||
:key="option.id + '-fill'"
|
:key="option.id + '-fill'"
|
||||||
@@ -623,6 +693,10 @@ layout("/layouts/platform.html"){
|
|||||||
:readonly="answerDialog.readonly"
|
:readonly="answerDialog.readonly"
|
||||||
v-model="subject.userFillContent"
|
v-model="subject.userFillContent"
|
||||||
:placeholder="'请输入' + subject.title"></el-input>
|
:placeholder="'请输入' + subject.title"></el-input>
|
||||||
|
<div v-if="showQuizResult && getSubjectResult(subject)" class="qsv-online-subject-result" :class="{ 'is-correct': getSubjectResult(subject).isCorrect }">
|
||||||
|
<i :class="getSubjectResult(subject).isCorrect ? 'el-icon-circle-check' : 'el-icon-circle-close'"></i>
|
||||||
|
{{getSubjectResult(subject).isCorrect ? '回答正确' : '回答错误'}},得分:{{getSubjectResult(subject).score || 0}} 分
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="qsv-online-footer">
|
<div class="qsv-online-footer">
|
||||||
@@ -709,6 +783,10 @@ layout("/layouts/platform.html"){
|
|||||||
minutes: 0,
|
minutes: 0,
|
||||||
seconds: 0
|
seconds: 0
|
||||||
},
|
},
|
||||||
|
quizTimer: null,
|
||||||
|
quizStartedAt: 0,
|
||||||
|
quizElapsedSeconds: 0,
|
||||||
|
quizExpired: false,
|
||||||
voteTimer: null,
|
voteTimer: null,
|
||||||
voteRankVisible: false,
|
voteRankVisible: false,
|
||||||
voteDetailVisible: false,
|
voteDetailVisible: false,
|
||||||
@@ -717,6 +795,21 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
// 仅已完成的计分答题显示成绩和正确答案,普通调查与投票保持原有展示。
|
||||||
|
showQuizResult() {
|
||||||
|
return this.answerDialog.activity.category === "QUIZ" && !!this.answerDialog.answerRecord.isFinish
|
||||||
|
},
|
||||||
|
quizRemainingSeconds() {
|
||||||
|
return Math.max(0, Number(this.answerDialog.activity.timeLimit || 0) * 60 - this.answerDialog.quizElapsedSeconds)
|
||||||
|
},
|
||||||
|
quizRemainingText() {
|
||||||
|
const seconds = this.quizRemainingSeconds
|
||||||
|
return Math.floor(seconds / 60) + '分' + String(seconds % 60).padStart(2, '0') + '秒'
|
||||||
|
},
|
||||||
|
quizTotalScore() {
|
||||||
|
const answers = this.answerDialog.answerRecord.extJson || {}
|
||||||
|
return Object.keys(answers).reduce((total, id) => total + Number(answers[id].score || 0), 0)
|
||||||
|
},
|
||||||
visibleSubjects() {
|
visibleSubjects() {
|
||||||
return this.answerDialog.subjects.filter((subject) => {
|
return this.answerDialog.subjects.filter((subject) => {
|
||||||
return this.isSubjectVisible(subject)
|
return this.isSubjectVisible(subject)
|
||||||
@@ -862,6 +955,10 @@ layout("/layouts/platform.html"){
|
|||||||
this.$message.warning(unavailableMessage)
|
this.$message.warning(unavailableMessage)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.stopAnswerTimers()
|
||||||
|
this.answerDialog.quizStartedAt = 0
|
||||||
|
this.answerDialog.quizElapsedSeconds = 0
|
||||||
|
this.answerDialog.quizExpired = false
|
||||||
this.answerDialog.visible = true
|
this.answerDialog.visible = true
|
||||||
this.answerDialog.loading = true
|
this.answerDialog.loading = true
|
||||||
this.answerDialog.readonly = row.actionType === "view"
|
this.answerDialog.readonly = row.actionType === "view"
|
||||||
@@ -908,6 +1005,7 @@ layout("/layouts/platform.html"){
|
|||||||
this.answerDialog.answerRecord = res.data || {}
|
this.answerDialog.answerRecord = res.data || {}
|
||||||
this.answerDialog.readonly = !!this.answerDialog.answerRecord.isFinish
|
this.answerDialog.readonly = !!this.answerDialog.answerRecord.isFinish
|
||||||
this.initAnswer()
|
this.initAnswer()
|
||||||
|
this.startQuizTimer()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -928,6 +1026,10 @@ layout("/layouts/platform.html"){
|
|||||||
this.clearHiddenSubjectAnswers()
|
this.clearHiddenSubjectAnswers()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getSubjectResult(subject) {
|
||||||
|
const answers = this.answerDialog.answerRecord.extJson || {}
|
||||||
|
return answers[subject.id]
|
||||||
|
},
|
||||||
getRadioValue(subject) {
|
getRadioValue(subject) {
|
||||||
return subject.userSelectOptionIds && subject.userSelectOptionIds.length > 0
|
return subject.userSelectOptionIds && subject.userSelectOptionIds.length > 0
|
||||||
? subject.userSelectOptionIds[0]
|
? subject.userSelectOptionIds[0]
|
||||||
@@ -985,6 +1087,43 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 使用实际经过时间计时,避免切换浏览器标签后定时器节流导致倒计时变慢。
|
||||||
|
startQuizTimer() {
|
||||||
|
this.stopQuizTimer()
|
||||||
|
if (!this.answerDialog.visible || this.answerDialog.readonly || this.answerDialog.activity.category !== "QUIZ") return
|
||||||
|
this.answerDialog.quizStartedAt = Date.now()
|
||||||
|
this.answerDialog.quizElapsedSeconds = 0
|
||||||
|
this.answerDialog.quizExpired = false
|
||||||
|
this.answerDialog.quizTimer = setInterval(() => this.updateQuizTimer(), 1000)
|
||||||
|
},
|
||||||
|
updateQuizTimer() {
|
||||||
|
if (!this.answerDialog.quizStartedAt || this.answerDialog.readonly || !this.answerDialog.visible) return
|
||||||
|
this.answerDialog.quizElapsedSeconds = Math.floor((Date.now() - this.answerDialog.quizStartedAt) / 1000)
|
||||||
|
if (Number(this.answerDialog.activity.timeLimit) > 0 && this.quizRemainingSeconds === 0
|
||||||
|
&& !this.answerDialog.quizExpired && !this.answerDialog.submitLoading) {
|
||||||
|
this.answerDialog.quizExpired = true
|
||||||
|
this.stopQuizTimer()
|
||||||
|
// 与手机端一致:超时提示重新答题,不自动提交未完成的答卷。
|
||||||
|
this.$alert("答题时间到,请重新进入答题", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
showClose: false,
|
||||||
|
closeOnClickModal: false,
|
||||||
|
closeOnPressEscape: false
|
||||||
|
}).then(() => {
|
||||||
|
this.answerDialog.visible = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stopQuizTimer() {
|
||||||
|
if (this.answerDialog.quizTimer) {
|
||||||
|
clearInterval(this.answerDialog.quizTimer)
|
||||||
|
this.answerDialog.quizTimer = null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stopAnswerTimers() {
|
||||||
|
this.stopQuizTimer()
|
||||||
|
this.stopVoteCountdown()
|
||||||
|
},
|
||||||
startVoteCountdown() {
|
startVoteCountdown() {
|
||||||
this.stopVoteCountdown()
|
this.stopVoteCountdown()
|
||||||
this.updateVoteCountdown()
|
this.updateVoteCountdown()
|
||||||
@@ -1196,6 +1335,8 @@ layout("/layouts/platform.html"){
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
submitAnswer() {
|
submitAnswer() {
|
||||||
|
this.updateQuizTimer()
|
||||||
|
if (this.answerDialog.readonly || this.answerDialog.quizExpired || this.answerDialog.submitLoading) return
|
||||||
if (!this.validateAnswer()) {
|
if (!this.validateAnswer()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1204,11 +1345,14 @@ layout("/layouts/platform.html"){
|
|||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
this.updateQuizTimer()
|
||||||
|
if (!this.answerDialog.visible || this.answerDialog.readonly || this.answerDialog.quizExpired || this.answerDialog.submitLoading) return
|
||||||
this.answerDialog.submitLoading = true
|
this.answerDialog.submitLoading = true
|
||||||
$.post("/platform/qsv/online/submitAnswer", {
|
$.post("/platform/qsv/online/submitAnswer", {
|
||||||
answer: JSON.stringify({
|
answer: JSON.stringify({
|
||||||
activityId: this.answerDialog.activity.id,
|
activityId: this.answerDialog.activity.id,
|
||||||
answerRecordId: this.answerDialog.answerRecordId,
|
answerRecordId: this.answerDialog.answerRecordId,
|
||||||
|
answerTime: this.answerDialog.quizElapsedSeconds,
|
||||||
subjects: this.submitSubjects.map((subject) => {
|
subjects: this.submitSubjects.map((subject) => {
|
||||||
return {
|
return {
|
||||||
id: subject.id,
|
id: subject.id,
|
||||||
@@ -1221,7 +1365,14 @@ layout("/layouts/platform.html"){
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$message.success(res.msg)
|
this.$message.success(res.msg)
|
||||||
|
if (this.answerDialog.activity.category === "QUIZ") {
|
||||||
|
// 提交后读取服务端判题结果,直接展示成绩并防止重复提交。
|
||||||
|
this.answerDialog.readonly = true
|
||||||
|
this.stopQuizTimer()
|
||||||
|
this.loadAnswerRecord()
|
||||||
|
} else {
|
||||||
this.answerDialog.visible = false
|
this.answerDialog.visible = false
|
||||||
|
}
|
||||||
this.pageData()
|
this.pageData()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.msg)
|
this.$message.error(res.msg)
|
||||||
@@ -1237,7 +1388,7 @@ layout("/layouts/platform.html"){
|
|||||||
this.openAnswerFromUrl()
|
this.openAnswerFromUrl()
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.stopVoteCountdown()
|
this.stopAnswerTimers()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+2
-2
@@ -9,8 +9,8 @@ layout("/layouts/platform.html"){
|
|||||||
<search-item label="年度">
|
<search-item label="年度">
|
||||||
<el-date-picker placeholder="请选择年度" style="width: 100%" type="year" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
<el-date-picker placeholder="请选择年度" style="width: 100%" type="year" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="资料名称">
|
<search-item label="会议名称">
|
||||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入资料名称" v-model="pageForm.searchKeyword"></el-input>
|
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入会议名称" v-model="pageForm.searchKeyword"></el-input>
|
||||||
</search-item>
|
</search-item>
|
||||||
</search>
|
</search>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|||||||
@@ -403,12 +403,6 @@ const PROPOSAL_INFO = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
openChart(){
|
openChart(){
|
||||||
// 仅保存的提案尚未创建 WF 实例,按提案流程 KEY 预览流程定义图。
|
|
||||||
if (!this.row.instanceId) {
|
|
||||||
this.$refs.snakerChartRef.onOpen("JDHTA_NC")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 已提交提案使用实例对应的流程版本,保留实际办理节点和审批进度。
|
|
||||||
this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId, this.row.instanceId)
|
this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId, this.row.instanceId)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-2
@@ -40,8 +40,7 @@
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" code="AIDFUND_MEMBER_USER_TYPE"
|
<dict-select v-model="pageForm.aidFundMemberUserType" code="AIDFUND_MEMBER_USER_TYPE"
|
||||||
style="width: 100%"></dict-select>
|
style="width: 100%"></dict-select>
|
||||||
</search-item>-->
|
</search-item>-->
|
||||||
<!-- 会员模块屏蔽人员属性查询入口。 -->
|
<search-item label="人员属性">
|
||||||
<search-item label="人员属性" v-if="false">
|
|
||||||
<dict-select v-if="userAttributeMultiple" v-model="pageForm.userAttributes" code="USER_ATTRIBUTE"
|
<dict-select v-if="userAttributeMultiple" v-model="pageForm.userAttributes" code="USER_ATTRIBUTE"
|
||||||
multiple collapse-tags clearable style="width: 100%"></dict-select>
|
multiple collapse-tags clearable style="width: 100%"></dict-select>
|
||||||
<dict-select v-else v-model="pageForm.userAttribute" code="USER_ATTRIBUTE"
|
<dict-select v-else v-model="pageForm.userAttribute" code="USER_ATTRIBUTE"
|
||||||
|
|||||||
+1
-3
@@ -32,9 +32,7 @@ const COMMON_QUERY = {
|
|||||||
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
||||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||||
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
this.$emit('search', pageForm)
|
this.$emit('search', pageForm)
|
||||||
},
|
},
|
||||||
async initData(){
|
async initData(){
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="入职时间">
|
<el-descriptions-item label="入职时间">
|
||||||
<el-form-item prop="arrivalAtSchoolDate">
|
<el-form-item prop="arrivalAtSchoolDate">
|
||||||
<el-input v-model="formData.arrivalAtSchoolDate" placeholder="暂无"
|
<el-input v-model="formData.arrivalAtSchoolDate" placeholder="请输入入职时间"
|
||||||
disabled maxlength="50"></el-input>
|
disabled maxlength="50"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@@ -256,6 +256,7 @@ layout("/layouts/platform.html"){
|
|||||||
personalData: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
personalData: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||||
specialty: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
specialty: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||||
marriage: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
marriage: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||||
|
arrivalAtSchoolDate: [{ required: true, message: "必填", trigger: ["change", "blur"] }]
|
||||||
/*email: [
|
/*email: [
|
||||||
{
|
{
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
@@ -320,14 +321,6 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 缺失或非法日期回填为空,避免生成十二位 Invalid date;不使用当天日期补缺。
|
|
||||||
formatArrivalAtSchoolDate(value) {
|
|
||||||
if (value === null || value === undefined || String(value).trim() === '') {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
const date = this.$moment(value, this.$moment.ISO_8601, true)
|
|
||||||
return date.isValid() ? date.format('YYYY-MM-DD') : ''
|
|
||||||
},
|
|
||||||
normalizeUnitField() {
|
normalizeUnitField() {
|
||||||
if (!this.formData || !this.formData.unitId) {
|
if (!this.formData || !this.formData.unitId) {
|
||||||
return
|
return
|
||||||
@@ -420,7 +413,6 @@ layout("/layouts/platform.html"){
|
|||||||
debugger
|
debugger
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.formData = res.data
|
this.formData = res.data
|
||||||
this.$set(this.formData, "arrivalAtSchoolDate", this.formatArrivalAtSchoolDate(res.data.arrivalAtSchoolDate))
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const {
|
const {
|
||||||
@@ -476,7 +468,7 @@ layout("/layouts/platform.html"){
|
|||||||
this.$set(this.formData, "email", email)
|
this.$set(this.formData, "email", email)
|
||||||
this.$set(this.formData, "families", families ? families : [])
|
this.$set(this.formData, "families", families ? families : [])
|
||||||
this.$set(this.formData, "personalData", personalData)
|
this.$set(this.formData, "personalData", personalData)
|
||||||
this.$set(this.formData, "arrivalAtSchoolDate", this.formatArrivalAtSchoolDate(arrivalAtSchoolDate))
|
this.$set(this.formData, "arrivalAtSchoolDate", this.$moment(arrivalAtSchoolDate).format('YYYY-MM-DD'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-2
@@ -29,8 +29,7 @@
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
||||||
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>-->
|
</search-item>-->
|
||||||
<!-- 会员模块屏蔽人员属性查询入口。 -->
|
<search-item label="人员属性">
|
||||||
<search-item label="人员属性" v-if="false">
|
|
||||||
<dict-select v-if="userAttributeMultiple" v-model="pageForm.userAttributes"
|
<dict-select v-if="userAttributeMultiple" v-model="pageForm.userAttributes"
|
||||||
placeholder="请选择人员属性" @change="doSearch" code="USER_ATTRIBUTE"
|
placeholder="请选择人员属性" @change="doSearch" code="USER_ATTRIBUTE"
|
||||||
multiple collapse-tags clearable></dict-select>
|
multiple collapse-tags clearable></dict-select>
|
||||||
|
|||||||
+2
-4
@@ -32,10 +32,8 @@ const COMMON_QUERY = {
|
|||||||
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
||||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||||
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
||||||
// 保持其他业务筛选条件,排除已屏蔽字段。
|
// 多选人员属性沿用现有数组查询参数的JSON提交方式。
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
this.$emit('search', pageForm)
|
this.$emit('search', pageForm)
|
||||||
},
|
},
|
||||||
async initData(){
|
async initData(){
|
||||||
|
|||||||
@@ -23,9 +23,8 @@ const INFO = {
|
|||||||
|
|
||||||
<el-descriptions-item label="工作单位">{{ viewData.unitName }}</el-descriptions-item>
|
<el-descriptions-item label="工作单位">{{ viewData.unitName }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="所属工会">{{ viewData.unionName }}</el-descriptions-item>
|
<el-descriptions-item label="所属工会">{{ viewData.unionName }}</el-descriptions-item>
|
||||||
<!-- 屏蔽三级单位展示,所属校区仍遵循原有显示条件。 -->
|
<el-descriptions-item v-if="showThreeUnit" label="三级单位">{{ viewData.threeUnitName || '暂无' }}</el-descriptions-item>
|
||||||
<el-descriptions-item v-if="false" label="三级单位">{{ viewData.threeUnitName || '暂无' }}</el-descriptions-item>
|
<el-descriptions-item v-else label="所属校区">{{ viewData.campus }}</el-descriptions-item>
|
||||||
<el-descriptions-item v-if="!showThreeUnit" label="所属校区">{{ viewData.campus }}</el-descriptions-item>
|
|
||||||
|
|
||||||
<el-descriptions-item label="身份证号码">{{ viewData.idCard }}</el-descriptions-item>
|
<el-descriptions-item label="身份证号码">{{ viewData.idCard }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="联系电话">{{ viewData.mobile }}</el-descriptions-item>
|
<el-descriptions-item label="联系电话">{{ viewData.mobile }}</el-descriptions-item>
|
||||||
@@ -75,8 +74,7 @@ const INFO = {
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="变更信息" name="changeInfo" v-if="viewData.changeInfos">
|
<el-tab-pane label="变更信息" name="changeInfo" v-if="viewData.changeInfos">
|
||||||
<!-- 仅过滤展示数据,保留后台三级单位历史变更记录。 -->
|
<el-table :data="viewData.changeInfos" :size="tableSize" @sort-change="pageOrder" ref="table"
|
||||||
<el-table :data="(viewData.changeInfos || []).filter(item => item.field !== 'threeUnitId' && item.field !== 'threeUnitName' && item.fieldName !== '三级单位')" :size="tableSize" @sort-change="pageOrder" ref="table"
|
|
||||||
row-key="id" style="width: 100%">
|
row-key="id" style="width: 100%">
|
||||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||||
label="序号" type="index" width="80px"></el-table-column>
|
label="序号" type="index" width="80px"></el-table-column>
|
||||||
|
|||||||
+1
-3
@@ -67,8 +67,7 @@ const MEMBER_ALL_CHANGE_INFO = {
|
|||||||
:key="index" :timestamp="changeData.timestamp">
|
:key="index" :timestamp="changeData.timestamp">
|
||||||
<el-card>
|
<el-card>
|
||||||
<h4>{{ changeData.changeOriginName }}</h4>
|
<h4>{{ changeData.changeOriginName }}</h4>
|
||||||
<!-- 仅过滤展示数据,保留后台三级单位历史变更记录。 -->
|
<el-table :data="changeData.changeInfos" size="mini" ref="table" row-key="id" style="width: 100%">
|
||||||
<el-table :data="(changeData.changeInfos || []).filter(item => item.field !== 'threeUnitId' && item.field !== 'threeUnitName' && item.fieldName !== '三级单位')" size="mini" ref="table" row-key="id" style="width: 100%">
|
|
||||||
<el-table-column align="center" header-align="center"
|
<el-table-column align="center" header-align="center"
|
||||||
label="序号" type="index" width="80px"></el-table-column>
|
label="序号" type="index" width="80px"></el-table-column>
|
||||||
<el-table-column prop="fieldName" label="变更字段" header-align="center"></el-table-column>
|
<el-table-column prop="fieldName" label="变更字段" header-align="center"></el-table-column>
|
||||||
@@ -87,7 +86,6 @@ const MEMBER_ALL_CHANGE_INFO = {
|
|||||||
</el-timeline-item>
|
</el-timeline-item>
|
||||||
</el-timeline>
|
</el-timeline>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<slot></slot>
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
`,
|
`,
|
||||||
store,
|
store,
|
||||||
|
|||||||
+31
-6
@@ -101,8 +101,7 @@ const MEMBER_CHANGE = {
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</template>
|
</template>
|
||||||
<!-- 屏蔽三级单位编辑,保留回填值,避免提交其他变更时清空历史数据。 -->
|
<el-descriptions-item v-if="showThreeUnit" label="三级单位">
|
||||||
<el-descriptions-item v-if="false" label="三级单位">
|
|
||||||
<el-form-item prop="threeUnitId">
|
<el-form-item prop="threeUnitId">
|
||||||
<el-select v-model="formData.threeUnitId" clearable filterable
|
<el-select v-model="formData.threeUnitId" clearable filterable
|
||||||
placeholder="请选择三级单位" style="width: 100%">
|
placeholder="请选择三级单位" style="width: 100%">
|
||||||
@@ -111,7 +110,7 @@ const MEMBER_CHANGE = {
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item v-if="!showThreeUnit" label="所属校区">
|
<el-descriptions-item v-else label="所属校区">
|
||||||
<el-form-item prop="campus">
|
<el-form-item prop="campus">
|
||||||
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
|
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
|
||||||
:disabled="allowFields('campus')" code="USER_CAMPUS"></dict-select>
|
:disabled="allowFields('campus')" code="USER_CAMPUS"></dict-select>
|
||||||
@@ -150,8 +149,7 @@ const MEMBER_CHANGE = {
|
|||||||
:disabled="allowFields('personType')" style="width: 100%"></dict-select>
|
:disabled="allowFields('personType')" style="width: 100%"></dict-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!-- 屏蔽人员属性展示和编辑,保留回填值以免保存时覆盖历史数据。 -->
|
<el-descriptions-item label="人员属性">
|
||||||
<el-descriptions-item label="人员属性" v-if="false">
|
|
||||||
<el-form-item prop="userAttribute">
|
<el-form-item prop="userAttribute">
|
||||||
<dict-select v-model="formData.userAttribute" code="USER_ATTRIBUTE"
|
<dict-select v-model="formData.userAttribute" code="USER_ATTRIBUTE"
|
||||||
style="width: 100%"></dict-select>
|
style="width: 100%"></dict-select>
|
||||||
@@ -216,6 +214,8 @@ const MEMBER_CHANGE = {
|
|||||||
value-format="yyyy-MM-dd"></el-date-picker>
|
value-format="yyyy-MM-dd"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item></el-descriptions-item>
|
||||||
|
<el-descriptions-item></el-descriptions-item>
|
||||||
<template v-if="formData.loginname == $store.state.user.loginname">
|
<template v-if="formData.loginname == $store.state.user.loginname">
|
||||||
<el-descriptions-item label="家庭主要成员" :span="3">
|
<el-descriptions-item label="家庭主要成员" :span="3">
|
||||||
<el-form-item prop="families">
|
<el-form-item prop="families">
|
||||||
@@ -392,6 +392,31 @@ const MEMBER_CHANGE = {
|
|||||||
allowFields(prop) {
|
allowFields(prop) {
|
||||||
return !this.allowChangeFields.map(v => v.code).includes(prop)
|
return !this.allowChangeFields.map(v => v.code).includes(prop)
|
||||||
},
|
},
|
||||||
|
// 管理页仅查询当前被编辑人员所属二级单位的直属三级单位,避免越级选择其他单位数据。
|
||||||
|
initThreeUnits() {
|
||||||
|
this.threeUnits = []
|
||||||
|
if (!this.showThreeUnit) {
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
|
if (!this.formData.unitId) {
|
||||||
|
this.$message.warning("当前人员未配置所属单位,无法查询三级单位")
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
|
return this.$axios.post("/platform/sys/unit/child", {pid: this.formData.unitId})
|
||||||
|
.then((resp) => {
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.threeUnits = resp.data || []
|
||||||
|
if (this.threeUnits.length === 0) {
|
||||||
|
this.$message.warning("当前所属单位未配置三级单位")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(resp.msg || "三级单位查询失败")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error("三级单位查询失败,请稍后重试")
|
||||||
|
})
|
||||||
|
},
|
||||||
doSave(){
|
doSave(){
|
||||||
this.$confirm("保存后可在我的申请里面再次编辑,您确定要保存吗?", "提示", { type: "warning" })
|
this.$confirm("保存后可在我的申请里面再次编辑,您确定要保存吗?", "提示", { type: "warning" })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -435,7 +460,7 @@ const MEMBER_CHANGE = {
|
|||||||
this.units = await this.$businessTool.listUnit()
|
this.units = await this.$businessTool.listUnit()
|
||||||
}
|
}
|
||||||
this.normalizeUnitField()
|
this.normalizeUnitField()
|
||||||
// 三级单位已屏蔽,不再加载选项或提示配置缺失;原值继续随表单回填。
|
this.initThreeUnits()
|
||||||
},
|
},
|
||||||
async getUserById(userId){
|
async getUserById(userId){
|
||||||
const resp = await $.post("/platform/member/change/apply/getUserByIdForMemberChange", { userId })
|
const resp = await $.post("/platform/member/change/apply/getUserByIdForMemberChange", { userId })
|
||||||
|
|||||||
+24
-18
@@ -1,4 +1,4 @@
|
|||||||
<!--#
|
<!--#
|
||||||
layout("/layouts/platform.html"){
|
layout("/layouts/platform.html"){
|
||||||
#-->
|
#-->
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
@@ -22,8 +22,7 @@ layout("/layouts/platform.html"){
|
|||||||
v-for="item in units"></el-option>
|
v-for="item in units"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
<!-- 三级单位已屏蔽,保留字段结构便于维护。 -->
|
<search-item label="三级单位">
|
||||||
<search-item label="三级单位" v-if="false">
|
|
||||||
<el-select clearable filterable placeholder="请选择三级单位" style="width: 100%"
|
<el-select clearable filterable placeholder="请选择三级单位" style="width: 100%"
|
||||||
v-model="pageForm.threeUnitId">
|
v-model="pageForm.threeUnitId">
|
||||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||||
@@ -51,8 +50,7 @@ layout("/layouts/platform.html"){
|
|||||||
<!-- <dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"-->
|
<!-- <dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"-->
|
||||||
<!-- code="AIDFUND_MEMBER_USER_TYPE"></dict-select>-->
|
<!-- code="AIDFUND_MEMBER_USER_TYPE"></dict-select>-->
|
||||||
<!-- </search-item>-->
|
<!-- </search-item>-->
|
||||||
<!-- 会员模块屏蔽人员属性查询入口。 -->
|
<search-item label="人员属性">
|
||||||
<search-item label="人员属性" v-if="false">
|
|
||||||
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
||||||
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
@@ -78,7 +76,7 @@ layout("/layouts/platform.html"){
|
|||||||
设置人员分类
|
设置人员分类
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-button v-if="false" :disabled="!checkUsers.length" @click="openBatchEditUserAttribute" class="ml5" icon="el-icon-edit"
|
<el-button :disabled="!checkUsers.length" @click="openBatchEditUserAttribute" class="ml5" icon="el-icon-edit"
|
||||||
size="small" type="primary">
|
size="small" type="primary">
|
||||||
设置人员属性
|
设置人员属性
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -242,7 +240,6 @@ layout("/layouts/platform.html"){
|
|||||||
|
|
||||||
<el-drawer
|
<el-drawer
|
||||||
:before-close="handleClose"
|
:before-close="handleClose"
|
||||||
v-if="false"
|
|
||||||
:visible.sync="batchEditUserAttributeVisible"
|
:visible.sync="batchEditUserAttributeVisible"
|
||||||
size="1000px" title="批量设置人员属性">
|
size="1000px" title="批量设置人员属性">
|
||||||
<el-timeline style="margin-right: 40px">
|
<el-timeline style="margin-right: 40px">
|
||||||
@@ -572,8 +569,7 @@ layout("/layouts/platform.html"){
|
|||||||
{ prop: "personType", label: "人员类型", width: 120, sortable: true },
|
{ prop: "personType", label: "人员类型", width: 120, sortable: true },
|
||||||
// 临时屏蔽“人员分类”列表字段,不删除配置,后续需要可恢复。
|
// 临时屏蔽“人员分类”列表字段,不删除配置,后续需要可恢复。
|
||||||
// { prop: "aidFundMemberUserType", label: "人员分类", width: 120, sortable: true },
|
// { prop: "aidFundMemberUserType", label: "人员分类", width: 120, sortable: true },
|
||||||
// 屏蔽人员属性列,同时从导出可选列中排除。
|
{ prop: "userAttribute", label: "人员属性", width: 120, sortable: true },
|
||||||
// { prop: "userAttribute", label: "人员属性", width: 120, sortable: true },
|
|
||||||
{ prop: "idCardType", label: "证件类型", width: 120, sortable: true, checked: 0 },
|
{ prop: "idCardType", label: "证件类型", width: 120, sortable: true, checked: 0 },
|
||||||
{ prop: "idCard", label: "证件号码", width: 120, sortable: true, checked: 0 },
|
{ prop: "idCard", label: "证件号码", width: 120, sortable: true, checked: 0 },
|
||||||
{ prop: "marriage", label: "婚姻状况", width: 120, sortable: true, checked: 0 },
|
{ prop: "marriage", label: "婚姻状况", width: 120, sortable: true, checked: 0 },
|
||||||
@@ -601,17 +597,13 @@ layout("/layouts/platform.html"){
|
|||||||
"member-all-change": MEMBER_ALL_CHANGE_INFO,
|
"member-all-change": MEMBER_ALL_CHANGE_INFO,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 分页和导出共用查询参数,排除已屏蔽的人员属性条件。
|
// 分页和导出共用该参数构建方法,保证人员属性多选值始终按 JSON 数组提交。
|
||||||
buildQueryPageForm(source = this.pageForm) {
|
buildQueryPageForm(source = this.pageForm) {
|
||||||
const pageForm = clone(source)
|
const pageForm = clone(source)
|
||||||
// 隐藏的三级单位不参与列表查询和导出筛选。
|
pageForm.userAttributes = JSON.stringify(source.userAttributes || [])
|
||||||
pageForm.threeUnitId = ""
|
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
return pageForm
|
return pageForm
|
||||||
},
|
},
|
||||||
// 复用公共分页方法,提交已清理的业务查询参数。
|
// 覆盖公共分页方法,使后端按人员属性集合执行查询。
|
||||||
pageData(data = null) {
|
pageData(data = null) {
|
||||||
return initTableMixins.methods.pageData.call(this, this.buildQueryPageForm(data || this.pageForm))
|
return initTableMixins.methods.pageData.call(this, this.buildQueryPageForm(data || this.pageForm))
|
||||||
},
|
},
|
||||||
@@ -703,10 +695,24 @@ layout("/layouts/platform.html"){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 三级单位已屏蔽,切换所属单位时仅清空旧筛选条件,不再请求子单位。
|
// 所属单位变化时只加载其直属三级单位,避免跨单位筛选。
|
||||||
flushThreeUnits() {
|
flushThreeUnits(unitId) {
|
||||||
this.$set(this.pageForm, "threeUnitId", null)
|
this.$set(this.pageForm, "threeUnitId", null)
|
||||||
this.threeUnits = []
|
this.threeUnits = []
|
||||||
|
if (!unitId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$axios.post("/platform/sys/unit/child", {pid: unitId})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.threeUnits = res.data || []
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg || "三级单位查询失败")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error("三级单位查询失败,请稍后重试")
|
||||||
|
})
|
||||||
},
|
},
|
||||||
checkAll() {
|
checkAll() {
|
||||||
this.checkedFields = this.tableColumns.map(c => c.prop);
|
this.checkedFields = this.tableColumns.map(c => c.prop);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ layout("/layouts/platform.html"){
|
|||||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||||
{ prop: "changeTypes", label: "变更类型", sortable: true, width: 200 },
|
{ prop: "changeTypes", label: "变更类型", sortable: true, width: 200 },
|
||||||
{ prop: "applyDateTime", label: "申请时间", sortable: true },
|
{ prop: "applyDateTime", label: "申请时间", sortable: true },
|
||||||
{ prop: "taskName", label: "当前节点"},
|
{ prop: "curTaskName", label: "当前节点"},
|
||||||
{ prop: "instanceState", label: "流程状态"}
|
{ prop: "instanceState", label: "流程状态"}
|
||||||
],
|
],
|
||||||
changeTypeData: [],
|
changeTypeData: [],
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ layout("/layouts/platform.html"){
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
||||||
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>-->
|
</search-item>-->
|
||||||
<!-- 会员模块屏蔽人员属性查询入口。 -->
|
<search-item label="人员属性">
|
||||||
<search-item label="人员属性" v-if="false">
|
|
||||||
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
||||||
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
@@ -199,10 +198,8 @@ layout("/layouts/platform.html"){
|
|||||||
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
|
||||||
pageForm.changeTypes = JSON.stringify(pageForm.changeTypes)
|
pageForm.changeTypes = JSON.stringify(pageForm.changeTypes)
|
||||||
pageForm.changeOrigins = JSON.stringify(pageForm.changeOrigins)
|
pageForm.changeOrigins = JSON.stringify(pageForm.changeOrigins)
|
||||||
// 人员属性已停用,不参与变更记录筛选。
|
// 人员属性为多选条件,提交前转换为后端可解析的 JSON 数组。
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
|
|
||||||
this.$axios.post(loc() + '/pageData', pageForm)
|
this.$axios.post(loc() + '/pageData', pageForm)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|||||||
@@ -427,10 +427,8 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
getUnionName(val){
|
getUnionName(val){
|
||||||
// 切换目标单位时同步名称;ID 类型统一后匹配,避免提交原单位名称。
|
const data = this.units.find(v => v.id === val)
|
||||||
const data = this.units.find(v => String(v.id) === String(val))
|
this.$set(this.formData, 'unionName', data ? data.unionname : '')
|
||||||
this.$set(this.formData, 'unitName', data ? data.name : '')
|
|
||||||
this.$set(this.formData, 'unionName', data ? (data.unionName || data.unionname || '') : '')
|
|
||||||
},
|
},
|
||||||
allowFields(prop) {
|
allowFields(prop) {
|
||||||
return !this.allowChangeFields.map(v => v.code).includes(prop)
|
return !this.allowChangeFields.map(v => v.code).includes(prop)
|
||||||
|
|||||||
@@ -432,10 +432,8 @@ layout("/layouts/platform.html"){
|
|||||||
|
|
||||||
// 获取表单工会名称
|
// 获取表单工会名称
|
||||||
getUnionName(val){
|
getUnionName(val){
|
||||||
// 切换目标单位时同步名称;ID 类型统一后匹配,避免提交原单位名称。
|
const data = this.units.find(v => v.id === val)
|
||||||
const data = this.units.find(v => String(v.id) === String(val))
|
this.$set(this.formData, 'unionName', data ? data.unionName : '')
|
||||||
this.$set(this.formData, 'unitName', data ? data.name : '')
|
|
||||||
this.$set(this.formData, 'unionName', data ? (data.unionName || data.unionname || '') : '')
|
|
||||||
},
|
},
|
||||||
// 获取表单可编辑的字段信息
|
// 获取表单可编辑的字段信息
|
||||||
allowFields(prop) {
|
allowFields(prop) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<el-descriptions-item label="学位">{{ viewData.academicDegree }}</el-descriptions-item>
|
<el-descriptions-item label="学位">{{ viewData.academicDegree }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="党政职务">{{ viewData.position }}</el-descriptions-item>
|
<el-descriptions-item label="党政职务">{{ viewData.position }}</el-descriptions-item>
|
||||||
|
|
||||||
<el-descriptions-item label="工作单位">{{ viewData.unitName }}</el-descriptions-item>
|
<el-descriptions-item label="工作单位">{{ viewData.unitname }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="所属工会">{{ viewData.unionname }}</el-descriptions-item>
|
<el-descriptions-item label="所属工会">{{ viewData.unionname }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="所属校区">{{ viewData.campus }}</el-descriptions-item>
|
<el-descriptions-item label="所属校区">{{ viewData.campus }}</el-descriptions-item>
|
||||||
|
|
||||||
@@ -60,8 +60,7 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="变更信息" name="changeInfo" v-if="viewData.changeInfos">
|
<el-tab-pane label="变更信息" name="changeInfo" v-if="viewData.changeInfos">
|
||||||
<!-- 仅过滤展示数据,保留后台三级单位历史变更记录。 -->
|
<el-table :data="viewData.changeInfos" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
||||||
<el-table :data="(viewData.changeInfos || []).filter(item => item.field !== 'threeUnitId' && item.field !== 'threeUnitName' && item.fieldName !== '三级单位')" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
|
||||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||||
label="序号" type="index" width="80px"></el-table-column>
|
label="序号" type="index" width="80px"></el-table-column>
|
||||||
<el-table-column prop="fieldName" label="变更字段" header-align="center"></el-table-column>
|
<el-table-column prop="fieldName" label="变更字段" header-align="center"></el-table-column>
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ const MEMBER_INFO = {
|
|||||||
<el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item>
|
<el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item>
|
||||||
|
|
||||||
<!-- 第 4 行 -->
|
<!-- 第 4 行 -->
|
||||||
<!-- 屏蔽人员属性展示和编辑,保留回填值以免保存时覆盖历史数据。 -->
|
<el-descriptions-item label="人员属性">{{ viewData.userAttribute }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="人员属性" v-if="false">{{ viewData.userAttribute }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="职称">{{ viewData.professionalTitle }}</el-descriptions-item>
|
<el-descriptions-item label="职称">{{ viewData.professionalTitle }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="职级">{{ viewData.professionalLevel }}</el-descriptions-item>
|
<el-descriptions-item label="职级">{{ viewData.professionalLevel }}</el-descriptions-item>
|
||||||
|
|
||||||
@@ -86,7 +85,6 @@ const MEMBER_INFO = {
|
|||||||
<el-descriptions-item label="行政岗级">{{ viewData.administrativePositionLevel }}</el-descriptions-item>
|
<el-descriptions-item label="行政岗级">{{ viewData.administrativePositionLevel }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="人员分类" v-if="false">{{ viewData.aidFundMemberUserType }}</el-descriptions-item>
|
<el-descriptions-item label="人员分类" v-if="false">{{ viewData.aidFundMemberUserType }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<slot></slot>
|
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
store,
|
store,
|
||||||
|
|||||||
+1
-2
@@ -43,8 +43,7 @@
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
||||||
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>-->
|
</search-item>-->
|
||||||
<!-- 会员模块屏蔽人员属性查询入口。 -->
|
<search-item label="人员属性">
|
||||||
<search-item label="人员属性" v-if="false">
|
|
||||||
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
||||||
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|||||||
+2
-4
@@ -37,10 +37,8 @@ const COMMON_QUERY = {
|
|||||||
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
||||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||||
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
||||||
// 保持其他业务筛选条件,排除已屏蔽字段。
|
// 人员属性多选值按现有数组查询参数口径提交。
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
this.$emit('search', pageForm)
|
this.$emit('search', pageForm)
|
||||||
},
|
},
|
||||||
handleUnionChange() {
|
handleUnionChange() {
|
||||||
|
|||||||
+1
-2
@@ -102,8 +102,7 @@
|
|||||||
style="width: 100%"></dict-select>
|
style="width: 100%"></dict-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!-- 屏蔽人员属性展示和编辑,保留回填值以免保存时覆盖历史数据。 -->
|
<el-descriptions-item label="人员属性">
|
||||||
<el-descriptions-item label="人员属性" v-if="false">
|
|
||||||
<el-form-item prop="userAttribute">
|
<el-form-item prop="userAttribute">
|
||||||
<dict-select v-model="formData.userAttribute" code="USER_ATTRIBUTE"
|
<dict-select v-model="formData.userAttribute" code="USER_ATTRIBUTE"
|
||||||
style="width: 100%"></dict-select>
|
style="width: 100%"></dict-select>
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ layout("/layouts/platform.html"){
|
|||||||
<search-item label="人员分类" v-if="false">
|
<search-item label="人员分类" v-if="false">
|
||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch" code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch" code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
<!-- 会员模块屏蔽人员属性查询入口。 -->
|
<search-item label="人员属性">
|
||||||
<search-item label="人员属性" v-if="false">
|
|
||||||
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
||||||
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
@@ -134,15 +133,13 @@ layout("/layouts/platform.html"){
|
|||||||
"member-info": MEMBER_INFO
|
"member-info": MEMBER_INFO
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 分页和导出共用查询参数,排除已屏蔽的人员属性条件。
|
// 分页和导出共用该参数构建方法,保证人员属性多选值始终按 JSON 数组提交。
|
||||||
buildQueryPageForm() {
|
buildQueryPageForm() {
|
||||||
const pageForm = clone(this.pageForm)
|
const pageForm = clone(this.pageForm)
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes || [])
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
return pageForm
|
return pageForm
|
||||||
},
|
},
|
||||||
// 复用公共分页方法,提交已清理的业务查询参数。
|
// 覆盖公共分页方法,使后端按人员属性集合执行查询。
|
||||||
pageData() {
|
pageData() {
|
||||||
return initTableMixins.methods.pageData.call(this, this.buildQueryPageForm())
|
return initTableMixins.methods.pageData.call(this, this.buildQueryPageForm())
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ layout("/layouts/platform.html"){
|
|||||||
<search-item label="人员分类" v-if="false">
|
<search-item label="人员分类" v-if="false">
|
||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch" code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch" code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
<!-- 会员模块屏蔽人员属性查询入口。 -->
|
<search-item label="人员属性">
|
||||||
<search-item label="人员属性" v-if="false">
|
|
||||||
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
||||||
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
code="USER_ATTRIBUTE" multiple collapse-tags clearable></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
@@ -142,12 +141,10 @@ layout("/layouts/platform.html"){
|
|||||||
"member-add-form": MEMBER_ADD_FORM
|
"member-add-form": MEMBER_ADD_FORM
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 分页查询前排除已屏蔽的人员属性条件。
|
// 人员属性为多选条件,分页查询前统一转换为后端可接收的 JSON 数组。
|
||||||
pageData(data = null) {
|
pageData(data = null) {
|
||||||
const pageForm = clone(data || this.pageForm)
|
const pageForm = clone(data || this.pageForm)
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes || [])
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
return initTableMixins.methods.pageData.call(this, pageForm)
|
return initTableMixins.methods.pageData.call(this, pageForm)
|
||||||
},
|
},
|
||||||
openAdd() {
|
openAdd() {
|
||||||
|
|||||||
+2
-4
@@ -129,7 +129,7 @@ layout("/layouts/platform.html"){
|
|||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row type="flex" align="middle" class="query-row query-row-tag" v-if="false">
|
<el-row type="flex" align="middle" class="query-row query-row-tag">
|
||||||
<el-col class="query-row-title">人员属性:</el-col>
|
<el-col class="query-row-title">人员属性:</el-col>
|
||||||
<el-col class="query-row-content query-row-content-tag">
|
<el-col class="query-row-content query-row-content-tag">
|
||||||
<el-tag class="query-tag-item"
|
<el-tag class="query-tag-item"
|
||||||
@@ -280,9 +280,7 @@ layout("/layouts/platform.html"){
|
|||||||
const pageForm = clone(this.pageForm)
|
const pageForm = clone(this.pageForm)
|
||||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||||
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
this.$axios.post(loc() + "/pageData", pageForm).then((res) => {
|
this.$axios.post(loc() + "/pageData", pageForm).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.tableData = res.data
|
this.tableData = res.data
|
||||||
|
|||||||
+3
-8
@@ -165,8 +165,7 @@ layout("/layouts/platform.html"){
|
|||||||
{ prop: "unitName", label: "所属单位", width: 120, sortable: true },
|
{ prop: "unitName", label: "所属单位", width: 120, sortable: true },
|
||||||
// 临时屏蔽“人员分类”列表字段,不删除配置,后续需要可恢复。
|
// 临时屏蔽“人员分类”列表字段,不删除配置,后续需要可恢复。
|
||||||
// { prop: "aidFundMemberUserType", label: "人员分类", width: 120, sortable: true },
|
// { prop: "aidFundMemberUserType", label: "人员分类", width: 120, sortable: true },
|
||||||
// 屏蔽人员属性列,同时从导出可选列中排除。
|
{ prop: "userAttribute", label: "人员属性", width: 120, sortable: true },
|
||||||
// { prop: "userAttribute", label: "人员属性", width: 120, sortable: true },
|
|
||||||
{ prop: "idCardType", label: "证件类型", width: 120, sortable: true, checked: 0 },
|
{ prop: "idCardType", label: "证件类型", width: 120, sortable: true, checked: 0 },
|
||||||
{ prop: "idCard", label: "证件号码", width: 120, sortable: true, checked: 0 },
|
{ prop: "idCard", label: "证件号码", width: 120, sortable: true, checked: 0 },
|
||||||
{ prop: "marriage", label: "婚姻状况", width: 120, sortable: true, checked: 0 },
|
{ prop: "marriage", label: "婚姻状况", width: 120, sortable: true, checked: 0 },
|
||||||
@@ -206,9 +205,7 @@ layout("/layouts/platform.html"){
|
|||||||
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
|
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
|
||||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||||
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
||||||
const data = this.tableColumns.filter(item => this.checkedFields.includes(item.prop)).map(item => {
|
const data = this.tableColumns.filter(item => this.checkedFields.includes(item.prop)).map(item => {
|
||||||
return {prop: item.prop, label: item.label}
|
return {prop: item.prop, label: item.label}
|
||||||
@@ -233,9 +230,7 @@ layout("/layouts/platform.html"){
|
|||||||
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
|
pageForm.memberTypes = JSON.stringify(this.pageForm.memberTypes)
|
||||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||||
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
||||||
pageForm.memberStatus = JSON.stringify(this.pageForm.memberStatus)
|
pageForm.memberStatus = JSON.stringify(this.pageForm.memberStatus)
|
||||||
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
||||||
|
|||||||
+1
-1
@@ -113,7 +113,7 @@ const MEMBER_STATISTICS_COMPREHENSIVE_QUERY_FORM = {
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row type="flex" align="middle" class="query-row query-row-tag" v-if="false">
|
<el-row type="flex" align="middle" class="query-row query-row-tag">
|
||||||
<el-col class="query-row-title">人员属性:</el-col>
|
<el-col class="query-row-title">人员属性:</el-col>
|
||||||
<el-col class="query-row-content query-row-content-tag">
|
<el-col class="query-row-content query-row-content-tag">
|
||||||
<el-tag
|
<el-tag
|
||||||
|
|||||||
+2
-4
@@ -129,7 +129,7 @@ layout("/layouts/platform.html"){
|
|||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row type="flex" align="middle" class="query-row query-row-tag" v-if="false">
|
<el-row type="flex" align="middle" class="query-row query-row-tag">
|
||||||
<el-col class="query-row-title">人员属性:</el-col>
|
<el-col class="query-row-title">人员属性:</el-col>
|
||||||
<el-col class="query-row-content query-row-content-tag">
|
<el-col class="query-row-content query-row-content-tag">
|
||||||
<el-tag class="query-tag-item"
|
<el-tag class="query-tag-item"
|
||||||
@@ -265,9 +265,7 @@ layout("/layouts/platform.html"){
|
|||||||
// 统计接口按 JSON 字符串接收多选条件,这里把人员分类和人员属性统一成同一提交口径。
|
// 统计接口按 JSON 字符串接收多选条件,这里把人员分类和人员属性统一成同一提交口径。
|
||||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||||
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
pageForm.aidFundMemberUserTypes = JSON.stringify(this.pageForm.aidFundMemberUserTypes)
|
||||||
// 人员属性已屏蔽,查询和导出均不再按该字段过滤。
|
pageForm.userAttributes = JSON.stringify(this.pageForm.userAttributes)
|
||||||
pageForm.userAttribute = ""
|
|
||||||
pageForm.userAttributes = "[]"
|
|
||||||
this.$axios.post(loc() + "/pageData", pageForm).then((res) => {
|
this.$axios.post(loc() + "/pageData", pageForm).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.tableData = res.data
|
this.tableData = res.data
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const filterUser = {
|
|||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="所属单位">
|
<search-item label="所属单位">
|
||||||
<el-select @change="unitChange" clearable filterable
|
<el-select clearable filterable
|
||||||
placeholder="请选择所属单位" style="width: 100%"
|
placeholder="请选择所属单位" style="width: 100%"
|
||||||
v-model="pageForm.unitId">
|
v-model="pageForm.unitId">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -74,17 +74,6 @@ const filterUser = {
|
|||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="三级单位">
|
|
||||||
<el-select clearable filterable placeholder="请先选择所属单位" style="width: 100%"
|
|
||||||
v-model="pageForm.threeUnitId">
|
|
||||||
<el-option
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="item in threeUnitOptions">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</search-item>
|
|
||||||
|
|
||||||
<search-item label="人员类型:">
|
<search-item label="人员类型:">
|
||||||
<dict-select clearable code="USER_PERSON_TYPE"
|
<dict-select clearable code="USER_PERSON_TYPE"
|
||||||
@@ -94,13 +83,6 @@ const filterUser = {
|
|||||||
v-model="pageForm.personTypes"></dict-select>
|
v-model="pageForm.personTypes"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="人员属性:">
|
|
||||||
<dict-select clearable code="USER_ATTRIBUTE"
|
|
||||||
multiple
|
|
||||||
collapse-tags
|
|
||||||
placeholder="请选择人员属性"
|
|
||||||
v-model="pageForm.userAttributes"></dict-select>
|
|
||||||
</search-item>
|
|
||||||
|
|
||||||
<search-item label="在职状态:">
|
<search-item label="在职状态:">
|
||||||
<dict-select clearable code="USER_STATE"
|
<dict-select clearable code="USER_STATE"
|
||||||
@@ -169,14 +151,11 @@ const filterUser = {
|
|||||||
userStates: [],
|
userStates: [],
|
||||||
personTypes: [],
|
personTypes: [],
|
||||||
preparedBys: [],
|
preparedBys: [],
|
||||||
userAttributes: [],
|
unitId: null
|
||||||
unitId: null,
|
|
||||||
threeUnitId: null
|
|
||||||
},
|
},
|
||||||
sexOptions: ["男", "女"],
|
sexOptions: ["男", "女"],
|
||||||
unionOptions: [],
|
unionOptions: [],
|
||||||
unitOptions: [],
|
unitOptions: [],
|
||||||
threeUnitOptions: [],
|
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ prop: "loginname", label: "工号" },
|
{ prop: "loginname", label: "工号" },
|
||||||
{ prop: "username", label: "姓名" },
|
{ prop: "username", label: "姓名" },
|
||||||
@@ -185,8 +164,7 @@ const filterUser = {
|
|||||||
{ prop: "personType", label: "人员类型", sortable: true },
|
{ prop: "personType", label: "人员类型", sortable: true },
|
||||||
{ prop: "userState", label: "在职状态", sortable: true },
|
{ prop: "userState", label: "在职状态", sortable: true },
|
||||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
{ prop: "unitName", label: "所属单位", sortable: true }
|
||||||
{ prop: "threeUnitName", label: "三级单位", sortable: true }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -208,35 +186,12 @@ const filterUser = {
|
|||||||
this.$set(this.pageForm, "birthMonths", [])
|
this.$set(this.pageForm, "birthMonths", [])
|
||||||
this.$set(this.pageForm, "unionId", null)
|
this.$set(this.pageForm, "unionId", null)
|
||||||
this.$set(this.pageForm, "unitId", null)
|
this.$set(this.pageForm, "unitId", null)
|
||||||
this.$set(this.pageForm, "threeUnitId", null)
|
|
||||||
this.threeUnitOptions = []
|
|
||||||
this.$set(this.pageForm, "personTypes", [])
|
this.$set(this.pageForm, "personTypes", [])
|
||||||
this.$set(this.pageForm, "preparedBys", [])
|
this.$set(this.pageForm, "preparedBys", [])
|
||||||
this.$set(this.pageForm, "userAttributes", [])
|
|
||||||
this.$set(this.pageForm, "userStates", [])
|
this.$set(this.pageForm, "userStates", [])
|
||||||
this.$set(this.pageForm, "isMember", null)
|
this.$set(this.pageForm, "isMember", null)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 所属单位改变后,仅加载该单位直属的三级单位,避免跨单位筛选。
|
|
||||||
unitChange(unitId) {
|
|
||||||
this.$set(this.pageForm, "threeUnitId", null)
|
|
||||||
this.threeUnitOptions = []
|
|
||||||
if (!unitId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$axios.post("/platform/sys/unit/child", { pid: unitId })
|
|
||||||
.then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.threeUnitOptions = res.data || []
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.msg || "三级单位查询失败")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.$message.error("三级单位查询失败,请稍后重试")
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
pageData() {
|
pageData() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
this.$axios
|
this.$axios
|
||||||
|
|||||||
@@ -65,10 +65,6 @@ layout("/layouts/platform.html"){
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
||||||
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="人员属性">
|
|
||||||
<dict-select v-model="pageForm.userAttribute" placeholder="请选择人员属性" @change="doSearch"
|
|
||||||
code="USER_ATTRIBUTE"></dict-select>
|
|
||||||
</search-item>
|
|
||||||
</search>
|
</search>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const addUser = {
|
|||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="所属单位">
|
<search-item label="所属单位">
|
||||||
<el-select @change="unitChange" clearable
|
<el-select clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择所属单位" style="width: 100%"
|
placeholder="请选择所属单位" style="width: 100%"
|
||||||
v-model="pageForm.unitId">
|
v-model="pageForm.unitId">
|
||||||
@@ -76,17 +76,6 @@ const addUser = {
|
|||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="三级单位">
|
|
||||||
<el-select clearable filterable placeholder="请先选择所属单位" style="width: 100%"
|
|
||||||
v-model="pageForm.threeUnitId">
|
|
||||||
<el-option
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="item in threeUnitOptions">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</search-item>
|
|
||||||
|
|
||||||
<search-item label="人员类型:">
|
<search-item label="人员类型:">
|
||||||
<dict-select clearable code="USER_PERSON_TYPE"
|
<dict-select clearable code="USER_PERSON_TYPE"
|
||||||
@@ -96,13 +85,6 @@ const addUser = {
|
|||||||
v-model="pageForm.personTypes"></dict-select>
|
v-model="pageForm.personTypes"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="人员属性:">
|
|
||||||
<dict-select clearable code="USER_ATTRIBUTE"
|
|
||||||
multiple
|
|
||||||
collapse-tags
|
|
||||||
placeholder="请选择人员属性"
|
|
||||||
v-model="pageForm.userAttributes"></dict-select>
|
|
||||||
</search-item>
|
|
||||||
|
|
||||||
<search-item label="在职状态:">
|
<search-item label="在职状态:">
|
||||||
<dict-select clearable code="USER_STATE"
|
<dict-select clearable code="USER_STATE"
|
||||||
@@ -171,9 +153,7 @@ const addUser = {
|
|||||||
birthMonths: [],
|
birthMonths: [],
|
||||||
unionId: null,
|
unionId: null,
|
||||||
unitId: null,
|
unitId: null,
|
||||||
threeUnitId: null,
|
|
||||||
personTypes: [],
|
personTypes: [],
|
||||||
userAttributes: [],
|
|
||||||
preparedBys: [],
|
preparedBys: [],
|
||||||
userStates: [],
|
userStates: [],
|
||||||
isMember: null
|
isMember: null
|
||||||
@@ -181,7 +161,6 @@ const addUser = {
|
|||||||
sexOptions: ["男", "女"],
|
sexOptions: ["男", "女"],
|
||||||
unionOptions: [],
|
unionOptions: [],
|
||||||
unitOptions: [],
|
unitOptions: [],
|
||||||
threeUnitOptions: [],
|
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ prop: "loginname", label: "工号" },
|
{ prop: "loginname", label: "工号" },
|
||||||
{ prop: "username", label: "姓名" },
|
{ prop: "username", label: "姓名" },
|
||||||
@@ -190,8 +169,7 @@ const addUser = {
|
|||||||
{ prop: "personType", label: "人员类型", sortable: true },
|
{ prop: "personType", label: "人员类型", sortable: true },
|
||||||
{ prop: "userState", label: "在职状态", sortable: true },
|
{ prop: "userState", label: "在职状态", sortable: true },
|
||||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
{ prop: "unitName", label: "所属单位", sortable: true }
|
||||||
{ prop: "threeUnitName", label: "三级单位", sortable: true }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -213,10 +191,7 @@ const addUser = {
|
|||||||
this.$set(this.pageForm, "birthMonths", [])
|
this.$set(this.pageForm, "birthMonths", [])
|
||||||
this.$set(this.pageForm, "unionId", null)
|
this.$set(this.pageForm, "unionId", null)
|
||||||
this.$set(this.pageForm, "unitId", null)
|
this.$set(this.pageForm, "unitId", null)
|
||||||
this.$set(this.pageForm, "threeUnitId", null)
|
|
||||||
this.$set(this, "threeUnitOptions", [])
|
|
||||||
this.$set(this.pageForm, "personTypes", [])
|
this.$set(this.pageForm, "personTypes", [])
|
||||||
this.$set(this.pageForm, "userAttributes", [])
|
|
||||||
this.$set(this.pageForm, "preparedBys", [])
|
this.$set(this.pageForm, "preparedBys", [])
|
||||||
this.$set(this.pageForm, "userStates", [])
|
this.$set(this.pageForm, "userStates", [])
|
||||||
this.$set(this.pageForm, "isMember", null)
|
this.$set(this.pageForm, "isMember", null)
|
||||||
@@ -224,7 +199,6 @@ const addUser = {
|
|||||||
|
|
||||||
async unionIdChange(val) {
|
async unionIdChange(val) {
|
||||||
this.$set(this.pageForm, "unitId", null)
|
this.$set(this.pageForm, "unitId", null)
|
||||||
this.unitChange(null)
|
|
||||||
if (val) {
|
if (val) {
|
||||||
this.$set(this, "unitOptions", await this.$businessTool.listUnit(val))
|
this.$set(this, "unitOptions", await this.$businessTool.listUnit(val))
|
||||||
} else {
|
} else {
|
||||||
@@ -232,26 +206,6 @@ const addUser = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 所属单位改变后,仅加载该单位直属的三级单位,避免跨单位筛选。
|
|
||||||
unitChange(unitId) {
|
|
||||||
this.$set(this.pageForm, "threeUnitId", null)
|
|
||||||
this.$set(this, "threeUnitOptions", [])
|
|
||||||
if (!unitId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$axios.post("/platform/sys/unit/child", { pid: unitId })
|
|
||||||
.then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$set(this, "threeUnitOptions", res.data || [])
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.msg || "三级单位查询失败")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.$message.error("三级单位查询失败,请稍后重试")
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
pageData() {
|
pageData() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
this.$axios
|
this.$axios
|
||||||
|
|||||||
@@ -81,26 +81,12 @@ layout("/layouts/platform.html"){
|
|||||||
collapse-tags
|
collapse-tags
|
||||||
placeholder="请选择所属单位"
|
placeholder="请选择所属单位"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="unitIdsChange"
|
|
||||||
v-model="pageForm.unitIds"
|
v-model="pageForm.unitIds"
|
||||||
>
|
>
|
||||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
|
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="三级单位">
|
|
||||||
<el-select
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
multiple
|
|
||||||
collapse-tags
|
|
||||||
placeholder="请先选择所属单位"
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="pageForm.threeUnitIds"
|
|
||||||
>
|
|
||||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in threeUnitOptions"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</search-item>
|
|
||||||
|
|
||||||
<search-item label="人员类型:">
|
<search-item label="人员类型:">
|
||||||
<dict-select
|
<dict-select
|
||||||
@@ -128,10 +114,6 @@ layout("/layouts/platform.html"){
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
||||||
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="人员属性">
|
|
||||||
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
|
||||||
code="USER_ATTRIBUTE" clearable multiple collapse-tags></dict-select>
|
|
||||||
</search-item>
|
|
||||||
|
|
||||||
<!-- <search-item label="所选福利:">-->
|
<!-- <search-item label="所选福利:">-->
|
||||||
<!-- <el-select clearable placeholder="请选择所选福利" style="width: 100%" v-model="pageForm.optionId">-->
|
<!-- <el-select clearable placeholder="请选择所选福利" style="width: 100%" v-model="pageForm.optionId">-->
|
||||||
@@ -283,7 +265,6 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
unionOptions: [],
|
unionOptions: [],
|
||||||
unitOptions: [],
|
unitOptions: [],
|
||||||
threeUnitOptions: [],
|
|
||||||
sexOptions: ["男", "女"],
|
sexOptions: ["男", "女"],
|
||||||
projectSelectOptions: [],
|
projectSelectOptions: [],
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
@@ -295,7 +276,6 @@ layout("/layouts/platform.html"){
|
|||||||
{ prop: "userState", label: "在职状态", sortable: true },
|
{ prop: "userState", label: "在职状态", sortable: true },
|
||||||
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
|
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
|
||||||
{ prop: "welfareUnitName", label: "所属单位", sortable: true },
|
{ prop: "welfareUnitName", label: "所属单位", sortable: true },
|
||||||
{ prop: "threeUnitName", label: "三级单位", sortable: true },
|
|
||||||
{ prop: "remark", label: "备注", sortable: true }
|
{ prop: "remark", label: "备注", sortable: true }
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -423,32 +403,6 @@ layout("/layouts/platform.html"){
|
|||||||
this.doSearch()
|
this.doSearch()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 根据已选所属单位查询直属三级单位,筛选项只保留当前所属单位范围内的数据。
|
|
||||||
async unitIdsChange(unitIds) {
|
|
||||||
this.$set(this.pageForm, "threeUnitIds", [])
|
|
||||||
this.$set(this, "threeUnitOptions", [])
|
|
||||||
if (!unitIds || unitIds.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const responses = await Promise.all(unitIds.map((unitId) => this.$axios.post("/platform/sys/unit/child", { pid: unitId })))
|
|
||||||
const failedResponse = responses.find((res) => res.code !== 0)
|
|
||||||
if (failedResponse) {
|
|
||||||
this.$message.error(failedResponse.msg || "三级单位查询失败")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const optionMap = {}
|
|
||||||
responses.forEach((res) => {
|
|
||||||
const options = res.data || []
|
|
||||||
options.forEach((item) => {
|
|
||||||
optionMap[item.id] = item
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.$set(this, "threeUnitOptions", Object.keys(optionMap).map((id) => optionMap[id]))
|
|
||||||
} catch (e) {
|
|
||||||
this.$message.error("三级单位查询失败,请稍后重试")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pageData() {
|
pageData() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
this.$axios
|
this.$axios
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="quiz-card-scroll" v-if="!answerRecord.isFinish">
|
<div class="quiz-card-scroll" v-if="!answerRecord.isFinish">
|
||||||
|
<van-collapse v-if="activity.description" v-model="descriptionPanels" class="quiz-description" @change="adaptDescriptionToMobile">
|
||||||
|
<van-collapse-item title="说明" name="description" :value="descriptionPanels.length ? '收起' : '展开'">
|
||||||
|
<div ref="descriptionContent" class="quiz-description-content" v-html="activity.description"></div>
|
||||||
|
</van-collapse-item>
|
||||||
|
</van-collapse>
|
||||||
<div v-for="(subject, index) in subjects" :key="index" class="subject">
|
<div v-for="(subject, index) in subjects" :key="index" class="subject">
|
||||||
<p>{{index+1}}、{{ subject.title }}</p>
|
<p>{{index+1}}、{{ subject.title }}</p>
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
@@ -65,6 +70,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
H5JumpTo: GetQueryString("H5JumpTo"),
|
H5JumpTo: GetQueryString("H5JumpTo"),
|
||||||
subjects: [],
|
subjects: [],
|
||||||
activity: {},
|
activity: {},
|
||||||
|
descriptionPanels: [],
|
||||||
isFinished: false,
|
isFinished: false,
|
||||||
answerRecord: {},
|
answerRecord: {},
|
||||||
answerRecordId: null,
|
answerRecordId: null,
|
||||||
@@ -100,6 +106,28 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 按原有字号层次缩小大字,不覆盖富文本颜色、字重、对齐等样式。
|
||||||
|
adaptDescriptionToMobile() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const content = this.$refs.descriptionContent
|
||||||
|
if (!content || !this.descriptionPanels.length || content.dataset.mobileAdapted) return
|
||||||
|
// 先读取全部字号,避免父元素缩放后影响子元素的继承字号计算。
|
||||||
|
const sizes = [content, ...content.querySelectorAll('*')].map(element => ({
|
||||||
|
element,
|
||||||
|
size: parseFloat(window.getComputedStyle(element).fontSize)
|
||||||
|
}))
|
||||||
|
const maxSize = sizes.reduce((max, item) => Math.max(max, item.size || 0), 0)
|
||||||
|
if (maxSize > 22) {
|
||||||
|
const ratio = 8 / (maxSize - 14)
|
||||||
|
sizes.forEach(({ element, size }) => {
|
||||||
|
if (!Number.isFinite(size)) return
|
||||||
|
const mobileSize = size > 14 ? 14 + (size - 14) * ratio : size
|
||||||
|
element.style.setProperty('font-size', mobileSize + 'px', 'important')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
content.dataset.mobileAdapted = 'true'
|
||||||
|
})
|
||||||
|
},
|
||||||
getCategoryPageTitle(category, defaultTitle) {
|
getCategoryPageTitle(category, defaultTitle) {
|
||||||
const titleMap = {
|
const titleMap = {
|
||||||
QUIZ: "在线答题",
|
QUIZ: "在线答题",
|
||||||
@@ -412,6 +440,25 @@ layout("/layouts/platform_h5.html"){
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quiz-description {
|
||||||
|
margin-bottom: 14px;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quiz-description-content {
|
||||||
|
color: #303133;
|
||||||
|
line-height: 1.8;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/deep/ .quiz-description-content img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.subject {
|
.subject {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|||||||
@@ -276,8 +276,22 @@ layout("/layouts/platform_h5.html"){
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 导航栏参与弹层布局,正文独立滚动,避免固定导航遮住首张卡片。 */
|
||||||
|
.tour-record-popup {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-top: env(safe-area-inset-top);
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-record-popup > .van-nav-bar {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.tour-popup-body {
|
.tour-popup-body {
|
||||||
height: calc(100vh - 46px);
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 10px 12px 76px;
|
padding: 10px 12px 76px;
|
||||||
background: #f4f6f8;
|
background: #f4f6f8;
|
||||||
@@ -594,7 +608,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tour-popup-body {
|
.tour-popup-body {
|
||||||
padding: 12px 12px 82px;
|
padding: 12px 12px calc(82px + env(safe-area-inset-bottom));
|
||||||
background-color: #f3f7fd;
|
background-color: #f3f7fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -616,6 +630,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
box-shadow: 0 -6px 18px rgba(38, 66, 103, .08);
|
box-shadow: 0 -6px 18px rgba(38, 66, 103, .08);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tour-bottom-bar .tour-cancel-button {
|
||||||
|
border: 0;
|
||||||
|
color: #65748a;
|
||||||
|
background-color: #f0f2f5;
|
||||||
|
}
|
||||||
|
|
||||||
/* 列表页结构与提案校工会预审核保持一致,业务字段及操作条件继续沿用疗休养逻辑。 */
|
/* 列表页结构与提案校工会预审核保持一致,业务字段及操作条件继续沿用疗休养逻辑。 */
|
||||||
.tour-my-page .van-nav-bar {
|
.tour-my-page .van-nav-bar {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -917,8 +937,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<van-popup v-model="detailVisible" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false">
|
<van-popup v-model="detailVisible" class="tour-record-popup" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false">
|
||||||
<van-nav-bar title="报名详情" left-text="返回" left-arrow @click-left="closeHistoryPopup('detail')" fixed placeholder></van-nav-bar>
|
<van-nav-bar title="报名详情" left-text="返回" left-arrow @click-left="closeHistoryPopup('detail')"></van-nav-bar>
|
||||||
<div class="tour-popup-body">
|
<div class="tour-popup-body">
|
||||||
<div class="tour-section">
|
<div class="tour-section">
|
||||||
<div class="tour-section-title">教职工信息</div>
|
<div class="tour-section-title">教职工信息</div>
|
||||||
@@ -926,6 +946,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<van-cell title="姓名" :value="detail.userName || ''"></van-cell>
|
<van-cell title="姓名" :value="detail.userName || ''"></van-cell>
|
||||||
<van-cell title="性别" :value="detail.gender || ''"></van-cell>
|
<van-cell title="性别" :value="detail.gender || ''"></van-cell>
|
||||||
<van-cell title="身份证号" :value="detail.idCard || ''"></van-cell>
|
<van-cell title="身份证号" :value="detail.idCard || ''"></van-cell>
|
||||||
|
<van-cell title="手机号" :value="detail.mobile || ''"></van-cell>
|
||||||
<van-cell title="所在单位" :value="detail.unitName || ''"></van-cell>
|
<van-cell title="所在单位" :value="detail.unitName || ''"></van-cell>
|
||||||
<van-cell title="所在工会" :value="detail.unionName || ''"></van-cell>
|
<van-cell title="所在工会" :value="detail.unionName || ''"></van-cell>
|
||||||
</div>
|
</div>
|
||||||
@@ -972,14 +993,15 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<van-popup v-model="signupVisible" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false" @closed="destroySignup">
|
<van-popup v-model="signupVisible" class="tour-record-popup" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false" @closed="destroySignup">
|
||||||
<van-nav-bar title="修改报名" left-text="返回" left-arrow @click-left="closeHistoryPopup('signup')" fixed placeholder></van-nav-bar>
|
<van-nav-bar title="修改报名" left-text="返回" left-arrow @click-left="closeHistoryPopup('signup')"></van-nav-bar>
|
||||||
<div class="tour-popup-body">
|
<div class="tour-popup-body">
|
||||||
<div class="tour-section">
|
<div class="tour-section">
|
||||||
<div class="tour-section-title">教职工信息</div>
|
<div class="tour-section-title">教职工信息</div>
|
||||||
<van-field label="姓名" readonly v-model="signupForm.userName"></van-field>
|
<van-field label="姓名" readonly v-model="signupForm.userName"></van-field>
|
||||||
<van-field label="工号" readonly v-model="signupForm.jobNo"></van-field>
|
<van-field label="工号" readonly v-model="signupForm.jobNo"></van-field>
|
||||||
<van-field label="身份证号" v-model="signupForm.idCard" maxlength="30" placeholder="请填写身份证号"></van-field>
|
<van-field required label="身份证号" v-model="signupForm.idCard" maxlength="30" placeholder="请填写身份证号"></van-field>
|
||||||
|
<van-field required label="手机号" v-model="signupForm.mobile" type="tel" maxlength="11" placeholder="请填写手机号"></van-field>
|
||||||
<van-field label="所在工会" readonly v-model="signupForm.unionName"></van-field>
|
<van-field label="所在工会" readonly v-model="signupForm.unionName"></van-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1007,12 +1029,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
|
|
||||||
<div v-if="isDirectFamilyLine(signupForm)" class="tour-section">
|
<div v-if="isDirectFamilyLine(signupForm)" class="tour-section">
|
||||||
<div class="tour-section-title">直系亲属线路</div>
|
<div class="tour-section-title">直系亲属线路</div>
|
||||||
<van-field label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
<van-field required label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
||||||
<van-field label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
<van-field required label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
||||||
<van-field readonly clickable is-link label="亲属关系" v-model="directRelativeForm.relationshipName" placeholder="请选择亲属关系" @click="openDirectRelativePicker"></van-field>
|
<van-field required readonly clickable is-link label="亲属关系" v-model="directRelativeForm.relationshipName" placeholder="请选择亲属关系" @click="openDirectRelativePicker"></van-field>
|
||||||
<van-field label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
<van-field required label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
||||||
<van-field label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
<van-field required label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
||||||
<van-field label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
<van-field required label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="allowFamily && !isDirectFamilyLine(signupForm)" class="tour-section">
|
<div v-if="allowFamily && !isDirectFamilyLine(signupForm)" class="tour-section">
|
||||||
@@ -1054,7 +1076,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
:title="familyTabTitle(family, familyIndex)">
|
:title="familyTabTitle(family, familyIndex)">
|
||||||
<div class="tour-family-form">
|
<div class="tour-family-form">
|
||||||
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
||||||
<van-field required label="年龄" v-model.number="family.age" type="digit" placeholder="请填写年龄"></van-field>
|
<van-field required label="年龄" v-model.number="family.age" type="number" :formatter="formatFamilyAge" placeholder="请填写年龄"></van-field>
|
||||||
<van-field required label="性别">
|
<van-field required label="性别">
|
||||||
<template #input>
|
<template #input>
|
||||||
<van-radio-group v-model="family.gender" direction="horizontal">
|
<van-radio-group v-model="family.gender" direction="horizontal">
|
||||||
@@ -1065,7 +1087,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</van-field>
|
</van-field>
|
||||||
<van-field :required="familyContactRequired(family)" label="身份证号码" v-model="family.idCard" maxlength="18" placeholder="请填写身份证号码" @blur="normalizeFamilyIdCard(family)"></van-field>
|
<van-field :required="familyContactRequired(family)" label="身份证号码" v-model="family.idCard" maxlength="18" placeholder="请填写身份证号码" @blur="normalizeFamilyIdCard(family)"></van-field>
|
||||||
<van-field :required="familyContactRequired(family)" label="手机号" v-model="family.mobile" type="tel" maxlength="30" placeholder="请填写手机号"></van-field>
|
<van-field :required="familyContactRequired(family)" label="手机号" v-model="family.mobile" type="tel" maxlength="30" placeholder="请填写手机号"></van-field>
|
||||||
<van-field required readonly clickable is-link label="与本人关系" v-model="family.relationship" placeholder="请选择关系" @click="openRelationshipPicker"></van-field>
|
<van-field required readonly clickable is-link label="与本人关系" v-model="family.relationship" placeholder="请选择关系" @click="openRelationshipPicker(familyIndex)"></van-field>
|
||||||
<van-field v-if="fillBedInfo" readonly clickable is-link label="床型" v-model="family.bedType" placeholder="请选择房型" @click="openBedPicker('family')"></van-field>
|
<van-field v-if="fillBedInfo" readonly clickable is-link label="床型" v-model="family.bedType" placeholder="请选择房型" @click="openBedPicker('family')"></van-field>
|
||||||
<van-field v-if="fillBedInfo" label="床位" v-model="family.bedInfo" maxlength="100" placeholder="请输入床位数量"></van-field>
|
<van-field v-if="fillBedInfo" label="床位" v-model="family.bedInfo" maxlength="100" placeholder="请输入床位数量"></van-field>
|
||||||
<van-field v-if="fillBedInfo" label="意向拼床人" v-model="family.intendedRoommate" maxlength="100" placeholder="请输入意向拼床人"></van-field>
|
<van-field v-if="fillBedInfo" label="意向拼床人" v-model="family.intendedRoommate" maxlength="100" placeholder="请输入意向拼床人"></van-field>
|
||||||
@@ -1087,8 +1109,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<div v-else class="tour-family-empty">暂无亲属,请按需添加</div>
|
<div v-else class="tour-family-empty">暂无亲属,请按需添加</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tour-bottom-bar">
|
<div class="tour-bottom-bar tour-h5-fixed-bar">
|
||||||
<van-button v-if="signupForm.id" type="danger" plain block round :loading="cancelLoading" @click="cancelSignup">取消报名</van-button>
|
<van-button v-if="signupForm.id" class="tour-cancel-button" type="default" block round :loading="cancelLoading" @click="cancelSignup">取消报名</van-button>
|
||||||
<van-button type="info" block round :loading="signupLoading" @click="submitSignup">提交</van-button>
|
<van-button type="info" block round :loading="signupLoading" @click="submitSignup">提交</van-button>
|
||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
@@ -1442,6 +1464,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
userName: "",
|
userName: "",
|
||||||
gender: "",
|
gender: "",
|
||||||
idCard: "",
|
idCard: "",
|
||||||
|
mobile: "",
|
||||||
unitId: "",
|
unitId: "",
|
||||||
unitName: "",
|
unitName: "",
|
||||||
unionId: "",
|
unionId: "",
|
||||||
@@ -1601,6 +1624,11 @@ layout("/layouts/platform_h5.html"){
|
|||||||
isBlankValue(value) {
|
isBlankValue(value) {
|
||||||
return value === undefined || value === null || !String(value).trim()
|
return value === undefined || value === null || !String(value).trim()
|
||||||
},
|
},
|
||||||
|
// 与 Web 端一致,亲属年龄限定为 0~120 岁整数,清空时保留必填状态。
|
||||||
|
formatFamilyAge(value) {
|
||||||
|
const age = parseInt(value, 10)
|
||||||
|
return Number.isNaN(age) ? "" : String(Math.min(120, Math.max(0, age)))
|
||||||
|
},
|
||||||
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
||||||
|
|||||||
@@ -307,9 +307,9 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
|
|
||||||
<div v-if="isDirectFamilyLine(signupForm)" class="tour-apply-card">
|
<div v-if="isDirectFamilyLine(signupForm)" class="tour-apply-card">
|
||||||
<div class="tour-apply-title">直系亲属线路</div>
|
<div class="tour-apply-title">直系亲属线路</div>
|
||||||
<van-field label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
<van-field required label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
||||||
<van-field label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
<van-field required label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
||||||
<van-field
|
<van-field required
|
||||||
label="亲属关系"
|
label="亲属关系"
|
||||||
readonly
|
readonly
|
||||||
clickable
|
clickable
|
||||||
@@ -318,9 +318,9 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
v-model="directRelativeForm.relationshipName"
|
v-model="directRelativeForm.relationshipName"
|
||||||
@click="openDirectRelativePicker">
|
@click="openDirectRelativePicker">
|
||||||
</van-field>
|
</van-field>
|
||||||
<van-field label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
<van-field required label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
||||||
<van-field label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
<van-field required label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
||||||
<van-field label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
<van-field required label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tour-apply-card">
|
<div class="tour-apply-card">
|
||||||
@@ -365,7 +365,7 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
:title="familyTabTitle(family, familyIndex)">
|
:title="familyTabTitle(family, familyIndex)">
|
||||||
<div class="tour-family-form">
|
<div class="tour-family-form">
|
||||||
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
||||||
<van-field required label="年龄" v-model.number="family.age" type="digit" placeholder="请填写年龄"></van-field>
|
<van-field required label="年龄" v-model.number="family.age" type="number" :formatter="formatFamilyAge" placeholder="请填写年龄"></van-field>
|
||||||
<van-field required label="性别">
|
<van-field required label="性别">
|
||||||
<template #input>
|
<template #input>
|
||||||
<van-radio-group v-model="family.gender" direction="horizontal">
|
<van-radio-group v-model="family.gender" direction="horizontal">
|
||||||
@@ -753,6 +753,11 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
isBlankValue(value) {
|
isBlankValue(value) {
|
||||||
return value === undefined || value === null || !String(value).trim()
|
return value === undefined || value === null || !String(value).trim()
|
||||||
},
|
},
|
||||||
|
// 与 Web 端一致,亲属年龄限定为 0~120 岁整数,清空时保留必填状态。
|
||||||
|
formatFamilyAge(value) {
|
||||||
|
const age = parseInt(value, 10)
|
||||||
|
return Number.isNaN(age) ? "" : String(Math.min(120, Math.max(0, age)))
|
||||||
|
},
|
||||||
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
||||||
|
|||||||
+1
-10
@@ -404,14 +404,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 缺失或非法日期回填为空,避免生成十二位 Invalid date;不使用当天日期补缺。
|
|
||||||
formatArrivalAtSchoolDate(value) {
|
|
||||||
if (value === null || value === undefined || String(value).trim() === '') {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
const date = this.$moment(value, this.$moment.ISO_8601, true)
|
|
||||||
return date.isValid() ? date.format('YYYY-MM-DD') : ''
|
|
||||||
},
|
|
||||||
handlePageBack() {
|
handlePageBack() {
|
||||||
if (window.h5HistoryLayerManager.stack.length) {
|
if (window.h5HistoryLayerManager.stack.length) {
|
||||||
window.h5HistoryLayerManager.close()
|
window.h5HistoryLayerManager.close()
|
||||||
@@ -600,7 +592,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$set(this, "formData", res.data)
|
this.$set(this, "formData", res.data)
|
||||||
this.$set(this.formData, "arrivalAtSchoolDate", this.formatArrivalAtSchoolDate(res.data.arrivalAtSchoolDate))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -658,7 +649,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$set(this.formData, "email", email)
|
this.$set(this.formData, "email", email)
|
||||||
this.$set(this.formData, "families", families ? families : [])
|
this.$set(this.formData, "families", families ? families : [])
|
||||||
this.$set(this.formData, "personalData", personalData)
|
this.$set(this.formData, "personalData", personalData)
|
||||||
this.$set(this.formData, "arrivalAtSchoolDate", this.formatArrivalAtSchoolDate(arrivalAtSchoolDate))
|
this.$set(this.formData, "arrivalAtSchoolDate", this.$moment(arrivalAtSchoolDate).format("YYYY-MM-DD"))
|
||||||
|
|
||||||
// 处理校区信息
|
// 处理校区信息
|
||||||
if (campus) {
|
if (campus) {
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ const home = {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 暂停展示我的课堂,保留模板供后续恢复。
|
|
||||||
<div class="classroom-section">
|
<div class="classroom-section">
|
||||||
<div class="classroom-section__head">
|
<div class="classroom-section__head">
|
||||||
<div class="classroom-section__title">我的课堂</div>
|
<div class="classroom-section__title">我的课堂</div>
|
||||||
@@ -193,9 +192,6 @@ const home = {
|
|||||||
<div v-else-if="!classroomLoading" class="classroom-empty">暂无课程</div>
|
<div v-else-if="!classroomLoading" class="classroom-empty">暂无课程</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- 暂停展示政策文件,待接入内容后恢复。
|
|
||||||
<div class="policy-panel">
|
<div class="policy-panel">
|
||||||
<div class="entry-panel__heading">
|
<div class="entry-panel__heading">
|
||||||
<span class="entry-panel__icon entry-panel__icon--policy"><van-icon name="description"></van-icon></span>
|
<span class="entry-panel__icon entry-panel__icon--policy"><van-icon name="description"></van-icon></span>
|
||||||
@@ -207,8 +203,6 @@ const home = {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
<div class="act-list" v-if="showLatestActivity">
|
<div class="act-list" v-if="showLatestActivity">
|
||||||
<div class="section-title section-title--hidden">最新活动</div>
|
<div class="section-title section-title--hidden">最新活动</div>
|
||||||
<template v-if="activityOptions && activityOptions.length > 0">
|
<template v-if="activityOptions && activityOptions.length > 0">
|
||||||
@@ -282,7 +276,6 @@ const home = {
|
|||||||
className: "feature-card--model",
|
className: "feature-card--model",
|
||||||
href: "/platform/honor/manage/h5"
|
href: "/platform/honor/manage/h5"
|
||||||
},
|
},
|
||||||
/* 暂停展示普惠信息,保留入口配置供后续接入。
|
|
||||||
{
|
{
|
||||||
name: "普惠信息",
|
name: "普惠信息",
|
||||||
desc: "普惠服务信息",
|
desc: "普惠服务信息",
|
||||||
@@ -291,7 +284,6 @@ const home = {
|
|||||||
className: "feature-card--inclusive",
|
className: "feature-card--inclusive",
|
||||||
href: ""
|
href: ""
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
],
|
],
|
||||||
appLogo: "",
|
appLogo: "",
|
||||||
appName: "",
|
appName: "",
|
||||||
@@ -621,9 +613,8 @@ const home = {
|
|||||||
created() {
|
created() {
|
||||||
this.listHomeBrand()
|
this.listHomeBrand()
|
||||||
this.listRecommendApp()
|
this.listRecommendApp()
|
||||||
// 我的课堂暂停展示,同步停用课程及推荐标签请求,恢复模块时再启用。
|
this.listClassroomCourses()
|
||||||
// this.listClassroomCourses()
|
this.listClassroomRecommendOptions()
|
||||||
// this.listClassroomRecommendOptions()
|
|
||||||
this.listSpreadHomeContent()
|
this.listSpreadHomeContent()
|
||||||
if (this.showLatestActivity) {
|
if (this.showLatestActivity) {
|
||||||
this.listActivity()
|
this.listActivity()
|
||||||
@@ -909,8 +900,7 @@ const home = {
|
|||||||
margin: 0 12px 7px;
|
margin: 0 12px 7px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1.08fr 1fr;
|
grid-template-columns: 1.08fr 1fr;
|
||||||
/* 普惠入口暂停展示,取消其第三行占位,避免留下空白。 */
|
grid-template-rows: 86px 86px 92px;
|
||||||
grid-template-rows: 86px 86px;
|
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user