no message
This commit is contained in:
@@ -37,9 +37,11 @@
|
||||
|
||||
<div class="time-box item-input-box flexacenter">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-date-picker v-model="info.deadline" type="date" placeholder="请选择" size="large" class="flex1 flexacenter" :clear-icon="{}" value-format="YYYY-MM-DD" :disabled-date="setDisabled" />
|
||||
<el-date-picker ref="pickerRef" v-model="info.deadline" type="date" placeholder="请选择" size="large" class="flex1 flexacenter" :clear-icon="{}" value-format="YYYY-MM-DD" :disabled-date="setDisabled" />
|
||||
</el-config-provider>
|
||||
<img class="calendar-icon" src="@/assets/img/calendar-icon.svg" />
|
||||
<div class="flexacenter">
|
||||
<img class="calendar-icon" @click="handlePicker" src="@/assets/img/calendar-icon.svg" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,7 +124,15 @@ import Sortable from "sortablejs"
|
||||
const router = useRouter()
|
||||
const goLogin = inject("goLogin")
|
||||
const setDisabled = time => {
|
||||
return time.getTime() < Date.now() // 可选历史天、可选当前天、不可选未来天
|
||||
// return time.getTime() < Date.now() // 可选历史天、可选当前天、不可选未来天
|
||||
const today = new Date()
|
||||
const tomorrow = new Date(today)
|
||||
tomorrow.setDate(today.getDate())
|
||||
|
||||
const thirtyDaysLater = new Date(today)
|
||||
thirtyDaysLater.setDate(today.getDate() + 29)
|
||||
|
||||
return time < tomorrow || time > thirtyDaysLater
|
||||
}
|
||||
|
||||
onMounted(() => {})
|
||||
@@ -190,6 +200,16 @@ const submit = (status = 1) => {
|
||||
return
|
||||
}
|
||||
|
||||
const hash = {}
|
||||
for (let i = 0; i < option.length; i++) {
|
||||
if (hash[option[i]]) {
|
||||
ElMessage.error("选项名称不能重复")
|
||||
loading = false
|
||||
return // 有重复值
|
||||
}
|
||||
hash[option[i]] = true
|
||||
}
|
||||
|
||||
option.push("不懂,围观学习")
|
||||
}
|
||||
|
||||
@@ -239,11 +259,16 @@ const getinit = () => {
|
||||
const data = res.data
|
||||
// data.info.option = []
|
||||
const option = data.info?.option || []
|
||||
|
||||
if (option.length == 0) {
|
||||
for (let index = 0; index < 2; index++) {
|
||||
optionList.value.push({ id: index, message: "" })
|
||||
}
|
||||
} else {
|
||||
while (option.length < 2) {
|
||||
option.push(null)
|
||||
}
|
||||
|
||||
option.forEach((message, index) => {
|
||||
optionList.value.push({ id: index, message })
|
||||
})
|
||||
@@ -321,6 +346,11 @@ const deleteOption = index => {
|
||||
const clearMessage = index => {
|
||||
optionList.value[index]["message"] = ""
|
||||
}
|
||||
|
||||
let pickerRef = ref(null)
|
||||
const handlePicker = () => {
|
||||
pickerRef.value.handleOpen()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@@ -417,9 +447,9 @@ const clearMessage = index => {
|
||||
|
||||
.time-box {
|
||||
.calendar-icon {
|
||||
width: 15px;
|
||||
height: 16px;
|
||||
margin: 0 12px;
|
||||
width: 17px;
|
||||
// height: 16px;
|
||||
margin: 0 9px;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
@@ -540,6 +570,7 @@ const clearMessage = index => {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
margin-bottom: 50px;
|
||||
// max-width: max-content;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user