wangziqian 5 жил өмнө
parent
commit
ee48411865

+ 24 - 3
src/views/ToConfigure/components/modifyNotice.vue

@@ -49,7 +49,7 @@
           </el-select>
         </el-form-item>
       </el-form>
-      <h2 class="form-title">通知条件</h2>
+      <h2 class="form-title">通知条件(必选)</h2>
       <el-form ref="form" :model="formData" label-width="100px" label-position="left">
         <el-form-item v-for="(item,index) in formData.noticeConditionList" :key="'condition'+index" label="条件">
           <el-select v-model="item.type" placeholder="请选择类型" size="small" class="condition-select" :disabled="disabled" @change="changeNoticeItem(item)">
@@ -143,11 +143,16 @@
       </el-form>
       <h2 class="form-title">通知时刻</h2>
       <div class="notice-time">
-        <el-time-picker
+        <el-time-select
           v-model="formData.noticeTime"
           placeholder="任意时间点"
           size="small"
           value-format="HH:mm:ss"
+          :picker-options="{
+            start: '00:00',
+            step: '00:15',
+            end: '23:45',
+          }"
           :disabled="disabled"
         />
       </div>
@@ -273,6 +278,12 @@ export default {
       deep: true,
       immediate: true
     },
+    type: {
+      handler(newV) {
+        this.type = newV
+      },
+      immediate: true
+    },
     visible: {
       handler(newV) {
         this.show = newV
@@ -285,6 +296,12 @@ export default {
       },
       immediate: true
     },
+    disabled: {
+      handler(newV) {
+        this.disabled = newV
+      },
+      immediate: true
+    },
     'formData.clientId': { // 客户端改变,版本默认取第一个版本
       handler(newV) {
         this.formData.clientVersionId = (this.clientList[0] && this.clientList[0].code) || null
@@ -492,7 +509,11 @@ export default {
         this.$message({ message: '请选择客户端', type: 'error', duration: 1000, offset: 150 })
         return false
       }
-      if (!this.EmailList && !this.DChartList && !this.GroupList) {
+      if (this.formData.noticeConditionList.length < 1) {
+        this.$message({ message: '请添加通知条件', type: 'error', duration: 1000, offset: 150 })
+        return false
+      }
+      if (this.EmailList.length === 0 && this.DChartList.length === 0 && this.GroupList.length === 0) {
         this.$message({ message: '请选择一种通知方式', type: 'error', duration: 1000, offset: 150 })
         return false
       }

+ 9 - 4
src/views/ToConfigure/components/noticeConfig.vue

@@ -104,7 +104,7 @@
       :disabled="disabled"
       :copy="copy"
       @confirm="confirmModify"
-      @cancel="disabled = false;copy = false"
+      @cancel="cancelModify"
     />
     <normal-dialog
       :show-dialog.sync="controlShow"
@@ -144,14 +144,14 @@ export default {
       requireImg: requireImg,
       taskImg: taskImg,
       disabled: false,
-      isCopy: false,
+      copy: false,
       visibleModify: false, // 添加修改弹框
       modifyType: 'require', // 弹框类型
       modifyData: null, // 当前修改的通知
       noticeList: [], // 通知列表
       pages: {// 分页
         pageIndex: 1,
-        pageSize: 1
+        pageSize: 6
       },
       total: 0,
       controlShow: false, // 操作弹框
@@ -245,8 +245,13 @@ export default {
     },
     confirmModify() { // 新增修改callback
       this.visibleModify = false
-      this.copy = false
       this.getBizNoticeSettingList()
+      this.cancelModify()
+    },
+    cancelModify() { // 取消修改/增加
+      this.disabled = false
+      this.copy = false
+      this.modifyData = null
     },
     addNotice(type) { // 新增通知
       this.modifyType = type