feat: add custom webhook message
This commit is contained in:
+2
-1
@@ -17,8 +17,9 @@ builds:
|
|||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- format: tar.gz
|
||||||
# this name template makes the OS and Arch compatible with the results of uname.
|
# this name template makes the OS and Arch compatible with the results of uname.
|
||||||
|
# {{ .ProjectName }}_
|
||||||
name_template: >-
|
name_template: >-
|
||||||
{{ .ProjectName }}_
|
Message-Nest_
|
||||||
{{- title .Os }}_
|
{{- title .Os }}_
|
||||||
{{- if eq .Arch "amd64" }}x86_64
|
{{- if eq .Arch "amd64" }}x86_64
|
||||||
{{- else if eq .Arch "386" }}i386
|
{{- else if eq .Arch "386" }}i386
|
||||||
|
|||||||
@@ -19,3 +19,4 @@ Host = 123.1.1.1
|
|||||||
Name = db_name
|
Name = db_name
|
||||||
Port = 3306
|
Port = 3306
|
||||||
TablePrefix = message_
|
TablePrefix = message_
|
||||||
|
; SqlDebug = enable
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ module message-nest
|
|||||||
go 1.20
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/blinkbean/dingtalk v0.0.0-20230927120905-796332ac4ba1
|
|
||||||
github.com/dgrijalva/jwt-go v3.1.0+incompatible
|
github.com/dgrijalva/jwt-go v3.1.0+incompatible
|
||||||
github.com/gin-gonic/gin v1.9.1
|
github.com/gin-gonic/gin v1.9.1
|
||||||
github.com/go-ini/ini v1.32.1-0.20180214101753-32e4be5f41bb
|
github.com/go-ini/ini v1.32.1-0.20180214101753-32e4be5f41bb
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
github.com/blinkbean/dingtalk v0.0.0-20230927120905-796332ac4ba1 h1:G14RkaB3RRW099aQbfyHm4RFgNxGUOTeHSoN+CZy2YI=
|
|
||||||
github.com/blinkbean/dingtalk v0.0.0-20230927120905-796332ac4ba1/go.mod h1:9BaLuGSBqY3vT5hstValh48DbsKO7vaHaJnG9pXwbto=
|
|
||||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||||
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
|
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
|
||||||
github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE=
|
github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE=
|
||||||
|
|||||||
+3
-1
@@ -49,7 +49,9 @@ func Setup() {
|
|||||||
return setting.DatabaseSetting.TablePrefix + defaultTableName
|
return setting.DatabaseSetting.TablePrefix + defaultTableName
|
||||||
}
|
}
|
||||||
|
|
||||||
//db.LogMode(true)
|
if setting.DatabaseSetting.SqlDebug == "enable" {
|
||||||
|
db.LogMode(true)
|
||||||
|
}
|
||||||
db.SingularTable(true)
|
db.SingularTable(true)
|
||||||
db.Callback().Create().Replace("gorm:update_time_stamp", updateTimeStampForCreateCallback)
|
db.Callback().Create().Replace("gorm:update_time_stamp", updateTimeStampForCreateCallback)
|
||||||
db.Callback().Update().Replace("gorm:update_time_stamp", updateTimeStampForUpdateCallback)
|
db.Callback().Update().Replace("gorm:update_time_stamp", updateTimeStampForUpdateCallback)
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ type InsEmailConfig struct {
|
|||||||
type InsDtalkConfig struct {
|
type InsDtalkConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InsCustomConfig 实例里面的自定义config
|
||||||
|
type InsCustomConfig struct {
|
||||||
|
}
|
||||||
|
|
||||||
// ManyAddTaskIns 批量添加实例
|
// ManyAddTaskIns 批量添加实例
|
||||||
func ManyAddTaskIns(taskIns []SendTasksIns) error {
|
func ManyAddTaskIns(taskIns []SendTasksIns) error {
|
||||||
tx := db.Begin()
|
tx := db.Begin()
|
||||||
|
|||||||
@@ -29,7 +29,21 @@ var V2VersionDesc = `
|
|||||||
9. 支持钉钉消息推送
|
9. 支持钉钉消息推送
|
||||||
`
|
`
|
||||||
|
|
||||||
|
var V3Version = "v0.0.3"
|
||||||
|
var V3VersionDesc = `
|
||||||
|
1. 单应用打包
|
||||||
|
2. 支持邮件发送
|
||||||
|
3. 用户密码设置
|
||||||
|
4. 支持用户定时任务清理,更新定时时间
|
||||||
|
5. 查看定时清理日志
|
||||||
|
6. 单应用的html浏览器自动缓存
|
||||||
|
7. gin的日志使用logrus
|
||||||
|
8. 支持异步发送
|
||||||
|
9. 支持钉钉消息推送
|
||||||
|
10. 支持自定义的webhook推送
|
||||||
|
`
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
LatestVersion["version"] = V2Version
|
LatestVersion["version"] = V3Version
|
||||||
LatestVersion["desc"] = strings.TrimSpace(V2VersionDesc)
|
LatestVersion["desc"] = strings.TrimSpace(V3VersionDesc)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package message
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CustomWebhook struct {
|
||||||
|
Webhook string
|
||||||
|
Body string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cw *CustomWebhook) Request(url string, msg string) ([]byte, error) {
|
||||||
|
resp, err := http.Post(url, "application/json", bytes.NewBuffer([]byte(msg)))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer func(Body io.ReadCloser) {
|
||||||
|
err := Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
}(resp.Body)
|
||||||
|
|
||||||
|
body, err := io.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return body, err
|
||||||
|
}
|
||||||
@@ -33,7 +33,12 @@ func (t *Dtalk) Request(msg interface{}) ([]byte, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer func(Body io.ReadCloser) {
|
||||||
|
err := Body.Close()
|
||||||
|
if err != nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
}(resp.Body)
|
||||||
body, err := io.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ type Database struct {
|
|||||||
Port int
|
Port int
|
||||||
Name string
|
Name string
|
||||||
TablePrefix string
|
TablePrefix string
|
||||||
|
SqlDebug string
|
||||||
}
|
}
|
||||||
|
|
||||||
var DatabaseSetting = &Database{}
|
var DatabaseSetting = &Database{}
|
||||||
|
|||||||
@@ -34,6 +34,15 @@ func (sw *SendTaskInsService) ValidateDiffIns(ins models.SendTasksIns) (string,
|
|||||||
var Config models.InsDtalkConfig
|
var Config models.InsDtalkConfig
|
||||||
return "", Config
|
return "", Config
|
||||||
}
|
}
|
||||||
|
if ins.WayType == "Custom" {
|
||||||
|
var Config models.InsCustomConfig
|
||||||
|
err := json.Unmarshal([]byte(ins.Config), &Config)
|
||||||
|
if err != nil {
|
||||||
|
return "自定义webhook反序列化失败!", empty
|
||||||
|
}
|
||||||
|
_, Msg := app.CommonPlaygroundValid(Config)
|
||||||
|
return Msg, Config
|
||||||
|
}
|
||||||
return "未知的渠道的config校验", empty
|
return "未知的渠道的config校验", empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package send_message_service
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"message-nest/models"
|
||||||
|
"message-nest/pkg/message"
|
||||||
|
"message-nest/service/send_way_service"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CustomService struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// SendCustomMessage 执行发送钉钉
|
||||||
|
func (s *CustomService) SendCustomMessage(auth send_way_service.WayDetailCustom, ins models.SendTasksIns, typeC string, title string, content string) string {
|
||||||
|
|
||||||
|
errMsg := ""
|
||||||
|
cli := message.CustomWebhook{}
|
||||||
|
data, _ := json.Marshal(content)
|
||||||
|
dataStr := string(data)
|
||||||
|
dataStr = strings.Trim(dataStr, "\"")
|
||||||
|
bodyStr := strings.Replace(auth.Body, "TEXT", dataStr, -1)
|
||||||
|
_, err := cli.Request(auth.Webhook, bodyStr)
|
||||||
|
if err != nil {
|
||||||
|
errMsg = fmt.Sprintf("发送失败:%s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return errMsg
|
||||||
|
}
|
||||||
@@ -47,12 +47,12 @@ func (sm *SendMessageService) Send() string {
|
|||||||
errStr := ""
|
errStr := ""
|
||||||
|
|
||||||
sm.LogsAndStatusMark(fmt.Sprintf("开始任务[%s]的发送", sm.TaskID), sm.Status)
|
sm.LogsAndStatusMark(fmt.Sprintf("开始任务[%s]的发送", sm.TaskID), sm.Status)
|
||||||
sm.LogsAndStatusMark(fmt.Sprintf("发送标题:%s \n", sm.Title), sm.Status)
|
|
||||||
|
|
||||||
sendTaskService := send_task_service.SendTaskService{
|
sendTaskService := send_task_service.SendTaskService{
|
||||||
ID: sm.TaskID,
|
ID: sm.TaskID,
|
||||||
}
|
}
|
||||||
task, err := sendTaskService.GetTaskWithIns()
|
task, err := sendTaskService.GetTaskWithIns()
|
||||||
|
sm.LogsAndStatusMark(fmt.Sprintf("任务名称:%s", task.Name), sm.Status)
|
||||||
|
sm.LogsAndStatusMark(fmt.Sprintf("发送标题:%s \n", sm.Title), sm.Status)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errStr = fmt.Sprintf("任务[%s]不存在!退出发送!", sm.TaskID)
|
errStr = fmt.Sprintf("任务[%s]不存在!退出发送!", sm.TaskID)
|
||||||
sm.LogsAndStatusMark(errStr, SendFail)
|
sm.LogsAndStatusMark(errStr, SendFail)
|
||||||
@@ -109,6 +109,14 @@ func (sm *SendMessageService) Send() string {
|
|||||||
sm.LogsAndStatusMark(sm.TransError(errMsg), errStrIsSuccess(errMsg))
|
sm.LogsAndStatusMark(sm.TransError(errMsg), errStrIsSuccess(errMsg))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// 自定义webhook类型的实例发送
|
||||||
|
customAuth, ok := msgObj.(send_way_service.WayDetailCustom)
|
||||||
|
if ok {
|
||||||
|
cs := CustomService{}
|
||||||
|
errMsg := cs.SendCustomMessage(customAuth, ins.SendTasksIns, typeC, sm.Title, content)
|
||||||
|
sm.LogsAndStatusMark(sm.TransError(errMsg), errStrIsSuccess(errMsg))
|
||||||
|
continue
|
||||||
|
}
|
||||||
sm.LogsAndStatusMark(fmt.Sprintf("发送失败:未知渠道的发信实例: %s\n", ins.ID), SendFail)
|
sm.LogsAndStatusMark(fmt.Sprintf("发送失败:未知渠道的发信实例: %s\n", ins.ID), SendFail)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/blinkbean/dingtalk"
|
|
||||||
"message-nest/models"
|
"message-nest/models"
|
||||||
"message-nest/pkg/app"
|
"message-nest/pkg/app"
|
||||||
"message-nest/pkg/message"
|
"message-nest/pkg/message"
|
||||||
@@ -39,6 +38,12 @@ type WayDetailDTalk struct {
|
|||||||
Secret string `json:"secret" validate:"max=100" label:"钉钉加签秘钥"`
|
Secret string `json:"secret" validate:"max=100" label:"钉钉加签秘钥"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WayDetailCustom 自定义渠道
|
||||||
|
type WayDetailCustom struct {
|
||||||
|
Webhook string `json:"webhook" validate:"required,max=200" label:"自定义的webhook地址"`
|
||||||
|
Body string `json:"body" validate:"max=2000" label:"自定义的请求体"`
|
||||||
|
}
|
||||||
|
|
||||||
func (sw *SendWay) GetByID() (interface{}, error) {
|
func (sw *SendWay) GetByID() (interface{}, error) {
|
||||||
return models.GetWayByID(sw.ID)
|
return models.GetWayByID(sw.ID)
|
||||||
}
|
}
|
||||||
@@ -103,6 +108,14 @@ func (sw *SendWay) ValidateDiffWay() (string, interface{}) {
|
|||||||
}
|
}
|
||||||
_, Msg := app.CommonPlaygroundValid(dtalk)
|
_, Msg := app.CommonPlaygroundValid(dtalk)
|
||||||
return Msg, dtalk
|
return Msg, dtalk
|
||||||
|
} else if sw.Type == "Custom" {
|
||||||
|
var custom WayDetailCustom
|
||||||
|
err := json.Unmarshal([]byte(sw.Auth), &custom)
|
||||||
|
if err != nil {
|
||||||
|
return "自定义参数反序列化失败!", empty
|
||||||
|
}
|
||||||
|
_, Msg := app.CommonPlaygroundValid(custom)
|
||||||
|
return Msg, custom
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("未知的发信渠道校验: %s", sw.Type), empty
|
return fmt.Sprintf("未知的发信渠道校验: %s", sw.Type), empty
|
||||||
}
|
}
|
||||||
@@ -119,8 +132,24 @@ func (sw *SendWay) TestSendWay(msgObj interface{}) string {
|
|||||||
}
|
}
|
||||||
dtalkAuth, ok := msgObj.(WayDetailDTalk)
|
dtalkAuth, ok := msgObj.(WayDetailDTalk)
|
||||||
if ok {
|
if ok {
|
||||||
cli := dingtalk.InitDingTalkWithSecret(dtalkAuth.AccessToken, dtalkAuth.Secret)
|
var cli = message.Dtalk{
|
||||||
err := cli.SendTextMessage(testMsg + dtalkAuth.Keys)
|
AccessToken: dtalkAuth.AccessToken,
|
||||||
|
Secret: dtalkAuth.Secret,
|
||||||
|
}
|
||||||
|
_, err := cli.SendMessageText(testMsg + dtalkAuth.Keys)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Sprintf("发送失败:%s", err)
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
customAuth, ok := msgObj.(WayDetailCustom)
|
||||||
|
if ok {
|
||||||
|
var cli = message.CustomWebhook{}
|
||||||
|
data, _ := json.Marshal(testMsg)
|
||||||
|
dataStr := string(data)
|
||||||
|
dataStr = strings.Trim(dataStr, "\"")
|
||||||
|
bodyStr := strings.Replace(customAuth.Body, "TEXT", dataStr, -1)
|
||||||
|
_, err := cli.Request(customAuth.Webhook, bodyStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Sprintf("发送失败:%s", err)
|
return fmt.Sprintf("发送失败:%s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-3
@@ -34,7 +34,6 @@ const CONSTANT = {
|
|||||||
label: '钉钉',
|
label: '钉钉',
|
||||||
inputs: [
|
inputs: [
|
||||||
{ subLabel: 'access_token', value: '', col: 'access_token', desc: "钉钉webhook中的access_token" },
|
{ subLabel: 'access_token', value: '', col: 'access_token', desc: "钉钉webhook中的access_token" },
|
||||||
// { subLabel: '关键字过滤', value: '', col: 'keys', desc: "使用的关键字过滤,多个使用|隔开" },
|
|
||||||
{ subLabel: '加签', value: '', col: 'secret', desc: "加签的签名,SEC开头" },
|
{ subLabel: '加签', value: '', col: 'secret', desc: "加签的签名,SEC开头" },
|
||||||
{ subLabel: '渠道名', value: '', col: 'name', desc: "想要设置的渠道名字" },
|
{ subLabel: '渠道名', value: '', col: 'name', desc: "想要设置的渠道名字" },
|
||||||
],
|
],
|
||||||
@@ -46,8 +45,23 @@ const CONSTANT = {
|
|||||||
{ subLabel: 'markdown', content: 'markdown' },
|
{ subLabel: 'markdown', content: 'markdown' },
|
||||||
],
|
],
|
||||||
taskInsInputs: [
|
taskInsInputs: [
|
||||||
// { value: '', col: 'to_account', desc: "目的邮箱账号(发给fsfsf谁)" },
|
],
|
||||||
// { value: '', col: 'title', desc: "邮箱标题fsfsf" },
|
},
|
||||||
|
{
|
||||||
|
type: 'Custom',
|
||||||
|
label: '自定义',
|
||||||
|
inputs: [
|
||||||
|
{ subLabel: 'webhook地址', value: '', col: 'webhook', desc: "自定义webhook地址" },
|
||||||
|
{ subLabel: '请求体', value: '', col: 'body', desc: "请求体, text内容请使用 TEXT 进行占位\n例如:{\"message\": \"TEXT\", \"other_field\": \"field_data\"}", isTextArea: true},
|
||||||
|
{ subLabel: '渠道名', value: '', col: 'name', desc: "想要设置的渠道名字" },
|
||||||
|
],
|
||||||
|
tips: {
|
||||||
|
text: "自定义webhook说明", desc: "自定义webhook暂时只支持text,消息将解析TEXT占位标识进行替换,暂时只支持POST方式"
|
||||||
|
},
|
||||||
|
taskInsRadios: [
|
||||||
|
{ subLabel: 'text', content: 'text' },
|
||||||
|
],
|
||||||
|
taskInsInputs: [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
<hr />
|
<hr />
|
||||||
<div ref="refContainer">
|
<div ref="refContainer">
|
||||||
<el-table :data="tableData" stripe empty-text="发信日志为空" :row-style="rowStyle()">
|
<el-table :data="tableData" stripe empty-text="发信日志为空" :row-style="rowStyle()">
|
||||||
<el-table-column label="ID" prop="id" width="100px" />
|
<el-table-column label="ID" prop="id" width="50px" />
|
||||||
<el-table-column label="任务名" prop="task_name" show-overflow-tooltip width="150px" />
|
<el-table-column label="任务名" prop="task_name" show-overflow-tooltip width="150px" />
|
||||||
<el-table-column label="发信日志" prop="log">
|
<el-table-column label="发信日志" prop="log">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip placement="top">
|
<el-tooltip enterable placement="top">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div v-html="TransHtml(scope.row.log)"></div>
|
<div v-html="TransHtml(scope.row.log)"></div>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,8 +20,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" prop="created_on" width="160px" />
|
<el-table-column label="创建时间" prop="created_on" width="160px" />
|
||||||
<el-table-column label="状态" prop="status" width="60px">
|
<el-table-column label="状态" prop="status" width="120px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
<el-button link size="small" style="margin-right: 10px;" type="primary" @click="drawer = true; logText = scope.row.log">日志</el-button>
|
||||||
<el-tag v-if="scope.row.status == 0" type="danger">失败</el-tag>
|
<el-tag v-if="scope.row.status == 0" type="danger">失败</el-tag>
|
||||||
<el-tag v-if="scope.row.status == 1" type="success">成功</el-tag>
|
<el-tag v-if="scope.row.status == 1" type="success">成功</el-tag>
|
||||||
</template>
|
</template>
|
||||||
@@ -29,6 +30,10 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-drawer v-model="drawer" :with-header="false">
|
||||||
|
<el-text v-html="TransHtml(logText)" size="small"></el-text>
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
<div class="pagination-block">
|
<div class="pagination-block">
|
||||||
<el-pagination layout="prev, pager, next" :total="total" :page-size="pageSize" @current-change="handPageChange" />
|
<el-pagination layout="prev, pager, next" :total="total" :page-size="pageSize" @current-change="handPageChange" />
|
||||||
<el-text class="total-tip" size="small">共{{ total }}条</el-text>
|
<el-text class="total-tip" size="small">共{{ total }}条</el-text>
|
||||||
@@ -53,9 +58,11 @@ export default {
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
search: '',
|
search: '',
|
||||||
optionValue: '',
|
optionValue: '',
|
||||||
|
logText: '',
|
||||||
|
drawer: false,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
total: CONSTANT.TOTAL,
|
total: CONSTANT.TOTAL,
|
||||||
pageSize: CONSTANT.PAGE_SIZE,
|
pageSize: CONSTANT.PAGE_SIZE,
|
||||||
currPage: CONSTANT.PAGE,
|
currPage: CONSTANT.PAGE,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
<el-form label-width="100px" v-for="item in waysLabelData">
|
<el-form label-width="100px" v-for="item in waysLabelData">
|
||||||
<el-tab-pane :label="item.label" :name="item.type">
|
<el-tab-pane :label="item.label" :name="item.type">
|
||||||
<el-form-item :label="one.subLabel" v-for="one in item.inputs">
|
<el-form-item :label="one.subLabel" v-for="one in item.inputs">
|
||||||
<el-input size="small" v-model="one.value" :placeholder="one.desc" />
|
<el-input v-if="one.isTextArea != true" size="small" v-model="one.value" :placeholder="one.desc" />
|
||||||
|
<el-input v-if="one.isTextArea == true" size="small" type="textarea" v-model="one.value"
|
||||||
|
:placeholder="one.desc" :autosize="{ minRows: 4, maxRows: 10 }" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<textTips v-if="item.tips" :text="item.tips.text" :desc="item.tips.desc" />
|
<textTips v-if="item.tips" :text="item.tips.text" :desc="item.tips.desc" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
<el-form label-width="100px" v-for="item in waysLabelData">
|
<el-form label-width="100px" v-for="item in waysLabelData">
|
||||||
<!-- <el-tab-pane :label="item.label" :name="item.type"> -->
|
<!-- <el-tab-pane :label="item.label" :name="item.type"> -->
|
||||||
<el-form-item :label="one.subLabel" v-for="one in item.inputs">
|
<el-form-item :label="one.subLabel" v-for="one in item.inputs">
|
||||||
<el-input size="small" v-model="one.value" :placeholder="one.desc" />
|
<el-input v-if="one.isTextArea != true" size="small" v-model="one.value" :placeholder="one.desc" />
|
||||||
|
<el-input v-if="one.isTextArea == true" size="small" type="textarea" v-model="one.value"
|
||||||
|
:placeholder="one.desc" :autosize="{ minRows: 4, maxRows: 10 }" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-tab-pane> -->
|
<!-- </el-tab-pane> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
Reference in New Issue
Block a user