--fix 持续时间为非必填

This commit is contained in:
yuping
2023-06-27 14:26:18 +08:00
parent 6dc25ee9f0
commit 4e2ed3c456
4 changed files with 13 additions and 8 deletions

View File

@@ -45,7 +45,7 @@
<span style="margin-right: 3px">持续时间</span>
</div>
<div class="btnbox">
<a-input-number :min="0" :max="999999" :precision="0" style="width: 400px; height: 40px; border-radius: 8px"
<a-input-number :min="0" :max="999999" :precision="0" style="width: 400px; height: 40px; border-radius: 8px" :placeholder="durationText"
v-model:value="formData.activityDuration" />
<span style="color: #999999; margin-left: 8px">分钟</span>
</div>
@@ -133,7 +133,7 @@
</a-drawer>
</template>
<script setup>
import { defineEmits, defineProps, ref } from "vue";
import {computed, defineEmits, defineProps, ref} from "vue";
import { Form, message } from "ant-design-vue";
import dayjs from "dayjs";
import {useResetRef} from "@/utils/useCommon";
@@ -197,6 +197,7 @@ const rulesRef = ref({
});
const { validate } = Form.useForm(formData, rulesRef);
const durationText = computed(() => dateTime.value?.length?dayjs(dateTime.value[1]).diff(dayjs(dateTime.value[0]),'minute'):'请输入持续时间');
const closeDrawer = () => {
visible.value = false