BUG 30239
This commit is contained in:
@@ -9,24 +9,16 @@
|
|||||||
<u-icon name="arrow-right" color="#999" size="24" style="margin-left:8px;"/>
|
<u-icon name="arrow-right" color="#999" size="24" style="margin-left:8px;"/>
|
||||||
</AiAreaPicker>
|
</AiAreaPicker>
|
||||||
</div>
|
</div>
|
||||||
<div class="area-flex">
|
|
||||||
<p class="title">部门</p>
|
|
||||||
<div class="value">
|
|
||||||
<AiPagePicker type="dept" :selected.sync="deptList" nodeKey="id" :isRequire="0">
|
|
||||||
<AiMore v-model="moreTextDept"/>
|
|
||||||
</AiPagePicker>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="area-flex">
|
|
||||||
<p class="title">人员</p>
|
|
||||||
<div class="value">
|
|
||||||
<AiPagePicker type="sysUser" :selected.sync="userList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id" :isRequire="0">
|
|
||||||
<AiMore v-model="moreText"/>
|
|
||||||
</AiPagePicker>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="type-content">
|
<div class="type-content">
|
||||||
|
<div class="type-list">
|
||||||
|
<p v-text="`部门/人员`"/>
|
||||||
|
<div class="list">
|
||||||
|
<AiPagePicker type="custom" :selected.sync="deptUserList" nodeKey="id" :ops="{url:'./selectDeptUser',label:'name'}" valueObj>
|
||||||
|
<div class="item active" v-for="item in deptUserList" :key="item.id">{{ item.name }}</div>
|
||||||
|
<AiMore v-if="deptUserList.length==0" class="right"/>
|
||||||
|
</AiPagePicker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="type-list" v-for="(item, index) in tagList" :key="index">
|
<div class="type-list" v-for="(item, index) in tagList" :key="index">
|
||||||
<p>{{ item.name }}</p>
|
<p>{{ item.name }}</p>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
@@ -48,6 +40,7 @@ import {mapState} from 'vuex'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "chooseUser",
|
name: "chooseUser",
|
||||||
|
appName: "条件选择",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: '',
|
value: '',
|
||||||
@@ -62,12 +55,16 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
moreText() {
|
deptUserList: {
|
||||||
if (this.userList.length) return '已选择'
|
set(v) {
|
||||||
},
|
this.userList = v.filter(e => e.kind == 'user')
|
||||||
moreTextDept() {
|
this.deptList = v.filter(e => e.kind == 'dept')
|
||||||
if (this.deptList.length) return '已选择'
|
},
|
||||||
},
|
get() {
|
||||||
|
let {userList, deptList} = this
|
||||||
|
return [userList, deptList].flat()
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTagList() {
|
getTagList() {
|
||||||
@@ -75,10 +72,7 @@ export default {
|
|||||||
if (res?.code == 0) {
|
if (res?.code == 0) {
|
||||||
res.data.records.map((item) => {
|
res.data.records.map((item) => {
|
||||||
item.tagList.map((items) => {
|
item.tagList.map((items) => {
|
||||||
items.isCheck = false
|
items.isCheck = this.tagIdList.includes(items.id);
|
||||||
if (this.tagIdList.includes(items.id)) {
|
|
||||||
items.isCheck = true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.tagList = res.data.records
|
this.tagList = res.data.records
|
||||||
@@ -281,5 +275,8 @@ export default {
|
|||||||
font-size: 28px !important;
|
font-size: 28px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
281
src/project/police/AppMessageNotification/selectDeptUser.vue
Normal file
281
src/project/police/AppMessageNotification/selectDeptUser.vue
Normal file
@@ -0,0 +1,281 @@
|
|||||||
|
<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="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||||
|
</div>
|
||||||
|
<div class="rightes">
|
||||||
|
<div class="applicationNames">{{ item.name }}</div>
|
||||||
|
<img src="./components/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="./components/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: "selectDeptUser",
|
||||||
|
appName: "选择部门/人员",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selected: [],
|
||||||
|
allData: null,
|
||||||
|
treeList: [],
|
||||||
|
selectDeptPath: [],
|
||||||
|
userList: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
hasData() {
|
||||||
|
return this.treeList?.length > 0 || this.userList?.length > 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.selected = this.$route.query.selected.map(id => ({id})) || []
|
||||||
|
this.getAllDepts()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
isSelected(id) {
|
||||||
|
return !!this.selected.find(e => e.id == id)
|
||||||
|
},
|
||||||
|
getAllDepts() {
|
||||||
|
this.$http.post('/app/wxcp/wxdepartment/listAll').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())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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;
|
||||||
|
|
||||||
|
.imgselect {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-image: url("./components/img/xz.png");
|
||||||
|
background-position: center;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
|
||||||
|
&.checked {
|
||||||
|
background-image: url("./components/img/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>
|
||||||
Reference in New Issue
Block a user