econtrol-tools-calendar 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar.js +260 -249
- package/dist/calendar.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/calendar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Te, ref as j, computed as Z, watch as
|
|
1
|
+
import { defineComponent as Te, ref as j, computed as Z, watch as ne, nextTick as ae, reactive as ze, resolveComponent as A, createElementBlock as N, openBlock as I, createElementVNode as S, createVNode as m, createCommentVNode as O, toDisplayString as T, createBlock as B, withCtx as b, createTextVNode as E, unref as U } from "vue";
|
|
2
2
|
import Fe from "@fullcalendar/vue3";
|
|
3
3
|
import Ae from "@fullcalendar/daygrid";
|
|
4
4
|
import Oe from "@fullcalendar/timegrid";
|
|
@@ -26,8 +26,8 @@ var He = {
|
|
|
26
26
|
},
|
|
27
27
|
weekText: "周",
|
|
28
28
|
allDayText: "全天",
|
|
29
|
-
moreLinkText(
|
|
30
|
-
return "另外 " +
|
|
29
|
+
moreLinkText(C) {
|
|
30
|
+
return "另外 " + C + " 个";
|
|
31
31
|
},
|
|
32
32
|
noEventsText: "没有事件显示"
|
|
33
33
|
};
|
|
@@ -40,13 +40,13 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
40
40
|
}, tt = { class: "detail-label" }, nt = { class: "detail-value" }, at = {
|
|
41
41
|
key: 1,
|
|
42
42
|
class: "detail-item"
|
|
43
|
-
}, rt = { class: "detail-label" }, dt = { class: "detail-value" },
|
|
43
|
+
}, rt = { class: "detail-label" }, dt = { class: "detail-value" }, ot = {
|
|
44
44
|
key: 2,
|
|
45
45
|
class: "detail-item"
|
|
46
|
-
},
|
|
46
|
+
}, it = { class: "detail-label" }, lt = { class: "detail-value" }, st = {
|
|
47
47
|
key: 3,
|
|
48
48
|
class: "detail-item"
|
|
49
|
-
},
|
|
49
|
+
}, ct = { class: "detail-label" }, ut = { class: "detail-value description-text" }, vt = { class: "event-content" }, ft = {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "my-event-marker"
|
|
52
52
|
}, gt = { class: "event-time" }, pt = { class: "event-title" }, mt = {
|
|
@@ -70,16 +70,16 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
70
70
|
events: { default: () => [] }
|
|
71
71
|
},
|
|
72
72
|
emits: ["quickAddSaved", "eventAdded", "eventUpdated", "eventDeleted", "eventsChange", "deviceClick"],
|
|
73
|
-
setup(
|
|
74
|
-
const w =
|
|
75
|
-
id:
|
|
76
|
-
name:
|
|
77
|
-
} : null),
|
|
73
|
+
setup(C, { emit: c }) {
|
|
74
|
+
const w = c, i = C, $ = j(null), V = j(!1), u = j(null), K = j(!1), z = Z(() => i.deviceInfo ? i.deviceInfo : i.deviceId ? {
|
|
75
|
+
id: i.deviceId,
|
|
76
|
+
name: i.deviceId
|
|
77
|
+
} : null), D = Z(() => {
|
|
78
78
|
var e;
|
|
79
|
-
return ((e =
|
|
79
|
+
return ((e = i.userinfo) == null ? void 0 : e.username) || "";
|
|
80
80
|
}), y = Z(() => {
|
|
81
81
|
var e;
|
|
82
|
-
return ((e =
|
|
82
|
+
return ((e = i.userinfo) == null ? void 0 : e.userid) || "";
|
|
83
83
|
}), R = { bg: "#FF0000", border: "#FF0000", name: "红色" }, P = [
|
|
84
84
|
{ bg: "#4A90E2", border: "#4A90E2", name: "蓝色" },
|
|
85
85
|
// 中等蓝色
|
|
@@ -142,11 +142,11 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
142
142
|
{ bg: "#5F9EA0", border: "#5F9EA0", name: "青灰" }
|
|
143
143
|
// 中等青灰色
|
|
144
144
|
];
|
|
145
|
-
function
|
|
145
|
+
function X(e) {
|
|
146
146
|
var a;
|
|
147
147
|
return y.value ? (((a = e.extendedProps) == null ? void 0 : a.organizerId) || "") === y.value : !0;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function re(e) {
|
|
150
150
|
if (e) {
|
|
151
151
|
if (e instanceof Date)
|
|
152
152
|
return e;
|
|
@@ -164,83 +164,94 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
164
164
|
return e;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function de(e) {
|
|
168
168
|
return {
|
|
169
169
|
...e,
|
|
170
|
-
start:
|
|
171
|
-
end:
|
|
170
|
+
start: re(e.start),
|
|
171
|
+
end: re(e.end)
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
const M = j(
|
|
175
|
-
(
|
|
175
|
+
(i.events || []).map((e) => de(e))
|
|
176
176
|
);
|
|
177
|
-
|
|
178
|
-
() =>
|
|
177
|
+
ne(
|
|
178
|
+
() => i.events,
|
|
179
179
|
(e) => {
|
|
180
|
-
M.value = (e || []).map((t) =>
|
|
180
|
+
M.value = (e || []).map((t) => de(t));
|
|
181
181
|
},
|
|
182
182
|
{ deep: !0, immediate: !0 }
|
|
183
|
-
),
|
|
184
|
-
() =>
|
|
183
|
+
), ne(
|
|
184
|
+
[() => i.taskid, W],
|
|
185
185
|
() => {
|
|
186
|
-
$.value &&
|
|
186
|
+
$.value && ae(() => {
|
|
187
187
|
if (!$.value) return;
|
|
188
|
-
const e = $.value.getApi();
|
|
189
|
-
|
|
190
|
-
const r = a.id, d =
|
|
191
|
-
|
|
188
|
+
const e = $.value.getApi(), t = e.getEvents();
|
|
189
|
+
console.log("[Calendar] 更新事件颜色,当前事件数量:", t.length), t.forEach((a) => {
|
|
190
|
+
const r = a.id, d = W.value.find((o) => o.id === r);
|
|
191
|
+
if (d) {
|
|
192
|
+
const o = d.backgroundColor || ee(r), s = d.borderColor || o;
|
|
193
|
+
console.log(`[Calendar] 更新事件 ${r} 颜色:`, o), a.setProp("backgroundColor", o), a.setProp("borderColor", s);
|
|
194
|
+
const l = a.el;
|
|
195
|
+
l && (l.style.backgroundColor = o, l.style.borderColor = s);
|
|
196
|
+
} else {
|
|
197
|
+
const o = ee(r), s = o;
|
|
198
|
+
a.setProp("backgroundColor", o), a.setProp("borderColor", s);
|
|
199
|
+
const l = a.el;
|
|
200
|
+
l && (l.style.backgroundColor = o, l.style.borderColor = s);
|
|
201
|
+
}
|
|
192
202
|
}), e.render();
|
|
193
203
|
});
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
204
|
+
},
|
|
205
|
+
{ deep: !0, immediate: !1 }
|
|
206
|
+
), ne(
|
|
207
|
+
() => i.deviceInfo,
|
|
197
208
|
() => {
|
|
198
|
-
$.value &&
|
|
209
|
+
$.value && ae(() => {
|
|
199
210
|
if (!$.value) return;
|
|
200
211
|
$.value.getApi().render();
|
|
201
212
|
});
|
|
202
213
|
},
|
|
203
214
|
{ deep: !0 }
|
|
204
215
|
);
|
|
205
|
-
const
|
|
216
|
+
const W = Z(() => M.value.map((e) => {
|
|
206
217
|
var g, f;
|
|
207
218
|
const t = ((g = e.extendedProps) == null ? void 0 : g.organizerId) || "";
|
|
208
219
|
let a = !y.value || t === y.value, r = "";
|
|
209
220
|
typeof e.start == "string" ? r = e.start : e.start instanceof Date ? r = e.start.toISOString() : e.start && (r = new Date(e.start).toISOString()), r && Y(r) && (a = !1);
|
|
210
|
-
let d,
|
|
211
|
-
const s = (f = e.extendedProps) == null ? void 0 : f.taskid, l = s != null ? String(s) : null, v =
|
|
212
|
-
if (
|
|
221
|
+
let d, o;
|
|
222
|
+
const s = (f = e.extendedProps) == null ? void 0 : f.taskid, l = s != null ? String(s) : null, v = i.taskid ? String(i.taskid) : null;
|
|
223
|
+
if (i.taskid)
|
|
213
224
|
if (l && v && console.log("[Calendar] 检查 taskid:", {
|
|
214
225
|
eventId: e.id,
|
|
215
226
|
eventTitle: e.title,
|
|
216
227
|
eventTaskId: s,
|
|
217
228
|
eventTaskIdStr: l,
|
|
218
|
-
propsTaskId:
|
|
229
|
+
propsTaskId: i.taskid,
|
|
219
230
|
propsTaskIdStr: v,
|
|
220
231
|
matched: l === v
|
|
221
232
|
}), l && v && l === v)
|
|
222
|
-
d = R.bg,
|
|
233
|
+
d = R.bg, o = R.border, console.log(
|
|
223
234
|
"[Calendar] 设置红色:",
|
|
224
235
|
e.id,
|
|
225
236
|
e.title,
|
|
226
237
|
d
|
|
227
238
|
);
|
|
228
239
|
else if (e.backgroundColor && e.backgroundColor !== R.bg)
|
|
229
|
-
d = e.backgroundColor,
|
|
240
|
+
d = e.backgroundColor, o = e.borderColor || e.backgroundColor;
|
|
230
241
|
else {
|
|
231
|
-
const _ = l || e.id || "",
|
|
232
|
-
d = P[
|
|
242
|
+
const _ = l || e.id || "", h = q(_);
|
|
243
|
+
d = P[h].bg, o = P[h].border;
|
|
233
244
|
}
|
|
234
245
|
else {
|
|
235
|
-
const _ = l || e.id || "",
|
|
236
|
-
d = P[
|
|
246
|
+
const _ = l || e.id || "", h = q(_);
|
|
247
|
+
d = P[h].bg, o = P[h].border;
|
|
237
248
|
}
|
|
238
249
|
return {
|
|
239
250
|
...e,
|
|
240
251
|
editable: a,
|
|
241
252
|
backgroundColor: d,
|
|
242
253
|
// 覆盖原始 backgroundColor
|
|
243
|
-
borderColor:
|
|
254
|
+
borderColor: o
|
|
244
255
|
// 覆盖原始 borderColor
|
|
245
256
|
};
|
|
246
257
|
})), n = ze({
|
|
@@ -267,12 +278,12 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
267
278
|
const r = new Date(t);
|
|
268
279
|
return r.setHours(0, 0, 0, 0), r < a;
|
|
269
280
|
}
|
|
270
|
-
function
|
|
281
|
+
function oe(e) {
|
|
271
282
|
const t = /* @__PURE__ */ new Date();
|
|
272
283
|
return t.setHours(0, 0, 0, 0), e.getTime() < t.getTime();
|
|
273
284
|
}
|
|
274
285
|
function fe(e) {
|
|
275
|
-
if (
|
|
286
|
+
if (i.isOccupied) {
|
|
276
287
|
x.warning("当前处于占用状态,无法新增事件");
|
|
277
288
|
return;
|
|
278
289
|
}
|
|
@@ -284,8 +295,8 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
284
295
|
!t && e.start && (t = e.start.toISOString()), !a && e.end && (a = e.end.toISOString());
|
|
285
296
|
let r = "", d = "";
|
|
286
297
|
if (e.start) {
|
|
287
|
-
const
|
|
288
|
-
if (isNaN(
|
|
298
|
+
const o = e.start instanceof Date ? e.start : new Date(e.start);
|
|
299
|
+
if (isNaN(o.getTime())) {
|
|
289
300
|
if (t) {
|
|
290
301
|
if (r = F(t, !0), r && r.match(/^\d{4}-\d{2}-\d{2}$/))
|
|
291
302
|
r = r + " 00:00:00";
|
|
@@ -297,7 +308,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
297
308
|
}
|
|
298
309
|
}
|
|
299
310
|
} else {
|
|
300
|
-
const s =
|
|
311
|
+
const s = o.toISOString();
|
|
301
312
|
r = F(s, !0);
|
|
302
313
|
const l = r.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
303
314
|
l && (r = l[1] + " 00:00:00");
|
|
@@ -308,13 +319,13 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
308
319
|
else if (r && r.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/))
|
|
309
320
|
r = r + ":00";
|
|
310
321
|
else if (r && !r.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/)) {
|
|
311
|
-
const
|
|
312
|
-
|
|
322
|
+
const o = r.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
323
|
+
o && (r = o[1] + " 00:00:00");
|
|
313
324
|
}
|
|
314
325
|
}
|
|
315
326
|
if (e.end) {
|
|
316
|
-
const
|
|
317
|
-
if (isNaN(
|
|
327
|
+
const o = e.end instanceof Date ? e.end : new Date(e.end);
|
|
328
|
+
if (isNaN(o.getTime())) {
|
|
318
329
|
if (a) {
|
|
319
330
|
if (d = F(a, !0), d && d.match(/^\d{4}-\d{2}-\d{2}$/))
|
|
320
331
|
d = d + " 00:00:00";
|
|
@@ -326,7 +337,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
326
337
|
}
|
|
327
338
|
}
|
|
328
339
|
} else {
|
|
329
|
-
const s =
|
|
340
|
+
const s = o.toISOString();
|
|
330
341
|
d = F(s, !0);
|
|
331
342
|
const l = d.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
332
343
|
l && (d = l[1] + " 00:00:00");
|
|
@@ -337,17 +348,17 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
337
348
|
else if (d && d.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/))
|
|
338
349
|
d = d + ":00";
|
|
339
350
|
else if (d && !d.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/)) {
|
|
340
|
-
const
|
|
341
|
-
|
|
351
|
+
const o = d.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
352
|
+
o && (d = o[1] + " 00:00:00");
|
|
342
353
|
}
|
|
343
354
|
}
|
|
344
|
-
n.title = "", n.description = "", n.allDay = !1, n.organizer =
|
|
355
|
+
n.title = "", n.description = "", n.allDay = !1, n.organizer = D.value, n.username = D.value, n.organizerId = y.value, i.taskid ? n.taskid = i.taskid : n.taskid = "", n.deviceId = i.deviceId || "", n.userid = y.value, n.start = r, n.end = d, u.value = null, V.value = !0, ae(() => {
|
|
345
356
|
r && !n.start && (n.start = r), d && !n.end && (n.end = d);
|
|
346
357
|
});
|
|
347
358
|
}
|
|
348
359
|
function ge(e) {
|
|
349
360
|
var r, d;
|
|
350
|
-
if (!
|
|
361
|
+
if (!X(e.event)) {
|
|
351
362
|
x.warning("您没有权限编辑此事件");
|
|
352
363
|
return;
|
|
353
364
|
}
|
|
@@ -356,12 +367,12 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
356
367
|
x.warning("今天之前的事件不能修改");
|
|
357
368
|
return;
|
|
358
369
|
}
|
|
359
|
-
|
|
370
|
+
u.value = e.event;
|
|
360
371
|
const a = e.event.extendedProps;
|
|
361
|
-
n.title = e.event.title, n.start = F(t), n.end = F(((d = e.event.end) == null ? void 0 : d.toISOString()) || ""), n.allDay = !1, n.description = a.description || "", n.organizer = a.username || a.organizer ||
|
|
372
|
+
n.title = e.event.title, n.start = F(t), n.end = F(((d = e.event.end) == null ? void 0 : d.toISOString()) || ""), n.allDay = !1, n.description = a.description || "", n.organizer = a.username || a.organizer || D.value, n.username = a.username || a.organizer || D.value, n.organizerId = a.organizerId || "", i.taskid ? n.taskid = i.taskid : n.taskid = "", n.deviceId = a.deviceId || i.deviceId || "", n.userid = a.organizerId || y.value, V.value = !0;
|
|
362
373
|
}
|
|
363
374
|
function pe(e) {
|
|
364
|
-
if (!
|
|
375
|
+
if (!X(e.event)) {
|
|
365
376
|
e.revert(), x.warning("您没有权限修改此事件");
|
|
366
377
|
return;
|
|
367
378
|
}
|
|
@@ -370,13 +381,13 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
370
381
|
e.revert(), x.warning("不能将事件移动到今天之前的时间");
|
|
371
382
|
return;
|
|
372
383
|
}
|
|
373
|
-
if (!
|
|
384
|
+
if (!i.allowOverlap && te(t, a, r)) {
|
|
374
385
|
e.revert(), x.error("该时间段与其他事件冲突,无法移动到此位置");
|
|
375
386
|
return;
|
|
376
387
|
}
|
|
377
|
-
|
|
388
|
+
u.value = e.event;
|
|
378
389
|
const d = e.event.extendedProps;
|
|
379
|
-
n.title = e.event.title || "", t ? n.start = F(t) : n.start = "", a ? n.end = F(a) : n.end = "", n.allDay = !1, n.description = (d == null ? void 0 : d.description) || "", n.organizer = (d == null ? void 0 : d.username) || (d == null ? void 0 : d.organizer) ||
|
|
390
|
+
n.title = e.event.title || "", t ? n.start = F(t) : n.start = "", a ? n.end = F(a) : n.end = "", n.allDay = !1, n.description = (d == null ? void 0 : d.description) || "", n.organizer = (d == null ? void 0 : d.username) || (d == null ? void 0 : d.organizer) || D.value, n.username = (d == null ? void 0 : d.username) || (d == null ? void 0 : d.organizer) || D.value, n.organizerId = (d == null ? void 0 : d.organizerId) || "", i.taskid ? n.taskid = i.taskid : n.taskid = "", n.deviceId = (d == null ? void 0 : d.deviceId) || i.deviceId || "", n.userid = (d == null ? void 0 : d.organizerId) || y.value, V.value = !0;
|
|
380
391
|
}
|
|
381
392
|
function me(e, t) {
|
|
382
393
|
return e ? e.length <= t ? e : e.substring(0, t) + "..." : "";
|
|
@@ -397,12 +408,12 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
397
408
|
if (!e) return "-";
|
|
398
409
|
let t;
|
|
399
410
|
e instanceof Date ? t = e : typeof e == "string" ? t = new Date(e) : t = new Date(e);
|
|
400
|
-
const a = t.getFullYear(), r = String(t.getMonth() + 1).padStart(2, "0"), d = String(t.getDate()).padStart(2, "0"),
|
|
401
|
-
return `${a}-${r}-${d} ${
|
|
411
|
+
const a = t.getFullYear(), r = String(t.getMonth() + 1).padStart(2, "0"), d = String(t.getDate()).padStart(2, "0"), o = String(t.getHours()).padStart(2, "0"), s = String(t.getMinutes()).padStart(2, "0"), l = String(t.getSeconds()).padStart(2, "0");
|
|
412
|
+
return `${a}-${r}-${d} ${o}:${s}:${l}`;
|
|
402
413
|
}
|
|
403
414
|
function ye(e) {
|
|
404
|
-
var v, g, f, _,
|
|
405
|
-
if (!
|
|
415
|
+
var v, g, f, _, h;
|
|
416
|
+
if (!X(e.event)) {
|
|
406
417
|
e.revert(), x.warning("您没有权限修改此事件");
|
|
407
418
|
return;
|
|
408
419
|
}
|
|
@@ -411,55 +422,55 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
411
422
|
e.revert(), x.warning("不能将事件调整到今天之前的时间");
|
|
412
423
|
return;
|
|
413
424
|
}
|
|
414
|
-
if (!
|
|
425
|
+
if (!i.allowOverlap && te(t, a, r)) {
|
|
415
426
|
e.revert(), x.error("该时间段与其他事件冲突,无法调整到此时间");
|
|
416
427
|
return;
|
|
417
428
|
}
|
|
418
|
-
const d = ((f = e.event.extendedProps) == null ? void 0 : f.organizer) ||
|
|
429
|
+
const d = ((f = e.event.extendedProps) == null ? void 0 : f.organizer) || D.value, o = (_ = e.event.extendedProps) == null ? void 0 : _.taskid, s = ce(
|
|
419
430
|
F(t),
|
|
420
431
|
a ? F(a) : void 0,
|
|
421
432
|
r,
|
|
422
433
|
d,
|
|
423
434
|
r,
|
|
424
435
|
// 传入事件ID用于颜色分配
|
|
425
|
-
|
|
436
|
+
o
|
|
426
437
|
// 传入 taskid 用于颜色分配
|
|
427
438
|
), l = M.value.findIndex((k) => k.id === r);
|
|
428
439
|
if (l !== -1) {
|
|
429
|
-
const k = M.value[l], p = ((
|
|
440
|
+
const k = M.value[l], p = ((h = k.extendedProps) == null ? void 0 : h.organizerId) || "", Q = !y.value || p === y.value, L = {
|
|
430
441
|
...k,
|
|
431
442
|
start: t,
|
|
432
443
|
end: a,
|
|
433
444
|
backgroundColor: s.bg,
|
|
434
445
|
borderColor: s.border,
|
|
435
|
-
editable:
|
|
446
|
+
editable: Q,
|
|
436
447
|
// 根据 userid 设置可编辑性
|
|
437
448
|
extendedProps: {
|
|
438
449
|
...k.extendedProps,
|
|
439
450
|
colorIndex: s.index,
|
|
440
|
-
deviceId:
|
|
451
|
+
deviceId: i.deviceId || ""
|
|
441
452
|
// 保存设备ID
|
|
442
453
|
}
|
|
443
454
|
};
|
|
444
455
|
w("eventUpdated", L);
|
|
445
|
-
const
|
|
456
|
+
const J = M.value.map(
|
|
446
457
|
(G) => G.id === r ? L : G
|
|
447
458
|
);
|
|
448
|
-
w("eventsChange",
|
|
459
|
+
w("eventsChange", J);
|
|
449
460
|
}
|
|
450
461
|
}
|
|
451
462
|
function ke(e) {
|
|
452
463
|
const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
453
464
|
return `${t}-${a}-${r}`;
|
|
454
465
|
}
|
|
455
|
-
function
|
|
456
|
-
if (!
|
|
466
|
+
function le(e) {
|
|
467
|
+
if (!i.holidays)
|
|
457
468
|
return null;
|
|
458
469
|
const t = ke(e);
|
|
459
|
-
return
|
|
470
|
+
return i.holidays[t] || null;
|
|
460
471
|
}
|
|
461
|
-
function
|
|
462
|
-
const t =
|
|
472
|
+
function he(e) {
|
|
473
|
+
const t = le(e.date);
|
|
463
474
|
if (t) {
|
|
464
475
|
const a = document.createElement("div");
|
|
465
476
|
a.style.cssText = "display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 2px;";
|
|
@@ -470,30 +481,30 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
470
481
|
}
|
|
471
482
|
return { html: e.dayNumberText };
|
|
472
483
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
484
|
+
function Se(e) {
|
|
485
|
+
le(e.date) && e.el.classList.add("holiday-day");
|
|
475
486
|
}
|
|
476
|
-
function
|
|
487
|
+
function ee(e) {
|
|
477
488
|
var d;
|
|
478
489
|
if (!e)
|
|
479
|
-
return
|
|
480
|
-
const t = M.value.find((
|
|
490
|
+
return i.taskid ? "#409eff" : P[0].bg;
|
|
491
|
+
const t = M.value.find((o) => o.id === e);
|
|
481
492
|
if (t) {
|
|
482
|
-
const
|
|
483
|
-
if (
|
|
484
|
-
if (
|
|
485
|
-
const v = String(
|
|
493
|
+
const o = (d = t.extendedProps) == null ? void 0 : d.taskid;
|
|
494
|
+
if (i.taskid) {
|
|
495
|
+
if (o != null) {
|
|
496
|
+
const v = String(o), g = String(i.taskid);
|
|
486
497
|
if (v === g)
|
|
487
498
|
return R.bg;
|
|
488
499
|
}
|
|
489
|
-
const s =
|
|
500
|
+
const s = o != null ? String(o) : e, l = q(s);
|
|
490
501
|
return P[l].bg;
|
|
491
502
|
} else {
|
|
492
|
-
const s =
|
|
503
|
+
const s = o != null ? String(o) : e, l = q(s);
|
|
493
504
|
return P[l].bg;
|
|
494
505
|
}
|
|
495
506
|
}
|
|
496
|
-
const a =
|
|
507
|
+
const a = W.value.find((o) => o.id === e);
|
|
497
508
|
if (a && a.backgroundColor)
|
|
498
509
|
return a.backgroundColor;
|
|
499
510
|
const r = q(e);
|
|
@@ -502,14 +513,14 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
502
513
|
function se(e) {
|
|
503
514
|
var t;
|
|
504
515
|
if (e.view.type === "dayGridMonth") {
|
|
505
|
-
const a = e.el, r = e.event, d = r.id,
|
|
506
|
-
r.setProp && (r.setProp("backgroundColor",
|
|
516
|
+
const a = e.el, r = e.event, d = r.id, o = ee(d), s = o;
|
|
517
|
+
r.setProp && (r.setProp("backgroundColor", o), r.setProp("borderColor", s)), a.style.backgroundColor = o, a.style.borderColor = s, a.style.height = "10px", a.style.minHeight = "10px", a.style.maxHeight = "10px", a.style.display = "block", a.style.visibility = "visible", a.style.opacity = "1", a.style.width = "100%", a.style.border = "none", a.style.borderRadius = "0", a.style.padding = "0", a.style.margin = "1px 0", a.style.cursor = "pointer";
|
|
507
518
|
const l = a.querySelector(".fc-daygrid-event-frame");
|
|
508
|
-
l && (l.style.backgroundColor =
|
|
519
|
+
l && (l.style.backgroundColor = o, l.style.height = "10px", l.style.minHeight = "10px", l.style.maxHeight = "10px", l.style.cursor = "pointer");
|
|
509
520
|
const v = a.querySelector(".el-tooltip__trigger") || a;
|
|
510
|
-
v && (v.style.display = "block", v.style.width = "100%", v.style.height = "100%", v.style.cursor = "pointer", v.style.position = "relative"), l && (l.style.cursor = "pointer"), a.querySelectorAll("*").forEach((
|
|
511
|
-
const k =
|
|
512
|
-
k.classList.contains("el-tooltip__trigger") || k.closest(".el-tooltip") ? (k.style.cursor = "pointer", k.style.pointerEvents = "auto", k.style.width = "100%", k.style.height = "100%", k.style.position = "absolute", k.style.top = "0", k.style.left = "0", k.style.zIndex = "10") : k.style.backgroundColor =
|
|
521
|
+
v && (v.style.display = "block", v.style.width = "100%", v.style.height = "100%", v.style.cursor = "pointer", v.style.position = "relative"), l && (l.style.cursor = "pointer"), a.querySelectorAll("*").forEach((h) => {
|
|
522
|
+
const k = h;
|
|
523
|
+
k.classList.contains("el-tooltip__trigger") || k.closest(".el-tooltip") ? (k.style.cursor = "pointer", k.style.pointerEvents = "auto", k.style.width = "100%", k.style.height = "100%", k.style.position = "absolute", k.style.top = "0", k.style.left = "0", k.style.zIndex = "10") : k.style.backgroundColor = o;
|
|
513
524
|
}), a.style.position = "relative", a.style.pointerEvents = "auto";
|
|
514
525
|
const f = ((t = r.extendedProps) == null ? void 0 : t.organizerId) || "";
|
|
515
526
|
if ((!y.value || f === y.value) && !a.querySelector(
|
|
@@ -566,9 +577,9 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
566
577
|
dayGridMonth: {
|
|
567
578
|
height: 480,
|
|
568
579
|
// 限制月视图高度为480px
|
|
569
|
-
dayCellContent:
|
|
580
|
+
dayCellContent: he,
|
|
570
581
|
// 自定义日期单元格内容
|
|
571
|
-
dayCellDidMount:
|
|
582
|
+
dayCellDidMount: Se,
|
|
572
583
|
// 日期单元格挂载后添加样式类
|
|
573
584
|
dayMaxEvents: !1,
|
|
574
585
|
// 不显示"more"链接,超出的事件不显示
|
|
@@ -578,10 +589,10 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
578
589
|
// 事件挂载后确保背景色显示
|
|
579
590
|
}
|
|
580
591
|
},
|
|
581
|
-
events:
|
|
592
|
+
events: W.value,
|
|
582
593
|
// 使用动态计算的可编辑事件
|
|
583
594
|
editable: !0,
|
|
584
|
-
selectable: !
|
|
595
|
+
selectable: !i.isOccupied,
|
|
585
596
|
// 占用状态时禁用日期选择
|
|
586
597
|
selectMirror: !0,
|
|
587
598
|
selectAllow: (e) => {
|
|
@@ -599,46 +610,46 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
599
610
|
eventDidMount: se
|
|
600
611
|
// 事件挂载后确保背景色显示
|
|
601
612
|
}));
|
|
602
|
-
function De() {
|
|
603
|
-
o.deviceId && w("deviceClick", o.deviceId);
|
|
604
|
-
}
|
|
605
613
|
function Ce() {
|
|
606
|
-
|
|
614
|
+
i.deviceId && w("deviceClick", i.deviceId);
|
|
615
|
+
}
|
|
616
|
+
function De() {
|
|
617
|
+
if (i.isOccupied) {
|
|
607
618
|
x.warning("当前处于占用状态,无法新增事件");
|
|
608
619
|
return;
|
|
609
620
|
}
|
|
610
621
|
const e = /* @__PURE__ */ new Date(), t = (a) => {
|
|
611
|
-
const r = a.getFullYear(), d = String(a.getMonth() + 1).padStart(2, "0"),
|
|
612
|
-
return `${r}-${d}-${
|
|
622
|
+
const r = a.getFullYear(), d = String(a.getMonth() + 1).padStart(2, "0"), o = String(a.getDate()).padStart(2, "0"), s = String(a.getHours()).padStart(2, "0"), l = String(a.getMinutes()).padStart(2, "0"), v = String(a.getSeconds()).padStart(2, "0");
|
|
623
|
+
return `${r}-${d}-${o} ${s}:${l}:${v}`;
|
|
613
624
|
};
|
|
614
|
-
n.start = t(e), n.end = t(new Date(e.getTime() + 60 * 60 * 1e3)), n.allDay = !1, n.title = "", n.description = "", n.organizer =
|
|
625
|
+
n.start = t(e), n.end = t(new Date(e.getTime() + 60 * 60 * 1e3)), n.allDay = !1, n.title = "", n.description = "", n.organizer = D.value, n.username = D.value, n.organizerId = y.value, u.value = null, V.value = !0;
|
|
615
626
|
}
|
|
616
627
|
function _e() {
|
|
617
|
-
if (
|
|
628
|
+
if (i.isOccupied) {
|
|
618
629
|
x.warning("当前处于占用状态,无法新增事件");
|
|
619
630
|
return;
|
|
620
631
|
}
|
|
621
|
-
if (!
|
|
632
|
+
if (!i.quickAddTimeRange) {
|
|
622
633
|
x.warning("未提供快速添加的时间段");
|
|
623
634
|
return;
|
|
624
635
|
}
|
|
625
|
-
if (!
|
|
636
|
+
if (!i.quickAddTaskName || !i.quickAddTaskName.trim()) {
|
|
626
637
|
x.warning("未提供快速添加的任务名称");
|
|
627
638
|
return;
|
|
628
639
|
}
|
|
629
|
-
const e = (
|
|
640
|
+
const e = (o) => o && (/^\d{4}-\d{2}-\d{2}$/.test(o) ? o + "T00:00:00" : /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(o) ? o.replace(" ", "T") : /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(o) ? o.replace(" ", "T") + ":00" : (o.includes("T"), o)), t = e(i.quickAddTimeRange.start), a = e(i.quickAddTimeRange.end), r = F(t), d = F(a);
|
|
630
641
|
if ($.value)
|
|
631
642
|
try {
|
|
632
|
-
const
|
|
633
|
-
l >= v && l < g ||
|
|
634
|
-
} catch (
|
|
635
|
-
console.warn("无法获取日历 API:",
|
|
643
|
+
const o = $.value.getApi(), s = o.view, l = new Date(t), v = new Date(s.activeStart), g = new Date(s.activeEnd);
|
|
644
|
+
l >= v && l < g || o.gotoDate(l);
|
|
645
|
+
} catch (o) {
|
|
646
|
+
console.warn("无法获取日历 API:", o);
|
|
636
647
|
}
|
|
637
648
|
if (Y(r)) {
|
|
638
649
|
x.warning("不能选择今天之前的时间进行预约");
|
|
639
650
|
return;
|
|
640
651
|
}
|
|
641
|
-
n.start = r, n.end = d, n.title =
|
|
652
|
+
n.start = r, n.end = d, n.title = i.quickAddTaskName, n.allDay = !1, n.description = "", n.organizer = D.value, n.username = D.value, n.organizerId = y.value, i.taskid ? n.taskid = i.taskid : n.taskid = "", n.deviceId = i.deviceId || "", n.userid = y.value, u.value = null, V.value = !0;
|
|
642
653
|
}
|
|
643
654
|
function F(e, t = !1) {
|
|
644
655
|
if (!e) return "";
|
|
@@ -649,7 +660,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
649
660
|
let g = e;
|
|
650
661
|
return g.endsWith("Z") && (g = g.slice(0, -1)), g = g.replace(/[+-]\d{2}:\d{2}$/, ""), g.replace("T", " ").split(".")[0];
|
|
651
662
|
}
|
|
652
|
-
let r, d,
|
|
663
|
+
let r, d, o, s, l, v;
|
|
653
664
|
if (t) {
|
|
654
665
|
const f = a.toLocaleString("en-US", {
|
|
655
666
|
timeZone: "Asia/Shanghai",
|
|
@@ -660,11 +671,11 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
660
671
|
minute: "2-digit",
|
|
661
672
|
second: "2-digit",
|
|
662
673
|
hour12: !1
|
|
663
|
-
}).split(", "), _ = f[0].split("/"),
|
|
664
|
-
r = parseInt(_[2]), d = parseInt(_[0]),
|
|
674
|
+
}).split(", "), _ = f[0].split("/"), h = f[1].split(":");
|
|
675
|
+
r = parseInt(_[2]), d = parseInt(_[0]), o = parseInt(_[1]), s = parseInt(h[0]), l = parseInt(h[1]), v = parseInt(h[2]);
|
|
665
676
|
} else
|
|
666
|
-
r = a.getFullYear(), d = a.getMonth() + 1,
|
|
667
|
-
return `${r}-${String(d).padStart(2, "0")}-${String(
|
|
677
|
+
r = a.getFullYear(), d = a.getMonth() + 1, o = a.getDate(), s = a.getHours(), l = a.getMinutes(), v = a.getSeconds();
|
|
678
|
+
return `${r}-${String(d).padStart(2, "0")}-${String(o).padStart(
|
|
668
679
|
2,
|
|
669
680
|
"0"
|
|
670
681
|
)} ${String(s).padStart(2, "0")}:${String(l).padStart(
|
|
@@ -680,35 +691,35 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
680
691
|
return e ? e.includes("T") ? e : e.replace(" ", "T") : "";
|
|
681
692
|
}
|
|
682
693
|
function Ee(e, t, a, r) {
|
|
683
|
-
const d = new Date(e).getTime(),
|
|
684
|
-
return d < l &&
|
|
694
|
+
const d = new Date(e).getTime(), o = t ? new Date(t).getTime() : d + 60 * 60 * 1e3, s = new Date(a).getTime(), l = r ? new Date(r).getTime() : s + 60 * 60 * 1e3;
|
|
695
|
+
return d < l && o > s;
|
|
685
696
|
}
|
|
686
|
-
function
|
|
687
|
-
if (
|
|
697
|
+
function te(e, t, a) {
|
|
698
|
+
if (i.allowOverlap)
|
|
688
699
|
return !1;
|
|
689
700
|
const r = H(e), d = t ? H(t) : void 0;
|
|
690
|
-
for (const
|
|
691
|
-
if (a &&
|
|
701
|
+
for (const o of M.value) {
|
|
702
|
+
if (a && o.id === a)
|
|
692
703
|
continue;
|
|
693
704
|
let s = "";
|
|
694
|
-
typeof
|
|
705
|
+
typeof o.start == "string" ? s = o.start : o.start instanceof Date ? s = o.start.toISOString() : o.start && (s = new Date(o.start).toISOString());
|
|
695
706
|
let l;
|
|
696
|
-
if (
|
|
707
|
+
if (o.end && (typeof o.end == "string" ? l = o.end : o.end instanceof Date ? l = o.end.toISOString() : l = new Date(o.end).toISOString()), !!s && Ee(r, d, s, l))
|
|
697
708
|
return !0;
|
|
698
709
|
}
|
|
699
710
|
return !1;
|
|
700
711
|
}
|
|
701
|
-
function
|
|
712
|
+
function ce(e, t, a, r, d, o) {
|
|
702
713
|
var v;
|
|
703
|
-
if (!
|
|
704
|
-
const g =
|
|
714
|
+
if (!i.taskid) {
|
|
715
|
+
const g = o != null ? String(o) : d || `temp-${Date.now()}-${Math.random()}`, f = q(g);
|
|
705
716
|
return {
|
|
706
717
|
...P[f],
|
|
707
718
|
index: f
|
|
708
719
|
};
|
|
709
720
|
}
|
|
710
|
-
if (
|
|
711
|
-
const g = String(
|
|
721
|
+
if (o != null && i.taskid) {
|
|
722
|
+
const g = String(o), f = String(i.taskid);
|
|
712
723
|
if (g === f)
|
|
713
724
|
return {
|
|
714
725
|
...R,
|
|
@@ -716,13 +727,13 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
716
727
|
// 使用 -2 表示红色(当前任务)
|
|
717
728
|
};
|
|
718
729
|
}
|
|
719
|
-
if (
|
|
730
|
+
if (i.taskid && d) {
|
|
720
731
|
const g = M.value.find((f) => f.id === d);
|
|
721
732
|
if (g) {
|
|
722
733
|
const f = (v = g.extendedProps) == null ? void 0 : v.taskid;
|
|
723
734
|
if (f != null) {
|
|
724
|
-
const _ = String(f),
|
|
725
|
-
if (_ ===
|
|
735
|
+
const _ = String(f), h = String(i.taskid);
|
|
736
|
+
if (_ === h)
|
|
726
737
|
return {
|
|
727
738
|
...R,
|
|
728
739
|
index: -2
|
|
@@ -731,15 +742,15 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
731
742
|
}
|
|
732
743
|
}
|
|
733
744
|
}
|
|
734
|
-
const s =
|
|
745
|
+
const s = o != null ? String(o) : d || `temp-${Date.now()}-${Math.random()}`, l = q(s);
|
|
735
746
|
return {
|
|
736
747
|
...P[l],
|
|
737
748
|
index: l
|
|
738
749
|
};
|
|
739
750
|
}
|
|
740
751
|
function Ie() {
|
|
741
|
-
var d,
|
|
742
|
-
if (
|
|
752
|
+
var d, o, s;
|
|
753
|
+
if (i.isOccupied && !u.value) {
|
|
743
754
|
x.warning("当前处于占用状态,无法新增事件");
|
|
744
755
|
return;
|
|
745
756
|
}
|
|
@@ -755,37 +766,37 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
755
766
|
x.warning("不能选择今天之前的时间进行预约");
|
|
756
767
|
return;
|
|
757
768
|
}
|
|
758
|
-
const e = (d =
|
|
759
|
-
if (
|
|
769
|
+
const e = (d = u.value) == null ? void 0 : d.id;
|
|
770
|
+
if (te(n.start, n.end, e)) {
|
|
760
771
|
x.error("该时间段与其他事件冲突,请选择其他时间");
|
|
761
772
|
return;
|
|
762
773
|
}
|
|
763
|
-
const a = ((
|
|
774
|
+
const a = ((o = u.value) == null ? void 0 : o.id) || (n.taskid && n.taskid === i.taskid ? n.taskid : void 0), r = ce(
|
|
764
775
|
n.start,
|
|
765
776
|
n.end,
|
|
766
|
-
(s =
|
|
767
|
-
n.organizer ||
|
|
777
|
+
(s = u.value) == null ? void 0 : s.id,
|
|
778
|
+
n.organizer || D.value,
|
|
768
779
|
a,
|
|
769
780
|
// 传入临时ID用于颜色分配(编辑时使用eventId,新增时如果taskid匹配使用taskid)
|
|
770
781
|
n.taskid
|
|
771
782
|
// 传入 taskid 用于颜色分配
|
|
772
783
|
);
|
|
773
|
-
if (
|
|
784
|
+
if (u.value) {
|
|
774
785
|
const l = H(n.start), v = n.end ? H(n.end) : null;
|
|
775
|
-
|
|
786
|
+
u.value.setProp("title", n.title), u.value.setStart(l), v ? u.value.setEnd(v) : u.value.setEnd(l), u.value.setAllDay(!1), u.value.setExtendedProp("description", n.description), u.value.setExtendedProp(
|
|
776
787
|
"organizer",
|
|
777
|
-
n.username || n.organizer ||
|
|
778
|
-
),
|
|
788
|
+
n.username || n.organizer || D.value
|
|
789
|
+
), u.value.setExtendedProp(
|
|
779
790
|
"username",
|
|
780
|
-
n.username || n.organizer ||
|
|
781
|
-
),
|
|
791
|
+
n.username || n.organizer || D.value
|
|
792
|
+
), u.value.setExtendedProp(
|
|
782
793
|
"organizerId",
|
|
783
794
|
n.organizerId || y.value
|
|
784
|
-
),
|
|
785
|
-
const g = n.deviceId ||
|
|
786
|
-
g &&
|
|
795
|
+
), u.value.setExtendedProp("colorIndex", r.index);
|
|
796
|
+
const g = n.deviceId || i.deviceId || "";
|
|
797
|
+
g && u.value.setExtendedProp("deviceId", g), i.taskid && u.value.setExtendedProp("taskid", i.taskid), u.value.setProp("backgroundColor", r.bg), u.value.setProp("borderColor", r.border);
|
|
787
798
|
const f = {
|
|
788
|
-
id:
|
|
799
|
+
id: u.value.id,
|
|
789
800
|
title: n.title,
|
|
790
801
|
start: l,
|
|
791
802
|
end: v || l,
|
|
@@ -795,25 +806,25 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
795
806
|
editable: !y.value || (n.organizerId || y.value) === y.value,
|
|
796
807
|
extendedProps: {
|
|
797
808
|
description: n.description,
|
|
798
|
-
organizer: n.username || n.organizer ||
|
|
809
|
+
organizer: n.username || n.organizer || D.value,
|
|
799
810
|
// 兼容
|
|
800
|
-
username: n.username || n.organizer ||
|
|
811
|
+
username: n.username || n.organizer || D.value,
|
|
801
812
|
organizerId: n.organizerId || y.value,
|
|
802
813
|
colorIndex: r.index,
|
|
803
|
-
deviceId: n.deviceId ||
|
|
804
|
-
taskid:
|
|
814
|
+
deviceId: n.deviceId || i.deviceId || "",
|
|
815
|
+
taskid: i.taskid || ""
|
|
805
816
|
}
|
|
806
817
|
};
|
|
807
818
|
w("eventUpdated", f);
|
|
808
819
|
const _ = M.value.map(
|
|
809
|
-
(
|
|
820
|
+
(h) => h.id === f.id ? f : h
|
|
810
821
|
);
|
|
811
822
|
w("eventsChange", _);
|
|
812
823
|
} else {
|
|
813
|
-
const l = H(n.start), v = n.end ? H(n.end) : void 0, g = n.username || n.organizer ||
|
|
824
|
+
const l = H(n.start), v = n.end ? H(n.end) : void 0, g = n.username || n.organizer || D.value, f = n.organizerId || y.value, _ = !y.value || f === y.value, h = {
|
|
814
825
|
// 不设置 id,由外部 App.vue 的事件列表提供
|
|
815
826
|
// 如果 taskid 匹配 props.taskid,可以设置 id 为 taskid(可选)
|
|
816
|
-
...n.taskid && n.taskid ===
|
|
827
|
+
...n.taskid && n.taskid === i.taskid ? { id: n.taskid } : {},
|
|
817
828
|
title: n.title,
|
|
818
829
|
start: l,
|
|
819
830
|
end: v,
|
|
@@ -829,71 +840,71 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
829
840
|
username: g,
|
|
830
841
|
organizerId: f,
|
|
831
842
|
colorIndex: r.index,
|
|
832
|
-
deviceId: n.deviceId ||
|
|
843
|
+
deviceId: n.deviceId || i.deviceId || "",
|
|
833
844
|
// 保存设备ID
|
|
834
|
-
taskid:
|
|
845
|
+
taskid: i.taskid || ""
|
|
835
846
|
// 保存 taskid(如果存在)
|
|
836
847
|
}
|
|
837
848
|
};
|
|
838
|
-
w("eventAdded",
|
|
839
|
-
const k = [...M.value,
|
|
849
|
+
w("eventAdded", h);
|
|
850
|
+
const k = [...M.value, h];
|
|
840
851
|
w("eventsChange", k);
|
|
841
852
|
}
|
|
842
|
-
V.value = !1,
|
|
853
|
+
V.value = !1, ue();
|
|
843
854
|
}
|
|
844
855
|
function we() {
|
|
845
856
|
var e, t, a;
|
|
846
|
-
if (
|
|
847
|
-
const r =
|
|
857
|
+
if (u.value) {
|
|
858
|
+
const r = u.value.id, d = {
|
|
848
859
|
id: r || "",
|
|
849
|
-
title:
|
|
850
|
-
start: ((e =
|
|
851
|
-
end: (t =
|
|
852
|
-
allDay:
|
|
853
|
-
backgroundColor:
|
|
854
|
-
borderColor:
|
|
855
|
-
editable: (a =
|
|
860
|
+
title: u.value.title,
|
|
861
|
+
start: ((e = u.value.start) == null ? void 0 : e.toISOString()) || "",
|
|
862
|
+
end: (t = u.value.end) == null ? void 0 : t.toISOString(),
|
|
863
|
+
allDay: u.value.allDay || !1,
|
|
864
|
+
backgroundColor: u.value.backgroundColor,
|
|
865
|
+
borderColor: u.value.borderColor,
|
|
866
|
+
editable: (a = u.value.extendedProps) == null ? void 0 : a.editable,
|
|
856
867
|
extendedProps: {
|
|
857
|
-
...
|
|
868
|
+
...u.value.extendedProps || {}
|
|
858
869
|
}
|
|
859
870
|
};
|
|
860
|
-
|
|
861
|
-
const
|
|
862
|
-
w("eventsChange",
|
|
871
|
+
u.value.remove(), V.value = !1, ue(), w("eventDeleted", d);
|
|
872
|
+
const o = M.value.filter((s) => s.id !== r);
|
|
873
|
+
w("eventsChange", o);
|
|
863
874
|
}
|
|
864
875
|
}
|
|
865
|
-
function
|
|
866
|
-
n.title = "", n.start = "", n.end = "", n.allDay = !1, n.description = "", n.organizer =
|
|
876
|
+
function ue() {
|
|
877
|
+
n.title = "", n.start = "", n.end = "", n.allDay = !1, n.description = "", n.organizer = D.value, n.username = D.value, n.organizerId = y.value, n.taskid = "", n.deviceId = "", n.userid = y.value, u.value = null;
|
|
867
878
|
}
|
|
868
879
|
return (e, t) => {
|
|
869
|
-
const a = A("el-button"), r = A("el-icon"), d = A("el-tooltip"),
|
|
880
|
+
const a = A("el-button"), r = A("el-icon"), d = A("el-tooltip"), o = A("el-input"), s = A("el-form-item"), l = A("el-date-picker"), v = A("el-form"), g = A("el-dialog"), f = A("el-descriptions-item"), _ = A("el-tag"), h = A("el-descriptions"), k = A("el-empty");
|
|
870
881
|
return I(), N("div", Be, [
|
|
871
|
-
|
|
882
|
+
S("div", qe, [
|
|
872
883
|
z.value ? (I(), N("div", Ue, [
|
|
873
|
-
t[9] || (t[9] =
|
|
874
|
-
|
|
884
|
+
t[9] || (t[9] = S("span", { class: "device-label" }, "设备名称:", -1)),
|
|
885
|
+
S("span", {
|
|
875
886
|
class: "device-id",
|
|
876
|
-
onClick:
|
|
887
|
+
onClick: Ce
|
|
877
888
|
}, T(z.value.name), 1)
|
|
878
889
|
])) : O("", !0),
|
|
879
|
-
|
|
890
|
+
S("div", null, [
|
|
880
891
|
m(a, {
|
|
881
892
|
type: "primary",
|
|
882
893
|
size: "small",
|
|
883
|
-
onClick:
|
|
884
|
-
disabled:
|
|
894
|
+
onClick: De,
|
|
895
|
+
disabled: C.isOccupied
|
|
885
896
|
}, {
|
|
886
897
|
default: b(() => [...t[10] || (t[10] = [
|
|
887
898
|
E(" 添加预约 ", -1)
|
|
888
899
|
])]),
|
|
889
900
|
_: 1
|
|
890
901
|
}, 8, ["disabled"]),
|
|
891
|
-
|
|
902
|
+
i.quickAddTimeRange ? (I(), B(a, {
|
|
892
903
|
key: 0,
|
|
893
904
|
type: "success",
|
|
894
905
|
size: "small",
|
|
895
906
|
onClick: _e,
|
|
896
|
-
disabled:
|
|
907
|
+
disabled: C.isOccupied
|
|
897
908
|
}, {
|
|
898
909
|
default: b(() => [...t[11] || (t[11] = [
|
|
899
910
|
E(" 快速添加 ", -1)
|
|
@@ -917,15 +928,15 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
917
928
|
"show-after": 200
|
|
918
929
|
}, {
|
|
919
930
|
content: b(() => {
|
|
920
|
-
var
|
|
931
|
+
var Q, L, J, G;
|
|
921
932
|
return [
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
933
|
+
S("div", Re, [
|
|
934
|
+
S("div", Le, [
|
|
935
|
+
S("span", Ge, T(p.event.title), 1)
|
|
925
936
|
]),
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
937
|
+
S("div", je, [
|
|
938
|
+
S("div", Ze, [
|
|
939
|
+
S("span", We, [
|
|
929
940
|
m(r, { class: "detail-icon" }, {
|
|
930
941
|
default: b(() => [
|
|
931
942
|
m(U(Me))
|
|
@@ -934,10 +945,10 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
934
945
|
}),
|
|
935
946
|
t[12] || (t[12] = E(" 时间范围: ", -1))
|
|
936
947
|
]),
|
|
937
|
-
|
|
948
|
+
S("span", Qe, T(p.timeText), 1)
|
|
938
949
|
]),
|
|
939
|
-
|
|
940
|
-
|
|
950
|
+
S("div", Je, [
|
|
951
|
+
S("span", Ke, [
|
|
941
952
|
m(r, { class: "detail-icon" }, {
|
|
942
953
|
default: b(() => [
|
|
943
954
|
m(U(ve))
|
|
@@ -946,10 +957,10 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
946
957
|
}),
|
|
947
958
|
t[13] || (t[13] = E(" 开始时间: ", -1))
|
|
948
959
|
]),
|
|
949
|
-
|
|
960
|
+
S("span", Xe, T(ie(p.event.start)), 1)
|
|
950
961
|
]),
|
|
951
962
|
p.event.end ? (I(), N("div", et, [
|
|
952
|
-
|
|
963
|
+
S("span", tt, [
|
|
953
964
|
m(r, { class: "detail-icon" }, {
|
|
954
965
|
default: b(() => [
|
|
955
966
|
m(U(ve))
|
|
@@ -958,10 +969,10 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
958
969
|
}),
|
|
959
970
|
t[14] || (t[14] = E(" 结束时间: ", -1))
|
|
960
971
|
]),
|
|
961
|
-
|
|
972
|
+
S("span", nt, T(ie(p.event.end)), 1)
|
|
962
973
|
])) : O("", !0),
|
|
963
|
-
(
|
|
964
|
-
|
|
974
|
+
(Q = p.event.extendedProps) != null && Q.organizer || (L = p.event.extendedProps) != null && L.username ? (I(), N("div", at, [
|
|
975
|
+
S("span", rt, [
|
|
965
976
|
m(r, { class: "detail-icon" }, {
|
|
966
977
|
default: b(() => [
|
|
967
978
|
m(U(Ve))
|
|
@@ -970,10 +981,10 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
970
981
|
}),
|
|
971
982
|
t[15] || (t[15] = E(" 预定人: ", -1))
|
|
972
983
|
]),
|
|
973
|
-
|
|
984
|
+
S("span", dt, T(p.event.extendedProps.username || p.event.extendedProps.organizer), 1)
|
|
974
985
|
])) : O("", !0),
|
|
975
|
-
(
|
|
976
|
-
|
|
986
|
+
(J = p.event.extendedProps) != null && J.deviceId ? (I(), N("div", ot, [
|
|
987
|
+
S("span", it, [
|
|
977
988
|
m(r, { class: "detail-icon" }, {
|
|
978
989
|
default: b(() => [
|
|
979
990
|
m(U(Ne))
|
|
@@ -982,10 +993,10 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
982
993
|
}),
|
|
983
994
|
t[16] || (t[16] = E(" 设备ID: ", -1))
|
|
984
995
|
]),
|
|
985
|
-
|
|
996
|
+
S("span", lt, T(p.event.extendedProps.deviceId), 1)
|
|
986
997
|
])) : O("", !0),
|
|
987
998
|
(G = p.event.extendedProps) != null && G.description ? (I(), N("div", st, [
|
|
988
|
-
|
|
999
|
+
S("span", ct, [
|
|
989
1000
|
m(r, { class: "detail-icon" }, {
|
|
990
1001
|
default: b(() => [
|
|
991
1002
|
m(U(Ye))
|
|
@@ -994,17 +1005,17 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
994
1005
|
}),
|
|
995
1006
|
t[17] || (t[17] = E(" 描述: ", -1))
|
|
996
1007
|
]),
|
|
997
|
-
|
|
1008
|
+
S("span", ut, T(p.event.extendedProps.description), 1)
|
|
998
1009
|
])) : O("", !0)
|
|
999
1010
|
])
|
|
1000
1011
|
])
|
|
1001
1012
|
];
|
|
1002
1013
|
}),
|
|
1003
1014
|
default: b(() => [
|
|
1004
|
-
|
|
1015
|
+
S("div", vt, [
|
|
1005
1016
|
be(p.event) ? (I(), N("span", ft, "★")) : O("", !0),
|
|
1006
|
-
|
|
1007
|
-
|
|
1017
|
+
S("span", gt, T(p.timeText), 1),
|
|
1018
|
+
S("span", pt, T(me(p.event.title, 10)), 1)
|
|
1008
1019
|
])
|
|
1009
1020
|
]),
|
|
1010
1021
|
_: 2
|
|
@@ -1015,7 +1026,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1015
1026
|
m(g, {
|
|
1016
1027
|
modelValue: V.value,
|
|
1017
1028
|
"onUpdate:modelValue": t[6] || (t[6] = (p) => V.value = p),
|
|
1018
|
-
title:
|
|
1029
|
+
title: u.value ? "编辑预约" : "添加预约",
|
|
1019
1030
|
width: "520px",
|
|
1020
1031
|
class: "event-dialog",
|
|
1021
1032
|
"close-on-click-modal": !1,
|
|
@@ -1036,7 +1047,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1036
1047
|
])]),
|
|
1037
1048
|
_: 1
|
|
1038
1049
|
}),
|
|
1039
|
-
|
|
1050
|
+
u.value ? (I(), B(a, {
|
|
1040
1051
|
key: 0,
|
|
1041
1052
|
type: "danger",
|
|
1042
1053
|
onClick: we
|
|
@@ -1064,7 +1075,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1064
1075
|
default: b(() => [
|
|
1065
1076
|
m(s, { label: "预定人" }, {
|
|
1066
1077
|
default: b(() => [
|
|
1067
|
-
m(
|
|
1078
|
+
m(o, {
|
|
1068
1079
|
modelValue: n.username,
|
|
1069
1080
|
"onUpdate:modelValue": t[0] || (t[0] = (p) => n.username = p),
|
|
1070
1081
|
disabled: "",
|
|
@@ -1078,7 +1089,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1078
1089
|
required: ""
|
|
1079
1090
|
}, {
|
|
1080
1091
|
default: b(() => [
|
|
1081
|
-
m(
|
|
1092
|
+
m(o, {
|
|
1082
1093
|
modelValue: n.title,
|
|
1083
1094
|
"onUpdate:modelValue": t[1] || (t[1] = (p) => n.title = p),
|
|
1084
1095
|
placeholder: "请输入事件标题"
|
|
@@ -1095,7 +1106,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1095
1106
|
placeholder: "选择开始时间",
|
|
1096
1107
|
format: "YYYY-MM-DD HH:mm",
|
|
1097
1108
|
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
1098
|
-
"disabled-date":
|
|
1109
|
+
"disabled-date": oe,
|
|
1099
1110
|
key: `start-${n.start || "empty"}`,
|
|
1100
1111
|
"append-to-body": "",
|
|
1101
1112
|
"z-index": 3001,
|
|
@@ -1113,7 +1124,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1113
1124
|
placeholder: "选择结束时间",
|
|
1114
1125
|
format: "YYYY-MM-DD HH:mm",
|
|
1115
1126
|
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
1116
|
-
"disabled-date":
|
|
1127
|
+
"disabled-date": oe,
|
|
1117
1128
|
key: `end-${n.end || "empty"}`,
|
|
1118
1129
|
"append-to-body": "",
|
|
1119
1130
|
"z-index": 3001,
|
|
@@ -1124,7 +1135,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1124
1135
|
}),
|
|
1125
1136
|
m(s, { label: "描述" }, {
|
|
1126
1137
|
default: b(() => [
|
|
1127
|
-
m(
|
|
1138
|
+
m(o, {
|
|
1128
1139
|
modelValue: n.description,
|
|
1129
1140
|
"onUpdate:modelValue": t[4] || (t[4] = (p) => n.description = p),
|
|
1130
1141
|
type: "textarea",
|
|
@@ -1141,8 +1152,8 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1141
1152
|
_: 1
|
|
1142
1153
|
}, 8, ["modelValue", "title"]),
|
|
1143
1154
|
m(g, {
|
|
1144
|
-
modelValue:
|
|
1145
|
-
"onUpdate:modelValue": t[8] || (t[8] = (p) =>
|
|
1155
|
+
modelValue: K.value,
|
|
1156
|
+
"onUpdate:modelValue": t[8] || (t[8] = (p) => K.value = p),
|
|
1146
1157
|
title: "设备详情",
|
|
1147
1158
|
width: "600px",
|
|
1148
1159
|
class: "device-dialog",
|
|
@@ -1158,7 +1169,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1158
1169
|
footer: b(() => [
|
|
1159
1170
|
m(a, {
|
|
1160
1171
|
type: "primary",
|
|
1161
|
-
onClick: t[7] || (t[7] = (p) =>
|
|
1172
|
+
onClick: t[7] || (t[7] = (p) => K.value = !1)
|
|
1162
1173
|
}, {
|
|
1163
1174
|
default: b(() => [...t[21] || (t[21] = [
|
|
1164
1175
|
E("关闭", -1)
|
|
@@ -1168,7 +1179,7 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1168
1179
|
]),
|
|
1169
1180
|
default: b(() => [
|
|
1170
1181
|
z.value ? (I(), N("div", mt, [
|
|
1171
|
-
m(
|
|
1182
|
+
m(h, {
|
|
1172
1183
|
column: 1,
|
|
1173
1184
|
border: ""
|
|
1174
1185
|
}, {
|
|
@@ -1240,33 +1251,33 @@ const Be = { class: "fullcalendar-demo" }, qe = { class: "demo-header" }, Ue = {
|
|
|
1240
1251
|
]);
|
|
1241
1252
|
};
|
|
1242
1253
|
}
|
|
1243
|
-
}), kt = (
|
|
1244
|
-
const w =
|
|
1245
|
-
for (const [
|
|
1246
|
-
w[
|
|
1254
|
+
}), kt = (C, c) => {
|
|
1255
|
+
const w = C.__vccOpts || C;
|
|
1256
|
+
for (const [i, $] of c)
|
|
1257
|
+
w[i] = $;
|
|
1247
1258
|
return w;
|
|
1248
|
-
},
|
|
1249
|
-
function
|
|
1250
|
-
const
|
|
1251
|
-
return
|
|
1259
|
+
}, ht = /* @__PURE__ */ kt(yt, [["__scopeId", "data-v-be4828e7"]]);
|
|
1260
|
+
function St(C) {
|
|
1261
|
+
const c = {};
|
|
1262
|
+
return C === 2026 && (c["2026-01-01"] = "元旦", c["2026-01-02"] = "元旦", c["2026-01-03"] = "元旦", c["2026-02-16"] = "春节", c["2026-02-17"] = "春节", c["2026-02-18"] = "春节", c["2026-02-19"] = "春节", c["2026-02-20"] = "春节", c["2026-02-21"] = "春节", c["2026-02-22"] = "春节", c["2026-04-04"] = "清明节", c["2026-04-05"] = "清明节", c["2026-04-06"] = "清明节", c["2026-05-01"] = "劳动节", c["2026-05-02"] = "劳动节", c["2026-05-03"] = "劳动节", c["2026-05-04"] = "劳动节", c["2026-05-05"] = "劳动节", c["2026-06-19"] = "端午节", c["2026-06-20"] = "端午节", c["2026-06-21"] = "端午节", c["2026-09-25"] = "中秋节", c["2026-09-26"] = "中秋节", c["2026-09-27"] = "中秋节", c["2026-10-01"] = "国庆节", c["2026-10-02"] = "国庆节", c["2026-10-03"] = "国庆节", c["2026-10-04"] = "国庆节", c["2026-10-05"] = "国庆节", c["2026-10-06"] = "国庆节", c["2026-10-07"] = "国庆节", c["2026-10-08"] = "国庆节"), c;
|
|
1252
1263
|
}
|
|
1253
|
-
function zt(
|
|
1254
|
-
const w = new Date(
|
|
1255
|
-
return
|
|
1264
|
+
function zt(C) {
|
|
1265
|
+
const w = new Date(C).getFullYear();
|
|
1266
|
+
return St(w)[C] || null;
|
|
1256
1267
|
}
|
|
1257
|
-
function Ft(
|
|
1258
|
-
const
|
|
1259
|
-
return `${
|
|
1268
|
+
function Ft(C) {
|
|
1269
|
+
const c = C.getFullYear(), w = String(C.getMonth() + 1).padStart(2, "0"), i = String(C.getDate()).padStart(2, "0");
|
|
1270
|
+
return `${c}-${w}-${i}`;
|
|
1260
1271
|
}
|
|
1261
1272
|
const At = {
|
|
1262
|
-
install(
|
|
1263
|
-
|
|
1273
|
+
install(C) {
|
|
1274
|
+
C.component("SCalendar", ht);
|
|
1264
1275
|
}
|
|
1265
1276
|
};
|
|
1266
1277
|
export {
|
|
1267
|
-
|
|
1278
|
+
ht as SCalendarComponent,
|
|
1268
1279
|
At as default,
|
|
1269
1280
|
Ft as formatDate,
|
|
1270
|
-
|
|
1281
|
+
St as getHolidays,
|
|
1271
1282
|
zt as isHoliday
|
|
1272
1283
|
};
|