|
@@ -28,13 +28,14 @@
|
|
|
>.
|
|
>.
|
|
|
</div>
|
|
</div>
|
|
|
<template v-slot:content>
|
|
<template v-slot:content>
|
|
|
|
|
+ <user-select-search @search="reload"></user-select-search>
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
ref="table"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:datasource="datasource"
|
|
:datasource="datasource"
|
|
|
tool-class="ele-toolbar-form"
|
|
tool-class="ele-toolbar-form"
|
|
|
:selection.sync="selection"
|
|
:selection.sync="selection"
|
|
|
- cache-key="systemOrgUserTable"
|
|
|
|
|
|
|
+ row-key="id"
|
|
|
>
|
|
>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
</template>
|
|
</template>
|
|
@@ -47,142 +48,150 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getUserPage } from '@/api/system/organization';
|
|
|
|
|
|
|
+ import { getUserPage } from '@/api/system/organization';
|
|
|
|
|
+ import userSelectSearch from './user-select-search.vue';
|
|
|
|
|
|
|
|
-import { listOrganizations } from '@/api/system/organization';
|
|
|
|
|
-export default {
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- data: [],
|
|
|
|
|
- show: false,
|
|
|
|
|
- organizationId: '',
|
|
|
|
|
- // 表格列配置
|
|
|
|
|
- columns: [
|
|
|
|
|
- {
|
|
|
|
|
- width: 45,
|
|
|
|
|
- type: 'selection',
|
|
|
|
|
- columnKey: 'selection',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- selectable: (row, index) => {
|
|
|
|
|
- return (
|
|
|
|
|
- this.$store.state.user.info.userId != row.id &&
|
|
|
|
|
- !this.disArr.includes(row.id)
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- columnKey: 'index',
|
|
|
|
|
- type: 'index',
|
|
|
|
|
- label: '序号',
|
|
|
|
|
- width: 45,
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true,
|
|
|
|
|
- fixed: 'left'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- 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 ? '女' : '';
|
|
|
|
|
|
|
+ import { listOrganizations } from '@/api/system/organization';
|
|
|
|
|
+ export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ userSelectSearch
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ data: [],
|
|
|
|
|
+ show: false,
|
|
|
|
|
+ organizationId: '',
|
|
|
|
|
+ // 表格列配置
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ reserveSelection: true,
|
|
|
|
|
+ selectable: (row, index) => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ this.$store.state.user.info.userId != row.id &&
|
|
|
|
|
+ !this.disArr.includes(row.id)
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ label: '序号',
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ 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 ? '女' : '';
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- selection: [],
|
|
|
|
|
- disArr: []
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ selection: [],
|
|
|
|
|
+ disArr: []
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- created() {},
|
|
|
|
|
- methods: {
|
|
|
|
|
- /* 查询 */
|
|
|
|
|
- query() {
|
|
|
|
|
- listOrganizations()
|
|
|
|
|
- .then((list) => {
|
|
|
|
|
- let _list = list.filter((i) => i.name != '超级管理员');
|
|
|
|
|
|
|
+ created() {},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ /* 查询 */
|
|
|
|
|
+ query() {
|
|
|
|
|
+ listOrganizations()
|
|
|
|
|
+ .then((list) => {
|
|
|
|
|
+ let _list = list.filter((i) => i.name != '超级管理员');
|
|
|
|
|
|
|
|
- this.data = this.$util.toTreeData({
|
|
|
|
|
- data: _list,
|
|
|
|
|
- idField: 'id',
|
|
|
|
|
- parentIdField: 'parentId'
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.data = this.$util.toTreeData({
|
|
|
|
|
+ data: _list,
|
|
|
|
|
+ idField: 'id',
|
|
|
|
|
+ parentIdField: 'parentId'
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.onNodeClick(this.data[0]);
|
|
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.onNodeClick(this.data[0]);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ // this.$message.error(e.message);
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ async open(data) {
|
|
|
|
|
+ this.query();
|
|
|
|
|
+ this.disArr = data;
|
|
|
|
|
+
|
|
|
|
|
+ this.show = true;
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
|
+ this.$refs.table.setSelectedRowKeys([])
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
- .catch((e) => {
|
|
|
|
|
- // this.$message.error(e.message);
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ /* 表格数据源 */
|
|
|
|
|
+ async datasource({ page, limit, where, order }) {
|
|
|
|
|
+ let data = await getUserPage({
|
|
|
|
|
+ ...where,
|
|
|
|
|
+ ...order,
|
|
|
|
|
+ pageNum: page,
|
|
|
|
|
+ size: limit,
|
|
|
|
|
+ groupId: this.organizationId
|
|
|
});
|
|
});
|
|
|
- },
|
|
|
|
|
- async open(data) {
|
|
|
|
|
- this.query();
|
|
|
|
|
-
|
|
|
|
|
- this.disArr = data;
|
|
|
|
|
- this.show = true;
|
|
|
|
|
- },
|
|
|
|
|
- /* 表格数据源 */
|
|
|
|
|
- async datasource({ page, limit, where, order }) {
|
|
|
|
|
- let data = await getUserPage({
|
|
|
|
|
- ...where,
|
|
|
|
|
- ...order,
|
|
|
|
|
- pageNum: page,
|
|
|
|
|
- size: limit,
|
|
|
|
|
- groupId: this.organizationId
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
- return data;
|
|
|
|
|
- },
|
|
|
|
|
- /* 保存编辑 */
|
|
|
|
|
- save() {
|
|
|
|
|
- let data = JSON.parse(JSON.stringify(this.selection));
|
|
|
|
|
- this.$emit('success', data);
|
|
|
|
|
- this.show = false;
|
|
|
|
|
- },
|
|
|
|
|
- onNodeClick(val) {
|
|
|
|
|
- this.organizationId = val.id;
|
|
|
|
|
- this.reload();
|
|
|
|
|
- },
|
|
|
|
|
- /* 刷新表格 */
|
|
|
|
|
- reload(where) {
|
|
|
|
|
- this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
|
|
- },
|
|
|
|
|
- cancel() {
|
|
|
|
|
- this.show = false;
|
|
|
|
|
|
|
+ return data;
|
|
|
|
|
+ },
|
|
|
|
|
+ /* 保存编辑 */
|
|
|
|
|
+ save() {
|
|
|
|
|
+ let data = JSON.parse(JSON.stringify(this.selection));
|
|
|
|
|
+ this.$emit('success', data);
|
|
|
|
|
+ this.show = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ onNodeClick(val) {
|
|
|
|
|
+ this.organizationId = val.id;
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ },
|
|
|
|
|
+ /* 刷新表格 */
|
|
|
|
|
+ reload(where) {
|
|
|
|
|
+ this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
|
|
+ },
|
|
|
|
|
+ cancel() {
|
|
|
|
|
+ this.show = false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
-:deep(.ele-split-panel-wrap) {
|
|
|
|
|
- height: 50vh;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
-}
|
|
|
|
|
-:deep(.el-checkbox__input.is-disabled .el-checkbox__inner){
|
|
|
|
|
- background-color: #f3f3f3;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
|
|
+ :deep(.ele-split-panel-wrap) {
|
|
|
|
|
+ height: 50vh;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+ :deep(.el-checkbox__input.is-disabled .el-checkbox__inner) {
|
|
|
|
|
+ background-color: #f3f3f3;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|