cleanup: 删除 roleEdit.js / errorInfo.js / demo/autocomplete.js 三个孤儿脚本
三者均为 2024-05-09 从山证v2.3.0拷贝带入后从未修改、全仓库零引用: - roleEdit.js: RoleEdit.cshtml 无任何 script 引用 - errorInfo.js: 操作 #infoTable/pageObj.SacInfoList,无视图加载 - autocomplete.js: demo 示例残留 单独 revert 本 commit 即可整体找回。
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
$(function () {
|
||||
var autoClientCtrl = FastVue.autocomplete(document.getElementById('ClientId'), {
|
||||
lookup: ylotc.clients, nameField: 'Name', valueField: 'id', searchField: ['Name', 'Code', 'PinYin'],
|
||||
onSelect: function (data) {
|
||||
console.log(data);
|
||||
console.log('#ClientId Value:' + $('#ClientId').val());
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
$(function () {
|
||||
var table = $("#infoTable")[0];
|
||||
pageObj.SacInfoList.forEach(Obj => {
|
||||
formatHtml(Obj, table, 1);
|
||||
})
|
||||
})
|
||||
function formatHtml(obj, table, rowIndex) {
|
||||
if (obj.FieldName !== "Root" && obj.FieldName !== "Header" && obj.FieldName !== "Body") {
|
||||
var html = '<td title="{0}">{1}</td><td>{2}</td><td>{3}</td>'.template(obj.FieldName, obj.FieldDescribe, obj.FieldValue, obj.ShowMessage);
|
||||
rowIndex = addRow(table, rowIndex, html);
|
||||
}
|
||||
if (obj.SubInfos && obj.SubInfos.length > 0) {
|
||||
obj.SubInfos.forEach(function (item) {
|
||||
rowIndex = formatHtml(item, table, rowIndex);
|
||||
});
|
||||
}
|
||||
return rowIndex;
|
||||
}
|
||||
function addRow(table, rowIndex, htmlStr) {
|
||||
var row = table.insertRow(rowIndex);
|
||||
row.innerHTML = htmlStr;
|
||||
rowIndex += 1;
|
||||
return rowIndex;
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
//roleFunctionEdit.cshtml
|
||||
|
||||
function autocheck(a) {
|
||||
$("input[id={0}]".template(a.id)).prop("checked", a.checked);
|
||||
linkage(a);
|
||||
}
|
||||
|
||||
function linkage(a) {
|
||||
var obj = $(a);
|
||||
var parentName = obj.attr('data-parent');
|
||||
var status = $(a).is(":checked");
|
||||
var typeName = obj.attr('data-type');
|
||||
var fname = obj.attr('lang');
|
||||
if (parentName === "-") {
|
||||
$(obj).next().css('display', 'none');
|
||||
$('input[type="checkbox"][data-parent="{0}"][data-type="{1}"]'.template(fname, typeName)).prop("checked", status);
|
||||
return;
|
||||
}
|
||||
var arr = $("input[type='checkbox'][data-parent='{0}'][data-type='{1}']".template(parentName, typeName));
|
||||
var parSelector = 'input[type="checkbox"][lang="{0}"][data-type="{1}"]'.template(parentName, typeName);
|
||||
$(parSelector).next().css('display', 'none');
|
||||
var continueState = false;
|
||||
$(arr).each(function (i, obj) {
|
||||
if ($(obj).is(":checked") != status) {
|
||||
$(parSelector).prop("checked", true);
|
||||
$(parSelector).next().css('display', 'inline-block');
|
||||
continueState = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (!continueState) {
|
||||
$(parSelector).prop("checked", status);
|
||||
}
|
||||
}
|
||||
|
||||
function GoBack() {
|
||||
if (document.all) { //ie
|
||||
if (window.history.length > 0) {
|
||||
window.history.back();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (window.history.length > 1) {
|
||||
window.history.back();
|
||||
} else {
|
||||
window.opener = null;
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
|
||||
function showOrHide(res) {
|
||||
if ($(res).text() === "-") {
|
||||
$(res).parent().next().next().hide();
|
||||
$(res).html("+");
|
||||
} else {
|
||||
$(res).parent().next().next().show();
|
||||
$(res).html("-");
|
||||
}
|
||||
}
|
||||
function modulePermissions() {
|
||||
$(".tab-1").parent().addClass("active");
|
||||
$(".tab-link").parent().removeClass("active");
|
||||
|
||||
$(".tab-content").removeClass("tab-none");
|
||||
$(".tab-content2").addClass("tab-none");
|
||||
$(".tab-content2").removeClass("tab-block");
|
||||
}
|
||||
function operationPeemissions() {
|
||||
$(".tab-link").parent().addClass("active");
|
||||
$(".tab-1").parent().removeClass("active");
|
||||
$(".tab-content").addClass("tab-none");
|
||||
$(".tab-content2").addClass("tab-block");
|
||||
|
||||
}
|
||||
$(".spanleft").parent().addClass("spanleft-w");
|
||||
|
||||
$(document).ready(function () {
|
||||
var parentArr = $("input[type='checkbox'][data-parent='-']");
|
||||
$(parentArr).each(function (i, obj) {
|
||||
var dataType = $(obj).attr("data-type")
|
||||
var allCount = $('input[type="checkbox"][data-parent="{0}"][data-type="{1}"]'.template(obj.lang, dataType)).length;
|
||||
var selectCount = $('input[type="checkbox"][data-parent="{0}"][data-type="{1}"]:checked'.template(obj.lang, dataType)).length;
|
||||
if (allCount != selectCount && selectCount > 0) {
|
||||
$(obj).next().css('display', 'inline-block');
|
||||
}
|
||||
});
|
||||
modulePermissions();
|
||||
main.form({
|
||||
el: '#roleFunctionEditForm',
|
||||
submit: {
|
||||
url: '/system/roleFunctionEditFormJson',
|
||||
after(res) {
|
||||
window.location.href = "/system/RoleView?id=" + res.obj.Id;
|
||||
try {
|
||||
window.parent && window.parent.SearchClick();
|
||||
}
|
||||
catch (e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user