feat: 只有PENDING可以修改开始时间&结束时间必须大于之前
This commit is contained in:
@@ -230,7 +230,7 @@
|
|||||||
endTime: endDate,
|
endTime: endDate,
|
||||||
startTime: startDate,
|
startTime: startDate,
|
||||||
ids: ids,
|
ids: ids,
|
||||||
email: this.email.trim(),
|
email: this.email?.trim(),
|
||||||
organizationName: this.organizationName,
|
organizationName: this.organizationName,
|
||||||
};
|
};
|
||||||
Https.axiosGet(Https.httpUrls.getDesignStatistic, {
|
Https.axiosGet(Https.httpUrls.getDesignStatistic, {
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export default defineComponent({
|
|||||||
changeEvent:this.changeEvent,
|
changeEvent:this.changeEvent,
|
||||||
size:this.pageSize,
|
size:this.pageSize,
|
||||||
page:this.currentPage,
|
page:this.currentPage,
|
||||||
email:this.email.trim(),
|
email:this.email?.trim(),
|
||||||
}
|
}
|
||||||
Https.axiosPost(Https.httpUrls.getGenerateFrequency,data).then((rv: any) => {
|
Https.axiosPost(Https.httpUrls.getGenerateFrequency,data).then((rv: any) => {
|
||||||
if (rv) {
|
if (rv) {
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ export default defineComponent({
|
|||||||
page: filterData.currentPage,
|
page: filterData.currentPage,
|
||||||
systemUser: filterData.systemUser,
|
systemUser: filterData.systemUser,
|
||||||
country: filterData.country,
|
country: filterData.country,
|
||||||
email: filterData.email.trim(),
|
email: filterData.email?.trim(),
|
||||||
userType: filterData.userType,
|
userType: filterData.userType,
|
||||||
ids: filterData.ids,
|
ids: filterData.ids,
|
||||||
occupation: filterData.occupation,
|
occupation: filterData.occupation,
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
<a-form-item label="ID">
|
<a-form-item label="ID">
|
||||||
<a-input v-model:value="searchForm.id" allow-clear placeholder="Input the id" />
|
<a-input v-model:value="searchForm.id" allow-clear placeholder="Input the id" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="Name">
|
<!-- <a-form-item label="Name">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="searchForm.name"
|
v-model:value="searchForm.name"
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="Input the name"
|
placeholder="Input the name"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item> -->
|
||||||
<a-form-item label="Time Range">
|
<a-form-item label="Time Range">
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
v-model:value="searchForm.dateRange"
|
v-model:value="searchForm.dateRange"
|
||||||
@@ -255,6 +255,7 @@
|
|||||||
<a-date-picker
|
<a-date-picker
|
||||||
v-model:value="formState.currentPeriodStart"
|
v-model:value="formState.currentPeriodStart"
|
||||||
value-format="X"
|
value-format="X"
|
||||||
|
:disabled="isEditMode && formState.status !== 'PENDING'"
|
||||||
style="width: 250px"
|
style="width: 250px"
|
||||||
:disabledDate="disabledDate"
|
:disabledDate="disabledDate"
|
||||||
:show-time="{ format: 'HH:mm' }"
|
:show-time="{ format: 'HH:mm' }"
|
||||||
@@ -275,7 +276,9 @@
|
|||||||
v-model:value="formState.currentPeriodEnd"
|
v-model:value="formState.currentPeriodEnd"
|
||||||
value-format="X"
|
value-format="X"
|
||||||
:show-time="{ format: 'HH:mm' }"
|
:show-time="{ format: 'HH:mm' }"
|
||||||
:disabledDate="disabledDate"
|
:disabledDate="disableEndDate"
|
||||||
|
:disabledTime="disableEndTime"
|
||||||
|
:show-now="!isEditMode"
|
||||||
style="width: 250px"
|
style="width: 250px"
|
||||||
class="range_picker"
|
class="range_picker"
|
||||||
placeholder="Select the end time"
|
placeholder="Select the end time"
|
||||||
@@ -418,10 +421,6 @@ interface SubscriptionPlan {
|
|||||||
endStamp: number
|
endStamp: number
|
||||||
}
|
}
|
||||||
|
|
||||||
const disabledDate = (current: Dayjs) => {
|
|
||||||
return current && current < dayjs().subtract(1, 'days').endOf('day')
|
|
||||||
}
|
|
||||||
|
|
||||||
const countryList = ref([])
|
const countryList = ref([])
|
||||||
const userRef = ref(null)
|
const userRef = ref(null)
|
||||||
|
|
||||||
@@ -492,6 +491,65 @@ const statusOption = ref([
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const disabledDate = (current: Dayjs) => {
|
||||||
|
return current && current < dayjs().subtract(1, 'days').endOf('day')
|
||||||
|
}
|
||||||
|
|
||||||
|
const disableEndDate = (current: Dayjs) => {
|
||||||
|
if (isEditMode.value) {
|
||||||
|
const specificTime = dayjs(formState.currentPeriodEnd)
|
||||||
|
return current && current < dayjs(formState.currentPeriodEnd * 1000).startOf('day')
|
||||||
|
}
|
||||||
|
return disabledDate(current)
|
||||||
|
}
|
||||||
|
const range = (start: number, end: number) => {
|
||||||
|
const result = []
|
||||||
|
for (let i = start; i < end; i++) {
|
||||||
|
result.push(i)
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
const disableEndTime = date => {
|
||||||
|
if (!formState.currentPeriodEnd || !isEditMode.value)
|
||||||
|
return {
|
||||||
|
disabledHours: () => [],
|
||||||
|
disabledMinutes: () => [],
|
||||||
|
disabledSeconds: () => []
|
||||||
|
}
|
||||||
|
|
||||||
|
const specificTime = dayjs.unix(formState.currentPeriodEnd)
|
||||||
|
|
||||||
|
if (date && date.isSame(specificTime, 'day')) {
|
||||||
|
// 如果是指定日期当天,禁用时间戳之前的时间
|
||||||
|
const hour = specificTime.hour()
|
||||||
|
const minute = specificTime.minute()
|
||||||
|
const second = specificTime.second()
|
||||||
|
|
||||||
|
return {
|
||||||
|
disabledHours: () => Array.from({ length: hour }, (_, i) => i), // 禁用小时之前
|
||||||
|
disabledMinutes: selectedHour => {
|
||||||
|
if (selectedHour === hour) {
|
||||||
|
return Array.from({ length: minute }, (_, i) => i) // 同小时,禁用分钟之前
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
disabledSeconds: (selectedHour, selectedMinute) => {
|
||||||
|
if (selectedHour === hour && selectedMinute === minute) {
|
||||||
|
return Array.from({ length: second }, (_, i) => i) // 同小时分钟,禁用秒之前
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
disabledHours: () => [],
|
||||||
|
disabledMinutes: () => [],
|
||||||
|
disabledSeconds: () => []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const normalizeStatus = (status?: string): PlanStatus | undefined => {
|
const normalizeStatus = (status?: string): PlanStatus | undefined => {
|
||||||
if (!status) return undefined
|
if (!status) return undefined
|
||||||
const upper = status.toUpperCase() as PlanStatus
|
const upper = status.toUpperCase() as PlanStatus
|
||||||
@@ -633,7 +691,7 @@ const handleReset = () => {
|
|||||||
searchForm.adminAccId = undefined
|
searchForm.adminAccId = undefined
|
||||||
searchForm.status = []
|
searchForm.status = []
|
||||||
searchForm.id = ''
|
searchForm.id = ''
|
||||||
searchForm.countryOrRegion = ''
|
searchForm.countryOrRegion = null
|
||||||
handleSearch()
|
handleSearch()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -679,7 +737,6 @@ const openEdit = (record: SubscriptionPlan) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (record.adminAccId) {
|
if (record.adminAccId) {
|
||||||
console.log(userRef.value)
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
userRef.value.patchList({
|
userRef.value.patchList({
|
||||||
label: record.name,
|
label: record.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user