Merge branch 'main' of http://101.43.53.74:3000/Admin.NET/Admin.NET
This commit is contained in:
commit
842b236250
@ -363,7 +363,7 @@ public class SysUserService : IDynamicApiController, ITransient
|
|||||||
// 获取当前用户可用的角色
|
// 获取当前用户可用的角色
|
||||||
var availableRoles = await _sysRoleService.GetList();
|
var availableRoles = await _sysRoleService.GetList();
|
||||||
// 改变用户分配的角色可分配状态
|
// 改变用户分配的角色可分配状态
|
||||||
grantedRoles.ForEach(u => u.Disabled = !availableRoles.Any(u => u.Id == u.Id));
|
grantedRoles.ForEach(u => u.Disabled = !availableRoles.Any(e => e.Id == u.Id));
|
||||||
// 排除已分配的角色
|
// 排除已分配的角色
|
||||||
availableRoles = availableRoles.ExceptBy(grantedRoles.Select(u => u.Id), u => u.Id).ToList();
|
availableRoles = availableRoles.ExceptBy(grantedRoles.Select(u => u.Id), u => u.Id).ToList();
|
||||||
return new GrantRoleOutput { GrantedRoles = grantedRoles, AvailableRoles = availableRoles };
|
return new GrantRoleOutput { GrantedRoles = grantedRoles, AvailableRoles = availableRoles };
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
:disabled="item[props.options.disabled]"
|
:disabled="item[props.options.disabled]"
|
||||||
:validate-event="false"
|
:validate-event="false"
|
||||||
class="transfer-panel__item"
|
class="transfer-panel__item"
|
||||||
|
@dblclick="dbClickToRight(item)"
|
||||||
>
|
>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
@ -54,6 +55,7 @@
|
|||||||
:disabled="item[props.options.disabled]"
|
:disabled="item[props.options.disabled]"
|
||||||
:validate-event="false"
|
:validate-event="false"
|
||||||
class="transfer-panel__item"
|
class="transfer-panel__item"
|
||||||
|
@dblclick="dbClickToLeft(item)"
|
||||||
>
|
>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
@ -156,6 +158,20 @@ watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 双击左边的变右边
|
||||||
|
const dbClickToRight = (item: any) => {
|
||||||
|
if (item[props.options.value] && item[props.options.disabled] === false) {
|
||||||
|
//取交集
|
||||||
|
let adds = props.leftData.filter((e: any) => item[props.options.value] == e[props.options.value]);
|
||||||
|
//取差集
|
||||||
|
let cuts = props.leftData.filter((e: any) => item[props.options.value] != e[props.options.value]);
|
||||||
|
emits('update:leftData', cuts);
|
||||||
|
emits('update:rightData', props.rightData.concat(adds));
|
||||||
|
emits('right');
|
||||||
|
state.leftChecked = state.leftChecked.filter((e: any) => item[props.options.value] != e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 左边中选中的变右边
|
// 左边中选中的变右边
|
||||||
const toRight = () => {
|
const toRight = () => {
|
||||||
if (state.leftChecked?.length > 0) {
|
if (state.leftChecked?.length > 0) {
|
||||||
@ -185,6 +201,20 @@ const allToRight = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 双击右边的变左边
|
||||||
|
const dbClickToLeft = (item: any) => {
|
||||||
|
if (item[props.options.value] && item[props.options.disabled] === false) {
|
||||||
|
//取交集
|
||||||
|
let adds = props.rightData.filter((e: any) => item[props.options.value] == e[props.options.value]);
|
||||||
|
//取差集
|
||||||
|
let cuts = props.rightData.filter((e: any) => item[props.options.value] != e[props.options.value]);
|
||||||
|
emits('update:leftData', props.leftData.concat(adds));
|
||||||
|
emits('update:rightData', cuts);
|
||||||
|
emits('left');
|
||||||
|
state.rightChecked = state.rightChecked.filter((e: any) => item[props.options.value] != e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 右边中选中的变左边
|
// 右边中选中的变左边
|
||||||
const toLeft = () => {
|
const toLeft = () => {
|
||||||
if (state.rightChecked?.length > 0) {
|
if (state.rightChecked?.length > 0) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user