@@ -144,6 +144,9 @@ export default {
sendTime: ''
},
formData: {
+ fileListImg: [],
+ fileListVideo: [],
+ fileListFile: [],
fileList: [],
imgList: [],
accessImgurl: '',
@@ -155,6 +158,8 @@ export default {
},
areaIdList: [],
tagIdList: [],
+ deptList: [],
+ userList: [],
timeShow: false,
timeParams: {
year: true,
@@ -164,19 +169,20 @@ export default {
minute: true,
second: true
},
- fileData: null
+ fileDataImg: null,
+ fileDataVideo: null,
+ fileDataFile: null
}
},
computed: {...mapState(['user'])},
methods: {
radioChange(e) {
- this.formDataInit()
- this.$nextTick(() => {
- this.form.contentType = e
- })
+ // this.$nextTick(() => {
+ // this.form.contentType = e
+ // })
},
toSelect() {
- uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`})
+ uni.navigateTo({url: `./chooseUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}&deptList=${this.deptList}&userList=${this.userList}`})
},
timeSelect(e) {
var nowTime = new Date().getTime() * 1
@@ -192,6 +198,7 @@ export default {
// if(!this.areaIdList.length) {
// return this.$u.toast('请选择用户')
// }
+ this.$loading()
if(this.form.sendType == 1 && !this.form.sendTime) {
return this.$u.toast('请选择群发时间')
}
@@ -207,16 +214,48 @@ export default {
if(this.form.contentType == 'file' && !this.formData.fileList.length) {
return this.$u.toast('请上传文件')
}
- 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 = []
+ 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)
}
var params = {
...this.form,
...this.formData,
areaId: this.areaIdList.join(','),
tag: this.tagIdList.join(','),
+ deptList: this.deptList,
+ userList: this.userList
}
this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => {
if (res?.code == 0) {
@@ -241,9 +280,9 @@ export default {
for(let key in this.formData) {
this.formData[key] = ''
}
- this.formData.imgList = []
- this.formData.fileList = []
- this.formData.file = {}
+ this.formData.fileListImg = []
+ this.formData.fileListVideo = []
+ this.formData.fileListFile = []
},
back() {
uni.navigateBack()
@@ -255,6 +294,8 @@ export default {
uni.$on('selectTag', res => {
this.tagIdList = res.tagIdList
this.areaIdList = res.areaIdList
+ this.deptList = res.deptList
+ this.userList = res.userList
})
},
}
diff --git a/src/project/police/AppMessageNotification/SelectUser.vue b/src/project/police/AppMessageNotification/chooseUser.vue
similarity index 60%
rename from src/project/police/AppMessageNotification/SelectUser.vue
rename to src/project/police/AppMessageNotification/chooseUser.vue
index a9df4744..a34b7ddc 100644
--- a/src/project/police/AppMessageNotification/SelectUser.vue
+++ b/src/project/police/AppMessageNotification/chooseUser.vue
@@ -1,40 +1,36 @@
-
-
+
-
选择标签
-
-
@@ -49,7 +45,7 @@
import {mapState} from 'vuex'
export default {
- name: "SelectUser",
+ name: "chooseUser",
data() {
return {
value: '',
@@ -57,10 +53,20 @@ export default {
areaName: '',
areaList: [],
tagList: [],
- tagIdList: []
+ tagIdList: [],
+ userList: [],
+ deptList: [],
}
},
- computed: {...mapState(['user'])},
+ computed: {
+ ...mapState(['user']),
+ moreText() {
+ if(this.userList.length) return '已选择'
+ },
+ moreTextDept() {
+ if(this.deptList.length) return '已选择'
+ },
+ },
methods: {
getTagList() {
this.$http.post("/app/wxcp/wxcorptag/listAll?size=100").then(res => {
@@ -95,37 +101,79 @@ export default {
// if(!this.tagIdList.length) {
// return this.$u.toast('请选择标签')
// }
+ var userIdList = [], deptIdList = []
+ this.userList.map((item) => {
+ userIdList.push(item.id)
+ })
+ this.deptList.map((item) => {
+ deptIdList.push(item.id)
+ })
uni.$emit('selectTag', {
areaIdList: this.areaList,
- tagIdList: this.tagIdList
+ tagIdList: this.tagIdList,
+ userList: userIdList,
+ deptList: deptIdList
})
uni.navigateBack({})
- }
+ },
+ toSelectDept() {
+ uni.navigateTo({ url: `./selectDept` })
+ },
},
onShow() {
document.title = '人员选择'
},
onLoad(option) {
+ console.log(option)
this.areaId = this.user.areaId
this.areaName = this.user.areaName
if(option.areaList) {
this.areaList = option.areaList.split(',')
+ }
+ if(option.tagIdList) {
this.tagIdList = option.tagIdList.split(',')
}
+ if(option.userList) {
+ var list = option.userList.split(',')
+ list.map(item => {
+ var info = {
+ id: item
+ }
+ this.userList.push(info)
+ })
+
+ }
+ if(option.deptList) {
+ var list = option.deptList.split(',')
+ list.map(item => {
+ var info = {
+ id: item
+ }
+ this.deptList.push(info)
+ })
+ }
this.getTagList()
},
}
diff --git a/src/project/police/AppMessageNotification/components/img/xz.png b/src/project/police/AppMessageNotification/components/img/xz.png
new file mode 100644
index 00000000..98f78cda
Binary files /dev/null and b/src/project/police/AppMessageNotification/components/img/xz.png differ
diff --git a/src/project/police/AppMessageNotification/components/img/xzh.png b/src/project/police/AppMessageNotification/components/img/xzh.png
new file mode 100644
index 00000000..967fa399
Binary files /dev/null and b/src/project/police/AppMessageNotification/components/img/xzh.png differ