<template>
|
<el-dialog v-model="dialogVisible" :fullscreen="full" title="用户选择" width="60%" draggable>
|
<el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
|
<el-row>
|
<el-col :span="6">
|
<div class="userTree">
|
<el-input v-model="names" placeholder="请输入组织机构过滤"></el-input>
|
<div class="tree">
|
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" />
|
</div>
|
</div>
|
</el-col>
|
<el-col :span="14" style="padding: 20px">
|
<el-form ref="ruleFormRef" :model="ruleForm" status-icon>
|
<el-row>
|
<el-col :span="10" :offset="1">
|
<el-form-item size="default">
|
<el-input v-model="ruleForm.pass" placeholder="登录名" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8" :offset="1">
|
<el-form-item>
|
<el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button>
|
<el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<el-table :data="tableData" style="width: 100%; margin-top: 20px" @cell-click="radio">
|
<el-table-column align="center">
|
<template #default="scope">
|
<el-radio-group v-model="radio1">
|
<el-radio :label="scope.row.id" size="large">{{ null }}</el-radio>
|
</el-radio-group>
|
</template>
|
</el-table-column>
|
<el-table-column align="center" prop="date" label="登录名" />
|
<el-table-column align="center" prop="name" label="用户名" />
|
<el-table-column align="center" prop="address" label="所属机构" />
|
<el-table-column align="center" prop="address" label="所属部门" />
|
<el-table-column align="center" prop="address" label="状态" />
|
</el-table>
|
<el-pagination
|
style="padding: 20px 0; border-bottom: 1px solid #dedede"
|
v-model:currentPage="currentPage4"
|
v-model:page-size="pageSize4"
|
:page-sizes="[100, 200, 300, 400]"
|
:small="small"
|
:disabled="disabled"
|
:background="background"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="400"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</el-col>
|
<el-col :span="4">
|
<el-tag
|
v-for="tag in dynamicTags"
|
:key="tag"
|
class="mx-1"
|
style="margin: 5px"
|
closable
|
:disable-transitions="false"
|
@close="handleClose(tag)"
|
>
|
{{ tag.name }}
|
</el-tag>
|
</el-col>
|
</el-row>
|
<template #footer>
|
<span class="dialog-footer">
|
<el-button @click="dialogVisible = false" size="default">关闭</el-button>
|
<el-button type="primary" @click="submitForm" size="default">确定</el-button>
|
</span>
|
</template>
|
</el-dialog>
|
</template>
|
<script lang="ts">
|
import { defineComponent, ref, reactive } from 'vue';
|
import { FullScreen } from '@element-plus/icons-vue';
|
interface Tree {
|
label: string;
|
children?: Tree[];
|
}
|
export default defineComponent({
|
setup(props,{emit}) {
|
//左边树形部分
|
const names = ref<any>();
|
const handleNodeClick = (data: Tree) => {
|
console.log(data);
|
};
|
|
const data: Tree[] = [
|
{
|
label: 'Level one 1',
|
children: [
|
{
|
label: 'Level two 1-1',
|
children: [
|
{
|
label: 'Level three 1-1-1',
|
},
|
],
|
},
|
],
|
},
|
{
|
label: 'Level one 2',
|
children: [
|
{
|
label: 'Level two 2-1',
|
children: [
|
{
|
label: 'Level three 2-1-1',
|
},
|
],
|
},
|
{
|
label: 'Level two 2-2',
|
children: [
|
{
|
label: 'Level three 2-2-1',
|
},
|
],
|
},
|
],
|
},
|
{
|
label: 'Level one 3',
|
children: [
|
{
|
label: 'Level two 3-1',
|
children: [
|
{
|
label: 'Level three 3-1-1',
|
},
|
],
|
},
|
{
|
label: 'Level two 3-2',
|
children: [
|
{
|
label: 'Level three 3-2-1',
|
},
|
],
|
},
|
],
|
},
|
];
|
//中间表格
|
// 搜索条件
|
const ruleForm = reactive({
|
pass: '',
|
checkPass: '',
|
});
|
// 表格
|
const tableData = [
|
{ id:1,
|
date: '2016-05-03',
|
name: 'Tom',
|
address: 'No. 189, Grove St, Los Angeles',
|
},
|
{
|
id:2,
|
date: '2016-05-02',
|
name: 'Tom',
|
address: 'No. 189, Grove St, Los Angeles',
|
},
|
{ id:3,
|
date: '2016-05-04',
|
name: 'Tom',
|
address: 'No. 189, Grove St, Los Angeles',
|
},
|
{ id:4,
|
date: '2016-05-01',
|
name: 'Tom',
|
address: 'No. 189, Grove St, Los Angeles',
|
},
|
];
|
const pageSize4 = ref(100);
|
const handleSizeChange = (val: number) => {
|
console.log(`${val} items per page`);
|
};
|
const handleCurrentChange = (val: number) => {
|
console.log(`current page: ${val}`);
|
};
|
// 右方点击添加后显示标签
|
const dynamicTags = ref(['']);
|
const handleClose = (tag: string) => {
|
dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
|
radio1.value = '';
|
};
|
const radio1 = ref('');
|
const radio = (event: any) => {
|
dynamicTags.value[0] = event;
|
};
|
// 开启弹窗
|
const dialogVisible = ref(false);
|
const openDailog = () => {
|
dialogVisible.value = true;
|
};
|
//全屏
|
const full = ref(false);
|
const toggleFullscreen = () => {
|
if (full.value == false) {
|
full.value = true;
|
} else {
|
full.value = false;
|
}
|
};
|
const submitForm=()=>{
|
let obj=JSON.parse(JSON.stringify(dynamicTags.value))
|
emit("SearchUser",obj[0])
|
dialogVisible.value = false
|
}
|
return {
|
dialogVisible,
|
names,
|
data,
|
handleNodeClick,
|
openDailog,
|
ruleForm,
|
tableData,
|
pageSize4,
|
handleSizeChange,
|
handleCurrentChange,
|
radio1,
|
dynamicTags,
|
handleClose,
|
FullScreen,
|
full,
|
toggleFullscreen,
|
radio,
|
submitForm
|
};
|
},
|
});
|
</script>
|
<style scoped>
|
.userTree {
|
border: 1px solid #ebeef5;
|
}
|
.userTree .el-input {
|
padding: 10px;
|
border-bottom: 1px solid #ebeef5;
|
}
|
.tree {
|
height: 500px;
|
overflow: hidden;
|
overflow-y: auto;
|
}
|
</style>
|