Files
geg-gas-web/src/views/system/group/components/config.ts
2025-03-27 09:36:29 +08:00

292 lines
6.4 KiB
TypeScript

import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '用户组名称',
component: 'Input',
},
{
field: 'code',
label: '用户组编码',
component: 'Input',
},
{
field: 'enabledMark',
label: '状态',
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 1, label: '启用', value: 1 },
{ key: 2, label: '停用', value: 0 },
],
labelField: 'label',
valueField: 'value',
getPopupContainer: () => document.body,
},
}
];
export const columns: BasicColumn[] = [
{
dataIndex: 'name',
title: '用户组名称',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'code',
title: '用户组编码',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'enabledMark',
title: '状态',
componentType: 'radio',
align: 'left',
customRender: ({ record }) => {
const staticOptions = [
{ key: 1, label: '启用', value: 1 },
{ key: 2, label: '停用', value: 0 },
];
return staticOptions.filter((x) => x.value === record.enabledMark)[0]?.label;
},
sorter: true,
},
{
dataIndex: 'remark',
title: '备注',
componentType: 'textarea',
align: 'left',
sorter: true,
},
];
//表单事件
export const formEventConfigs = {
0: [
{
type: 'circle',
color: '#2774ff',
text: '开始节点',
icon: '#icon-kaishi',
bgcColor: '#D8E5FF',
isUserDefined: false,
},
{
color: '#F6AB01',
icon: '#icon-chushihua',
text: '初始化表单',
bgcColor: '#f9f5ea',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
1: [
{
color: '#B36EDB',
icon: '#icon-shujufenxi',
text: '获取表单数据',
detail: '(新增无此操作)',
bgcColor: '#F8F2FC',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
2: [
{
color: '#F8625C',
icon: '#icon-jiazai',
text: '加载表单',
bgcColor: '#FFF1F1',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
3: [
{
color: '#6C6AE0',
icon: '#icon-jsontijiao',
text: '提交表单',
bgcColor: '#F5F4FF',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
4: [
{
type: 'circle',
color: '#F8625C',
text: '结束节点',
icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6',
isLast: true,
isUserDefined: false,
},
],
};
export const formProps: FormProps = {
labelCol: { span: 3, offset: 0, labelWidthMode: 'flex' },
labelAlign: 'right',
layout: 'horizontal',
size: 'default',
schemas: [
{
key: '78982448aafb4c6aa670af77d3c81671',
field: 'name',
label: '用户组名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: true,
respNewRow: false,
placeholder: '请输入用户组名称',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},
{
key: '5042a508994f4b73a6e6ff826bfc90a3',
field: 'code',
label: '用户组编码',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: true,
respNewRow: false,
placeholder: '请输入用户组编码',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
isSave: false,
isShow: true,
scan: false,
style: { width: '100%' },
},
},
{
key: 'f236824d858c43cfb801762f2a585f75',
field: 'enabledMark',
label: '状态',
type: 'radio',
component: 'ApiRadioGroup',
colProps: { span: 24 },
componentProps: {
span: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: true,
respNewRow: false,
showLabel: true,
disabled: false,
optionType: 'default',
staticOptions: [
{ key: 1, label: '启用', value: 1 },
{ key: 2, label: '停用', value: 0 },
],
datasourceType: 'staticData',
labelField: 'label',
valueField: 'value',
defaultSelect: '0',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
params: null,
style: {},
},
},
{
key: '06f7026e60a14d07a0e53043caf99437',
field: 'remark',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: true,
respNewRow: true,
placeholder: '请输入备注',
maxlength: null,
rows: 4,
autoSize: false,
showCount: false,
disabled: false,
showLabel: true,
allowClear: false,
required: false,
isShow: true,
rules: [],
events: {},
style: { width: '100%' },
},
},
],
showActionButtonGroup: false,
buttonLocation: 'center',
actionColOptions: { span: 24 },
showResetButton: false,
showSubmitButton: false,
hiddenComponent: [],
};