初始化项目
This commit is contained in:
374
UI/Views/Org/Index.cshtml
Normal file
374
UI/Views/Org/Index.cshtml
Normal file
@@ -0,0 +1,374 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/_LayoutDefaule.cshtml";
|
||||
|
||||
ViewBag.Title = "<22>û<EFBFBD><C3BB><EFBFBD>Ȩ<EFBFBD><EFBFBD><DEB9><EFBFBD>";
|
||||
|
||||
}
|
||||
<style>
|
||||
td:first-child, th:first-child {
|
||||
position: sticky;
|
||||
left: 0; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
z-index: 99 !important;
|
||||
min-width: 150px;
|
||||
background: #ffffff;
|
||||
}
|
||||
.PR {
|
||||
width: 100px;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
<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.OrgName</span> Ȩ<><C8A8>һ<EFBFBD><D2BB><span id="qxsl"></span></h5>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button id="seljd" style="margin-top:5px;" data-widget="control-sidebar" data-slide="true" class="btn btn-info btn-xs"><3E>Ƶ<EFBFBD><C6B5><EFBFBD>Ȩ</button>
|
||||
</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" onclick="Delzz()" class="btn btn-danger btn-xs @(ViewBag.SelectOrg==1?"disabled":"")">ɾ<><C9BE></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 10px;">
|
||||
<a style="line-height:1;">Ȩ<><C8A8><EFBFBD><EFBFBD>Ϣ</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">
|
||||
<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>
|
||||
<span class="text-gray" style=" margin:0;line-height:1;">
|
||||
<20><><EFBFBD><EFBFBD>:<span class="text-info " style=" line-height: 1;">{{Desc}}</span>
|
||||
|
||||
Ȩ<><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<span class="text-red" style="line-height: 1;">{{AuthorSum}}</span>
|
||||
</span>
|
||||
<span class="text-gray qxtj" style="display:block; margin:0;line-height:1;padding:0;">
|
||||
{{qxtj}}
|
||||
</span>
|
||||
</div>
|
||||
{{card-body}}
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
let HotelList = @(ViewBag.HotelList??0);
|
||||
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, //<2F><><EFBFBD>û<EFBFBD><C3BB><EFBFBD>
|
||||
data: params, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
resolve(result);
|
||||
},
|
||||
error: function (res) {
|
||||
reject(res)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
$(function () {
|
||||
request("/Api/GetOrgAutho", { OrgId: "@ViewBag.SelectOrg" }).then(result => {
|
||||
oa = result.Data
|
||||
//$("#orgingo").html("-" + uoa[0].OrganizationName);
|
||||
$("#qxsl").html("(" +oa.length+")");
|
||||
ajxj++;
|
||||
checkData = HotelList
|
||||
selfincinput(HotelList)
|
||||
Add(aau, checkData);
|
||||
})
|
||||
request("/Api/GetApps", { }).then(result => {
|
||||
aau = result.Data.Appinfos
|
||||
types = result.Data.Types
|
||||
ajxj++;
|
||||
checkData = HotelList
|
||||
selfincinput(HotelList)
|
||||
Add(aau, checkData);
|
||||
})
|
||||
});
|
||||
let card_body = `
|
||||
<div style="line-height:1;word-wrap:break-word;max-height:{{max-height}}px; padding:0 ; margin:0;" class="card-body table-responsive">
|
||||
<table class="table table-head-fixed text-nowrap text-center" style="margin:0;border:none;">
|
||||
<thead>
|
||||
{{trthead}}
|
||||
<thead>
|
||||
<tbody>
|
||||
{{tr}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`
|
||||
let defauletd = "<td class='text-{{hotelname}}' style=' padding:2px;' title='{{Desc}}'>{{Name}}</td>";
|
||||
let seltd = "";
|
||||
let tdtext = `
|
||||
<td style="padding:2px;border:none;">
|
||||
<span >
|
||||
<select {{disabled}} checkdatax = "{{data-checkDatax}}" authoid="{{data-authoid}}" onchange="ChangeA(this);" hook = "{{hook}}" class="custom-select {{class}}" style="width:auto;padding:0px;border:none;margin:0;line-height:1;background:none;height:auto;">
|
||||
{{option}}
|
||||
</select>
|
||||
</span>
|
||||
</td>`
|
||||
function Add(aaus, checkData) {
|
||||
if (!aaus) {
|
||||
aaus = oa;
|
||||
}
|
||||
if (ajxj < 2)
|
||||
return;
|
||||
let opttext = ``;
|
||||
//types.forEach(x => {
|
||||
// opttext = opttext + (`<option style="color:gray;padding:0px;height:auto;" {{` + x.Id + `}} value="` + x.Id + `">` + x.Name + `</option>`);
|
||||
// })
|
||||
// seltd = tdtext.replace("{{option}}", opttext);
|
||||
let dnyc = $(".sloatdnyc");
|
||||
if (!KP || KP == "")
|
||||
KP = dnyc.html();
|
||||
dnyc.html("");
|
||||
aau.forEach(x => {
|
||||
if (x.AppId == '3') {
|
||||
return;
|
||||
}
|
||||
//<2F>ܵ<EFBFBD>tr
|
||||
//ͳ<><CDB3>Ȩ<EFBFBD><C8A8>
|
||||
let uautp = [];
|
||||
let aauautho = [];//<2F><>¼<EFBFBD><C2BC>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ȩ<EFBFBD><C8A8>id
|
||||
let TD_bodytext = "";
|
||||
let text = KP.replace("{{AppName}}", x.AppName)
|
||||
.replace("{{AppId}}", x.AppId)
|
||||
.replace("{{Desc}}", x.Desc)
|
||||
.replace("{{AuthorSum}}", x.data.length ? 0 : x.data.length);
|
||||
let trthead = "";
|
||||
let trsum = "";
|
||||
x.data.forEach(
|
||||
y => {
|
||||
aauautho.push(y);
|
||||
trthead += "<th title='{{Desc}}' style=' box-sizing:border-box;padding:5PX;' > {{Name}} </th>".replace("{{Desc}}", y.Desc).replace("{{Name}}", y.AuthorityName)
|
||||
})
|
||||
trthead = "<th style='padding:0;'></th>" + trthead
|
||||
//ѭ<><D1AD>ѡ<EFBFBD>еľƵ<C4BE><C6B5><EFBFBD>Ϣ
|
||||
//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
||||
let wd = 0;
|
||||
checkData.forEach(
|
||||
checkDatax => {
|
||||
BaseData.forEach(
|
||||
y => {
|
||||
y.forEach(z => {
|
||||
debugger
|
||||
if (z.Id == checkDatax) {
|
||||
wd = (100 / (x.data.length + 1));
|
||||
//trthead = trthead.replaceAll("{{width}}", wd);
|
||||
//<2F>ҵ<EFBFBD><D2B5>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
trsum += "<tr>" + defauletd.replace("{{Name}}", '<span class="PR">'+z.Name+'</span>').replace("{{Desc}}", z.Desc);
|
||||
let issuccess = "gray";
|
||||
aauautho.forEach(aauauthox => {
|
||||
//<2F>ж<EFBFBD>Ȩ<EFBFBD><C8A8>״̬
|
||||
let uy = aaus.filter(oax => {
|
||||
return oax.AuthorityId == aauauthox.Id && checkDatax == oax.HotelId
|
||||
}).length > 0 ? aaus.filter(oax => {
|
||||
return oax.AuthorityId == aauauthox.Id && checkDatax == oax.HotelId
|
||||
})[0] : null;
|
||||
// <20><><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>
|
||||
if (uy) {
|
||||
let count = 1;
|
||||
let newarr = uautp.filter(uautpx => { return uautpx.id == uy.AuthotypeId });
|
||||
if (newarr.length > 0) {
|
||||
count = newarr[0].count + 1;
|
||||
uautp = uautp.filter(uautpxz => { return uautpxz.id != uy.AuthotypeId });
|
||||
}
|
||||
uautp.push({ id: uy.AuthotypeId, name: uy.AstName, count: count });
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȩ<><EFBFBD><DEB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
let seltypes = aauauthox.AuthoStatusTypeId.split(',');
|
||||
opttext = '';
|
||||
types.forEach(typesx => {
|
||||
if (seltypes.indexOf(''+typesx.Id) >= 0)
|
||||
opttext = opttext + (`<option style="color:gray;padding:0px;height:auto;" {{` + typesx.Id + `}} value="` + typesx.Id + `">` + typesx.Name + `</option>`);
|
||||
})
|
||||
seltd = tdtext.replace("{{option}}", opttext);
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
let hook = "1";
|
||||
let selAuthotypeId = "{{}}";
|
||||
if (uy) {
|
||||
selAuthotypeId = hook = uy.AuthotypeId
|
||||
//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ѡ<EFBFBD>оͱ<D0BE>ɫ
|
||||
if (uy.AuthotypeId!= '1') {
|
||||
issuccess = "success";
|
||||
}
|
||||
}
|
||||
trsum += seltd /*.replace("{{width}}",wd)*/.replace("{{class}}", (hook == 1 ? 'text-gray' : hook == 4 ? 'text-success' : 'text-info')).replace("{{data-checkDatax}}", checkDatax).replace("{{data-authoid}}", aauauthox.Id).replace("{{hook}}", hook).replace(`{{` + selAuthotypeId + `}}`, "selected").replace("{{hook}}", "0");
|
||||
}
|
||||
)
|
||||
trsum = trsum.replace("{{hotelname}}", issuccess);
|
||||
trsum += "</tr>";
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
})
|
||||
//Ȩ<><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3><EFBFBD><EFBFBD>ʾ
|
||||
let qxtj = "";
|
||||
let yycount = 0;
|
||||
let wu = 0;
|
||||
types.forEach(typesx => {
|
||||
let sumcount = 0;
|
||||
uautp.filter(uautpx => {
|
||||
if (typesx.Id == uautpx.id) {
|
||||
if (typesx.Id == 1) {
|
||||
wu = uautpx.count
|
||||
return;
|
||||
}
|
||||
sumcount = uautpx.count;
|
||||
}
|
||||
});
|
||||
if (typesx.Id == 1) { return; }
|
||||
yycount += sumcount
|
||||
qxtj += typesx.Name + ":<span class=' text-info types" + typesx.Id + "'>" + sumcount + "</span> "
|
||||
})
|
||||
qxtj += "<22><>ֹ:<span class='types1 text-gray'>" + (x.data.length * checkData.length - yycount + wu) + "</span> "
|
||||
text = text.replace("{{card-body}}", card_body.replace("{{tr}}", trsum).replace("{{trthead}}", trthead)).replace("{{qxtj}}", qxtj);
|
||||
if (checkData.length <= 0) {
|
||||
text = text.replace("{{max-height}}", '50')
|
||||
} else {
|
||||
text = text.replace("{{max-height}}", '300')
|
||||
}
|
||||
dnyc.append(text);
|
||||
})
|
||||
dnyc.show();
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD> δʹ<CEB4><CAB9>
|
||||
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;
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8> Ȩ<><C8A8>id
|
||||
function ChangeA(that) {
|
||||
//Ȩ<><C8A8>id
|
||||
let tditem = $(that).attr("authoid");
|
||||
//<2F>Ƶ<EFBFBD>id
|
||||
let datacheckDatax = $(that).attr("checkdatax");
|
||||
let data = {
|
||||
status: $(that).val(),
|
||||
id: tditem,
|
||||
type: 1,
|
||||
hotels: datacheckDatax,
|
||||
uid: "@ViewBag.SelectOrg"
|
||||
}
|
||||
request("/Api/EditAuthoType", { ...data }).then(result => {
|
||||
if (result.Status == 200) {
|
||||
let selectlist = $(that).closest("tr").find("select")
|
||||
//<2F><>һ<EFBFBD><D2BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ <20>Ƶ<EFBFBD>
|
||||
let issuccess = 0;
|
||||
for (var x = 0; x < selectlist.length;x++) {
|
||||
if ($(selectlist[x]).val() != 1) {
|
||||
issuccess = 1;
|
||||
$($(that).closest("tr").find("td").get(0)).removeClass("text-gray").addClass("text-success");
|
||||
}
|
||||
if (issuccess == 0) {
|
||||
$($(that).closest("tr").find("td").get(0)).removeClass("text-success").addClass("text-gray");
|
||||
}
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
let card = $(that).closest(".card").find(".qxtj");
|
||||
let old = Number($(that).attr("hook"))
|
||||
let jk = Number($(card).find(".types" + old).html())
|
||||
jk--
|
||||
$(card).find(".types" + old).html(
|
||||
jk
|
||||
);
|
||||
jk = Number($(card).find(".types" + $(that).val()).html());
|
||||
jk++;
|
||||
$(card).find(".types" + $(that).val()).html(
|
||||
jk
|
||||
);
|
||||
//<2F><>¼<EFBFBD><C2BC>ǰѡ<C7B0><D1A1>
|
||||
$(that).attr("hook", $(that).val())
|
||||
num = $("#qxsl").html().replace("(", "").replace(")", "")
|
||||
if (old == 1) {
|
||||
num++;
|
||||
} else {
|
||||
if ($(that).val() == "1") {
|
||||
num--;
|
||||
}
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD>ɫ
|
||||
let colortext = ($(that).val() == 1 || $(that).val() == 0 ? 'text-gray' : $(that).val() == 4 ? 'text-success' : 'text-info')
|
||||
$(that).removeClass("text-gray").removeClass("text-info").removeClass("text-success").addClass(colortext);
|
||||
$("#qxsl").html("(" + num.toString() + ")")
|
||||
$("#delnum").html(num.toString())
|
||||
}
|
||||
else {
|
||||
error("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!");
|
||||
$(that).val($(that).attr("hook"))
|
||||
}
|
||||
},
|
||||
err => {
|
||||
error("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!");
|
||||
$(that).val($(that).attr("hook"))
|
||||
})
|
||||
}
|
||||
function Delzz() {
|
||||
if (@ViewBag.SelectOrg == 1)
|
||||
error("Ĭ<><C4AC><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>~");
|
||||
else
|
||||
$("#modaldangerbtn").click();
|
||||
}
|
||||
function ResDel() {
|
||||
$("#closebtn").click();
|
||||
request("/Api/DelOrg", { OrgId:@ViewBag.SelectOrg}).then(
|
||||
res => {
|
||||
if (res.Status == 200) {
|
||||
success("ɾ<><C9BE><EFBFBD>ɹ<EFBFBD>");
|
||||
location.href = "/";
|
||||
}
|
||||
else
|
||||
error("ɾ<><C9BE>ʧ<EFBFBD><CAA7>");
|
||||
}
|
||||
)
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade " id="modal-danger">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-danger">
|
||||
<div class="modal-header" style="padding-top: 0; padding-bottom: 0;">
|
||||
<h5 class="modal-title">@ViewBag.OrgName</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" style="padding-top: 0; padding-bottom: 0;">
|
||||
<p><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><span id="delnum"></span><3E><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD><DEA3><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>Ƶ<EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棡</p>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between" style="padding-top: 0; padding-bottom: 0;">
|
||||
<button type="button" class="btn btn-outline-light btn-xs" data-dismiss="modal"><3E>ر<EFBFBD></button>
|
||||
<button type="button" class="btn btn-outline-light btn-xs" onclick="ResDel()">ȷ<><C8B7>ɾ<EFBFBD><C9BE></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user