From ad5ed2b582aff1cb15ea8562324651ba374c9ae8 Mon Sep 17 00:00:00 2001
From: "www.byteblogs.com" <598092184@qq.com>
Date: Tue, 30 May 2023 23:21:24 +0800
Subject: [PATCH] =?UTF-8?q?feat:=201.4.0=201.=E5=89=8D=E7=AB=AF=E6=96=B0?=
 =?UTF-8?q?=E5=A2=9E=E9=A3=9E=E4=B9=A6=E9=80=9A=E7=9F=A5=E5=85=A5=E5=8F=A3?=
 =?UTF-8?q?=202.=20=E4=BC=98=E5=8C=96=E5=9C=BA=E6=99=AF=E5=92=8C=E9=80=9A?=
 =?UTF-8?q?=E7=9F=A5=E7=9A=84=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E6=BB=91?=
 =?UTF-8?q?=E5=8A=A8=203.=20=E9=99=90=E5=88=B6=E5=9B=BA=E5=AE=9A=E9=97=B4?=
 =?UTF-8?q?=E9=9A=94=E5=92=8C=E9=9A=8F=E6=9C=BA=E9=97=B4=E9=9A=94=E4=B8=A4?=
 =?UTF-8?q?=E4=B8=AA=E9=80=80=E9=81=BF=E7=AD=96=E7=95=A5=E7=9A=84=E9=97=B4?=
 =?UTF-8?q?=E9=9A=94=E6=97=B6=E9=97=B4=E4=B8=8D=E8=83=BD=E5=B0=8F=E4=BA=8E?=
 =?UTF-8?q?10=E7=A7=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../config/basicConfigForm/NotifyList.vue     | 27 ++++++++++++++-----
 .../config/basicConfigForm/SceneList.vue      | 26 +++++++++++-------
 2 files changed, 37 insertions(+), 16 deletions(-)

diff --git a/frontend/src/views/config/basicConfigForm/NotifyList.vue b/frontend/src/views/config/basicConfigForm/NotifyList.vue
index 9168a249..038f0d3b 100644
--- a/frontend/src/views/config/basicConfigForm/NotifyList.vue
+++ b/frontend/src/views/config/basicConfigForm/NotifyList.vue
@@ -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
diff --git a/frontend/src/views/config/basicConfigForm/SceneList.vue b/frontend/src/views/config/basicConfigForm/SceneList.vue
index c6c9ff4a..42c15ee4 100644
--- a/frontend/src/views/config/basicConfigForm/SceneList.vue
+++ b/frontend/src/views/config/basicConfigForm/SceneList.vue
@@ -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