From 2706b59ab1632d2fedf5879e8be302dd18814599 Mon Sep 17 00:00:00 2001 From: 3y Date: Sat, 22 Jan 2022 17:51:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=20=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=20=E5=92=8C=20=E6=96=B0=E5=A2=9E=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/crud-edit.json | 41 +++++++- pages/crud-list.json | 65 ++++++++---- pages/crud-new.json | 230 ++++++++++++++++++++++++++++++++++--------- pages/site.json | 95 +++--------------- 4 files changed, 282 insertions(+), 149 deletions(-) diff --git a/pages/crud-edit.json b/pages/crud-edit.json index c5144b0..1a8fb83 100644 --- a/pages/crud-edit.json +++ b/pages/crud-edit.json @@ -13,10 +13,49 @@ "body": [ { "type": "form", - "initApi": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/${params.id}", + "initApi": "http://localhost:8080/messageTemplate/queryById/${params.id}", "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/$id", "redirect": "/crud/list", "controls": [ + { + "type": "text", + "name": "id", + "label": "ID", + "width": 20, + "required": true + }, + { + "type": "text", + "name": "name", + "label": "name" + }, + { + "type": "radios", + "name": "idType", + "label": "接收者ID类型", + "options": [ + { + "label": "用户ID", + "value": "10" + }, + { + "label": "设备号", + "value": "20" + }, + { + "label": "手机号", + "value": "30" + }, + { + "label": "openID", + "value": "40" + }, + { + "label": "邮箱地址", + "value": "50" + } + ] + }, { "type": "text", "name": "engine", diff --git a/pages/crud-list.json b/pages/crud-list.json index 765f088..9b76ae7 100644 --- a/pages/crud-list.json +++ b/pages/crud-list.json @@ -1,6 +1,6 @@ { "type": "page", - "title": "列表.", + "title": "列表管理", "remark": null, "name": "page-demo", "toolbar": [ @@ -8,6 +8,7 @@ "type": "button", "actionType": "link", "link": "/crud/new", + "icon": "fa fa-plus", "label": "新增", "primary": true } @@ -16,7 +17,7 @@ { "type": "crud", "name": "sample", - "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample", + "api": "http://localhost:8080/messageTemplate/list", "filter": { "title": "", "mode": "inline", @@ -69,11 +70,6 @@ } ], "columns": [ - { - "name": "engine", - "label": "Rendering engine", - "sortable": true - }, { "name": "id", "label": "ID", @@ -81,22 +77,37 @@ "sortable": true }, { - "name": "browser", - "label": "Browser", - "sortable": true + "name": "name", + "label": "模板消息名" }, { - "name": "platform", - "label": "Platform(s)", - "sortable": true + "name": "sendChannel", + "label": "发送渠道", + "type": "mapping", + "map": { + "10": "IM站内信", + "20": "PUSH通知栏", + "30": "短信", + "40": "邮箱", + "50": "服务号", + "60": "小程序" + } }, { - "name": "version", - "label": "Engine version" + "name": "creator", + "label": "创建者" }, { - "name": "grade", - "label": "CSS grade" + "name": "idType", + "label": "接收者ID类型", + "type": "mapping", + "map": { + "10": "用户ID", + "20": "设备号", + "30": "手机号", + "40": "openId", + "50": "邮箱地址" + } }, { "type": "operation", @@ -106,6 +117,26 @@ { "type": "button-group", "buttons": [ + { + "type": "button", + "label": "测试", + "level": "primary", + "actionType": "dialog", + "dialog": { + "title": "测试一条消息", + "body": { + "type": "form", + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm", + "body": [ + { + "type": "input-text", + "name": "groupName", + "label": "接收者" + } + ] + } + } + }, { "type": "button", "label": "查看", diff --git a/pages/crud-new.json b/pages/crud-new.json index 49bf000..01dfc99 100644 --- a/pages/crud-new.json +++ b/pages/crud-new.json @@ -1,7 +1,6 @@ { "type": "page", - "title": "新增", - "remark": null, + "title": "新建消息模板配置", "toolbar": [ { "type": "button", @@ -12,58 +11,193 @@ ], "body": [ { - "title": "", "type": "form", - "redirect": "/crud/list", - "name": "sample-edit-form", - "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample", - "controls": [ - { - "type": "text", - "name": "engine", - "label": "Engine", - "required": true, - "inline": false, - "description": "", - "descriptionClassName": "help-block", - "placeholder": "", - "addOn": null - }, - { - "type": "divider" - }, - { - "type": "text", - "name": "browser", - "label": "Browser", - "required": true - }, - { - "type": "divider" - }, - { - "type": "text", - "name": "platform", - "label": "Platform(s)", - "required": true - }, - { - "type": "divider" - }, + "mode": "horizontal", + "title": "", + "affixFooter": true, + "api": "http://localhost:8080/messageTemplate/save", + "actions": [ { - "type": "text", - "name": "version", - "label": "Engine version" - }, + "label": "保存", + "type": "submit", + "level": "success" + } + ], + "body": [ { - "type": "divider" + "type": "fieldSet", + "title": "基本配置", + "body": [ + { + "type": "input-text", + "label": "模板名称", + "name": "name", + "size": "md", + "required": true + }, + { + "type": "radios", + "label": "接收者Id类型", + "name": "idType", + "options": [ + { + "label": "用户ID", + "value": "10" + }, + { + "label": "设备号", + "value": "20" + }, + { + "label": "手机号", + "value": "30" + }, + { + "label": "openID", + "value": "40" + }, + { + "label": "邮箱地址", + "value": "50" + } + ], + "required": true + }, + { + "type": "radios", + "label": "消息类型", + "name": "msgType", + "options": [ + { + "label": "通知类", + "value": "10" + }, + { + "label": "营销类", + "value": "20" + }, + { + "label": "验证码", + "value": "30" + } + ], + "required": true + }, + { + "type": "radios", + "label": "消息模板类型", + "name": "templateType", + "options": [ + { + "label": "定时", + "value": "10" + }, + { + "label": "实时", + "value": "20" + } + ], + "required": true + }, + { + "type": "input-text", + "label": "cron表达式", + "name": "expectPushTime", + "size": "md", + "visibleOn": "this.templateType == 10", + "clearValueOnHidden": false, + "visible": "", + "required": true + }, + { + "type": "input-text", + "label": "模板业务方", + "name": "proposer", + "size": "md", + "mode": "", + "description": "" + } + ] }, { - "type": "text", - "name": "grade", - "label": "CSS grade" + "type": "fieldSet", + "title": "渠道信息", + "body": [ + { + "type": "radios", + "label": "发送渠道", + "name": "sendChannel", + "options": [ + { + "label": "IM站内信", + "value": "10" + }, + { + "label": "PUSH通知栏", + "value": "20" + }, + { + "label": "短信", + "value": "30" + }, + { + "label": "邮箱", + "value": "40" + }, + { + "label": "服务号", + "value": "50" + }, + { + "label": "小程序", + "value": "60" + } + ], + "required": true + }, + { + "type": "select", + "label": "短信账号", + "name": "sendAccount", + "options": [ + { + "label": "腾讯云通知", + "value": "10" + }, + { + "label": "腾讯云营销", + "value": "20" + } + ], + "visibleOn": "this.sendChannel == 30", + "clearValueOnHidden": false, + "required": true, + "size": "lg" + }, + { + "type": "input-text", + "label": "短信内容", + "name": "content", + "required": true, + "visibleOn": "this.sendChannel == 30", + "mode": "", + "size": "lg", + "clearValueOnHidden": false + }, + { + "type": "input-text", + "label": "短信链接", + "name": "url", + "visibleOn": "this.sendChannel == 30", + "size": "lg", + "clearValueOnHidden": false + } + ], + "className": "" } - ] + ], + "panelClassName": "Panel--default", + "bodyClassName": "text-lg" } ] } diff --git a/pages/site.json b/pages/site.json index f710212..c69dde7 100644 --- a/pages/site.json +++ b/pages/site.json @@ -9,87 +9,32 @@ "redirect": "/index/1" }, { - "label": "示例", + "label": "消息模板管理", "children": [ { - "label": "页面A", - "url": "index", - "schema": { - "type": "page", - "title": "页面A", - "body": "页面A" - }, - "children": [ - { - "label": "页面A-1", - "url": "1", - "schema": { - "type": "page", - "title": "页面A-1", - "body": "页面A-1" - } - }, - { - "label": "页面A-2", - "url": "2", - "schema": { - "type": "page", - "title": "页面A-2", - "body": "页面A-2" - } - }, - { - "label": "页面A-3", - "url": "3", - "schema": { - "type": "page", - "title": "页面A-3", - "body": "页面A-3" - } - } - ] - }, - { - "label": "页面B", - "schema": { - "type": "page", - "title": "页面B", - "body": "页面B" - } - }, - { - "label": "页面C", - "schema": { - "type": "page", - "title": "页面C", - "body": "页面C" - } - }, - { - "label": "列表示例", + "label": "消息模板管理", "url": "/crud", "rewrite": "/crud/list", "icon": "fa fa-cube", "children": [ { - "label": "列表", - "url": "/crud/list", - "icon": "fa fa-list", - "schemaApi": "get:/pages/crud-list.json" - }, - { - "label": "新增", + "label": "新增模板", "url": "/crud/new", "icon": "fa fa-plus", "schemaApi": "get:/pages/crud-new.json" }, { - "label": "查看", + "label": "模板列表", + "url": "/crud/list", + "icon": "fa fa-list", + "schemaApi": "get:/pages/crud-list.json" + }, + { "url": "/crud/:id", "schemaApi": "get:/pages/crud-view.json" }, { - "label": "修改", + "url": "/crud/:id/edit", "schemaApi": "get:/pages/crud-edit.json" } @@ -98,27 +43,11 @@ ] }, { - "label": "分组2", + "label": "数据管理", "children": [ { - "label": "用户管理", - "schema": { - "type": "page", - "title": "用户管理", - "body": "页面C" - } - }, - { - "label": "外部链接", + "label": "全链路追踪", "link": "http://baidu.gitee.io/amis" - }, - { - "label": "部门管理", - "schemaApi": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/service/form?tpl=tpl3" - }, - { - "label": "jsonp 返回示例", - "schemaApi": "jsonp:/pages/jsonp.js?callback=jsonpCallback" } ] }