240 lines
5.0 KiB
Vue
240 lines
5.0 KiB
Vue
|
|
<template>
|
||
|
|
<section class="selectUser">
|
||
|
|
<div class="header-middle">
|
||
|
|
<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)" />
|
||
|
|
<img src="./images/tx@2x.png" alt="" class="avatras"/>
|
||
|
|
</div>
|
||
|
|
<div class="rights fill">
|
||
|
|
<div class="applicationNames">
|
||
|
|
<AiOpenData type="userName" :openid="e.id"/>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<AiEmpty description="暂无数据" v-if="!hasData"/>
|
||
|
|
</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()
|
||
|
|
},
|
||
|
|
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) {
|
||
|
|
this.userList = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.id)}))
|
||
|
|
console.log(this.userList, '123456');
|
||
|
|
}
|
||
|
|
})
|
||
|
|
},
|
||
|
|
itemCheck(row) {
|
||
|
|
row.isChecked = !row.isChecked
|
||
|
|
if (row.isChecked) {
|
||
|
|
this.selected[0] = row
|
||
|
|
}
|
||
|
|
console.log(this.selected, '胡很顾及到凤凰国际');
|
||
|
|
// else {
|
||
|
|
// let index = this.selected.findIndex(e => e.id == row.id)
|
||
|
|
// this.selected.splice(index, 1)
|
||
|
|
// }
|
||
|
|
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>
|