消息推送

This commit is contained in:
liuye
2022-06-24 23:10:12 +08:00
parent f766e65cd5
commit 2948b35a13
3 changed files with 23 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ export default {
form: { form: {
content: '', content: '',
contentType: 'text', contentType: 'text',
sendType: '1', sendType: '0',
}, },
formData: { formData: {
fileListImg: [], fileListImg: [],
@@ -122,6 +122,8 @@ export default {
radioGroupChange(e) { radioGroupChange(e) {
this.form.sendType = e this.form.sendType = e
uni.setStorageSync('sendType', e) uni.setStorageSync('sendType', e)
this.deptUserTagList = []
this.deptUserList = []
}, },
toSelect() { toSelect() {
uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`}) uni.navigateTo({url: `./SelectUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}`})
@@ -148,6 +150,7 @@ export default {
let result = {}, tags = {} let result = {}, tags = {}
this.deptUserTagList.map(e => { this.deptUserTagList.map(e => {
let {kind, id, tagIdList} = e let {kind, id, tagIdList} = e
console.log([result[e.corpId], {kind, id}].flat())
result[e.corpId] = [result[e.corpId], {kind, id}].flat() result[e.corpId] = [result[e.corpId], {kind, id}].flat()
if (tagIdList) { if (tagIdList) {
tags[e.corpId] = [tags[e.corpId], {tagIdList}].flat() tags[e.corpId] = [tags[e.corpId], {tagIdList}].flat()
@@ -155,11 +158,20 @@ export default {
}) })
console.log(result, tags) console.log(result, tags)
var deptList = Object.keys(result).map(corpId => ({
corpId, var deptList = Object.keys(result).map(corpId => {
objList: result[corpId], let res
tagId: tags[corpId]?.tagIdList if (result[corpId]) {
})) res = {
corpId,
objList: result[corpId]
}
if (tags[corpId]?.tagIdList) {
res.tagId = tags[corpId]?.tagIdList
}
}
return res
}).filter(e => !!e)
console.log(deptList) console.log(deptList)

View File

@@ -121,6 +121,9 @@ export default {
// }) // })
// uni.$emit("selectDept", [this.selected].flat()) // uni.$emit("selectDept", [this.selected].flat())
console.log([this.selected].flat()) console.log([this.selected].flat())
if(![this.selected].flat().length) {
return this.$u.toast('请选择部门或人员')
}
uni.$emit("pagePicker:custom", [this.selected].flat()) uni.$emit("pagePicker:custom", [this.selected].flat())
uni.setStorageSync('selectDeptUser', [this.selected].flat()) uni.setStorageSync('selectDeptUser', [this.selected].flat())
uni.navigateTo({url: `./selectTag`}) uni.navigateTo({url: `./selectTag`})

View File

@@ -85,7 +85,7 @@ export default {
this.showTagList=false this.showTagList=false
}, },
getTagList(id) { getTagList(id) {
var url = this.sendType == 1 ? `/app/wxcp/wxcorptag/listAllByCorp?dvcpCorpId=${id}` : `/app/wxcp/wxgroupchattag/listAllByCorp?dvcpCorpId=${id}` var url = this.sendType == 1 ? `/app/wxcp/wxcorptag/listAllByCorp?dvcpCorpId=${id}&size=1000` : `/app/wxcp/wxgroupchattag/listAllByCorp?dvcpCorpId=${id}&size=1000`
this.$http.post(url).then(res => { this.$http.post(url).then(res => {
if (res?.code == 0) { if (res?.code == 0) {
res.data.records.map((item) => { res.data.records.map((item) => {
@@ -125,6 +125,7 @@ export default {
var list = uni.getStorageSync('selectDeptUser') var list = uni.getStorageSync('selectDeptUser')
this.sendType = uni.getStorageSync('sendType') this.sendType = uni.getStorageSync('sendType')
list.map((item) => { list.map((item) => {
item.tagIdList = []
if(item.kind == 'dept') { if(item.kind == 'dept') {
this.deptList.push(item) this.deptList.push(item)
}else { }else {