From abc33595df9214ec4c868d94ddee8df91bd077c8 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Mon, 13 Jun 2022 22:54:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppMassNotification/components/Add.vue | 134 +++++++++++------- .../AppMassNotification/components/List.vue | 15 +- 2 files changed, 93 insertions(+), 56 deletions(-) diff --git a/core/apps/AppMassNotification/components/Add.vue b/core/apps/AppMassNotification/components/Add.vue index 3584cc33..fb7c453a 100644 --- a/core/apps/AppMassNotification/components/Add.vue +++ b/core/apps/AppMassNotification/components/Add.vue @@ -61,24 +61,27 @@ placeholder="选择日期时间"> - + - - + + + - - + + + - - + + + @@ -104,17 +107,20 @@ {{ data.sendType | format }} - - - - - - - - - - +
+ + + + + + + + + + +
+ @@ -143,32 +149,49 @@ form: { areaId: '', tag: '', - content: '', - contentType: 'text', - file: {}, - accessUrl: '', - accessDesc: '', - accessTitle: '', - accessImgurl: '', - accessAppid: '', sendType: '0', sendTime: '', - mediaId: '', - name: '', + content: '', + contentType: 'text', + fileList: [ + { + accessAppid: "", + accessDesc: "", + accessImgurl: "", + accessTitle: "", + accessUrl: "", + // content: "", + contentType: "", + createdA: 0, + mediaId: "" + } + ], + // file: {}, + // accessUrl: '', + // accessDesc: '', + // accessTitle: '', + // accessImgurl: '', + // accessAppid: '', + // mediaId: '', + // name: '', }, tags: [], subTags: {}, areaId: [], areaName: [], + imgList: [], + videoList: [], + filesList: [], files: [], areaRootId: '', accessUrlAll: [], users: [], rules: { - content: [{ required: true, message: '请输入群发内容', trigger: 'change' }], + content: [{ required: true, message: '请输入群发内容'}], sendType: [{ required: true, message: '请选择群发方式' }], sendTime: [{ required: true, message: '请选择群发时间' }], }, + } }, @@ -249,31 +272,40 @@ this.$refs.form.validate((valid) => { if (valid) { - if(this.files.length) { - this.form.accessUrl = this.files[0].url, - this.form.mediaId = this.files[0].media.mediaId - } - if (this.form.contentType == 'text' && !this.form.content) { - return this.$message.error('请输入消息内容') + this.form.fileList = [] + var contentList = { + content: this.form.content, + contentType: 'text' } - // if (this.form.contentType === 'image' && !this.form.accessUrl) { - // return this.$message.error('请上传图片') - // } - - // if (this.form.contentType === 'video' && !this.form.accessUrl) { - // return this.$message.error('请上传视频') - // } + this.form.fileList.push(contentList) - // if (this.form.contentType === 'file' && !this.form.accessUrl) { - // return this.$message.error('请上传附件') - // } + if(this.imgList.length) { + var info = { + contentType: 'image', + mediaId: this.imgList[0].media.mediaId, + accessUrl: this.imgList[0].url + } + this.form.fileList.push(info) + } - // if (this.form.sendType == 1) { - // if (!this.form.sendTime) { - // return this.$message.error('请选择时间') - // } - // } + if(this.videoList.length) { + var info = { + contentType: 'video', + mediaId: this.videoList[0].media.mediaId, + accessUrl: this.videoList[0].url + } + this.form.fileList.push(info) + } + + if(this.filesList.length) { + var info = { + contentType: 'file', + mediaId: this.filesList[0].media.mediaId, + accessUrl: this.filesList[0].url + } + this.form.fileList.push(info) + } this.instance.post(`/app/pushmessage/addOrUpdate`, { ...this.form diff --git a/core/apps/AppMassNotification/components/List.vue b/core/apps/AppMassNotification/components/List.vue index 22bcd14a..3acaa125 100644 --- a/core/apps/AppMassNotification/components/List.vue +++ b/core/apps/AppMassNotification/components/List.vue @@ -49,6 +49,7 @@