Просмотр исходного кода

update src/views/notification/add.vue

wudebin 10 месяцев назад
Родитель
Сommit
0c526acc3c
1 измененных файлов с 32 добавлено и 2 удалено
  1. 32 2
      Strides-Admin/src/views/notification/add.vue

+ 32 - 2
Strides-Admin/src/views/notification/add.vue

@@ -56,6 +56,28 @@
               <div>{{formInfo.message.length + "/1000"}}</div>
             </el-form-item>
           </el-col>
+          <el-col :xs="22" :md="12">
+            <el-form-item
+              label="Pin">
+              <el-switch
+                class="add-text"
+                v-model="formInfo.bin"
+                :disabled="!isEdit"
+              />
+            </el-form-item>
+            <el-form-item
+              label="Expiration Time"
+              prop="pinExpireTime"
+              v-if="formInfo.bin">
+              <el-date-picker
+                v-model="formInfo.pinExpireTime"
+                class="add-text"
+                type="datetime"
+                format="yyyy-MM-dd HH:mm"
+                value-format="yyyy-MM-dd HH:mm"
+                :disabled="!isEdit"/>
+            </el-form-item>
+          </el-col>
         </el-row>
         <div class="sparator" style="margin: 10px -80px;"></div>
         <div class="buttons" v-if="isEdit">
@@ -94,7 +116,10 @@ export default {
       formInfo: {
         title: "",
         message: "",
-        targets: []
+        targets: [],
+        pin: false,
+        bin: false ,
+        pinExpireTime: ""
       },
       autosize: {
         minRows: 3,
@@ -116,6 +141,11 @@ export default {
           required: true,
           trigger: 'change',
           message: 'Please select target platform'
+        },
+        pinExpireTime: {
+          required: true,
+          trigger: 'change',
+          message: 'Please select expiration time'
         }
       },
       isEdit: true
@@ -176,7 +206,7 @@ export default {
     },
     sendNotification() {
       this.loading = true;
-      api.sendNotification(this.formInfo).then(res => {
+      api.sendNotification(info).then(res => {
         this.$message({
           type: 'success',
           message: "Send successfully!"