字典页面与字典信息页面完成增删改查
This commit is contained in:
@@ -130,6 +130,20 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryController.DelList(System.Collections.Generic.List{System.Int64})">
|
||||
<summary>
|
||||
id范围删除
|
||||
</summary>
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryController.Update(Yi.Framework.Model.Models.DictionaryEntity)">
|
||||
<summary>
|
||||
更新
|
||||
</summary>
|
||||
<param name="dic"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryInfoController.PageList(Yi.Framework.Model.Models.DictionaryInfoEntity,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
动态条件分页查询
|
||||
@@ -159,6 +173,20 @@
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryInfoController.Update(Yi.Framework.Model.Models.DictionaryInfoEntity)">
|
||||
<summary>
|
||||
更新
|
||||
</summary>
|
||||
<param name="dicInfo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryInfoController.GetById(System.Int64)">
|
||||
<summary>
|
||||
根据字典id获取字典信息表
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.Framework.ApiMicroservice.Controllers.FileController">
|
||||
<summary>
|
||||
文件
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Helper;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.Models;
|
||||
@@ -73,5 +74,29 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
return Result.Success().SetData(await _iDictionaryService._repository.GetListAsync());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// id范围删除
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
|
||||
public async Task<Result> DelList(List<long> ids)
|
||||
{
|
||||
return Result.Success().SetStatus(await _iDictionaryService._repository.DeleteByIdsAsync(ids.ToDynamicArray()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
public async Task<Result> Update(DictionaryEntity dic)
|
||||
{
|
||||
return Result.Success().SetStatus(await _iDictionaryService._repository.UpdateIgnoreNullAsync(dic));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,5 +76,29 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
return Result.Success().SetStatus(await _iDictionaryInfoService._repository.DeleteByIdsAsync(ids.ToDynamicArray()));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新
|
||||
/// </summary>
|
||||
/// <param name="dicInfo"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
public async Task<Result> Update(DictionaryInfoEntity dicInfo)
|
||||
{
|
||||
return Result.Success().SetStatus(await _iDictionaryInfoService._repository.UpdateIgnoreNullAsync(dicInfo));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据字典id获取字典信息表
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> GetById(long id)
|
||||
{
|
||||
return Result.Success().SetData(await _iDictionaryInfoService._repository.GetByIdAsync(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -12,7 +12,7 @@ export function listData(query) {
|
||||
// 查询字典数据详细
|
||||
export function getData(dictCode) {
|
||||
return request({
|
||||
url: '/system/dict/data/' + dictCode,
|
||||
url: '/dictionaryInfo/getById/' + dictCode,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export function addData(data) {
|
||||
// 修改字典数据
|
||||
export function updateData(data) {
|
||||
return request({
|
||||
url: '/system/dict/data',
|
||||
url: '/dictionaryInfo/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
||||
@@ -29,7 +29,7 @@ export function addType(data) {
|
||||
// 修改字典类型
|
||||
export function updateType(data) {
|
||||
return request({
|
||||
url: '/system/dict/type',
|
||||
url: '/dictionary/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -37,9 +37,14 @@ export function updateType(data) {
|
||||
|
||||
// 删除字典类型
|
||||
export function delType(dictId) {
|
||||
if("string"==typeof(dictId))
|
||||
{
|
||||
dictId=[dictId];
|
||||
}
|
||||
return request({
|
||||
url: '/system/dict/type/' + dictId,
|
||||
method: 'delete'
|
||||
url: '/dictionary/delList',
|
||||
method: 'delete',
|
||||
data:dictId
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
isDeleted: undefined
|
||||
isDeleted: false
|
||||
},
|
||||
rules: {
|
||||
dictLabel: [{ required: true, message: "数据标签不能为空", trigger: "blur" }],
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-form-item label="状态" prop="isDeleted">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
v-model="queryParams.isDeleted"
|
||||
placeholder="字典状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@@ -206,7 +206,7 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
isDeleted: undefined
|
||||
isDeleted: false
|
||||
},
|
||||
rules: {
|
||||
dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }],
|
||||
@@ -233,7 +233,7 @@ function cancel() {
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
Id: undefined,
|
||||
id: undefined,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
isDeleted: false,
|
||||
@@ -260,14 +260,14 @@ function handleAdd() {
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.dictId);
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const dictId = row.dictId || ids.value;
|
||||
const dictId = row.id || ids.value;
|
||||
getType(dictId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
@@ -278,7 +278,7 @@ function handleUpdate(row) {
|
||||
function submitForm() {
|
||||
proxy.$refs["dictRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.dictId != undefined) {
|
||||
if (form.value.id != undefined) {
|
||||
updateType(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
@@ -296,7 +296,7 @@ function submitForm() {
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const dictIds = row.dictId || ids.value;
|
||||
const dictIds = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
|
||||
return delType(dictIds);
|
||||
}).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user