fix: todo
This commit is contained in:
@@ -58,18 +58,22 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '详细地址',
|
||||
rules: 'required',
|
||||
},
|
||||
// TODO @xingyu:时间类型不对
|
||||
{
|
||||
component: 'TimePicker',
|
||||
fieldName: 'openingTime',
|
||||
label: '营业开始时间',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'TimePicker',
|
||||
fieldName: 'closingTime',
|
||||
label: '营业结束时间',
|
||||
component: 'TimeRangePicker',
|
||||
fieldName: 'rangeTime',
|
||||
label: '营业时间',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
format: 'HH:mm',
|
||||
minuteStep: 15,
|
||||
disabledTime: () => {
|
||||
return {
|
||||
disabledHours: () => {
|
||||
return [0, 1, 2, 3, 4, 5, 6, 7];
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
|
||||
@@ -18,7 +18,6 @@ import { useBindFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<MallDeliveryPickUpStoreApi.PickUpStore>();
|
||||
// TODO @xingyu:店员是多选;
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['绑定店员'])
|
||||
|
||||
@@ -6,6 +6,7 @@ import { computed, ref } from 'vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
@@ -33,6 +34,7 @@ const [Form, formApi] = useVbenForm({
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 120,
|
||||
},
|
||||
fieldMappingTime: [['rangeTime', ['openingTime', 'closingTime'], 'HH:mm']],
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
@@ -73,6 +75,10 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getDeliveryPickUpStore(data.id);
|
||||
formData.value.rangeTime = [
|
||||
dayjs(formData.value.openingTime, 'HH:mm'),
|
||||
dayjs(formData.value.closingTime, 'HH:mm'),
|
||||
];
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user