消息发送

This commit is contained in:
liuye
2022-06-24 20:18:31 +08:00
parent cbf3af6aa2
commit 8e807e785f
14 changed files with 995 additions and 358 deletions

View File

@@ -5,25 +5,18 @@
<span>居民群</span>
<u-icon name="arrow-right" color="#ddd" size="32"></u-icon>
</div>
<div class="num"><span>12</span></div>
<p class="text">201位群成员</p>
<div class="num"><span>{{totalInfo.groupNumber}}</span></div>
<p class="text">{{totalInfo.userNumber}}位群成员</p>
</div>
<div class="list">
<div class="title">
<span>组织信息</span>
<i>72</i>
<i>{{orgInfo.total}}</i>
</div>
<div class="item" @click="linkTo('./orgDetail')">
<div class="item" v-for="(item, index) in orgInfo.Organizational" :key="index" @click="linkTo(`./orgList?id=${item.corpId}`)">
<div class="left">
<img src="./img/gird--select-icon.png" alt="">
<span>曼城去应急管理处曼城去应急管理处曼城去应急管理处曼城去应急管理处</span>
</div>
<u-icon name="arrow-right" color="#ddd" size="32"></u-icon>
</div>
<div class="item">
<div class="left">
<img src="./img/gird--select-icon.png" alt="">
<span>曼城去应急管理处曼城</span>
<span>{{item.name}}</span>
</div>
<u-icon name="arrow-right" color="#ddd" size="32"></u-icon>
</div>
@@ -40,11 +33,13 @@ export default {
appName: "数据总览",
data() {
return {
totalInfo: {},
orgInfo: {}
}
},
computed: {...mapState(['user'])},
created() {
this.getTotal()
},
onShow() {
document.title = '数据总览'
@@ -52,6 +47,19 @@ export default {
methods: {
linkTo(url) {
uni.navigateTo({ url })
},
getTotal() {
this.$http.post(`/app/wxcp/wxgroup/getGoupAndUserCount`).then(res => {
if (res?.code == 0) {
this.totalInfo = res.data
}
})
this.$http.post(`/app/appdvcpconfig/getOrganizationalInfo`).then(res => {
if (res?.code == 0) {
this.orgInfo = res.data
}
})
}
},
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,11 +1,16 @@
<template>
<div class="orgDetail">
<p class="total">组织内共72人</p>
<div class="title">
<span>管理局/什么部门</span>
<i>共72人</i>
</div>
<div class="list">
<div class="item">
<div class="user-item">
<div class="left">
<img src="./img/gird--select-icon.png" alt="">
<span>曼城去应急管理处曼城去应急管理处曼城去应急管理处曼城去应急管理处</span>
<img src="./img/user-img.png" alt="">
</div>
<div class="right">
<p>王一一 (13303256321)</p>
</div>
</div>
<div class="item">
@@ -45,6 +50,7 @@ export default {
.list{
padding-left: 32px;
background-color: #fff;
margin-top: 16px;
.item{
padding: 34px 32px 34px 0;
box-sizing: border-box;
@@ -67,12 +73,47 @@ export default {
}
}
}
.user-item{
padding: 34px 32px 34px 0;
box-sizing: border-box;
border-bottom: 1px solid #ddd;
display: flex;
.left{
width: 70px;
img{
width: 56px;
height: 56px;
vertical-align: bottom;
margin-right: 14px;
}
}
.right{
width: calc(100% - 70px);
p{
line-height: 44px;
font-size: 30px;
color: #333;
}
}
}
}
.total{
.title{
display: flex;
justify-content: space-between;
font-size: 32px;
font-weight: 500;
line-height: 44px;
font-size: 30px;
color: #666;
padding: 32px 32px 24px 32px;
color: #333;
font-family: PingFangSC-Regular, PingFang SC;
padding: 32px;
box-sizing: border-box;
background-color: #fff;
i{
font-style: normal;
padding-right: 32px;
font-size: 28px;
color: #666;
}
}
}
</style>

View File

@@ -0,0 +1,272 @@
<template>
<section class="selectDeptUser">
<div class="header-middle">
<div class="hint">
<span v-for="(item, index) in selectDeptPath" :key="index">
<span v-if="index>0" class="mar-h4">/</span>
<span class="color-3F8DF5" @click="deptNameClick(item, index)">{{ item.name }}</span>
</span>
</div>
<div class="cards" v-for="item in treeList" :key="item.id" @click="itemClick(item)">
<div class="imges">
<!-- <div class="imgselect" :class="{checked:item.isChecked}" @click.stop="itemCheck(item, 'dept')"/> -->
<img src="./img/gird--select-icon.png" alt="" class="avatras"/>
</div>
<div class="rightes">
<div class="applicationNames">{{ item.name }}</div>
<img src="./img/right-icon.png" alt="" class="imgs"/>
</div>
</div>
<div class="userCards" v-for="e in userList" :key="e.id">
<div class="imges">
<!-- <div class="imgselect" :class="{checked:e.isChecked}" @click.stop="itemCheck(e, 'user')"/> -->
<img src="./img/tx@2x.png" alt="" class="avatras"/>
</div>
<div class="rights fill">
<div class="applicationNames" v-text="e.name"/>
<div class="idNumbers">{{ e.phone }}</div>
</div>
</div>
<AiEmpty description="暂无数据" v-if="!hasData"/>
</div>
<!-- <div class="subBtn" @click="submit">
<div>确定选择</div>
</div> -->
</section>
</template>
<script>
export default {
name: "orgList",
data() {
return {
selected: [],
allData: null,
treeList: [],
selectDeptPath: [],
userList: [],
}
},
computed: {
hasData() {
return this.treeList?.length > 0 || this.userList?.length > 0
}
},
onLoad(option) {
this.getAllDepts(option.id)
},
methods: {
isSelected(id) {
return !!this.selected.find(e => e.id == id)
},
getAllDepts(id) {
this.$http.post(`/app/wxcp/wxdepartment/listAllByCid?cid=${id}`).then((res) => {
if (res?.data) {
let parents = res.data.map(e => e.parentid)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id), isChecked: this.isSelected(e.id)}))
this.deptInit()
}
})
},
deptInit() {
this.treeList = this.allData.filter(e => !e.parentid)
this.selectDeptPath = [{name: "可选范围", id: ''}]
},
itemClick({id, name}) {
let index = this.selectDeptPath.findIndex(e => e.id == id)
if (index == -1) {
this.selectDeptPath.push({name, id})
this.getDeptsAndUsersByParent(id)
}
},
getDeptsAndUsersByParent(departmentId) {
this.treeList = this.allData.filter(e => e.parentid == departmentId)
this.userList = []
this.$http.post(`/app/wxcp/wxuser/listByDeptId`, null, {
params: {departmentId, status: 1}
}).then(res => {
if (res?.data) {
this.userList = res.data.map(e => ({...e, isChecked: this.isSelected(e.id)}))
}
})
},
deptNameClick(row, index) {
this.userList = []
if (!index) { //第一级别
this.deptInit()
} else {
let length = this.selectDeptPath.length - index
this.selectDeptPath.splice(index + 1, length)
this.getDeptsAndUsersByParent(row.id)
}
},
itemCheck(row, kind) {
row.isChecked = !row.isChecked
if (row.isChecked) {
this.selected.push({...row, kind})
} else {
let index = this.selected.findIndex(e => e.id == row.id)
this.selected.splice(index, 1)
}
this.$forceUpdate()
},
submit() {
// uni.navigateBack({
// success: () => {
// uni.$emit("pagePicker:custom", [this.selected].flat())
// }
// })
// uni.$emit("selectDept", [this.selected].flat())
console.log([this.selected].flat())
uni.$emit("pagePicker:custom", [this.selected].flat())
uni.setStorageSync('selectDeptUser', [this.selected].flat())
uni.navigateTo({url: `./selectTag`})
},
}
}
</script>
<style lang="scss" scoped>
.selectDeptUser {
height: 100%;
background: #fff;
.header-top {
background: #fff;
padding: 20px 32px;
}
.header-middle {
padding-bottom: 140px;
.hint {
padding: 28px 20px 28px 32px;
line-height: 56px;
box-shadow: 0 1px 0 0 #e4e5e6;
font-size: 30px;
font-weight: 500;
word-break: break-all;
}
.empty-div {
height: 16px;
background: #f5f5f5;
}
.imges {
display: flex;
align-items: center;
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
img {
width: 74px;
height: 74px;
border-radius: 8px;
}
.rightes {
width: calc(100% - 160px);
display: flex;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
.applicationNames {
flex: 1;
min-width: 0;
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.imgs {
flex-shrink: 0;
width: 40px;
height: 40px;
margin-right: 20px;
}
}
}
.userCards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
.rights {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
padding-right: 40px;
height: inherit;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.idNumbers {
color: #666;
}
}
}
}
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
div {
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background: #1365dd;
border-radius: 4px;
font-size: 32px;
color: #fff;
margin: 20px 34px 0 0;
float: right;
}
}
.color-3F8DF5 {
color: #3F8DF5;
}
.mar-h4 {
margin: 0 4px;
}
}
</style>

View File

@@ -1,22 +1,25 @@
<template>
<div class="userDetail">
<div class="list">
<div class="item">
<AiTopFixed>
<div class="currentLeft-top">
<div class="left">
<img src="./img/user-img.png" alt="">
</div>
<div class="right">
<p>群聊</p>
<div>3 | 群主张三</div>
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="getList" :name.sync="areaName" selectRoot>
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="24" style="margin-left: 4px" />
</AiAreaPicker>
</div>
<u-search v-model="groupName" :clearabled="true" placeholder="请输入群昵称" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getList" @clear="handerClear"></u-search>
</div>
<div class="item">
</AiTopFixed>
<div class="list">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="left">
<img src="./img/user-img.png" alt="">
</div>
<div class="right">
<p>群聊群聊群聊群聊群聊群聊群聊群聊群聊群聊群聊群聊群聊群聊群聊群聊</p>
<div>3 | 群主张三</div>
<p>{{item.groupName || '群聊'}}</p>
<div>{{item.personCount}} | 群主{{item.ownerName}}</div>
</div>
</div>
</div>
@@ -30,26 +33,58 @@ export default {
name: "userDetail",
data() {
return {
areaId: '',
areaName: '',
groupName: '',
list: []
}
},
computed: {...mapState(['user'])},
created() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName
this.getList()
},
onShow() {
document.title = '居民群详情'
},
methods: {
handerClear() {
this.groupName = ''
this.getList()
},
getList() {
this.$http.post(`/app/wxcp/wxgroup/allGroupInfo?areaId=${this.areaId}&groupName=${this.groupName}`).then(res => {
if (res?.code == 0) {
this.list = res.data
}
})
}
},
}
</script>
<style lang="scss" scoped>
.userDetail {
.currentLeft-top {
display: flex;
align-items: center;
.left {
width: 200px;
display: flex;
align-items: center;
img {
width: 48px;
height: 48px;
}
}
}
.list{
background-color: #fff;
padding-left: 32px;
margin-top: 16px;
.item{
padding: 34px 32px 34px 0;
display: flex;