添加项目文件。

This commit is contained in:
zel
2025-03-05 19:42:01 +08:00
parent 659f1a2ad9
commit 47dcdeb55d
582 changed files with 242004 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WaterCloud.Code;
using WaterCloud.Domain.SystemOrganize;
using WaterCloud.Service.SystemOrganize;
namespace WaterCloud.Web.Areas.SystemOrganize.Controllers
{
/// <summary>
/// 创 建:超级管理员
/// 日 期2020-06-01 09:44
/// 描 述:数据权限控制器类
/// </summary>
[Area("SystemOrganize")]
public class DataPrivilegeRuleController : BaseController
{
public DataPrivilegeRuleService _service { get; set; }
#region
[HandlerAjaxOnly]
[IgnoreAntiforgeryToken]
public async Task<ActionResult> GetGridJson(SoulPage<DataPrivilegeRuleEntity> pagination, string keyword)
{
if (string.IsNullOrEmpty(pagination.field))
{
pagination.field = "F_Id";
pagination.order = "desc";
}
var data = await _service.GetLookList(pagination, keyword);
return Content(pagination.setData(data).ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public async Task<ActionResult> GetListJson(string keyword)
{
var data = await _service.GetList(keyword);
return Content(data.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public async Task<ActionResult> GetFormJson(string keyValue)
{
var data = await _service.GetLookForm(keyValue);
return Content(data.ToJson());
}
[HttpGet]
public virtual ActionResult RuleForm()
{
return View();
}
#endregion
#region
[HttpPost]
[HandlerAjaxOnly]
public async Task<ActionResult> SubmitForm(DataPrivilegeRuleEntity entity, string listData, string keyValue)
{
var filterList = JsonConvert.DeserializeObject<List<FilterList>>(listData);
foreach (var item in filterList)
{
if (!string.IsNullOrEmpty(item.Description))
{
entity.F_Description += item.Description + ",";
}
}
if (!string.IsNullOrEmpty(entity.F_Description))
{
entity.F_Description = entity.F_Description.Substring(0, entity.F_Description.Length - 1);
}
entity.F_PrivilegeRules = filterList.ToJson();
try
{
await _service.SubmitForm(entity, keyValue);
return await Success("操作成功。", "", keyValue);
}
catch (Exception ex)
{
return await Error(ex.Message, "", keyValue);
}
}
[HttpPost]
[HandlerAjaxOnly]
[HandlerAuthorize]
public async Task<ActionResult> DeleteForm(string keyValue)
{
try
{
await _service.DeleteForm(keyValue);
return await Success("操作成功。", "", keyValue, DbLogType.Delete);
}
catch (Exception ex)
{
return await Error(ex.Message, "", keyValue, DbLogType.Delete);
}
}
#endregion
}
}