feat: 1.4.0
1.前端新增飞书通知入口 2. 优化场景和通知的列表支持滑动 3. 限制固定间隔和随机间隔两个退避策略的间隔时间不能小于10秒
This commit is contained in:
parent
357869aac9
commit
ad5ed2b582
@ -5,6 +5,7 @@
|
||||
:dataSource="data"
|
||||
:pagination="false"
|
||||
:loading="memberLoading"
|
||||
:scroll="{ x: 1200 }"
|
||||
>
|
||||
<template v-for="(col, i) in ['description']" :slot="col" slot-scope="text, record">
|
||||
<a-input
|
||||
@ -102,6 +103,16 @@
|
||||
{rules: [{ required: true, message: '请输入钉钉URL', whitespace: true}]}
|
||||
]" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
v-if="this.notifyTypeValue === '4'"
|
||||
label="飞书URL">
|
||||
<a-input
|
||||
placeholder="请输入飞书URL"
|
||||
v-decorator="[
|
||||
'feiShuUrl',
|
||||
{rules: [{ required: true, message: '请输入飞书URL', whitespace: true}]}
|
||||
]" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
v-if="this.notifyTypeValue === '2'"
|
||||
label="用户名">
|
||||
@ -201,7 +212,7 @@ export default {
|
||||
title: '通知场景',
|
||||
dataIndex: 'notifyScene',
|
||||
key: 'notifyScene',
|
||||
width: '15%',
|
||||
width: '20%',
|
||||
scopedSlots: { customRender: 'notifyScene' }
|
||||
},
|
||||
{
|
||||
@ -215,19 +226,20 @@ export default {
|
||||
title: '配置属性',
|
||||
dataIndex: 'notifyAttribute',
|
||||
key: 'notifyAttribute',
|
||||
width: '25%',
|
||||
width: '30%',
|
||||
scopedSlots: { customRender: 'notifyAttribute' }
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
width: '25%',
|
||||
width: '15%',
|
||||
scopedSlots: { customRender: 'description' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right',
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
}
|
||||
],
|
||||
@ -248,7 +260,8 @@ export default {
|
||||
},
|
||||
notifyType: {
|
||||
'1': '钉钉通知',
|
||||
'2': '邮箱通知'
|
||||
'2': '邮箱通知',
|
||||
'4': '飞书'
|
||||
// '3': '企业微信'
|
||||
},
|
||||
notifyThresholdDisabled: ['3', '4'],
|
||||
@ -319,8 +332,6 @@ export default {
|
||||
|
||||
const target = this.formData.find(item => key === item.key)
|
||||
if (!target) {
|
||||
console.log(target)
|
||||
console.log(this.formData)
|
||||
this.formData.push({
|
||||
key: key,
|
||||
id,
|
||||
@ -374,7 +385,7 @@ export default {
|
||||
setTimeout(resolve, 1500)
|
||||
}).then(() => {
|
||||
const { form } = this
|
||||
const formData = pick(record.notifyAttribute, ['dingDingUrl', 'user', 'pass', 'host', 'port', 'from', 'tos'])
|
||||
const formData = pick(record.notifyAttribute, ['dingDingUrl', 'feiShuUrl', 'user', 'pass', 'host', 'port', 'from', 'tos'])
|
||||
console.log(formData)
|
||||
form.setFieldsValue(formData)
|
||||
})
|
||||
@ -410,6 +421,8 @@ export default {
|
||||
|
||||
if (record.notifyType === '1') {
|
||||
s = '钉钉地址:' + text['dingDingUrl'] + ';'
|
||||
} else if (record.notifyType === '4') {
|
||||
s = '飞书地址:' + text['feiShuUrl'] + ';'
|
||||
}
|
||||
|
||||
return s
|
||||
|
@ -26,6 +26,7 @@
|
||||
:pagination="pagination"
|
||||
:loading="memberLoading"
|
||||
@change="handleTableChange"
|
||||
:scroll="{ x: 1200 }"
|
||||
>
|
||||
<template v-for="(col, i) in ['sceneName', 'description']" :slot="col" slot-scope="text, record">
|
||||
<a-input
|
||||
@ -68,7 +69,7 @@
|
||||
<a-input-number
|
||||
v-if="record.editable"
|
||||
:min="1"
|
||||
:max="99999"
|
||||
:max="max"
|
||||
style="width: 100%;"
|
||||
:value="text"
|
||||
placeholder="最大重试次数"
|
||||
@ -90,7 +91,7 @@
|
||||
<a-input
|
||||
v-if="record.editable"
|
||||
style="margin: -5px 0"
|
||||
placeholder="间隔时间"
|
||||
:placeholder="data.find(item => item.key === record.key).backOff === '3' ? '请输入CRON表达式' : '请输入间隔时间'"
|
||||
:value="text"
|
||||
:disabled="data.find(item => item.key === record.key).backOff === '1'"
|
||||
@change="e => handleChange(e.target.value, record.key, 'triggerInterval')"
|
||||
@ -149,7 +150,7 @@ export default {
|
||||
title: '场景状态',
|
||||
dataIndex: 'sceneStatus',
|
||||
key: 'sceneStatus',
|
||||
width: '10%',
|
||||
width: '8%',
|
||||
scopedSlots: { customRender: 'sceneStatus' }
|
||||
},
|
||||
{
|
||||
@ -163,33 +164,34 @@ export default {
|
||||
title: '最大重试次数',
|
||||
dataIndex: 'maxRetryCount',
|
||||
key: 'maxRetryCount',
|
||||
width: '12%',
|
||||
width: '10%',
|
||||
scopedSlots: { customRender: 'maxRetryCount' }
|
||||
},
|
||||
{
|
||||
title: '调用链超时时间',
|
||||
dataIndex: 'deadlineRequest',
|
||||
key: 'deadlineRequest',
|
||||
width: '15%',
|
||||
width: '10%',
|
||||
scopedSlots: { customRender: 'deadlineRequest' }
|
||||
},
|
||||
{
|
||||
title: '间隔时间',
|
||||
dataIndex: 'triggerInterval',
|
||||
key: 'triggerInterval',
|
||||
width: '10%',
|
||||
width: '15%',
|
||||
scopedSlots: { customRender: 'triggerInterval' }
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
width: '15%',
|
||||
width: '18%',
|
||||
scopedSlots: { customRender: 'description' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right',
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
}
|
||||
],
|
||||
@ -199,7 +201,7 @@ export default {
|
||||
advanced: false,
|
||||
memberLoading: false,
|
||||
triggerIntervalDisabled: false,
|
||||
max: 21,
|
||||
max: 26,
|
||||
pagination: {},
|
||||
backOffLabels: {
|
||||
'1': '延迟等级',
|
||||
@ -332,6 +334,12 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
if ((backOff === '2' || backOff === '4') && triggerInterval < 10) {
|
||||
this.memberLoading = false
|
||||
this.$message.error('描述: 间隔时间最小为10秒')
|
||||
return
|
||||
}
|
||||
|
||||
const target = this.formData.find(item => key === item.key)
|
||||
if (!target) {
|
||||
this.formData.push({
|
||||
@ -377,7 +385,7 @@ export default {
|
||||
switch (value) {
|
||||
case '1':
|
||||
this.triggerIntervalDisabled = true
|
||||
this.max = 21
|
||||
this.max = 26
|
||||
break
|
||||
default:
|
||||
this.triggerIntervalDisabled = false
|
||||
|
Loading…
Reference in New Issue
Block a user