From b5ad7a1721bc76c2c4ab6d7a34eecb4da707ce3b Mon Sep 17 00:00:00 2001 From: chenchun <454313500@qq.com> Date: Sat, 10 Sep 2022 20:25:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E9=A1=B5=E9=9D=A2=E4=B8=8E?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Config/SwaggerDoc.xml | 28 ++++++++++++++++++ .../Controllers/DictionaryController.cs | 25 ++++++++++++++++ .../Controllers/DictionaryInfoController.cs | 24 +++++++++++++++ .../yi-sqlsugar-dev.db | Bin 126976 -> 126976 bytes Yi.Vue3.X.RuoYi/src/api/system/dict/data.js | 4 +-- Yi.Vue3.X.RuoYi/src/api/system/dict/type.js | 11 +++++-- .../src/views/system/dict/data.vue | 2 +- .../src/views/system/dict/index.vue | 16 +++++----- 8 files changed, 96 insertions(+), 14 deletions(-) diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml index 73c9f8fe..7a8e4863 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml @@ -130,6 +130,20 @@ + + + id范围删除 + + + + + + + 更新 + + + + 动态条件分页查询 @@ -159,6 +173,20 @@ + + + 更新 + + + + + + + 根据字典id获取字典信息表 + + + + 文件 diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryController.cs index 0fcc3abb..c5c38f6f 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryController.cs @@ -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()); } + + + /// + /// id范围删除 + /// + /// + /// + [HttpDelete] + + public async Task DelList(List ids) + { + return Result.Success().SetStatus(await _iDictionaryService._repository.DeleteByIdsAsync(ids.ToDynamicArray())); + } + + /// + /// 更新 + /// + /// + /// + [HttpPut] + public async Task Update(DictionaryEntity dic) + { + return Result.Success().SetStatus(await _iDictionaryService._repository.UpdateIgnoreNullAsync(dic)); + } } } diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryInfoController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryInfoController.cs index 06a321df..2a41bb27 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryInfoController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/DictionaryInfoController.cs @@ -76,5 +76,29 @@ namespace Yi.Framework.ApiMicroservice.Controllers return Result.Success().SetStatus(await _iDictionaryInfoService._repository.DeleteByIdsAsync(ids.ToDynamicArray())); } + + /// + /// 更新 + /// + /// + /// + [HttpPut] + public async Task Update(DictionaryInfoEntity dicInfo) + { + return Result.Success().SetStatus(await _iDictionaryInfoService._repository.UpdateIgnoreNullAsync(dicInfo)); + } + + + /// + /// 根据字典id获取字典信息表 + /// + /// + /// + [HttpGet] + [Route("{id}")] + public async Task GetById(long id) + { + return Result.Success().SetData(await _iDictionaryInfoService._repository.GetByIdAsync(id)); + } } } diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db index 323989b1dc070edce32ee6587b9d8c6d6f6a745b..bc2597acdd9b90ed09ea2b331fc1aeb42169b108 100644 GIT binary patch delta 368 zcmZp8z~1nHeS$Qj-$WT_M!&{{tqF|F`dJn+@Gsgd=rDsnE{0KnO_Tu$j2WCcfRwDF z=#dR?CLa=DD6T9vF)}bR(lxNuH8fB#GO#iITC zWY5I}u^DWZv7wMz_X!+gGU} - + 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(() => {