配置 列表页 和 新增页的页面

master
3y 3 years ago
parent 423cda497a
commit 2706b59ab1

@ -13,10 +13,49 @@
"body": [ "body": [
{ {
"type": "form", "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", "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/$id",
"redirect": "/crud/list", "redirect": "/crud/list",
"controls": [ "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", "type": "text",
"name": "engine", "name": "engine",

@ -1,6 +1,6 @@
{ {
"type": "page", "type": "page",
"title": "列表.", "title": "列表管理",
"remark": null, "remark": null,
"name": "page-demo", "name": "page-demo",
"toolbar": [ "toolbar": [
@ -8,6 +8,7 @@
"type": "button", "type": "button",
"actionType": "link", "actionType": "link",
"link": "/crud/new", "link": "/crud/new",
"icon": "fa fa-plus",
"label": "新增", "label": "新增",
"primary": true "primary": true
} }
@ -16,7 +17,7 @@
{ {
"type": "crud", "type": "crud",
"name": "sample", "name": "sample",
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample", "api": "http://localhost:8080/messageTemplate/list",
"filter": { "filter": {
"title": "", "title": "",
"mode": "inline", "mode": "inline",
@ -69,11 +70,6 @@
} }
], ],
"columns": [ "columns": [
{
"name": "engine",
"label": "Rendering engine",
"sortable": true
},
{ {
"name": "id", "name": "id",
"label": "ID", "label": "ID",
@ -81,22 +77,37 @@
"sortable": true "sortable": true
}, },
{ {
"name": "browser", "name": "name",
"label": "Browser", "label": "模板消息名"
"sortable": true
}, },
{ {
"name": "platform", "name": "sendChannel",
"label": "Platform(s)", "label": "发送渠道",
"sortable": true "type": "mapping",
"map": {
"10": "IM站内信",
"20": "PUSH通知栏",
"30": "短信",
"40": "邮箱",
"50": "服务号",
"60": "小程序"
}
}, },
{ {
"name": "version", "name": "creator",
"label": "Engine version" "label": "创建者"
}, },
{ {
"name": "grade", "name": "idType",
"label": "CSS grade" "label": "接收者ID类型",
"type": "mapping",
"map": {
"10": "用户ID",
"20": "设备号",
"30": "手机号",
"40": "openId",
"50": "邮箱地址"
}
}, },
{ {
"type": "operation", "type": "operation",
@ -106,6 +117,26 @@
{ {
"type": "button-group", "type": "button-group",
"buttons": [ "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", "type": "button",
"label": "查看", "label": "查看",

@ -1,7 +1,6 @@
{ {
"type": "page", "type": "page",
"title": "新增", "title": "新建消息模板配置",
"remark": null,
"toolbar": [ "toolbar": [
{ {
"type": "button", "type": "button",
@ -12,58 +11,193 @@
], ],
"body": [ "body": [
{ {
"title": "",
"type": "form", "type": "form",
"redirect": "/crud/list", "mode": "horizontal",
"name": "sample-edit-form", "title": "",
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample", "affixFooter": true,
"controls": [ "api": "http://localhost:8080/messageTemplate/save",
{ "actions": [
"type": "text", {
"name": "engine", "label": "保存",
"label": "Engine", "type": "submit",
"required": true, "level": "success"
"inline": false, }
"description": "", ],
"descriptionClassName": "help-block", "body": [
"placeholder": "", {
"addOn": null "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"
}, },
{ {
"type": "divider" "label": "手机号",
"value": "30"
}, },
{ {
"type": "text", "label": "openID",
"name": "browser", "value": "40"
"label": "Browser", },
{
"label": "邮箱地址",
"value": "50"
}
],
"required": true "required": true
}, },
{ {
"type": "divider" "type": "radios",
"label": "消息类型",
"name": "msgType",
"options": [
{
"label": "通知类",
"value": "10"
},
{
"label": "营销类",
"value": "20"
}, },
{ {
"type": "text", "label": "验证码",
"name": "platform", "value": "30"
"label": "Platform(s)", }
],
"required": true "required": true
}, },
{ {
"type": "divider" "type": "radios",
"label": "消息模板类型",
"name": "templateType",
"options": [
{
"label": "定时",
"value": "10"
}, },
{ {
"type": "text", "label": "实时",
"name": "version", "value": "20"
"label": "Engine version" }
],
"required": true
}, },
{ {
"type": "divider" "type": "input-text",
"label": "cron表达式",
"name": "expectPushTime",
"size": "md",
"visibleOn": "this.templateType == 10",
"clearValueOnHidden": false,
"visible": "",
"required": true
}, },
{ {
"type": "text", "type": "input-text",
"name": "grade", "label": "模板业务方",
"label": "CSS grade" "name": "proposer",
"size": "md",
"mode": "",
"description": ""
} }
] ]
},
{
"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"
} }
] ]
} }

@ -9,87 +9,32 @@
"redirect": "/index/1" "redirect": "/index/1"
}, },
{ {
"label": "示例", "label": "消息模板管理",
"children": [ "children": [
{ {
"label": "页面A", "label": "消息模板管理",
"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": "列表示例",
"url": "/crud", "url": "/crud",
"rewrite": "/crud/list", "rewrite": "/crud/list",
"icon": "fa fa-cube", "icon": "fa fa-cube",
"children": [ "children": [
{ {
"label": "列表", "label": "新增模板",
"url": "/crud/list",
"icon": "fa fa-list",
"schemaApi": "get:/pages/crud-list.json"
},
{
"label": "新增",
"url": "/crud/new", "url": "/crud/new",
"icon": "fa fa-plus", "icon": "fa fa-plus",
"schemaApi": "get:/pages/crud-new.json" "schemaApi": "get:/pages/crud-new.json"
}, },
{ {
"label": "查看", "label": "模板列表",
"url": "/crud/list",
"icon": "fa fa-list",
"schemaApi": "get:/pages/crud-list.json"
},
{
"url": "/crud/:id", "url": "/crud/:id",
"schemaApi": "get:/pages/crud-view.json" "schemaApi": "get:/pages/crud-view.json"
}, },
{ {
"label": "修改",
"url": "/crud/:id/edit", "url": "/crud/:id/edit",
"schemaApi": "get:/pages/crud-edit.json" "schemaApi": "get:/pages/crud-edit.json"
} }
@ -98,27 +43,11 @@
] ]
}, },
{ {
"label": "分组2", "label": "数据管理",
"children": [ "children": [
{ {
"label": "用户管理", "label": "全链路追踪",
"schema": {
"type": "page",
"title": "用户管理",
"body": "页面C"
}
},
{
"label": "外部链接",
"link": "http://baidu.gitee.io/amis" "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"
} }
] ]
} }

Loading…
Cancel
Save