tor-univer-sheet 1.1.13 → 1.1.15

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.
@@ -1,64 +1,64 @@
1
1
  import l from "dayjs";
2
- import { CellValueType as U } from "@univerjs/presets";
3
- import z from "decimal.js";
4
- const ft = (t, r) => {
5
- for (const o of r)
6
- t[o] = null;
7
- }, K = () => {
2
+ import { CellValueType as $ } from "@univerjs/presets";
3
+ import K from "decimal.js";
4
+ const dt = (t, o) => {
5
+ for (const r of o)
6
+ t[r] = null;
7
+ }, W = () => {
8
8
  if (typeof crypto == "object") {
9
9
  if (typeof crypto.randomUUID == "function")
10
10
  return crypto.randomUUID();
11
11
  if (typeof crypto.getRandomValues == "function" && typeof Uint8Array == "function") {
12
- const o = (e) => {
13
- const c = Number(e);
14
- return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
12
+ const r = (e) => {
13
+ const f = Number(e);
14
+ return (f ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> f / 4).toString(16);
15
15
  };
16
- return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, o);
16
+ return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, r);
17
17
  }
18
18
  }
19
- let t = (/* @__PURE__ */ new Date()).getTime(), r = typeof performance < "u" && performance.now && performance.now() * 1e3 || 0;
20
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (o) => {
19
+ let t = (/* @__PURE__ */ new Date()).getTime(), o = typeof performance < "u" && performance.now && performance.now() * 1e3 || 0;
20
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
21
21
  let e = Math.random() * 16;
22
- return t > 0 ? (e = (t + e) % 16 | 0, t = Math.floor(t / 16)) : (e = (r + e) % 16 | 0, r = Math.floor(r / 16)), (o === "x" ? e : e & 3 | 8).toString(16);
22
+ return t > 0 ? (e = (t + e) % 16 | 0, t = Math.floor(t / 16)) : (e = (o + e) % 16 | 0, o = Math.floor(o / 16)), (r === "x" ? e : e & 3 | 8).toString(16);
23
23
  });
24
24
  };
25
- function mt(t) {
25
+ function ht(t) {
26
26
  return {
27
27
  ...t?.workbookData,
28
- id: t?.id || K(),
28
+ id: t?.id || W(),
29
29
  name: t?.name || "未命名",
30
30
  appVersion: t?.appVersion || "1.0.0"
31
31
  };
32
32
  }
33
- const L = Object.prototype.toString, Z = (t, r) => L.call(t) === `[object ${r}]`, Q = (t) => typeof t < "u", W = (t) => !Q(t), X = (t) => t !== null && Z(t, "Object"), I = (t) => t == null || typeof t > "u" ? !0 : q(t) || rt(t) ? t.length === 0 : t instanceof Map || t instanceof Set ? t.size === 0 : X(t) ? Object.keys(t).length === 0 : !1, tt = (t) => t === null, et = (t) => W(t) || tt(t), rt = (t) => Z(t, "String"), q = (t) => t && Array.isArray(t);
34
- class ot {
33
+ const X = Object.prototype.toString, L = (t, o) => X.call(t) === `[object ${o}]`, tt = (t) => typeof t < "u", et = (t) => !tt(t), rt = (t) => t !== null && L(t, "Object"), E = (t) => t == null || typeof t > "u" ? !0 : J(t) || st(t) ? t.length === 0 : t instanceof Map || t instanceof Set ? t.size === 0 : rt(t) ? Object.keys(t).length === 0 : !1, ot = (t) => t === null, nt = (t) => et(t) || ot(t), st = (t) => L(t, "String"), J = (t) => t && Array.isArray(t);
34
+ class at {
35
35
  value;
36
- constructor(r) {
37
- this.value = new z(r);
36
+ constructor(o) {
37
+ this.value = new K(o);
38
38
  }
39
39
  /**
40
40
  * 加法运算
41
41
  * @param num 要加的数
42
42
  * @returns DecimalChain 实例,支持链式调用
43
43
  */
44
- add(r) {
45
- return this.value = this.value.add(r || 0), this;
44
+ add(o) {
45
+ return this.value = this.value.add(o || 0), this;
46
46
  }
47
47
  /**
48
48
  * 减法运算
49
49
  * @param num 要减的数
50
50
  * @returns DecimalChain 实例,支持链式调用
51
51
  */
52
- subtract(r) {
53
- return this.value = this.value.sub(r || 0), this;
52
+ subtract(o) {
53
+ return this.value = this.value.sub(o || 0), this;
54
54
  }
55
55
  /**
56
56
  * 乘法运算
57
57
  * @param num 要乘的数
58
58
  * @returns DecimalChain 实例,支持链式调用
59
59
  */
60
- multiply(r) {
61
- return this.value = this.value.mul(r || 0), this;
60
+ multiply(o) {
61
+ return this.value = this.value.mul(o || 0), this;
62
62
  }
63
63
  /**
64
64
  * 除法运算
@@ -66,11 +66,11 @@ class ot {
66
66
  * @returns DecimalChain 实例,支持链式调用
67
67
  * @throws 当除数为0时抛出错误
68
68
  */
69
- divide(r) {
70
- const o = new z(r);
71
- if (o.isZero())
69
+ divide(o) {
70
+ const r = new K(o);
71
+ if (r.isZero())
72
72
  throw new Error("除数是0");
73
- return this.value = this.value.div(o), this;
73
+ return this.value = this.value.div(r), this;
74
74
  }
75
75
  /**
76
76
  * 保留小数位数
@@ -78,8 +78,8 @@ class ot {
78
78
  * @param rounding 舍入模式,默认为四舍五入
79
79
  * @returns DecimalChain 实例,支持链式调用
80
80
  */
81
- toFixed(r, o) {
82
- return this.value = new z(this.value.toFixed(r, o)), this;
81
+ toFixed(o, r) {
82
+ return this.value = new K(this.value.toFixed(o, r)), this;
83
83
  }
84
84
  /**
85
85
  * 返回当前值
@@ -103,393 +103,410 @@ class ot {
103
103
  return this.value.toNumber();
104
104
  }
105
105
  }
106
- function $(t = 0) {
107
- return new ot(t);
106
+ function C(t = 0) {
107
+ return new at(t);
108
108
  }
109
- var nt = /* @__PURE__ */ ((t) => (t.无 = "no", t.年 = "year", t.月 = "month", t.周 = "week", t.天 = "day", t.班组 = "shift", t.小时 = "hour", t.半小时 = "half_hour", t))(nt || {}), st = /* @__PURE__ */ ((t) => (t.view = "view", t.edit = "edit", t))(st || {});
110
- async function lt(t, r) {
111
- if (!r) return Promise.reject("日期不能为空");
109
+ var it = /* @__PURE__ */ ((t) => (t.无 = "no", t.年 = "year", t.月 = "month", t.周 = "week", t.天 = "day", t.班组 = "shift", t.小时 = "hour", t.半小时 = "half_hour", t))(it || {}), ct = /* @__PURE__ */ ((t) => (t.view = "view", t.edit = "edit", t))(ct || {});
110
+ async function Yt(t, o) {
111
+ if (!o) return Promise.reject("日期不能为空");
112
112
  switch (t) {
113
113
  case "year":
114
- if (q(r))
115
- return Promise.resolve(r);
116
- const o = l(r);
117
- if (!o.isValid())
114
+ if (J(o))
115
+ return Promise.resolve(o);
116
+ const r = l(o);
117
+ if (!r.isValid())
118
118
  return Promise.reject("无效的日期格式");
119
- const e = o.year(), c = `${e}-01`, s = `${e}-12`;
120
- return Promise.resolve([c, s]);
119
+ const e = r.year(), f = `${e}-01`, n = `${e}-12`;
120
+ return Promise.resolve([f, n]);
121
121
  case "month":
122
- if (q(r))
123
- return Promise.resolve(r);
124
- const i = l(r);
125
- if (!i.isValid())
122
+ if (J(o))
123
+ return Promise.resolve(o);
124
+ const h = l(o);
125
+ if (!h.isValid())
126
126
  return Promise.reject("无效的日期格式");
127
- const N = i.startOf("month").format("YYYY-MM-DD"), n = i.endOf("month").format("YYYY-MM-DD");
128
- return Promise.resolve([N, n]);
127
+ const k = h.startOf("month").format("YYYY-MM-DD"), c = h.endOf("month").format("YYYY-MM-DD");
128
+ return Promise.resolve([k, c]);
129
129
  case "day":
130
- if (q(r))
131
- return Promise.resolve(r);
132
- const w = l(r);
133
- if (!w.isValid())
130
+ if (J(o))
131
+ return Promise.resolve(o);
132
+ const Y = l(o);
133
+ if (!Y.isValid())
134
134
  return Promise.reject("无效的日期格式");
135
- const d = w.startOf("day").format("YYYY-MM-DD HH:mm:ss"), H = w.endOf("day").format("YYYY-MM-DD HH:mm:ss");
136
- return Promise.resolve([d, H]);
135
+ const p = Y.startOf("day").format("YYYY-MM-DD HH:mm:ss"), d = Y.endOf("day").format("YYYY-MM-DD HH:mm:ss");
136
+ return Promise.resolve([p, d]);
137
137
  default:
138
138
  return Promise.reject("不支持的周期类型");
139
139
  }
140
140
  }
141
- function S(t, r, o) {
142
- if (!o) return 0;
141
+ function H(t, o, r) {
142
+ if (!r) return 0;
143
143
  const e = {
144
144
  year: "YYYY",
145
145
  month: "YYYY-MM",
146
146
  day: "YYYY-MM-DD",
147
147
  hour: "HH:mm:ss"
148
- }[o];
149
- return ["day", "hour"].includes(o) ? l(r, e).diff(l(t, e), o) : l(r, e).diff(l(t, e), o);
148
+ }[r];
149
+ return ["day", "hour"].includes(r) ? l(o, e).diff(l(t, e), r) : l(o, e).diff(l(t, e), r);
150
150
  }
151
- function F(t, r, o) {
152
- if (!o)
151
+ function z(t, o, r) {
152
+ if (!r)
153
153
  throw new Error("日期类型不能为空");
154
154
  const e = {
155
155
  year: "YYYY",
156
156
  month: "YYYY-MM",
157
157
  day: "YYYY-MM-DD",
158
158
  hour: "HH:mm:ss"
159
- }[o];
160
- return l(t).subtract(r, o).format(e);
159
+ }[r];
160
+ return l(t).subtract(o, r).format(e);
161
161
  }
162
- function x(t, r, o, e) {
163
- const c = "YYYY-MM-DD HH:mm:ss", s = A(t, r, o, e), i = l(s);
164
- if (r === "month") {
165
- const n = i.month();
166
- return n === 0 ? [i.startOf("month").format(c), i.date(25).endOf("day").format(c)] : n === 11 ? [i.subtract(1, "month").date(26).startOf("day").format(c), i.endOf("month").format(c)] : [i.subtract(1, "month").date(26).startOf("day").format(c), i.date(25).endOf("day").format(c)];
162
+ function S(t, o, r, e) {
163
+ const f = "YYYY-MM-DD HH:mm:ss", n = A(t, o, r, e), h = l(n);
164
+ if (o === "month") {
165
+ const c = h.month();
166
+ return c === 0 ? [h.startOf("month").format(f), h.date(25).endOf("day").format(f)] : c === 11 ? [h.subtract(1, "month").date(26).startOf("day").format(f), h.endOf("month").format(f)] : [h.subtract(1, "month").date(26).startOf("day").format(f), h.date(25).endOf("day").format(f)];
167
167
  }
168
- const N = { year: "year", day: "day", hour: "hour" };
169
- return [i.startOf(N[r]).format(c), i.endOf(N[r]).format(c)];
168
+ const k = { year: "year", day: "day", hour: "hour" };
169
+ return [h.startOf(k[o]).format(f), h.endOf(k[o]).format(f)];
170
170
  }
171
- function A(t, r, o, e) {
172
- const c = {
171
+ function A(t, o, r, e) {
172
+ const f = {
173
173
  year: "YYYY",
174
174
  month: "YYYY-MM",
175
175
  day: "YYYY-MM-DD",
176
176
  hour: "YYYY-MM-DD HH:mm:ss"
177
- }[r];
178
- return l(t, c).add(o * e, r).format(c);
177
+ }[o];
178
+ return l(t, f).add(r * e, o).format(f);
179
179
  }
180
- function g(t, r, o) {
181
- return t[r] || (t[r] = {}), t[r][o] || (t[r][o] = {}), t[r][o];
180
+ function g(t, o, r) {
181
+ return t[o] || (t[o] = {}), t[o][r] || (t[o][r] = {}), t[o][r];
182
182
  }
183
- async function dt(t) {
183
+ async function Dt(t) {
184
184
  if (!t)
185
185
  throw new Error("cellData is required");
186
- const r = Object.entries(t).reduce((o, e) => {
187
- const [c, s] = e;
188
- for (const [i, N] of Object.entries(s)) {
189
- const { custom: n, v: w, t: d, s: H } = N;
190
- if (!n) continue;
191
- const { cellType: m } = n, B = !n.hasOwnProperty("writeBack") || I(n?.writeBack) ? !0 : n.writeBack;
192
- if (m === "indicator") {
193
- const P = g(o, c, i);
194
- P.custom = {
195
- ...n,
196
- required: I(n?.required) ? !1 : n?.required,
197
- defaultShift: I(n?.defaultShift) ? !1 : n?.defaultShift,
198
- forwardPush: I(n?.forwardPush) ? !1 : n?.forwardPush,
199
- forwardPushTimes: I(n?.useDefaultEndDate) ? 0 : n?.forwardPushTimes,
200
- useDefaultEndDate: I(n?.useDefaultEndDate) ? !1 : n?.useDefaultEndDate,
201
- copyType: I(n?.copyType) ? "" : n?.copyType,
202
- writeBack: B
203
- }, P.s = H, P.t = d, P.v = w;
186
+ const o = Object.entries(t).reduce((r, e) => {
187
+ const [f, n] = e;
188
+ for (const [h, k] of Object.entries(n)) {
189
+ const { custom: c, v: Y, t: p, s: d } = k;
190
+ if (!c) continue;
191
+ const { cellType: q } = c, i = !c.hasOwnProperty("writeBack") || E(c?.writeBack) ? !0 : c.writeBack;
192
+ if (q === "indicator") {
193
+ const j = g(r, f, h);
194
+ j.custom = {
195
+ ...c,
196
+ required: E(c?.required) ? !1 : c?.required,
197
+ defaultShift: E(c?.defaultShift) ? !1 : c?.defaultShift,
198
+ forwardPush: E(c?.forwardPush) ? !1 : c?.forwardPush,
199
+ forwardPushTimes: E(c?.useDefaultEndDate) ? 0 : c?.forwardPushTimes,
200
+ useDefaultEndDate: E(c?.useDefaultEndDate) ? !1 : c?.useDefaultEndDate,
201
+ copyType: E(c?.copyType) ? "" : c?.copyType,
202
+ writeBack: i
203
+ }, j.s = d, j.t = p, j.v = Y;
204
204
  }
205
205
  }
206
- return o;
206
+ return r;
207
207
  }, {});
208
- return !r || I(r) ? Promise.reject(new Error("No data found")) : Promise.resolve(r);
208
+ return !o || E(o) ? Promise.reject(new Error("No data found")) : Promise.resolve(o);
209
209
  }
210
- function E(t, r) {
211
- return t.replace(/\$\{([^}]+)\}/g, (o, e) => {
210
+ function F(t, o) {
211
+ return t.replace(/\$\{([^}]+)\}/g, (r, e) => {
212
212
  try {
213
- const c = Object.keys(r), s = Object.values(r);
214
- return new Function(...c, `return ${e};`)(...s);
215
- } catch (c) {
216
- return console.error(`表达式执行失败: ${e}`, c), o;
213
+ const f = Object.keys(o), n = Object.values(o);
214
+ return new Function(...f, `return ${e};`)(...n);
215
+ } catch (f) {
216
+ return console.error(`表达式执行失败: ${e}`, f), r;
217
217
  }
218
218
  });
219
219
  }
220
- function at({
220
+ function ut({
221
221
  acc: t,
222
- params: r,
223
- initRowNum: o,
222
+ params: o,
223
+ initRowNum: r,
224
224
  initColNum: e,
225
- cellData: c
225
+ cellData: f
226
226
  }) {
227
- const { rangeData: s, currentDay: i, extraArgs: N } = r;
228
- N?.teamData;
229
- const { cycleType: n, timeIncrement: w, forwardPush: d, forwardPushTimes: H, copyType: m, copyInterval: B, defaultShift: P, templateStr: v, useDefaultEndDate: R } = c.custom;
230
- let b = 0;
231
- switch (n) {
227
+ const { rangeData: n, currentDay: h, extraArgs: k } = o, c = k?.teamData || {}, { cycleType: Y, timeIncrement: p, forwardPush: d, forwardPushTimes: q, copyType: i, copyInterval: j, defaultShift: O, templateStr: P, useDefaultEndDate: Z } = f.custom;
228
+ let y = 0;
229
+ switch (Y) {
232
230
  case "day": {
233
- let a = "";
234
- if (d && (a = F(
235
- s[0],
236
- H,
231
+ let s = "";
232
+ if (d && (s = z(
233
+ n[0],
234
+ q,
237
235
  "day"
238
236
  /* day */
239
- )), !m) {
237
+ )), !i) {
240
238
  let u = "";
241
- d ? u = a : u = s[0];
242
- const Y = g(t, o, e);
243
- Y.v = v ? E(v, { businessDate: u, dayjs: l }) : l(u).format("YYYY-MM-DD"), Y.t = U.STRING;
239
+ d ? u = s : u = n[0];
240
+ const a = g(t, r, e);
241
+ a.v = P ? F(P, { businessDate: u, dayjs: l }) : l(u).format("YYYY-MM-DD"), a.t = $.STRING;
244
242
  break;
245
243
  }
246
- d ? b = S(
247
- a,
248
- s[0],
244
+ d ? y = H(
245
+ s,
246
+ n[0],
249
247
  "day"
250
248
  /* day */
251
- ) : (b = S(
252
- s[0],
253
- s[1],
249
+ ) : (y = H(
250
+ n[0],
251
+ n[1],
254
252
  "day"
255
253
  /* day */
256
- ), console.log("copyNum", b));
257
- for (let u = 0; u <= Math.abs(b === 0 ? 1 : b); u++) {
258
- const Y = u * (B + 1);
259
- let O = "";
260
- d ? O = A(a, "day", u, w) : O = A(s[0], "day", u, w);
261
- const T = m === "right" ? o : o + Y, M = m === "right" ? e + Y : e, D = g(t, T, M);
262
- D.v = v ? E(v, { businessDate: O, dayjs: l }) : l(O).format("YYYY-MM-DD"), D.t = U.STRING;
254
+ ), console.log("copyNum", y));
255
+ for (let u = 0; u <= Math.abs(y === 0 ? 1 : y); u++) {
256
+ const a = u * (j + 1);
257
+ let M = "";
258
+ d ? M = A(s, "day", u, p) : M = A(n[0], "day", u, p);
259
+ const w = i === "right" ? r : r + a, R = i === "right" ? e + a : e, G = g(t, w, R);
260
+ G.v = P ? F(P, { businessDate: M, dayjs: l }) : l(M).format("YYYY-MM-DD"), G.t = $.STRING;
263
261
  }
264
262
  break;
265
263
  }
266
264
  case "month": {
267
- if (!m) {
268
- const [a, u] = x(s[1], "month", 0, 1), Y = g(t, o, e);
269
- Y.v = l(u).format("YYYY-MM"), Y.t = U.STRING;
265
+ if (!i) {
266
+ const [s, u] = S(n[1], "month", 0, 1), a = g(t, r, e);
267
+ a.v = l(u).format("YYYY-MM"), a.t = $.STRING;
270
268
  break;
271
269
  }
272
- b = S(
273
- s[0],
274
- s[1],
270
+ y = H(
271
+ n[0],
272
+ n[1],
275
273
  "month"
276
274
  /* month */
277
275
  );
278
- for (let a = 0; a <= Math.abs(b === 0 ? 1 : b); a++) {
279
- const u = a * (B + 1), Y = m === "right" ? o : o + u, O = m === "right" ? e + u : e, T = g(t, Y, O);
280
- T.v = A(s[0], "month", a, w), T.t = U.STRING;
276
+ for (let s = 0; s <= Math.abs(y === 0 ? 1 : y); s++) {
277
+ const u = s * (j + 1), a = i === "right" ? r : r + u, M = i === "right" ? e + u : e, w = g(t, a, M);
278
+ w.v = A(n[0], "month", s, p), w.t = $.STRING;
281
279
  }
282
280
  break;
283
281
  }
284
282
  case "year": {
285
- let a = "";
286
- if (d && (a = F(
287
- s[0],
288
- H || 0,
283
+ let s = "";
284
+ if (d && (s = z(
285
+ n[0],
286
+ q || 0,
289
287
  "year"
290
288
  /* year */
291
- )), !m) {
292
- const u = d ? a : s[0], [Y, O] = x(u, "year", 0, 1), T = g(t, o, e), [, M] = x(s[1], "month", 0, 1);
293
- T.v = v ? E(v, {
294
- startTime: Y,
295
- endTime: O,
296
- rangeData: s,
289
+ )), !i) {
290
+ const u = d ? s : n[0], [a, M] = S(u, "year", 0, 1), w = g(t, r, e), [, R] = S(n[1], "month", 0, 1);
291
+ w.v = P ? F(P, {
292
+ startTime: a,
293
+ endTime: M,
294
+ rangeData: n,
297
295
  dayjs: l
298
- }) : u, T.t = U.STRING;
296
+ }) : u, w.t = $.STRING;
299
297
  break;
300
298
  }
301
- d ? b = S(
302
- a,
303
- s[0],
299
+ d ? y = H(
300
+ s,
301
+ n[0],
304
302
  "year"
305
303
  /* year */
306
- ) : b = S(
307
- s[0],
308
- s[1],
304
+ ) : y = H(
305
+ n[0],
306
+ n[1],
309
307
  "year"
310
308
  /* year */
311
309
  );
312
- for (let u = 0; u <= Math.abs(b === 0 ? 1 : b); u++) {
313
- const Y = u * (B + 1), O = m === "right" ? o : o + Y, T = m === "right" ? e + Y : e, [M, D] = x(s[0], "year", u, w), f = g(t, O, T), h = A(s[0], "year", u, w);
314
- f.v = v ? E(v, {
315
- startTime: M,
316
- endTime: D,
317
- rangeData: s,
310
+ for (let u = 0; u <= Math.abs(y === 0 ? 1 : y); u++) {
311
+ const a = u * (j + 1), M = i === "right" ? r : r + a, w = i === "right" ? e + a : e, [R, G] = S(n[0], "year", u, p), x = g(t, M, w), N = A(n[0], "year", u, p);
312
+ x.v = P ? F(P, {
313
+ startTime: R,
314
+ endTime: G,
315
+ rangeData: n,
318
316
  dayjs: l
319
- }) : h, f.t = U.STRING;
317
+ }) : N, x.t = $.STRING;
320
318
  }
321
319
  break;
322
320
  }
323
321
  case "hour": {
324
- if (!m) {
325
- const a = g(t, o, e);
326
- if (a.t = U.STRING, P) {
327
- a.v = l(s[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
322
+ if (!i) {
323
+ const s = g(t, r, e);
324
+ if (s.t = $.STRING, O) {
325
+ s.v = l(n[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
328
326
  break;
329
327
  }
330
- a.v = l(i).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
328
+ s.v = l(h).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
331
329
  break;
332
330
  }
333
- b = S(
334
- s[0],
335
- s[1],
331
+ y = H(
332
+ n[0],
333
+ n[1],
336
334
  "hour"
337
335
  /* hour */
338
336
  );
339
- for (let a = 0; a <= Math.abs(b === 0 ? 1 : b); a++) {
340
- const u = a * (B + 1), Y = m === "right" ? o : o + u, O = m === "right" ? e + u : e, T = g(t, Y, O);
341
- if (T.t = U.STRING, P) {
342
- const M = l(s[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
343
- T.v = A(M, "hour", a, w);
337
+ for (let s = 0; s <= Math.abs(y === 0 ? 1 : y); s++) {
338
+ const u = s * (j + 1), a = i === "right" ? r : r + u, M = i === "right" ? e + u : e, w = g(t, a, M);
339
+ if (w.t = $.STRING, O) {
340
+ const R = l(n[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss");
341
+ w.v = A(R, "hour", s, p);
344
342
  continue;
345
343
  }
346
- T.v = A(l(i).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), "hour", a, w);
344
+ w.v = A(l(h).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), "hour", s, p);
347
345
  }
346
+ break;
347
+ }
348
+ case "shift": {
349
+ if (!i) {
350
+ const s = g(t, r, e);
351
+ s.t = $.STRING, s.v = P ? F(P, {
352
+ rangeData: n,
353
+ dayjs: l
354
+ }) : n[0];
355
+ break;
356
+ }
357
+ if (!c.length)
358
+ throw new Error("没有获取到当班数据");
359
+ for (let s = 0; s < c.length; s++) {
360
+ const u = c[s], { startDatetime: a, endDatetime: M } = u, w = s * (j + 1), R = i === "right" ? r : C(r).add(w).toNumber(), G = i === "right" ? C(e).add(w).toNumber() : e, x = g(t, R, G);
361
+ x.v = P ? F(P, {
362
+ team: u
363
+ }) : a;
364
+ }
365
+ break;
348
366
  }
349
367
  }
350
368
  }
351
- async function ht(t, r) {
369
+ async function yt(t, o) {
352
370
  if (!t)
353
371
  return Promise.reject("没有可用的单元格数据");
354
- const { extraArgs: o, rangeData: e } = r;
372
+ const { extraArgs: r, rangeData: e } = o;
355
373
  if (!e.length)
356
374
  return Promise.reject("处理时间范围失败, rangeData不能为空");
357
- o?.teamData;
358
- const c = r?.currentDay || l().format("YYYY-MM-DD"), s = Object.entries(t).reduce((i, N) => {
359
- const [n, w] = N;
360
- for (const [d, H] of Object.entries(w)) {
361
- const { custom: m } = H;
362
- if (!m) continue;
375
+ const f = r?.teamData || [], { periodicityTime: n } = o, h = o?.currentDay || l().format("YYYY-MM-DD"), k = (Y, p) => n ? parseInt(n.split(":")[0], 10) < 12 ? [Y, l(p).add(1, "day").format("YYYY-MM-DD") + " " + n] : [l(Y).subtract(1, "day").format("YYYY-MM-DD") + " " + n, p] : [Y, p], c = Object.entries(t).reduce((Y, p) => {
376
+ const [d, q] = p;
377
+ for (const [i, j] of Object.entries(q)) {
378
+ const { custom: O } = j;
379
+ if (!O) continue;
363
380
  const {
364
- cellType: B,
365
- cycleType: P,
366
- timeIncrement: v,
367
- forwardPush: R,
368
- forwardPushTimes: b,
381
+ cellType: P,
382
+ cycleType: Z,
383
+ timeIncrement: y,
384
+ forwardPush: s,
385
+ forwardPushTimes: u,
369
386
  copyType: a,
370
- copyInterval: u,
371
- defaultShift: Y,
372
- useDefaultStartDate: O,
373
- useDefaultEndDate: T
374
- } = m;
375
- if (B === "time") {
376
- at({ acc: i, params: r, initRowNum: Number(n), initColNum: Number(d), cellData: H });
387
+ copyInterval: M,
388
+ defaultShift: w,
389
+ useDefaultStartDate: R,
390
+ useDefaultEndDate: G
391
+ } = O;
392
+ if (P === "time") {
393
+ ut({ acc: Y, params: o, initRowNum: Number(d), initColNum: Number(i), cellData: j });
377
394
  continue;
378
395
  }
379
- const M = {
380
- cycleType: P,
381
- indicatorName: m.indicatorName,
382
- indicatorCode: m.indicatorCode,
383
- indicatorId: m.indicatorId,
384
- indicatorDimensionName: m.indicatorDimensionName,
385
- indicatorDimensionConfig: m.indicatorDimensionConfig,
386
- required: et(m?.required) ?? !1,
387
- cellType: m.cellType,
388
- defaultShift: m?.defaultShift || !1,
389
- writeBack: I(m?.writeBack) ? !0 : m.writeBack
396
+ const x = {
397
+ cycleType: Z,
398
+ indicatorName: O.indicatorName,
399
+ indicatorCode: O.indicatorCode,
400
+ indicatorId: O.indicatorId,
401
+ indicatorDimensionName: O.indicatorDimensionName,
402
+ indicatorDimensionConfig: O.indicatorDimensionConfig,
403
+ required: nt(O?.required) ?? !1,
404
+ cellType: O.cellType,
405
+ defaultShift: O?.defaultShift || !1,
406
+ writeBack: E(O?.writeBack) ? !0 : O.writeBack
390
407
  };
391
- let D = 0;
392
- switch (P) {
408
+ let N = 0;
409
+ switch (Z) {
393
410
  case "day": {
394
- let f = "";
395
- if (R && (f = F(
411
+ let m = "";
412
+ if (s && (m = z(
396
413
  e[0],
397
- b || 0,
414
+ u || 0,
398
415
  "day"
399
416
  /* day */
400
417
  )), !a) {
401
- const h = R ? f : e[0], [p, y] = x(h, "day", 0, 1), k = g(i, n, d);
402
- k.custom = {
403
- ...M,
404
- startTime: p,
405
- endTime: y
418
+ const D = s ? m : e[0], [T, b] = k(...S(D, "day", 0, 1)), v = g(Y, d, i);
419
+ v.custom = {
420
+ ...x,
421
+ startTime: T,
422
+ endTime: b
406
423
  };
407
424
  break;
408
425
  }
409
- R ? D = S(
410
- f,
426
+ s ? N = H(
427
+ m,
411
428
  e[0],
412
429
  "day"
413
430
  /* day */
414
- ) : D = S(
431
+ ) : N = H(
415
432
  e[0],
416
433
  e[1],
417
434
  "day"
418
435
  /* day */
419
436
  );
420
- for (let h = 0; h <= Math.abs(D === 0 ? 1 : D); h++) {
421
- const p = h * (u + 1), y = R ? f : e[0], [k, j] = x(y, "day", h, v), C = a === "right" ? n : $(n).add(p).toNumber(), G = a === "right" ? $(d).add(p).toNumber() : d, V = g(i, C, G);
437
+ for (let D = 0; D <= Math.abs(N === 0 ? 1 : N); D++) {
438
+ const T = D * (M + 1), b = s ? m : e[0], [v, I] = k(...S(b, "day", D, y)), B = a === "right" ? d : C(d).add(T).toNumber(), U = a === "right" ? C(i).add(T).toNumber() : i, V = g(Y, B, U);
422
439
  V.custom = {
423
- ...M,
424
- startTime: k,
425
- endTime: j
440
+ ...x,
441
+ startTime: v,
442
+ endTime: I
426
443
  };
427
444
  }
428
445
  break;
429
446
  }
430
447
  case "month": {
431
448
  if (!a) {
432
- const [f, h] = x(e[1], "month", 0, 1), p = g(i, n, d);
433
- p.custom = {
434
- ...M,
435
- startTime: f,
436
- endTime: h
449
+ const [m, D] = S(e[1], "month", 0, 1), T = g(Y, d, i);
450
+ T.custom = {
451
+ ...x,
452
+ startTime: m,
453
+ endTime: D
437
454
  };
438
455
  break;
439
456
  }
440
- D = S(
457
+ N = H(
441
458
  e[0],
442
459
  e[1],
443
460
  "month"
444
461
  /* month */
445
462
  );
446
- for (let f = 0; f <= Math.abs(D === 0 ? 1 : D); f++) {
447
- const h = f * (u + 1), p = a === "right" ? n : $(n).add(h).toNumber(), y = a === "right" ? $(d).add(h).toNumber() : d, [k, j] = x(e[0], "month", f, v), C = g(i, p, y);
448
- C.custom = {
449
- ...M,
450
- startTime: k,
451
- endTime: j
463
+ for (let m = 0; m <= Math.abs(N === 0 ? 1 : N); m++) {
464
+ const D = m * (M + 1), T = a === "right" ? d : C(d).add(D).toNumber(), b = a === "right" ? C(i).add(D).toNumber() : i, [v, I] = S(e[0], "month", m, y), B = g(Y, T, b);
465
+ B.custom = {
466
+ ...x,
467
+ startTime: v,
468
+ endTime: I
452
469
  };
453
470
  }
454
471
  break;
455
472
  }
456
473
  case "year": {
457
- let f = "", h = "", p = "";
458
- if (R) {
459
- f = F(
474
+ let m = "", D = "", T = "";
475
+ if (s) {
476
+ m = z(
460
477
  e[0],
461
- b || 0,
478
+ u || 0,
462
479
  "year"
463
480
  /* year */
464
481
  );
465
- const y = l(e[1]).format("MM");
466
- h = l(`${f}-${y + 1}`).format("YYYY-MM"), p = l(`${f}-${y + 2}`).format("YYYY-MM");
482
+ const b = l(e[1]).format("MM");
483
+ D = l(`${m}-${b + 1}`).format("YYYY-MM"), T = l(`${m}-${b + 2}`).format("YYYY-MM");
467
484
  }
468
485
  if (!a) {
469
- const y = R ? f : e[0], [k, j] = x(y, "year", 0, 1), C = g(i, n, d), [, G] = x(h, "month", 0, 1), [V] = x(p, "month", 0, 1);
470
- C.custom = {
471
- ...M,
472
- startTime: O ? V : k,
473
- endTime: T ? G : j
486
+ const b = s ? m : e[0], [v, I] = S(b, "year", 0, 1), B = g(Y, d, i), [, U] = S(D, "month", 0, 1), [V] = S(T, "month", 0, 1);
487
+ B.custom = {
488
+ ...x,
489
+ startTime: R ? V : v,
490
+ endTime: G ? U : I
474
491
  };
475
492
  break;
476
493
  }
477
- R ? D = S(
478
- f,
494
+ s ? N = H(
495
+ m,
479
496
  e[0],
480
497
  "year"
481
498
  /* year */
482
- ) : D = S(
499
+ ) : N = H(
483
500
  e[0],
484
501
  e[1],
485
502
  "year"
486
503
  /* year */
487
504
  );
488
- for (let y = 0; y <= Math.abs(D === 0 ? 1 : D); y++) {
489
- const k = y * (u + 1), j = a === "right" ? n : $(n).add(k).toNumber(), C = a === "right" ? $(d).add(k).toNumber() : d, [G, V] = x(e[0], "year", y, v), J = g(i, j, C);
490
- J.custom = {
491
- ...M,
492
- startTime: G,
505
+ for (let b = 0; b <= Math.abs(N === 0 ? 1 : N); b++) {
506
+ const v = b * (M + 1), I = a === "right" ? d : C(d).add(v).toNumber(), B = a === "right" ? C(i).add(v).toNumber() : i, [U, V] = S(e[0], "year", b, y), _ = g(Y, I, B);
507
+ _.custom = {
508
+ ...x,
509
+ startTime: U,
493
510
  endTime: V
494
511
  };
495
512
  }
@@ -497,82 +514,104 @@ async function ht(t, r) {
497
514
  }
498
515
  case "hour": {
499
516
  if (!a) {
500
- const f = Y ? e[0] : e[0] ?? c, [h, p] = x(f, "hour", 1, 1), y = g(i, n, d);
501
- y.custom = {
502
- ...M,
503
- startTime: h,
504
- endTime: p
517
+ const m = w ? e[0] : e[0] ?? h, [D, T] = S(m, "hour", 1, 1), b = g(Y, d, i);
518
+ b.custom = {
519
+ ...x,
520
+ startTime: D,
521
+ endTime: T
505
522
  };
506
523
  break;
507
524
  }
508
- D = S(
525
+ N = H(
509
526
  e[0],
510
527
  e[1],
511
528
  "hour"
512
529
  /* hour */
513
530
  );
514
- for (let f = 0; f <= Math.abs(D === 0 ? 1 : D); f++) {
515
- const h = f * (u + 1), p = a === "right" ? n : $(n).add(h).toNumber(), y = a === "right" ? $(d).add(h).toNumber() : d, k = g(i, p, y);
516
- if (Y) {
517
- const V = l(e[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [J, _] = x(V, "hour", f, v);
518
- k.custom = {
519
- ...M,
520
- startTime: J,
521
- endTime: _
531
+ for (let m = 0; m <= Math.abs(N === 0 ? 1 : N); m++) {
532
+ const D = m * (M + 1), T = a === "right" ? d : C(d).add(D).toNumber(), b = a === "right" ? C(i).add(D).toNumber() : i, v = g(Y, T, b);
533
+ if (w) {
534
+ const V = l(e[0]).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [_, Q] = S(V, "hour", m, y);
535
+ v.custom = {
536
+ ...x,
537
+ startTime: _,
538
+ endTime: Q
522
539
  };
523
540
  continue;
524
541
  }
525
- const j = l(c).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [C, G] = x(j, "hour", f, v);
526
- k.custom = {
527
- ...M,
528
- startTime: C,
529
- endTime: G
542
+ const I = l(h).add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), [B, U] = S(I, "hour", m, y);
543
+ v.custom = {
544
+ ...x,
545
+ startTime: B,
546
+ endTime: U
547
+ };
548
+ }
549
+ break;
550
+ }
551
+ case "shift": {
552
+ if (!a) {
553
+ const [m, D] = e, T = g(Y, d, i);
554
+ T.custom = {
555
+ ...x,
556
+ startTime: m,
557
+ endTime: D
558
+ };
559
+ break;
560
+ }
561
+ if (!f.length)
562
+ throw new Error("没有获取到当班数据");
563
+ for (let m = 0; m < f.length; m++) {
564
+ const D = f[m], { startDatetime: T, endDatetime: b } = D, v = m * (M + 1), I = a === "right" ? d : C(d).add(v).toNumber(), B = a === "right" ? C(i).add(v).toNumber() : i, U = g(Y, I, B);
565
+ U.custom = {
566
+ ...x,
567
+ startTime: T,
568
+ endTime: b
530
569
  };
531
570
  }
532
571
  break;
533
572
  }
534
573
  }
535
574
  }
536
- return i;
575
+ return Y;
537
576
  }, {});
538
- return Promise.resolve(s);
577
+ return Promise.resolve(c);
539
578
  }
540
- function Yt(t) {
541
- return Object.entries(t).reduce((o, [e, c]) => {
542
- const s = Math.max(...Object.keys(c).map(Number));
543
- return s > o ? o = Number(s) : o = Number(o) || 0, o;
579
+ function bt(t) {
580
+ return Object.entries(t).reduce((r, [e, f]) => {
581
+ const n = Math.max(...Object.keys(f).map(Number));
582
+ return n > r ? r = Number(n) : r = Number(r) || 0, r;
544
583
  }, 0);
545
584
  }
546
- function Dt(t, r) {
547
- const o = JSON.parse(JSON.stringify(t || {}));
548
- for (const [e, c] of Object.entries(r)) {
549
- o[e] || (o[e] = {});
550
- for (const [s, i] of Object.entries(c)) {
551
- const N = i, n = o[e]?.[s];
552
- n ? o[e][s] = {
553
- ...n,
554
- ...N,
585
+ function gt(t, o) {
586
+ const r = JSON.parse(JSON.stringify(t || {}));
587
+ for (const [e, f] of Object.entries(o)) {
588
+ r[e] || (r[e] = {});
589
+ for (const [n, h] of Object.entries(f)) {
590
+ const k = h, c = r[e]?.[n];
591
+ c ? r[e][n] = {
592
+ ...c,
593
+ ...k,
555
594
  custom: {
556
- ...n.custom,
557
- ...N.custom
595
+ ...c.custom,
596
+ ...k.custom
558
597
  }
559
- } : o[e][s] = N;
598
+ } : r[e][n] = k;
560
599
  }
561
600
  }
562
- return o;
601
+ return r;
563
602
  }
564
- const yt = "./style.css";
603
+ const Mt = "./style.css";
565
604
  export {
566
- nt as CycleTypeEnum,
567
- st as ModeEnum,
568
- $ as decimal,
569
- dt as filterIndicatorsCell,
570
- ht as generateIndicatorsCells,
571
- K as generateUUID,
572
- Yt as getNumColumns,
573
- ft as handleClearInput,
574
- lt as initDateRange,
575
- Dt as mergeCellData,
576
- yt as stylePath,
577
- mt as useData
605
+ it as CycleTypeEnum,
606
+ ct as ModeEnum,
607
+ C as decimal,
608
+ Dt as filterIndicatorsCell,
609
+ yt as generateIndicatorsCells,
610
+ W as generateUUID,
611
+ bt as getNumColumns,
612
+ dt as handleClearInput,
613
+ Yt as initDateRange,
614
+ gt as mergeCellData,
615
+ Mt as stylePath,
616
+ ht as useData
578
617
  };
@@ -1 +1 @@
1
- (function(Y,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("dayjs"),require("@univerjs/presets"),require("decimal.js")):typeof define=="function"&&define.amd?define(["exports","dayjs","@univerjs/presets","decimal.js"],c):(Y=typeof globalThis<"u"?globalThis:Y||self,c(Y.TorUniverSheet={},Y.dayjs,Y.presets,Y.Decimal))})(this,(function(Y,c,R,z){"use strict";const W=(e,r)=>{for(const n of r)e[n]=null},_=()=>{if(typeof crypto=="object"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"&&typeof Uint8Array=="function"){const n=t=>{const f=Number(t);return(f^crypto.getRandomValues(new Uint8Array(1))[0]&15>>f/4).toString(16)};return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n)}}let e=new Date().getTime(),r=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{let t=Math.random()*16;return e>0?(t=(e+t)%16|0,e=Math.floor(e/16)):(t=(r+t)%16|0,r=Math.floor(r/16)),(n==="x"?t:t&3|8).toString(16)})};function X(e){return{...e?.workbookData,id:e?.id||_(),name:e?.name||"未命名",appVersion:e?.appVersion||"1.0.0"}}const ee=Object.prototype.toString,K=(e,r)=>ee.call(e)===`[object ${r}]`,te=e=>typeof e<"u",re=e=>!te(e),ne=e=>e!==null&&K(e,"Object"),H=e=>e==null||typeof e>"u"?!0:A(e)||ae(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:ne(e)?Object.keys(e).length===0:!1,oe=e=>e===null,se=e=>re(e)||oe(e),ae=e=>K(e,"String"),A=e=>e&&Array.isArray(e);class ie{value;constructor(r){this.value=new z(r)}add(r){return this.value=this.value.add(r||0),this}subtract(r){return this.value=this.value.sub(r||0),this}multiply(r){return this.value=this.value.mul(r||0),this}divide(r){const n=new z(r);if(n.isZero())throw new Error("除数是0");return this.value=this.value.div(n),this}toFixed(r,n){return this.value=new z(this.value.toFixed(r,n)),this}valueOf(){return this.value}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}}function I(e=0){return new ie(e)}var L=(e=>(e.无="no",e.年="year",e.月="month",e.周="week",e.天="day",e.班组="shift",e.小时="hour",e.半小时="half_hour",e))(L||{}),Q=(e=>(e.view="view",e.edit="edit",e))(Q||{});async function ue(e,r){if(!r)return Promise.reject("日期不能为空");switch(e){case"year":if(A(r))return Promise.resolve(r);const n=c(r);if(!n.isValid())return Promise.reject("无效的日期格式");const t=n.year(),f=`${t}-01`,s=`${t}-12`;return Promise.resolve([f,s]);case"month":if(A(r))return Promise.resolve(r);const i=c(r);if(!i.isValid())return Promise.reject("无效的日期格式");const x=i.startOf("month").format("YYYY-MM-DD"),o=i.endOf("month").format("YYYY-MM-DD");return Promise.resolve([x,o]);case"day":if(A(r))return Promise.resolve(r);const p=c(r);if(!p.isValid())return Promise.reject("无效的日期格式");const d=p.startOf("day").format("YYYY-MM-DD HH:mm:ss"),V=p.endOf("day").format("YYYY-MM-DD HH:mm:ss");return Promise.resolve([d,V]);default:return Promise.reject("不支持的周期类型")}}function k(e,r,n){if(!n)return 0;const t={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"HH:mm:ss"}[n];return["day","hour"].includes(n),c(r,t).diff(c(e,t),n)}function F(e,r,n){if(!n)throw new Error("日期类型不能为空");const t={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"HH:mm:ss"}[n];return c(e).subtract(r,n).format(t)}function T(e,r,n,t){const f="YYYY-MM-DD HH:mm:ss",s=E(e,r,n,t),i=c(s);if(r==="month"){const o=i.month();return o===0?[i.startOf("month").format(f),i.date(25).endOf("day").format(f)]:o===11?[i.subtract(1,"month").date(26).startOf("day").format(f),i.endOf("month").format(f)]:[i.subtract(1,"month").date(26).startOf("day").format(f),i.date(25).endOf("day").format(f)]}const x={year:"year",day:"day",hour:"hour"};return[i.startOf(x[r]).format(f),i.endOf(x[r]).format(f)]}function E(e,r,n,t){const f={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"YYYY-MM-DD HH:mm:ss"}[r];return c(e,f).add(n*t,r).format(f)}function M(e,r,n){return e[r]||(e[r]={}),e[r][n]||(e[r][n]={}),e[r][n]}async function ce(e){if(!e)throw new Error("cellData is required");const r=Object.entries(e).reduce((n,t)=>{const[f,s]=t;for(const[i,x]of Object.entries(s)){const{custom:o,v:p,t:d,s:V}=x;if(!o)continue;const{cellType:m}=o,$=!o.hasOwnProperty("writeBack")||H(o?.writeBack)?!0:o.writeBack;if(m==="indicator"){const P=M(n,f,i);P.custom={...o,required:H(o?.required)?!1:o?.required,defaultShift:H(o?.defaultShift)?!1:o?.defaultShift,forwardPush:H(o?.forwardPush)?!1:o?.forwardPush,forwardPushTimes:H(o?.useDefaultEndDate)?0:o?.forwardPushTimes,useDefaultEndDate:H(o?.useDefaultEndDate)?!1:o?.useDefaultEndDate,copyType:H(o?.copyType)?"":o?.copyType,writeBack:$},P.s=V,P.t=d,P.v=p}}return n},{});return!r||H(r)?Promise.reject(new Error("No data found")):Promise.resolve(r)}function J(e,r){return e.replace(/\$\{([^}]+)\}/g,(n,t)=>{try{const f=Object.keys(r),s=Object.values(r);return new Function(...f,`return ${t};`)(...s)}catch(f){return console.error(`表达式执行失败: ${t}`,f),n}})}function fe({acc:e,params:r,initRowNum:n,initColNum:t,cellData:f}){const{rangeData:s,currentDay:i,extraArgs:x}=r;x?.teamData;const{cycleType:o,timeIncrement:p,forwardPush:d,forwardPushTimes:V,copyType:m,copyInterval:$,defaultShift:P,templateStr:C,useDefaultEndDate:q}=f.custom;let b=0;switch(o){case"day":{let a="";if(d&&(a=F(s[0],V,"day")),!m){let u="";d?u=a:u=s[0];const D=M(e,n,t);D.v=C?J(C,{businessDate:u,dayjs:c}):c(u).format("YYYY-MM-DD"),D.t=R.CellValueType.STRING;break}d?b=k(a,s[0],"day"):(b=k(s[0],s[1],"day"),console.log("copyNum",b));for(let u=0;u<=Math.abs(b===0?1:b);u++){const D=u*($+1);let O="";d?O=E(a,"day",u,p):O=E(s[0],"day",u,p);const v=m==="right"?n:n+D,w=m==="right"?t+D:t,y=M(e,v,w);y.v=C?J(C,{businessDate:O,dayjs:c}):c(O).format("YYYY-MM-DD"),y.t=R.CellValueType.STRING}break}case"month":{if(!m){const[a,u]=T(s[1],"month",0,1),D=M(e,n,t);D.v=c(u).format("YYYY-MM"),D.t=R.CellValueType.STRING;break}b=k(s[0],s[1],"month");for(let a=0;a<=Math.abs(b===0?1:b);a++){const u=a*($+1),D=m==="right"?n:n+u,O=m==="right"?t+u:t,v=M(e,D,O);v.v=E(s[0],"month",a,p),v.t=R.CellValueType.STRING}break}case"year":{let a="";if(d&&(a=F(s[0],V||0,"year")),!m){const u=d?a:s[0],[D,O]=T(u,"year",0,1),v=M(e,n,t),[,w]=T(s[1],"month",0,1);v.v=C?J(C,{startTime:D,endTime:O,rangeData:s,dayjs:c}):u,v.t=R.CellValueType.STRING;break}d?b=k(a,s[0],"year"):b=k(s[0],s[1],"year");for(let u=0;u<=Math.abs(b===0?1:b);u++){const D=u*($+1),O=m==="right"?n:n+D,v=m==="right"?t+D:t,[w,y]=T(s[0],"year",u,p),l=M(e,O,v),h=E(s[0],"year",u,p);l.v=C?J(C,{startTime:w,endTime:y,rangeData:s,dayjs:c}):h,l.t=R.CellValueType.STRING}break}case"hour":{if(!m){const a=M(e,n,t);if(a.t=R.CellValueType.STRING,P){a.v=c(s[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}a.v=c(i).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}b=k(s[0],s[1],"hour");for(let a=0;a<=Math.abs(b===0?1:b);a++){const u=a*($+1),D=m==="right"?n:n+u,O=m==="right"?t+u:t,v=M(e,D,O);if(v.t=R.CellValueType.STRING,P){const w=c(s[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");v.v=E(w,"hour",a,p);continue}v.v=E(c(i).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),"hour",a,p)}}}}async function le(e,r){if(!e)return Promise.reject("没有可用的单元格数据");const{extraArgs:n,rangeData:t}=r;if(!t.length)return Promise.reject("处理时间范围失败, rangeData不能为空");n?.teamData;const f=r?.currentDay||c().format("YYYY-MM-DD"),s=Object.entries(e).reduce((i,x)=>{const[o,p]=x;for(const[d,V]of Object.entries(p)){const{custom:m}=V;if(!m)continue;const{cellType:$,cycleType:P,timeIncrement:C,forwardPush:q,forwardPushTimes:b,copyType:a,copyInterval:u,defaultShift:D,useDefaultStartDate:O,useDefaultEndDate:v}=m;if($==="time"){fe({acc:i,params:r,initRowNum:Number(o),initColNum:Number(d),cellData:V});continue}const w={cycleType:P,indicatorName:m.indicatorName,indicatorCode:m.indicatorCode,indicatorId:m.indicatorId,indicatorDimensionName:m.indicatorDimensionName,indicatorDimensionConfig:m.indicatorDimensionConfig,required:se(m?.required)??!1,cellType:m.cellType,defaultShift:m?.defaultShift||!1,writeBack:H(m?.writeBack)?!0:m.writeBack};let y=0;switch(P){case"day":{let l="";if(q&&(l=F(t[0],b||0,"day")),!a){const h=q?l:t[0],[N,g]=T(h,"day",0,1),S=M(i,o,d);S.custom={...w,startTime:N,endTime:g};break}q?y=k(l,t[0],"day"):y=k(t[0],t[1],"day");for(let h=0;h<=Math.abs(y===0?1:y);h++){const N=h*(u+1),g=q?l:t[0],[S,B]=T(g,"day",h,C),U=a==="right"?o:I(o).add(N).toNumber(),G=a==="right"?I(d).add(N).toNumber():d,j=M(i,U,G);j.custom={...w,startTime:S,endTime:B}}break}case"month":{if(!a){const[l,h]=T(t[1],"month",0,1),N=M(i,o,d);N.custom={...w,startTime:l,endTime:h};break}y=k(t[0],t[1],"month");for(let l=0;l<=Math.abs(y===0?1:y);l++){const h=l*(u+1),N=a==="right"?o:I(o).add(h).toNumber(),g=a==="right"?I(d).add(h).toNumber():d,[S,B]=T(t[0],"month",l,C),U=M(i,N,g);U.custom={...w,startTime:S,endTime:B}}break}case"year":{let l="",h="",N="";if(q){l=F(t[0],b||0,"year");const g=c(t[1]).format("MM");h=c(`${l}-${g+1}`).format("YYYY-MM"),N=c(`${l}-${g+2}`).format("YYYY-MM")}if(!a){const g=q?l:t[0],[S,B]=T(g,"year",0,1),U=M(i,o,d),[,G]=T(h,"month",0,1),[j]=T(N,"month",0,1);U.custom={...w,startTime:O?j:S,endTime:v?G:B};break}q?y=k(l,t[0],"year"):y=k(t[0],t[1],"year");for(let g=0;g<=Math.abs(y===0?1:y);g++){const S=g*(u+1),B=a==="right"?o:I(o).add(S).toNumber(),U=a==="right"?I(d).add(S).toNumber():d,[G,j]=T(t[0],"year",g,C),Z=M(i,B,U);Z.custom={...w,startTime:G,endTime:j}}break}case"hour":{if(!a){const l=D?t[0]:t[0]??f,[h,N]=T(l,"hour",1,1),g=M(i,o,d);g.custom={...w,startTime:h,endTime:N};break}y=k(t[0],t[1],"hour");for(let l=0;l<=Math.abs(y===0?1:y);l++){const h=l*(u+1),N=a==="right"?o:I(o).add(h).toNumber(),g=a==="right"?I(d).add(h).toNumber():d,S=M(i,N,g);if(D){const j=c(t[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[Z,Ye]=T(j,"hour",l,C);S.custom={...w,startTime:Z,endTime:Ye};continue}const B=c(f).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[U,G]=T(B,"hour",l,C);S.custom={...w,startTime:U,endTime:G}}break}}}return i},{});return Promise.resolve(s)}function me(e){return Object.entries(e).reduce((n,[t,f])=>{const s=Math.max(...Object.keys(f).map(Number));return s>n?n=Number(s):n=Number(n)||0,n},0)}function de(e,r){const n=JSON.parse(JSON.stringify(e||{}));for(const[t,f]of Object.entries(r)){n[t]||(n[t]={});for(const[s,i]of Object.entries(f)){const x=i,o=n[t]?.[s];o?n[t][s]={...o,...x,custom:{...o.custom,...x.custom}}:n[t][s]=x}}return n}const he="./style.css";Y.CycleTypeEnum=L,Y.ModeEnum=Q,Y.decimal=I,Y.filterIndicatorsCell=ce,Y.generateIndicatorsCells=le,Y.generateUUID=_,Y.getNumColumns=me,Y.handleClearInput=W,Y.initDateRange=ue,Y.mergeCellData=de,Y.stylePath=he,Y.useData=X,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(M,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("dayjs"),require("@univerjs/presets"),require("decimal.js")):typeof define=="function"&&define.amd?define(["exports","dayjs","@univerjs/presets","decimal.js"],i):(M=typeof globalThis<"u"?globalThis:M||self,i(M.TorUniverSheet={},M.dayjs,M.presets,M.Decimal))})(this,(function(M,i,E,_){"use strict";const te=(e,n)=>{for(const r of n)e[r]=null},Q=()=>{if(typeof crypto=="object"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"&&typeof Uint8Array=="function"){const r=t=>{const l=Number(t);return(l^crypto.getRandomValues(new Uint8Array(1))[0]&15>>l/4).toString(16)};return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r)}}let e=new Date().getTime(),n=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let t=Math.random()*16;return e>0?(t=(e+t)%16|0,e=Math.floor(e/16)):(t=(n+t)%16|0,n=Math.floor(n/16)),(r==="x"?t:t&3|8).toString(16)})};function re(e){return{...e?.workbookData,id:e?.id||Q(),name:e?.name||"未命名",appVersion:e?.appVersion||"1.0.0"}}const ne=Object.prototype.toString,W=(e,n)=>ne.call(e)===`[object ${n}]`,oe=e=>typeof e<"u",se=e=>!oe(e),ae=e=>e!==null&&W(e,"Object"),$=e=>e==null||typeof e>"u"?!0:z(e)||ce(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:ae(e)?Object.keys(e).length===0:!1,ie=e=>e===null,ue=e=>se(e)||ie(e),ce=e=>W(e,"String"),z=e=>e&&Array.isArray(e);class fe{value;constructor(n){this.value=new _(n)}add(n){return this.value=this.value.add(n||0),this}subtract(n){return this.value=this.value.sub(n||0),this}multiply(n){return this.value=this.value.mul(n||0),this}divide(n){const r=new _(n);if(r.isZero())throw new Error("除数是0");return this.value=this.value.div(r),this}toFixed(n,r){return this.value=new _(this.value.toFixed(n,r)),this}valueOf(){return this.value}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}}function H(e=0){return new fe(e)}var X=(e=>(e.无="no",e.年="year",e.月="month",e.周="week",e.天="day",e.班组="shift",e.小时="hour",e.半小时="half_hour",e))(X||{}),ee=(e=>(e.view="view",e.edit="edit",e))(ee||{});async function le(e,n){if(!n)return Promise.reject("日期不能为空");switch(e){case"year":if(z(n))return Promise.resolve(n);const r=i(n);if(!r.isValid())return Promise.reject("无效的日期格式");const t=r.year(),l=`${t}-01`,o=`${t}-12`;return Promise.resolve([l,o]);case"month":if(z(n))return Promise.resolve(n);const h=i(n);if(!h.isValid())return Promise.reject("无效的日期格式");const O=h.startOf("month").format("YYYY-MM-DD"),c=h.endOf("month").format("YYYY-MM-DD");return Promise.resolve([O,c]);case"day":if(z(n))return Promise.resolve(n);const Y=i(n);if(!Y.isValid())return Promise.reject("无效的日期格式");const N=Y.startOf("day").format("YYYY-MM-DD HH:mm:ss"),d=Y.endOf("day").format("YYYY-MM-DD HH:mm:ss");return Promise.resolve([N,d]);default:return Promise.reject("不支持的周期类型")}}function V(e,n,r){if(!r)return 0;const t={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"HH:mm:ss"}[r];return["day","hour"].includes(r),i(n,t).diff(i(e,t),r)}function Z(e,n,r){if(!r)throw new Error("日期类型不能为空");const t={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"HH:mm:ss"}[r];return i(e).subtract(n,r).format(t)}function k(e,n,r,t){const l="YYYY-MM-DD HH:mm:ss",o=A(e,n,r,t),h=i(o);if(n==="month"){const c=h.month();return c===0?[h.startOf("month").format(l),h.date(25).endOf("day").format(l)]:c===11?[h.subtract(1,"month").date(26).startOf("day").format(l),h.endOf("month").format(l)]:[h.subtract(1,"month").date(26).startOf("day").format(l),h.date(25).endOf("day").format(l)]}const O={year:"year",day:"day",hour:"hour"};return[h.startOf(O[n]).format(l),h.endOf(O[n]).format(l)]}function A(e,n,r,t){const l={year:"YYYY",month:"YYYY-MM",day:"YYYY-MM-DD",hour:"YYYY-MM-DD HH:mm:ss"}[n];return i(e,l).add(r*t,n).format(l)}function g(e,n,r){return e[n]||(e[n]={}),e[n][r]||(e[n][r]={}),e[n][r]}async function me(e){if(!e)throw new Error("cellData is required");const n=Object.entries(e).reduce((r,t)=>{const[l,o]=t;for(const[h,O]of Object.entries(o)){const{custom:c,v:Y,t:N,s:d}=O;if(!c)continue;const{cellType:J}=c,u=!c.hasOwnProperty("writeBack")||$(c?.writeBack)?!0:c.writeBack;if(J==="indicator"){const I=g(r,l,h);I.custom={...c,required:$(c?.required)?!1:c?.required,defaultShift:$(c?.defaultShift)?!1:c?.defaultShift,forwardPush:$(c?.forwardPush)?!1:c?.forwardPush,forwardPushTimes:$(c?.useDefaultEndDate)?0:c?.forwardPushTimes,useDefaultEndDate:$(c?.useDefaultEndDate)?!1:c?.useDefaultEndDate,copyType:$(c?.copyType)?"":c?.copyType,writeBack:u},I.s=d,I.t=N,I.v=Y}}return r},{});return!n||$(n)?Promise.reject(new Error("No data found")):Promise.resolve(n)}function F(e,n){return e.replace(/\$\{([^}]+)\}/g,(r,t)=>{try{const l=Object.keys(n),o=Object.values(n);return new Function(...l,`return ${t};`)(...o)}catch(l){return console.error(`表达式执行失败: ${t}`,l),r}})}function de({acc:e,params:n,initRowNum:r,initColNum:t,cellData:l}){const{rangeData:o,currentDay:h,extraArgs:O}=n,c=O?.teamData||{},{cycleType:Y,timeIncrement:N,forwardPush:d,forwardPushTimes:J,copyType:u,copyInterval:I,defaultShift:S,templateStr:P,useDefaultEndDate:K}=l.custom;let y=0;switch(Y){case"day":{let s="";if(d&&(s=Z(o[0],J,"day")),!u){let f="";d?f=s:f=o[0];const a=g(e,r,t);a.v=P?F(P,{businessDate:f,dayjs:i}):i(f).format("YYYY-MM-DD"),a.t=E.CellValueType.STRING;break}d?y=V(s,o[0],"day"):(y=V(o[0],o[1],"day"),console.log("copyNum",y));for(let f=0;f<=Math.abs(y===0?1:y);f++){const a=f*(I+1);let w="";d?w=A(s,"day",f,N):w=A(o[0],"day",f,N);const T=u==="right"?r:r+a,R=u==="right"?t+a:t,G=g(e,T,R);G.v=P?F(P,{businessDate:w,dayjs:i}):i(w).format("YYYY-MM-DD"),G.t=E.CellValueType.STRING}break}case"month":{if(!u){const[s,f]=k(o[1],"month",0,1),a=g(e,r,t);a.v=i(f).format("YYYY-MM"),a.t=E.CellValueType.STRING;break}y=V(o[0],o[1],"month");for(let s=0;s<=Math.abs(y===0?1:y);s++){const f=s*(I+1),a=u==="right"?r:r+f,w=u==="right"?t+f:t,T=g(e,a,w);T.v=A(o[0],"month",s,N),T.t=E.CellValueType.STRING}break}case"year":{let s="";if(d&&(s=Z(o[0],J||0,"year")),!u){const f=d?s:o[0],[a,w]=k(f,"year",0,1),T=g(e,r,t),[,R]=k(o[1],"month",0,1);T.v=P?F(P,{startTime:a,endTime:w,rangeData:o,dayjs:i}):f,T.t=E.CellValueType.STRING;break}d?y=V(s,o[0],"year"):y=V(o[0],o[1],"year");for(let f=0;f<=Math.abs(y===0?1:y);f++){const a=f*(I+1),w=u==="right"?r:r+a,T=u==="right"?t+a:t,[R,G]=k(o[0],"year",f,N),v=g(e,w,T),C=A(o[0],"year",f,N);v.v=P?F(P,{startTime:R,endTime:G,rangeData:o,dayjs:i}):C,v.t=E.CellValueType.STRING}break}case"hour":{if(!u){const s=g(e,r,t);if(s.t=E.CellValueType.STRING,S){s.v=i(o[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}s.v=i(h).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");break}y=V(o[0],o[1],"hour");for(let s=0;s<=Math.abs(y===0?1:y);s++){const f=s*(I+1),a=u==="right"?r:r+f,w=u==="right"?t+f:t,T=g(e,a,w);if(T.t=E.CellValueType.STRING,S){const R=i(o[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss");T.v=A(R,"hour",s,N);continue}T.v=A(i(h).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),"hour",s,N)}break}case"shift":{if(!u){const s=g(e,r,t);s.t=E.CellValueType.STRING,s.v=P?F(P,{rangeData:o,dayjs:i}):o[0];break}if(!c.length)throw new Error("没有获取到当班数据");for(let s=0;s<c.length;s++){const f=c[s],{startDatetime:a,endDatetime:w}=f,T=s*(I+1),R=u==="right"?r:H(r).add(T).toNumber(),G=u==="right"?H(t).add(T).toNumber():t,v=g(e,R,G);v.v=P?F(P,{team:f}):a}break}}}async function he(e,n){if(!e)return Promise.reject("没有可用的单元格数据");const{extraArgs:r,rangeData:t}=n;if(!t.length)return Promise.reject("处理时间范围失败, rangeData不能为空");const l=r?.teamData||[],{periodicityTime:o}=n,h=n?.currentDay||i().format("YYYY-MM-DD"),O=(Y,N)=>o?parseInt(o.split(":")[0],10)<12?[Y,i(N).add(1,"day").format("YYYY-MM-DD")+" "+o]:[i(Y).subtract(1,"day").format("YYYY-MM-DD")+" "+o,N]:[Y,N],c=Object.entries(e).reduce((Y,N)=>{const[d,J]=N;for(const[u,I]of Object.entries(J)){const{custom:S}=I;if(!S)continue;const{cellType:P,cycleType:K,timeIncrement:y,forwardPush:s,forwardPushTimes:f,copyType:a,copyInterval:w,defaultShift:T,useDefaultStartDate:R,useDefaultEndDate:G}=S;if(P==="time"){de({acc:Y,params:n,initRowNum:Number(d),initColNum:Number(u),cellData:I});continue}const v={cycleType:K,indicatorName:S.indicatorName,indicatorCode:S.indicatorCode,indicatorId:S.indicatorId,indicatorDimensionName:S.indicatorDimensionName,indicatorDimensionConfig:S.indicatorDimensionConfig,required:ue(S?.required)??!1,cellType:S.cellType,defaultShift:S?.defaultShift||!1,writeBack:$(S?.writeBack)?!0:S.writeBack};let C=0;switch(K){case"day":{let m="";if(s&&(m=Z(t[0],f||0,"day")),!a){const D=s?m:t[0],[p,b]=O(...k(D,"day",0,1)),x=g(Y,d,u);x.custom={...v,startTime:p,endTime:b};break}s?C=V(m,t[0],"day"):C=V(t[0],t[1],"day");for(let D=0;D<=Math.abs(C===0?1:C);D++){const p=D*(w+1),b=s?m:t[0],[x,B]=O(...k(b,"day",D,y)),U=a==="right"?d:H(d).add(p).toNumber(),q=a==="right"?H(u).add(p).toNumber():u,j=g(Y,U,q);j.custom={...v,startTime:x,endTime:B}}break}case"month":{if(!a){const[m,D]=k(t[1],"month",0,1),p=g(Y,d,u);p.custom={...v,startTime:m,endTime:D};break}C=V(t[0],t[1],"month");for(let m=0;m<=Math.abs(C===0?1:C);m++){const D=m*(w+1),p=a==="right"?d:H(d).add(D).toNumber(),b=a==="right"?H(u).add(D).toNumber():u,[x,B]=k(t[0],"month",m,y),U=g(Y,p,b);U.custom={...v,startTime:x,endTime:B}}break}case"year":{let m="",D="",p="";if(s){m=Z(t[0],f||0,"year");const b=i(t[1]).format("MM");D=i(`${m}-${b+1}`).format("YYYY-MM"),p=i(`${m}-${b+2}`).format("YYYY-MM")}if(!a){const b=s?m:t[0],[x,B]=k(b,"year",0,1),U=g(Y,d,u),[,q]=k(D,"month",0,1),[j]=k(p,"month",0,1);U.custom={...v,startTime:R?j:x,endTime:G?q:B};break}s?C=V(m,t[0],"year"):C=V(t[0],t[1],"year");for(let b=0;b<=Math.abs(C===0?1:C);b++){const x=b*(w+1),B=a==="right"?d:H(d).add(x).toNumber(),U=a==="right"?H(u).add(x).toNumber():u,[q,j]=k(t[0],"year",b,y),L=g(Y,B,U);L.custom={...v,startTime:q,endTime:j}}break}case"hour":{if(!a){const m=T?t[0]:t[0]??h,[D,p]=k(m,"hour",1,1),b=g(Y,d,u);b.custom={...v,startTime:D,endTime:p};break}C=V(t[0],t[1],"hour");for(let m=0;m<=Math.abs(C===0?1:C);m++){const D=m*(w+1),p=a==="right"?d:H(d).add(D).toNumber(),b=a==="right"?H(u).add(D).toNumber():u,x=g(Y,p,b);if(T){const j=i(t[0]).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[L,ye]=k(j,"hour",m,y);x.custom={...v,startTime:L,endTime:ye};continue}const B=i(h).add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),[U,q]=k(B,"hour",m,y);x.custom={...v,startTime:U,endTime:q}}break}case"shift":{if(!a){const[m,D]=t,p=g(Y,d,u);p.custom={...v,startTime:m,endTime:D};break}if(!l.length)throw new Error("没有获取到当班数据");for(let m=0;m<l.length;m++){const D=l[m],{startDatetime:p,endDatetime:b}=D,x=m*(w+1),B=a==="right"?d:H(d).add(x).toNumber(),U=a==="right"?H(u).add(x).toNumber():u,q=g(Y,B,U);q.custom={...v,startTime:p,endTime:b}}break}}}return Y},{});return Promise.resolve(c)}function Ye(e){return Object.entries(e).reduce((r,[t,l])=>{const o=Math.max(...Object.keys(l).map(Number));return o>r?r=Number(o):r=Number(r)||0,r},0)}function De(e,n){const r=JSON.parse(JSON.stringify(e||{}));for(const[t,l]of Object.entries(n)){r[t]||(r[t]={});for(const[o,h]of Object.entries(l)){const O=h,c=r[t]?.[o];c?r[t][o]={...c,...O,custom:{...c.custom,...O.custom}}:r[t][o]=O}}return r}const ge="./style.css";M.CycleTypeEnum=X,M.ModeEnum=ee,M.decimal=H,M.filterIndicatorsCell=me,M.generateIndicatorsCells=he,M.generateUUID=Q,M.getNumColumns=Ye,M.handleClearInput=te,M.initDateRange=le,M.mergeCellData=De,M.stylePath=ge,M.useData=re,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
@@ -90,6 +90,7 @@ export declare interface IGenerateIndicatorsCellsParams {
90
90
  extraArgs: any;
91
91
  rangeData: string[];
92
92
  currentDay?: string;
93
+ periodicityTime?: string;
93
94
  }
94
95
 
95
96
  export declare function initDateRange(cycleType: CycleTypeEnum, date: string[] | string): Promise<string[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tor-univer-sheet",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "style": "./dist/style.css",
5
5
  "description": "基于 Univer 的 Vue3 电子表格组件",
6
6
  "author": "tortormore",