湖南公安
This commit is contained in:
@@ -48,15 +48,15 @@
|
||||
<div class="type-content">
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">图片</p>
|
||||
<AiUploader type="image" :def.sync="formData.fileListImg" :limit="1" @data="(v) => fileDataImg = v"></AiUploader>
|
||||
<AiUploader type="image" :limit="9" multiple :def.sync="fileListImg" @data="changeImg"></AiUploader>
|
||||
</div>
|
||||
<div class="flex" >
|
||||
<p class="label" style="width:40px;">视频</p>
|
||||
<AiUploader type="video" :limit="1" placeholder="上传视频" :def.sync="formData.fileListVideo" @data="(v) => fileDataVideo = v"></AiUploader>
|
||||
<AiUploader type="video" :limit="9" multiple placeholder="上传视频" :def.sync="fileListVideo" @data="changeVideo"></AiUploader>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">附件</p>
|
||||
<AiUploader type="file" :limit="1" placeholder="上传附件" :def.sync="formData.fileListFile" @data="(v) => fileDataFile = v"></AiUploader>
|
||||
<AiUploader type="file" :limit="9" multiple placeholder="上传附件" :def.sync="fileListFile" @data="changeFile"></AiUploader>
|
||||
</div>
|
||||
<div v-if="form.contentType == 'link'">
|
||||
<div class="flex border-b">
|
||||
@@ -139,23 +139,14 @@ export default {
|
||||
],
|
||||
form: {
|
||||
content: '',
|
||||
contentType: 'text',
|
||||
sendType: '0',
|
||||
sendTime: ''
|
||||
},
|
||||
formData: {
|
||||
fileListImg: [],
|
||||
fileListVideo: [],
|
||||
fileListFile: [],
|
||||
fileList: [],
|
||||
imgList: [],
|
||||
accessImgurl: '',
|
||||
accessTitle: '',
|
||||
accessUrl: '',
|
||||
accessAppid: '',
|
||||
file: {},
|
||||
mediaId: ''
|
||||
},
|
||||
formData: {},
|
||||
fileList: [],
|
||||
fileListImg: [],
|
||||
fileListVideo: [],
|
||||
fileListFile: [],
|
||||
areaIdList: [],
|
||||
tagIdList: [],
|
||||
deptList: [],
|
||||
@@ -169,18 +160,40 @@ export default {
|
||||
minute: true,
|
||||
second: true
|
||||
},
|
||||
fileDataImg: null,
|
||||
fileDataVideo: null,
|
||||
fileDataFile: null
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
methods: {
|
||||
radioChange(e) {
|
||||
// this.$nextTick(() => {
|
||||
// this.form.contentType = e
|
||||
// })
|
||||
},
|
||||
changeImg(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListImg.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'image'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeVideo(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListVideo.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'video'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeFile(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListFile.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'file'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
toSelect() {
|
||||
uni.navigateTo({url: `./chooseUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}&deptList=${this.deptList}&userList=${this.userList}`})
|
||||
},
|
||||
@@ -195,9 +208,6 @@ export default {
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
// if(!this.areaIdList.length) {
|
||||
// return this.$u.toast('请选择用户')
|
||||
// }
|
||||
this.$loading()
|
||||
if(this.form.sendType == 1 && !this.form.sendTime) {
|
||||
return this.$u.toast('请选择群发时间')
|
||||
@@ -205,57 +215,20 @@ export default {
|
||||
if(!this.form.content) {
|
||||
return this.$u.toast('请输入文本内容')
|
||||
}
|
||||
if(this.form.contentType == 'image' && !this.formData.fileList.length) {
|
||||
return this.$u.toast('请上传图片')
|
||||
}
|
||||
if(this.form.contentType == 'video' && !this.formData.fileList.length) {
|
||||
return this.$u.toast('请上传视频')
|
||||
}
|
||||
if(this.form.contentType == 'file' && !this.formData.fileList.length) {
|
||||
return this.$u.toast('请上传文件')
|
||||
}
|
||||
this.formData.fileList = []
|
||||
this.fileList = []
|
||||
var contentFile = {
|
||||
content: this.form.content,
|
||||
contentType: 'text'
|
||||
}
|
||||
// if(this.formData.fileList.length) {
|
||||
// this.formData.file = this.formData.fileList[0]
|
||||
// this.formData.accessUrl = this.formData.fileList[0].url
|
||||
// this.formData.mediaId = this.fileData.media.mediaId
|
||||
// }
|
||||
this.formData.fileList.push(contentFile)
|
||||
if(this.formData.fileListImg.length) {
|
||||
var info = {
|
||||
contentType: 'image',
|
||||
mediaId: this.fileDataImg.media.mediaId,
|
||||
accessUrl: this.formData.fileListImg[0].url
|
||||
}
|
||||
this.formData.fileList.push(info)
|
||||
}
|
||||
if(this.formData.fileListVideo.length) {
|
||||
var info = {
|
||||
contentType: 'video',
|
||||
mediaId: this.fileDataVideo.media.mediaId,
|
||||
accessUrl: this.formData.fileListVideo[0].url
|
||||
}
|
||||
this.formData.fileList.push(info)
|
||||
}
|
||||
if(this.formData.fileListFile.length) {
|
||||
var info = {
|
||||
contentType: 'file',
|
||||
mediaId: this.fileDataFile.media.mediaId,
|
||||
accessUrl: this.formData.fileListFile[0].url
|
||||
}
|
||||
this.formData.fileList.push(info)
|
||||
}
|
||||
this.fileList = [...this.fileListImg, ...this.fileListVideo, ...this.fileListFile]
|
||||
this.fileList.unshift(contentFile)
|
||||
var params = {
|
||||
...this.form,
|
||||
...this.formData,
|
||||
areaId: this.areaIdList.join(','),
|
||||
tag: this.tagIdList.join(','),
|
||||
deptList: this.deptList,
|
||||
userList: this.userList
|
||||
userList: this.userList,
|
||||
fileList: this.fileList
|
||||
}
|
||||
this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => {
|
||||
if (res?.code == 0) {
|
||||
@@ -277,13 +250,13 @@ export default {
|
||||
})
|
||||
},
|
||||
formDataInit() {
|
||||
for(let key in this.formData) {
|
||||
this.formData[key] = ''
|
||||
for(let key in this.form) {
|
||||
this.form[key] = ''
|
||||
}
|
||||
this.formData.sendType = '0'
|
||||
this.formData.fileListImg = []
|
||||
this.formData.fileListVideo = []
|
||||
this.formData.fileListFile = []
|
||||
this.form.sendType = '0'
|
||||
this.fileListImg = []
|
||||
this.fileListVideo = []
|
||||
this.fileListFile = []
|
||||
this.areaIdList = []
|
||||
this.tagIdList = []
|
||||
this.deptList = []
|
||||
|
||||
Reference in New Issue
Block a user