committed by
GitHub
15 changed files with 449 additions and 25 deletions
@ -1,10 +1,11 @@ |
|||
using System; |
|||
|
|||
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries.Dtos; |
|||
|
|||
public class DeleteDataDictionaryDetailInput |
|||
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries.Dtos |
|||
{ |
|||
public Guid DataDictionaryId { get; set; } |
|||
|
|||
public Guid DataDictionayDetailId { get; set; } |
|||
} |
|||
public class DeleteDataDictionaryDetailInput |
|||
{ |
|||
public Guid DataDictionaryId { get; set; } |
|||
|
|||
public Guid DataDictionayDetailId { get; set; } |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,20 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries.Dtos |
|||
{ |
|||
public class UpdateDataDictinaryInput |
|||
{ |
|||
[Required] |
|||
public Guid Id { get; set; } |
|||
[Required] |
|||
public string Code { get; set; } |
|||
[Required] |
|||
public string DisplayText { get; set; } |
|||
public string Description { get; set; } |
|||
} |
|||
} |
|||
@ -1,17 +1,19 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries.Dtos; |
|||
|
|||
public class UpdateDetailInput |
|||
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries.Dtos |
|||
{ |
|||
[Required] public Guid DataDictionaryId { get; set; } |
|||
public class UpdateDetailInput |
|||
{ |
|||
[Required] public Guid DataDictionaryId { get; set; } |
|||
|
|||
[Required] public Guid Id { get; set; } |
|||
|
|||
[Required] public Guid Id { get; set; } |
|||
[Required] public string DisplayText { get; set; } |
|||
|
|||
[Required] public string DisplayText { get; set; } |
|||
public string Description { get; set; } |
|||
|
|||
public string Description { get; set; } |
|||
public int Order { get; set; } |
|||
} |
|||
} |
|||
|
|||
public int Order { get; set; } |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|||
using Lion.AbpPro.DataDictionaryManagement.DataDictionaries; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries.Tests |
|||
{ |
|||
[TestClass()] |
|||
public class DataDictionaryControllerTests |
|||
{ |
|||
[TestMethod()] |
|||
public void CreateAsyncTest() |
|||
{ |
|||
Assert.Fail(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>.NETCoreApp,Version=v6.0</TargetFramework> |
|||
|
|||
<IsPackable>false</IsPackable> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" /> |
|||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" /> |
|||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" /> |
|||
<PackageReference Include="coverlet.collector" Version="3.0.2" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Lion.AbpPro.DataDictionaryManagement.HttpApi\Lion.AbpPro.DataDictionaryManagement.HttpApi.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,72 @@ |
|||
<template> |
|||
<BasicModal |
|||
:title="t('common.editText')" |
|||
:canFullscreen="false" |
|||
@ok="submit" |
|||
@cancel="cancel" |
|||
@register="registerModal" |
|||
:destroyOnClose="true" |
|||
:maskClosable="false" |
|||
:minHeight="100" |
|||
> |
|||
<BasicForm @register="registeDictionaryTypeForm" /> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent } from 'vue'; |
|||
import { useI18n } from '/@/hooks/web/useI18n'; |
|||
import { BasicModal, useModalInner } from '/@/components/Modal'; |
|||
import { BasicForm, useForm } from '/@/components/Form/index'; |
|||
import { editDictionaryTypeFormSchema, editDictionaryTypeAsync } from './AbpDictionary'; |
|||
export default defineComponent({ |
|||
name: 'EditDictionary', |
|||
components: { |
|||
BasicModal, |
|||
BasicForm, |
|||
}, |
|||
setup(_, { emit }) { |
|||
const { t } = useI18n(); |
|||
const [registerModal, { closeModal, changeOkLoading }] = useModalInner((data) => { |
|||
setFieldsValue({ |
|||
id: data.record.id, |
|||
code: data.record.code, |
|||
description: data.record.description, |
|||
displayText: data.record.displayText, |
|||
key: data.record.key, |
|||
}); |
|||
}); |
|||
const [registeDictionaryTypeForm, { setFieldsValue, getFieldsValue, validate, resetFields }] = |
|||
useForm({ |
|||
labelWidth: 100, |
|||
schemas: editDictionaryTypeFormSchema, |
|||
showActionButtonGroup: false, |
|||
}); |
|||
|
|||
const submit = async () => { |
|||
try { |
|||
let request = getFieldsValue(); |
|||
await editDictionaryTypeAsync({ request, changeOkLoading, validate, closeModal }); |
|||
emit('reloadType'); |
|||
} catch (error) { |
|||
changeOkLoading(false); |
|||
} |
|||
}; |
|||
|
|||
const cancel = () => { |
|||
resetFields(); |
|||
closeModal(); |
|||
}; |
|||
|
|||
return { |
|||
registerModal, |
|||
registeDictionaryTypeForm, |
|||
submit, |
|||
t, |
|||
cancel, |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
|
|||
<style lang="less" scoped></style> |
|||
Loading…
Reference in new issue