@ -1,39 +1,39 @@
import { FormSchema } from '/@/components/Table' ;
import { FormSchema } from "/@/components/Table" ;
import { BasicColumn } from '/@/components/Table' ;
import { BasicColumn } from "/@/components/Table" ;
import { message } from 'ant-design-vue' ;
import { message } from "ant-design-vue" ;
import { useI18n } from '/@/hooks/web/useI18n' ;
import { useI18n } from "/@/hooks/web/useI18n" ;
import {
import {
PagingDataDictionaryInput ,
PagingDataDictionaryInput ,
DataDictionaryServiceProxy ,
DataDictionaryServiceProxy ,
SetDataDictinaryDetailInput ,
SetDataDictinaryDetailInput ,
DeleteDataDictionaryDetailInput ,
DeleteDataDictionaryDetailInput ,
IdInput ,
IdInput
} from '/@/services/ServiceProxies' ;
} from "/@/services/ServiceProxies" ;
import { h } from 'vue' ;
import { h } from "vue" ;
import { Switch } from 'ant-design-vue' ;
import { Switch } from "ant-design-vue" ;
const { t } = useI18n ( ) ;
const { t } = useI18n ( ) ;
export const tableColumns : BasicColumn [ ] = [
export const tableColumns : BasicColumn [ ] = [
{
{
title : t ( 'routes.admin.dictionaryCode' ) ,
title : t ( "routes.admin.dictionaryCode" ) ,
dataIndex : 'code' ,
dataIndex : "code"
} ,
} ,
{
{
title : t ( 'routes.admin.dictionaryDisplayText' ) ,
title : t ( "routes.admin.dictionaryDisplayText" ) ,
dataIndex : 'displayText' ,
dataIndex : "displayText"
} ,
} ,
{
{
title : t ( 'routes.admin.dictionaryOrder' ) ,
title : t ( "routes.admin.dictionaryOrder" ) ,
dataIndex : 'order' ,
dataIndex : "order"
} ,
} ,
{
{
title : t ( 'common.status' ) ,
title : t ( "common.status" ) ,
dataIndex : 'isEnabled' ,
dataIndex : "isEnabled" ,
customRender : ( { record } ) = > {
customRender : ( { record } ) = > {
return h ( Switch , {
return h ( Switch , {
checked : record.isEnabled ,
checked : record.isEnabled ,
checkedChildren : '是' ,
checkedChildren : "是" ,
unCheckedChildren : '否' ,
unCheckedChildren : "否" ,
onChange ( checked : boolean ) {
onChange ( checked : boolean ) {
const request = new SetDataDictinaryDetailInput ( ) ;
const request = new SetDataDictinaryDetailInput ( ) ;
request . dataDictionaryId = record . dataDictionaryId ;
request . dataDictionaryId = record . dataDictionaryId ;
@ -42,102 +42,102 @@ export const tableColumns: BasicColumn[] = [
enableDictionaryAsync ( request )
enableDictionaryAsync ( request )
. then ( ( ) = > {
. then ( ( ) = > {
record . isEnabled = checked ;
record . isEnabled = checked ;
message . success ( t ( 'common.operationSuccess' ) ) ;
message . success ( t ( "common.operationSuccess" ) ) ;
} )
} )
. catch ( ( ) = > {
. catch ( ( ) = > {
message . error ( t ( 'common.operationFail' ) ) ;
message . error ( t ( "common.operationFail" ) ) ;
} ) ;
} ) ;
} ,
}
} ) ;
} ) ;
} ,
}
} ,
} ,
{
{
dataIndex : 'description' ,
dataIndex : "description" ,
title : t ( 'routes.admin.dictionaryDescription' ) ,
title : t ( "routes.admin.dictionaryDescription" )
} ,
}
] ;
] ;
//字典类型表格
//字典类型表格
export const dictionaryTypeTableColumns : BasicColumn [ ] = [
export const dictionaryTypeTableColumns : BasicColumn [ ] = [
{
{
title : t ( 'routes.admin.dictionaryCode' ) + '|' + t ( 'routes.admin.dictionaryDisplayText' ) ,
title : t ( "routes.admin.dictionaryCode" ) + "|" + t ( "routes.admin.dictionaryDisplayText" ) ,
dataIndex : 'text' ,
dataIndex : "text" ,
align : 'left' ,
align : "left" ,
slots : {
slots : {
customRender : 'text' ,
customRender : "text"
} ,
}
} ,
}
] ;
] ;
//字典项查询
//字典项查询
export const searchFormSchema : FormSchema [ ] = [
export const searchFormSchema : FormSchema [ ] = [
{
{
field : 'filter' ,
field : "filter" ,
label : '' ,
label : "" ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 6 ,
span : 6
} ,
}
} ,
}
] ;
] ;
//字典类型查询
//字典类型查询
export const searchDictionaryFormSchema : FormSchema [ ] = [
export const searchDictionaryFormSchema : FormSchema [ ] = [
{
{
field : 'filter' ,
field : "filter" ,
label : '' ,
label : "" ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
}
] ;
] ;
//新增字典项
//新增字典项
export const createFormSchema : FormSchema [ ] = [
export const createFormSchema : FormSchema [ ] = [
{
{
field : 'id' ,
field : "id" ,
label : '' ,
label : "" ,
ifShow : false ,
ifShow : false ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
} ,
{
{
field : 'typeDisplayText' ,
field : "typeDisplayText" ,
label : t ( 'routes.admin.dictionaryTypeName' ) ,
label : t ( "routes.admin.dictionaryTypeName" ) ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
} ,
componentProps : {
componentProps : {
disabled : true ,
disabled : true
} ,
}
} ,
} ,
{
{
field : 'code' ,
field : "code" ,
label : t ( 'routes.admin.dictionaryCode' ) ,
label : t ( "routes.admin.dictionaryCode" ) ,
required : true ,
required : true ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
} ,
{
{
field : 'displayText' ,
field : "displayText" ,
label : t ( 'routes.admin.dictionaryDisplayText' ) ,
label : t ( "routes.admin.dictionaryDisplayText" ) ,
component : 'Input' ,
component : "Input" ,
required : true ,
required : true ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
} ,
{
{
field : 'order' ,
field : "order" ,
label : t ( 'routes.admin.dictionaryOrder' ) ,
label : t ( "routes.admin.dictionaryOrder" ) ,
required : true ,
required : true ,
component : 'InputNumber' ,
component : "InputNumber" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
} ,
dynamicRules : ( ) = > {
dynamicRules : ( ) = > {
return [
return [
@ -148,69 +148,69 @@ export const createFormSchema: FormSchema[] = [
if ( regNull . test ( value ) ) {
if ( regNull . test ( value ) ) {
return Promise . resolve ( ) ;
return Promise . resolve ( ) ;
}
}
return Promise . reject ( t ( 'routes.admin.nonZeroMessage' ) ) ;
return Promise . reject ( t ( "routes.admin.nonZeroMessage" ) ) ;
} ,
}
} ,
}
] ;
] ;
} ,
}
} ,
} ,
{
{
field : 'description' ,
field : "description" ,
label : t ( 'routes.admin.dictionaryDescription' ) ,
label : t ( "routes.admin.dictionaryDescription" ) ,
component : 'InputTextArea' ,
component : "InputTextArea" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
}
] ;
] ;
//编辑字典项
//编辑字典项
export const editFormSchema : FormSchema [ ] = [
export const editFormSchema : FormSchema [ ] = [
{
{
field : 'dataDictionaryId' ,
field : "dataDictionaryId" ,
label : '' ,
label : "" ,
ifShow : false ,
ifShow : false ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
} ,
{
{
field : 'id' ,
field : "id" ,
label : '' ,
label : "" ,
ifShow : false ,
ifShow : false ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
} ,
{
{
field : 'code' ,
field : "code" ,
label : t ( 'routes.admin.dictionaryCode' ) ,
label : t ( "routes.admin.dictionaryCode" ) ,
required : true ,
required : true ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
} ,
componentProps : {
componentProps : {
disabled : true ,
disabled : true
} ,
}
} ,
} ,
{
{
field : 'displayText' ,
field : "displayText" ,
label : t ( 'routes.admin.dictionaryDisplayText' ) ,
label : t ( "routes.admin.dictionaryDisplayText" ) ,
component : 'Input' ,
component : "Input" ,
required : true ,
required : true ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
} ,
{
{
field : 'order' ,
field : "order" ,
label : t ( 'routes.admin.dictionaryOrder' ) ,
label : t ( "routes.admin.dictionaryOrder" ) ,
required : true ,
required : true ,
component : 'InputNumber' ,
component : "InputNumber" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
} ,
dynamicRules : ( ) = > {
dynamicRules : ( ) = > {
return [
return [
@ -221,99 +221,99 @@ export const editFormSchema: FormSchema[] = [
if ( regNull . test ( value ) ) {
if ( regNull . test ( value ) ) {
return Promise . resolve ( ) ;
return Promise . resolve ( ) ;
}
}
return Promise . reject ( t ( 'routes.admin.nonZeroMessage' ) ) ;
return Promise . reject ( t ( "routes.admin.nonZeroMessage" ) ) ;
} ,
}
} ,
}
] ;
] ;
} ,
}
} ,
} ,
{
{
field : 'description' ,
field : "description" ,
label : t ( 'routes.admin.dictionaryDescription' ) ,
label : t ( "routes.admin.dictionaryDescription" ) ,
component : 'InputTextArea' ,
component : "InputTextArea" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
}
] ;
] ;
//新增字典类型
//新增字典类型
export const createDictionaryTypeFormSchema : FormSchema [ ] = [
export const createDictionaryTypeFormSchema : FormSchema [ ] = [
{
{
field : 'code' ,
field : "code" ,
label : t ( 'routes.admin.dictionaryCode' ) ,
label : t ( "routes.admin.dictionaryCode" ) ,
component : 'Input' ,
component : "Input" ,
required : true ,
required : true ,
colProps : {
colProps : {
span : 22 ,
span : 22
} ,
}
} ,
} ,
{
{
field : 'displayText' ,
field : "displayText" ,
label : t ( 'routes.admin.dictionaryDisplayText' ) ,
label : t ( "routes.admin.dictionaryDisplayText" ) ,
component : 'Input' ,
component : "Input" ,
required : true ,
required : true ,
colProps : {
colProps : {
span : 22 ,
span : 22
} ,
}
} ,
} ,
{
{
field : 'description' ,
field : "description" ,
label : t ( 'routes.admin.dictionaryDescription' ) ,
label : t ( "routes.admin.dictionaryDescription" ) ,
component : 'InputTextArea' ,
component : "InputTextArea" ,
colProps : {
colProps : {
span : 22 ,
span : 22
} ,
}
} ,
}
] ;
] ;
//编辑字典类型
//编辑字典类型
export const editDictionaryTypeFormSchema : FormSchema [ ] = [
export const editDictionaryTypeFormSchema : FormSchema [ ] = [
{
{
field : 'code' ,
field : "code" ,
label : t ( 'routes.admin.dictionaryCode' ) ,
label : t ( "routes.admin.dictionaryCode" ) ,
component : 'Input' ,
component : "Input" ,
required : true ,
required : true ,
colProps : {
colProps : {
span : 22 ,
span : 22
} ,
} ,
componentProps : {
componentProps : {
disabled : true ,
disabled : true
} ,
}
} ,
} ,
{
{
field : 'displayText' ,
field : "displayText" ,
label : t ( 'routes.admin.dictionaryDisplayText' ) ,
label : t ( "routes.admin.dictionaryDisplayText" ) ,
component : 'Input' ,
component : "Input" ,
required : true ,
required : true ,
colProps : {
colProps : {
span : 22 ,
span : 22
} ,
}
} ,
} ,
{
{
field : 'description' ,
field : "description" ,
label : t ( 'routes.admin.dictionaryDescription' ) ,
label : t ( "routes.admin.dictionaryDescription" ) ,
component : 'InputTextArea' ,
component : "InputTextArea" ,
colProps : {
colProps : {
span : 22 ,
span : 22
} ,
}
} ,
} ,
{
{
field : 'key' ,
field : "key" ,
label : '' ,
label : "" ,
ifShow : false ,
ifShow : false ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
} ,
{
{
field : 'id' ,
field : "id" ,
label : '' ,
label : "" ,
ifShow : false ,
ifShow : false ,
component : 'Input' ,
component : "Input" ,
colProps : {
colProps : {
span : 18 ,
span : 18
} ,
}
} ,
}
] ;
] ;
/ * *
/ * *
@ -333,13 +333,13 @@ export async function createDictionaryTypeAsync({
changeOkLoading ,
changeOkLoading ,
closeModal ,
closeModal ,
validate ,
validate ,
resetFields ,
resetFields
} ) {
} ) {
changeOkLoading ( true ) ;
changeOkLoading ( true ) ;
await validate ( ) ;
await validate ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
await _dataDictionaryServiceProxy . create ( request ) ;
await _dataDictionaryServiceProxy . create ( request ) ;
message . success ( t ( 'common.operationSuccess' ) ) ;
message . success ( t ( "common.operationSuccess" ) ) ;
resetFields ( ) ;
resetFields ( ) ;
changeOkLoading ( false ) ;
changeOkLoading ( false ) ;
closeModal ( ) ;
closeModal ( ) ;
@ -351,7 +351,7 @@ export async function editDictionaryTypeAsync({ request, changeOkLoading, valida
await validate ( ) ;
await validate ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
await _dataDictionaryServiceProxy . update ( request ) ;
await _dataDictionaryServiceProxy . update ( request ) ;
message . success ( t ( 'common.operationSuccess' ) ) ;
message . success ( t ( "common.operationSuccess" ) ) ;
changeOkLoading ( false ) ;
changeOkLoading ( false ) ;
closeModal ( ) ;
closeModal ( ) ;
}
}
@ -368,13 +368,13 @@ export async function createDetailsDictionaryAsync({
changeOkLoading ,
changeOkLoading ,
validate ,
validate ,
resetFields ,
resetFields ,
closeModal ,
closeModal
} ) {
} ) {
changeOkLoading ( true ) ;
changeOkLoading ( true ) ;
await validate ( ) ;
await validate ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
await _dataDictionaryServiceProxy . createDetail ( request ) ;
await _dataDictionaryServiceProxy . createDetail ( request ) ;
message . success ( t ( 'common.operationSuccess' ) ) ;
message . success ( t ( "common.operationSuccess" ) ) ;
resetFields ( ) ;
resetFields ( ) ;
changeOkLoading ( false ) ;
changeOkLoading ( false ) ;
closeModal ( ) ;
closeModal ( ) ;
@ -392,13 +392,13 @@ export async function editDetailsDictionaryAsync({
request ,
request ,
changeOkLoading ,
changeOkLoading ,
validate ,
validate ,
closeModal ,
closeModal
} ) {
} ) {
changeOkLoading ( true ) ;
changeOkLoading ( true ) ;
await validate ( ) ;
await validate ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
const _dataDictionaryServiceProxy = new DataDictionaryServiceProxy ( ) ;
await _dataDictionaryServiceProxy . updateDetail ( request ) ;
await _dataDictionaryServiceProxy . updateDetail ( request ) ;
message . success ( t ( 'common.operationSuccess' ) ) ;
message . success ( t ( "common.operationSuccess" ) ) ;
changeOkLoading ( false ) ;
changeOkLoading ( false ) ;
closeModal ( ) ;
closeModal ( ) ;
}
}