2022-07-20 17:00:46 +08:00
|
|
|
<template>
|
|
|
|
|
<section class="selectUser">
|
|
|
|
|
<div class="header-middle">
|
2022-07-25 18:02:40 +08:00
|
|
|
<div class="userCards" v-for="e in userList" :key="e.userId">
|
2022-07-20 17:00:46 +08:00
|
|
|
<div class="imges">
|
2022-07-25 10:46:48 +08:00
|
|
|
<div class="imgselect" :class="{ checked: e.isChecked }" @click.stop="itemCheck(e)" />
|
2022-07-25 18:02:40 +08:00
|
|
|
<img src="./images/tx@2x.png" alt="" class="avatras"/> {{e.userId}}
|
2022-07-20 17:00:46 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="rights fill">
|
|
|
|
|
<div class="applicationNames">
|
2022-07-25 18:02:40 +08:00
|
|
|
<AiOpenData type="userName" :openid="e.userId"/>
|
2022-07-20 17:00:46 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-07-25 09:11:26 +08:00
|
|
|
<AiEmpty description="暂无数据" v-if="!userList"/>
|
2022-07-20 17:00:46 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="subBtn" @click="submit">
|
|
|
|
|
<div>确定选择</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "selectUser",
|
|
|
|
|
appName: "选择创建人",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
selected: [],
|
|
|
|
|
userList: [],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState(['user']),
|
|
|
|
|
hasData() {
|
|
|
|
|
return this.userList?.length > 0
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.selected = uni.getStorageSync('userSelect') || []
|
|
|
|
|
this.getDeptsAndUsersByParent()
|
2022-07-25 09:11:26 +08:00
|
|
|
console.log(this.selected);
|
2022-07-20 17:00:46 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
isSelected(id) {
|
|
|
|
|
return !!this.selected.find(e => e.id == id)
|
|
|
|
|
},
|
|
|
|
|
getDeptsAndUsersByParent() {
|
|
|
|
|
this.userList = []
|
|
|
|
|
this.$http.post(`/app/appmasssendingtask/list`, null, {
|
|
|
|
|
params: {}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res?.data) {
|
2022-07-21 09:33:17 +08:00
|
|
|
let userArr = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.id)}))
|
|
|
|
|
// 数组去重
|
|
|
|
|
this.userList = []
|
|
|
|
|
userArr.forEach(item=> {
|
|
|
|
|
if(!this.userList.find(o=> o.userId === item.userId)) {
|
|
|
|
|
this.userList.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-07-20 17:00:46 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
itemCheck(row) {
|
2022-07-21 09:33:17 +08:00
|
|
|
this.userList.forEach(e => e.isChecked = false)
|
2022-07-20 17:00:46 +08:00
|
|
|
row.isChecked = !row.isChecked
|
2022-07-21 09:33:17 +08:00
|
|
|
this.selected[0] = this.userList.filter(e => e.isChecked == true)
|
2022-07-20 17:00:46 +08:00
|
|
|
this.$forceUpdate()
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
if(!this.selected.length) {
|
|
|
|
|
return this.$u.toast('请选择创建人')
|
|
|
|
|
}
|
|
|
|
|
uni.$emit("pagePicker:custom", this.selected)
|
|
|
|
|
uni.setStorageSync('userSelect', this.selected)
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.selectUser {
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
.imgselect {
|
|
|
|
|
width: 48px;
|
|
|
|
|
height: 48px;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
background-image: url("./images/xz.png");
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
|
|
|
|
|
&.checked {
|
|
|
|
|
background-image: url("./images/xzh.png");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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>
|