From 9294806ad39471e8b0d31e764259f0ba3a953d0b Mon Sep 17 00:00:00 2001 From: 3y Date: Wed, 8 Jun 2022 20:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=A0=E6=9D=90=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/crud-edit.json | 16 +++---- pages/crud-list.json | 26 ++++++++--- pages/crud-new.json | 16 +++---- pages/crud-view.json | 12 ++--- pages/material-upload.json | 89 ++++++++++++++++++++++++++++++++++++++ pages/site.json | 19 +++++++- requestHandler.md | 9 ++-- 7 files changed, 155 insertions(+), 32 deletions(-) create mode 100644 pages/material-upload.json diff --git a/pages/crud-edit.json b/pages/crud-edit.json index dd1f6a9..264c997 100644 --- a/pages/crud-edit.json +++ b/pages/crud-edit.json @@ -629,11 +629,11 @@ { "type": "input-text", "label": "语音Id", - "name": "media_id", + "name": "mediaId", "required": true, "visibleOn": "this.sendChannel == 90 && this.sendType == 20", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -649,11 +649,11 @@ { "type": "input-text", "label": "文件Id", - "name": "media_id", + "name": "mediaId", "required": true, "visibleOn": "this.sendChannel == 90 && this.sendType == 60", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -738,10 +738,10 @@ { "type": "input-text", "label": "图片Id", - "name": "media_id", + "name": "mediaId", "visibleOn": "this.sendChannel == 90 && (this.sendType == 100 || this.sendType == 110|| this.sendType == 130)", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -766,7 +766,7 @@ "api": { "url": "http://localhost:8080/messageTemplate/save", "method": "post", - "requestAdaptor": "let jsonObj = {};\n\nlet content = JSON.parse(api.data.msgContent).content\nlet url = JSON.parse(api.data.msgContent).url\nlet title = JSON.parse(api.data.msgContent).title\nlet sendType = JSON.parse(api.data.msgContent).sendType\nlet picUrl = JSON.parse(api.data.msgContent).picUrl\n\n\n// push通知栏\nif(api.data.sendChannel == '20'){\n jsonObj.content = content\n jsonObj.url = url\n jsonObj.title = title\n}\n// 短信\nif(api.data.sendChannel == '30'){\n jsonObj.url = url\n jsonObj.content = content\n}\n// 邮件\nif(api.data.sendChannel == '40'){\n jsonObj.content = content\n jsonObj.title = title\n}\n// 企业微信\nif (api.data.sendChannel == '70') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n}\n// 钉钉机器人\nif (api.data.sendChannel == '80') {\n // 文本类型(text)\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 图文类型(FeedCard)\n if (sendType == '40') {\n jsonObj.sendType = sendType\n jsonObj.feedCards = JSON.stringify(api.data.feedCards)\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 链接类型(link)\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.picUrl = picUrl\n jsonObj.url = url\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n}\n// 钉钉工作消息\nif (api.data.sendChannel == '90') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 语音类型\n if (sendType == '20') {\n jsonObj.sendType = sendType\n jsonObj.duration = api.data.duration\n jsonObj.media_id = api.data.media_id\n }\n // 文件类型 || 图片类型\n if (sendType == '60' || sendType == '100') {\n jsonObj.sendType = sendType\n jsonObj.media_id = api.data.media_id\n }\n // 链接类型\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.media_id = api.data.media_id\n jsonObj.url = url\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n \n // OA(actionCard)\n if (sendType == '130') {\n \n // 头部\n var head = {}\n head.bgcolor = api.data.dingDingOaHeadBgColor\n head.text = api.data.dingDingOaHeadTitle\n jsonObj.dingDingOaHead = head\n \n // body\n var body = {}\n body.title = api.data.dingDingOaTitle\n body.content = api.data.dingDingOaContent\n body.image = api.data.media_id\n body.author = api.data.dingDingOaAuthor\n jsonObj.dingDingOaBody = body\n \n // 通用\n jsonObj.sendType = sendType\n jsonObj.url = url\n }\n}\n\napi.data.msgContent = JSON.stringify(jsonObj)", + "requestAdaptor": "let jsonObj = {};\n\nlet content = JSON.parse(api.data.msgContent).content\nlet url = JSON.parse(api.data.msgContent).url\nlet title = JSON.parse(api.data.msgContent).title\nlet sendType = JSON.parse(api.data.msgContent).sendType\nlet picUrl = JSON.parse(api.data.msgContent).picUrl\n\n\n// push通知栏\nif(api.data.sendChannel == '20'){\n jsonObj.content = content\n jsonObj.url = url\n jsonObj.title = title\n}\n// 短信\nif(api.data.sendChannel == '30'){\n jsonObj.url = url\n jsonObj.content = content\n}\n// 邮件\nif(api.data.sendChannel == '40'){\n jsonObj.content = content\n jsonObj.title = title\n}\n// 企业微信\nif (api.data.sendChannel == '70') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n}\n// 钉钉机器人\nif (api.data.sendChannel == '80') {\n // 文本类型(text)\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 图文类型(FeedCard)\n if (sendType == '40') {\n jsonObj.sendType = sendType\n jsonObj.feedCards = JSON.stringify(api.data.feedCards)\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 链接类型(link)\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.picUrl = picUrl\n jsonObj.url = url\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n}\n// 钉钉工作消息\nif (api.data.sendChannel == '90') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 语音类型\n if (sendType == '20') {\n jsonObj.sendType = sendType\n jsonObj.duration = api.data.duration\n jsonObj.mediaId = api.data.mediaId\n }\n // 文件类型 || 图片类型\n if (sendType == '60' || sendType == '100') {\n jsonObj.sendType = sendType\n jsonObj.mediaId = api.data.mediaId\n }\n // 链接类型\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.mediaId = api.data.mediaId\n jsonObj.url = url\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n \n // OA(actionCard)\n if (sendType == '130') {\n \n // 头部\n var head = {}\n head.bgcolor = api.data.dingDingOaHeadBgColor\n head.text = api.data.dingDingOaHeadTitle\n jsonObj.dingDingOaHead = head\n \n // body\n var body = {}\n body.title = api.data.dingDingOaTitle\n body.content = api.data.dingDingOaContent\n body.image = api.data.mediaId\n body.author = api.data.dingDingOaAuthor\n jsonObj.dingDingOaBody = body\n \n // 通用\n jsonObj.sendType = sendType\n jsonObj.url = url\n }\n}\n\napi.data.msgContent = JSON.stringify(jsonObj)", "data": { "name": "${name}", "idType": "${idType}", @@ -794,7 +794,7 @@ "feedCards": "${feedCards}", "btnOrientation": "${btnOrientation}", "btns": "${btns}", - "media_id": "${media_id}", + "mediaId": "${mediaId}", "duration": "${duration}", "dingDingOaHeadTitle": "${dingDingOaHeadTitle}", "dingDingOaHeadBgColor": "${dingDingOaHeadBgColor}", diff --git a/pages/crud-list.json b/pages/crud-list.json index 630e65b..c980a93 100644 --- a/pages/crud-list.json +++ b/pages/crud-list.json @@ -124,13 +124,29 @@ "api": { "url": "http://localhost:8080/messageTemplate/test", "method": "post", - "requestAdaptor": "let jsonObj = {};\n\nlet content = JSON.parse(api.data.msgContent).content\nlet url = JSON.parse(api.data.msgContent).url\nlet title = JSON.parse(api.data.msgContent).title\nlet sendType = JSON.parse(api.data.msgContent).sendType\nlet picUrl = JSON.parse(api.data.msgContent).picUrl\n\n\n// 钉钉机器人\nif (api.data.sendChannel == '80') {\n // 图文类型(FeedCard)\n if (sendType == '40') {\n jsonObj.feedCards = JSON.stringify(api.data.feedCards)\n api.data.msgContent = JSON.stringify(jsonObj)\n }\n}\n\n\nreturn api;", + "requestAdaptor": "let jsonObj = {};\n\nlet content = JSON.parse(api.data.msgContent).content\nlet url = JSON.parse(api.data.msgContent).url\nlet title = JSON.parse(api.data.msgContent).title\nlet sendType = JSON.parse(api.data.msgContent).sendType\nlet picUrl = JSON.parse(api.data.msgContent).picUrl\n\n\n// push通知栏\nif(api.data.sendChannel == '20'){\n jsonObj.content = content\n jsonObj.url = url\n jsonObj.title = title\n}\n// 短信\nif(api.data.sendChannel == '30'){\n jsonObj.url = url\n jsonObj.content = content\n}\n// 邮件\nif(api.data.sendChannel == '40'){\n jsonObj.content = content\n jsonObj.title = title\n}\n// 企业微信\nif (api.data.sendChannel == '70') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n}\n// 钉钉机器人\nif (api.data.sendChannel == '80') {\n // 文本类型(text)\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 图文类型(FeedCard)\n if (sendType == '40') {\n jsonObj.sendType = sendType\n jsonObj.feedCards = JSON.stringify(api.data.feedCards)\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 链接类型(link)\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.picUrl = picUrl\n jsonObj.url = url\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n}\n// 钉钉工作消息\nif (api.data.sendChannel == '90') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 语音类型\n if (sendType == '20') {\n jsonObj.sendType = sendType\n jsonObj.duration = api.data.duration\n jsonObj.mediaId = api.data.mediaId\n }\n // 文件类型 || 图片类型\n if (sendType == '60' || sendType == '100') {\n jsonObj.sendType = sendType\n jsonObj.mediaId = api.data.mediaId\n }\n // 链接类型\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.mediaId = api.data.mediaId\n jsonObj.url = url\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n \n // OA(actionCard)\n if (sendType == '130') {\n \n // 头部\n var head = {}\n head.bgcolor = api.data.dingDingOaHeadBgColor\n head.text = api.data.dingDingOaHeadTitle\n jsonObj.dingDingOaHead = head\n \n // body\n var body = {}\n body.title = api.data.dingDingOaTitle\n body.content = api.data.dingDingOaContent\n body.image = api.data.mediaId\n body.author = api.data.dingDingOaAuthor\n jsonObj.dingDingOaBody = body\n \n // 通用\n jsonObj.sendType = sendType\n jsonObj.url = url\n }\n}\n\napi.data.msgContent = JSON.stringify(jsonObj)\nreturn api;", "data": { "id": "${id}", "name": "${name}", "receiver": "${receiver}", + "msgType": "${msgType}", + "templateType": "${templateType}", + "expectPushTime": "${expectPushTime}", + "proposer": "${proposer}", "sendChannel": "${sendChannel}", + "sendAccount": "${sendAccount}", + "cronCrowdPath": "${cronCrowdPath}", + "shieldType": "${shieldType}", "feedCards": "${feedCards}", + "btnOrientation": "${btnOrientation}", + "btns": "${btns}", + "mediaId": "${mediaId}", + "duration": "${duration}", + "dingDingOaHeadTitle": "${dingDingOaHeadTitle}", + "dingDingOaHeadBgColor": "${dingDingOaHeadBgColor}", + "dingDingOaTitle": "${dingDingOaTitle}", + "dingDingOaContent": "${dingDingOaContent}", + "dingDingOaAuthor": "${dingDingOaAuthor}", "msgContent": "{\"content\":\"${content}\",\"url\":\"${url}\",\"title\":\"${title}\",\"sendType\":\"${sendType}\",\"picUrl\":\"${picUrl}\"}" } }, @@ -401,7 +417,7 @@ { "type": "input-text", "label": "语音Id", - "name": "media_id", + "name": "mediaId", "visibleOn": "this.sendChannel == 90 && this.sendType == 20", "size": "lg", "clearValueOnHidden": false @@ -417,7 +433,7 @@ { "type": "input-text", "label": "文件Id", - "name": "media_id", + "name": "mediaId", "visibleOn": "this.sendChannel == 90 && this.sendType == 60", "size": "lg", "clearValueOnHidden": false @@ -486,10 +502,10 @@ { "type": "input-text", "label": "图片Id", - "name": "media_id", + "name": "mediaId", "visibleOn": "this.sendChannel == 90 && (this.sendType == 100 || this.sendType == 110|| this.sendType == 130)", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { diff --git a/pages/crud-new.json b/pages/crud-new.json index d1b8cb5..8ab782c 100644 --- a/pages/crud-new.json +++ b/pages/crud-new.json @@ -655,11 +655,11 @@ { "type": "input-text", "label": "语音Id", - "name": "media_id", + "name": "mediaId", "required": true, "visibleOn": "this.sendChannel == 90 && this.sendType == 20", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -675,11 +675,11 @@ { "type": "input-text", "label": "文件Id", - "name": "media_id", + "name": "mediaId", "required": true, "visibleOn": "this.sendChannel == 90 && this.sendType == 60", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -764,10 +764,10 @@ { "type": "input-text", "label": "图片Id", - "name": "media_id", + "name": "mediaId", "visibleOn": "this.sendChannel == 90 && (this.sendType == 100 || this.sendType == 110|| this.sendType == 130)", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -792,7 +792,7 @@ "api": { "url": "http://localhost:8080/messageTemplate/save", "method": "post", - "requestAdaptor": "let jsonObj = {};\n\nlet content = JSON.parse(api.data.msgContent).content\nlet url = JSON.parse(api.data.msgContent).url\nlet title = JSON.parse(api.data.msgContent).title\nlet sendType = JSON.parse(api.data.msgContent).sendType\nlet picUrl = JSON.parse(api.data.msgContent).picUrl\n\n\n// push通知栏\nif(api.data.sendChannel == '20'){\n jsonObj.content = content\n jsonObj.url = url\n jsonObj.title = title\n}\n// 短信\nif(api.data.sendChannel == '30'){\n jsonObj.url = url\n jsonObj.content = content\n}\n// 邮件\nif(api.data.sendChannel == '40'){\n jsonObj.content = content\n jsonObj.title = title\n}\n// 企业微信\nif (api.data.sendChannel == '70') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n}\n// 钉钉机器人\nif (api.data.sendChannel == '80') {\n // 文本类型(text)\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 图文类型(FeedCard)\n if (sendType == '40') {\n jsonObj.sendType = sendType\n jsonObj.feedCards = JSON.stringify(api.data.feedCards)\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 链接类型(link)\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.picUrl = picUrl\n jsonObj.url = url\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n}\n// 钉钉工作消息\nif (api.data.sendChannel == '90') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 语音类型\n if (sendType == '20') {\n jsonObj.sendType = sendType\n jsonObj.duration = api.data.duration\n jsonObj.media_id = api.data.media_id\n }\n // 文件类型 || 图片类型\n if (sendType == '60' || sendType == '100') {\n jsonObj.sendType = sendType\n jsonObj.media_id = api.data.media_id\n }\n // 链接类型\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.media_id = api.data.media_id\n jsonObj.url = url\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n \n // OA(actionCard)\n if (sendType == '130') {\n \n // 头部\n var head = {}\n head.bgcolor = api.data.dingDingOaHeadBgColor\n head.text = api.data.dingDingOaHeadTitle\n jsonObj.dingDingOaHead = head\n \n // body\n var body = {}\n body.title = api.data.dingDingOaTitle\n body.content = api.data.dingDingOaContent\n body.image = api.data.media_id\n body.author = api.data.dingDingOaAuthor\n jsonObj.dingDingOaBody = body\n \n // 通用\n jsonObj.sendType = sendType\n jsonObj.url = url\n }\n}\n\napi.data.msgContent = JSON.stringify(jsonObj)", + "requestAdaptor": "let jsonObj = {};\n\nlet content = JSON.parse(api.data.msgContent).content\nlet url = JSON.parse(api.data.msgContent).url\nlet title = JSON.parse(api.data.msgContent).title\nlet sendType = JSON.parse(api.data.msgContent).sendType\nlet picUrl = JSON.parse(api.data.msgContent).picUrl\n\n\n// push通知栏\nif(api.data.sendChannel == '20'){\n jsonObj.content = content\n jsonObj.url = url\n jsonObj.title = title\n}\n// 短信\nif(api.data.sendChannel == '30'){\n jsonObj.url = url\n jsonObj.content = content\n}\n// 邮件\nif(api.data.sendChannel == '40'){\n jsonObj.content = content\n jsonObj.title = title\n}\n// 企业微信\nif (api.data.sendChannel == '70') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n}\n// 钉钉机器人\nif (api.data.sendChannel == '80') {\n // 文本类型(text)\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 图文类型(FeedCard)\n if (sendType == '40') {\n jsonObj.sendType = sendType\n jsonObj.feedCards = JSON.stringify(api.data.feedCards)\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 链接类型(link)\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.picUrl = picUrl\n jsonObj.url = url\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n}\n// 钉钉工作消息\nif (api.data.sendChannel == '90') {\n // 文本类型\n if (sendType == '10') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n }\n // 语音类型\n if (sendType == '20') {\n jsonObj.sendType = sendType\n jsonObj.duration = api.data.duration\n jsonObj.mediaId = api.data.mediaId\n }\n // 文件类型 || 图片类型\n if (sendType == '60' || sendType == '100') {\n jsonObj.sendType = sendType\n jsonObj.mediaId = api.data.mediaId\n }\n // 链接类型\n if (sendType == '110') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n jsonObj.mediaId = api.data.mediaId\n jsonObj.url = url\n }\n // markdown类型(markdown)\n if (sendType == '80') {\n jsonObj.content = content\n jsonObj.sendType = sendType\n jsonObj.title = title\n }\n // 卡片跳转(actionCard)\n if (sendType == '120') {\n jsonObj.title = title\n jsonObj.content = content\n jsonObj.btnOrientation = api.data.btnOrientation\n jsonObj.btns = JSON.stringify(api.data.btns)\n jsonObj.sendType = sendType\n }\n \n // OA(actionCard)\n if (sendType == '130') {\n \n // 头部\n var head = {}\n head.bgcolor = api.data.dingDingOaHeadBgColor\n head.text = api.data.dingDingOaHeadTitle\n jsonObj.dingDingOaHead = head\n \n // body\n var body = {}\n body.title = api.data.dingDingOaTitle\n body.content = api.data.dingDingOaContent\n body.image = api.data.mediaId\n body.author = api.data.dingDingOaAuthor\n jsonObj.dingDingOaBody = body\n \n // 通用\n jsonObj.sendType = sendType\n jsonObj.url = url\n }\n}\n\napi.data.msgContent = JSON.stringify(jsonObj)", "data": { "name": "${name}", "idType": "${idType}", @@ -807,7 +807,7 @@ "feedCards": "${feedCards}", "btnOrientation": "${btnOrientation}", "btns": "${btns}", - "media_id": "${media_id}", + "mediaId": "${mediaId}", "duration": "${duration}", "dingDingOaHeadTitle": "${dingDingOaHeadTitle}", "dingDingOaHeadBgColor": "${dingDingOaHeadBgColor}", diff --git a/pages/crud-view.json b/pages/crud-view.json index 22215fa..f1bc43f 100644 --- a/pages/crud-view.json +++ b/pages/crud-view.json @@ -633,11 +633,11 @@ { "type": "input-text", "label": "语音Id", - "name": "media_id", + "name": "mediaId", "required": true, "visibleOn": "this.sendChannel == 90 && this.sendType == 20", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -653,11 +653,11 @@ { "type": "input-text", "label": "文件Id", - "name": "media_id", + "name": "mediaId", "required": true, "visibleOn": "this.sendChannel == 90 && this.sendType == 60", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { @@ -742,10 +742,10 @@ { "type": "input-text", "label": "图片Id", - "name": "media_id", + "name": "mediaId", "visibleOn": "this.sendChannel == 90 && (this.sendType == 100 || this.sendType == 110|| this.sendType == 130)", "size": "lg", - "placeholder": "可用占位符{$media_id}", + "placeholder": "可用占位符{$mediaId}", "clearValueOnHidden": false }, { diff --git a/pages/material-upload.json b/pages/material-upload.json new file mode 100644 index 0000000..39daacf --- /dev/null +++ b/pages/material-upload.json @@ -0,0 +1,89 @@ +{ + "type": "form", + "title": "上传素材", + "body": [ + { + "label": "渠道类型", + "type": "radios", + "name": "sendChannel", + "options": [ + { + "label": "服务号", + "value": "50" + }, + { + "label": "小程序", + "value": "60" + }, + { + "label": "企业微信", + "value": "70" + }, + { + "label": "钉钉工作消息", + "value": "90" + } + ] + }, + { + "type": "select", + "label": "渠道账号", + "name": "sendAccount", + "options": [ + { + "label": "austin", + "value": "10" + }, + { + "label": "athena", + "value": "20" + } + ] + }, + { + "type": "radios", + "label": "文件类型", + "name": "fileType", + "options": [ + { + "label": "图片", + "value": "10" + }, + { + "label": "语音", + "value": "20" + }, + { + "label": "普通文件", + "value": "30" + }, + { + "label": "视频", + "value": "40" + } + ] + }, + { + "type": "input-file", + "label": "上传素材", + "name": "file", + "asBlob": true + }, + { + "type": "static", + "name": "id", + "visibleOn": "typeof data.id !== 'undefined'", + "label": "返回 ID" + } + ], + "api": { + "url": "http://localhost:8080/material/upload", + "method": "post", + "data": { + "sendChannel": "${sendChannel}", + "sendAccount": "${sendAccount}", + "fileType": "${fileType}", + "file": "${file}" + } + } +} \ No newline at end of file diff --git a/pages/site.json b/pages/site.json index 8cb21e1..71eaf84 100644 --- a/pages/site.json +++ b/pages/site.json @@ -68,7 +68,24 @@ ] } ] - + }, + { + "label": "素材管理", + "children": [ + { + "label": "渠道物料管理", + "url": "/crud", + "rewrite": "/crud/list", + "icon": "fa fa-cube", + "children": [ + { + "url": "material/upload", + "label": "上传素材", + "schemaApi": "get:/pages/material-upload.json" + } + ] + } + ] } ] } diff --git a/requestHandler.md b/requestHandler.md index 6ae79e8..15cfc5f 100644 --- a/requestHandler.md +++ b/requestHandler.md @@ -83,19 +83,19 @@ if (api.data.sendChannel == '90') { if (sendType == '20') { jsonObj.sendType = sendType jsonObj.duration = api.data.duration - jsonObj.media_id = api.data.media_id + jsonObj.mediaId = api.data.mediaId } // 文件类型 || 图片类型 if (sendType == '60' || sendType == '100') { jsonObj.sendType = sendType - jsonObj.media_id = api.data.media_id + jsonObj.mediaId = api.data.mediaId } // 链接类型 if (sendType == '110') { jsonObj.content = content jsonObj.sendType = sendType jsonObj.title = title - jsonObj.media_id = api.data.media_id + jsonObj.mediaId = api.data.mediaId jsonObj.url = url } // markdown类型(markdown) @@ -126,7 +126,7 @@ if (api.data.sendChannel == '90') { var body = {} body.title = api.data.dingDingOaTitle body.content = api.data.dingDingOaContent - body.image = api.data.media_id + body.image = api.data.mediaId body.author = api.data.dingDingOaAuthor jsonObj.dingDingOaBody = body @@ -165,6 +165,7 @@ if (api.data.sendChannel == '80') { } + return api;