ABPCMS.Web/Views/Tenants/Index.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
(function () {
$(function () {
var _tenantService = abp.services.app.tenant;
var _$modal = $('#TenantCreateModal');
var _$form = _$modal.find('form');
_$form.validate();
$('#RefreshButton').click(function () {
refreshTenantList();
});
$('.delete-tenant').click(function () {
var tenantId = $(this).attr("data-tenant-id");
var tenancyName = $(this).attr('data-tenancy-name');
deleteTenant(tenantId, tenancyName);
});
$('.edit-tenant').click(function (e) {
var tenantId = $(this).attr("data-tenant-id");
e.preventDefault();
$.ajax({
url: abp.appPath + 'Tenants/EditTenantModal?tenantId=' + tenantId,
type: 'POST',
contentType: 'application/html',
success: function (content) {
$('#TenantEditModal div.modal-content').html(content);
},
error: function (e) { }
});
});
_$form.find('button[type="submit"]').click(function (e) {
e.preventDefault();
if (!_$form.valid()) {
return;
}
var tenant = _$form.serializeFormToObject(); //serializeFormToObject is defined in main.js
abp.ui.setBusy(_$modal);
_tenantService.create(tenant).done(function () {
_$modal.modal('hide');
location.reload(true); //reload page to see new tenant!
}).always(function () {
abp.ui.clearBusy(_$modal);
});
});
_$modal.on('shown.bs.modal', function () {
_$modal.find('input:not([type=hidden]):first').focus();
});
function refreshTenantList() {
location.reload(true); //reload page to see new tenant!
}
后面还有 17 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
