|
@@ -1,5 +1,5 @@
|
|
|
import { CrudSchema } from '@/components/crud'
|
|
import { CrudSchema } from '@/components/crud'
|
|
|
-import { DictService, DictItemService } from './dict.api'
|
|
|
|
|
|
|
+import { DictService, DictItemService } from '@/api/dict.api'
|
|
|
|
|
|
|
|
// 字典配置
|
|
// 字典配置
|
|
|
export const dictSchema: CrudSchema = {
|
|
export const dictSchema: CrudSchema = {
|
|
@@ -12,7 +12,7 @@ export const dictSchema: CrudSchema = {
|
|
|
// 修改接口
|
|
// 修改接口
|
|
|
edit: DictService.update,
|
|
edit: DictService.update,
|
|
|
// 删除接口
|
|
// 删除接口
|
|
|
- remove: DictService.remove,
|
|
|
|
|
|
|
+ remove: DictService.delete,
|
|
|
// 详情接口
|
|
// 详情接口
|
|
|
view: DictService.detail
|
|
view: DictService.detail
|
|
|
},
|
|
},
|
|
@@ -36,67 +36,15 @@ export const dictSchema: CrudSchema = {
|
|
|
viewAuth: 'sys:dict:detail',
|
|
viewAuth: 'sys:dict:detail',
|
|
|
// 表格列定义
|
|
// 表格列定义
|
|
|
columns: [
|
|
columns: [
|
|
|
- {
|
|
|
|
|
- type: 'selection'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'groupCode',
|
|
|
|
|
- label: '分组编码',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- minWidth: 200,
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'sys_dict_group_code'
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'name',
|
|
|
|
|
- label: '字典名称',
|
|
|
|
|
- minWidth: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'code',
|
|
|
|
|
- label: '唯一编码',
|
|
|
|
|
- minWidth: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'dataType',
|
|
|
|
|
- label: '数据类型',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'sys_dict_data_type'
|
|
|
|
|
- },
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'sort',
|
|
|
|
|
- label: '排序',
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'enabled',
|
|
|
|
|
- label: '是否启用',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'yes_no'
|
|
|
|
|
- },
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 选择列
|
|
|
|
|
+ { type: 'selection' },
|
|
|
|
|
+ { prop: 'name', label: '字典名称', minWidth: 200 },
|
|
|
|
|
+ { prop: 'code', label: '字典编码', minWidth: 200 },
|
|
|
|
|
+ { prop: 'sort', label: '排序', minWidth: 100 }
|
|
|
],
|
|
],
|
|
|
// 搜索表单定义
|
|
// 搜索表单定义
|
|
|
searchFormSchema: {
|
|
searchFormSchema: {
|
|
|
schema: [
|
|
schema: [
|
|
|
- {
|
|
|
|
|
- label: '所属分组',
|
|
|
|
|
- prop: 'm_IN_groupCode',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'sys_dict_group_code',
|
|
|
|
|
- clearable: true,
|
|
|
|
|
- placeholder: '请选择所属分组',
|
|
|
|
|
- multiple: true
|
|
|
|
|
- },
|
|
|
|
|
- colSpan: 6
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
prop: 'm_LIKE_name',
|
|
prop: 'm_LIKE_name',
|
|
|
label: '字典名称',
|
|
label: '字典名称',
|
|
@@ -116,17 +64,6 @@ export const dictSchema: CrudSchema = {
|
|
|
placeholder: '请输入唯一编码'
|
|
placeholder: '请输入唯一编码'
|
|
|
},
|
|
},
|
|
|
colSpan: 6
|
|
colSpan: 6
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '是否启用',
|
|
|
|
|
- prop: 'm_IN_enabled',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'yes_no',
|
|
|
|
|
- clearable: true,
|
|
|
|
|
- placeholder: '请选择是否启用'
|
|
|
|
|
- },
|
|
|
|
|
- colSpan: 6
|
|
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
@@ -139,95 +76,20 @@ export const dictSchema: CrudSchema = {
|
|
|
showDefaultActions: false,
|
|
showDefaultActions: false,
|
|
|
labelWidth: '100px',
|
|
labelWidth: '100px',
|
|
|
schema: [
|
|
schema: [
|
|
|
- {
|
|
|
|
|
- label: '字典ID',
|
|
|
|
|
- prop: 'id',
|
|
|
|
|
- component: 'Input',
|
|
|
|
|
- colSpan: 24,
|
|
|
|
|
- show: false,
|
|
|
|
|
- ifDetail: false
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '所属分组',
|
|
|
|
|
- prop: 'groupCode',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'sys_dict_group_code'
|
|
|
|
|
- },
|
|
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请选择所属分组'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- colSpan: 24
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
label: '字典名称',
|
|
label: '字典名称',
|
|
|
prop: 'name',
|
|
prop: 'name',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入字典名称'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- placeholder: '请输入字典名称'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ rules: [{ required: true, message: '请输入字典名称' }],
|
|
|
|
|
+ componentProps: { placeholder: '请输入字典名称' },
|
|
|
colSpan: 24
|
|
colSpan: 24
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '唯一编码',
|
|
label: '唯一编码',
|
|
|
prop: 'code',
|
|
prop: 'code',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入唯一编码'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- placeholder: '请输入唯一编码'
|
|
|
|
|
- },
|
|
|
|
|
- colSpan: 24
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- label: '数据类型',
|
|
|
|
|
- prop: 'dataType',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- defaultValue: 1,
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'sys_dict_data_type',
|
|
|
|
|
- renderType: 'RadioGroup',
|
|
|
|
|
- isBtn: true,
|
|
|
|
|
- placeholder: '请选择数据类型'
|
|
|
|
|
- },
|
|
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请选择数据类型'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- colSpan: 24
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '是否启用',
|
|
|
|
|
- prop: 'enabled',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- defaultValue: 1,
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'yes_no',
|
|
|
|
|
- renderType: 'RadioGroup',
|
|
|
|
|
- isBtn: true
|
|
|
|
|
- },
|
|
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请选择是否启用'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ rules: [{ required: true, message: '请输入唯一编码' }],
|
|
|
|
|
+ componentProps: { placeholder: '请输入唯一编码' },
|
|
|
colSpan: 24
|
|
colSpan: 24
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -241,11 +103,7 @@ export const dictSchema: CrudSchema = {
|
|
|
label: '备注',
|
|
label: '备注',
|
|
|
prop: 'remark',
|
|
prop: 'remark',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- componentProps: {
|
|
|
|
|
- type: 'textarea',
|
|
|
|
|
- rows: 4,
|
|
|
|
|
- placeholder: '请输入备注'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ componentProps: { type: 'textarea', rows: 4, placeholder: '请输入备注' },
|
|
|
colSpan: 24
|
|
colSpan: 24
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -259,7 +117,7 @@ export const dictItemSchema: CrudSchema = {
|
|
|
crudApi: {
|
|
crudApi: {
|
|
|
add: DictItemService.save,
|
|
add: DictItemService.save,
|
|
|
edit: DictItemService.update,
|
|
edit: DictItemService.update,
|
|
|
- remove: DictItemService.remove,
|
|
|
|
|
|
|
+ remove: DictItemService.delete,
|
|
|
view: DictItemService.detail
|
|
view: DictItemService.detail
|
|
|
},
|
|
},
|
|
|
useCrud: true,
|
|
useCrud: true,
|
|
@@ -272,30 +130,10 @@ export const dictItemSchema: CrudSchema = {
|
|
|
editAuth: 'sys:dict-item:update',
|
|
editAuth: 'sys:dict-item:update',
|
|
|
viewAuth: 'sys:dict-item:detail',
|
|
viewAuth: 'sys:dict-item:detail',
|
|
|
columns: [
|
|
columns: [
|
|
|
- {
|
|
|
|
|
- type: 'selection'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'name',
|
|
|
|
|
- label: '字典项名称'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'code',
|
|
|
|
|
- label: '字典值'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'sort',
|
|
|
|
|
- label: '排序'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'enabled',
|
|
|
|
|
- label: '是否启用',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'yes_no',
|
|
|
|
|
- renderType: 'RadioGroup'
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 选择列
|
|
|
|
|
+ { prop: 'name', label: '字典项名称' },
|
|
|
|
|
+ { prop: 'code', label: '字典值' },
|
|
|
|
|
+ { prop: 'sort', label: '排序' }
|
|
|
],
|
|
],
|
|
|
searchFormSchema: {
|
|
searchFormSchema: {
|
|
|
schema: [
|
|
schema: [
|
|
@@ -304,20 +142,14 @@ export const dictItemSchema: CrudSchema = {
|
|
|
labelWidth: '90px',
|
|
labelWidth: '90px',
|
|
|
label: '字典项名称',
|
|
label: '字典项名称',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- componentProps: {
|
|
|
|
|
- clearable: true,
|
|
|
|
|
- placeholder: '请输入字典项名称'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ componentProps: { clearable: true, placeholder: '请输入字典项名称' },
|
|
|
colSpan: 8
|
|
colSpan: 8
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'm_LIKE_code',
|
|
prop: 'm_LIKE_code',
|
|
|
- label: '字典值',
|
|
|
|
|
|
|
+ label: '字典项数值',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- componentProps: {
|
|
|
|
|
- clearable: true,
|
|
|
|
|
- placeholder: '请输入字典值'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ componentProps: { clearable: true, placeholder: '请输入字典值' },
|
|
|
colSpan: 8
|
|
colSpan: 8
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -329,73 +161,32 @@ export const dictItemSchema: CrudSchema = {
|
|
|
showDefaultActions: false,
|
|
showDefaultActions: false,
|
|
|
labelWidth: '100px',
|
|
labelWidth: '100px',
|
|
|
schema: [
|
|
schema: [
|
|
|
- {
|
|
|
|
|
- label: '字典项ID',
|
|
|
|
|
- prop: 'id',
|
|
|
|
|
- component: 'Input',
|
|
|
|
|
- colSpan: 24,
|
|
|
|
|
- show: false,
|
|
|
|
|
- ifDetail: false
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
label: '字典项名称',
|
|
label: '字典项名称',
|
|
|
prop: 'name',
|
|
prop: 'name',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入字典项名称'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ rules: [{ required: true, message: '请输入字典项名称' }],
|
|
|
colSpan: 24
|
|
colSpan: 24
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '字典值',
|
|
label: '字典值',
|
|
|
prop: 'code',
|
|
prop: 'code',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入唯一编码'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- colSpan: 24
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '是否启用',
|
|
|
|
|
- prop: 'enabled',
|
|
|
|
|
- component: 'ApiDict',
|
|
|
|
|
- defaultValue: 1,
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- code: 'yes_no',
|
|
|
|
|
- renderType: 'RadioGroup',
|
|
|
|
|
- isBtn: true
|
|
|
|
|
- },
|
|
|
|
|
- rules: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请选择是否启用'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ rules: [{ required: true, message: '请输入唯一编码' }],
|
|
|
colSpan: 24
|
|
colSpan: 24
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '排序',
|
|
label: '排序',
|
|
|
prop: 'sort',
|
|
prop: 'sort',
|
|
|
component: 'InputNumber',
|
|
component: 'InputNumber',
|
|
|
- componentProps: {
|
|
|
|
|
- min: 0
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ componentProps: { min: 0 },
|
|
|
colSpan: 24
|
|
colSpan: 24
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '备注',
|
|
label: '备注',
|
|
|
prop: 'remark',
|
|
prop: 'remark',
|
|
|
component: 'Input',
|
|
component: 'Input',
|
|
|
- componentProps: {
|
|
|
|
|
- type: 'textarea',
|
|
|
|
|
- rows: 3
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ componentProps: { type: 'textarea', rows: 3 },
|
|
|
colSpan: 24
|
|
colSpan: 24
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|