This commit is contained in:
橙子
2021-10-19 11:49:25 +08:00
parent 135b9148b3
commit 358dee1262
11 changed files with 39 additions and 30 deletions

View File

@@ -168,5 +168,11 @@
<param name="idsListDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.GetRolesByUser">
<summary>
根据http上下文的用户得到该用户有哪些角色
</summary>
<returns></returns>
</member>
</members>
</doc>

View File

@@ -6,8 +6,9 @@
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
<#
DirectoryInfo dir = new DirectoryInfo(@"D:\YiFramework\Yi\Yi.Framework\Yi.Framework.Model\Models\");
string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径
string dirPath= Path.Combine(solutionsPath,@"Yi.Framework.Model\Models\");
DirectoryInfo dir = new DirectoryInfo(dirPath);
FileInfo[] finfo = dir.GetFiles();
string filenames = string.Empty;
List<string> filenameList = new List<string>();

View File

@@ -6,8 +6,9 @@
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
<#
DirectoryInfo dir = new DirectoryInfo(@"D:\YiFramework\Yi\Yi.Framework\Yi.Framework.Model\Models\");
string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径
string dirPath= Path.Combine(solutionsPath,@"Yi.Framework.Model\Models\");
DirectoryInfo dir = new DirectoryInfo(dirPath);
FileInfo[] finfo = dir.GetFiles();
string filenames = string.Empty;
List<string> filenameList = new List<string>();

View File

@@ -11,9 +11,6 @@ namespace Yi.Framework.Service
{
public partial class MenuService:BaseService<menu>, IMenuService
{
public MenuService(DbContext Db) : base(Db) { }
public async Task<menu> AddChildrenMenu(menu _menu, menu _children)
{
var menu_data = await _Db.Set<menu>().Include(u => u.children).Where(u => u.id == _menu.id).FirstOrDefaultAsync();

View File

@@ -11,8 +11,6 @@ namespace Yi.Framework.Service
{
public partial class MouldService:BaseService<mould>, IMouldService
{
public MouldService(DbContext Db) : base(Db) { }
public async Task<bool> DelListByUpdateAsync(List<int> _ids)
{
var mouldList =await GetEntitiesAsync(u => _ids.Contains(u.id));

View File

@@ -11,10 +11,6 @@ namespace Yi.Framework.Service
{
public partial class RoleService:BaseService<role>, IRoleService
{
public RoleService(DbContext Db):base(Db)
{
}
public async Task<bool> DelListByUpdateAsync(List<int> _ids)
{
var userList = await GetEntitiesAsync(u=>_ids.Contains(u.id));

View File

@@ -12,21 +12,21 @@ namespace Yi.Framework.Service
public partial class MenuService:BaseService<menu>,IMenuService
{
//public MenuService(DbContext Db):base(Db){ }
public MenuService(DbContext Db):base(Db){ }
}
public partial class MouldService:BaseService<mould>,IMouldService
{
//public MouldService(DbContext Db):base(Db){ }
public MouldService(DbContext Db):base(Db){ }
}
public partial class RoleService:BaseService<role>,IRoleService
{
//public RoleService(DbContext Db):base(Db){ }
public RoleService(DbContext Db):base(Db){ }
}
public partial class UserService:BaseService<user>,IUserService
{
//public UserService(DbContext Db):base(Db){ }
public UserService(DbContext Db):base(Db){ }
}
}

View File

@@ -6,8 +6,9 @@
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
<#
DirectoryInfo dir = new DirectoryInfo(@"D:\YiFramework\Yi\Yi.Framework\Yi.Framework.Model\Models\");
string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径
string dirPath= Path.Combine(solutionsPath,@"Yi.Framework.Model\Models\");
DirectoryInfo dir = new DirectoryInfo(dirPath);
FileInfo[] finfo = dir.GetFiles();
string filenames = string.Empty;
List<string> filenameList = new List<string>();
@@ -37,7 +38,7 @@ namespace Yi.Framework.Service
public partial class <#= fn #>Service:BaseService<<#= k #>>,I<#= fn #>Service
{
//public <#= fn #>Service(DbContext Db):base(Db){ }
public <#= fn #>Service(DbContext Db):base(Db){ }
}
<# } #>
}

View File

@@ -7,4 +7,10 @@ export default {
data: { "ids1": userIds, "ids2": roleIds }
})
},
GetRolesByUser() {
return myaxios({
url: '/User/GetRolesByUser',
method: 'get'
})
}
}

View File

@@ -1,9 +1,9 @@
<template>
<material-card color="primary" icon="mdi-account-outline">
<material-card color="primary" icon="mdi-account-outline">
<template #title>
用户管理 <small class="text-body-1">用户可拥有多个角色</small>
用户管理 <small class="text-body-1">用户可拥有多个角色</small>
</template>
<ccCombobox
<ccCombobox
headers="设置角色"
:items="roleItems"
@select="getSelect"
@@ -24,8 +24,6 @@
</template>
</ccTable>
</material-card>
</template>
<script>
import userApi from "../api/userApi";
@@ -37,13 +35,15 @@ export default {
methods: {
async showItem(item) {
var strInfo = "";
var strInfo="";
Object.keys(item).forEach(function(key){
roleApi.GetRolesByUser().then(resp=>{
strInfo+=key+":"+ item[key]+"<br>"
})
});
Object.keys(item).forEach(function (key) {
strInfo += key + ":" + item[key] + "<br>";
});
await this.$dialog.confirm({
text: strInfo,
title: "信息详情",
@@ -67,7 +67,10 @@ strInfo+=key+":"+ item[key]+"<br>"
roleIds.push(item.id);
});
userApi.SetRoleByUser(userIds, roleIds).then((resp) => {
alert(resp);
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
});
},
getTableSelect(data) {