feat: wire schedule notifications and data import downloads
Some checks failed
ci / build-test-parity (push) Has been cancelled
Some checks failed
ci / build-test-parity (push) Has been cancelled
This commit is contained in:
@@ -107,10 +107,16 @@ public final class EngineclassDelta {
|
||||
register("com.dsasp.client.tools.schedulejob.ScheduleJobDesignComponent",
|
||||
EngineclassDelta::scheduleJobScriptButton);
|
||||
|
||||
// 数据导入配置管理:DataImportConfigView 加「编辑转换脚本 / 编辑保存脚本」。
|
||||
// 设置定时任务:ScheduleJobSettingComponent 加「设置提醒人」,结构化编辑 SENDINFO JSON。
|
||||
register("com.dsasp.client.tools.schedulejob.ScheduleJobSettingComponent",
|
||||
EngineclassDelta::scheduleJobNotifyButton);
|
||||
|
||||
// 数据导入配置管理:DataImportConfigView 加「编辑转换脚本 / 编辑保存脚本 / 下载模板 / 下载基础数据」。
|
||||
register("com.dsasp.client.dataimport.view.DataImportConfigView",
|
||||
EngineclassDelta::dataImportConvertScriptButton,
|
||||
EngineclassDelta::dataImportSaveScriptButton);
|
||||
EngineclassDelta::dataImportSaveScriptButton,
|
||||
EngineclassDelta::dataImportTemplateDownloadButton,
|
||||
EngineclassDelta::dataImportBaseDataDownloadButton);
|
||||
|
||||
// 功能/视图管理与自定义列表:先补高级配置 XML 源码编辑入口;可视化设计器另走独立路由。
|
||||
register("com.dsasp.client.viewframework.component.UserFunDesignComponent",
|
||||
@@ -576,6 +582,161 @@ public final class EngineclassDelta {
|
||||
"SYS_DATAIMPORTCONFIG", "SYS_DATAIMPORTCONFIG_ID", pkField, "SAVESCRIPT", "java");
|
||||
}
|
||||
|
||||
private static Map<String, Object> dataImportTemplateDownloadButton(String pkField) {
|
||||
return downloadButton("下载模板", "fa fa-download",
|
||||
"/api/dataimport/template?configId=" + selectedSingleFieldExpr(pkField));
|
||||
}
|
||||
|
||||
private static Map<String, Object> dataImportBaseDataDownloadButton(String pkField) {
|
||||
return downloadButton("下载基础数据", "fa fa-download", "/api/dataimport/basedata");
|
||||
}
|
||||
|
||||
private static Map<String, Object> scheduleJobNotifyButton(String pkField) {
|
||||
String idExpr = selectedSingleFieldExpr(pkField);
|
||||
Map<String, Object> form = mapOf(
|
||||
"type", "form",
|
||||
"id", "schedulejob-notify-form",
|
||||
"wrapWithPanel", false,
|
||||
"initApi", mapOf(
|
||||
"method", "get",
|
||||
"url", "/api/schedulejob/" + idExpr + "/notify"),
|
||||
"api", mapOf(
|
||||
"method", "post",
|
||||
"url", "/api/schedulejob/" + idExpr + "/notify",
|
||||
"data", mapOf("items", "${items}")),
|
||||
"body", List.of(scheduleJobNotifyTable()));
|
||||
Map<String, Object> btn = new LinkedHashMap<>();
|
||||
btn.put("type", "button");
|
||||
btn.put("id", "设置提醒人");
|
||||
btn.put("label", "设置提醒人");
|
||||
btn.put("icon", "fa fa-bell");
|
||||
btn.put("disabledOn", "${!selectedItems || selectedItems.length !== 1}");
|
||||
btn.put("actionType", "dialog");
|
||||
btn.put("dialog", mapOf(
|
||||
"type", "dialog",
|
||||
"title", "设置提醒人",
|
||||
"size", "xl",
|
||||
"body", form,
|
||||
"actions", formActions()));
|
||||
return btn;
|
||||
}
|
||||
|
||||
private static Map<String, Object> scheduleJobNotifyTable() {
|
||||
Map<String, Object> table = new LinkedHashMap<>();
|
||||
table.put("type", "input-table");
|
||||
table.put("name", "items");
|
||||
table.put("label", false);
|
||||
table.put("needConfirm", false);
|
||||
table.put("addable", true);
|
||||
table.put("removable", true);
|
||||
table.put("copyable", false);
|
||||
table.put("columns", List.of(
|
||||
inputTableColumn("type", "基于", 140, mapOf(
|
||||
"type", "select",
|
||||
"name", "type",
|
||||
"clearable", false,
|
||||
"options", List.of(
|
||||
mapOf("label", "用户", "value", "user"),
|
||||
mapOf("label", "部门", "value", "depart"),
|
||||
mapOf("label", "岗位", "value", "position"),
|
||||
mapOf("label", "指定维度岗位类别负责人", "value", "fixedDimension"),
|
||||
mapOf("label", "所属公司岗位类别", "value", "formSpecifiedDimension"),
|
||||
mapOf("label", "基于项目角色", "value", "projectRoleType")))),
|
||||
inputTableColumn("users", "用户", 280, notifyPicker("users",
|
||||
"76d2f950-ef40-4eff-89ec-98ad9a4976b9"), "${type === 'user'}"),
|
||||
inputTableColumn("departs", "部门", 280, notifyPicker("departs",
|
||||
"138b7ca7-befb-4a0c-bfc6-ed8fb4d4e434"), "${type === 'depart'}"),
|
||||
inputTableColumn("positions", "岗位", 280, notifyPicker("positions",
|
||||
"feeee51d-d41b-410b-b7a4-67d61ec8c4df"), "${type === 'position'}"),
|
||||
inputTableColumn("dimensionId", "维度", 180, mapOf(
|
||||
"type", "select",
|
||||
"name", "dimensionId",
|
||||
"source", "/api/schedulejob/dimensions/options",
|
||||
"clearable", true), "${type === 'fixedDimension'}"),
|
||||
inputTableColumn("positionTypes", "岗位类别", 280, notifyPicker("positionTypes",
|
||||
"8c19a765-047e-4a5c-8657-eb16c013ba65"),
|
||||
"${type === 'fixedDimension' || type === 'formSpecifiedDimension'}"),
|
||||
inputTableColumn("projectRoles", "项目角色", 260, mapOf(
|
||||
"type", "checkboxes",
|
||||
"name", "projectRoles",
|
||||
"source", "/api/schedulejob/project-role-options"), "${type === 'projectRoleType'}"),
|
||||
inputTableColumn("content", "原始内容", 220, mapOf(
|
||||
"type", "input-text",
|
||||
"name", "content",
|
||||
"clearable", true),
|
||||
"${type !== 'user' && type !== 'depart' && type !== 'position' "
|
||||
+ "&& type !== 'fixedDimension' && type !== 'formSpecifiedDimension' "
|
||||
+ "&& type !== 'projectRoleType'}"),
|
||||
inputTableColumn("isSendMessage", "短消息", 80, mapOf(
|
||||
"type", "checkbox",
|
||||
"name", "isSendMessage")),
|
||||
inputTableColumn("isSendMail", "邮件", 80, mapOf(
|
||||
"type", "checkbox",
|
||||
"name", "isSendMail")),
|
||||
inputTableColumn("isSendPhone", "手机", 80, mapOf(
|
||||
"type", "checkbox",
|
||||
"name", "isSendPhone"))));
|
||||
return table;
|
||||
}
|
||||
|
||||
private static Map<String, Object> inputTableColumn(String name, String label, int width,
|
||||
Map<String, Object> quickEdit) {
|
||||
return inputTableColumn(name, label, width, quickEdit, null);
|
||||
}
|
||||
|
||||
private static Map<String, Object> inputTableColumn(String name, String label, int width,
|
||||
Map<String, Object> quickEdit, String visibleOn) {
|
||||
Map<String, Object> col = new LinkedHashMap<>();
|
||||
col.put("name", name);
|
||||
col.put("label", label);
|
||||
col.put("width", width);
|
||||
col.put("quickEdit", quickEdit);
|
||||
if (visibleOn != null && !visibleOn.isBlank()) {
|
||||
col.put("visibleOn", visibleOn);
|
||||
}
|
||||
return col;
|
||||
}
|
||||
|
||||
private static Map<String, Object> notifyPicker(String name, String dialogId) {
|
||||
Map<String, Object> picker = new LinkedHashMap<>();
|
||||
picker.put("type", "picker");
|
||||
picker.put("name", name);
|
||||
picker.put("multiple", true);
|
||||
picker.put("joinValues", false);
|
||||
picker.put("extractValue", false);
|
||||
picker.put("valueField", "_id");
|
||||
picker.put("labelField", "_label");
|
||||
picker.put("source", "/api/picker/" + dialogId + "/list");
|
||||
picker.put("modalMode", "dialog");
|
||||
picker.put("overflowConfig", mapOf("maxTagCount", 1));
|
||||
picker.put("pickerSchema", mapOf(
|
||||
"mode", "table",
|
||||
"filter", mapOf(
|
||||
"title", "",
|
||||
"body", List.of(mapOf(
|
||||
"type", "input-text",
|
||||
"name", "q",
|
||||
"label", "关键字",
|
||||
"clearable", true))),
|
||||
"columns", List.of(mapOf("name", "_label", "label", "名称")),
|
||||
"footerToolbar", List.of("pagination")));
|
||||
return picker;
|
||||
}
|
||||
|
||||
private static Map<String, Object> downloadButton(String label, String icon, String url) {
|
||||
Map<String, Object> btn = new LinkedHashMap<>();
|
||||
btn.put("type", "button");
|
||||
btn.put("id", label);
|
||||
btn.put("label", label);
|
||||
btn.put("icon", icon);
|
||||
if (!label.equals("下载基础数据")) {
|
||||
btn.put("disabledOn", "${!selectedItems || selectedItems.length !== 1}");
|
||||
}
|
||||
btn.put("actionType", "download");
|
||||
btn.put("api", mapOf("method", "get", "url", url));
|
||||
return btn;
|
||||
}
|
||||
|
||||
private static Map<String, Object> viewTemplateXmlButton(String pkField) {
|
||||
return fieldEditorButton("高级配置", "fa fa-code",
|
||||
"VIEW_TEMPLATE", "VIEW_TEMPLATE_ID", pkField, "XML", "xml");
|
||||
|
||||
Reference in New Issue
Block a user