@lee576/vue3-gantt 1.0.4 → 1.0.5
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/vue3-gantt.css +1 -1
- package/dist/vue3-gantt.es.js +477 -475
- package/dist/vue3-gantt.es.js.map +1 -1
- package/dist/vue3-gantt.umd.js +29 -29
- package/dist/vue3-gantt.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/vue3-gantt.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Jn = Object.defineProperty;
|
|
2
2
|
var Kn = (e, t, a) => t in e ? Jn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
3
|
var Lt = (e, t, a) => Kn(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
-
import { reactive as Qa, ref as $, computed as E, defineComponent as Qe, onBeforeMount as In, watch as
|
|
4
|
+
import { reactive as Qa, ref as $, computed as E, defineComponent as Qe, onBeforeMount as In, watch as ye, onMounted as gt, onUnmounted as qt, createElementBlock as S, openBlock as w, createElementVNode as i, createBlock as vt, withDirectives as Ge, createCommentVNode as fe, vModelText as ht, Teleport as ua, normalizeStyle as _e, createVNode as $e, Transition as Qt, withCtx as wt, normalizeClass as Ce, toDisplayString as H, createTextVNode as lt, Fragment as Ne, renderList as nt, vShow as jt, nextTick as Rt, renderSlot as Ba, inject as Ot, withModifiers as Dt, resolveComponent as at, toRefs as Qn, onBeforeUnmount as ca, onDeactivated as Xn, vModelSelect as ja, provide as ia, watchEffect as es, vModelRadio as ts, vModelCheckbox as $a } from "vue";
|
|
5
5
|
import g from "dayjs";
|
|
6
6
|
import rn from "svg.js";
|
|
7
7
|
import kt from "interactjs";
|
|
@@ -32,8 +32,8 @@ function ns() {
|
|
|
32
32
|
}, V = function(d, G) {
|
|
33
33
|
var P, K = m.meridiem;
|
|
34
34
|
if (K) {
|
|
35
|
-
for (var
|
|
36
|
-
P =
|
|
35
|
+
for (var B = 1; B <= 24; B += 1) if (d.indexOf(K(B, 0, G)) > -1) {
|
|
36
|
+
P = B > 12;
|
|
37
37
|
break;
|
|
38
38
|
}
|
|
39
39
|
} else P = d === (G ? "pm" : "PM");
|
|
@@ -69,22 +69,22 @@ function ns() {
|
|
|
69
69
|
function L(d) {
|
|
70
70
|
var G, P;
|
|
71
71
|
G = d, P = m && m.formats;
|
|
72
|
-
for (var K = (d = G.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(
|
|
73
|
-
var z =
|
|
74
|
-
return se || P[
|
|
72
|
+
for (var K = (d = G.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(j, se, he) {
|
|
73
|
+
var z = he && he.toUpperCase();
|
|
74
|
+
return se || P[he] || a[he] || P[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(q, h, u) {
|
|
75
75
|
return h || u.slice(1);
|
|
76
76
|
});
|
|
77
|
-
})).match(s),
|
|
78
|
-
var O = K[C], de = b[O],
|
|
79
|
-
K[C] = ce ? { regex:
|
|
77
|
+
})).match(s), B = K.length, C = 0; C < B; C += 1) {
|
|
78
|
+
var O = K[C], de = b[O], Z = de && de[0], ce = de && de[1];
|
|
79
|
+
K[C] = ce ? { regex: Z, parser: ce } : O.replace(/^\[|\]$/g, "");
|
|
80
80
|
}
|
|
81
|
-
return function(
|
|
82
|
-
for (var se = {},
|
|
83
|
-
var q = K[
|
|
81
|
+
return function(j) {
|
|
82
|
+
for (var se = {}, he = 0, z = 0; he < B; he += 1) {
|
|
83
|
+
var q = K[he];
|
|
84
84
|
if (typeof q == "string") z += q.length;
|
|
85
85
|
else {
|
|
86
|
-
var h = q.regex, u = q.parser, k =
|
|
87
|
-
u.call(se, v),
|
|
86
|
+
var h = q.regex, u = q.parser, k = j.slice(z), v = h.exec(k)[0];
|
|
87
|
+
u.call(se, v), j = j.replace(v, "");
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
return function(_) {
|
|
@@ -98,34 +98,34 @@ function ns() {
|
|
|
98
98
|
}
|
|
99
99
|
return function(d, G, P) {
|
|
100
100
|
P.p.customParseFormat = !0, d && d.parseTwoDigitYear && (f = d.parseTwoDigitYear);
|
|
101
|
-
var K = G.prototype,
|
|
101
|
+
var K = G.prototype, B = K.parse;
|
|
102
102
|
K.parse = function(C) {
|
|
103
|
-
var O = C.date, de = C.utc,
|
|
103
|
+
var O = C.date, de = C.utc, Z = C.args;
|
|
104
104
|
this.$u = de;
|
|
105
|
-
var ce =
|
|
105
|
+
var ce = Z[1];
|
|
106
106
|
if (typeof ce == "string") {
|
|
107
|
-
var
|
|
108
|
-
se && (z =
|
|
107
|
+
var j = Z[2] === !0, se = Z[3] === !0, he = j || se, z = Z[2];
|
|
108
|
+
se && (z = Z[2]), m = this.$locale(), !j && z && (m = P.Ls[z]), this.$d = function(k, v, _, Y) {
|
|
109
109
|
try {
|
|
110
110
|
if (["x", "X"].indexOf(v) > -1) return new Date((v === "X" ? 1e3 : 1) * k);
|
|
111
|
-
var A = L(v)(k), I = A.year, Q = A.month, N = A.day, ee = A.hours, Te = A.minutes, Me = A.seconds, Fe = A.milliseconds, ge = A.zone,
|
|
111
|
+
var A = L(v)(k), I = A.year, Q = A.month, N = A.day, ee = A.hours, Te = A.minutes, Me = A.seconds, Fe = A.milliseconds, ge = A.zone, me = A.week, x = /* @__PURE__ */ new Date(), qe = N || (I || Q ? 1 : x.getDate()), F = I || x.getFullYear(), W = 0;
|
|
112
112
|
I && !Q || (W = Q > 0 ? Q - 1 : x.getMonth());
|
|
113
|
-
var
|
|
114
|
-
return ge ? new Date(Date.UTC(F, W, qe,
|
|
113
|
+
var ae, J = ee || 0, re = Te || 0, We = Me || 0, Oe = Fe || 0;
|
|
114
|
+
return ge ? new Date(Date.UTC(F, W, qe, J, re, We, Oe + 60 * ge.offset * 1e3)) : _ ? new Date(Date.UTC(F, W, qe, J, re, We, Oe)) : (ae = new Date(F, W, qe, J, re, We, Oe), me && (ae = Y(ae).week(me).toDate()), ae);
|
|
115
115
|
} catch {
|
|
116
116
|
return /* @__PURE__ */ new Date("");
|
|
117
117
|
}
|
|
118
|
-
}(O, ce, de, P), this.init(), z && z !== !0 && (this.$L = this.locale(z).$L),
|
|
118
|
+
}(O, ce, de, P), this.init(), z && z !== !0 && (this.$L = this.locale(z).$L), he && O != this.format(ce) && (this.$d = /* @__PURE__ */ new Date("")), m = {};
|
|
119
119
|
} else if (ce instanceof Array) for (var q = ce.length, h = 1; h <= q; h += 1) {
|
|
120
|
-
|
|
121
|
-
var u = P.apply(this,
|
|
120
|
+
Z[1] = ce[h - 1];
|
|
121
|
+
var u = P.apply(this, Z);
|
|
122
122
|
if (u.isValid()) {
|
|
123
123
|
this.$d = u.$d, this.$L = u.$L, this.init();
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
126
|
h === q && (this.$d = /* @__PURE__ */ new Date(""));
|
|
127
127
|
}
|
|
128
|
-
else
|
|
128
|
+
else B.call(this, C);
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
131
|
});
|
|
@@ -2972,20 +2972,20 @@ const ct = ln.getInstance(), Gs = Qe({
|
|
|
2972
2972
|
"ru-RU": "ru"
|
|
2973
2973
|
})[s.value] || "en", o = E(() => {
|
|
2974
2974
|
const c = r();
|
|
2975
|
-
return Array.from({ length: 7 }, (D,
|
|
2976
|
-
}), n = (c) => g().month(c - 1).locale(r()).format("MMMM"), l = $(!1), m = $(!1), f = $(!1), y = $(""), p = $(0), T = $("fadeX_Prev"), V = $(!1), b = $(!1), L = $(null), d = $(null), G = $(null), P = $(null), K = $(0),
|
|
2975
|
+
return Array.from({ length: 7 }, (D, te) => g().day(te + 1).locale(c).format("dd"));
|
|
2976
|
+
}), n = (c) => g().month(c - 1).locale(r()).format("MMMM"), l = $(!1), m = $(!1), f = $(!1), y = $(""), p = $(0), T = $("fadeX_Prev"), V = $(!1), b = $(!1), L = $(null), d = $(null), G = $(null), P = $(null), K = $(0), B = $(0), C = $(ct.getCurrentTheme()), O = $(-1), de = $(-1), Z = $({ row: -1, col: -1 }), ce = $((/* @__PURE__ */ new Date()).getFullYear()), j = $((/* @__PURE__ */ new Date()).getMonth() + 1), se = $((/* @__PURE__ */ new Date()).getFullYear()), he = $((/* @__PURE__ */ new Date()).getMonth() + 1), z = $((/* @__PURE__ */ new Date()).getDate()), q = $(1970), h = $(1), u = $(1), k = $(2099), v = $(12), _ = $(31), Y = (c) => {
|
|
2977
2977
|
if (!c) return null;
|
|
2978
2978
|
const D = c.split("-");
|
|
2979
2979
|
if (D.length !== 3) return null;
|
|
2980
|
-
const
|
|
2981
|
-
return isNaN(
|
|
2980
|
+
const te = parseInt(D[0], 10), ie = parseInt(D[1], 10), U = parseInt(D[2], 10);
|
|
2981
|
+
return isNaN(te) || isNaN(ie) || isNaN(U) ? null : { year: te, month: ie, day: U };
|
|
2982
2982
|
}, A = (c) => c > 9 ? String(c) : `0${c}`, I = E(() => ({
|
|
2983
2983
|
year: ce.value,
|
|
2984
|
-
month:
|
|
2985
|
-
monthStr: n(
|
|
2984
|
+
month: j.value,
|
|
2985
|
+
monthStr: n(j.value)
|
|
2986
2986
|
})), Q = E(() => ({
|
|
2987
2987
|
year: se.value,
|
|
2988
|
-
month:
|
|
2988
|
+
month: he.value,
|
|
2989
2989
|
day: z.value
|
|
2990
2990
|
})), N = E(() => {
|
|
2991
2991
|
const c = [];
|
|
@@ -2994,59 +2994,59 @@ const ct = ln.getInstance(), Gs = Qe({
|
|
|
2994
2994
|
}), ee = E(() => Array.from({ length: 12 }, (c, D) => D + 1)), Te = E(() => ({
|
|
2995
2995
|
position: "fixed",
|
|
2996
2996
|
top: `${K.value}px`,
|
|
2997
|
-
left: `${
|
|
2997
|
+
left: `${B.value}px`,
|
|
2998
2998
|
zIndex: 100002
|
|
2999
|
-
})), Me = () => ce.value < q.value || ce.value === q.value &&
|
|
2999
|
+
})), Me = () => ce.value < q.value || ce.value === q.value && j.value <= h.value, Fe = () => ce.value > k.value || ce.value === k.value && j.value >= v.value, ge = E(() => {
|
|
3000
3000
|
p.value;
|
|
3001
|
-
const c = ce.value, D =
|
|
3002
|
-
let
|
|
3003
|
-
for (let ue = 1; ue <=
|
|
3001
|
+
const c = ce.value, D = j.value, te = new Date(c, D, 0).getDate(), ie = [];
|
|
3002
|
+
let U = [];
|
|
3003
|
+
for (let ue = 1; ue <= te; ue++) {
|
|
3004
3004
|
const Ye = new Date(c, D - 1, ue).getDay(), Ke = Ye === 0 ? 7 : Ye;
|
|
3005
3005
|
if (ue === 1 && Ke > 1)
|
|
3006
|
-
for (let Ie = 1; Ie < Ke; Ie++)
|
|
3007
|
-
const ze = c === se.value && D ===
|
|
3006
|
+
for (let Ie = 1; Ie < Ke; Ie++) U.push({ value: "" });
|
|
3007
|
+
const ze = c === se.value && D === he.value && ue === z.value;
|
|
3008
3008
|
let De = !1;
|
|
3009
|
-
if (c === q.value && D === h.value && ue < u.value && (De = !0), c === k.value && D === v.value && ue > _.value && (De = !0),
|
|
3010
|
-
for (let Ie = Ke; Ie < 7; Ie++)
|
|
3011
|
-
(Ke === 7 || ue ===
|
|
3009
|
+
if (c === q.value && D === h.value && ue < u.value && (De = !0), c === k.value && D === v.value && ue > _.value && (De = !0), U.push({ value: ue, selected: ze, disabled: De }), ue === te && Ke < 7)
|
|
3010
|
+
for (let Ie = Ke; Ie < 7; Ie++) U.push({ value: "" });
|
|
3011
|
+
(Ke === 7 || ue === te) && (ie.push(U), U = []);
|
|
3012
3012
|
}
|
|
3013
3013
|
return ie;
|
|
3014
|
-
}),
|
|
3014
|
+
}), me = () => {
|
|
3015
3015
|
const c = Y(e.date);
|
|
3016
3016
|
if (c)
|
|
3017
|
-
ce.value = c.year,
|
|
3017
|
+
ce.value = c.year, j.value = c.month, se.value = c.year, he.value = c.month, z.value = c.day;
|
|
3018
3018
|
else {
|
|
3019
3019
|
const ie = /* @__PURE__ */ new Date();
|
|
3020
|
-
ce.value = ie.getFullYear(),
|
|
3020
|
+
ce.value = ie.getFullYear(), j.value = ie.getMonth() + 1, se.value = ie.getFullYear(), he.value = ie.getMonth() + 1, z.value = ie.getDate();
|
|
3021
3021
|
}
|
|
3022
3022
|
const D = Y(e.minDate || "1970-01-01");
|
|
3023
3023
|
D && (q.value = D.year, h.value = D.month, u.value = D.day);
|
|
3024
|
-
const
|
|
3025
|
-
|
|
3024
|
+
const te = Y(e.maxDate || "2099-12-31");
|
|
3025
|
+
te && (k.value = te.year, v.value = te.month, _.value = te.day), x();
|
|
3026
3026
|
}, x = () => {
|
|
3027
|
-
const c = `${se.value}-${A(
|
|
3028
|
-
y.value = g(c).locale(D).format(
|
|
3027
|
+
const c = `${se.value}-${A(he.value)}-${A(z.value)}`, D = r(), te = a("dateFormat.full");
|
|
3028
|
+
y.value = g(c).locale(D).format(te);
|
|
3029
3029
|
}, qe = (c) => {
|
|
3030
3030
|
ce.value = c, m.value = !1, f.value = !1, p.value++;
|
|
3031
3031
|
}, F = (c) => {
|
|
3032
|
-
|
|
3032
|
+
j.value = c, m.value = !1, f.value = !1, p.value++;
|
|
3033
3033
|
}, W = (c) => {
|
|
3034
3034
|
if (c.disabled || c.value === "") return;
|
|
3035
|
-
se.value = ce.value,
|
|
3036
|
-
const D = new Date(se.value,
|
|
3035
|
+
se.value = ce.value, he.value = j.value, z.value = c.value, x(), l.value = !1;
|
|
3036
|
+
const D = new Date(se.value, he.value - 1, z.value).getDay(), te = D === 0 ? 7 : D, ie = r(), U = g(`${se.value}-${he.value}-${z.value}`).locale(ie).format("dddd");
|
|
3037
3037
|
t("confirm", {
|
|
3038
|
-
date: `${se.value}-${A(
|
|
3038
|
+
date: `${se.value}-${A(he.value)}-${A(z.value)}`,
|
|
3039
3039
|
year: se.value,
|
|
3040
|
-
month:
|
|
3040
|
+
month: he.value,
|
|
3041
3041
|
day: z.value,
|
|
3042
|
-
week:
|
|
3043
|
-
weekStr:
|
|
3044
|
-
monthStr: n(
|
|
3042
|
+
week: te,
|
|
3043
|
+
weekStr: U,
|
|
3044
|
+
monthStr: n(he.value)
|
|
3045
3045
|
});
|
|
3046
|
-
},
|
|
3047
|
-
V.value || Me() || (V.value = !0, setTimeout(() => V.value = !1, 300), T.value = "fadeX_Prev",
|
|
3048
|
-
},
|
|
3049
|
-
b.value || Fe() || (b.value = !0, setTimeout(() => b.value = !1, 300), T.value = "fadeX_Next",
|
|
3046
|
+
}, ae = () => {
|
|
3047
|
+
V.value || Me() || (V.value = !0, setTimeout(() => V.value = !1, 300), T.value = "fadeX_Prev", j.value <= 1 ? (ce.value--, j.value = 12) : j.value--, p.value++);
|
|
3048
|
+
}, J = () => {
|
|
3049
|
+
b.value || Fe() || (b.value = !0, setTimeout(() => b.value = !1, 300), T.value = "fadeX_Next", j.value >= 12 ? (ce.value++, j.value = 1) : j.value++, p.value++);
|
|
3050
3050
|
}, re = () => {
|
|
3051
3051
|
if (m.value = !m.value, f.value = !1, m.value && G.value) {
|
|
3052
3052
|
const c = N.value.indexOf(se.value);
|
|
@@ -3056,7 +3056,7 @@ const ct = ln.getInstance(), Gs = Qe({
|
|
|
3056
3056
|
}
|
|
3057
3057
|
}, We = () => {
|
|
3058
3058
|
if (f.value = !f.value, m.value = !1, f.value && P.value) {
|
|
3059
|
-
const c =
|
|
3059
|
+
const c = he.value - 1;
|
|
3060
3060
|
setTimeout(() => {
|
|
3061
3061
|
P.value && (P.value.scrollTop = Math.max(0, c - 3) * 40);
|
|
3062
3062
|
}, 0);
|
|
@@ -3066,7 +3066,7 @@ const ct = ln.getInstance(), Gs = Qe({
|
|
|
3066
3066
|
}, Pe = () => {
|
|
3067
3067
|
if (d.value) {
|
|
3068
3068
|
const c = d.value.getBoundingClientRect();
|
|
3069
|
-
K.value = c.bottom + 5,
|
|
3069
|
+
K.value = c.bottom + 5, B.value = c.left;
|
|
3070
3070
|
}
|
|
3071
3071
|
l.value = !0, setTimeout(() => {
|
|
3072
3072
|
C.value = ct.getCurrentTheme(), Ae(C.value);
|
|
@@ -3076,13 +3076,13 @@ const ct = ln.getInstance(), Gs = Qe({
|
|
|
3076
3076
|
}, Ae = (c) => {
|
|
3077
3077
|
if (!L.value) return;
|
|
3078
3078
|
const D = ct.getThemeInfo(c);
|
|
3079
|
-
D && (L.value.setAttribute("data-gantt-theme", c), Object.entries(D.cssVariables).forEach(([
|
|
3080
|
-
L.value.style.setProperty(
|
|
3079
|
+
D && (L.value.setAttribute("data-gantt-theme", c), Object.entries(D.cssVariables).forEach(([te, ie]) => {
|
|
3080
|
+
L.value.style.setProperty(te, ie);
|
|
3081
3081
|
}));
|
|
3082
3082
|
}, Ve = (c) => {
|
|
3083
3083
|
L.value && d.value && !L.value.contains(c.target) && !d.value.contains(c.target) && (l.value = !1);
|
|
3084
|
-
}, Ue = (c) => O.value === c, et = (c) => de.value === c, ke = (c, D) =>
|
|
3085
|
-
return In(() =>
|
|
3084
|
+
}, Ue = (c) => O.value === c, et = (c) => de.value === c, ke = (c, D) => Z.value.row === D && Z.value.col === c, Je = (c) => O.value = c, Be = () => O.value = -1, Le = (c) => de.value = c, Ze = () => de.value = -1, oe = (c, D) => Z.value = { row: D, col: c }, je = () => Z.value = { row: -1, col: -1 };
|
|
3085
|
+
return In(() => me()), ye(() => e.date, () => me()), ye(() => e.minDate, () => me()), ye(() => e.maxDate, () => me()), ye(() => s.value, () => {
|
|
3086
3086
|
y.value && x(), p.value++;
|
|
3087
3087
|
}), gt(() => {
|
|
3088
3088
|
document.addEventListener("click", Ve);
|
|
@@ -3109,8 +3109,8 @@ const ct = ln.getInstance(), Gs = Qe({
|
|
|
3109
3109
|
yearList: N,
|
|
3110
3110
|
rows: ge,
|
|
3111
3111
|
yearListRef: G,
|
|
3112
|
-
prevMonth:
|
|
3113
|
-
nextMonth:
|
|
3112
|
+
prevMonth: ae,
|
|
3113
|
+
nextMonth: J,
|
|
3114
3114
|
selectDay: W,
|
|
3115
3115
|
selectYear: qe,
|
|
3116
3116
|
openYearList: re,
|
|
@@ -3383,7 +3383,7 @@ const fr = /* @__PURE__ */ Xe(Gs, [["render", cr], ["__scopeId", "data-v-49f102c
|
|
|
3383
3383
|
let a = $(null), s = $(null), r = $(0), o = $("");
|
|
3384
3384
|
const n = $(ct.getCurrentTheme()), l = E(() => e.direction === "row" ? "width" : "height"), m = E(() => {
|
|
3385
3385
|
var de;
|
|
3386
|
-
const
|
|
3386
|
+
const B = n.value, C = e.direction === "row", O = {
|
|
3387
3387
|
metro: {
|
|
3388
3388
|
default: C ? "-webkit-gradient(linear,left top,right top,from(#ffffff), to(#d0d0d0))" : "-webkit-gradient(linear, 0 0, 0 bottom, from(#ffffff), to(#d0d0d0))",
|
|
3389
3389
|
move: C ? "-webkit-gradient(linear,left top,right top,from(#1084d8), to(#0078d4))" : "-webkit-gradient(linear, 0 0, 0 bottom, from(#1084d8), to(#0078d4))"
|
|
@@ -3413,10 +3413,10 @@ const fr = /* @__PURE__ */ Xe(Gs, [["render", cr], ["__scopeId", "data-v-49f102c
|
|
|
3413
3413
|
move: C ? "-webkit-gradient(linear,left top,right top,from(rgba(166,212,225,0.8)), to(rgba(37,145,200,0.6)))" : "-webkit-gradient(linear, 0 0, 0 bottom, from(rgba(166,212,225,0.8)), to(rgba(37,145,200,0.6)))"
|
|
3414
3414
|
}
|
|
3415
3415
|
};
|
|
3416
|
-
return ((de = O[
|
|
3416
|
+
return ((de = O[B]) == null ? void 0 : de.default) || O.metro.default;
|
|
3417
3417
|
}), f = E(() => {
|
|
3418
3418
|
var de;
|
|
3419
|
-
const
|
|
3419
|
+
const B = n.value, C = e.direction === "row", O = {
|
|
3420
3420
|
metro: {
|
|
3421
3421
|
default: C ? "-webkit-gradient(linear,left top,right top,from(#ffffff), to(#d0d0d0))" : "-webkit-gradient(linear, 0 0, 0 bottom, from(#ffffff), to(#d0d0d0))",
|
|
3422
3422
|
move: C ? "-webkit-gradient(linear,left top,right top,from(#1084d8), to(#0078d4))" : "-webkit-gradient(linear, 0 0, 0 bottom, from(#1084d8), to(#0078d4))"
|
|
@@ -3446,9 +3446,9 @@ const fr = /* @__PURE__ */ Xe(Gs, [["render", cr], ["__scopeId", "data-v-49f102c
|
|
|
3446
3446
|
move: C ? "-webkit-gradient(linear,left top,right top,from(rgba(166,212,225,0.8)), to(rgba(37,145,200,0.6)))" : "-webkit-gradient(linear, 0 0, 0 bottom, from(rgba(166,212,225,0.8)), to(rgba(37,145,200,0.6)))"
|
|
3447
3447
|
}
|
|
3448
3448
|
};
|
|
3449
|
-
return ((de = O[
|
|
3449
|
+
return ((de = O[B]) == null ? void 0 : de.move) || O.metro.move;
|
|
3450
3450
|
}), y = E(() => `calc(${e.paneLengthPercent}% - ${e.triggerLength / 2}px)`), p = E(() => `${e.triggerLength}px`), T = E(() => {
|
|
3451
|
-
const
|
|
3451
|
+
const B = n.value, C = {
|
|
3452
3452
|
metro: "brightness(0.4) opacity(0.5)",
|
|
3453
3453
|
dark: "brightness(0) invert(1) opacity(0.9)",
|
|
3454
3454
|
// 反色 + 高亮度
|
|
@@ -3458,9 +3458,9 @@ const fr = /* @__PURE__ */ Xe(Gs, [["render", cr], ["__scopeId", "data-v-49f102c
|
|
|
3458
3458
|
apple: "brightness(0.5) contrast(1.1) opacity(0.45)",
|
|
3459
3459
|
liquidGlass: "opacity(0.6)"
|
|
3460
3460
|
};
|
|
3461
|
-
return C[
|
|
3461
|
+
return C[B] || C.metro;
|
|
3462
3462
|
}), V = E(() => {
|
|
3463
|
-
const
|
|
3463
|
+
const B = n.value, C = {
|
|
3464
3464
|
metro: "brightness(0.3) opacity(0.8)",
|
|
3465
3465
|
dark: "brightness(0) invert(1) opacity(1) drop-shadow(0 0 3px cyan)",
|
|
3466
3466
|
modern: "grayscale(0) brightness(0.5) hue-rotate(240deg) opacity(0.8)",
|
|
@@ -3469,7 +3469,7 @@ const fr = /* @__PURE__ */ Xe(Gs, [["render", cr], ["__scopeId", "data-v-49f102c
|
|
|
3469
3469
|
apple: "brightness(0.35) contrast(1.3) saturate(1.2) opacity(0.85)",
|
|
3470
3470
|
liquidGlass: "opacity(0.9)"
|
|
3471
3471
|
};
|
|
3472
|
-
return C[
|
|
3472
|
+
return C[B] || C.metro;
|
|
3473
3473
|
});
|
|
3474
3474
|
gt(async () => {
|
|
3475
3475
|
await Rt(), o.value = `background: ${m.value}`;
|
|
@@ -3478,19 +3478,19 @@ const fr = /* @__PURE__ */ Xe(Gs, [["render", cr], ["__scopeId", "data-v-49f102c
|
|
|
3478
3478
|
await Rt(), o.value = `background: ${m.value}`;
|
|
3479
3479
|
}, L = async () => {
|
|
3480
3480
|
await Rt(), o.value = `background: ${f.value}`;
|
|
3481
|
-
}, d = (
|
|
3482
|
-
document.addEventListener("mousemove", G), document.addEventListener("mouseup", P), e.direction === "row" ? r.value =
|
|
3483
|
-
}, G = async (
|
|
3481
|
+
}, d = (B) => {
|
|
3482
|
+
document.addEventListener("mousemove", G), document.addEventListener("mouseup", P), e.direction === "row" ? r.value = B.pageX - B.target.getBoundingClientRect().left : r.value = B.pageY - B.target.getBoundingClientRect().top;
|
|
3483
|
+
}, G = async (B) => {
|
|
3484
3484
|
if (await Rt(), o.value = `background: ${f.value}`, a.value) {
|
|
3485
3485
|
const C = a.value.getBoundingClientRect();
|
|
3486
3486
|
let O = 0;
|
|
3487
|
-
e.direction === "row" ? O = (
|
|
3487
|
+
e.direction === "row" ? O = (B.pageX - C.left - r.value + e.triggerLength / 2) / C.width * 100 : O = (B.pageY - C.top - r.value + e.triggerLength / 2) / C.height * 100, O < e.min && (O = e.min), O > e.max && (O = e.max), t("update:paneLengthPercent", O);
|
|
3488
3488
|
}
|
|
3489
3489
|
}, P = async () => {
|
|
3490
3490
|
await Rt(), o.value = `background: ${m.value}`, document.removeEventListener("mousemove", G);
|
|
3491
3491
|
}, K = setInterval(() => {
|
|
3492
|
-
const
|
|
3493
|
-
|
|
3492
|
+
const B = ct.getCurrentTheme();
|
|
3493
|
+
B !== n.value && (n.value = B, o.value = `background: ${m.value}`);
|
|
3494
3494
|
}, 100);
|
|
3495
3495
|
return qt(() => {
|
|
3496
3496
|
clearInterval(K);
|
|
@@ -3652,7 +3652,7 @@ const wr = /* @__PURE__ */ Xe(pr, [["render", kr], ["__scopeId", "data-v-65d32e3
|
|
|
3652
3652
|
endDate: ""
|
|
3653
3653
|
}
|
|
3654
3654
|
};
|
|
3655
|
-
let M = Qa(Cr),
|
|
3655
|
+
let M = Qa(Cr), be = {
|
|
3656
3656
|
setMonthHeaders(e) {
|
|
3657
3657
|
M.monthHeaders = e;
|
|
3658
3658
|
},
|
|
@@ -3781,24 +3781,24 @@ const yt = Qa({
|
|
|
3781
3781
|
}), T = E(() => {
|
|
3782
3782
|
const C = [], O = e.row.treeLevel || 0;
|
|
3783
3783
|
if (O <= 1) return C;
|
|
3784
|
-
const de = O - 1,
|
|
3784
|
+
const de = O - 1, Z = [];
|
|
3785
3785
|
let ce = e.row;
|
|
3786
3786
|
for (; ce; ) {
|
|
3787
|
-
|
|
3788
|
-
const
|
|
3789
|
-
if (!
|
|
3787
|
+
Z.unshift(ce);
|
|
3788
|
+
const j = ce[o.value.parentId];
|
|
3789
|
+
if (!j || j === "0") break;
|
|
3790
3790
|
const se = M.tasks.find(
|
|
3791
|
-
(
|
|
3791
|
+
(he) => he[o.value.id] === j
|
|
3792
3792
|
);
|
|
3793
3793
|
if (!se) break;
|
|
3794
3794
|
ce = se;
|
|
3795
3795
|
}
|
|
3796
|
-
for (let
|
|
3797
|
-
const se =
|
|
3796
|
+
for (let j = Z.length - 2; j >= 0; j--) {
|
|
3797
|
+
const se = Z[j], he = se[o.value.id], z = se[o.value.parentId], q = M.tasks.filter(
|
|
3798
3798
|
(h) => h[o.value.parentId] === z
|
|
3799
3799
|
);
|
|
3800
3800
|
if (q.length > 0) {
|
|
3801
|
-
if (q[q.length - 1][o.value.id] ===
|
|
3801
|
+
if (q[q.length - 1][o.value.id] === he)
|
|
3802
3802
|
break;
|
|
3803
3803
|
{
|
|
3804
3804
|
const k = se.treeLevel;
|
|
@@ -3809,12 +3809,12 @@ const yt = Qa({
|
|
|
3809
3809
|
return C;
|
|
3810
3810
|
}), V = () => {
|
|
3811
3811
|
const C = e.row[o.value.id];
|
|
3812
|
-
|
|
3812
|
+
be.toggleTaskCollapse(C);
|
|
3813
3813
|
};
|
|
3814
3814
|
gt(() => {
|
|
3815
3815
|
});
|
|
3816
|
-
const b =
|
|
3817
|
-
return
|
|
3816
|
+
const b = be.setSubTask, L = be.setEditTask, d = be.setRemoveTask, G = (C, O) => o.value[O] ? C[o.value[O]] : C[O] ? C[O] : null;
|
|
3817
|
+
return ye(() => yt.highlightedId, (C) => {
|
|
3818
3818
|
e.row[o.value.id] === C ? a.value = !0 : a.value = !1;
|
|
3819
3819
|
}), {
|
|
3820
3820
|
showRow: t,
|
|
@@ -3996,10 +3996,10 @@ const Er = /* @__PURE__ */ Xe(Mr, [["render", Fr], ["__scopeId", "data-v-0fbd050
|
|
|
3996
3996
|
}), l = E({
|
|
3997
3997
|
get: () => M.expandRow,
|
|
3998
3998
|
set: (f) => {
|
|
3999
|
-
|
|
3999
|
+
be.setExpandRow(f);
|
|
4000
4000
|
}
|
|
4001
4001
|
});
|
|
4002
|
-
|
|
4002
|
+
ye(l, (f) => {
|
|
4003
4003
|
t.value = [], m(f.pid);
|
|
4004
4004
|
});
|
|
4005
4005
|
const m = (f) => {
|
|
@@ -4047,7 +4047,7 @@ const zr = /* @__PURE__ */ Xe(Rr, [["render", Or]]), Pr = Qe({
|
|
|
4047
4047
|
},
|
|
4048
4048
|
setup(e) {
|
|
4049
4049
|
const t = E(() => M.tasks), { scrollTop: a, scrollFlag: s, setScrollTop: r, setScrollFlag: o } = zn(), n = $(null), l = E(() => M.mapFields), m = E(() => t.value.length * e.rowHeight), f = () => t.value.filter((L) => L[l.value.parentId] === "0");
|
|
4050
|
-
|
|
4050
|
+
ye(a, (L) => {
|
|
4051
4051
|
!s.value && n.value && (n.value.scrollTop = L);
|
|
4052
4052
|
});
|
|
4053
4053
|
let y = null;
|
|
@@ -4062,7 +4062,7 @@ const zr = /* @__PURE__ */ Xe(Rr, [["render", Or]]), Pr = Qe({
|
|
|
4062
4062
|
L && (L.scrollWidth > L.clientWidth ? n.value.style.paddingBottom = "20px" : n.value.style.paddingBottom = "0px");
|
|
4063
4063
|
}
|
|
4064
4064
|
};
|
|
4065
|
-
|
|
4065
|
+
ye(t, () => {
|
|
4066
4066
|
setTimeout(V, 50);
|
|
4067
4067
|
});
|
|
4068
4068
|
const b = () => {
|
|
@@ -4125,7 +4125,7 @@ const Nr = /* @__PURE__ */ Xe(Pr, [["render", Vr], ["__scopeId", "data-v-f13dd03
|
|
|
4125
4125
|
s.value.style.setProperty(b, L);
|
|
4126
4126
|
}));
|
|
4127
4127
|
};
|
|
4128
|
-
return
|
|
4128
|
+
return ye(() => e.visible, (T) => {
|
|
4129
4129
|
T && (r.value = ct.getCurrentTheme(), setTimeout(() => {
|
|
4130
4130
|
o(r.value);
|
|
4131
4131
|
}, 0));
|
|
@@ -4324,9 +4324,9 @@ const ro = Qe({
|
|
|
4324
4324
|
const { t: e } = Mt(), t = E(() => M.tasks), a = E(() => M.taskHeaders), s = E({
|
|
4325
4325
|
get: () => M.rootTask,
|
|
4326
4326
|
set: (p) => {
|
|
4327
|
-
|
|
4327
|
+
be.setRootTask(p);
|
|
4328
4328
|
}
|
|
4329
|
-
}), r = E(() => M.startGanttDate), o = E(() => M.endGanttDate), n = $(!1), l =
|
|
4329
|
+
}), r = E(() => M.startGanttDate), o = E(() => M.endGanttDate), n = $(!1), l = be.setRootTask;
|
|
4330
4330
|
return {
|
|
4331
4331
|
t: e,
|
|
4332
4332
|
tasks: t,
|
|
@@ -4343,7 +4343,7 @@ const ro = Qe({
|
|
|
4343
4343
|
n.value = !0;
|
|
4344
4344
|
},
|
|
4345
4345
|
updateHeaders: (p) => {
|
|
4346
|
-
|
|
4346
|
+
be.setTaskHeaders(p);
|
|
4347
4347
|
}
|
|
4348
4348
|
};
|
|
4349
4349
|
}
|
|
@@ -4650,7 +4650,7 @@ const So = Qe({
|
|
|
4650
4650
|
}
|
|
4651
4651
|
}
|
|
4652
4652
|
return { bgContent: z, bgSecondary: q, borderColor: h };
|
|
4653
|
-
},
|
|
4653
|
+
}, B = E(() => {
|
|
4654
4654
|
if (L.value !== "日") return [];
|
|
4655
4655
|
const z = [], q = M.daySubMode === "half", h = q ? 2 : 1;
|
|
4656
4656
|
for (let u = 0; u < V.value; u++) {
|
|
@@ -4670,7 +4670,7 @@ const So = Qe({
|
|
|
4670
4670
|
)
|
|
4671
4671
|
`;
|
|
4672
4672
|
if (L.value === "日") {
|
|
4673
|
-
const _ =
|
|
4673
|
+
const _ = B.value;
|
|
4674
4674
|
_.length > 0 && (v = _.map((A) => {
|
|
4675
4675
|
const I = A * z, Q = I + z;
|
|
4676
4676
|
return `linear-gradient(to right, transparent ${I}px, ${u} ${I}px, ${u} ${Q}px, transparent ${Q}px)`;
|
|
@@ -4694,10 +4694,10 @@ const So = Qe({
|
|
|
4694
4694
|
};
|
|
4695
4695
|
t("progress-update", q), window.dispatchEvent(new CustomEvent("taskProgressUpdate", { detail: q })), console.log("Task progress updated:", q);
|
|
4696
4696
|
};
|
|
4697
|
-
|
|
4697
|
+
ye(() => yt.highlightedId, (z) => {
|
|
4698
4698
|
m.value = e.row[d.value.id] === z;
|
|
4699
4699
|
});
|
|
4700
|
-
const de = () => yt.triggerHighlight(e.row[d.value.id]),
|
|
4700
|
+
const de = () => yt.triggerHighlight(e.row[d.value.id]), Z = () => yt.triggerHighlight(null), ce = (z) => {
|
|
4701
4701
|
p.value;
|
|
4702
4702
|
let q = "#ffffff", h = "#f8f8f8";
|
|
4703
4703
|
if (a.value) {
|
|
@@ -4724,43 +4724,43 @@ const So = Qe({
|
|
|
4724
4724
|
case "时":
|
|
4725
4725
|
return q;
|
|
4726
4726
|
}
|
|
4727
|
-
},
|
|
4727
|
+
}, j = be.setBarDate, se = be.setAllowChangeTaskDate, he = (z) => {
|
|
4728
4728
|
let q = 0;
|
|
4729
4729
|
switch (L.value) {
|
|
4730
4730
|
case "季度": {
|
|
4731
|
-
const F = g(e.startGanttDate).startOf("quarter"), W = g(e.row[d.value.startdate]).startOf("quarter"),
|
|
4732
|
-
let
|
|
4733
|
-
q = b.value *
|
|
4734
|
-
let re = (
|
|
4731
|
+
const F = g(e.startGanttDate).startOf("quarter"), W = g(e.row[d.value.startdate]).startOf("quarter"), ae = g(e.row[d.value.enddate]).startOf("quarter");
|
|
4732
|
+
let J = (W.year() - F.year()) * 4 + (W.quarter() - F.quarter());
|
|
4733
|
+
q = b.value * J;
|
|
4734
|
+
let re = (ae.year() - W.year()) * 4 + (ae.quarter() - W.quarter()) + 1;
|
|
4735
4735
|
n.value = re * b.value, e.row[d.value.takestime] = re + xe("durationUnit.quarters");
|
|
4736
4736
|
break;
|
|
4737
4737
|
}
|
|
4738
4738
|
case "月": {
|
|
4739
|
-
const F = g(e.startGanttDate).startOf("month"), W = g(e.row[d.value.startdate]).startOf("month"),
|
|
4740
|
-
let
|
|
4741
|
-
q = b.value *
|
|
4742
|
-
let re = (
|
|
4739
|
+
const F = g(e.startGanttDate).startOf("month"), W = g(e.row[d.value.startdate]).startOf("month"), ae = g(e.row[d.value.enddate]).startOf("month");
|
|
4740
|
+
let J = (W.year() - F.year()) * 12 + (W.month() - F.month());
|
|
4741
|
+
q = b.value * J;
|
|
4742
|
+
let re = (ae.year() - W.year()) * 12 + (ae.month() - W.month()) + 1;
|
|
4743
4743
|
n.value = re * b.value, e.row[d.value.takestime] = re + xe("durationUnit.months");
|
|
4744
4744
|
break;
|
|
4745
4745
|
}
|
|
4746
4746
|
case "日": {
|
|
4747
4747
|
const F = M.daySubMode === "half", W = F ? 2 : 1;
|
|
4748
|
-
let
|
|
4748
|
+
let ae = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "days");
|
|
4749
4749
|
if (F) {
|
|
4750
4750
|
const re = g(e.row[d.value.startdate]).hour(), We = g(e.row[d.value.enddate]).hour(), Oe = re < 12, Pe = We < 12, Ee = Oe ? 0 : 1, Ae = Pe ? 0 : 1;
|
|
4751
|
-
q = b.value * (
|
|
4752
|
-
const Ue = g(e.row[d.value.enddate]).diff(g(e.startGanttDate), "days") * 2 + Ae, et =
|
|
4751
|
+
q = b.value * (ae * 2 + Ee);
|
|
4752
|
+
const Ue = g(e.row[d.value.enddate]).diff(g(e.startGanttDate), "days") * 2 + Ae, et = ae * 2 + Ee;
|
|
4753
4753
|
n.value = (Ue - et + 1) * b.value;
|
|
4754
4754
|
} else
|
|
4755
|
-
q = b.value *
|
|
4756
|
-
let
|
|
4757
|
-
F || (n.value =
|
|
4755
|
+
q = b.value * ae * W;
|
|
4756
|
+
let J = g(e.row[d.value.enddate]).diff(g(e.row[d.value.startdate]), "days") + 1;
|
|
4757
|
+
F || (n.value = J * b.value * W), e.row[d.value.takestime] = J + xe("durationUnit.days");
|
|
4758
4758
|
break;
|
|
4759
4759
|
}
|
|
4760
4760
|
case "周": {
|
|
4761
4761
|
const F = g(e.startGanttDate).startOf("isoWeek"), W = g(e.row[d.value.startdate]).startOf("isoWeek");
|
|
4762
|
-
let
|
|
4763
|
-
q = b.value *
|
|
4762
|
+
let ae = W.diff(F, "week");
|
|
4763
|
+
q = b.value * ae;
|
|
4764
4764
|
let re = g(e.row[d.value.enddate]).startOf("isoWeek").diff(W, "week") + 1;
|
|
4765
4765
|
n.value = re * b.value, e.row[d.value.takestime] = re + xe("durationUnit.weeks");
|
|
4766
4766
|
break;
|
|
@@ -4768,17 +4768,17 @@ const So = Qe({
|
|
|
4768
4768
|
case "时": {
|
|
4769
4769
|
const F = M.hourSubMode || "60", W = parseInt(F);
|
|
4770
4770
|
if (W < 60) {
|
|
4771
|
-
let
|
|
4772
|
-
q = b.value *
|
|
4771
|
+
let ae = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "minutes"), J = Math.floor(ae / W);
|
|
4772
|
+
q = b.value * J;
|
|
4773
4773
|
let re = g(e.row[d.value.enddate]).diff(g(e.row[d.value.startdate]), "minutes") + W, We = Math.ceil(re / W);
|
|
4774
4774
|
n.value = We * b.value;
|
|
4775
4775
|
const Oe = Math.floor(re / 60), Pe = re % 60;
|
|
4776
4776
|
Oe > 0 && Pe > 0 ? e.row[d.value.takestime] = xe("durationUnit.hoursAndMinutes", { hours: Oe, minutes: Pe }) : Oe > 0 ? e.row[d.value.takestime] = `${Oe}${xe("durationUnit.hours")}` : e.row[d.value.takestime] = `${Pe}${xe("durationUnit.minutes")}`;
|
|
4777
4777
|
} else {
|
|
4778
|
-
let
|
|
4779
|
-
q = b.value *
|
|
4780
|
-
let
|
|
4781
|
-
n.value =
|
|
4778
|
+
let ae = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "hours");
|
|
4779
|
+
q = b.value * ae;
|
|
4780
|
+
let J = g(e.row[d.value.enddate]).diff(g(e.row[d.value.startdate]), "hours") + 1;
|
|
4781
|
+
n.value = J * b.value, e.row[d.value.takestime] = J + xe("durationUnit.hours");
|
|
4782
4782
|
}
|
|
4783
4783
|
break;
|
|
4784
4784
|
}
|
|
@@ -4795,19 +4795,19 @@ const So = Qe({
|
|
|
4795
4795
|
_ ? (_.fill({ color: f.value, opacity: 0.4 }), _.width(Q)) : (_ = h.rect(Q, s.value).radius(10), _.addClass("innerRect"), v.add(_)), Y ? Y.width(n.value) : (Y = h.rect(n.value, s.value).radius(10).fill(k).stroke({ color: u, width: 1 }), Y.on("mouseover", () => Y.animate(200).attr({ stroke: "#000", strokeWidth: 2, opacity: 1 })), Y.on("mouseleave", () => Y.animate(200).attr({ stroke: "#0066ff", strokeWidth: 10, opacity: 0.4 }))), A ? A.text(G.value) : A = h.text(G.value).stroke("#faf7ec");
|
|
4796
4796
|
const N = A.bbox();
|
|
4797
4797
|
A.font({ size: 15, anchor: "middle", leading: "1em" }).fill("#000").attr("opacity", 1).attr("dominant-baseline", "middle").center(_.width() / 2 + N.width / 2, _.height() / 2);
|
|
4798
|
-
const ee = 12, Te = 8, Me = Q - ee / 2, Fe = s.value - Te / 2, ge = Q,
|
|
4799
|
-
let F = "#f59e0b", W = "#d97706",
|
|
4800
|
-
for (;
|
|
4801
|
-
if (
|
|
4802
|
-
F = getComputedStyle(
|
|
4798
|
+
const ee = 12, Te = 8, Me = Q - ee / 2, Fe = s.value - Te / 2, ge = Q, me = () => {
|
|
4799
|
+
let F = "#f59e0b", W = "#d97706", ae = "#fbbf24", J = z.parentElement;
|
|
4800
|
+
for (; J; ) {
|
|
4801
|
+
if (J.hasAttribute("data-gantt-theme")) {
|
|
4802
|
+
F = getComputedStyle(J).getPropertyValue("--primary").trim() || F, W = getComputedStyle(J).getPropertyValue("--primary-dark").trim() || W, ae = getComputedStyle(J).getPropertyValue("--primary-light").trim() || ae;
|
|
4803
4803
|
break;
|
|
4804
4804
|
}
|
|
4805
|
-
|
|
4805
|
+
J = J.parentElement;
|
|
4806
4806
|
}
|
|
4807
|
-
return { primary: F, primaryDark: W, primaryLight:
|
|
4807
|
+
return { primary: F, primaryDark: W, primaryLight: ae };
|
|
4808
4808
|
};
|
|
4809
4809
|
let x = z.querySelector(".progressGuideLine");
|
|
4810
|
-
const qe =
|
|
4810
|
+
const qe = me();
|
|
4811
4811
|
if (!x) {
|
|
4812
4812
|
const F = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
4813
4813
|
F.setAttribute("class", "progressGuideLine"), F.setAttribute("x1", String(ge)), F.setAttribute("y1", "0"), F.setAttribute("x2", String(ge)), F.setAttribute("y2", String(Fe)), F.setAttribute("stroke", qe.primaryDark), F.setAttribute("stroke-width", "2"), F.setAttribute("stroke-dasharray", "4,3"), F.setAttribute("opacity", "0.8"), z.appendChild(F), x = F;
|
|
@@ -4821,43 +4821,43 @@ const So = Qe({
|
|
|
4821
4821
|
I = h.polygon(F).fill(qe.primary).stroke({ color: qe.primaryDark, width: 1 }).addClass("progressHandle");
|
|
4822
4822
|
const W = I.node;
|
|
4823
4823
|
W.style.cursor = "ew-resize", W.style.pointerEvents = "auto", I.move(Me, Fe);
|
|
4824
|
-
let
|
|
4824
|
+
let ae = Me;
|
|
4825
4825
|
W.addEventListener("mouseenter", () => {
|
|
4826
4826
|
if (!T.value) {
|
|
4827
|
-
const
|
|
4828
|
-
W.setAttribute("fill",
|
|
4827
|
+
const J = me();
|
|
4828
|
+
W.setAttribute("fill", J.primaryLight), W.setAttribute("stroke", J.primary), W.setAttribute("stroke-width", "2"), x.setAttribute("stroke", J.primaryLight), x.setAttribute("stroke-width", "2"), x.setAttribute("opacity", "1");
|
|
4829
4829
|
}
|
|
4830
4830
|
}), W.addEventListener("mouseleave", () => {
|
|
4831
4831
|
if (!T.value) {
|
|
4832
|
-
const
|
|
4833
|
-
W.setAttribute("fill",
|
|
4832
|
+
const J = me();
|
|
4833
|
+
W.setAttribute("fill", J.primary), W.setAttribute("stroke", J.primaryDark), W.setAttribute("stroke-width", "1"), x.setAttribute("stroke", J.primaryDark), x.setAttribute("stroke-width", "2"), x.setAttribute("opacity", "0.8");
|
|
4834
4834
|
}
|
|
4835
4835
|
}), kt(W).draggable({
|
|
4836
4836
|
inertia: !1,
|
|
4837
4837
|
listeners: {
|
|
4838
4838
|
start: () => {
|
|
4839
4839
|
T.value = !0;
|
|
4840
|
-
const
|
|
4841
|
-
W.setAttribute("fill",
|
|
4840
|
+
const J = me();
|
|
4841
|
+
W.setAttribute("fill", J.primaryDark), W.setAttribute("stroke", J.primaryDark), W.setAttribute("stroke-width", "2"), x.setAttribute("stroke", J.primaryDark), x.setAttribute("stroke-width", "2"), x.setAttribute("opacity", "1");
|
|
4842
4842
|
},
|
|
4843
|
-
move: (
|
|
4844
|
-
|
|
4845
|
-
const re =
|
|
4843
|
+
move: (J) => {
|
|
4844
|
+
ae += J.dx, ae = Math.max(-12 / 2, Math.min(ae, n.value - ee / 2)), I.move(ae, Fe);
|
|
4845
|
+
const re = ae + ee / 2;
|
|
4846
4846
|
x.setAttribute("x1", String(re)), x.setAttribute("x2", String(re));
|
|
4847
|
-
const We = Math.min(1, Math.max(0, (
|
|
4847
|
+
const We = Math.min(1, Math.max(0, (ae + ee / 2) / n.value));
|
|
4848
4848
|
_.width(We * n.value), A.text((We * 100).toFixed(2) + "%"), A.center(_.width() / 2 + N.width / 2, _.height() / 2);
|
|
4849
4849
|
},
|
|
4850
4850
|
end: () => {
|
|
4851
4851
|
T.value = !1;
|
|
4852
|
-
const
|
|
4853
|
-
W.setAttribute("fill",
|
|
4854
|
-
const re = Math.min(1, Math.max(0, (
|
|
4852
|
+
const J = me();
|
|
4853
|
+
W.setAttribute("fill", J.primary), W.setAttribute("stroke", J.primaryDark), W.setAttribute("stroke-width", "1"), x.setAttribute("stroke", J.primaryDark), x.setAttribute("stroke-width", "2"), x.setAttribute("opacity", "0.8");
|
|
4854
|
+
const re = Math.min(1, Math.max(0, (ae + ee / 2) / n.value));
|
|
4855
4855
|
e.row[d.value.progress] = re, O(re);
|
|
4856
4856
|
}
|
|
4857
4857
|
}
|
|
4858
4858
|
});
|
|
4859
4859
|
}
|
|
4860
|
-
|
|
4860
|
+
j({ id: e.row[d.value.id], startDate: e.row[d.value.startdate], endDate: e.row[d.value.enddate] }), kt(z).draggable({
|
|
4861
4861
|
inertia: !1,
|
|
4862
4862
|
modifiers: [kt.modifiers.restrictRect({ restriction: "parent", endOnly: !0 })],
|
|
4863
4863
|
autoScroll: !0,
|
|
@@ -4872,7 +4872,7 @@ const So = Qe({
|
|
|
4872
4872
|
},
|
|
4873
4873
|
end: (F) => {
|
|
4874
4874
|
if (T.value) return;
|
|
4875
|
-
let W = F.target,
|
|
4875
|
+
let W = F.target, ae = parseFloat(W.getAttribute("data-x") || "0") || 0, re = Math.round(ae / b.value) * b.value;
|
|
4876
4876
|
re < 0 && (re = 0), re > V.value * b.value && (re = V.value * b.value);
|
|
4877
4877
|
const We = d.value.parentId || "pid", Oe = e.row[We];
|
|
4878
4878
|
if (Oe && Oe !== "0") {
|
|
@@ -4880,18 +4880,18 @@ const So = Qe({
|
|
|
4880
4880
|
if (c) {
|
|
4881
4881
|
let D = 0;
|
|
4882
4882
|
if (L.value === "季度" || L.value === "月") {
|
|
4883
|
-
const
|
|
4884
|
-
D = ((ie.year() -
|
|
4883
|
+
const te = g(e.startGanttDate).startOf("month"), ie = g(c[d.value.startdate]).startOf("month");
|
|
4884
|
+
D = ((ie.year() - te.year()) * 12 + (ie.month() - te.month())) * b.value;
|
|
4885
4885
|
} else if (L.value === "日")
|
|
4886
4886
|
D = g(c[d.value.startdate]).diff(g(e.startGanttDate), "days") * b.value;
|
|
4887
4887
|
else if (L.value === "周") {
|
|
4888
|
-
const
|
|
4889
|
-
D = g(c[d.value.startdate]).startOf("isoWeek").diff(
|
|
4888
|
+
const te = g(e.startGanttDate).startOf("isoWeek");
|
|
4889
|
+
D = g(c[d.value.startdate]).startOf("isoWeek").diff(te, "week") * b.value;
|
|
4890
4890
|
} else if (L.value === "时") {
|
|
4891
|
-
const
|
|
4891
|
+
const te = M.hourSubMode || "60", ie = parseInt(te);
|
|
4892
4892
|
if (ie < 60) {
|
|
4893
|
-
const
|
|
4894
|
-
D = Math.floor(
|
|
4893
|
+
const U = g(c[d.value.startdate]).diff(g(e.startGanttDate), "minutes");
|
|
4894
|
+
D = Math.floor(U / ie) * b.value;
|
|
4895
4895
|
} else
|
|
4896
4896
|
D = g(c[d.value.startdate]).diff(g(e.startGanttDate), "hours") * b.value;
|
|
4897
4897
|
}
|
|
@@ -4905,15 +4905,15 @@ const So = Qe({
|
|
|
4905
4905
|
else if (L.value === "月") Ve = Pe;
|
|
4906
4906
|
else if (L.value === "日")
|
|
4907
4907
|
if (M.daySubMode === "half") {
|
|
4908
|
-
const D = Math.round(re / b.value),
|
|
4909
|
-
e.row[d.value.startdate] = Ye.format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.enddate] = De.format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] = Ke -
|
|
4908
|
+
const D = Math.round(re / b.value), te = Math.round(n.value / b.value), ie = D + te - 1, U = Math.floor(D / 2), ue = D % 2 === 0, Ye = g(e.startGanttDate).add(U, "days").hour(ue ? 0 : 12).minute(0).second(0), Ke = Math.floor(ie / 2), ze = ie % 2 === 0, De = g(e.startGanttDate).add(Ke, "days").hour(ze ? 11 : 23).minute(59).second(59);
|
|
4909
|
+
e.row[d.value.startdate] = Ye.format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.enddate] = De.format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] = Ke - U + 1 + xe("durationUnit.days");
|
|
4910
4910
|
} else
|
|
4911
4911
|
Ee = Pe;
|
|
4912
4912
|
else if (L.value === "周") Ee = Pe * 7;
|
|
4913
4913
|
else if (L.value === "时") {
|
|
4914
4914
|
const c = M.hourSubMode || "60", D = parseInt(c);
|
|
4915
4915
|
if (D < 60) {
|
|
4916
|
-
const
|
|
4916
|
+
const te = Math.round(re / b.value), ie = Math.round(n.value / b.value), U = te + ie - 1, ue = 60 / D, Ye = 24 * ue, Ke = Math.floor(te / Ye), ze = te % Ye, De = Math.floor(ze / ue), Ie = ze % ue * D, tt = g(e.startGanttDate).add(Ke, "days").hour(De).minute(Ie).second(0), it = Math.floor(U / Ye), rt = U % Ye, bt = Math.floor(rt / ue), Ht = rt % ue * D + D - 1, Jt = g(e.startGanttDate).add(it, "days").hour(bt).minute(Ht).second(59);
|
|
4917
4917
|
e.row[d.value.startdate] = tt.format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.enddate] = Jt.format("YYYY-MM-DD HH:mm:ss");
|
|
4918
4918
|
const Da = Jt.diff(tt, "minutes") + 1, Kt = Math.floor(Da / 60), an = Da % 60;
|
|
4919
4919
|
Kt > 0 && an > 0 ? e.row[d.value.takestime] = xe("durationUnit.hoursAndMinutes", { hours: Kt, minutes: an }) : Kt > 0 ? e.row[d.value.takestime] = `${Kt}${xe("durationUnit.hours")}` : e.row[d.value.takestime] = `${an}${xe("durationUnit.minutes")}`;
|
|
@@ -4923,12 +4923,12 @@ const So = Qe({
|
|
|
4923
4923
|
const et = L.value === "日" && M.daySubMode === "half", ke = L.value === "时" && (M.hourSubMode === "15" || M.hourSubMode === "30");
|
|
4924
4924
|
if (L.value === "季度") {
|
|
4925
4925
|
e.row[d.value.startdate] = g(e.row[d.value.startdate]).add(Ue, "quarters").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.enddate] = g(e.row[d.value.enddate]).add(Ue, "quarters").format("YYYY-MM-DD HH:mm:ss");
|
|
4926
|
-
const c = g(e.row[d.value.startdate]).startOf("quarter"), D = g(e.row[d.value.enddate]).startOf("quarter"),
|
|
4927
|
-
e.row[d.value.takestime] =
|
|
4926
|
+
const c = g(e.row[d.value.startdate]).startOf("quarter"), D = g(e.row[d.value.enddate]).startOf("quarter"), te = (D.year() - c.year()) * 4 + (D.quarter() - c.quarter()) + 1;
|
|
4927
|
+
e.row[d.value.takestime] = te + xe("durationUnit.quarters");
|
|
4928
4928
|
} else if (L.value === "月") {
|
|
4929
4929
|
e.row[d.value.startdate] = g(e.row[d.value.startdate]).add(Ve, "months").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.enddate] = g(e.row[d.value.enddate]).add(Ve, "months").format("YYYY-MM-DD HH:mm:ss");
|
|
4930
|
-
const c = g(e.row[d.value.startdate]).startOf("month"), D = g(e.row[d.value.enddate]).startOf("month"),
|
|
4931
|
-
e.row[d.value.takestime] =
|
|
4930
|
+
const c = g(e.row[d.value.startdate]).startOf("month"), D = g(e.row[d.value.enddate]).startOf("month"), te = (D.year() - c.year()) * 12 + (D.month() - c.month()) + 1;
|
|
4931
|
+
e.row[d.value.takestime] = te + xe("durationUnit.months");
|
|
4932
4932
|
} else if (L.value === "时" && !ke)
|
|
4933
4933
|
e.row[d.value.startdate] = g(e.row[d.value.startdate]).add(Ae, "hours").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.enddate] = g(e.row[d.value.enddate]).add(Ae, "hours").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] = g(e.row[d.value.enddate]).diff(g(e.row[d.value.startdate]), "hours") + 1 + xe("durationUnit.hours");
|
|
4934
4934
|
else if (!et && !ke) {
|
|
@@ -4940,10 +4940,10 @@ const So = Qe({
|
|
|
4940
4940
|
}
|
|
4941
4941
|
}
|
|
4942
4942
|
const Je = g(e.row[d.value.startdate]), Be = e.row[d.value.id], Le = (c, D) => {
|
|
4943
|
-
const
|
|
4943
|
+
const te = [];
|
|
4944
4944
|
for (const ie of D)
|
|
4945
|
-
String(ie[We]) === String(c) && (
|
|
4946
|
-
return
|
|
4945
|
+
String(ie[We]) === String(c) && (te.push(ie), te.push(...Le(ie[d.value.id], D)));
|
|
4946
|
+
return te;
|
|
4947
4947
|
}, Ze = Le(Be, M.tasks), oe = L.value === "季度" ? Ue : L.value === "月" ? Ve : L.value === "时" ? Ae : Ee;
|
|
4948
4948
|
if (et || ke || oe > 0) {
|
|
4949
4949
|
for (const c of Ze)
|
|
@@ -4963,10 +4963,10 @@ const So = Qe({
|
|
|
4963
4963
|
c[d.value.startdate] = g(c[d.value.startdate]).add(D, "hours").format("YYYY-MM-DD HH:mm:ss"), c[d.value.enddate] = g(c[d.value.enddate]).add(D, "hours").format("YYYY-MM-DD HH:mm:ss");
|
|
4964
4964
|
} else
|
|
4965
4965
|
c[d.value.startdate] = g(c[d.value.startdate]).add(Ee, "days").format("YYYY-MM-DD HH:mm:ss"), c[d.value.enddate] = g(c[d.value.enddate]).add(Ee, "days").format("YYYY-MM-DD HH:mm:ss");
|
|
4966
|
-
|
|
4966
|
+
j({ id: c[d.value.id], startDate: c[d.value.startdate], endDate: c[d.value.enddate] });
|
|
4967
4967
|
}
|
|
4968
4968
|
}
|
|
4969
|
-
|
|
4969
|
+
j({ id: e.row[d.value.id], startDate: e.row[d.value.startdate], endDate: e.row[d.value.enddate] });
|
|
4970
4970
|
}
|
|
4971
4971
|
}
|
|
4972
4972
|
}), kt(z).resizable({
|
|
@@ -4977,12 +4977,12 @@ const So = Qe({
|
|
|
4977
4977
|
},
|
|
4978
4978
|
end: (F) => {
|
|
4979
4979
|
se(e.row);
|
|
4980
|
-
let W = F.target,
|
|
4981
|
-
|
|
4980
|
+
let W = F.target, ae = F.rect.width, J = Math.round(ae / b.value);
|
|
4981
|
+
J < 1 && (J = 1), ae = J * b.value;
|
|
4982
4982
|
let re = o.value;
|
|
4983
4983
|
const We = F.edges && F.edges.right && !F.edges.left;
|
|
4984
4984
|
if (F.edges && F.edges.left) {
|
|
4985
|
-
re = o.value + (n.value -
|
|
4985
|
+
re = o.value + (n.value - ae), re = Math.round(re / b.value) * b.value, re < 0 && (re = 0);
|
|
4986
4986
|
const ke = d.value.parentId || "pid", Je = e.row[ke];
|
|
4987
4987
|
if (Je && Je !== "0") {
|
|
4988
4988
|
const Be = M.tasks.find((Le) => String(Le[d.value.id]) === String(Je));
|
|
@@ -5008,18 +5008,18 @@ const So = Qe({
|
|
|
5008
5008
|
} else
|
|
5009
5009
|
Le = g(Be[d.value.startdate]).diff(g(e.startGanttDate), "hours") * b.value;
|
|
5010
5010
|
}
|
|
5011
|
-
re < Le && (re = Le,
|
|
5011
|
+
re < Le && (re = Le, ae = o.value + n.value - re, J = Math.round(ae / b.value), J < 1 && (J = 1), ae = J * b.value);
|
|
5012
5012
|
}
|
|
5013
5013
|
}
|
|
5014
5014
|
}
|
|
5015
|
-
W.setAttribute("width",
|
|
5016
|
-
let Oe = Math.round(re / b.value), Pe = Oe +
|
|
5015
|
+
W.setAttribute("width", ae.toString()), W.style.width = ae + "px", W.style.transform = `translate(${re}px, 0px)`, W.setAttribute("data-x", re.toString());
|
|
5016
|
+
let Oe = Math.round(re / b.value), Pe = Oe + J - 1, Ee, Ae;
|
|
5017
5017
|
if (L.value === "季度") {
|
|
5018
5018
|
const ke = g(e.startGanttDate).startOf("quarter");
|
|
5019
|
-
Ee = We ? e.row[d.value.startdate] : ke.add(Oe, "quarters").format("YYYY-MM-DD HH:mm:ss"), Ae = ke.add(Pe, "quarters").endOf("quarter").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] =
|
|
5019
|
+
Ee = We ? e.row[d.value.startdate] : ke.add(Oe, "quarters").format("YYYY-MM-DD HH:mm:ss"), Ae = ke.add(Pe, "quarters").endOf("quarter").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] = J + xe("durationUnit.quarters");
|
|
5020
5020
|
} else if (L.value === "月") {
|
|
5021
5021
|
const ke = g(e.startGanttDate).startOf("month");
|
|
5022
|
-
Ee = We ? e.row[d.value.startdate] : ke.add(Oe, "months").format("YYYY-MM-DD HH:mm:ss"), Ae = ke.add(Pe, "months").endOf("month").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] =
|
|
5022
|
+
Ee = We ? e.row[d.value.startdate] : ke.add(Oe, "months").format("YYYY-MM-DD HH:mm:ss"), Ae = ke.add(Pe, "months").endOf("month").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] = J + xe("durationUnit.months");
|
|
5023
5023
|
} else if (L.value === "日") {
|
|
5024
5024
|
const ke = M.daySubMode === "half", Je = ke ? 2 : 1, Be = ke ? Math.floor(Pe / Je) : Pe;
|
|
5025
5025
|
if (ke) {
|
|
@@ -5037,9 +5037,9 @@ const So = Qe({
|
|
|
5037
5037
|
Ae = g(e.startGanttDate).add(Be, "days").hour(je).minute(59).second(59).format("YYYY-MM-DD HH:mm:ss");
|
|
5038
5038
|
} else if (We) {
|
|
5039
5039
|
Ee = e.row[d.value.startdate];
|
|
5040
|
-
const Ze = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "days") +
|
|
5040
|
+
const Ze = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "days") + J - 1;
|
|
5041
5041
|
Ae = g(e.startGanttDate).add(Ze, "days").hour(23).minute(59).second(59).format("YYYY-MM-DD HH:mm:ss");
|
|
5042
|
-
const oe =
|
|
5042
|
+
const oe = J;
|
|
5043
5043
|
e.row[d.value.takestime] = oe + xe("durationUnit.days");
|
|
5044
5044
|
} else {
|
|
5045
5045
|
const Le = Oe;
|
|
@@ -5049,7 +5049,7 @@ const So = Qe({
|
|
|
5049
5049
|
}
|
|
5050
5050
|
} else if (L.value === "周") {
|
|
5051
5051
|
const ke = g(e.startGanttDate).startOf("isoWeek");
|
|
5052
|
-
Ee = We ? e.row[d.value.startdate] : ke.add(Oe, "weeks").format("YYYY-MM-DD HH:mm:ss"), Ae = ke.add(Pe, "weeks").endOf("isoWeek").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] =
|
|
5052
|
+
Ee = We ? e.row[d.value.startdate] : ke.add(Oe, "weeks").format("YYYY-MM-DD HH:mm:ss"), Ae = ke.add(Pe, "weeks").endOf("isoWeek").format("YYYY-MM-DD HH:mm:ss"), e.row[d.value.takestime] = J + xe("durationUnit.weeks");
|
|
5053
5053
|
} else if (L.value === "时") {
|
|
5054
5054
|
const ke = M.hourSubMode || "60", Je = parseInt(ke);
|
|
5055
5055
|
if (Je < 60) {
|
|
@@ -5057,38 +5057,38 @@ const So = Qe({
|
|
|
5057
5057
|
if (We)
|
|
5058
5058
|
Ee = e.row[d.value.startdate];
|
|
5059
5059
|
else {
|
|
5060
|
-
const
|
|
5061
|
-
Ee = g(e.startGanttDate).add(
|
|
5060
|
+
const U = Math.floor(Oe / Le), ue = Oe % Le, Ye = Math.floor(ue / Be), Ke = ue % Be * Je;
|
|
5061
|
+
Ee = g(e.startGanttDate).add(U, "days").hour(Ye).minute(Ke).second(0).format("YYYY-MM-DD HH:mm:ss");
|
|
5062
5062
|
}
|
|
5063
5063
|
const Ze = Math.floor(Pe / Le), oe = Pe % Le, je = Math.floor(oe / Be), c = oe % Be * Je + Je - 1;
|
|
5064
5064
|
Ae = g(e.startGanttDate).add(Ze, "days").hour(je).minute(c).second(59).format("YYYY-MM-DD HH:mm:ss");
|
|
5065
|
-
const D = g(Ae).diff(g(Ee), "minutes") + 1,
|
|
5066
|
-
|
|
5065
|
+
const D = g(Ae).diff(g(Ee), "minutes") + 1, te = Math.floor(D / 60), ie = D % 60;
|
|
5066
|
+
te > 0 && ie > 0 ? e.row[d.value.takestime] = xe("durationUnit.hoursAndMinutes", { hours: te, minutes: ie }) : te > 0 ? e.row[d.value.takestime] = `${te}${xe("durationUnit.hours")}` : e.row[d.value.takestime] = `${ie}${xe("durationUnit.minutes")}`;
|
|
5067
5067
|
} else {
|
|
5068
5068
|
if (We) {
|
|
5069
5069
|
Ee = e.row[d.value.startdate];
|
|
5070
|
-
const Le = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "hours") +
|
|
5070
|
+
const Le = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "hours") + J - 1;
|
|
5071
5071
|
Ae = g(e.startGanttDate).add(Le, "hours").minute(59).second(59).format("YYYY-MM-DD HH:mm:ss");
|
|
5072
5072
|
} else
|
|
5073
5073
|
Ee = g(e.startGanttDate).add(Oe, "hours").format("YYYY-MM-DD HH:mm:ss"), Ae = g(e.startGanttDate).add(Pe, "hours").minute(59).second(59).format("YYYY-MM-DD HH:mm:ss");
|
|
5074
|
-
e.row[d.value.takestime] =
|
|
5074
|
+
e.row[d.value.takestime] = J + xe("durationUnit.hours");
|
|
5075
5075
|
}
|
|
5076
5076
|
} else {
|
|
5077
5077
|
if (We) {
|
|
5078
5078
|
Ee = e.row[d.value.startdate];
|
|
5079
|
-
const Je = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "hours") +
|
|
5079
|
+
const Je = g(e.row[d.value.startdate]).diff(g(e.startGanttDate), "hours") + J - 1;
|
|
5080
5080
|
Ae = g(e.startGanttDate).add(Je, "hours").minute(59).second(59).format("YYYY-MM-DD HH:mm:ss");
|
|
5081
5081
|
} else
|
|
5082
5082
|
Ee = g(e.startGanttDate).add(Oe, "hours").format("YYYY-MM-DD HH:mm:ss"), Ae = g(e.startGanttDate).add(Pe, "hours").minute(59).second(59).format("YYYY-MM-DD HH:mm:ss");
|
|
5083
|
-
e.row[d.value.takestime] =
|
|
5083
|
+
e.row[d.value.takestime] = J + xe("durationUnit.hours");
|
|
5084
5084
|
}
|
|
5085
5085
|
e.row[d.value.startdate] = Ee, e.row[d.value.enddate] = Ae;
|
|
5086
5086
|
let Ve = rn(z), Ue = Ve.select(".innerRect").first(), et = Ve.select("rect:not(.innerRect):not(.progressHandle)").first();
|
|
5087
5087
|
if (Ue) {
|
|
5088
|
-
let ke = e.row[d.value.progress] ?
|
|
5088
|
+
let ke = e.row[d.value.progress] ? ae * Number(e.row[d.value.progress]) : ae;
|
|
5089
5089
|
Ue.width(ke);
|
|
5090
5090
|
}
|
|
5091
|
-
if (et && et.width(
|
|
5091
|
+
if (et && et.width(ae), F.edges && F.edges.left) {
|
|
5092
5092
|
const ke = g(Ee), Je = e.row[d.value.id], Be = d.value.parentId || "pid", Le = (oe, je) => {
|
|
5093
5093
|
const c = [];
|
|
5094
5094
|
for (const D of je)
|
|
@@ -5119,10 +5119,10 @@ const So = Qe({
|
|
|
5119
5119
|
const je = ke.diff(g(oe[d.value.startdate]), "days");
|
|
5120
5120
|
oe[d.value.startdate] = g(oe[d.value.startdate]).add(je, "days").format("YYYY-MM-DD HH:mm:ss"), oe[d.value.enddate] = g(oe[d.value.enddate]).add(je, "days").format("YYYY-MM-DD HH:mm:ss");
|
|
5121
5121
|
}
|
|
5122
|
-
|
|
5122
|
+
j({ id: oe[d.value.id], startDate: oe[d.value.startdate], endDate: oe[d.value.enddate] });
|
|
5123
5123
|
}
|
|
5124
5124
|
}
|
|
5125
|
-
|
|
5125
|
+
j({ id: e.row[d.value.id], startDate: Ee, endDate: Ae });
|
|
5126
5126
|
}
|
|
5127
5127
|
},
|
|
5128
5128
|
modifiers: [
|
|
@@ -5133,10 +5133,12 @@ const So = Qe({
|
|
|
5133
5133
|
hold: 1
|
|
5134
5134
|
});
|
|
5135
5135
|
};
|
|
5136
|
-
return
|
|
5137
|
-
a.value && y.value &&
|
|
5138
|
-
}, { deep: !1 }),
|
|
5139
|
-
|
|
5136
|
+
return ye(() => [e.row[d.value.startdate], e.row[d.value.enddate]], () => {
|
|
5137
|
+
a.value && y.value && he(a.value);
|
|
5138
|
+
}, { deep: !1 }), ye([L, b], () => {
|
|
5139
|
+
a.value && y.value && he(a.value);
|
|
5140
|
+
}), gt(() => {
|
|
5141
|
+
if (a.value && !y.value && (he(a.value), y.value = !0), P && (f.value = P(e.row), a.value && he(a.value)), a.value) {
|
|
5140
5142
|
let z = a.value.parentElement;
|
|
5141
5143
|
for (; z && !z.hasAttribute("data-gantt-theme"); )
|
|
5142
5144
|
z = z.parentElement;
|
|
@@ -5175,7 +5177,7 @@ const So = Qe({
|
|
|
5175
5177
|
mode: L,
|
|
5176
5178
|
mapFields: d,
|
|
5177
5179
|
hoverActive: de,
|
|
5178
|
-
hoverInactive:
|
|
5180
|
+
hoverInactive: Z,
|
|
5179
5181
|
WeekEndColor: ce,
|
|
5180
5182
|
barRowStyle: C
|
|
5181
5183
|
};
|
|
@@ -5199,7 +5201,7 @@ function Do(e, t, a, s, r, o) {
|
|
|
5199
5201
|
}, null, 10, Mo)) : fe("", !0)
|
|
5200
5202
|
], 46, To)) : fe("", !0);
|
|
5201
5203
|
}
|
|
5202
|
-
const $o = /* @__PURE__ */ Xe(So, [["render", Do], ["__scopeId", "data-v-
|
|
5204
|
+
const $o = /* @__PURE__ */ Xe(So, [["render", Do], ["__scopeId", "data-v-4f728f95"]]);
|
|
5203
5205
|
g.extend(Pn);
|
|
5204
5206
|
const _o = Qe({
|
|
5205
5207
|
name: "Milestone",
|
|
@@ -5213,27 +5215,27 @@ const _o = Qe({
|
|
|
5213
5215
|
const t = $(null), a = $(e.rowHeight * 0.6), s = $(!0), r = $(!1), o = $(""), n = $(0), l = $(0), m = E(() => M.timelineCellCount), f = E(() => M.scale), y = E(() => M.mode), p = E(() => M.mapFields), T = Ot(ta.SetBarColorSymbol), V = () => {
|
|
5214
5216
|
let C = "#ffffff", O = "#f8f8f8", de = "#cecece";
|
|
5215
5217
|
if (t.value) {
|
|
5216
|
-
let
|
|
5217
|
-
for (;
|
|
5218
|
-
if (
|
|
5219
|
-
C = getComputedStyle(
|
|
5218
|
+
let Z = t.value.parentElement;
|
|
5219
|
+
for (; Z; ) {
|
|
5220
|
+
if (Z.hasAttribute("data-gantt-theme")) {
|
|
5221
|
+
C = getComputedStyle(Z).getPropertyValue("--bg-content").trim() || "#ffffff", O = getComputedStyle(Z).getPropertyValue("--bg-secondary").trim() || "#f8f8f8", de = getComputedStyle(Z).getPropertyValue("--border").trim() || "#cecece";
|
|
5220
5222
|
break;
|
|
5221
5223
|
}
|
|
5222
|
-
|
|
5224
|
+
Z = Z.parentElement;
|
|
5223
5225
|
}
|
|
5224
5226
|
}
|
|
5225
5227
|
return { bgContent: C, bgSecondary: O, borderColor: de };
|
|
5226
5228
|
}, b = E(() => {
|
|
5227
5229
|
if (y.value !== "日") return [];
|
|
5228
5230
|
const C = [], O = M.daySubMode === "half", de = O ? 2 : 1;
|
|
5229
|
-
for (let
|
|
5230
|
-
const ce = O ? Math.floor(
|
|
5231
|
-
(se === 6 || se === 7) && C.push(
|
|
5231
|
+
for (let Z = 0; Z < m.value; Z++) {
|
|
5232
|
+
const ce = O ? Math.floor(Z / de) : Z, se = g(e.startGanttDate).add(ce, "days").isoWeekday();
|
|
5233
|
+
(se === 6 || se === 7) && C.push(Z);
|
|
5232
5234
|
}
|
|
5233
5235
|
return C;
|
|
5234
5236
|
}), L = E(() => {
|
|
5235
|
-
const C = f.value, O = m.value * C, { bgContent: de, bgSecondary:
|
|
5236
|
-
let
|
|
5237
|
+
const C = f.value, O = m.value * C, { bgContent: de, bgSecondary: Z, borderColor: ce } = V();
|
|
5238
|
+
let j = `
|
|
5237
5239
|
repeating-linear-gradient(
|
|
5238
5240
|
to right,
|
|
5239
5241
|
transparent 0px,
|
|
@@ -5244,35 +5246,35 @@ const _o = Qe({
|
|
|
5244
5246
|
`;
|
|
5245
5247
|
if (y.value === "日") {
|
|
5246
5248
|
const se = b.value;
|
|
5247
|
-
se.length > 0 && (
|
|
5249
|
+
se.length > 0 && (j = se.map((z) => {
|
|
5248
5250
|
const q = z * C, h = q + C;
|
|
5249
|
-
return `linear-gradient(to right, transparent ${q}px, ${
|
|
5250
|
-
}).join(", ") + ", " +
|
|
5251
|
+
return `linear-gradient(to right, transparent ${q}px, ${Z} ${q}px, ${Z} ${h}px, transparent ${h}px)`;
|
|
5252
|
+
}).join(", ") + ", " + j);
|
|
5251
5253
|
}
|
|
5252
5254
|
return {
|
|
5253
5255
|
height: e.rowHeight + "px",
|
|
5254
5256
|
width: O + "px",
|
|
5255
5257
|
minWidth: O + "px",
|
|
5256
5258
|
background: de,
|
|
5257
|
-
backgroundImage:
|
|
5259
|
+
backgroundImage: j,
|
|
5258
5260
|
backgroundSize: `${O}px 100%`,
|
|
5259
5261
|
borderBottom: `1px solid ${ce}`
|
|
5260
5262
|
};
|
|
5261
5263
|
});
|
|
5262
|
-
|
|
5264
|
+
ye(() => yt.highlightedId, (C) => {
|
|
5263
5265
|
r.value = e.row[p.value.id] === C;
|
|
5264
5266
|
});
|
|
5265
5267
|
const d = () => yt.triggerHighlight(e.row[p.value.id]), G = () => yt.triggerHighlight(null), P = (C) => {
|
|
5266
5268
|
n.value;
|
|
5267
5269
|
let O = "#ffffff", de = "#f8f8f8";
|
|
5268
5270
|
if (t.value) {
|
|
5269
|
-
let
|
|
5270
|
-
for (;
|
|
5271
|
-
if (
|
|
5272
|
-
O = getComputedStyle(
|
|
5271
|
+
let Z = t.value.parentElement;
|
|
5272
|
+
for (; Z; ) {
|
|
5273
|
+
if (Z.hasAttribute("data-gantt-theme")) {
|
|
5274
|
+
O = getComputedStyle(Z).getPropertyValue("--bg-content").trim() || "#ffffff", de = getComputedStyle(Z).getPropertyValue("--bg-secondary").trim() || "#f8f8f8";
|
|
5273
5275
|
break;
|
|
5274
5276
|
}
|
|
5275
|
-
|
|
5277
|
+
Z = Z.parentElement;
|
|
5276
5278
|
}
|
|
5277
5279
|
}
|
|
5278
5280
|
switch (y.value) {
|
|
@@ -5282,36 +5284,36 @@ const _o = Qe({
|
|
|
5282
5284
|
return g(e.startGanttDate).startOf("month").add(C, "months"), O;
|
|
5283
5285
|
case "日": {
|
|
5284
5286
|
const ce = M.daySubMode === "half" ? Math.floor(C / 2) : C;
|
|
5285
|
-
let
|
|
5286
|
-
return
|
|
5287
|
+
let j = g(e.startGanttDate).add(ce, "days");
|
|
5288
|
+
return j.isoWeekday() === 7 || j.isoWeekday() === 1 ? de : O;
|
|
5287
5289
|
}
|
|
5288
5290
|
case "周":
|
|
5289
5291
|
case "时":
|
|
5290
5292
|
return O;
|
|
5291
5293
|
}
|
|
5292
|
-
}, K =
|
|
5294
|
+
}, K = be.setBarDate, B = (C) => {
|
|
5293
5295
|
let O = 0;
|
|
5294
5296
|
switch (y.value) {
|
|
5295
5297
|
case "季度": {
|
|
5296
|
-
const ge = g(e.startGanttDate).startOf("quarter"),
|
|
5297
|
-
let x = (
|
|
5298
|
+
const ge = g(e.startGanttDate).startOf("quarter"), me = g(e.row[p.value.startdate]).startOf("quarter");
|
|
5299
|
+
let x = (me.year() - ge.year()) * 4 + (me.quarter() - ge.quarter());
|
|
5298
5300
|
O = f.value * x + f.value / 2, e.row[p.value.takestime] = "0季度", e.row[p.value.enddate] = e.row[p.value.startdate];
|
|
5299
5301
|
break;
|
|
5300
5302
|
}
|
|
5301
5303
|
case "月": {
|
|
5302
|
-
const ge = g(e.startGanttDate).startOf("month"),
|
|
5303
|
-
let x = (
|
|
5304
|
+
const ge = g(e.startGanttDate).startOf("month"), me = g(e.row[p.value.startdate]).startOf("month");
|
|
5305
|
+
let x = (me.year() - ge.year()) * 12 + (me.month() - ge.month());
|
|
5304
5306
|
O = f.value * x + f.value / 2, e.row[p.value.takestime] = "0月", e.row[p.value.enddate] = e.row[p.value.startdate];
|
|
5305
5307
|
break;
|
|
5306
5308
|
}
|
|
5307
5309
|
case "日": {
|
|
5308
5310
|
const ge = M.daySubMode === "half";
|
|
5309
|
-
let
|
|
5311
|
+
let me = g(e.row[p.value.startdate]).diff(g(e.startGanttDate), "days");
|
|
5310
5312
|
if (ge) {
|
|
5311
5313
|
const F = g(e.row[p.value.startdate]).hour() < 12 ? 0 : 1;
|
|
5312
|
-
O = f.value * (
|
|
5314
|
+
O = f.value * (me * 2 + F) + f.value / 2;
|
|
5313
5315
|
} else
|
|
5314
|
-
O = f.value *
|
|
5316
|
+
O = f.value * me + f.value / 2;
|
|
5315
5317
|
e.row[p.value.takestime] = "0" + xe("durationUnit.days"), e.row[p.value.enddate] = e.row[p.value.startdate];
|
|
5316
5318
|
break;
|
|
5317
5319
|
}
|
|
@@ -5329,25 +5331,25 @@ const _o = Qe({
|
|
|
5329
5331
|
}
|
|
5330
5332
|
l.value = O;
|
|
5331
5333
|
let de = rn(C);
|
|
5332
|
-
const
|
|
5333
|
-
C.setAttribute("data-x", O.toString()), C.setAttribute("stroke",
|
|
5334
|
-
let ce = "#f59e0b",
|
|
5335
|
-
for (;
|
|
5336
|
-
if (
|
|
5337
|
-
const ge = getComputedStyle(
|
|
5338
|
-
ce = ge.getPropertyValue("--primary").trim() || ce,
|
|
5334
|
+
const Z = getComputedStyle(C).getPropertyValue("--border") || "#cecece";
|
|
5335
|
+
C.setAttribute("data-x", O.toString()), C.setAttribute("stroke", Z), C.setAttribute("stroke-width", "2px"), C.style.transform = `translate(${O}px, 0px)`;
|
|
5336
|
+
let ce = "#f59e0b", j = "#333333", se = "#ffffff", he = C.parentElement;
|
|
5337
|
+
for (; he; ) {
|
|
5338
|
+
if (he.hasAttribute("data-gantt-theme")) {
|
|
5339
|
+
const ge = getComputedStyle(he);
|
|
5340
|
+
ce = ge.getPropertyValue("--primary").trim() || ce, j = ge.getPropertyValue("--text-primary").trim() || j, se = ge.getPropertyValue("--bg-content").trim() || se;
|
|
5339
5341
|
break;
|
|
5340
5342
|
}
|
|
5341
|
-
|
|
5343
|
+
he = he.parentElement;
|
|
5342
5344
|
}
|
|
5343
|
-
(se.includes("#1") || se.includes("#2") || se.toLowerCase().includes("dark")) &&
|
|
5344
|
-
const z = a.value, q = z / 2, h = e.rowHeight / 2, u = q, k = u, v = h - q, _ = u + q, Y = h, A = u, I = h + q, Q = u - q, ee = `M ${k},${v} L ${_},${Y} L ${A},${I} L ${Q},${h} Z`, Te = de.path(ee).fill(o.value || ce).stroke({ color:
|
|
5345
|
+
(se.includes("#1") || se.includes("#2") || se.toLowerCase().includes("dark")) && j === "#333333" && (j = "#ffffff"), de.clear();
|
|
5346
|
+
const z = a.value, q = z / 2, h = e.rowHeight / 2, u = q, k = u, v = h - q, _ = u + q, Y = h, A = u, I = h + q, Q = u - q, ee = `M ${k},${v} L ${_},${Y} L ${A},${I} L ${Q},${h} Z`, Te = de.path(ee).fill(o.value || ce).stroke({ color: Z, width: 2 }).attr("opacity", 0.9);
|
|
5345
5347
|
Te.on("mouseover", () => {
|
|
5346
5348
|
Te.animate(200).attr({ opacity: 1, strokeWidth: 3 });
|
|
5347
5349
|
}), Te.on("mouseleave", () => {
|
|
5348
5350
|
Te.animate(200).attr({ opacity: 0.9, strokeWidth: 2 });
|
|
5349
5351
|
});
|
|
5350
|
-
const Me = de.text(e.row[p.value.task] || "Milestone").move(z + 5, h - 7).fill(
|
|
5352
|
+
const Me = de.text(e.row[p.value.task] || "Milestone").move(z + 5, h - 7).fill(j).attr({
|
|
5351
5353
|
"font-size": "14px",
|
|
5352
5354
|
"font-family": "'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif",
|
|
5353
5355
|
"font-weight": "400",
|
|
@@ -5377,15 +5379,15 @@ const _o = Qe({
|
|
|
5377
5379
|
l.value = Number(ge.target.getAttribute("data-x"));
|
|
5378
5380
|
},
|
|
5379
5381
|
move: (ge) => {
|
|
5380
|
-
let
|
|
5381
|
-
ge.target.style.transform = `translate(${
|
|
5382
|
+
let me = ((parseFloat(ge.target.getAttribute("data-x") || "0") || 0) + ge.dx).toString();
|
|
5383
|
+
ge.target.style.transform = `translate(${me}px, 0px)`, ge.target.setAttribute("data-x", me);
|
|
5382
5384
|
},
|
|
5383
5385
|
end: (ge) => {
|
|
5384
|
-
let
|
|
5386
|
+
let me = ge.target, x = parseFloat(me.getAttribute("data-x") || "0") || 0, F = Math.round((x - f.value / 2) / f.value) * f.value + f.value / 2;
|
|
5385
5387
|
F < f.value / 2 && (F = f.value / 2), F > m.value * f.value && (F = m.value * f.value - f.value / 2);
|
|
5386
|
-
const W = p.value.parentId || "pid",
|
|
5387
|
-
if (
|
|
5388
|
-
const Ae = M.tasks.find((Ve) => String(Ve[p.value.id]) === String(
|
|
5388
|
+
const W = p.value.parentId || "pid", ae = e.row[W];
|
|
5389
|
+
if (ae && ae !== "0") {
|
|
5390
|
+
const Ae = M.tasks.find((Ve) => String(Ve[p.value.id]) === String(ae));
|
|
5389
5391
|
if (Ae) {
|
|
5390
5392
|
let Ve = 0;
|
|
5391
5393
|
if (y.value === "季度") {
|
|
@@ -5404,25 +5406,25 @@ const _o = Qe({
|
|
|
5404
5406
|
F < Ve && (F = Ve);
|
|
5405
5407
|
}
|
|
5406
5408
|
}
|
|
5407
|
-
|
|
5408
|
-
const
|
|
5409
|
+
me.style.transform = `translate(${F}px, 0px)`, me.setAttribute("data-x", F.toString());
|
|
5410
|
+
const J = Math.round((F - l.value) / f.value);
|
|
5409
5411
|
let re = 0, We = 0, Oe = 0, Pe = 0;
|
|
5410
|
-
if (y.value === "季度") Pe =
|
|
5411
|
-
else if (y.value === "月") Oe =
|
|
5412
|
+
if (y.value === "季度") Pe = J;
|
|
5413
|
+
else if (y.value === "月") Oe = J;
|
|
5412
5414
|
else if (y.value === "日")
|
|
5413
5415
|
if (M.daySubMode === "half") {
|
|
5414
5416
|
const Ve = Math.round((F - f.value / 2) / f.value), Ue = Math.floor(Ve / 2), ke = Ve % 2 === 0 ? 0 : 12, Je = g(e.startGanttDate).add(Ue, "days").hour(ke).minute(0).second(0);
|
|
5415
5417
|
e.row[p.value.startdate] = Je.format("YYYY-MM-DD HH:mm:ss"), e.row[p.value.enddate] = e.row[p.value.startdate];
|
|
5416
5418
|
} else
|
|
5417
|
-
re =
|
|
5418
|
-
else if (y.value === "周") re =
|
|
5419
|
+
re = J;
|
|
5420
|
+
else if (y.value === "周") re = J * 7;
|
|
5419
5421
|
else if (y.value === "时") {
|
|
5420
5422
|
const Ae = M.hourSubMode || "60", Ve = parseInt(Ae);
|
|
5421
5423
|
if (Ve < 60) {
|
|
5422
5424
|
const Ue = Math.round(F / f.value), et = 60 / Ve, ke = 24 * et, Je = Math.floor(Ue / ke), Be = Ue % ke, Le = Math.floor(Be / et), Ze = Be % et * Ve, oe = g(e.startGanttDate).add(Je, "days").hour(Le).minute(Ze).second(0);
|
|
5423
5425
|
e.row[p.value.startdate] = oe.format("YYYY-MM-DD HH:mm:ss"), e.row[p.value.enddate] = e.row[p.value.startdate];
|
|
5424
5426
|
} else
|
|
5425
|
-
We =
|
|
5427
|
+
We = J;
|
|
5426
5428
|
}
|
|
5427
5429
|
const Ee = y.value === "日" && M.daySubMode === "half";
|
|
5428
5430
|
if (y.value === "时" && (M.hourSubMode === "15" || M.hourSubMode), y.value === "季度")
|
|
@@ -5442,10 +5444,12 @@ const _o = Qe({
|
|
|
5442
5444
|
}
|
|
5443
5445
|
});
|
|
5444
5446
|
};
|
|
5445
|
-
return
|
|
5446
|
-
t.value &&
|
|
5447
|
-
}, { deep: !1 }),
|
|
5448
|
-
|
|
5447
|
+
return ye(() => [e.row[p.value.startdate]], () => {
|
|
5448
|
+
t.value && B(t.value);
|
|
5449
|
+
}, { deep: !1 }), ye([y, f], () => {
|
|
5450
|
+
t.value && B(t.value);
|
|
5451
|
+
}), gt(() => {
|
|
5452
|
+
if (t.value && B(t.value), T && (o.value = T(e.row), t.value && B(t.value)), t.value) {
|
|
5449
5453
|
let C = t.value.parentElement;
|
|
5450
5454
|
for (; C && !C.hasAttribute("data-gantt-theme"); )
|
|
5451
5455
|
C = C.parentElement;
|
|
@@ -5498,7 +5502,7 @@ function Lo(e, t, a, s, r, o) {
|
|
|
5498
5502
|
}, null, 10, Ho)) : fe("", !0)
|
|
5499
5503
|
], 46, Ao)) : fe("", !0);
|
|
5500
5504
|
}
|
|
5501
|
-
const Yo = /* @__PURE__ */ Xe(_o, [["render", Lo], ["__scopeId", "data-v-
|
|
5505
|
+
const Yo = /* @__PURE__ */ Xe(_o, [["render", Lo], ["__scopeId", "data-v-eea18236"]]), _n = {
|
|
5502
5506
|
// 虚拟滚动:上下缓冲区的行数
|
|
5503
5507
|
VIRTUAL_SCROLL_BUFFER: 5,
|
|
5504
5508
|
// 约60fps
|
|
@@ -5513,7 +5517,7 @@ const Yo = /* @__PURE__ */ Xe(_o, [["render", Lo], ["__scopeId", "data-v-5d31c7b
|
|
|
5513
5517
|
}
|
|
5514
5518
|
},
|
|
5515
5519
|
setup(e) {
|
|
5516
|
-
const t = $([]), a = $(0), s = $(null), r = $(0), o = $(0), n = $(0), l = $(0), m = Ot(ta.SetTaskTypeSymbol), f = E(() => M.tasks), y = E(() => M.timelineCellCount), p = E(() => M.scale), T = E(() => M.mode), V = E(() => M.startGanttDate ? M.startGanttDate.toISOString() : void 0), b = E(() => M.endGanttDate ? M.endGanttDate.toISOString() : void 0), L = E(() => M.mapFields), d = E(() => M.collapsedTasks), G = E(() => se.value.length >= _n.VIRTUAL_SCROLL_THRESHOLD), P = E(() => se.value.length * e.rowHeight), K = E(() => n.value * e.rowHeight),
|
|
5520
|
+
const t = $([]), a = $(0), s = $(null), r = $(0), o = $(0), n = $(0), l = $(0), m = Ot(ta.SetTaskTypeSymbol), f = E(() => M.tasks), y = E(() => M.timelineCellCount), p = E(() => M.scale), T = E(() => M.mode), V = E(() => M.startGanttDate ? M.startGanttDate.toISOString() : void 0), b = E(() => M.endGanttDate ? M.endGanttDate.toISOString() : void 0), L = E(() => M.mapFields), d = E(() => M.collapsedTasks), G = E(() => se.value.length >= _n.VIRTUAL_SCROLL_THRESHOLD), P = E(() => se.value.length * e.rowHeight), K = E(() => n.value * e.rowHeight), B = E(() => {
|
|
5517
5521
|
if (!G.value) return [];
|
|
5518
5522
|
const h = se.value, u = [];
|
|
5519
5523
|
for (let k = n.value; k <= l.value && k < h.length; k++)
|
|
@@ -5533,7 +5537,7 @@ const Yo = /* @__PURE__ */ Xe(_o, [["render", Lo], ["__scopeId", "data-v-5d31c7b
|
|
|
5533
5537
|
O || (O = requestAnimationFrame(() => {
|
|
5534
5538
|
C(), O = null;
|
|
5535
5539
|
}));
|
|
5536
|
-
},
|
|
5540
|
+
}, Z = (h) => {
|
|
5537
5541
|
if (m)
|
|
5538
5542
|
return m(h);
|
|
5539
5543
|
if (h.type)
|
|
@@ -5548,28 +5552,28 @@ const Yo = /* @__PURE__ */ Xe(_o, [["render", Lo], ["__scopeId", "data-v-5d31c7b
|
|
|
5548
5552
|
});
|
|
5549
5553
|
};
|
|
5550
5554
|
return k(h), u;
|
|
5551
|
-
},
|
|
5552
|
-
const h =
|
|
5555
|
+
}, j = E(() => new Set(t.value.map((h) => h[L.value.id]))), se = E(() => {
|
|
5556
|
+
const h = j.value, u = M.tasks.filter((v) => !h.has(v[L.value.id])), k = /* @__PURE__ */ new Set();
|
|
5553
5557
|
return d.value.forEach((v) => {
|
|
5554
5558
|
ce(v).forEach((Y) => k.add(Y));
|
|
5555
5559
|
}), u.filter((v) => !k.has(v[L.value.id]));
|
|
5556
|
-
}),
|
|
5560
|
+
}), he = E({
|
|
5557
5561
|
get: () => M.expandRow,
|
|
5558
5562
|
set: (h) => {
|
|
5559
|
-
|
|
5563
|
+
be.setExpandRow(h);
|
|
5560
5564
|
}
|
|
5561
5565
|
});
|
|
5562
|
-
|
|
5566
|
+
ye(he, (h) => {
|
|
5563
5567
|
t.value = [], z(h.pid);
|
|
5564
|
-
}),
|
|
5568
|
+
}), ye(() => se.value.length, () => {
|
|
5565
5569
|
C();
|
|
5566
5570
|
});
|
|
5567
5571
|
const z = (h) => {
|
|
5568
5572
|
let u = f.value.filter((k) => k[L.value.parentId] === h);
|
|
5569
5573
|
if (u && u.length > 0)
|
|
5570
5574
|
for (let k = 0; k < u.length; k++)
|
|
5571
|
-
|
|
5572
|
-
}, q =
|
|
5575
|
+
he.value.expand === !1 && t.value.push(u[k]), z(u[k][L.value.id]);
|
|
5576
|
+
}, q = be.setExpandRow;
|
|
5573
5577
|
return gt(() => {
|
|
5574
5578
|
if (s.value) {
|
|
5575
5579
|
const h = s.value.closest(".content");
|
|
@@ -5593,16 +5597,16 @@ const Yo = /* @__PURE__ */ Xe(_o, [["render", Lo], ["__scopeId", "data-v-5d31c7b
|
|
|
5593
5597
|
endGanttDate: b,
|
|
5594
5598
|
mapFields: L,
|
|
5595
5599
|
filterTask: se,
|
|
5596
|
-
expandRow:
|
|
5600
|
+
expandRow: he,
|
|
5597
5601
|
setExpandRow: q,
|
|
5598
5602
|
recursionRow: z,
|
|
5599
|
-
getTaskType:
|
|
5603
|
+
getTaskType: Z,
|
|
5600
5604
|
TaskType: Va,
|
|
5601
5605
|
// 虚拟滚动相关
|
|
5602
5606
|
useVirtualScroll: G,
|
|
5603
5607
|
totalHeight: P,
|
|
5604
5608
|
offsetY: K,
|
|
5605
|
-
visibleTasks:
|
|
5609
|
+
visibleTasks: B,
|
|
5606
5610
|
startIndex: n,
|
|
5607
5611
|
endIndex: l
|
|
5608
5612
|
};
|
|
@@ -5893,43 +5897,43 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
5893
5897
|
case ot.STRAIGHT:
|
|
5894
5898
|
return `M ${h} ${u} L ${k} ${v}`;
|
|
5895
5899
|
case ot.BEZIER:
|
|
5896
|
-
return
|
|
5900
|
+
return B(h, u, k, v, Y, A);
|
|
5897
5901
|
case ot.RIGHT_ANGLE:
|
|
5898
5902
|
default:
|
|
5899
5903
|
return C(h, u, k, v, Y, I, Q, N);
|
|
5900
5904
|
}
|
|
5901
|
-
},
|
|
5905
|
+
}, B = (h, u, k, v, _, Y) => {
|
|
5902
5906
|
const A = k - h, I = v - u;
|
|
5903
5907
|
switch (_) {
|
|
5904
5908
|
case "horizontal":
|
|
5905
5909
|
if (A > 20 && Math.abs(I) < 10)
|
|
5906
5910
|
return `M ${h} ${u} L ${k} ${v}`;
|
|
5907
5911
|
if (A < 20) {
|
|
5908
|
-
const
|
|
5912
|
+
const J = l(u, v, 30), re = 30 * Y;
|
|
5909
5913
|
return `M ${h} ${u}
|
|
5910
|
-
C ${h + re} ${u} ${h + re} ${
|
|
5911
|
-
C ${k - re} ${
|
|
5914
|
+
C ${h + re} ${u} ${h + re} ${J} ${h + 30 / 2} ${J}
|
|
5915
|
+
C ${k - re} ${J} ${k - re} ${v} ${k} ${v}`;
|
|
5912
5916
|
}
|
|
5913
5917
|
const Q = Math.min(Math.abs(A) * Y, 60), N = h + Q, ee = k - Q;
|
|
5914
5918
|
return `M ${h} ${u} C ${N} ${u} ${ee} ${v} ${k} ${v}`;
|
|
5915
5919
|
case "left-u":
|
|
5916
5920
|
const Te = 25, Me = Math.min(h, k) - Te, Fe = Te * Y;
|
|
5917
5921
|
if (Math.abs(I) > r()) {
|
|
5918
|
-
const
|
|
5922
|
+
const ae = o((u + v) / 2);
|
|
5919
5923
|
return `M ${h} ${u}
|
|
5920
|
-
C ${h - Fe} ${u} ${Me} ${u + Fe} ${Me} ${
|
|
5924
|
+
C ${h - Fe} ${u} ${Me} ${u + Fe} ${Me} ${ae}
|
|
5921
5925
|
C ${Me} ${v - Fe} ${k - Fe} ${v} ${k} ${v}`;
|
|
5922
5926
|
}
|
|
5923
5927
|
return `M ${h} ${u} C ${Me} ${u} ${Me} ${v} ${k} ${v}`;
|
|
5924
5928
|
case "right-u":
|
|
5925
|
-
const ge = 25,
|
|
5929
|
+
const ge = 25, me = Math.max(h, k) + ge, x = ge * Y;
|
|
5926
5930
|
if (Math.abs(I) > r()) {
|
|
5927
|
-
const
|
|
5931
|
+
const ae = o((u + v) / 2);
|
|
5928
5932
|
return `M ${h} ${u}
|
|
5929
|
-
C ${h + x} ${u} ${
|
|
5930
|
-
C ${
|
|
5933
|
+
C ${h + x} ${u} ${me} ${u + x} ${me} ${ae}
|
|
5934
|
+
C ${me} ${v - x} ${k + x} ${v} ${k} ${v}`;
|
|
5931
5935
|
}
|
|
5932
|
-
return `M ${h} ${u} C ${
|
|
5936
|
+
return `M ${h} ${u} C ${me} ${u} ${me} ${v} ${k} ${v}`;
|
|
5933
5937
|
case "cross":
|
|
5934
5938
|
if (A > 20 && Math.abs(I) < 10)
|
|
5935
5939
|
return `M ${h} ${u} L ${k} ${v}`;
|
|
@@ -5947,16 +5951,16 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
5947
5951
|
if (Q < 20) {
|
|
5948
5952
|
const x = Y, qe = l(u, v, x), F = h + x / 2, W = k - x / 2;
|
|
5949
5953
|
if (A && I > 0) {
|
|
5950
|
-
const
|
|
5954
|
+
const ae = Math.min(I, x / 4);
|
|
5951
5955
|
return `M ${h} ${u}
|
|
5952
|
-
L ${F -
|
|
5953
|
-
Q ${F} ${u} ${F} ${u +
|
|
5954
|
-
L ${F} ${qe -
|
|
5955
|
-
Q ${F} ${qe} ${F +
|
|
5956
|
-
L ${W -
|
|
5957
|
-
Q ${W} ${qe} ${W} ${qe +
|
|
5958
|
-
L ${W} ${v -
|
|
5959
|
-
Q ${W} ${v} ${W +
|
|
5956
|
+
L ${F - ae} ${u}
|
|
5957
|
+
Q ${F} ${u} ${F} ${u + ae}
|
|
5958
|
+
L ${F} ${qe - ae}
|
|
5959
|
+
Q ${F} ${qe} ${F + ae} ${qe}
|
|
5960
|
+
L ${W - ae} ${qe}
|
|
5961
|
+
Q ${W} ${qe} ${W} ${qe + ae}
|
|
5962
|
+
L ${W} ${v - ae}
|
|
5963
|
+
Q ${W} ${v} ${W + ae} ${v}
|
|
5960
5964
|
L ${k} ${v}`;
|
|
5961
5965
|
}
|
|
5962
5966
|
return `M ${h} ${u}
|
|
@@ -6009,22 +6013,22 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
6009
6013
|
case "cross":
|
|
6010
6014
|
if (Q > 20 && Math.abs(N) < 10)
|
|
6011
6015
|
return `M ${h} ${u} L ${k} ${v}`;
|
|
6012
|
-
const
|
|
6016
|
+
const me = h + Q / 2;
|
|
6013
6017
|
if (A && I > 0) {
|
|
6014
6018
|
const x = Math.min(I, Math.abs(Q) / 4, Math.abs(N) / 2);
|
|
6015
6019
|
return N > 0 ? `M ${h} ${u}
|
|
6016
|
-
L ${
|
|
6017
|
-
Q ${
|
|
6018
|
-
L ${
|
|
6019
|
-
Q ${
|
|
6020
|
+
L ${me - x} ${u}
|
|
6021
|
+
Q ${me} ${u} ${me} ${u + x}
|
|
6022
|
+
L ${me} ${v - x}
|
|
6023
|
+
Q ${me} ${v} ${me + x} ${v}
|
|
6020
6024
|
L ${k} ${v}` : `M ${h} ${u}
|
|
6021
|
-
L ${
|
|
6022
|
-
Q ${
|
|
6023
|
-
L ${
|
|
6024
|
-
Q ${
|
|
6025
|
+
L ${me - x} ${u}
|
|
6026
|
+
Q ${me} ${u} ${me} ${u - x}
|
|
6027
|
+
L ${me} ${v + x}
|
|
6028
|
+
Q ${me} ${v} ${me + x} ${v}
|
|
6025
6029
|
L ${k} ${v}`;
|
|
6026
6030
|
}
|
|
6027
|
-
return `M ${h} ${u} L ${
|
|
6031
|
+
return `M ${h} ${u} L ${me} ${u} L ${me} ${v} L ${k} ${v}`;
|
|
6028
6032
|
default:
|
|
6029
6033
|
return `M ${h} ${u} L ${k} ${v}`;
|
|
6030
6034
|
}
|
|
@@ -6062,7 +6066,7 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
6062
6066
|
} catch (_) {
|
|
6063
6067
|
return console.error("依赖箭头生成失败:", _), "";
|
|
6064
6068
|
}
|
|
6065
|
-
},
|
|
6069
|
+
}, Z = (h) => {
|
|
6066
6070
|
const u = /* @__PURE__ */ new Set(), k = (v) => {
|
|
6067
6071
|
M.tasks.filter((Y) => Y[M.mapFields.parentId] === v).forEach((Y) => {
|
|
6068
6072
|
const A = Y[M.mapFields.id];
|
|
@@ -6072,10 +6076,10 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
6072
6076
|
return k(h), u;
|
|
6073
6077
|
}, ce = (h) => {
|
|
6074
6078
|
for (const u of M.collapsedTasks)
|
|
6075
|
-
if (
|
|
6079
|
+
if (Z(u).has(h))
|
|
6076
6080
|
return !0;
|
|
6077
6081
|
return !1;
|
|
6078
|
-
},
|
|
6082
|
+
}, j = () => {
|
|
6079
6083
|
const h = [], u = e.linkConfig.linkTypeVisibility || {
|
|
6080
6084
|
finishToStart: !0,
|
|
6081
6085
|
startToStart: !0,
|
|
@@ -6163,28 +6167,28 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
6163
6167
|
}
|
|
6164
6168
|
}), t.value = h;
|
|
6165
6169
|
};
|
|
6166
|
-
|
|
6167
|
-
setTimeout(
|
|
6168
|
-
}, { deep: !0 }),
|
|
6169
|
-
setTimeout(
|
|
6170
|
-
}),
|
|
6171
|
-
setTimeout(
|
|
6172
|
-
}),
|
|
6173
|
-
setTimeout(
|
|
6174
|
-
}),
|
|
6175
|
-
setTimeout(
|
|
6176
|
-
}),
|
|
6177
|
-
requestAnimationFrame(
|
|
6178
|
-
}, { deep: !0 }),
|
|
6179
|
-
setTimeout(
|
|
6180
|
-
}, { deep: !0 }),
|
|
6181
|
-
setTimeout(
|
|
6170
|
+
ye(() => M.tasks, () => {
|
|
6171
|
+
setTimeout(j, 50);
|
|
6172
|
+
}, { deep: !0 }), ye(() => M.scale, () => {
|
|
6173
|
+
setTimeout(j, 50);
|
|
6174
|
+
}), ye(() => M.mode, () => {
|
|
6175
|
+
setTimeout(j, 200);
|
|
6176
|
+
}), ye(() => M.timelineCellCount, () => {
|
|
6177
|
+
setTimeout(j, 100);
|
|
6178
|
+
}), ye(() => [M.startGanttDate, M.endGanttDate], () => {
|
|
6179
|
+
setTimeout(j, 100);
|
|
6180
|
+
}), ye(() => M.barDate, () => {
|
|
6181
|
+
requestAnimationFrame(j);
|
|
6182
|
+
}, { deep: !0 }), ye(() => e.linkConfig.linkTypeVisibility, () => {
|
|
6183
|
+
setTimeout(j, 50);
|
|
6184
|
+
}, { deep: !0 }), ye(() => M.collapsedTasks, () => {
|
|
6185
|
+
setTimeout(j, 50);
|
|
6182
6186
|
}, { deep: !0 });
|
|
6183
|
-
let se = null,
|
|
6187
|
+
let se = null, he = null;
|
|
6184
6188
|
gt(() => {
|
|
6185
|
-
setTimeout(
|
|
6189
|
+
setTimeout(j, 100);
|
|
6186
6190
|
const h = document.querySelector(".gantt");
|
|
6187
|
-
h && (se = new ResizeObserver(
|
|
6191
|
+
h && (se = new ResizeObserver(j), se.observe(h), he = new MutationObserver((u) => {
|
|
6188
6192
|
let k = !1;
|
|
6189
6193
|
u.forEach((v) => {
|
|
6190
6194
|
var Y, A;
|
|
@@ -6193,14 +6197,14 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
6193
6197
|
const I = v.attributeName;
|
|
6194
6198
|
(I === "data-x" || I === "width" || I === "style" || I === "transform") && ((Y = _.classList) != null && Y.contains("bar") || (A = _.classList) != null && A.contains("barRow") || _.tagName === "svg") && (k = !0);
|
|
6195
6199
|
}
|
|
6196
|
-
}), k && requestAnimationFrame(
|
|
6197
|
-
}),
|
|
6200
|
+
}), k && requestAnimationFrame(j);
|
|
6201
|
+
}), he.observe(h, {
|
|
6198
6202
|
attributes: !0,
|
|
6199
6203
|
subtree: !0,
|
|
6200
6204
|
attributeFilter: ["style", "data-x", "transform", "width"]
|
|
6201
6205
|
}));
|
|
6202
6206
|
}), qt(() => {
|
|
6203
|
-
se && se.disconnect(),
|
|
6207
|
+
se && se.disconnect(), he && he.disconnect();
|
|
6204
6208
|
});
|
|
6205
6209
|
const z = (h) => {
|
|
6206
6210
|
const u = f(h);
|
|
@@ -6208,7 +6212,7 @@ const Ro = /* @__PURE__ */ Xe(Io, [["render", Eo], ["__scopeId", "data-v-6a210a0
|
|
|
6208
6212
|
};
|
|
6209
6213
|
return {
|
|
6210
6214
|
links: t,
|
|
6211
|
-
updateLinks:
|
|
6215
|
+
updateLinks: j,
|
|
6212
6216
|
getLinkStyle: f,
|
|
6213
6217
|
isDashedLine: z,
|
|
6214
6218
|
getDashAnimationStyle: (h) => {
|
|
@@ -6288,19 +6292,19 @@ const Bo = /* @__PURE__ */ Xe(Oo, [["render", xo], ["__scopeId", "data-v-dc9db72
|
|
|
6288
6292
|
},
|
|
6289
6293
|
setup(e) {
|
|
6290
6294
|
const t = $(null), { scrollTop: a, scrollFlag: s, setScrollTop: r, setScrollFlag: o } = zn(), { config: n } = en(), l = E(() => M.tasks), m = E(() => M.timelineCellCount), f = E(() => M.scale), y = E(() => M.mode), p = E(() => M.startGanttDate), T = E(() => M.endGanttDate), V = E(() => M.mapFields), b = E(() => m.value * f.value), L = E(() => l.value.length * e.rowHeight);
|
|
6291
|
-
|
|
6292
|
-
s.value && t.value && (t.value.scrollTop =
|
|
6295
|
+
ye(a, (Z) => {
|
|
6296
|
+
s.value && t.value && (t.value.scrollTop = Z);
|
|
6293
6297
|
}), gt(() => {
|
|
6294
6298
|
t.value && (t.value.scrollTop = a.value);
|
|
6295
6299
|
});
|
|
6296
|
-
const d = () => l.value.filter((
|
|
6300
|
+
const d = () => l.value.filter((Z) => Z[V.value.parentId] === "0");
|
|
6297
6301
|
let G = null;
|
|
6298
6302
|
const P = () => {
|
|
6299
6303
|
G && cancelAnimationFrame(G), G = requestAnimationFrame(() => {
|
|
6300
6304
|
t.value && (o(!1), r(t.value.scrollTop)), G = null;
|
|
6301
6305
|
});
|
|
6302
6306
|
}, K = () => {
|
|
6303
|
-
},
|
|
6307
|
+
}, B = $(!1), C = $(0);
|
|
6304
6308
|
return {
|
|
6305
6309
|
barContent: t,
|
|
6306
6310
|
scrollFlag: s,
|
|
@@ -6318,15 +6322,15 @@ const Bo = /* @__PURE__ */ Xe(Oo, [["render", xo], ["__scopeId", "data-v-dc9db72
|
|
|
6318
6322
|
containerWidth: b,
|
|
6319
6323
|
containerHeight: L,
|
|
6320
6324
|
linkConfig: n,
|
|
6321
|
-
showGuideLine:
|
|
6325
|
+
showGuideLine: B,
|
|
6322
6326
|
guideLineX: C,
|
|
6323
|
-
handleMouseMove: (
|
|
6327
|
+
handleMouseMove: (Z) => {
|
|
6324
6328
|
if (!t.value) return;
|
|
6325
|
-
const ce = t.value.getBoundingClientRect(),
|
|
6326
|
-
C.value = z,
|
|
6329
|
+
const ce = t.value.getBoundingClientRect(), j = Z.clientX - ce.left + t.value.scrollLeft, se = f.value, z = Math.floor(j / se) * se + se / 2;
|
|
6330
|
+
C.value = z, B.value = !0;
|
|
6327
6331
|
},
|
|
6328
6332
|
handleMouseLeave: () => {
|
|
6329
|
-
|
|
6333
|
+
B.value = !1;
|
|
6330
6334
|
}
|
|
6331
6335
|
};
|
|
6332
6336
|
}
|
|
@@ -6404,7 +6408,7 @@ const qo = /* @__PURE__ */ Xe(jo, [["render", Go], ["__scopeId", "data-v-5196853
|
|
|
6404
6408
|
break;
|
|
6405
6409
|
}
|
|
6406
6410
|
};
|
|
6407
|
-
return
|
|
6411
|
+
return ye(() => yt.shouldScrollToToday, (y) => {
|
|
6408
6412
|
y && (f(), yt.shouldScrollToToday = !1);
|
|
6409
6413
|
}), gt(() => {
|
|
6410
6414
|
}), {
|
|
@@ -6992,7 +6996,7 @@ const Il = /* @__PURE__ */ Xe(_l, [["render", Yl], ["__scopeId", "data-v-c58f997
|
|
|
6992
6996
|
CheckboxConfig: Il
|
|
6993
6997
|
},
|
|
6994
6998
|
setup() {
|
|
6995
|
-
var
|
|
6999
|
+
var B, C, O, de, Z, ce, j, se, he, z, q, h;
|
|
6996
7000
|
const { t: e, locale: t, setLocale: a, getLocales: s } = Mt(), r = $(!1), o = $(pt), n = $("metro"), l = $(null), m = E(() => t.value), f = E(() => s()), y = (u) => {
|
|
6997
7001
|
a(u);
|
|
6998
7002
|
}, p = Ot("ganttContainer"), { config: T, updateConfig: V } = en(), b = $({
|
|
@@ -7013,19 +7017,19 @@ const Il = /* @__PURE__ */ Xe(_l, [["render", Yl], ["__scopeId", "data-v-c58f997
|
|
|
7013
7017
|
labelColor: T.labelColor || "#333333",
|
|
7014
7018
|
labelFontSize: T.labelFontSize || 12,
|
|
7015
7019
|
parentChildStyle: {
|
|
7016
|
-
color: ((
|
|
7020
|
+
color: ((B = T.parentChildStyle) == null ? void 0 : B.color) || "#999999",
|
|
7017
7021
|
width: ((C = T.parentChildStyle) == null ? void 0 : C.width) || 1.5,
|
|
7018
7022
|
dashArray: ((O = T.parentChildStyle) == null ? void 0 : O.dashArray) || "3,3"
|
|
7019
7023
|
},
|
|
7020
7024
|
linkTypeColors: {
|
|
7021
7025
|
finishToStart: ((de = T.linkTypeColors) == null ? void 0 : de.finishToStart) || "#3498db",
|
|
7022
|
-
startToStart: ((
|
|
7026
|
+
startToStart: ((Z = T.linkTypeColors) == null ? void 0 : Z.startToStart) || "#2ecc71",
|
|
7023
7027
|
finishToFinish: ((ce = T.linkTypeColors) == null ? void 0 : ce.finishToFinish) || "#e74c3c",
|
|
7024
|
-
startToFinish: ((
|
|
7028
|
+
startToFinish: ((j = T.linkTypeColors) == null ? void 0 : j.startToFinish) || "#f39c12"
|
|
7025
7029
|
},
|
|
7026
7030
|
linkTypeVisibility: {
|
|
7027
7031
|
finishToStart: ((se = T.linkTypeVisibility) == null ? void 0 : se.finishToStart) ?? !0,
|
|
7028
|
-
startToStart: ((
|
|
7032
|
+
startToStart: ((he = T.linkTypeVisibility) == null ? void 0 : he.startToStart) ?? !0,
|
|
7029
7033
|
finishToFinish: ((z = T.linkTypeVisibility) == null ? void 0 : z.finishToFinish) ?? !0,
|
|
7030
7034
|
startToFinish: ((q = T.linkTypeVisibility) == null ? void 0 : q.startToFinish) ?? !0,
|
|
7031
7035
|
parentChild: ((h = T.linkTypeVisibility) == null ? void 0 : h.parentChild) ?? !0
|
|
@@ -10496,47 +10500,47 @@ const Ju = Qe({
|
|
|
10496
10500
|
l({
|
|
10497
10501
|
linkTypeVisibility: { [c]: D }
|
|
10498
10502
|
});
|
|
10499
|
-
}, y = $([]), p = $(35), T = $(["button", "button", "button", "button is-active", "button"]), V = $("日"), b = $(M.daySubMode), L = $("60"), d = $(!1), G = $(!1), P = $(null), K = $(null),
|
|
10503
|
+
}, y = $([]), p = $(35), T = $(["button", "button", "button", "button is-active", "button"]), V = $("日"), b = $(M.daySubMode), L = $("60"), d = $(!1), G = $(!1), P = $(null), K = $(null), B = $(null), C = $(null), O = $(0), de = $(0), Z = $(0), ce = $(0), j = $(
|
|
10500
10504
|
e.dataConfig.queryStartDate || g().locale(s()).startOf("month").format("YYYY-MM-DD")
|
|
10501
|
-
), se = $(g().locale(s()).add(-5, "y").format("YYYY-MM-DD")),
|
|
10505
|
+
), se = $(g().locale(s()).add(-5, "y").format("YYYY-MM-DD")), he = $(g().locale(s()).add(5, "y").format("YYYY-MM-DD")), z = $(!1), q = $(j.value), h = $(
|
|
10502
10506
|
e.dataConfig.queryEndDate || g().locale(s()).endOf("month").format("YYYY-MM-DD")
|
|
10503
|
-
), u = $(g().locale(s()).add(-5, "y").format("YYYY-MM-DD")), k = $(g(
|
|
10504
|
-
const D = g(q.value),
|
|
10505
|
-
if (!(!D.isValid() || !
|
|
10507
|
+
), u = $(g().locale(s()).add(-5, "y").format("YYYY-MM-DD")), k = $(g(j.value).locale(s()).add(5, "y").format("YYYY-MM-DD")), v = $(!1), _ = $(h.value), Y = $([]), A = $([]), I = $([]), Q = $([]), N = $(0), ee = $(0), Te = $(j.value + " 00:00:00"), Me = $(h.value + " 23:59:59"), Fe = $(""), ge = $(), me = E(() => M.subTask), x = E(() => M.editTask), qe = E(() => M.removeTask), F = E(() => M.rootTask), W = E(() => M.allowChangeTaskDate), ae = (c) => {
|
|
10508
|
+
const D = g(q.value), te = g(_.value);
|
|
10509
|
+
if (!(!D.isValid() || !te.isValid() || te.diff(D, "day") < 0))
|
|
10506
10510
|
switch (Te.value = q.value + " 00:00:00", Me.value = _.value + " 23:59:59", I.value = [], A.value = [], Y.value = [], Q.value = [], c) {
|
|
10507
10511
|
case "季度": {
|
|
10508
10512
|
N.value = 200;
|
|
10509
|
-
const
|
|
10513
|
+
const U = [];
|
|
10510
10514
|
let ue = D.startOf("quarter");
|
|
10511
|
-
const Ye =
|
|
10515
|
+
const Ye = te.endOf("quarter");
|
|
10512
10516
|
for (; ue.isBefore(Ye) || ue.isSame(Ye, "quarter"); )
|
|
10513
|
-
|
|
10514
|
-
[...new Set(
|
|
10515
|
-
const De =
|
|
10517
|
+
U.push(ue), ue = ue.add(1, "quarter");
|
|
10518
|
+
[...new Set(U.map((ze) => ze.year()))].forEach((ze) => {
|
|
10519
|
+
const De = U.filter((tt) => tt.year() === ze), Ie = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value);
|
|
10516
10520
|
Y.value.push({
|
|
10517
10521
|
title: ze + (Ie ? "年" : ""),
|
|
10518
10522
|
width: De.length * N.value
|
|
10519
10523
|
});
|
|
10520
|
-
}),
|
|
10524
|
+
}), U.forEach((ze) => {
|
|
10521
10525
|
const De = ze.quarter(), tt = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value) ? `第${De}季度` : `Q${De}`;
|
|
10522
10526
|
A.value.push({
|
|
10523
10527
|
title: tt,
|
|
10524
10528
|
width: N.value,
|
|
10525
10529
|
fulldate: ze.format("YYYY-MM-DD")
|
|
10526
10530
|
});
|
|
10527
|
-
}), ee.value =
|
|
10531
|
+
}), ee.value = U.length;
|
|
10528
10532
|
break;
|
|
10529
10533
|
}
|
|
10530
10534
|
case "月": {
|
|
10531
10535
|
N.value = 120;
|
|
10532
|
-
let
|
|
10533
|
-
const ue =
|
|
10534
|
-
let Ke =
|
|
10536
|
+
let U = D.startOf("month");
|
|
10537
|
+
const ue = te.endOf("month"), Ye = [];
|
|
10538
|
+
let Ke = U.startOf("year");
|
|
10535
10539
|
for (; Ke.isBefore(ue) || Ke.isSame(ue, "year"); )
|
|
10536
10540
|
Ye.push(Ke.year()), Ke = Ke.add(1, "year");
|
|
10537
10541
|
for (Ye.forEach((ze) => {
|
|
10538
10542
|
g().year(ze).startOf("year").endOf("year");
|
|
10539
|
-
let Ie = 0, tt =
|
|
10543
|
+
let Ie = 0, tt = U.clone();
|
|
10540
10544
|
for (; tt.isBefore(ue) || tt.isSame(ue, "month"); )
|
|
10541
10545
|
tt.year() === ze && Ie++, tt = tt.add(1, "month");
|
|
10542
10546
|
if (Ie > 0) {
|
|
@@ -10546,27 +10550,27 @@ const Ju = Qe({
|
|
|
10546
10550
|
width: Ie * N.value
|
|
10547
10551
|
});
|
|
10548
10552
|
}
|
|
10549
|
-
}),
|
|
10550
|
-
const ze =
|
|
10553
|
+
}), U = D.startOf("month"); U.isBefore(ue) || U.isSame(ue, "month"); ) {
|
|
10554
|
+
const ze = U.locale(s()).format("MMM");
|
|
10551
10555
|
I.value.push({
|
|
10552
10556
|
title: ze,
|
|
10553
10557
|
width: N.value,
|
|
10554
|
-
fulldate:
|
|
10555
|
-
}),
|
|
10558
|
+
fulldate: U.format("YYYY-MM-DD")
|
|
10559
|
+
}), U = U.add(1, "month");
|
|
10556
10560
|
}
|
|
10557
10561
|
ee.value = I.value.length;
|
|
10558
10562
|
break;
|
|
10559
10563
|
}
|
|
10560
10564
|
case "周": {
|
|
10561
10565
|
N.value = 120;
|
|
10562
|
-
let
|
|
10563
|
-
const ue =
|
|
10564
|
-
let Ke =
|
|
10566
|
+
let U = D.startOf("isoWeek");
|
|
10567
|
+
const ue = te.endOf("isoWeek"), Ye = [];
|
|
10568
|
+
let Ke = U.startOf("month");
|
|
10565
10569
|
for (; Ke.isBefore(ue) || Ke.isSame(ue, "month"); )
|
|
10566
10570
|
Ye.push(Ke.format("YYYY-MM-DD")), Ke = Ke.add(1, "month");
|
|
10567
10571
|
for (Ye.forEach((ze, De) => {
|
|
10568
10572
|
const Ie = g(ze), tt = Ie.endOf("month");
|
|
10569
|
-
let it = 0, rt =
|
|
10573
|
+
let it = 0, rt = U.clone();
|
|
10570
10574
|
for (; rt.isBefore(ue) || rt.isSame(ue, "week"); ) {
|
|
10571
10575
|
const bt = rt.startOf("isoWeek"), Ht = rt.endOf("isoWeek");
|
|
10572
10576
|
(bt.isSame(Ie, "month") || Ht.isSame(Ie, "month") || bt.isBefore(tt) && Ht.isAfter(Ie)) && it++, rt = rt.add(1, "week");
|
|
@@ -10578,26 +10582,26 @@ const Ju = Qe({
|
|
|
10578
10582
|
width: it * N.value
|
|
10579
10583
|
});
|
|
10580
10584
|
}
|
|
10581
|
-
});
|
|
10582
|
-
const ze =
|
|
10585
|
+
}); U.isBefore(ue) || U.isSame(ue, "week"); ) {
|
|
10586
|
+
const ze = U.startOf("isoWeek"), De = U.endOf("isoWeek"), tt = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value) ? `第${U.isoWeek()}周 (${ze.format("MM/DD")}-${De.format("MM/DD")})` : `Week ${U.isoWeek()} (${ze.format("MM/DD")}-${De.format("MM/DD")})`;
|
|
10583
10587
|
I.value.push({
|
|
10584
10588
|
title: tt,
|
|
10585
10589
|
width: N.value,
|
|
10586
10590
|
fulldate: ze.format("YYYY-MM-DD")
|
|
10587
|
-
}),
|
|
10591
|
+
}), U = U.add(1, "week");
|
|
10588
10592
|
}
|
|
10589
10593
|
ee.value = I.value.length;
|
|
10590
10594
|
break;
|
|
10591
10595
|
}
|
|
10592
10596
|
case "日": {
|
|
10593
|
-
const
|
|
10594
|
-
N.value =
|
|
10597
|
+
const U = b.value === "half";
|
|
10598
|
+
N.value = U ? 40 : 80;
|
|
10595
10599
|
let ue = D;
|
|
10596
10600
|
const Ye = [];
|
|
10597
|
-
for (; ue.isBefore(
|
|
10601
|
+
for (; ue.isBefore(te) || ue.isSame(te, "day"); )
|
|
10598
10602
|
Ye.push(ue), ue = ue.add(1, "day");
|
|
10599
10603
|
[...new Set(Ye.map((De) => De.year()))].forEach((De) => {
|
|
10600
|
-
const Ie = Ye.filter((rt) => rt.year() === De), tt = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value), it =
|
|
10604
|
+
const Ie = Ye.filter((rt) => rt.year() === De), tt = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value), it = U ? Ie.length * 2 * N.value : Ie.length * N.value;
|
|
10601
10605
|
Y.value.push({
|
|
10602
10606
|
title: De + (tt ? "年" : ""),
|
|
10603
10607
|
width: it
|
|
@@ -10608,13 +10612,13 @@ const Ju = Qe({
|
|
|
10608
10612
|
const Ie = `${De.year()}-${De.month()}`;
|
|
10609
10613
|
ze.has(Ie) || ze.set(Ie, []), ze.get(Ie).push(De);
|
|
10610
10614
|
}), ze.forEach((De, Ie) => {
|
|
10611
|
-
const tt = De[0].locale(s()).format("MMM"), it =
|
|
10615
|
+
const tt = De[0].locale(s()).format("MMM"), it = U ? De.length * 2 * N.value : De.length * N.value;
|
|
10612
10616
|
I.value.push({
|
|
10613
10617
|
title: tt,
|
|
10614
10618
|
width: it,
|
|
10615
10619
|
fulldate: De[0].format("YYYY-MM-DD")
|
|
10616
10620
|
});
|
|
10617
|
-
}),
|
|
10621
|
+
}), U ? (Ye.forEach((De) => {
|
|
10618
10622
|
const tt = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value) ? De.format("DD") + "日" : De.format("DD"), it = De.format("YYYY-MM-DD");
|
|
10619
10623
|
A.value.push({
|
|
10620
10624
|
title: tt,
|
|
@@ -10642,10 +10646,10 @@ const Ju = Qe({
|
|
|
10642
10646
|
break;
|
|
10643
10647
|
}
|
|
10644
10648
|
case "时": {
|
|
10645
|
-
const
|
|
10646
|
-
N.value =
|
|
10649
|
+
const U = parseInt(L.value), ue = 60 / U;
|
|
10650
|
+
N.value = U === 60 ? 30 : U === 30 ? 40 : 50;
|
|
10647
10651
|
let Ye = D;
|
|
10648
|
-
const Ke =
|
|
10652
|
+
const Ke = te.endOf("day");
|
|
10649
10653
|
for (; Ye.isBefore(Ke); ) {
|
|
10650
10654
|
const De = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value) ? Ye.locale(s()).format("MMMM DD") + "日" : Ye.locale(s()).format("MMMM DD"), Ie = Ye.format("YYYY-MM-DD"), tt = Ye.locale(s()).format("dddd"), it = ue * 24 * N.value;
|
|
10651
10655
|
I.value.push({
|
|
@@ -10659,10 +10663,10 @@ const Ju = Qe({
|
|
|
10659
10663
|
});
|
|
10660
10664
|
for (let rt = 0; rt <= 23; rt++)
|
|
10661
10665
|
for (let bt = 0; bt < ue; bt++) {
|
|
10662
|
-
const Ht = bt *
|
|
10666
|
+
const Ht = bt * U;
|
|
10663
10667
|
let Jt;
|
|
10664
10668
|
const Da = ["zh-CN", "zh-TW", "ja-JP", "ko-KR"].includes(a.value);
|
|
10665
|
-
if (
|
|
10669
|
+
if (U === 60)
|
|
10666
10670
|
Jt = Da ? rt + "点" : `${rt}:00`;
|
|
10667
10671
|
else {
|
|
10668
10672
|
const Kt = Ht.toString().padStart(2, "0");
|
|
@@ -10680,19 +10684,17 @@ const Ju = Qe({
|
|
|
10680
10684
|
break;
|
|
10681
10685
|
}
|
|
10682
10686
|
}
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
}, re = (c, D, ae) => {
|
|
10689
|
-
let ie = D.filter((J) => J[r.value.parentId] === c);
|
|
10687
|
+
}, J = (c, D) => {
|
|
10688
|
+
let te = c.filter((ie) => ie[r.value.id] === D);
|
|
10689
|
+
te && te.length > 0 && (Fe.value = te[0].index + "." + Fe.value, J(c, te[0][r.value.parentId]));
|
|
10690
|
+
}, re = (c, D, te) => {
|
|
10691
|
+
let ie = D.filter((U) => U[r.value.parentId] === c);
|
|
10690
10692
|
if (ie && ie.length > 0) {
|
|
10691
|
-
|
|
10692
|
-
for (let
|
|
10693
|
-
ie[
|
|
10694
|
-
let ue = y.value.filter((Ye) => Ye[r.value.id] === ie[
|
|
10695
|
-
Fe.value = "", ue && ue.length > 0 ? (Fe.value = ue[0].index + "." + ie[
|
|
10693
|
+
te++;
|
|
10694
|
+
for (let U = 0; U < ie.length; U++) {
|
|
10695
|
+
ie[U].treeLevel = te, ie[U].index = U + 1;
|
|
10696
|
+
let ue = y.value.filter((Ye) => Ye[r.value.id] === ie[U][r.value.parentId]);
|
|
10697
|
+
Fe.value = "", ue && ue.length > 0 ? (Fe.value = ue[0].index + "." + ie[U].index, J(y.value, ue[0][r.value.parentId]), ie[U].no = Fe.value) : ie[U].no = U + 1 + "", y.value.push(ie[U]), re(ie[U][r.value.id], D, te);
|
|
10696
10698
|
}
|
|
10697
10699
|
}
|
|
10698
10700
|
}, We = (c) => {
|
|
@@ -10725,7 +10727,7 @@ const Ju = Qe({
|
|
|
10725
10727
|
D && (D.scrollLeft = 0);
|
|
10726
10728
|
});
|
|
10727
10729
|
}, Oe = () => {
|
|
10728
|
-
|
|
10730
|
+
be.setDaySubMode(b.value), ae("日");
|
|
10729
10731
|
}, Pe = E(() => ({
|
|
10730
10732
|
position: "fixed",
|
|
10731
10733
|
top: `${O.value}px`,
|
|
@@ -10733,7 +10735,7 @@ const Ju = Qe({
|
|
|
10733
10735
|
zIndex: 100002
|
|
10734
10736
|
})), Ee = E(() => ({
|
|
10735
10737
|
position: "fixed",
|
|
10736
|
-
top: `${
|
|
10738
|
+
top: `${Z.value}px`,
|
|
10737
10739
|
left: `${ce.value}px`,
|
|
10738
10740
|
zIndex: 100002
|
|
10739
10741
|
})), Ae = () => {
|
|
@@ -10745,78 +10747,78 @@ const Ju = Qe({
|
|
|
10745
10747
|
(!C.value || !document.querySelector(".hour-submenu-popup:hover")) && (G.value = !1);
|
|
10746
10748
|
}, 100);
|
|
10747
10749
|
}, Ue = (c) => {
|
|
10748
|
-
b.value = c,
|
|
10750
|
+
b.value = c, be.setDaySubMode(c), ae("日"), d.value = !1;
|
|
10749
10751
|
}, et = (c) => {
|
|
10750
|
-
L.value = c,
|
|
10752
|
+
L.value = c, be.setHourSubMode(c), ae("时"), G.value = !1;
|
|
10751
10753
|
};
|
|
10752
|
-
|
|
10754
|
+
ye(d, (c) => {
|
|
10753
10755
|
if (c && P.value) {
|
|
10754
10756
|
const D = P.value.getBoundingClientRect();
|
|
10755
10757
|
O.value = D.bottom + 5, de.value = D.left;
|
|
10756
10758
|
}
|
|
10757
|
-
}),
|
|
10758
|
-
if (c &&
|
|
10759
|
-
const D =
|
|
10760
|
-
|
|
10759
|
+
}), ye(G, (c) => {
|
|
10760
|
+
if (c && B.value) {
|
|
10761
|
+
const D = B.value.getBoundingClientRect();
|
|
10762
|
+
Z.value = D.bottom + 5, ce.value = D.left;
|
|
10761
10763
|
}
|
|
10762
10764
|
});
|
|
10763
10765
|
const ke = (c) => {
|
|
10764
|
-
g(h.value).diff(g(c.date), "days") < 0 && (_.value = c.date, h.value = c.date,
|
|
10766
|
+
g(h.value).diff(g(c.date), "days") < 0 && (_.value = c.date, h.value = c.date, be.setEndGanttDate(g(c.date).toDate())), z.value = !1, q.value = c.date, j.value = c.date, be.setStartGanttDate(g(c.date).toDate()), u.value = c.date;
|
|
10765
10767
|
}, Je = (c) => {
|
|
10766
|
-
g(c.date).diff(g(
|
|
10768
|
+
g(c.date).diff(g(j.value), "days") < 0 && (q.value = g(c.date).format("YYYY-MM-DD"), j.value = g(c.date).format("YYYY-MM-DD"), be.setStartGanttDate(g(c.date).toDate())), v.value = !1, _.value = c.date, h.value = c.date, be.setEndGanttDate(g(c.date).toDate());
|
|
10767
10769
|
};
|
|
10768
|
-
|
|
10769
|
-
(c !== ie || D !==
|
|
10770
|
-
}),
|
|
10771
|
-
|
|
10772
|
-
}),
|
|
10770
|
+
ye([V, q, _], ([c, D, te], [ie, U, ue]) => {
|
|
10771
|
+
(c !== ie || D !== U || te !== ue) && (ae(c), (D !== U || te !== ue) && e.eventConfig.queryTask(q.value, _.value, V.value));
|
|
10772
|
+
}), ye(a, () => {
|
|
10773
|
+
ae(V.value);
|
|
10774
|
+
}), ye(F, (c) => {
|
|
10773
10775
|
e.eventConfig.addRootTask(c);
|
|
10774
|
-
}),
|
|
10776
|
+
}), ye(me, (c) => {
|
|
10775
10777
|
e.eventConfig.addSubTask(c);
|
|
10776
|
-
}),
|
|
10778
|
+
}), ye(qe, (c) => {
|
|
10777
10779
|
e.eventConfig.removeTask(c);
|
|
10778
|
-
}),
|
|
10780
|
+
}), ye(x, (c) => {
|
|
10779
10781
|
e.eventConfig.editTask(c);
|
|
10780
|
-
}),
|
|
10782
|
+
}), ye(W, (c) => {
|
|
10781
10783
|
e.eventConfig.allowChangeTaskDate(c);
|
|
10782
|
-
}),
|
|
10784
|
+
}), ye(() => M.barDate, (c) => {
|
|
10783
10785
|
if (c) {
|
|
10784
|
-
const { id: D, startDate:
|
|
10785
|
-
D &&
|
|
10786
|
+
const { id: D, startDate: te, endDate: ie } = c;
|
|
10787
|
+
D && te && ie && e.eventConfig.barDate(D, te, ie);
|
|
10786
10788
|
}
|
|
10787
|
-
}),
|
|
10788
|
-
|
|
10789
|
-
}),
|
|
10790
|
-
|
|
10791
|
-
}),
|
|
10792
|
-
|
|
10793
|
-
}),
|
|
10794
|
-
|
|
10795
|
-
}),
|
|
10796
|
-
c &&
|
|
10797
|
-
}),
|
|
10798
|
-
c && (
|
|
10799
|
-
}),
|
|
10800
|
-
c && (
|
|
10801
|
-
}),
|
|
10802
|
-
c &&
|
|
10789
|
+
}), ye(N, (c) => {
|
|
10790
|
+
be.setScale(c);
|
|
10791
|
+
}), ye(() => e.dataConfig.taskHeaders, (c) => {
|
|
10792
|
+
be.setTaskHeaders(c);
|
|
10793
|
+
}), ye([Y, A, I, Q], ([c, D, te, ie]) => {
|
|
10794
|
+
be.setMonthHeaders(c), be.setDayHeaders(D), be.setWeekHeaders(te), be.setHourHeaders(ie);
|
|
10795
|
+
}), ye(V, (c) => {
|
|
10796
|
+
be.setMode(c);
|
|
10797
|
+
}), ye(r, (c) => {
|
|
10798
|
+
c && be.setMapFields(c);
|
|
10799
|
+
}), ye(() => e.dataConfig.queryStartDate, (c) => {
|
|
10800
|
+
c && (be.setStartGanttDate(g(c).toDate()), Te.value = c, q.value = c, j.value = c);
|
|
10801
|
+
}), ye(() => e.dataConfig.queryEndDate, (c) => {
|
|
10802
|
+
c && (be.setEndGanttDate(g(c).toDate()), Me.value = c, _.value = c, h.value = c);
|
|
10803
|
+
}), ye(ee, (c) => {
|
|
10804
|
+
c && be.setTimelineCellCount(c);
|
|
10803
10805
|
}), In(() => {
|
|
10804
|
-
|
|
10806
|
+
be.setStartGanttDate(g(j.value).toDate()), be.setEndGanttDate(g(h.value).toDate()), be.setMonthHeaders(Y.value), be.setWeekHeaders(I.value), be.setDayHeaders(A.value), be.setHourHeaders(Q.value), be.setTaskHeaders(e.dataConfig.taskHeaders), be.setMapFields(r.value), be.setTimelineCellCount(ee.value), o.value && o.value.length > 0 && be.setTasks(o.value);
|
|
10805
10807
|
});
|
|
10806
10808
|
const Be = (c) => {
|
|
10807
10809
|
const D = c;
|
|
10808
10810
|
e.eventConfig.updateProgress && e.eventConfig.updateProgress(D.detail);
|
|
10809
10811
|
};
|
|
10810
10812
|
gt(() => {
|
|
10811
|
-
Y.value = [], I.value = [], A.value = [], Q.value = [], re("0", o.value, 0),
|
|
10812
|
-
|
|
10813
|
+
Y.value = [], I.value = [], A.value = [], Q.value = [], re("0", o.value, 0), be.setTasks(y.value), Rt(() => {
|
|
10814
|
+
be.setMode(V.value), ae(V.value);
|
|
10813
10815
|
}), window.addEventListener("taskProgressUpdate", Be);
|
|
10814
10816
|
});
|
|
10815
10817
|
let Le = null;
|
|
10816
|
-
|
|
10818
|
+
ye(o, (c) => {
|
|
10817
10819
|
c && c.length > 0 ? (Le && clearTimeout(Le), Le = setTimeout(() => {
|
|
10818
|
-
y.value = [], re("0", c, 0),
|
|
10819
|
-
}, 100)) : c && c.length === 0 &&
|
|
10820
|
+
y.value = [], re("0", c, 0), be.setTasks(y.value), Le = null;
|
|
10821
|
+
}, 100)) : c && c.length === 0 && be.setTasks([]);
|
|
10820
10822
|
}, { immediate: !1 }), ca(() => {
|
|
10821
10823
|
window.removeEventListener("taskProgressUpdate", Be);
|
|
10822
10824
|
}), ia(ta.AddRootTaskSymbol, (c) => e.eventConfig.addRootTask(c)), ia(ta.SetBarColorSymbol, (c) => e.styleConfig.setBarColor(c)), e.styleConfig.setTaskType && ia(ta.SetTaskTypeSymbol, e.styleConfig.setTaskType), ia("ganttContainer", ge);
|
|
@@ -10827,33 +10829,33 @@ const Ju = Qe({
|
|
|
10827
10829
|
} catch (c) {
|
|
10828
10830
|
console.warn("Failed to load theme from localStorage:", c);
|
|
10829
10831
|
}
|
|
10830
|
-
ia("currentTheme", Ze),
|
|
10832
|
+
ia("currentTheme", Ze), ye(() => e.dataConfig.dependencies, (c) => {
|
|
10831
10833
|
c && c.length > 0 && (on.clear(), c.forEach((D) => {
|
|
10832
10834
|
on.addDependency(D);
|
|
10833
10835
|
}));
|
|
10834
10836
|
}, { immediate: !0 });
|
|
10835
10837
|
const oe = (c) => {
|
|
10836
10838
|
}, je = E(() => {
|
|
10837
|
-
var c, D,
|
|
10839
|
+
var c, D, te, ie;
|
|
10838
10840
|
return {
|
|
10839
10841
|
finishToStart: ((c = n.linkTypeColors) == null ? void 0 : c.finishToStart) || "#3498db",
|
|
10840
10842
|
startToStart: ((D = n.linkTypeColors) == null ? void 0 : D.startToStart) || "#2ecc71",
|
|
10841
|
-
finishToFinish: ((
|
|
10843
|
+
finishToFinish: ((te = n.linkTypeColors) == null ? void 0 : te.finishToFinish) || "#e74c3c",
|
|
10842
10844
|
startToFinish: ((ie = n.linkTypeColors) == null ? void 0 : ie.startToFinish) || "#f39c12"
|
|
10843
10845
|
};
|
|
10844
10846
|
});
|
|
10845
10847
|
return {
|
|
10846
10848
|
t,
|
|
10847
|
-
subTask:
|
|
10849
|
+
subTask: me,
|
|
10848
10850
|
editTask: x,
|
|
10849
10851
|
removeTask: qe,
|
|
10850
10852
|
rootTask: F,
|
|
10851
10853
|
allowChangeTaskDate: W,
|
|
10852
10854
|
paneLengthPercent: p,
|
|
10853
|
-
startDate:
|
|
10855
|
+
startDate: j,
|
|
10854
10856
|
endDate: h,
|
|
10855
10857
|
minStartDate: se,
|
|
10856
|
-
maxStartDate:
|
|
10858
|
+
maxStartDate: he,
|
|
10857
10859
|
confirmStart: ke,
|
|
10858
10860
|
minEndDate: u,
|
|
10859
10861
|
maxEndDate: k,
|
|
@@ -10867,7 +10869,7 @@ const Ju = Qe({
|
|
|
10867
10869
|
showHourSubMenu: G,
|
|
10868
10870
|
dayButtonRef: P,
|
|
10869
10871
|
daySubMenuRef: K,
|
|
10870
|
-
hourButtonRef:
|
|
10872
|
+
hourButtonRef: B,
|
|
10871
10873
|
hourSubMenuRef: C,
|
|
10872
10874
|
daySubMenuPosition: Pe,
|
|
10873
10875
|
hourSubMenuPosition: Ee,
|
|
@@ -11243,7 +11245,7 @@ function jc(e, t, a, s, r, o) {
|
|
|
11243
11245
|
])
|
|
11244
11246
|
], 512);
|
|
11245
11247
|
}
|
|
11246
|
-
const Yn = /* @__PURE__ */ Xe(Ju, [["render", jc], ["__scopeId", "data-v-
|
|
11248
|
+
const Yn = /* @__PURE__ */ Xe(Ju, [["render", jc], ["__scopeId", "data-v-ff95da52"]]), Gc = Qe({
|
|
11247
11249
|
name: "GanttThemeSelector",
|
|
11248
11250
|
setup() {
|
|
11249
11251
|
const { t: e } = Mt(), t = $(!1), a = Ot("currentTheme", $("metro")), s = $(""), r = $(), o = $(pt), n = Ot("ganttContainer"), l = () => {
|
|
@@ -11255,8 +11257,8 @@ const Yn = /* @__PURE__ */ Xe(Ju, [["render", jc], ["__scopeId", "data-v-ed4e563
|
|
|
11255
11257
|
let K = null;
|
|
11256
11258
|
if (n && n.value ? K = n.value : K = document.querySelector(".gantt-container") || document.querySelector(".page") || document.querySelector('[class*="gantt"]'), K) {
|
|
11257
11259
|
K.setAttribute("data-gantt-theme", P);
|
|
11258
|
-
const
|
|
11259
|
-
|
|
11260
|
+
const B = document.querySelector(".page");
|
|
11261
|
+
B && B.setAttribute("data-gantt-theme", P);
|
|
11260
11262
|
try {
|
|
11261
11263
|
localStorage.setItem("gantt-theme", P);
|
|
11262
11264
|
} catch (C) {
|
|
@@ -11272,21 +11274,21 @@ const Yn = /* @__PURE__ */ Xe(Ju, [["render", jc], ["__scopeId", "data-v-ed4e563
|
|
|
11272
11274
|
}, p = () => {
|
|
11273
11275
|
s.value && n && n.value && (s.value = "", d(a.value));
|
|
11274
11276
|
}, T = () => {
|
|
11275
|
-
const P = ct.exportThemeConfig(), K = new Blob([P], { type: "application/json" }),
|
|
11276
|
-
C.href =
|
|
11277
|
+
const P = ct.exportThemeConfig(), K = new Blob([P], { type: "application/json" }), B = URL.createObjectURL(K), C = document.createElement("a");
|
|
11278
|
+
C.href = B, C.download = `gantt-theme-config-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.json`, document.body.appendChild(C), C.click(), document.body.removeChild(C), URL.revokeObjectURL(B);
|
|
11277
11279
|
}, V = () => {
|
|
11278
11280
|
var P;
|
|
11279
11281
|
(P = r.value) == null || P.click();
|
|
11280
11282
|
}, b = (P) => {
|
|
11281
|
-
var
|
|
11282
|
-
const K = (
|
|
11283
|
+
var B;
|
|
11284
|
+
const K = (B = P.target.files) == null ? void 0 : B[0];
|
|
11283
11285
|
if (K) {
|
|
11284
11286
|
const C = new FileReader();
|
|
11285
11287
|
C.onload = (O) => {
|
|
11286
11288
|
var de;
|
|
11287
11289
|
try {
|
|
11288
|
-
const
|
|
11289
|
-
ct.importThemeConfig(
|
|
11290
|
+
const Z = (de = O.target) == null ? void 0 : de.result;
|
|
11291
|
+
ct.importThemeConfig(Z) ? (a.value = ct.getCurrentTheme(), alert("主题配置导入成功!")) : alert("主题配置文件格式错误!");
|
|
11290
11292
|
} catch {
|
|
11291
11293
|
alert("主题配置文件格式错误!");
|
|
11292
11294
|
}
|
|
@@ -11297,12 +11299,12 @@ const Yn = /* @__PURE__ */ Xe(Ju, [["render", jc], ["__scopeId", "data-v-ed4e563
|
|
|
11297
11299
|
}, d = (P) => {
|
|
11298
11300
|
const K = document.getElementById("gantt-theme-styles");
|
|
11299
11301
|
K && K.remove();
|
|
11300
|
-
const
|
|
11301
|
-
if (!
|
|
11302
|
+
const B = pt.find((Z) => Z.id === P);
|
|
11303
|
+
if (!B)
|
|
11302
11304
|
return;
|
|
11303
11305
|
const C = document.createElement("style");
|
|
11304
11306
|
C.id = "gantt-theme-styles";
|
|
11305
|
-
const O = Object.entries(
|
|
11307
|
+
const O = Object.entries(B.cssVariables).map(([Z, ce]) => `${Z}: ${ce};`).join(`
|
|
11306
11308
|
`);
|
|
11307
11309
|
C.textContent = `
|
|
11308
11310
|
/* 甘特图主题样式 - ${P} */
|
|
@@ -11355,7 +11357,7 @@ const Yn = /* @__PURE__ */ Xe(Ju, [["render", jc], ["__scopeId", "data-v-ed4e563
|
|
|
11355
11357
|
console.log("🚀 initTheme called"), console.log("📦 ganttContainer:", n), console.log("📦 ganttContainer.value:", n == null ? void 0 : n.value);
|
|
11356
11358
|
try {
|
|
11357
11359
|
const K = localStorage.getItem("gantt-theme");
|
|
11358
|
-
K && pt.find((
|
|
11360
|
+
K && pt.find((B) => B.id === K) && (a.value = K, console.log("💾 Loaded theme from localStorage:", K));
|
|
11359
11361
|
} catch (K) {
|
|
11360
11362
|
console.warn("Failed to load theme from localStorage:", K);
|
|
11361
11363
|
}
|
|
@@ -11575,37 +11577,37 @@ const ch = /* @__PURE__ */ Xe(Gc, [["render", sf], ["__scopeId", "data-v-4b6192d
|
|
|
11575
11577
|
themes: m,
|
|
11576
11578
|
showImportDialog: f,
|
|
11577
11579
|
importText: y,
|
|
11578
|
-
getThemeName: (
|
|
11579
|
-
isCurrentTheme: (
|
|
11580
|
-
const C = m[
|
|
11580
|
+
getThemeName: (B) => T[B] || B,
|
|
11581
|
+
isCurrentTheme: (B) => {
|
|
11582
|
+
const C = m[B];
|
|
11581
11583
|
return C ? Object.keys(C).every((O) => {
|
|
11582
|
-
const de = C[O],
|
|
11583
|
-
return typeof de == "object" && typeof
|
|
11584
|
+
const de = C[O], Z = a[O];
|
|
11585
|
+
return typeof de == "object" && typeof Z == "object" ? JSON.stringify(de) === JSON.stringify(Z) : de === Z;
|
|
11584
11586
|
}) : !1;
|
|
11585
11587
|
},
|
|
11586
11588
|
updateConfig: () => {
|
|
11587
11589
|
r(a), t("configChange", a);
|
|
11588
11590
|
},
|
|
11589
|
-
applyTheme: (
|
|
11590
|
-
s(
|
|
11591
|
+
applyTheme: (B) => {
|
|
11592
|
+
s(B), t("configChange", a);
|
|
11591
11593
|
},
|
|
11592
11594
|
resetConfig: () => {
|
|
11593
11595
|
o(), t("configChange", a);
|
|
11594
11596
|
},
|
|
11595
11597
|
exportConfig: () => {
|
|
11596
|
-
const
|
|
11597
|
-
navigator.clipboard.writeText(
|
|
11598
|
+
const B = n();
|
|
11599
|
+
navigator.clipboard.writeText(B).then(() => {
|
|
11598
11600
|
alert("配置已复制到剪贴板");
|
|
11599
11601
|
}).catch(() => {
|
|
11600
11602
|
const C = document.createElement("textarea");
|
|
11601
|
-
C.value =
|
|
11603
|
+
C.value = B, document.body.appendChild(C), C.select(), document.execCommand("copy"), document.body.removeChild(C), alert("配置已复制到剪贴板");
|
|
11602
11604
|
});
|
|
11603
11605
|
},
|
|
11604
11606
|
importConfig: () => {
|
|
11605
11607
|
try {
|
|
11606
11608
|
l(y.value) ? (f.value = !1, y.value = "", t("configChange", a), alert("配置导入成功")) : alert("配置格式错误,请检查JSON格式");
|
|
11607
|
-
} catch (
|
|
11608
|
-
alert("配置导入失败:" +
|
|
11609
|
+
} catch (B) {
|
|
11610
|
+
alert("配置导入失败:" + B);
|
|
11609
11611
|
}
|
|
11610
11612
|
}
|
|
11611
11613
|
};
|
|
@@ -12063,7 +12065,7 @@ export {
|
|
|
12063
12065
|
pt as ganttThemes,
|
|
12064
12066
|
hh as install,
|
|
12065
12067
|
on as linkDataManager,
|
|
12066
|
-
|
|
12068
|
+
be as mutations,
|
|
12067
12069
|
xs as setLocale,
|
|
12068
12070
|
M as store,
|
|
12069
12071
|
Mt as useI18n,
|