|
@@ -9,7 +9,7 @@
|
|
|
@before-open="modalBeforeOpen"
|
|
|
>
|
|
|
<a-form ref="formRef" :model="formData" auto-label-width>
|
|
|
- <a-form-item label="添加方式">
|
|
|
+ <a-form-item label="添加方式" required>
|
|
|
<a-radio-group v-model="formData.type" @change="typeChange">
|
|
|
<a-radio value="simple">简单创建</a-radio>
|
|
|
<a-radio value="loop">循环创建</a-radio>
|
|
@@ -27,7 +27,11 @@
|
|
|
},
|
|
|
]"
|
|
|
>
|
|
|
- <select-range-datetime v-model="formData.date" :show-time="false">
|
|
|
+ <select-range-datetime
|
|
|
+ v-model="formData.date"
|
|
|
+ :show-time="false"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ >
|
|
|
</select-range-datetime>
|
|
|
</a-form-item>
|
|
|
|
|
@@ -41,17 +45,27 @@
|
|
|
message: '请选择时间',
|
|
|
},
|
|
|
]"
|
|
|
+ :label="index + 1 + ''"
|
|
|
>
|
|
|
- <select-range-time v-if="IS_LOOP" v-model="formData.times[index]">
|
|
|
+ <select-range-time
|
|
|
+ v-if="IS_LOOP"
|
|
|
+ v-model="formData.times[index]"
|
|
|
+ disable-confirm
|
|
|
+ :style="{ width: '256px' }"
|
|
|
+ >
|
|
|
</select-range-time>
|
|
|
<select-range-datetime v-else v-model="formData.times[index]">
|
|
|
</select-range-datetime>
|
|
|
- <a-button class="ml-10" type="primary" @click="toAdd(index)">
|
|
|
+ <a-button class="ml-10" @click="toAdd(index)">
|
|
|
<template #icon>
|
|
|
- <svg-icon name="icon-add"></svg-icon>
|
|
|
+ <icon-plus />
|
|
|
</template>
|
|
|
</a-button>
|
|
|
- <a-button status="danger" @click="toDelete(index)">
|
|
|
+ <a-button
|
|
|
+ status="danger"
|
|
|
+ :disabled="formData.times.length === 1"
|
|
|
+ @click="toDelete(index)"
|
|
|
+ >
|
|
|
<template #icon>
|
|
|
<svg-icon name="icon-delete"></svg-icon>
|
|
|
</template>
|
|
@@ -71,6 +85,7 @@
|
|
|
import type { FormInstance } from '@arco-design/web-vue/es/form';
|
|
|
import useModal from '@/hooks/modal';
|
|
|
import { formatDate, objModifyAssign } from '@/utils/utils';
|
|
|
+ import { Message } from '@arco-design/web-vue';
|
|
|
|
|
|
defineOptions({
|
|
|
name: 'AddTimes',
|
|
@@ -114,6 +129,10 @@
|
|
|
}
|
|
|
|
|
|
function toDelete(index: number) {
|
|
|
+ if (formData.times.length <= 1) {
|
|
|
+ Message.error('不可再删除!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
formData.times.splice(index, 1);
|
|
|
}
|
|
|
|