|
|
@@ -1,22 +1,22 @@
|
|
|
<template>
|
|
|
<a-col v-bind="actionColOpt" v-if="showActionButtonGroup">
|
|
|
<div class="btnArea" style="width: 100%" :style="{ textAlign: actionColOpt.style.textAlign }">
|
|
|
- <FormItem>
|
|
|
+ <FormItem v-bind="formItemProps">
|
|
|
<slot name="submitBefore"></slot>
|
|
|
- <Button type="primary" class="mr-2" v-bind="getSubmitBtnOptions" @click="submitAction" v-if="showSubmitButton">
|
|
|
+ <a-button type="primary" class="mr-2" v-bind="getSubmitBtnOptions" @click="submitAction" v-if="showSubmitButton">
|
|
|
{{ getSubmitBtnOptions.text }}
|
|
|
- </Button>
|
|
|
+ </a-button>
|
|
|
|
|
|
<slot name="resetBefore"></slot>
|
|
|
- <Button type="default" class="mr-2" v-bind="getResetBtnOptions" @click="resetAction" v-if="showResetButton">
|
|
|
+ <a-button type="default" class="mr-2" v-bind="getResetBtnOptions" @click="resetAction" v-if="showResetButton">
|
|
|
{{ getResetBtnOptions.text }}
|
|
|
- </Button>
|
|
|
+ </a-button>
|
|
|
|
|
|
<slot name="advanceBefore"></slot>
|
|
|
- <Button type="link" size="small" @click="toggleAdvanced" v-if="showAdvancedButton && !hideAdvanceBtn">
|
|
|
+ <a-button type="link" size="small" @click="toggleAdvanced" v-if="showAdvancedButton && !hideAdvanceBtn">
|
|
|
{{ isAdvanced ? t('component.form.putAway') : t('component.form.unfold') }}
|
|
|
<BasicArrow class="ml-1" :expand="!isAdvanced" up />
|
|
|
- </Button>
|
|
|
+ </a-button>
|
|
|
<slot name="advanceAfter"></slot>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
@@ -26,8 +26,8 @@
|
|
|
import type { ColEx } from '../types/index';
|
|
|
//import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes';
|
|
|
import { defineComponent, computed, PropType } from 'vue';
|
|
|
- import { Form, Col } from 'ant-design-vue';
|
|
|
- import { Button, ButtonProps } from '/@/components/Button';
|
|
|
+ import { Form, FormItemProps } from 'ant-design-vue';
|
|
|
+ import { ButtonProps } from '/@/components/Button';
|
|
|
import { BasicArrow } from '/@/components/Basic';
|
|
|
import { useFormContext } from '../hooks/useFormContext';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
@@ -39,9 +39,7 @@
|
|
|
name: 'BasicFormAction',
|
|
|
components: {
|
|
|
FormItem: Form.Item,
|
|
|
- Button,
|
|
|
BasicArrow,
|
|
|
- [Col.name]: Col,
|
|
|
},
|
|
|
props: {
|
|
|
showActionButtonGroup: propTypes.bool.def(true),
|
|
|
@@ -64,6 +62,10 @@
|
|
|
isAdvanced: propTypes.bool,
|
|
|
hideAdvanceBtn: propTypes.bool,
|
|
|
layout: propTypes.oneOf(['horizontal', 'vertical', 'inline']).def('horizontal'),
|
|
|
+ formItemProps: {
|
|
|
+ type: Object as PropType<FormItemProps>,
|
|
|
+ default: () => ({}),
|
|
|
+ },
|
|
|
},
|
|
|
emits: ['toggle-advanced'],
|
|
|
setup(props, { emit }) {
|