revert: 恢复误删的Admin后台区域——用户澄清/admin管理后台是在用的,上条消息"没有使用"指的是admin页面也没引用jquery-3.6.0而非页面废弃。恢复Areas/Admin整目录28文件+Scripts/admin两文件。jquery三件套/3个业务死JS/11个死视图/NCrontab的删除仍然有效(admin布局零jquery引用,复验不受影响)

This commit is contained in:
hjhan
2026-08-22 10:19:36 +08:00
parent d42742ab10
commit d7e6955132
30 changed files with 2634 additions and 0 deletions
@@ -0,0 +1,73 @@
//保存配置
function SaveValue(id, blEncodeURI) {
var $e = $('#config' + id);
var value = '';
if ($e.is("select") || $e.attr("type") === "text" || $e.is("textarea")) {
value = $e.val();
if (blEncodeURI) value = encodeURIComponent(value);
if ($e.data("value") === value) {
return;
}
} else if ($e.attr("type") === "checkbox") {
value = $e.prop("checked").toString();
}
else {
alert("不支持");
return;
}
main.post(saveConfigValueUrl, { name: $e.attr("name"), value: value }).done(function (resp) {
$e.data("value", value);
$('#respMsg').text(resp.data);
});
}
function OnInputKeyDown(blEncodeURI) {
if (event.keyCode === 13) {
SaveValue(blEncodeURI);
}
}
//重置配置
function ResetConfig() {
main.post(resetConfigValueUrl).done(function (resp) {
$('#respMsg').text(resp.data);
});
}
var ueditor, ueditorConfigId;
function showUeditorConfig(id, title) {
ueditorConfigId = id;
$('.modal-title', '#ueditorModal').text(title || '配置');
$('#ueditorModal').modal('show');
}
function saveUeditorConfig() {
let cont = ueditor.getContent();
$('#config' + ueditorConfigId).val(cont).blur();
$('#ueditorModal').modal('hide');
}
$(function () {
$('#ueditorModal').on('shown.bs.modal', function () {
function insertHtml(editor) {
let content = $('#config' + ueditorConfigId).val() || '';
ueditor.execCommand('insertHtml', content);
}
if (ueditor) {
ueditor.reset();
ueditor.setContent('');
insertHtml();
} else {
ueditor = UE.getEditor('editor', {
autoHeight: false,
wordCount: false,
autoHeightEnabled: false,
initialFrameHeight: 500
});
ueditor.ready(insertHtml);
}
});
});
+113
View File
@@ -0,0 +1,113 @@
var sqlViewer = CodeMirror.fromTextArea(document.getElementById('dbContentText'), {
mode: "text/x-mysql",
indentWithTabs: true,
smartIndent: true,
lineNumbers: true,
matchBrackets: true,
autofocus: true,
readOnly: true
});
var vue = new Vue({
el: "#dbUpdateDiv",
data: {
updateList: [],
checkAll: false,
filter: { version: '', dbschema: '', upstate: '', versionItems: [] }
},
mounted: function () {
this.getUpdateList();
},
methods: {
//获取升级列表列表
getUpdateList() {
var thisObj = this;
main.post("/Admin/DbUpdate/AjaxGetUpdateList").done(function (resp) {
thisObj.checkAll = false;
thisObj.updateList = resp.data;
let verSet = new Set();
Object.assign(thisObj.filter, { versionItems: [], dbschemaItems: [] })
thisObj.updateList.forEach(x => {
x.checked = false;
verSet.add(x.Version);
});
thisObj.filter.versionItems = Array.from(verSet);
}).fail(function () {
main.alert("加载失败");
});
},
changeItemChecked() {
this.checkAll = this.updateList.every(x => x.checked);
},
changeAllChecked() {
let checked = this.checkAll;
this.updateList.forEach(x => {
x.checked = checked;
});
},
//查看脚本内容
viewUpdateContent(upkey) {
if (upkey) {
upkey = [upkey];
} else {
upkey = this.updateList.filter(x => x.checked).map(x => x.UpKey);
if (!upkey.length) {
return main.alert("请至少选择一项!");
}
}
main.post("/Admin/DbUpdate/AjaxGetUpdateContent", { upKeyList: upkey }).done(function (resp) {
sqlViewer.getDoc().setValue(resp.data);
$("#dbContentModal").modal('show');
sqlViewer.refresh();
});
},
//执行脚本内容
executeUpdate(item) {
let confirmMsg, upkeyList, upMap = {}, isUpdateDone = item === "isUpdateDone";
if (item && !isUpdateDone) {
upkeyList = [item.UpKey];
upMap[item.UpKey] = item;
confirmMsg = item.UpState < 1 ? "确定要执行更新吗?" : "确定要重新执行吗?";
} else {
upkeyList = this.updateList.filter(x => x.checked).map(x => {
upMap[x.UpKey] = x; return x.UpKey;
});
if (!upkeyList.length) {
return main.alert("请至少选择一项!");
}
confirmMsg = "确定要执行批量更新吗?";
}
main.confirm(confirmMsg, function () {
$("#waitMeModal").modal("show");
let postData = { upKeyList: upkeyList, isUpdateDone: isUpdateDone };
main.post("/Admin/DbUpdate/AjaxExecuteUpdate", postData).done(function (resp) {
resp.data.forEach(x => {
let item = upMap[x.UpKey];
if (item) {
item.UpState = x.UpState;
item.UpResult = x.UpResult;
}
});
}).always(() => {
$("#waitMeModal").modal("hide");
});
});
},
itemStatusClass(item) {
if (item.UpState < 0) {
return "text-danger";
}
if (item.UpState > 0) {
return "text-muted";
}
},
isShowItem(item) {
return (this.filter.version && item.Version !== this.filter.version)
|| (this.filter.dbschema && item.DbSchema !== this.filter.dbschema)
|| (this.filter.upstate == true && item.UpState > 0) ? "display:none" : "display:table-row";
}
}
});