素材功能开发

master
3y 3 years ago
parent 7eb1e43e10
commit 9294806ad3

@ -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}",

@ -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
},
{

@ -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}",

@ -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
},
{

@ -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}"
}
}
}

@ -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"
}
]
}
]
}
]
}

@ -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;

Loading…
Cancel
Save