|
@@ -1,36 +1,46 @@
|
|
<template>
|
|
<template>
|
|
- <FullCalendar
|
|
|
|
- ref="fullCalendar"
|
|
|
|
- :options="calendarOptions"
|
|
|
|
- class="calendar"
|
|
|
|
- id="calendar"
|
|
|
|
- />
|
|
|
|
|
|
+ <FullCalendar :options="calendarOptions" class="calendar" id="calendar" />
|
|
|
|
|
|
- <!-- 修改框 -->
|
|
|
|
|
|
+ <!-- 备注修改框 -->
|
|
<el-dialog title="修改订单" center v-model="Visible">
|
|
<el-dialog title="修改订单" center v-model="Visible">
|
|
<el-form :model="form" label-width="auto" style="max-width: 600px">
|
|
<el-form :model="form" label-width="auto" style="max-width: 600px">
|
|
<el-form-item label="备注名称">
|
|
<el-form-item label="备注名称">
|
|
<el-input v-model="form.name" />
|
|
<el-input v-model="form.name" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="时间">
|
|
<el-form-item label="时间">
|
|
- <el-col :span="11">
|
|
|
|
|
|
+ <el-date-picker
|
|
|
|
+ :span="11"
|
|
|
|
+ v-model="form.date"
|
|
|
|
+ type="daterange"
|
|
|
|
+ range-separator="To"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ format="YYYY/MM/DD"
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
+ />
|
|
|
|
+ <!--
|
|
|
|
+ <el-col>
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="form.date1"
|
|
v-model="form.date1"
|
|
type="date"
|
|
type="date"
|
|
placeholder="日期"
|
|
placeholder="日期"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
+ format="YYYY/MM/DD"
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="2" class="text-center">
|
|
|
|
- <span class="text-gray-500">-</span>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="11">
|
|
|
|
- <el-time-picker
|
|
|
|
|
|
+
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-time-select
|
|
v-model="form.date2"
|
|
v-model="form.date2"
|
|
placeholder="详细时刻"
|
|
placeholder="详细时刻"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
+ start="00:00"
|
|
|
|
+ step="01:00"
|
|
|
|
+ end="24:00"
|
|
/>
|
|
/>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="类型">
|
|
<el-form-item label="类型">
|
|
<el-checkbox-group v-model="form.type">
|
|
<el-checkbox-group v-model="form.type">
|
|
@@ -40,21 +50,37 @@
|
|
<el-checkbox value="4" name="type"> 4 </el-checkbox>
|
|
<el-checkbox value="4" name="type"> 4 </el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="测试">
|
|
|
|
|
|
+ <el-form-item label="具体时间">
|
|
<el-radio-group v-model="form.resource">
|
|
<el-radio-group v-model="form.resource">
|
|
- <el-radio value="Sponsor">test1</el-radio>
|
|
|
|
- <el-radio value="Venue">test2</el-radio>
|
|
|
|
|
|
+ <el-radio value="yes">是</el-radio>
|
|
|
|
+ <el-radio value="no">否</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="详细信息">
|
|
<el-form-item label="详细信息">
|
|
<el-input v-model="form.desc" type="textarea" />
|
|
<el-input v-model="form.desc" type="textarea" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" @click="this.Visible = false">确定</el-button>
|
|
|
|
- <el-button @click="this.Visible = false" style="">取消</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="confirm">确定</el-button>
|
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 对备注进行操作 -->
|
|
|
|
+ <el-dialog title="备注信息修改" center v-model="changeInfo">
|
|
|
|
+ <el-form-item label="操作">
|
|
|
|
+ <el-radio-group v-model="operateSelect">
|
|
|
|
+ <el-radio value="delete">删除备注</el-radio>
|
|
|
|
+ <el-radio value="edit">修改备注</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="operate(this.operateSelect)"
|
|
|
|
+ >确定</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button @click="operateCancel">取消</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-dialog>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import FullCalendar from "@fullcalendar/vue3";
|
|
import FullCalendar from "@fullcalendar/vue3";
|
|
@@ -65,23 +91,24 @@ import listPlugin from "@fullcalendar/list";
|
|
import multiMonthPlugin from "@fullcalendar/multimonth";
|
|
import multiMonthPlugin from "@fullcalendar/multimonth";
|
|
import bootstrap5Plugin from "@fullcalendar/bootstrap5";
|
|
import bootstrap5Plugin from "@fullcalendar/bootstrap5";
|
|
|
|
|
|
-import tippy from "tippy.js"; //引入 tippy.js
|
|
|
|
-import 'tippy.js/dist/tippy.css'; //引入 tippy.js
|
|
|
|
-import 'tippy.js/themes/light.css'; //引入主题
|
|
|
|
-import 'tippy.js/animations/scale.css';
|
|
|
|
|
|
+import tippy from "tippy.js"; //引入 tippy.js
|
|
|
|
+import "tippy.js/dist/tippy.css"; //引入 tippy.js
|
|
|
|
+import "tippy.js/themes/light.css"; //引入主题
|
|
|
|
+import "tippy.js/animations/scale.css";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
//import引入的组件需要注入到对象中才能使用
|
|
//import引入的组件需要注入到对象中才能使用
|
|
components: { FullCalendar },
|
|
components: { FullCalendar },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- Visible: false,
|
|
|
|
|
|
+ Visible: false, // 是否显示添加备注框
|
|
|
|
+ changeInfo: false, // 是否显示备注日程修改框
|
|
|
|
+ operateSelect: "",
|
|
|
|
+ GetInfo: "",
|
|
|
|
+ // 备注信息
|
|
form: {
|
|
form: {
|
|
name: "",
|
|
name: "",
|
|
- region: "",
|
|
|
|
- date1: "",
|
|
|
|
- date2: "",
|
|
|
|
- delivery: false,
|
|
|
|
|
|
+ date: "",
|
|
type: [],
|
|
type: [],
|
|
resource: "",
|
|
resource: "",
|
|
desc: "",
|
|
desc: "",
|
|
@@ -103,6 +130,7 @@ export default {
|
|
unselectAuto: true, //当点击页⾯⽇历以外的位置时,是否⾃动取消当前的选中状态。false是不取消
|
|
unselectAuto: true, //当点击页⾯⽇历以外的位置时,是否⾃动取消当前的选中状态。false是不取消
|
|
selectable: true, //是否可以选中日历格
|
|
selectable: true, //是否可以选中日历格
|
|
editable: true,
|
|
editable: true,
|
|
|
|
+ dayMaxEventRows: 2, //允许事件堆叠,但不超过设定的行数
|
|
|
|
|
|
buttonText: {
|
|
buttonText: {
|
|
prev: "上一页",
|
|
prev: "上一页",
|
|
@@ -114,12 +142,18 @@ export default {
|
|
list: "周列表",
|
|
list: "周列表",
|
|
},
|
|
},
|
|
headerToolbar: {
|
|
headerToolbar: {
|
|
- left: "prev,next today",
|
|
|
|
|
|
+ left: "prev,next today addEventButton",
|
|
center: "title",
|
|
center: "title",
|
|
right:
|
|
right:
|
|
"dayGridYear,multiMonthYearGrid,multiMonthYearStack,dayGridMonth,timeGridWeek,timeGridDay listWeek",
|
|
"dayGridYear,multiMonthYearGrid,multiMonthYearStack,dayGridMonth,timeGridWeek,timeGridDay listWeek",
|
|
themeSystem: "bootstrap5",
|
|
themeSystem: "bootstrap5",
|
|
},
|
|
},
|
|
|
|
+ customButtons: {
|
|
|
|
+ addEventButton: {
|
|
|
|
+ text: "添加备注",
|
|
|
|
+ click: this.addThings,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
views: {
|
|
views: {
|
|
multiMonthYearGrid: {
|
|
multiMonthYearGrid: {
|
|
type: "multiMonthYear",
|
|
type: "multiMonthYear",
|
|
@@ -152,7 +186,7 @@ export default {
|
|
title: "五一劳动节放假",
|
|
title: "五一劳动节放假",
|
|
start: "2024-05-01",
|
|
start: "2024-05-01",
|
|
end: "2024-05-06",
|
|
end: "2024-05-06",
|
|
- color: "#ffcc99",
|
|
|
|
|
|
+ color: "green",
|
|
editable: true, //允许拖动缩放
|
|
editable: true, //允许拖动缩放
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -163,15 +197,32 @@ export default {
|
|
color: "#ffcc99",
|
|
color: "#ffcc99",
|
|
editable: true,
|
|
editable: true,
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ id: 1,
|
|
|
|
+ title: "Meeting",
|
|
|
|
+ start: "2024-06-12T10:30:00",
|
|
|
|
+ end: "2024-06-12T12:30:00",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 2,
|
|
|
|
+ title: "Lunch",
|
|
|
|
+ start: "2024-06-12T12:00:00",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 3,
|
|
|
|
+ title: "Meeting",
|
|
|
|
+ start: "2024-06-12T14:30:00",
|
|
|
|
+ },
|
|
], //背景色 (添加相同时间的背景色时颜色会重叠)
|
|
], //背景色 (添加相同时间的背景色时颜色会重叠)
|
|
- datesSet: this.datesSet, //日期渲染;修改日期范围后触发 ------显示时间事件
|
|
|
|
- eventMouseEnter: this.handleEventMouseEnter, //悬浮至日程触发 ------hover下拉框事件
|
|
|
|
- eventDrop: this.calendarEventDropOrResize, //拖动事件触发 ------备注修改事件
|
|
|
|
- eventResize: this.calendarEventDropOrResize, //缩放事件触发 ------备注修改事件
|
|
|
|
- eventClick: this.hoverE, //点击日程触发 ------编辑事件
|
|
|
|
- select: this.deleteInfo, //拖拽多个方格触发 ------编辑事件 会与dateClick同时触发 待考虑
|
|
|
|
|
|
+ datesSet: this.datesSet, //日期渲染;修改日期范围后触发 ------显示时间事件
|
|
|
|
+ eventMouseEnter: this.handleEventMouseEnter, //悬浮至日程触发 ------hover下拉框事件
|
|
|
|
+ eventDrop: this.calendarEventDropOrResize, //拖动事件触发 ------备注修改事件
|
|
|
|
+ eventResize: this.calendarEventDropOrResize, //缩放事件触发 ------备注修改事件
|
|
|
|
+ eventClick: this.remarkControl, //点击日程触发 ------编辑事件
|
|
|
|
+ select: this.deleteInfo, //拖拽多个方格触发 ------编辑事件
|
|
|
|
|
|
- displayEventTime: false, //不显示具体时间
|
|
|
|
|
|
+ displayEventTime: true, //不显示具体时间
|
|
themeSystem: "bootstrap5",
|
|
themeSystem: "bootstrap5",
|
|
aspectRatio: 1.2, //宽高比
|
|
aspectRatio: 1.2, //宽高比
|
|
},
|
|
},
|
|
@@ -187,6 +238,7 @@ export default {
|
|
console.log(info);
|
|
console.log(info);
|
|
},
|
|
},
|
|
calendarEventDropOrResize(e) {
|
|
calendarEventDropOrResize(e) {
|
|
|
|
+ console.log(e);
|
|
const index = this.calendarOptions.events.findIndex(
|
|
const index = this.calendarOptions.events.findIndex(
|
|
(item) => item.id == e.event.id
|
|
(item) => item.id == e.event.id
|
|
);
|
|
);
|
|
@@ -196,36 +248,105 @@ export default {
|
|
},
|
|
},
|
|
// 鼠标悬浮至日历触发事件
|
|
// 鼠标悬浮至日历触发事件
|
|
handleEventMouseEnter(e) {
|
|
handleEventMouseEnter(e) {
|
|
- console.log(e);
|
|
|
|
- new tippy(e.el,{
|
|
|
|
- content:e.event.title,
|
|
|
|
- theme: 'tomato',
|
|
|
|
|
|
+ new tippy(e.el, {
|
|
|
|
+ content:
|
|
|
|
+ e.event.title +
|
|
|
|
+ "<br>From:" +
|
|
|
|
+ e.event.startStr +
|
|
|
|
+ "<br>" +
|
|
|
|
+ e.event.endStr,
|
|
|
|
+ theme: "tomato",
|
|
allowHTML: true,
|
|
allowHTML: true,
|
|
- })
|
|
|
|
- console.log(1111);
|
|
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 备注日程修改
|
|
|
|
+ remarkControl(e) {
|
|
|
|
+ this.GetInfo = e;
|
|
|
|
+ this.changeInfo = true;
|
|
|
|
+ },
|
|
|
|
+ // 备注日程修改取消
|
|
|
|
+ operateCancel(){
|
|
|
|
+ this.GetInfo = "";
|
|
|
|
+ this.changeInfo = false
|
|
},
|
|
},
|
|
- // 点击到日期表格触发事件
|
|
|
|
- handleDateClick() {
|
|
|
|
- console.log(222);
|
|
|
|
|
|
+ // 拖拽表格时获取点击的起止时间
|
|
|
|
+ deleteInfo(e) {
|
|
|
|
+ this.Visible = true;
|
|
|
|
+ this.form.date = [e.startStr, e.endStr];
|
|
},
|
|
},
|
|
- hoverE() {
|
|
|
|
- console.log("----------------------------");
|
|
|
|
|
|
+ // 添加备注
|
|
|
|
+ addThings() {
|
|
|
|
+ this.Visible = true;
|
|
},
|
|
},
|
|
- deleteInfo() {
|
|
|
|
- this.$confirm("是否进行修改编辑, 是否继续?", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning",
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- this.Visible = true;
|
|
|
|
|
|
+ // 确认添加备注事件
|
|
|
|
+ confirm() {
|
|
|
|
+ this.Visible = false;
|
|
|
|
+ // 将备注加入日历中
|
|
|
|
+ this.calendarOptions.events.push({
|
|
|
|
+ id: this.GetInfo == null || this.GetInfo =="" ? this.form.date[0] : this.GetInfo.event.id,
|
|
|
|
+ title: this.form.name,
|
|
|
|
+ start: this.form.date[0],
|
|
|
|
+ end: this.form.date[1],
|
|
|
|
+ });
|
|
|
|
+ this.form = {
|
|
|
|
+ name: "",
|
|
|
|
+ date: "",
|
|
|
|
+ type: [],
|
|
|
|
+ resource: "",
|
|
|
|
+ desc: "",
|
|
|
|
+ };
|
|
|
|
+ this.GetInfo=""
|
|
|
|
+ },
|
|
|
|
+ // 取消添加备注
|
|
|
|
+ cancel() {
|
|
|
|
+ this.form = {
|
|
|
|
+ name: "",
|
|
|
|
+ date: "",
|
|
|
|
+ type: [],
|
|
|
|
+ resource: "",
|
|
|
|
+ desc: "",
|
|
|
|
+ };
|
|
|
|
+ this.Visible = false;
|
|
|
|
+ },
|
|
|
|
+ // 进行操作选中
|
|
|
|
+ operate(value) {
|
|
|
|
+ this.changeInfo = false;
|
|
|
|
+ if (value == "delete") {
|
|
|
|
+ this.$confirm("是否删除当前备注, 是否继续?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
})
|
|
})
|
|
- .catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: "info",
|
|
|
|
- message: "已取消删除",
|
|
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.GetInfo=""
|
|
|
|
+ console.log(this.calendarOptions.events);
|
|
|
|
+ const idx = this.calendarOptions.events.findIndex(
|
|
|
|
+ (item) => item.id == this.GetInfo.event.id
|
|
|
|
+ );
|
|
|
|
+ this.calendarOptions.events.splice(idx, 1);
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "已删除",
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.GetInfo=""
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "已取消删除",
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.Visible = true;
|
|
|
|
+ this.form = {
|
|
|
|
+ name: this.GetInfo.event.title,
|
|
|
|
+ date: [this.GetInfo.event.startStr,this.GetInfo.event.endStr],
|
|
|
|
+ type: [],
|
|
|
|
+ resource: "",
|
|
|
|
+ desc: ""
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|