初始化项目
This commit is contained in:
555
UI/Views/App/Index.cshtml
Normal file
555
UI/Views/App/Index.cshtml
Normal file
@@ -0,0 +1,555 @@
|
||||
|
||||
@{
|
||||
ViewBag.Title = "应用管理";
|
||||
Layout = "~/Views/Shared/_LayoutDefaule.cshtml";
|
||||
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header navbar" style="padding:5px 5px;">
|
||||
<ul class="navbar-nav ">
|
||||
<li class="nav-item">
|
||||
<h5 class="card-title" style="line-height:1;"><span class="text-red text-bold">@ViewBag.App.AppName</span> 应用权限一览<span id="qxsl"></span></h5>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item" style="color:#999c9e;">
|
||||
<button data-toggle="modal" data-target="#modal-danger" id="modaldangerbtn" style="display:none;"></button>
|
||||
<button type="button" id="btnDelzz" onclick="Delzz(this)" data-IsValid='@ViewBag.App.IsValid' class="btn btn-@(ViewBag.App.IsValid==0? "danger":"success") btn-sm">@(ViewBag.App.IsValid==0? "禁用":"恢复")</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body" id="cardbody" style="padding:0">
|
||||
<div class="card card-gray" style="margin-bottom: 0px;">
|
||||
<div class="card-header" style="padding:1px 5px;">
|
||||
<a style="line-height:1;">权限信息</a>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse">
|
||||
<i class="fas fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" style=" padding:0.2rem 0rem">
|
||||
<slot class="sloatdnyc" style="display:none;">
|
||||
<div class="card" style="margin-bottom: 10px;">
|
||||
<div class="card-header" style="padding:1px 10px;" data-card-widget="collapse">
|
||||
<a href="{{AppId}}" style="line-height: 1; display: block; color: black;" class=" text-bold">{{AppName}}</a>
|
||||
<div class="text-gray" style=" margin:0;line-height:1;">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
App类型: <span class="text-info " style=" line-height: 1;">{{AppType}}</span>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
版本: <span class="text-info " style=" line-height: 1;">{{Version}}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-5">
|
||||
权限数量: <span class="text-info" style="line-height: 1;">{{AuthorSum}}</span>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
发布日期: <span class="text-info" style="line-height: 1;">{{ReleaseDate}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row flex-column">
|
||||
<div class="col-12">
|
||||
描述: <span class="text-info " style=" line-height: 1;">{{Desc}}</span>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
网址: <a class="text-info " href="{{WebSite}}" style=" line-height: 1;">{{WebSite}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-success btn-sm" style=" margin:2px; " onclick="AddAuthority()">添加权限</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body " style=" padding:0 2px;">
|
||||
{{card-body}}
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let oa, KP, aau,types;
|
||||
let ajxj = 0;
|
||||
let request = (url, params = {}, method = "Post") => {
|
||||
return new Promise((resolve, reject) => {
|
||||
$.ajax({
|
||||
type: method,
|
||||
url: url,
|
||||
cache: false, //禁用缓存
|
||||
data: params, //传入组装的参数
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
resolve(result);
|
||||
},
|
||||
error: function (res) {
|
||||
reject(res)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
function init () {
|
||||
request("/Api/GetApps", { appid:@ViewBag.SelectApp }).then(result => {
|
||||
aau = result.Data.Appinfos[0]
|
||||
types = result.Data.Types
|
||||
$("#qxsl").html("(" + aau.data.length + ")");
|
||||
ajxj++;
|
||||
Add();
|
||||
})
|
||||
let card_body =`<div id="{{tbsuccess}}" style="line-height:1;word-wrap:break-word;">
|
||||
<table class="table dataTable" style="margin:0;">
|
||||
<thead>
|
||||
<tr style="border:none;">
|
||||
<th style="padding:2px;border:none;">ID</th>
|
||||
<th style="padding:2px;border:none;">名称</th>
|
||||
<th style="padding:2px;border:none;">说明</th>
|
||||
<th style="padding:2px;border:none;">创建时间</th>
|
||||
<th style="padding:2px;border:none;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
{{tr}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`
|
||||
let tdtext =`
|
||||
<tr style="background:{{bg--gray}};">
|
||||
<td style="padding:2px;" data-type ='{{AuthoStatusTypeId}}'>
|
||||
{{AuthorityID}}
|
||||
</td>
|
||||
<td style="padding:2px;" >
|
||||
{{AuthorityName}}</td>
|
||||
<td style="padding:2px;" >
|
||||
{{AuthDesc}}
|
||||
</td>
|
||||
<td style="padding:2px;" >
|
||||
{{CreateTime}}
|
||||
</td>
|
||||
<td style="padding:2px;">
|
||||
<button class="btn btn-info btn-sm" data-toggle="modal" data-target="#exampleModalCenter" onclick="edit(this)">修改</button>
|
||||
<button data-toggle="modal" data-target="#modal-qx" class="btn btn-{{btncss}} btn-sm" data-isactive = {{isactive}} onclick="del({{del}},this)">{{btntext}}</button></td>
|
||||
</tr>
|
||||
`
|
||||
function Add() {
|
||||
let dnyc = $(".sloatdnyc");
|
||||
if (!KP || KP == "")
|
||||
KP = dnyc.html();
|
||||
dnyc.html("");
|
||||
let x = aau
|
||||
//.forEach(x => {
|
||||
//统计权限
|
||||
uautp = [];
|
||||
let successtr = "";
|
||||
let dangertr = "";
|
||||
let text = KP.replace("{{AppName}}", x.AppName)
|
||||
.replace("{{AppId}}", x.AppId)
|
||||
.replace("{{Desc}}", x.Desc)
|
||||
.replace("{{AppType}}", x.AppType==0?"Web网站":"桌面程序")
|
||||
.replace(`{{WebSite}}`, x.WebSite)
|
||||
.replace(`{{WebSite}}`, x.WebSite)
|
||||
.replace("{{Version}}", x.Version)
|
||||
.replace("{{ReleaseDate}}",Gotimestamp(x.ReleaseDate))
|
||||
.replace("{{AuthorSum}}", x.data.length);
|
||||
x.data.forEach(
|
||||
y => {
|
||||
let TD_bodytext = tdtext.replace("{{AuthorityID}}", y.Id)
|
||||
.replace("{{AuthorityName}}", y.AuthorityName)
|
||||
.replace("{{CreateTime}}", Gotimestamp(y.CreateTime))
|
||||
.replace("{{isactive}}", y.IsValid)
|
||||
.replace("{{btncss}}", y.IsValid == '0' ? "danger" : "success")
|
||||
.replace("{{btntext}}", y.IsValid == '0' ? "禁用" : "恢复")
|
||||
.replace("{{bg-gray}}", y.IsValid == '0' ? "" : "#ececec")
|
||||
.replace("{{AuthDesc}}", y.Desc).replace("{{del}}", y.Id).replace("{{AuthoStatusTypeId}}", y.AuthoStatusTypeId);
|
||||
if (y.IsValid == '0')
|
||||
successtr += TD_bodytext;
|
||||
else
|
||||
dangertr += TD_bodytext;
|
||||
})
|
||||
//
|
||||
text = text.replace("{{card-body}}",
|
||||
"<h6 class='text-info' style='margin:7px 0 ;'>正常权限<h6>"+
|
||||
card_body.replace("{{tr}}", successtr).replace("{{tbsuccess}}", "tbsuccess")
|
||||
+ "<h6 class='text-gray' style='margin:7px 0 ;'>已经禁用权限<h6>"
|
||||
+ card_body.replace("{{tr}}", dangertr).replace("{{tbsuccess}}","tbdanger"));
|
||||
TD_body = dangertr;
|
||||
dnyc.append(text);
|
||||
dnyc.show();
|
||||
}
|
||||
};
|
||||
//分组 未使用
|
||||
function Grouparr(arr) {
|
||||
let res = [],AppId = [];
|
||||
arr.forEach(x => {
|
||||
if (AppId.filter(y => { return y == x.AppId }).length <= 0)
|
||||
{
|
||||
AppId.push(x.AppId);
|
||||
}
|
||||
});
|
||||
AppId.forEach(y => {
|
||||
res.push( arr.filter(x => { return x.AppId == y }));
|
||||
});
|
||||
return res;
|
||||
}
|
||||
//添加权限
|
||||
function AddAuthority() {
|
||||
event.stopPropagation();
|
||||
//唤起添加编辑弹出
|
||||
$('#modal-Addautho-title').html('添加权限');
|
||||
$('#ResAddauthobtn').html('确认添加');
|
||||
$('#ResAddauthobtn').removeAttr('data-type');
|
||||
$('#Authoname').removeAttr("data-oldname");
|
||||
$('#Authoname').val('');
|
||||
$('#authoDesc').val('');
|
||||
$('#authoDesc').removeAttr("data-olddesc");
|
||||
$('#ResAddauthobtn').removeAttr('data-id');
|
||||
$("#ResAddauthobtn").attr("disabled", "disabled");
|
||||
$("#Addauthobtn").click();
|
||||
$("#Addauthobtn").click();
|
||||
autypes = [];
|
||||
//每次取消选择
|
||||
$($('.icheck-primary').find('input[type = checkbox]')).prop("checked", false);
|
||||
}
|
||||
// 唤起提示弹出
|
||||
function Delzz(that) {
|
||||
let IsValid = $(that).attr('data-IsValid');
|
||||
if (IsValid == 0) {
|
||||
$('#ptext').html("将清除应用下相关权限!");
|
||||
$('#tsbtn').html("禁用");
|
||||
}
|
||||
else {
|
||||
$('#tsbtn').html("恢复");
|
||||
$('#ptext').html("将恢复应用下相关权限!");
|
||||
}
|
||||
$('#tsbtn').attr('data-IsValid', IsValid == 0 ? '1' : '0');
|
||||
|
||||
$("#modaldangerbtn").click();
|
||||
}
|
||||
function ResDel(that) {
|
||||
let IsValid = $(that).attr('data-IsValid');
|
||||
let btnthat = $('#btnDelzz');
|
||||
$("#closebtn").click();
|
||||
request("/Api/DelApp", { AppId:'@ViewBag.SelectApp',IsValid:IsValid }).then(
|
||||
res => {
|
||||
if (res.Status == 200) {
|
||||
btnthat.removeClass("btn-success").removeClass("btn-danger");
|
||||
$(btnthat).attr('data-IsValid', IsValid);
|
||||
if (IsValid == 0) {
|
||||
$(btnthat).addClass("btn-danger");
|
||||
$(btnthat).html("禁用");
|
||||
} else {
|
||||
$(btnthat).addClass("btn-success");
|
||||
$(btnthat).html("恢复");
|
||||
}
|
||||
success("成功");
|
||||
}
|
||||
else
|
||||
error("失败");
|
||||
}
|
||||
)
|
||||
}
|
||||
//添加权限 -- 验证名字通过时提交
|
||||
//验证通过标识
|
||||
let xgnam = -1;
|
||||
//防抖 多次提交
|
||||
let timers;
|
||||
function Checkautho(that) {
|
||||
$("#ResAddauthobtn").attr("disabled", "disabled");
|
||||
let name = $(that).val();
|
||||
let oldname = $('#Authoname').attr("data-oldname");
|
||||
if (name == "")
|
||||
return;
|
||||
if (name == oldname) {
|
||||
$("#ResAddauthobtn").removeAttr("disabled")
|
||||
return;
|
||||
}
|
||||
if (timers)
|
||||
clearInterval(timers);
|
||||
timers = setTimeout(() => {
|
||||
$.post("/Api/Checkautho", { AppId:@ViewBag.SelectApp, AuthoNmae: name }, res => {
|
||||
if (res.Status == 200) {
|
||||
xgnam = 1;
|
||||
$("#ResAddauthobtn").removeAttr("disabled")
|
||||
//$('#Authoname').attr("data-oldname", name)
|
||||
}
|
||||
else
|
||||
error("名字重复")
|
||||
})
|
||||
},1000
|
||||
)
|
||||
}
|
||||
//编辑项的 类型
|
||||
let autypes;
|
||||
//确定添加 修改
|
||||
function ResAddautho(that) {
|
||||
if (xgnam == -1 && $("#Authoname").val() != $("#Authoname").attr("data-oldname")) {
|
||||
info("验证权限名中,请稍等")
|
||||
return;
|
||||
}
|
||||
$(that).attr("disabled", "disabled");
|
||||
let datatype = $('#ResAddauthobtn').attr('data-type');
|
||||
let dataid = $('#ResAddauthobtn').attr('data-id');
|
||||
let selitem = $('.icheck-primary').find('input[type = checkbox]:checked');
|
||||
if (selitem.length < 2) {
|
||||
$("#ResAddauthobtn").removeAttr("disabled")
|
||||
error('选项至少勾选两项');
|
||||
return;
|
||||
}
|
||||
let newtypes = [];
|
||||
for (var i = 0; i < selitem.length; i++) {
|
||||
newtypes.push($(selitem[i]).val());
|
||||
}
|
||||
if (autypes.join() == newtypes.join() && $('#authoDesc').attr("data-olddesc") == $("#authoDesc").val() && $("#Authoname").val() == $("#Authoname").attr("data-oldname")) {
|
||||
$("#Addorgclosebtn").click();
|
||||
info('无修改!')
|
||||
return;
|
||||
}
|
||||
let AuthoStatusTypeId = newtypes.join()
|
||||
if (datatype == '1') {
|
||||
editok($("#Authoname").val(), $("#authoDesc").val(), dataid, AuthoStatusTypeId);
|
||||
} else {
|
||||
$.post("/Api/Addautho", {
|
||||
AppId:@ViewBag.SelectApp, AuthoNmae: $("#Authoname").val(), Desc: $("#authoDesc").val(), AuthoStatusTypeId
|
||||
}, res => {
|
||||
if (res.Status == 200 && res.Data) {
|
||||
$("#Addorgclosebtn").click();
|
||||
$("#authoDesc").val("")
|
||||
$("#Authoname").val("")
|
||||
success("添加成功");
|
||||
init();
|
||||
}
|
||||
else {
|
||||
error("添加失败");
|
||||
$("#ResAddauthobtn").removeAttr("disabled")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
//禁用权限
|
||||
//存放选择禁用恢复的tr
|
||||
let qxtr;
|
||||
function del(id, that) {
|
||||
qxtr = that;
|
||||
//根据当前状态 判断
|
||||
let isactive = $(that).attr("data-isactive") == '0' ? 1 : 0;
|
||||
$("#qxname").html(($($(that).closest("tr").find("td").get(1)).html().replace(/\s*/g, "")));
|
||||
$('#qxbtn').prop('data-isactive', isactive);
|
||||
if (isactive == 1) {
|
||||
$('#qxbtn').html("确认禁用");
|
||||
$("#qxtext").html("相关用户的权限将被禁用!");
|
||||
}
|
||||
else {
|
||||
$("#qxtext").html("相关用户的权限将被恢复!");
|
||||
$('#qxbtn').html("确认恢复");
|
||||
}
|
||||
}
|
||||
//确认删除
|
||||
function ResDelqx(that) {
|
||||
$("#qxclosebtn").click();
|
||||
let id = $($(qxtr).closest("tr").find("td").get(0)).html().replace(/\s*/g, "");
|
||||
let isactive = $(that).prop('data-isactive');
|
||||
request("/Api/DelAppAutho", { AuthoId: id, status: isactive }).then(res => {
|
||||
if (res.Status == 200 && res.Message == true) {
|
||||
$(qxtr).attr("data-isactive", isactive)
|
||||
$(qxtr).removeClass("btn-danger").removeClass("btn-success");
|
||||
if (isactive == 0) {
|
||||
$(qxtr).addClass("btn-danger");
|
||||
$(qxtr).html("禁用");
|
||||
$("#tbsuccess table").append($($(qxtr).closest("tr")));
|
||||
} else {
|
||||
$(qxtr).addClass("btn-success");
|
||||
$(qxtr).html("恢复");
|
||||
$("#tbdanger table").append($($(qxtr).closest("tr")));
|
||||
}
|
||||
}
|
||||
else
|
||||
error("删除失败~");
|
||||
}).catch(() => {
|
||||
error("删除失败~");
|
||||
})
|
||||
}
|
||||
//修改
|
||||
function edit(that) {
|
||||
let name = $(that).closest("tr").find("td").get(1);
|
||||
let id = $(that).closest("tr").find("td").get(0);
|
||||
autypes = $($(that).closest("tr").find("td").get(0)).attr('data-type') != 'null' ? $($(that).closest("tr").find("td").get(0)).attr('data-type').split(','):[];
|
||||
let desc = $(that).closest("tr").find("td").get(2);
|
||||
let txdesc = $(desc).html().replace(/\s*/g, "");
|
||||
let txid = $(id).html().replace(/\s*/g, "");
|
||||
let txname = $(name).html().replace(/\s*/g, "");
|
||||
$('#Authoname').attr("data-oldname", txname);
|
||||
$('#Authoname').val(txname);
|
||||
$('#authoDesc').val(txdesc);
|
||||
$('#authoDesc').attr("data-olddesc", txdesc);
|
||||
$('#modal-Addautho-title').html('编辑权限');
|
||||
$('#ResAddauthobtn').html('确认修改');
|
||||
$('#ResAddauthobtn').attr('data-type', '1');
|
||||
$('#ResAddauthobtn').attr('data-id', txid);
|
||||
$("#ResAddauthobtn").removeAttr("disabled")
|
||||
$("#Addauthobtn").click();
|
||||
$($('.icheck-primary').find('input[type = checkbox]')).prop("checked", false);
|
||||
for (var i = 0; i < autypes.length; i++) {
|
||||
$($('.icheck-primary').find('input[type = checkbox][value="' + autypes[i]+'"]')).prop("checked", true);
|
||||
}
|
||||
}
|
||||
//完成修改
|
||||
function editok(newname, newdesc, Id, AuthoStatusTypeId) {
|
||||
request("/Api/EditAppAutho", { AuthorityName: newname, Desc: newdesc, Id: Id, AuthoStatusTypeId:AuthoStatusTypeId }).then(res => {
|
||||
if (res.Status == 200 && res.Message == true) {
|
||||
$("#Addorgclosebtn").click();
|
||||
success("修改成功~");
|
||||
init();
|
||||
}
|
||||
else {
|
||||
error("修改失败~");
|
||||
}
|
||||
}).catch(() => {
|
||||
error("修改失败~");
|
||||
}
|
||||
)
|
||||
};
|
||||
//添加类型
|
||||
function AddType(that) {
|
||||
if ($('#content').find('#addtype').length > 0)
|
||||
$('#addtype').toggle();
|
||||
if ($(that).val().replace(/' '/, '') == "新增") {
|
||||
if ($('#content').find('#addtype').length <= 0) {
|
||||
//追加元素
|
||||
let text = `
|
||||
<div id="addtype" style='width:60%;margin:10px 10.5px;' class="input-group input-group-sm" >
|
||||
<div class="input-group input-group-sm" style='margin:5px 0px;'>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-info btn-flat">名称</button>
|
||||
</span>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style='margin:2.5px 0px;' >
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-info btn-flat">描述</button>
|
||||
</span>
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
<div class='col-12'>
|
||||
<button type="button" class="btn btn-success btn-sm" style='margin-top:2.5px;float:right;margin-right:0;' onclick="AddTypeOk()">添加</button>
|
||||
<div>
|
||||
</div>`
|
||||
$('#content').append(text);
|
||||
}
|
||||
$(that).removeClass('btn-success').addClass('btn-danger');
|
||||
$(that).val("取消")
|
||||
} else {
|
||||
$(that).removeClass('btn-danger').addClass('btn-success');
|
||||
$(that).val("新增")
|
||||
}
|
||||
}
|
||||
//确定添加类型
|
||||
function AddTypeOk() {
|
||||
let name = $($('#addtype').find('input').get(0)).val().replace(/''/, '');
|
||||
let desc = $($('#addtype').find('input').get(1)).val().replace(/''/, '');
|
||||
if (name == "")
|
||||
error("名字无效!");
|
||||
request('/Api/AddType', { name, desc }).then(x => {
|
||||
if (x.Status == 200) {
|
||||
success("添加成功!");
|
||||
$($('#addtype').find('input').get(0)).val('');
|
||||
$($('#addtype').find('input').get(1)).val('');
|
||||
let dom = $($('.icheck-primary').find('input[type = checkbox]').get(0)).closest('.col-4');
|
||||
let newdom = dom.clone(true);
|
||||
$($(newdom).find('label')).html(x.Data.Name);
|
||||
$($(newdom).find('input[type = checkbox]')).val(x.Data.Id);
|
||||
$('.icheck-primary').append(newdom)
|
||||
//$($('.icheck-primary').find('input[type = checkbox]')).prop("checked", false);
|
||||
AddType($('#addtypebtn'));
|
||||
} else {
|
||||
if (x.Status == 100)
|
||||
error("名字无效!");
|
||||
else
|
||||
error("网络繁忙~");
|
||||
}
|
||||
})
|
||||
}
|
||||
init();
|
||||
</script>
|
||||
@* 禁用app警告 *@
|
||||
<div class="modal fade " id="modal-danger">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">@ViewBag.AppName</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" id="closebtn">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="ptext"></p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-sm btn-info" data-dismiss="modal">关闭</button>
|
||||
<button type="button" id="tsbtn" class="btn btn-sm btn-danger" onclick="ResDel(this)">禁用</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button data-toggle="modal" data-target="#modal-Addautho" id="Addauthobtn" style="display:none;"></button>
|
||||
@*//添加编辑弹出*@
|
||||
<div class="modal fade" id="modal-Addautho">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content ">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="modal-Addautho-title">添加权限</h5>
|
||||
<button type="button" class="close " data-dismiss="modal" aria-label="Close" id="Addorgclosebtn">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="content">
|
||||
<input type="text" oninput="Checkautho(this)" placeholder="请输入名字" class="form-control" style="border:none;" id="Authoname" />
|
||||
<input type="text" placeholder="描述" class="form-control" style="border:none;" id="authoDesc" />
|
||||
<div class="icheck-primary row" style="margin:5.25px 3px">
|
||||
@foreach (var item in ViewBag.AuthoType)
|
||||
{
|
||||
<div class="col-4">
|
||||
<input value="@item.Id" type="checkbox">
|
||||
<label>
|
||||
@item.Name
|
||||
</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<input value="新增" id="addtypebtn" onclick="AddType(this)" type="button" class=" btn btn-success btn-sm ">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-success btn-sm" id="ResAddauthobtn" disabled onclick="ResAddautho(this)">确定添加</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* 禁用权限弹出 *@
|
||||
<div class="modal fade " id="modal-qx">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="qxname"></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" id="qxclosebtn">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="qxtext"></p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-sm btn-info" data-dismiss="modal">关闭</button>
|
||||
<button type="button" id="qxbtn" class="btn btn-sm btn-danger" onclick="ResDelqx(this)">禁用</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
44
UI/Views/App/List.cshtml
Normal file
44
UI/Views/App/List.cshtml
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
@{
|
||||
ViewBag.Title = "应用列表";
|
||||
Layout = "~/Views/Shared/_LayoutDefaule.cshtml";
|
||||
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">应用列表</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body" id="cardbody">
|
||||
@foreach (var item in ViewBag.Apps)
|
||||
{
|
||||
<a href="/App/Index/@item.Id" class="info-box " style="color:#6c757d; padding: 0px; margin-bottom: 0.5rem; overflow-wrap: break-word; ">
|
||||
<div class="info-box-content">
|
||||
<span class="text-bold" style="line-height: 1;">
|
||||
@item.AppName
|
||||
</span>
|
||||
<span style="line-height: 1;">
|
||||
创建: <span style="color: rgb(169, 169, 169); line-height: 1;">@item.CreatedBy</span>
|
||||
</span>
|
||||
<span style="line-height: 1;">
|
||||
状态:<span class=" @(item.IsValid==0?"text-info":"text-danger")" style="line-height: 1;">@(item.IsValid==0?"正常":"禁用")</span>
|
||||
</span>
|
||||
<span style="line-height: 1;">
|
||||
日期: <span style="color: rgb(169, 169, 169); line-height: 1;">@item.CreateTime</span>
|
||||
</span>
|
||||
<span style="line-height: 1;">
|
||||
备注:
|
||||
<span style="color: rgb(169, 169, 169); line-height: 1;">@item.Desc</span>
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
}
|
||||
<div>
|
||||
<a onclick="AddApp()" class="nav-link">
|
||||
<p>添加应用</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user