|
|
@@ -2,22 +2,24 @@
|
|
|
<div class="allocation">
|
|
|
<el-input v-model="searchValue" style="width: 240px" placeholder="输入姓名、手机号、工号查找" clearable>
|
|
|
<template #prefix>
|
|
|
- <el-icon class="el-input__icon" @click="handleSearch"><Search /></el-icon>
|
|
|
+ <el-icon class="el-input__icon"><Search /></el-icon>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
<el-row :gutter="20" class="allocation-content">
|
|
|
<el-col :span="12" style="padding: 10px; box-sizing: border-box;">
|
|
|
<el-tree
|
|
|
+ ref="treeRef"
|
|
|
:data="options"
|
|
|
:props="cascaderProps"
|
|
|
node-key="id"
|
|
|
:default-expanded-keys="expandedKeys"
|
|
|
:default-checked-keys="checkedKeys"
|
|
|
@node-click="handleNodeClick"
|
|
|
+ :filter-node-method="filterNode"
|
|
|
/>
|
|
|
</el-col>
|
|
|
<el-col :span="12" style="padding: 10px; box-sizing: border-box;border-left: 1px solid #ccc;">
|
|
|
- <el-radio-group v-model="radioValue" class="allocation-radio">
|
|
|
+ <el-radio-group v-if="userList?.length>0" v-model="radioValue" class="allocation-radio">
|
|
|
<el-radio v-for="item in userList" :value="item.id" size="large">
|
|
|
<template #default>
|
|
|
<div>{{ item.name }}</div>
|
|
|
@@ -25,6 +27,7 @@
|
|
|
</template>
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
+ <el-empty v-else description="暂无数据" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<div style="display: flex; justify-content: flex-end">
|
|
|
@@ -71,10 +74,16 @@ const initCheckedKeys = (id, type, ids) => {
|
|
|
initUser(id)
|
|
|
}
|
|
|
|
|
|
+// 搜索过滤
|
|
|
let searchValue = ref('')
|
|
|
+const treeRef = ref(null)
|
|
|
+watch(searchValue, (val) => {
|
|
|
+ treeRef.value!.filter(val);
|
|
|
+});
|
|
|
const handleSearch = () => {
|
|
|
-
|
|
|
+ filterNode(searchValue.value, options.value)
|
|
|
}
|
|
|
+
|
|
|
// 机构数据
|
|
|
let options = ref([])
|
|
|
// 默认展开
|
|
|
@@ -101,12 +110,24 @@ const institutionList = () => {
|
|
|
}
|
|
|
const handleNodeClick = (data) => {
|
|
|
console.log(data)
|
|
|
+ initUser(data.id)
|
|
|
+}
|
|
|
+const filterNode = (value: string, data: any) => {
|
|
|
+ if (!value) return true
|
|
|
+ return data.name.includes(value)
|
|
|
}
|
|
|
|
|
|
let radioValue = ref('')
|
|
|
|
|
|
const onSubmit = (type) => {
|
|
|
if(type == '确定') {
|
|
|
+ if(!radioValue.value) {
|
|
|
+ ElMessage({
|
|
|
+ message: '请选择管理人',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
api.operationApi.setLeader({
|
|
|
ids: selectedIds.value,
|
|
|
leaderId: radioValue.value,
|