日历-左上角年份,弹窗右上角x,优化打开多个弹窗可分别关闭对应.
This commit is contained in:
parent
f3bf65cbaf
commit
05a497c40a
@ -1,13 +1,21 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<span style="font-size: 24px">
|
||||
{{currentYear}} 年
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button-group style="display: flex; justify-content: space-between;">
|
||||
<el-button size="large" @click="selectDate(-1)">上年</el-button>
|
||||
<el-button size="large" @click="toYear()">今年</el-button>
|
||||
<el-button size="large" @click="selectDate(1)">下年</el-button>
|
||||
<el-button size="large" @click="getListDate()">刷新</el-button>
|
||||
<!-- <el-button size="small" @click="createDate()">创建</el-button>-->
|
||||
<!-- <el-button size="small" @click="createDate()">创建</el-button>-->
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="loading" :gutter="10">
|
||||
<el-col v-for="(month, index) in months" :key="index" :span="6" >
|
||||
@ -40,9 +48,18 @@
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 右上角关闭按钮 -->
|
||||
<el-button
|
||||
type="text"
|
||||
style="position: absolute; top: 2px; right: 10px; padding: 0;"
|
||||
@click="closePopover(data)"
|
||||
>
|
||||
<el-icon class="el-icon--right"><Close /></el-icon>
|
||||
</el-button>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formDataCaln"
|
||||
style="margin-top: 20px"
|
||||
label-width="70px"
|
||||
>
|
||||
<el-form-item label="状态" >
|
||||
@ -67,7 +84,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button size="small" @click="submitForm();" type="primary">确定</el-button>
|
||||
<el-button size="small" @click="submitForm(data);" type="primary">确定</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
|
||||
@ -83,6 +100,7 @@
|
||||
import {CalendarInstance} from "element-plus";
|
||||
import {CalendarApi, CalendarVO} from "@/api/home/calendar";
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import {Close} from "@element-plus/icons-vue";
|
||||
|
||||
defineOptions({ name: 'CalendarAgendaIndex' })
|
||||
|
||||
@ -201,7 +219,9 @@ const handleSelect = async (date:any) => {
|
||||
};
|
||||
|
||||
//提交更改
|
||||
const submitForm = async ()=> {
|
||||
const submitForm = async (date:any)=> {
|
||||
// 判断更改是否符合
|
||||
await getDate(date);
|
||||
const dataClan = formDataCaln.value as unknown as CalendarVO
|
||||
// 更新后台数据
|
||||
try {
|
||||
@ -219,7 +239,14 @@ const submitForm = async ()=> {
|
||||
// 关闭弹窗
|
||||
updatedHoliday.visible = false;
|
||||
}
|
||||
|
||||
const closePopover = async (date:any)=> {
|
||||
// 判断更改是否符合
|
||||
await getDate(date);
|
||||
//获取选择日期
|
||||
const updatedHoliday = holidayDate.value[sDate.value];
|
||||
// 关闭弹窗
|
||||
updatedHoliday.visible = false;
|
||||
}
|
||||
// 获取日期时间 年月日
|
||||
function formatDate2(dat: number|Date) {
|
||||
const date = new Date(dat)
|
||||
|
Loading…
Reference in New Issue
Block a user