Merge pull request 'master' (#338) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/338
This commit is contained in:
@@ -5,14 +5,16 @@
|
|||||||
<div class="picker">
|
<div class="picker">
|
||||||
<div class="candidate" v-loading="loading">
|
<div class="candidate" v-loading="loading">
|
||||||
<el-input v-model="filterText" @change="getList()"
|
<el-input v-model="filterText" @change="getList()"
|
||||||
clearable placeholder="输入部门进行搜索">
|
clearable placeholder="输入公司进行搜索">
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-button @click="getList()">搜索</el-button>
|
<el-button @click="getList()">搜索</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
<el-button v-if="isChooseAll" @click="chooseAll">全选</el-button>
|
||||||
|
<el-button v-else @click="cancelAll">不全选</el-button>
|
||||||
<!-- 人员选择 -->
|
<!-- 人员选择 -->
|
||||||
<el-empty :image-size="100" description="似乎没有数据" v-show="dataList.length === 0"/>
|
<el-empty :image-size="100" description="似乎没有数据" v-show="dataList.length === 0"/>
|
||||||
<el-scrollbar style="height:90%;">
|
<el-scrollbar style="height:87%;">
|
||||||
<div class="tree">
|
<div class="tree">
|
||||||
<el-tree :data="dataList" ref="tree" :props="defaultProps" empty-text="" node-key="value"
|
<el-tree :data="dataList" ref="tree" :props="defaultProps" empty-text="" node-key="value"
|
||||||
default-expand-all :show-checkbox="showCheckbox" highlight-current :default-checked-keys="defaultChecked"
|
default-expand-all :show-checkbox="showCheckbox" highlight-current :default-checked-keys="defaultChecked"
|
||||||
@@ -74,6 +76,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const radio = ref(0);
|
const radio = ref(0);
|
||||||
|
const isChooseAll = ref(true);
|
||||||
const chooseId = ref(0);
|
const chooseId = ref(0);
|
||||||
let selectItem = reactive({
|
let selectItem = reactive({
|
||||||
type: -1,
|
type: -1,
|
||||||
@@ -107,7 +110,22 @@ const _value = computed({
|
|||||||
watch(() => filterText.value, (newVal) => {
|
watch(() => filterText.value, (newVal) => {
|
||||||
tree.value.filter(newVal);
|
tree.value.filter(newVal);
|
||||||
});
|
});
|
||||||
|
const matterTree=(list)=>{
|
||||||
|
list.forEach(item=>{
|
||||||
|
tree.value.setChecked(item,true)
|
||||||
|
if(item.children!==undefined){
|
||||||
|
matterTree(item.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const cancelAll=()=>{
|
||||||
|
isChooseAll.value=true
|
||||||
|
tree.value.setCheckedNodes([])
|
||||||
|
}
|
||||||
|
const chooseAll=()=>{
|
||||||
|
isChooseAll.value=false
|
||||||
|
matterTree(dataList.value)
|
||||||
|
}
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
getSubCompOpt().then(res => {
|
getSubCompOpt().then(res => {
|
||||||
dataList.value = res.data;
|
dataList.value = res.data;
|
||||||
@@ -252,6 +270,7 @@ $containWidth: 480px;
|
|||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
float: right;
|
float: right;
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.picker {
|
.picker {
|
||||||
@@ -261,9 +280,9 @@ $containWidth: 480px;
|
|||||||
|
|
||||||
.candidate {
|
.candidate {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: inline-block;
|
display: block;
|
||||||
width: $containWidth;
|
width: $containWidth;
|
||||||
height: 98%;
|
height: 100%;
|
||||||
border: 1px solid #e8e8e8;
|
border: 1px solid #e8e8e8;
|
||||||
|
|
||||||
:deep(.el-input) {
|
:deep(.el-input) {
|
||||||
@@ -281,7 +300,7 @@ $containWidth: 480px;
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 450px;
|
width: 450px;
|
||||||
height: 98%;
|
height: 100%;
|
||||||
border: 1px solid #e8e8e8;
|
border: 1px solid #e8e8e8;
|
||||||
|
|
||||||
.count {
|
.count {
|
||||||
|
|||||||
Reference in New Issue
Block a user