Browse Source

feat: 通用表单组件上下间距调整

master
AaronWu 1 month ago
parent
commit
e6467f428b
  1. 1
      src/components/core/schema-form/src/schema-form-item.vue
  2. 2
      src/views/client/issue/index.vue
  3. 6
      src/views/question/issue/formSchemas.tsx

1
src/components/core/schema-form/src/schema-form-item.vue

@ -11,6 +11,7 @@
:label-col="itemLabelWidthProp.labelCol" :label-col="itemLabelWidthProp.labelCol"
:wrapper-col="itemLabelWidthProp.wrapperCol" :wrapper-col="itemLabelWidthProp.wrapperCol"
:rules="getRules" :rules="getRules"
class="!mb-[14px]"
> >
<slot v-if="schema.slot" :name="schema.slot" v-bind="getValues"> </slot> <slot v-if="schema.slot" :name="schema.slot" v-bind="getValues"> </slot>
<component <component

2
src/views/client/issue/index.vue

@ -167,7 +167,7 @@
const [SchemaForm, formRef] = useForm({ const [SchemaForm, formRef] = useForm({
labelWidth: 100, labelWidth: 100,
labelAlign: 'right', labelAlign: 'right',
schemas: getEditFormSchema(curRow.value),
schemas: getEditFormSchema(curRow.value, false, true),
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { actionColOptions: {
span: 24, span: 24,

6
src/views/question/issue/formSchemas.tsx

@ -14,7 +14,8 @@ const questionTypeList = await getDictionaryByTypeName(DictEnum.QUESTION_TYPE);
export const getEditFormSchema: ( export const getEditFormSchema: (
row?: Partial<TableListItem>, row?: Partial<TableListItem>,
isDetail?: boolean, isDetail?: boolean,
) => FormSchema[] = (record = {}, isDetail = false) => {
isClient?: boolean,
) => FormSchema[] = (record = {}, isDetail = false, isClient = false) => {
console.log('questionTypeList: ', questionTypeList); console.log('questionTypeList: ', questionTypeList);
return [ return [
@ -194,6 +195,7 @@ export const getEditFormSchema: (
colProps: { colProps: {
span: 6, span: 6,
}, },
}, },
{ {
field: 'zentaoNos', field: 'zentaoNos',
@ -202,6 +204,7 @@ export const getEditFormSchema: (
colProps: { colProps: {
span: 6, span: 6,
}, },
vIf: () => !isClient,
}, },
{ {
@ -216,6 +219,7 @@ export const getEditFormSchema: (
options: stateTypeList, options: stateTypeList,
disabled: true, disabled: true,
}, },
vIf: () => !isClient,
rules: [{ required: true, type: 'number' }], rules: [{ required: true, type: 'number' }],
}, },

Loading…
Cancel
Save