| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <template>
- <el-dialog
- :title="title"
- :visible.sync="visible"
- :before-close="handleClose"
- :close-on-click-modal="false"
- top="5vh"
- :close-on-press-escape="false"
- append-to-body
- width="70%"
- >
- <el-card shadow="never">
- <ele-split-layout width="244px" allow-collapse>
- <div class="ele-border-lighter split-layout-right-content">
- <DepartmentTree
- @handleNodeClick="handleNodeClick"
- :isFirstRefreshTable="false"
- ref="treeList"
- />
- </div>
- <!-- 表格 -->
- <template v-slot:content>
- <user-select-search @search="reload"></user-select-search>
- <ele-pro-table
- class="table1"
- ref="table222"
- :columns="columns1"
- :datasource="datasource"
- :selection.sync="selection"
- height="calc(100vh - 430px)"
- cache-key="systemRoleTable3"
- row-key="id"
- ></ele-pro-table>
- </template>
- </ele-split-layout>
- </el-card>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" size="small" @click="selected">选择</el-button>
- <el-button size="small" @click="handleClose">关闭</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import { getUserPage } from '@/api/system/organization';
- import DepartmentTree from './departmentTree.vue';
- import userSelectSearch from './user-select-search.vue';
- export default {
- components: {
- DepartmentTree,
- userSelectSearch
- },
- props: {},
- data() {
- return {
- visible: false,
- currentIndex: 0,
- title: '选择',
- statusOptions: [
- { value: 1, label: '全职' },
- { value: 2, label: '兼职' },
- { value: 3, label: '实习' },
- { value: 4, label: '正式' },
- { value: 5, label: '试用' },
- { value: 6, label: '离职' }
- ],
- selection: [],
- columns1: [
- {
- width: 45,
- type: 'selection',
- columnKey: 'selection',
- reserveSelection: true
- },
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55
- },
- {
- prop: 'name',
- label: '姓名',
- sortable: 'custom',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'jobNumber',
- label: '工号',
- sortable: 'custom',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'loginName',
- label: '用户账号',
- sortable: 'custom',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'sex',
- label: '性别',
- sortable: 'custom',
- showOverflowTooltip: true,
- minWidth: 80,
- formatter: (_row, _column, cellValue) => {
- return cellValue == 1 ? '男' : cellValue == 2 ? '女' : '';
- }
- },
- {
- prop: 'status',
- label: '状态',
- sortable: 'custom',
- width: 80,
- formatter: (_row, _column, cellValue) => {
- const dom = this.statusOptions.find((item) => {
- return item.value == cellValue;
- });
- return dom ? dom.label : '';
- }
- }
- ]
- };
- },
- computed: {},
- watch: {},
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where }) {
- return getUserPage({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table222.reload({ pageNum: 1, where: where });
- },
- open(row, index) {
- this.visible = true;
- this.selection = [];
- this.currentIndex = index;
- this.$refs.table222.clearSelection();
- },
- handleNodeClick(data, node) {
- this.curNodeData = data;
- this.reload({ groupId: data.id });
- },
- handleClose() {
- this.visible = false;
- },
- selected() {
- if (!this.selection.length) return this.$message.warning('请选择');
- this.$emit('changeParent', this.selection, this.currentIndex);
- this.handleClose();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .table1 .el-table .el-table__cell .cell {
- display: flex;
- width: 100%;
- justify-content: center;
- }
- </style>
|