forked from github/dataease
Merge pull request #2713 from dataease/pr@dev_user_role_dept
Pr@dev user role dept
This commit is contained in:
commit
23e81bc9d6
@ -159,16 +159,6 @@ export default {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
::v-deep .el-table__header-wrapper {
|
|
||||||
background-color: #f5f6f7;
|
|
||||||
// border-top: 1px solid rgba(31, 35, 41, 0.15);
|
|
||||||
}
|
|
||||||
::v-deep .el-table__fixed-header-wrapper {
|
|
||||||
th {
|
|
||||||
background-color: var(--TableBG, #f5f6f7) !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-table::before {
|
.el-table::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -557,7 +557,11 @@ export default {
|
|||||||
new_passwd: 'New Password',
|
new_passwd: 'New Password',
|
||||||
confirm_passwd: 'Confirm Password',
|
confirm_passwd: 'Confirm Password',
|
||||||
change_password: 'Change Password',
|
change_password: 'Change Password',
|
||||||
search_by_name: 'Search by name'
|
search_by_name: 'Search by name',
|
||||||
|
result_one: 'Results',
|
||||||
|
clear_filter: 'Empty condition',
|
||||||
|
recover_pwd: 'Restore to the original password?',
|
||||||
|
filter_method: 'Filter criteria',
|
||||||
},
|
},
|
||||||
ldap: {
|
ldap: {
|
||||||
url: 'LDAP url',
|
url: 'LDAP url',
|
||||||
|
@ -558,7 +558,11 @@ export default {
|
|||||||
confirm_passwd: '確認密碼',
|
confirm_passwd: '確認密碼',
|
||||||
change_password: '修改密碼',
|
change_password: '修改密碼',
|
||||||
search_by_name: '按姓名搜索',
|
search_by_name: '按姓名搜索',
|
||||||
import_ldap: '導入LDAP用戶'
|
import_ldap: '導入LDAP用戶',
|
||||||
|
result_one: '個結果',
|
||||||
|
clear_filter: '清空條件',
|
||||||
|
recover_pwd: '是否恢復為初始密碼?',
|
||||||
|
filter_method: '篩選條件',
|
||||||
},
|
},
|
||||||
ldap: {
|
ldap: {
|
||||||
url: 'LDAP地址',
|
url: 'LDAP地址',
|
||||||
|
@ -559,7 +559,11 @@ export default {
|
|||||||
confirm_passwd: '确认密码',
|
confirm_passwd: '确认密码',
|
||||||
change_password: '修改密码',
|
change_password: '修改密码',
|
||||||
search_by_name: '按姓名搜索',
|
search_by_name: '按姓名搜索',
|
||||||
import_ldap: '导入LDAP用户'
|
import_ldap: '导入LDAP用户',
|
||||||
|
result_one: '个结果',
|
||||||
|
clear_filter: '清空条件',
|
||||||
|
recover_pwd: '是否恢复为初始密码?',
|
||||||
|
filter_method: '筛选条件',
|
||||||
},
|
},
|
||||||
ldap: {
|
ldap: {
|
||||||
url: 'LDAP地址',
|
url: 'LDAP地址',
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
:show-close="false"
|
:show-close="false"
|
||||||
class="dialog-css"
|
class="dialog-css"
|
||||||
:fullscreen="true"
|
:fullscreen="true"
|
||||||
append-to-body="true"
|
append-to-body
|
||||||
>
|
>
|
||||||
<template-market v-if="templateMarketShow" style="text-align: center" @closeDialog="changeTemplateMarketShow(false)" />
|
<template-market v-if="templateMarketShow" style="text-align: center" @closeDialog="changeTemplateMarketShow(false)" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -871,3 +871,20 @@ div:focus {
|
|||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.de-confirm-fail-cancel:hover {
|
||||||
|
background: #F5F6F7 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.de-confirm-fail-confirm:hover {
|
||||||
|
background: #F76964 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__header-wrapper {
|
||||||
|
background-color: var(--TableBG, #f5f6f7) !important;
|
||||||
|
}
|
||||||
|
.el-table__fixed-header-wrapper {
|
||||||
|
th {
|
||||||
|
background-color: var(--TableBG, #f5f6f7) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-drawer
|
<el-drawer
|
||||||
title="筛选条件"
|
:title="$t('user.filter_method')"
|
||||||
:visible.sync="userDrawer"
|
:visible.sync="userDrawer"
|
||||||
custom-class="user-drawer"
|
custom-class="user-drawer"
|
||||||
size="680px"
|
size="680px"
|
||||||
@ -8,7 +8,7 @@
|
|||||||
direction="rtl"
|
direction="rtl"
|
||||||
>
|
>
|
||||||
<div class="filter">
|
<div class="filter">
|
||||||
<span>状态</span>
|
<span>{{ $t('commons.status')}}</span>
|
||||||
<div class="filter-item">
|
<div class="filter-item">
|
||||||
<span
|
<span
|
||||||
class="item"
|
class="item"
|
||||||
@ -16,11 +16,11 @@
|
|||||||
:class="[activeStatus.includes(ele.id) ? 'active' : '']"
|
:class="[activeStatus.includes(ele.id) ? 'active' : '']"
|
||||||
:key="ele.id"
|
:key="ele.id"
|
||||||
v-for="ele in status"
|
v-for="ele in status"
|
||||||
>{{ ele.label }}</span>
|
>{{ $t(ele.label) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter">
|
<div class="filter">
|
||||||
<span>组织</span>
|
<span>{{ $t('commons.organization')}}</span>
|
||||||
<div class="filter-item">
|
<div class="filter-item">
|
||||||
<span
|
<span
|
||||||
class="item"
|
class="item"
|
||||||
@ -67,12 +67,12 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<span class="more" slot="reference">+ 更多</span>
|
<span class="more" slot="reference">+ {{ $t('panel.more')}}</span>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter">
|
<div class="filter">
|
||||||
<span>角色</span>
|
<span>{{ $t('panel.role')}}</span>
|
||||||
<div class="filter-item">
|
<div class="filter-item">
|
||||||
<span
|
<span
|
||||||
@click="activeRoleChange(ele.id)"
|
@click="activeRoleChange(ele.id)"
|
||||||
@ -104,7 +104,7 @@
|
|||||||
:value="item"
|
:value="item"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span class="more" slot="reference">+ 更多</span>
|
<span class="more" slot="reference">+ {{ $t('panel.more')}}</span>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -133,10 +133,10 @@ export default {
|
|||||||
filterTextMap: [],
|
filterTextMap: [],
|
||||||
status: [{
|
status: [{
|
||||||
id: 1,
|
id: 1,
|
||||||
label: '启用'
|
label: 'commons.enable'
|
||||||
},{
|
},{
|
||||||
id: 0,
|
id: 0,
|
||||||
label: '禁用'
|
label: 'commons.disable'
|
||||||
}],
|
}],
|
||||||
activeStatus: [],
|
activeStatus: [],
|
||||||
rolesValue: [],
|
rolesValue: [],
|
||||||
@ -276,16 +276,16 @@ export default {
|
|||||||
this.filterTextMap = [];
|
this.filterTextMap = [];
|
||||||
const params = [];
|
const params = [];
|
||||||
if (this.activeStatus.length) {
|
if (this.activeStatus.length) {
|
||||||
let str = `状态:${this.activeStatus.reduce((pre,next) => (this.status.find(ele => ele.id === next) || {}).label + '、' + pre, '')}`;
|
let str = `${this.$t('kettle.status')}:${this.activeStatus.reduce((pre,next) => (this.status.find(ele => ele.id === next) || {}).label + '、' + pre, '')}`;
|
||||||
params.push(str.slice(0, str.length - 1 ))
|
params.push(str.slice(0, str.length - 1 ))
|
||||||
this.filterTextMap.push(['activeStatus'])
|
this.filterTextMap.push(['activeStatus'])
|
||||||
}
|
}
|
||||||
if (this.activeDept.length) {
|
if (this.activeDept.length) {
|
||||||
params.push(`组织:${this.selectDeptsCahe.map(ele => ele.label).join('、')}`)
|
params.push(`${this.$t('panel.org')}:${this.selectDeptsCahe.map(ele => ele.label).join('、')}`)
|
||||||
this.filterTextMap.push(['activeDept', 'selectDepts', 'selectDeptsCahe', 'deptCahe'])
|
this.filterTextMap.push(['activeDept', 'selectDepts', 'selectDeptsCahe', 'deptCahe'])
|
||||||
}
|
}
|
||||||
if (this.activeRole.length) {
|
if (this.activeRole.length) {
|
||||||
params.push(`角色:${this.rolesValueCopy.map(ele => ele.name).join('、')}`)
|
params.push(`${this.$t('panel.role')}:${this.rolesValueCopy.map(ele => ele.name).join('、')}`)
|
||||||
this.filterTextMap.push(['rolesValue', 'activeRole', 'roleCahe'])
|
this.filterTextMap.push(['rolesValue', 'activeRole', 'roleCahe'])
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<div class="filter-texts" v-if="filterTexts.length">
|
<div class="filter-texts" v-if="filterTexts.length">
|
||||||
<span class="sum">{{ paginationConfig.total }}</span>
|
<span class="sum">{{ paginationConfig.total }}</span>
|
||||||
<span class="title">个结果</span>
|
<span class="title">{{$t('user.result_one')}}</span>
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<i @click="scrollPre" v-if="showScroll" class="el-icon-arrow-left arrow-filter"></i>
|
<i @click="scrollPre" v-if="showScroll" class="el-icon-arrow-left arrow-filter"></i>
|
||||||
<div class="filter-texts-container">
|
<div class="filter-texts-container">
|
||||||
@ -77,11 +77,12 @@
|
|||||||
class="clear-btn"
|
class="clear-btn"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="clearFilter"
|
@click="clearFilter"
|
||||||
>清空条件</el-button
|
>{{$t('user.clear_filter')}}</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="table-container"
|
class="table-container"
|
||||||
|
id="resize-for-filter"
|
||||||
:class="[filterTexts.length ? 'table-container-filter' : '']"
|
:class="[filterTexts.length ? 'table-container-filter' : '']"
|
||||||
>
|
>
|
||||||
<grid-table
|
<grid-table
|
||||||
@ -177,7 +178,7 @@
|
|||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
slot="__operation"
|
slot="__operation"
|
||||||
label="操作"
|
:label="$t('commons.operating')"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
width="168"
|
width="168"
|
||||||
>
|
>
|
||||||
@ -197,7 +198,7 @@
|
|||||||
trigger="click"
|
trigger="click"
|
||||||
>
|
>
|
||||||
<i class="el-icon-warning"></i>
|
<i class="el-icon-warning"></i>
|
||||||
<div class="tips">是否恢复为初始密码?</div>
|
<div class="tips">{{$t('user.recover_pwd')}}</div>
|
||||||
<div class="editer-form-title">
|
<div class="editer-form-title">
|
||||||
<span class="pwd" type="text">{{
|
<span class="pwd" type="text">{{
|
||||||
$t("commons.default_pwd") + ":" + defaultPWD
|
$t("commons.default_pwd") + ":" + defaultPWD
|
||||||
@ -300,6 +301,7 @@ import {
|
|||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
import filterUser from "./filterUser.vue";
|
import filterUser from "./filterUser.vue";
|
||||||
import GridTable from "@/components/gridTable/index.vue";
|
import GridTable from "@/components/gridTable/index.vue";
|
||||||
|
import _ from 'lodash';
|
||||||
export default {
|
export default {
|
||||||
components: { DeLayoutContent, GridTable, filterUser, userEditer },
|
components: { DeLayoutContent, GridTable, filterUser, userEditer },
|
||||||
data() {
|
data() {
|
||||||
@ -349,6 +351,7 @@ export default {
|
|||||||
defaultPWD: "DataEase123..",
|
defaultPWD: "DataEase123..",
|
||||||
canLoadDom: false,
|
canLoadDom: false,
|
||||||
showScroll: false,
|
showScroll: false,
|
||||||
|
resizeForFilter: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -369,6 +372,7 @@ export default {
|
|||||||
this.allRoles();
|
this.allRoles();
|
||||||
this.search();
|
this.search();
|
||||||
document.addEventListener("keypress", this.entryKey);
|
document.addEventListener("keypress", this.entryKey);
|
||||||
|
this.resizeObserver();
|
||||||
},
|
},
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
pluginLoaded()
|
pluginLoaded()
|
||||||
@ -392,6 +396,16 @@ export default {
|
|||||||
document.removeEventListener("keypress", this.entryKey);
|
document.removeEventListener("keypress", this.entryKey);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
resizeObserver() {
|
||||||
|
this.resizeForFilter = new ResizeObserver(entries => {
|
||||||
|
if (!this.filterTexts.length) return;
|
||||||
|
this.layoutResize();
|
||||||
|
});
|
||||||
|
this.resizeForFilter.observe(document.querySelector('#resize-for-filter'));
|
||||||
|
},
|
||||||
|
layoutResize: _.debounce(function () {
|
||||||
|
this.getScrollStatus()
|
||||||
|
}, 200),
|
||||||
scrollPre() {
|
scrollPre() {
|
||||||
const dom = document.querySelector('.filter-texts-container');
|
const dom = document.querySelector('.filter-texts-container');
|
||||||
dom.scrollLeft -= 10
|
dom.scrollLeft -= 10
|
||||||
@ -930,9 +944,8 @@ export default {
|
|||||||
color: #1f2329;
|
color: #1f2329;
|
||||||
}
|
}
|
||||||
|
|
||||||
.de-confirm-fail-confirm,
|
.de-confirm-fail-confirm {
|
||||||
.de-confirm-fail-confirm:hover {
|
background: #f54a45;
|
||||||
background: #f54a45 !important;
|
|
||||||
border: none;
|
border: none;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user