消息推送
This commit is contained in:
@@ -32,6 +32,7 @@ export default {
|
||||
sysUser: {url: "/components/pages/selectSysUser", label: "name"},
|
||||
gird: {url: "/components/pages/selectGird", label: "girdName"},
|
||||
party: {url: "/components/pages/selectParty", label: "name"},
|
||||
dept: {url: "/components/pages/selectDept", label: "name"},
|
||||
custom: {...this.ops}
|
||||
},
|
||||
}
|
||||
|
||||
175
src/components/pages/selectDept.vue
Normal file
175
src/components/pages/selectDept.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div class="selectDept">
|
||||
<AiTopFixed>
|
||||
<u-search placeholder="搜索" v-model="name" :show-action="false" @change="getList()"/>
|
||||
</AiTopFixed>
|
||||
<div class="user-list">
|
||||
<template v-if="list.length>0">
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="select-img" @click="checkClick(index)">
|
||||
<img :src="item.isCheck ? checkIcon : cirIcon" alt="">
|
||||
</div>
|
||||
<div class="user-info">{{ item.name }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<AiEmpty/>
|
||||
<div class="pad-b118"/>
|
||||
</template>
|
||||
</div>
|
||||
<div class="pad-b118"/>
|
||||
<div class="footer">
|
||||
<div class="btn" @click="confirm">确定选择</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "selectDept",
|
||||
appName: "选择部门",
|
||||
data() {
|
||||
return {
|
||||
current: 1,
|
||||
total: 0,
|
||||
name: '',
|
||||
list: [],
|
||||
cirIcon: require('./img/xz.png'),
|
||||
checkIcon: require('./img/xzh.png'),
|
||||
selected: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
isSingle() {
|
||||
return this.$route.query.single
|
||||
},
|
||||
nodeKey() {
|
||||
return this.$route.query.nodeKey || "idNumber"
|
||||
}
|
||||
},
|
||||
onLoad(query) {
|
||||
console.log(query)
|
||||
if (query.selected) {
|
||||
this.selected = query.selected?.split(",") || []
|
||||
}
|
||||
this.selected.map((item, index) => {
|
||||
this.selected[index] = parseInt(item)
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.$http.post(`/app/wxcp/wxdepartment/listAll?name=${this.name}`).then(res => {
|
||||
if (res?.data) {
|
||||
res.data.forEach(e => {
|
||||
e.isCheck = this.selected.includes(e[this.nodeKey])
|
||||
})
|
||||
this.list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
checkClick(index) {
|
||||
if (this.isSingle) {
|
||||
this.list.map((e, i) => {
|
||||
e.isCheck = i == index;
|
||||
})
|
||||
} else this.list[index].isCheck = !this.list[index].isCheck
|
||||
|
||||
},
|
||||
confirm() {
|
||||
let checkList = []
|
||||
this.list.map((item) => {
|
||||
if (item.isCheck) {
|
||||
checkList.push(item)
|
||||
}
|
||||
})
|
||||
if (!checkList.length) {
|
||||
return this.$u.toast('请先选择部门')
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
success: () => {
|
||||
uni.$emit("pagePicker:dept", checkList)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.selectDept {
|
||||
::v-deep .AiTopFixed .u-search {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.pad-b118 {
|
||||
padding-bottom: 118px;
|
||||
}
|
||||
|
||||
.user-list {
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
.select-img {
|
||||
display: inline-block;
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin: 12px 36px 12px 30px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: inline-block;
|
||||
padding: 20px 0 20px 0;
|
||||
width: calc(100% - 114px);
|
||||
height: 100%;
|
||||
border-bottom: 1px solid #E4E5E6;
|
||||
font-size: 36px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 74px;
|
||||
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-right: 34px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #F4F8FB;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
text-align: right;
|
||||
|
||||
.btn {
|
||||
display: inline-block;
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
background: #1365DD;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #FFF;
|
||||
margin: 20px 34px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user