字典新增批量查询
This commit is contained in:
@@ -261,7 +261,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
FileHelper.ZipGenCode(dto);
|
||||
|
||||
//HttpContext.Response.Headers.Add("Content-disposition", $"attachment; filename={zipFileName}");
|
||||
return SUCCESS(new { zipPath = "/Generatecode/" + dto.ZipFileName, fileName = dto.ZipFileName });
|
||||
return SUCCESS(new { path = "/Generatecode/" + dto.ZipFileName, fileName = dto.ZipFileName });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,9 +3,13 @@ using Infrastructure.Enums;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Common;
|
||||
using ZR.Model;
|
||||
using ZR.Model.System;
|
||||
using ZR.Model.System.Dto;
|
||||
using ZR.Model.Vo;
|
||||
using ZR.Service.System.IService;
|
||||
|
||||
@@ -53,6 +57,30 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
return SUCCESS(SysDictDataService.SelectDictDataByType(dictType));
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据字典类型查询字典数据信息
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpPost("types")]
|
||||
public IActionResult DictTypes([FromBody] List<SysdictDataDto> dto)
|
||||
{
|
||||
var list = SysDictDataService.SelectDictDataByTypes(dto.Select(f => f.DictType).ToArray());
|
||||
List<SysdictDataDto> dataVos = new();
|
||||
|
||||
foreach (var dic in dto)
|
||||
{
|
||||
SysdictDataDto vo = new()
|
||||
{
|
||||
DictType = dic.DictType,
|
||||
ColumnName = dic.ColumnName,
|
||||
List = list.FindAll(f => f.DictType == dic.DictType)
|
||||
};
|
||||
dataVos.Add(vo);
|
||||
}
|
||||
return SUCCESS(dataVos);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询字典数据详细
|
||||
|
||||
@@ -148,12 +148,21 @@ $end
|
||||
// 列表数据查询
|
||||
this.getList();
|
||||
|
||||
$set(index = 0)
|
||||
var dictParams = [
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox") && item.DictType != "")
|
||||
this.getDicts("${item.DictType}").then((response) => {
|
||||
this.${item.ColumnName}Options = response.data;
|
||||
})
|
||||
{ dictType: "${item.DictType}", columnName: "${item.ColumnName}Options" },
|
||||
$set(index = index + 1)
|
||||
$end
|
||||
$end
|
||||
];
|
||||
$if(index > 0)
|
||||
this.getMoreDicts(dictParams).then((response) => {
|
||||
response.data.forEach((element) => {
|
||||
this[element.columnName] = element.list;
|
||||
});
|
||||
});
|
||||
$end
|
||||
},
|
||||
methods: {
|
||||
@@ -165,7 +174,6 @@ $if(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
this.queryParams["end${item.CsharpField}"] = this.addDateRange2(this.dateRange${item.CsharpField}, 1);
|
||||
$end
|
||||
$end
|
||||
console.log(JSON.stringify(this.queryParams));
|
||||
this.loading = true;
|
||||
list${genTable.BusinessName}(this.queryParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
|
||||
Reference in New Issue
Block a user