diff --git a/src/components/Form/src/hooks/useFormEvents.ts b/src/components/Form/src/hooks/useFormEvents.ts index 260dace..fd88595 100644 --- a/src/components/Form/src/hooks/useFormEvents.ts +++ b/src/components/Form/src/hooks/useFormEvents.ts @@ -46,7 +46,9 @@ export function useFormEvents({ const isInput = schema?.component && defaultValueComponents.includes(schema.component); const isSubForm = schema?.component && arrayValueComponents.includes(schema.component); - if (isSubForm) { + if (schema?.clearOnReset) { + formModel[key] = undefined; + } else if (isSubForm) { formModel[key] = []; } else if (isInput) { formModel[key] = defaultValueRef.value[key] || ''; diff --git a/src/components/Form/src/types/index.ts b/src/components/Form/src/types/index.ts index 1aa2fbf..9366893 100644 --- a/src/components/Form/src/types/index.ts +++ b/src/components/Form/src/types/index.ts @@ -171,6 +171,7 @@ export interface SubFormColumn extends ColumnProps { componentType?: ComponentType; rules?: Rule[]; defaultValue?: any; + clearOnReset?: boolean; fieldMapToTime?: FieldMapToTime; //RangerPick组件特有 // Render the content in the form-item tag render?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string; diff --git a/src/components/common/contractSalesPngPurPointModal.vue b/src/components/common/contractSalesPngPurPointModal.vue index 8c3b426..5f9dfc5 100644 --- a/src/components/common/contractSalesPngPurPointModal.vue +++ b/src/components/common/contractSalesPngPurPointModal.vue @@ -128,7 +128,7 @@ loadData() } const onReset = () => { - dateArr.value = [dayjs(props.defaultDate[0]), dayjs(props.defaultDate[1])] + dateArr.value = [] pagination.current = 1 loadData() } diff --git a/src/components/common/contractSalesPngPurPointTcModal.vue b/src/components/common/contractSalesPngPurPointTcModal.vue index 7ff6c63..e56b982 100644 --- a/src/components/common/contractSalesPngPurPointTcModal.vue +++ b/src/components/common/contractSalesPngPurPointTcModal.vue @@ -128,7 +128,7 @@ loadData() } const onReset = () => { - dateArr.value = [dayjs(props.defaultDate[0]), dayjs(props.defaultDate[1])] + dateArr.value = [] pagination.current = 1 loadData() } diff --git a/src/views/approve/Appro/index.vue b/src/views/approve/Appro/index.vue index 26b9cd6..774a8c1 100644 --- a/src/views/approve/Appro/index.vue +++ b/src/views/approve/Appro/index.vue @@ -130,7 +130,8 @@ field: 'dateAppro', label: '拟稿日期', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/contract/ContractFact/index.vue b/src/views/contract/ContractFact/index.vue index b15fe19..7af6e53 100644 --- a/src/views/contract/ContractFact/index.vue +++ b/src/views/contract/ContractFact/index.vue @@ -134,7 +134,8 @@ field: 'dateFrom', label: '有效期', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/contract/ContractPurLng/index.vue b/src/views/contract/ContractPurLng/index.vue index 428d09b..8ea94dd 100644 --- a/src/views/contract/ContractPurLng/index.vue +++ b/src/views/contract/ContractPurLng/index.vue @@ -124,7 +124,7 @@ }, schemas: customSearchFormSchema, fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']], - showResetButton: false, + showResetButton: true, }, beforeFetch: (params) => { return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit}; @@ -527,4 +527,7 @@ :deep(.ant-col-8:nth-child(5) .ant-select-selector) { width: 172px !important; } + :deep(.ant-col-8:nth-child(3) .ant-form-item-label) { + width: 80px !important; + } \ No newline at end of file diff --git a/src/views/contract/ContractSalesPngPur/index.vue b/src/views/contract/ContractSalesPngPur/index.vue index 423b3ee..c0f11ca 100644 --- a/src/views/contract/ContractSalesPngPur/index.vue +++ b/src/views/contract/ContractSalesPngPur/index.vue @@ -29,9 +29,7 @@ const logId = ref('') const logPath = ref('/contract/contractSalesPngPur/datalog'); import { DataLog } from '/@/components/pcitc'; - import { ref, computed, onMounted, onUnmounted, - -} from 'vue'; + import { ref, computed, onMounted, onUnmounted } from 'vue'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { getLngContractSalesPngPointPage, deleteLngContractSalesPngPoint} from '/@/api/contract/ContractSalesPngPur'; @@ -106,6 +104,7 @@ label: '销售合同有效期', component: 'RangePicker', defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/dayPlan/Demand/index.vue b/src/views/dayPlan/Demand/index.vue index 62f7be1..7901282 100644 --- a/src/views/dayPlan/Demand/index.vue +++ b/src/views/dayPlan/Demand/index.vue @@ -148,7 +148,8 @@ field: 'datePlan', label: '计划日期', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/dayPlan/PngApproJsz/index.vue b/src/views/dayPlan/PngApproJsz/index.vue index 6ae6cba..3ed6612 100644 --- a/src/views/dayPlan/PngApproJsz/index.vue +++ b/src/views/dayPlan/PngApproJsz/index.vue @@ -121,7 +121,8 @@ field: 'datePlan', label: '计划日期', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/ship/MeaPurInt/index.vue b/src/views/ship/MeaPurInt/index.vue index 6c245d9..3e12e18 100644 --- a/src/views/ship/MeaPurInt/index.vue +++ b/src/views/ship/MeaPurInt/index.vue @@ -105,7 +105,8 @@ field: 'dateMea', label: '计量日期', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/ship/OpsPurInt/index.vue b/src/views/ship/OpsPurInt/index.vue index 17d2df8..126378e 100644 --- a/src/views/ship/OpsPurInt/index.vue +++ b/src/views/ship/OpsPurInt/index.vue @@ -107,7 +107,8 @@ field: 'dateEta', label: '卸港ETA', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/ship/OpsSalesInt/index.vue b/src/views/ship/OpsSalesInt/index.vue index 025f35c..935606d 100644 --- a/src/views/ship/OpsSalesInt/index.vue +++ b/src/views/ship/OpsSalesInt/index.vue @@ -104,7 +104,8 @@ field: 'dateEta', label: '卸港ETA', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' }, diff --git a/src/views/ship/ShipSchedule/index.vue b/src/views/ship/ShipSchedule/index.vue index 3eba715..747c50a 100644 --- a/src/views/ship/ShipSchedule/index.vue +++ b/src/views/ship/ShipSchedule/index.vue @@ -115,7 +115,8 @@ field: 'dateEta', label: '卸港ETA', component: 'RangePicker', - defaultValue: defaultDate.value, + defaultValue: defaultDate.value, + clearOnReset: true, componentProps: { format: 'YYYY-MM-DD', style: { width: '100%' },