sdy-gantt 1.0.0

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.
@@ -0,0 +1,1117 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["sdy-gantt"] = factory();
8
+ else
9
+ root["sdy-gantt"] = factory();
10
+ })((typeof self !== 'undefined' ? self : this), function() {
11
+ return /******/ (function(modules) { // webpackBootstrap
12
+ /******/ // The module cache
13
+ /******/ var installedModules = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function __webpack_require__(moduleId) {
17
+ /******/
18
+ /******/ // Check if module is in cache
19
+ /******/ if(installedModules[moduleId]) {
20
+ /******/ return installedModules[moduleId].exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var module = installedModules[moduleId] = {
24
+ /******/ i: moduleId,
25
+ /******/ l: false,
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
+ /******/
32
+ /******/ // Flag the module as loaded
33
+ /******/ module.l = true;
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /******/
40
+ /******/ // expose the modules object (__webpack_modules__)
41
+ /******/ __webpack_require__.m = modules;
42
+ /******/
43
+ /******/ // expose the module cache
44
+ /******/ __webpack_require__.c = installedModules;
45
+ /******/
46
+ /******/ // define getter function for harmony exports
47
+ /******/ __webpack_require__.d = function(exports, name, getter) {
48
+ /******/ if(!__webpack_require__.o(exports, name)) {
49
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
+ /******/ }
51
+ /******/ };
52
+ /******/
53
+ /******/ // define __esModule on exports
54
+ /******/ __webpack_require__.r = function(exports) {
55
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
+ /******/ }
58
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
+ /******/ };
60
+ /******/
61
+ /******/ // create a fake namespace object
62
+ /******/ // mode & 1: value is a module id, require it
63
+ /******/ // mode & 2: merge all properties of value into the ns
64
+ /******/ // mode & 4: return value when already ns object
65
+ /******/ // mode & 8|1: behave like require
66
+ /******/ __webpack_require__.t = function(value, mode) {
67
+ /******/ if(mode & 1) value = __webpack_require__(value);
68
+ /******/ if(mode & 8) return value;
69
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
+ /******/ var ns = Object.create(null);
71
+ /******/ __webpack_require__.r(ns);
72
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
+ /******/ return ns;
75
+ /******/ };
76
+ /******/
77
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
78
+ /******/ __webpack_require__.n = function(module) {
79
+ /******/ var getter = module && module.__esModule ?
80
+ /******/ function getDefault() { return module['default']; } :
81
+ /******/ function getModuleExports() { return module; };
82
+ /******/ __webpack_require__.d(getter, 'a', getter);
83
+ /******/ return getter;
84
+ /******/ };
85
+ /******/
86
+ /******/ // Object.prototype.hasOwnProperty.call
87
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
+ /******/
89
+ /******/ // __webpack_public_path__
90
+ /******/ __webpack_require__.p = "";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = "fb15");
95
+ /******/ })
96
+ /************************************************************************/
97
+ /******/ ({
98
+
99
+ /***/ "24fb":
100
+ /***/ (function(module, exports, __webpack_require__) {
101
+
102
+ "use strict";
103
+
104
+
105
+ /*
106
+ MIT License http://www.opensource.org/licenses/mit-license.php
107
+ Author Tobias Koppers @sokra
108
+ */
109
+ // css base code, injected by the css-loader
110
+ // eslint-disable-next-line func-names
111
+ module.exports = function (useSourceMap) {
112
+ var list = []; // return the list of modules as css string
113
+
114
+ list.toString = function toString() {
115
+ return this.map(function (item) {
116
+ var content = cssWithMappingToString(item, useSourceMap);
117
+
118
+ if (item[2]) {
119
+ return "@media ".concat(item[2], " {").concat(content, "}");
120
+ }
121
+
122
+ return content;
123
+ }).join('');
124
+ }; // import a list of modules into the list
125
+ // eslint-disable-next-line func-names
126
+
127
+
128
+ list.i = function (modules, mediaQuery, dedupe) {
129
+ if (typeof modules === 'string') {
130
+ // eslint-disable-next-line no-param-reassign
131
+ modules = [[null, modules, '']];
132
+ }
133
+
134
+ var alreadyImportedModules = {};
135
+
136
+ if (dedupe) {
137
+ for (var i = 0; i < this.length; i++) {
138
+ // eslint-disable-next-line prefer-destructuring
139
+ var id = this[i][0];
140
+
141
+ if (id != null) {
142
+ alreadyImportedModules[id] = true;
143
+ }
144
+ }
145
+ }
146
+
147
+ for (var _i = 0; _i < modules.length; _i++) {
148
+ var item = [].concat(modules[_i]);
149
+
150
+ if (dedupe && alreadyImportedModules[item[0]]) {
151
+ // eslint-disable-next-line no-continue
152
+ continue;
153
+ }
154
+
155
+ if (mediaQuery) {
156
+ if (!item[2]) {
157
+ item[2] = mediaQuery;
158
+ } else {
159
+ item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
160
+ }
161
+ }
162
+
163
+ list.push(item);
164
+ }
165
+ };
166
+
167
+ return list;
168
+ };
169
+
170
+ function cssWithMappingToString(item, useSourceMap) {
171
+ var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
172
+
173
+ var cssMapping = item[3];
174
+
175
+ if (!cssMapping) {
176
+ return content;
177
+ }
178
+
179
+ if (useSourceMap && typeof btoa === 'function') {
180
+ var sourceMapping = toComment(cssMapping);
181
+ var sourceURLs = cssMapping.sources.map(function (source) {
182
+ return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
183
+ });
184
+ return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
185
+ }
186
+
187
+ return [content].join('\n');
188
+ } // Adapted from convert-source-map (MIT)
189
+
190
+
191
+ function toComment(sourceMap) {
192
+ // eslint-disable-next-line no-undef
193
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
194
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
195
+ return "/*# ".concat(data, " */");
196
+ }
197
+
198
+ /***/ }),
199
+
200
+ /***/ "2c63":
201
+ /***/ (function(module, exports, __webpack_require__) {
202
+
203
+ // style-loader: Adds some css to the DOM by adding a <style> tag
204
+
205
+ // load the styles
206
+ var content = __webpack_require__("7636");
207
+ if(content.__esModule) content = content.default;
208
+ if(typeof content === 'string') content = [[module.i, content, '']];
209
+ if(content.locals) module.exports = content.locals;
210
+ // add the styles to the DOM
211
+ var add = __webpack_require__("499e").default
212
+ var update = add("3e5a16fe", content, true, {"sourceMap":false,"shadowMode":false});
213
+
214
+ /***/ }),
215
+
216
+ /***/ "499e":
217
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
218
+
219
+ "use strict";
220
+ // ESM COMPAT FLAG
221
+ __webpack_require__.r(__webpack_exports__);
222
+
223
+ // EXPORTS
224
+ __webpack_require__.d(__webpack_exports__, "default", function() { return /* binding */ addStylesClient; });
225
+
226
+ // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/listToStyles.js
227
+ /**
228
+ * Translates the list format produced by css-loader into something
229
+ * easier to manipulate.
230
+ */
231
+ function listToStyles (parentId, list) {
232
+ var styles = []
233
+ var newStyles = {}
234
+ for (var i = 0; i < list.length; i++) {
235
+ var item = list[i]
236
+ var id = item[0]
237
+ var css = item[1]
238
+ var media = item[2]
239
+ var sourceMap = item[3]
240
+ var part = {
241
+ id: parentId + ':' + i,
242
+ css: css,
243
+ media: media,
244
+ sourceMap: sourceMap
245
+ }
246
+ if (!newStyles[id]) {
247
+ styles.push(newStyles[id] = { id: id, parts: [part] })
248
+ } else {
249
+ newStyles[id].parts.push(part)
250
+ }
251
+ }
252
+ return styles
253
+ }
254
+
255
+ // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/addStylesClient.js
256
+ /*
257
+ MIT License http://www.opensource.org/licenses/mit-license.php
258
+ Author Tobias Koppers @sokra
259
+ Modified by Evan You @yyx990803
260
+ */
261
+
262
+
263
+
264
+ var hasDocument = typeof document !== 'undefined'
265
+
266
+ if (typeof DEBUG !== 'undefined' && DEBUG) {
267
+ if (!hasDocument) {
268
+ throw new Error(
269
+ 'vue-style-loader cannot be used in a non-browser environment. ' +
270
+ "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
271
+ ) }
272
+ }
273
+
274
+ /*
275
+ type StyleObject = {
276
+ id: number;
277
+ parts: Array<StyleObjectPart>
278
+ }
279
+
280
+ type StyleObjectPart = {
281
+ css: string;
282
+ media: string;
283
+ sourceMap: ?string
284
+ }
285
+ */
286
+
287
+ var stylesInDom = {/*
288
+ [id: number]: {
289
+ id: number,
290
+ refs: number,
291
+ parts: Array<(obj?: StyleObjectPart) => void>
292
+ }
293
+ */}
294
+
295
+ var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
296
+ var singletonElement = null
297
+ var singletonCounter = 0
298
+ var isProduction = false
299
+ var noop = function () {}
300
+ var options = null
301
+ var ssrIdKey = 'data-vue-ssr-id'
302
+
303
+ // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
304
+ // tags it will allow on a page
305
+ var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
306
+
307
+ function addStylesClient (parentId, list, _isProduction, _options) {
308
+ isProduction = _isProduction
309
+
310
+ options = _options || {}
311
+
312
+ var styles = listToStyles(parentId, list)
313
+ addStylesToDom(styles)
314
+
315
+ return function update (newList) {
316
+ var mayRemove = []
317
+ for (var i = 0; i < styles.length; i++) {
318
+ var item = styles[i]
319
+ var domStyle = stylesInDom[item.id]
320
+ domStyle.refs--
321
+ mayRemove.push(domStyle)
322
+ }
323
+ if (newList) {
324
+ styles = listToStyles(parentId, newList)
325
+ addStylesToDom(styles)
326
+ } else {
327
+ styles = []
328
+ }
329
+ for (var i = 0; i < mayRemove.length; i++) {
330
+ var domStyle = mayRemove[i]
331
+ if (domStyle.refs === 0) {
332
+ for (var j = 0; j < domStyle.parts.length; j++) {
333
+ domStyle.parts[j]()
334
+ }
335
+ delete stylesInDom[domStyle.id]
336
+ }
337
+ }
338
+ }
339
+ }
340
+
341
+ function addStylesToDom (styles /* Array<StyleObject> */) {
342
+ for (var i = 0; i < styles.length; i++) {
343
+ var item = styles[i]
344
+ var domStyle = stylesInDom[item.id]
345
+ if (domStyle) {
346
+ domStyle.refs++
347
+ for (var j = 0; j < domStyle.parts.length; j++) {
348
+ domStyle.parts[j](item.parts[j])
349
+ }
350
+ for (; j < item.parts.length; j++) {
351
+ domStyle.parts.push(addStyle(item.parts[j]))
352
+ }
353
+ if (domStyle.parts.length > item.parts.length) {
354
+ domStyle.parts.length = item.parts.length
355
+ }
356
+ } else {
357
+ var parts = []
358
+ for (var j = 0; j < item.parts.length; j++) {
359
+ parts.push(addStyle(item.parts[j]))
360
+ }
361
+ stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
362
+ }
363
+ }
364
+ }
365
+
366
+ function createStyleElement () {
367
+ var styleElement = document.createElement('style')
368
+ styleElement.type = 'text/css'
369
+ head.appendChild(styleElement)
370
+ return styleElement
371
+ }
372
+
373
+ function addStyle (obj /* StyleObjectPart */) {
374
+ var update, remove
375
+ var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]')
376
+
377
+ if (styleElement) {
378
+ if (isProduction) {
379
+ // has SSR styles and in production mode.
380
+ // simply do nothing.
381
+ return noop
382
+ } else {
383
+ // has SSR styles but in dev mode.
384
+ // for some reason Chrome can't handle source map in server-rendered
385
+ // style tags - source maps in <style> only works if the style tag is
386
+ // created and inserted dynamically. So we remove the server rendered
387
+ // styles and inject new ones.
388
+ styleElement.parentNode.removeChild(styleElement)
389
+ }
390
+ }
391
+
392
+ if (isOldIE) {
393
+ // use singleton mode for IE9.
394
+ var styleIndex = singletonCounter++
395
+ styleElement = singletonElement || (singletonElement = createStyleElement())
396
+ update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
397
+ remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
398
+ } else {
399
+ // use multi-style-tag mode in all other cases
400
+ styleElement = createStyleElement()
401
+ update = applyToTag.bind(null, styleElement)
402
+ remove = function () {
403
+ styleElement.parentNode.removeChild(styleElement)
404
+ }
405
+ }
406
+
407
+ update(obj)
408
+
409
+ return function updateStyle (newObj /* StyleObjectPart */) {
410
+ if (newObj) {
411
+ if (newObj.css === obj.css &&
412
+ newObj.media === obj.media &&
413
+ newObj.sourceMap === obj.sourceMap) {
414
+ return
415
+ }
416
+ update(obj = newObj)
417
+ } else {
418
+ remove()
419
+ }
420
+ }
421
+ }
422
+
423
+ var replaceText = (function () {
424
+ var textStore = []
425
+
426
+ return function (index, replacement) {
427
+ textStore[index] = replacement
428
+ return textStore.filter(Boolean).join('\n')
429
+ }
430
+ })()
431
+
432
+ function applyToSingletonTag (styleElement, index, remove, obj) {
433
+ var css = remove ? '' : obj.css
434
+
435
+ if (styleElement.styleSheet) {
436
+ styleElement.styleSheet.cssText = replaceText(index, css)
437
+ } else {
438
+ var cssNode = document.createTextNode(css)
439
+ var childNodes = styleElement.childNodes
440
+ if (childNodes[index]) styleElement.removeChild(childNodes[index])
441
+ if (childNodes.length) {
442
+ styleElement.insertBefore(cssNode, childNodes[index])
443
+ } else {
444
+ styleElement.appendChild(cssNode)
445
+ }
446
+ }
447
+ }
448
+
449
+ function applyToTag (styleElement, obj) {
450
+ var css = obj.css
451
+ var media = obj.media
452
+ var sourceMap = obj.sourceMap
453
+
454
+ if (media) {
455
+ styleElement.setAttribute('media', media)
456
+ }
457
+ if (options.ssrId) {
458
+ styleElement.setAttribute(ssrIdKey, obj.id)
459
+ }
460
+
461
+ if (sourceMap) {
462
+ // https://developer.chrome.com/devtools/docs/javascript-debugging
463
+ // this makes source maps inside style tags work properly in Chrome
464
+ css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
465
+ // http://stackoverflow.com/a/26603875
466
+ css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
467
+ }
468
+
469
+ if (styleElement.styleSheet) {
470
+ styleElement.styleSheet.cssText = css
471
+ } else {
472
+ while (styleElement.firstChild) {
473
+ styleElement.removeChild(styleElement.firstChild)
474
+ }
475
+ styleElement.appendChild(document.createTextNode(css))
476
+ }
477
+ }
478
+
479
+
480
+ /***/ }),
481
+
482
+ /***/ "5a0c":
483
+ /***/ (function(module, exports, __webpack_require__) {
484
+
485
+ !function(t,e){ true?module.exports=e():undefined}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
486
+
487
+ /***/ }),
488
+
489
+ /***/ "7636":
490
+ /***/ (function(module, exports, __webpack_require__) {
491
+
492
+ // Imports
493
+ var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
494
+ exports = ___CSS_LOADER_API_IMPORT___(false);
495
+ // Module
496
+ exports.push([module.i, ".schedule-card[data-v-72a2d2e2]{padding:14px 20px;border:1px solid #dcdee2;border-color:#e8eaec;display:block;background:#fff;border-radius:4px;font-size:14px;position:relative;transition:all .2s ease-in-out}.schedule-card .table-outer-container[data-v-72a2d2e2]{border:1px solid #ddd;border-radius:4px;overflow:hidden;background:#fff;position:relative}.schedule-card .table-outer-container .fixed-left-bar[data-v-72a2d2e2]{position:absolute;top:2px;bottom:15px;left:0;width:190px;background:#fff;z-index:100;-webkit-user-select:none;user-select:none;-moz-user-select:none}.schedule-card .blank-tip[data-v-72a2d2e2]{display:flex;align-items:center;justify-content:center;min-height:455px;border-right:1px solid #dcdee2;text-align:center;color:#999;font-size:12px}.schedule-card .table-scroll-container[data-v-72a2d2e2]{display:flex;flex-direction:column;overflow-x:auto;overflow-y:visible}.schedule-card .table-scroll-container[data-v-72a2d2e2]::-webkit-scrollbar{width:6px;height:6px}.schedule-card .table-scroll-container[data-v-72a2d2e2]::-webkit-scrollbar-thumb{background:#cccdce}.schedule-card .table-scroll-container[data-v-72a2d2e2]::-webkit-scrollbar-track{background:#fff}.schedule-card .table-header-row[data-v-72a2d2e2]{display:flex;background-color:#eef3ff;border-bottom:2px solid #ebebeb;position:sticky;top:0;z-index:10;-webkit-user-select:none;user-select:none;-moz-user-select:none}.schedule-card .header-cell[data-v-72a2d2e2]{width:190px;flex-shrink:0;padding:12px 8px;border-right:1px solid #ebebeb;font-weight:700;text-align:center;white-space:nowrap}.schedule-card .fixed-person-header[data-v-72a2d2e2]{width:190px;background-color:#d3e0ff;z-index:11;position:sticky;left:0}.schedule-card .scroll-date-header[data-v-72a2d2e2]{width:190px;line-height:43px;flex-shrink:0;background-color:#d3e0ff;border-right:1px solid #ebebeb}.schedule-card .scroll-date-header[data-v-72a2d2e2]::-moz-selection{background:#d3e0ff;color:#515a6e}.schedule-card .scroll-date-header[data-v-72a2d2e2]::selection{background:#d3e0ff;color:#515a6e}.schedule-card .scroll-date-header[data-v-72a2d2e2]:last-child{border-right:none}.schedule-card .table-body-rows[data-v-72a2d2e2]{display:flex;flex-direction:column}.schedule-card .table-person-row[data-v-72a2d2e2]{display:flex;overflow:visible}.schedule-card .body-cell[data-v-72a2d2e2]{width:190px;flex-shrink:0;padding:10px 8px;border-right:1px solid #ebebeb;border-bottom:1px solid #ebebeb;white-space:nowrap;vertical-align:top;position:relative}.schedule-card .fixed-person-cell[data-v-72a2d2e2]{width:190px;flex-shrink:0;background-color:#eef3ff;font-weight:500;line-height:1.3;z-index:5;position:sticky;left:0}.schedule-card .fixed-person-cell[data-v-72a2d2e2]:hover{background-color:#d3e0ff}.schedule-card .scroll-date-cell[data-v-72a2d2e2]{width:190px;flex-shrink:0;padding:2px 0;position:relative;vertical-align:top}.schedule-card .task-item[data-v-72a2d2e2]{height:auto;line-height:18px;font-size:12px}.schedule-card .stacked-task[data-v-72a2d2e2]{padding:2px 6px;border-radius:5px;color:#fff;width:100%;box-sizing:border-box;text-align:left;position:absolute;left:0;white-space:pre-line;word-break:break-all;cursor:pointer}.schedule-card .stacked-task[data-v-72a2d2e2]:hover{opacity:.9}.schedule-card .no-task[data-v-72a2d2e2]{color:#999;font-style:italic;font-size:12px;text-align:center;padding:15px 5px;color:#ccc;font-size:10px}.schedule-card .cross-day-track[data-v-72a2d2e2]{position:relative;z-index:20;height:0;pointer-events:none}.schedule-card .cross-day-bar[data-v-72a2d2e2]{position:absolute;height:auto;line-height:18px;font-size:12px;padding:2px 6px;border-radius:5px;color:#fff;word-break:break-all;white-space:pre-line;pointer-events:auto;cursor:pointer}.schedule-card .cross-day-bar[data-v-72a2d2e2]:hover{opacity:.9}.schedule-card .page-col[data-v-72a2d2e2]{margin:10px 0;text-align:center}.schedule-card .scroll-box-list[data-v-72a2d2e2]{overflow-x:visible;overflow-y:auto;max-height:674px}@media (max-width:768px){.scroll-date-cell[data-v-72a2d2e2],.scroll-date-header[data-v-72a2d2e2]{width:190px}.fixed-person-cell[data-v-72a2d2e2],.fixed-person-header[data-v-72a2d2e2]{width:190px;font-size:12px}}", ""]);
497
+ // Exports
498
+ module.exports = exports;
499
+
500
+
501
+ /***/ }),
502
+
503
+ /***/ "b375":
504
+ /***/ (function(module, exports, __webpack_require__) {
505
+
506
+ !function(e,i){ true?module.exports=i():undefined}(this,(function(){"use strict";return function(e,i){i.prototype.isSameOrBefore=function(e,i){return this.isSame(e,i)||this.isBefore(e,i)}}}));
507
+
508
+ /***/ }),
509
+
510
+ /***/ "b9f5":
511
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
512
+
513
+ "use strict";
514
+ /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_11_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_sdy_gantt_chart_vue_vue_type_style_index_0_id_72a2d2e2_prod_lang_less_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2c63");
515
+ /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_11_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_sdy_gantt_chart_vue_vue_type_style_index_0_id_72a2d2e2_prod_lang_less_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_11_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_3_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_sdy_gantt_chart_vue_vue_type_style_index_0_id_72a2d2e2_prod_lang_less_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
516
+ /* unused harmony reexport * */
517
+
518
+
519
+ /***/ }),
520
+
521
+ /***/ "fb15":
522
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
523
+
524
+ "use strict";
525
+ // ESM COMPAT FLAG
526
+ __webpack_require__.r(__webpack_exports__);
527
+
528
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
529
+ // This file is imported into lib/wc client bundles.
530
+
531
+ if (typeof window !== 'undefined') {
532
+ var currentScript = window.document.currentScript
533
+ if (false) { var getCurrentScript; }
534
+
535
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
536
+ if (src) {
537
+ __webpack_require__.p = src[1] // eslint-disable-line
538
+ }
539
+ }
540
+
541
+ // Indicate to webpack that this file can be concatenated
542
+ /* harmony default export */ var setPublicPath = (null);
543
+
544
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"55ff81cd-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/sdy-gantt-chart.vue?vue&type=template&id=72a2d2e2&scoped=true
545
+ var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('div',{staticClass:"schedule-card"},[_c('div',{staticClass:"table-outer-container"},[_c('div',{staticClass:"fixed-left-bar",style:(_vm.personList.length == 0 ? 'min-height:500px' : '')},[_c('div',{staticClass:"header-cell fixed-person-header"},[_vm._v("人员\\日期")]),_vm._l((_vm.personList),function(person){return _c('div',{key:'row-person-' + person.id,staticClass:"table-person-row",style:(`height:${person.allHeight || 40}px`)},[_c('div',{staticClass:"flex_center body-cell fixed-person-cell"},[_vm._v(" "+_vm._s(person.name)+" ")])])}),(_vm.personList.length == 0)?_c('div',{staticClass:"blank-tip"},[_vm._v("暂无人员")]):_vm._e()],2),_c('div',{directives:[{name:"drag-scroll",rawName:"v-drag-scroll"}],staticClass:"table-scroll-container",style:(_vm.personList.length == 0 ? 'min-height:500px' : '')},[_c('div',{staticClass:"table-header-row"},[_c('div',{staticClass:"header-cell fixed-person-header"},[_vm._v("人员\\日期")]),_vm._l((_vm.dateList),function(date){return _c('div',{key:'date-' + date.key,staticClass:"flex_center scroll-date-header"},[_vm._v(" "+_vm._s(date.display)+" ")])})],2),_c('div',{staticClass:"cross-day-track"},_vm._l((_vm.allCrossDayTasks),function(task){return _c('div',{key:'track-' + task.id,staticClass:"cross-day-bar",style:({
546
+ left: task.trackLeft + 'px',
547
+ width: task.trackWidth + 'px',
548
+ top: task.trackTop + 'px',
549
+ backgroundColor: task.color,
550
+ }),attrs:{"title":task.tooltip},on:{"click":function($event){return _vm.handleDetail(task)}}},[_c('span',[_vm._v(_vm._s(task.shortLabel))])])}),0),_c('div',{staticClass:"table-body-rows"},_vm._l((_vm.personList),function(person){return _c('div',{key:'row-person-' + person.id,staticClass:"table-person-row",style:(`height:${person.allHeight || 40}px`)},[_c('div',{staticClass:"flex_center body-cell fixed-person-cell"},[_vm._v(" "+_vm._s(person.name)+" ")]),_vm._l((_vm.dateList),function(date){return _c('div',{key:'cell-' + person.id + '-' + date.key,staticClass:"body-cell scroll-date-cell"},_vm._l((_vm.getSameDayTasks(person.id, date.key)),function(task,taskIndex){return _c('div',{key:'stacked-' + task.id + '-' + taskIndex,staticClass:"task-item stacked-task",style:({
551
+ backgroundColor: task.color,
552
+ top: task.cellTop + 'px',
553
+ }),attrs:{"title":task.tooltip},on:{"click":function($event){return _vm.handleDetail(task)}}},[_c('span',[_vm._v(_vm._s(task.shortLabel))])])}),0)})],2)}),0)])])])])
554
+ }
555
+ var staticRenderFns = []
556
+
557
+
558
+ // CONCATENATED MODULE: ./src/components/sdy-gantt-chart.vue?vue&type=template&id=72a2d2e2&scoped=true
559
+
560
+ // EXTERNAL MODULE: ./node_modules/dayjs/dayjs.min.js
561
+ var dayjs_min = __webpack_require__("5a0c");
562
+ var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
563
+
564
+ // CONCATENATED MODULE: ./src/libs/tools.js
565
+
566
+
567
+ // 格式化时间尽量用插值表达式,避免import引入的麻烦
568
+
569
+ /**
570
+ * @功能描述: 格式化时间
571
+ * @参数: date:时间戳number pattern:格式
572
+ * @返回值:
573
+ */
574
+ const dateFormat = (date, pattern = 'YYYY-MM-DD HH:mm:ss') => {
575
+ if (!date || String(date) === '0') return ''
576
+
577
+ let len = String(date).length
578
+ if (len < 12) {
579
+ // 秒级时间戳转为毫秒级时间戳
580
+ date = date * 1000
581
+ }
582
+
583
+ return dayjs_min_default()(date).format(pattern)
584
+ }
585
+
586
+ const sumArray = (arr) => {
587
+ return arr.reduce((total, val) => total + val, 0)
588
+ }
589
+
590
+ function ts2day(ts) {
591
+ return dayjs_min_default.a.unix(ts).format('YYYY-MM-DD')
592
+ }
593
+ // 计算一个用户的任务先后排序 占位
594
+ const assignRow = (list) => {
595
+ // 1. 按开始时间升序,保证先画靠前的任务
596
+ list.sort(function (a, b) {
597
+ return a.start - b.start
598
+ })
599
+
600
+ // 2. 日期字符串 -> 当前已占行号集合
601
+ var occupied = {}
602
+
603
+ // 3. 遍历每个任务
604
+ for (var i = 0; i < list.length; i++) {
605
+ var t = list[i]
606
+ var startDay = ts2day(t.start)
607
+ var endDay = ts2day(t.end)
608
+
609
+ // 3.1 收集这段日期范围内所有已占行号
610
+ var used = new Set()
611
+ var cur = dayjs_min_default()(startDay)
612
+ var end = dayjs_min_default()(endDay)
613
+ while (cur.isSameOrBefore(end, 'day')) {
614
+ var dayKey = cur.format('YYYY-MM-DD')
615
+ if (occupied[dayKey]) {
616
+ occupied[dayKey].forEach(function (n) {
617
+ used.add(n)
618
+ })
619
+ }
620
+ cur = cur.add(1, 'day')
621
+ }
622
+
623
+ // 3.2 找到最小可用行号
624
+ var row = 0
625
+ while (used.has(row)) row++
626
+
627
+ // 3.3 写回任务对象
628
+ t.row = row
629
+ // 3.4 真正占用:把行号写回每一天
630
+ cur = dayjs_min_default()(startDay)
631
+ while (cur.isSameOrBefore(end, 'day')) {
632
+ var dayKey = cur.format('YYYY-MM-DD')
633
+ if (!occupied[dayKey]) occupied[dayKey] = []
634
+ occupied[dayKey].push(row)
635
+ cur = cur.add(1, 'day')
636
+ }
637
+ }
638
+
639
+ return list
640
+ }
641
+
642
+ function formatDateKey(date) {
643
+ return date.toISOString().split('T')[0]
644
+ }
645
+ function formatDateDisplay(date) {
646
+ const year = date.getFullYear()
647
+ const month = (date.getMonth() + 1).toString().padStart(2, '0')
648
+ const day = date.getDate().toString().padStart(2, '0')
649
+ const weekdays = ['日', '一', '二', '三', '四', '五', '六']
650
+ const weekday = weekdays[date.getDay()]
651
+ return `${year}/${month}/${day}(周${weekday})`
652
+ }
653
+ // 生成日期范围 "2024-01-01", 14
654
+ const generateDateRange = (startDate, days) => {
655
+ const dates = []
656
+ const start = new Date(startDate)
657
+
658
+ for (let i = 0; i < days; i++) {
659
+ const date = new Date(start)
660
+ date.setDate(start.getDate() + i)
661
+ const dateKey = formatDateKey(date)
662
+ dates.push({
663
+ key: dateKey,
664
+ date: date,
665
+ display: formatDateDisplay(date),
666
+ })
667
+ }
668
+ return dates
669
+ }
670
+
671
+ // EXTERNAL MODULE: ./node_modules/dayjs/plugin/isSameOrBefore.js
672
+ var isSameOrBefore = __webpack_require__("b375");
673
+ var isSameOrBefore_default = /*#__PURE__*/__webpack_require__.n(isSameOrBefore);
674
+
675
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/sdy-gantt-chart.vue?vue&type=script&lang=js
676
+
677
+
678
+
679
+
680
+ dayjs_min_default.a.extend(isSameOrBefore_default.a)
681
+
682
+ const FontSetting = '12px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif'
683
+
684
+ /* harmony default export */ var sdy_gantt_chartvue_type_script_lang_js = ({
685
+ name: 'TopicSchedule',
686
+ props: {
687
+ // 日期范围 [startDate, endDate] 格式如 '2026-01-12'
688
+ dateRange: {
689
+ type: Array,
690
+ required: true,
691
+ },
692
+ // 日程数据
693
+ scheduleData: {
694
+ type: Array,
695
+ required: true,
696
+ },
697
+ },
698
+ data() {
699
+ return {
700
+ tableLoading: false,
701
+ personList: [],
702
+ dateList: [],
703
+ allTasks: [],
704
+ userRowObj: {}, // {userId: [{id,row,height}, ...]}
705
+ colorPalette: [
706
+ '#4285f4',
707
+ '#34a853',
708
+ '#ea4335',
709
+ '#fbbc05',
710
+ '#9c27b0',
711
+ '#ff5722',
712
+ '#009688',
713
+ '#795548',
714
+ '#607d8b',
715
+ '#e91e63',
716
+ ],
717
+ }
718
+ },
719
+ watch: {
720
+ dateRange: {
721
+ handler() {
722
+ this.initSchedule()
723
+ },
724
+ deep: true,
725
+ },
726
+ scheduleData: {
727
+ handler() {
728
+ this.initSchedule()
729
+ },
730
+ deep: true,
731
+ },
732
+ },
733
+ computed: {
734
+ allCrossDayTasks() {
735
+ const gap = 3
736
+ let list = []
737
+
738
+ this.personList.forEach((p, pIdx) => {
739
+ let tasks = this.allTasks.filter(
740
+ ({ personId, isCrossDay }) => personId == p.id && isCrossDay
741
+ )
742
+ tasks.forEach((t) => {
743
+ let maxObj = {}
744
+ let arr = this.userRowObj[p.id] || []
745
+ arr.forEach((ele) => {
746
+ if (ele.row < t.row) {
747
+ if (!maxObj[ele.row] || ele.height > maxObj[ele.row]) {
748
+ maxObj[ele.row] = ele.height
749
+ }
750
+ }
751
+ })
752
+ const top =
753
+ this.personList.slice(0, pIdx).reduce((sum, u) => sum + u.allHeight, 0) +
754
+ Object.values(maxObj).reduce((total, val) => total + val + gap, 0) +
755
+ 2
756
+
757
+ list.push({ ...t, trackTop: top })
758
+ })
759
+ })
760
+
761
+ return list
762
+ },
763
+ },
764
+ mounted() {
765
+ this.initSchedule()
766
+ },
767
+ methods: {
768
+ initSchedule() {
769
+ if (!this.dateRange || !this.scheduleData) return
770
+
771
+ let schedule = JSON.parse(JSON.stringify(this.scheduleData))
772
+ const [start, end] = this.dateRange
773
+ const dayCount = dayjs_min_default()(end).diff(dayjs_min_default()(start), 'day') + 1
774
+
775
+ this.dateList = generateDateRange(start, dayCount)
776
+ this.personList = schedule.map((user) => ({
777
+ id: user.id,
778
+ name: user.nickname,
779
+ }))
780
+
781
+ this.calcScheduleDate(schedule, dayCount)
782
+ },
783
+
784
+ // 计算文本占高 (最小损耗 无 DOM、无回流)
785
+ getTextBlockHeight(text, width = 190) {
786
+ const padV = 4
787
+ const osCanvas = new OffscreenCanvas(width, 1)
788
+ const ctx = osCanvas.getContext('2d')
789
+ ctx.font = FontSetting
790
+
791
+ const lines = []
792
+ let line = ''
793
+
794
+ for (let i = 0; i < text.length; i++) {
795
+ const ch = text[i]
796
+
797
+ // 遇到显式换行符直接断行
798
+ if (ch === '\n') {
799
+ lines.push(line)
800
+ line = ''
801
+ continue
802
+ }
803
+
804
+ // 宽度超限也断行
805
+ const test = line + ch
806
+ if (ctx.measureText(test).width <= width) {
807
+ line = test
808
+ } else {
809
+ lines.push(line)
810
+ line = ch
811
+ }
812
+ }
813
+ if (line) lines.push(line) // 收尾
814
+
815
+ const lineHeight = 12 * 1.5
816
+ return lines.length * lineHeight + padV
817
+ },
818
+
819
+ calcScheduleDate(list, dayCount) {
820
+ const CellWidth = 190,
821
+ padH = 14 // 横向padding+border
822
+
823
+ let allArr = []
824
+ this.userRowObj = {}
825
+ list.forEach((user) => {
826
+ // id: "2", nickname: "王璐-测试1", tasks:[{id: '102', title: '我的选题1111111', start: 1761148800, end: 1761321600}]
827
+ let tasks = assignRow(user.tasks)
828
+ // if (tasks && tasks.length > 0) {
829
+ // console.log("排序tasks", tasks);
830
+ // }
831
+
832
+ if (!this.userRowObj[user.id]) {
833
+ this.userRowObj[user.id] = []
834
+ }
835
+
836
+ let oneDay = 86400
837
+ tasks.forEach((it) => {
838
+ let startStr = dateFormat(it.start, 'YYYY-MM-DD')
839
+ let endStr = dateFormat(it.end, 'YYYY-MM-DD')
840
+ // 目前是整0点的日期 为了计算天数 都+2
841
+ let isCrossDay = it.end - it.start + 2 > oneDay
842
+ let showLabel = it.content ? it.content : '暂无内容'
843
+
844
+ let dayStart = this.dateList.findIndex((d) => d.key === startStr)
845
+ let dayEnd = this.dateList.findIndex((d) => d.key === endStr)
846
+ // 如果选题开始时间早于日程表的起始时间 开始的pos改为日程表的开始
847
+ if (dayStart < 0) {
848
+ dayStart = 0
849
+ }
850
+ // 如果选题结束时间晚于日程表的结束时间 结束的pos改为日程表的结束
851
+ if (dayEnd < 0) {
852
+ dayEnd = dayCount - 1
853
+ }
854
+ // 有可能出现本来跨天任务 但落在当前日程的就一天
855
+ let crossOneDay = isCrossDay && dayEnd - dayStart === 0
856
+
857
+ let blockWidth = 0,
858
+ crossLeft = 0
859
+ if (isCrossDay && dayEnd - dayStart > 0) {
860
+ crossLeft = dayStart * CellWidth + CellWidth // 人员列宽
861
+ blockWidth = (dayEnd - dayStart + 1) * CellWidth // 日期跨度宽度
862
+ } else {
863
+ blockWidth = CellWidth
864
+ }
865
+
866
+ let textWidth = isCrossDay && !crossOneDay ? blockWidth - padH - 4 : blockWidth - padH
867
+ let realHeight = this.getTextBlockHeight(showLabel, textWidth)
868
+
869
+ this.userRowObj[user.id].push({
870
+ id: it.id,
871
+ row: it.row,
872
+ height: realHeight,
873
+ })
874
+ let obj = {
875
+ // 后续编辑需要 id, row, isDistribute, isCoop, status, createUserId, content
876
+ ...it,
877
+ personId: user.id,
878
+ personName: user.nickname,
879
+ startDate: startStr,
880
+ endDate: endStr,
881
+ isCrossDay,
882
+ crossOneDay,
883
+ shortLabel: showLabel,
884
+ color: '#2d8cf0',
885
+ tooltip: `标题: ${it.title}\n时间: ${startStr} ~ ${endStr}`,
886
+ // 日程占高度
887
+ realHeight,
888
+ // 跨天日程字段
889
+ trackLeft: crossLeft,
890
+ trackWidth: blockWidth,
891
+ }
892
+ allArr.push(obj)
893
+ })
894
+ })
895
+
896
+ this.allTasks = allArr
897
+ this.setPersonStyle()
898
+ },
899
+
900
+ // 获取同一天内的多个任务(用于垂直堆叠)
901
+ getSameDayTasks(personId, dateKey) {
902
+ const gap = 3
903
+ let list = []
904
+ let rowArr = this.userRowObj[personId] || []
905
+ // 不跨天日程 宽度186px 计算高度
906
+ // task.crossOneDay 起始时间落在日程表只有一天的时候 跨天任务也渲染成单日任务
907
+ let tasks = this.allTasks.filter(
908
+ (task) =>
909
+ task.personId === personId && // 只显示单日任务
910
+ ((!task.isCrossDay && task.startDate === dateKey && task.endDate === dateKey) ||
911
+ (task.crossOneDay && task.startDate === dateKey) ||
912
+ (task.crossOneDay && task.endDate === dateKey))
913
+ )
914
+
915
+ tasks.forEach((t) => {
916
+ // 前面人员的行高累加
917
+ let maxObj = {} // {0:23, 1:45, 2:130}
918
+ rowArr.forEach((ele) => {
919
+ if (ele.row < t.row) {
920
+ // 当前用户 前面的日程高度总和
921
+ if (!maxObj[ele.row] || ele.height > maxObj[ele.row]) {
922
+ maxObj[ele.row] = ele.height
923
+ }
924
+ }
925
+ })
926
+ const top = Object.values(maxObj).reduce((total, val) => total + val + gap, 0) + 2
927
+
928
+ list.push({ ...t, cellTop: top })
929
+ })
930
+
931
+ return list
932
+ },
933
+ // 根据userRowObj的row,height 计算top值 人员单元格总高度
934
+ // {userId: [{id,row,height}, ...]}
935
+ setPersonStyle() {
936
+ const gap = 3
937
+
938
+ // 人员的行高
939
+ this.personList = this.personList.map((user) => {
940
+ // 当前用户 每行的最大高度
941
+ let maxObj = {} // {0:23, 1:45, 2:130}
942
+ let arr = this.userRowObj[user.id] || []
943
+ arr.forEach((ele) => {
944
+ if (!maxObj[ele.row] || ele.height > maxObj[ele.row]) {
945
+ maxObj[ele.row] = ele.height
946
+ }
947
+ })
948
+ let count = Object.keys(maxObj).length || 1
949
+ let allHeight = sumArray(Object.values(maxObj)) + (count + 1) * gap
950
+ if (allHeight < 40) {
951
+ allHeight = 40
952
+ }
953
+
954
+ return { ...user, allHeight, count }
955
+ })
956
+ },
957
+
958
+ handleDetail(obj) {
959
+ this.$emit('on-check', obj)
960
+ },
961
+ handleEdit(obj) {
962
+ this.$emit('on-edit', obj)
963
+ },
964
+ },
965
+ });
966
+
967
+ // CONCATENATED MODULE: ./src/components/sdy-gantt-chart.vue?vue&type=script&lang=js
968
+ /* harmony default export */ var components_sdy_gantt_chartvue_type_script_lang_js = (sdy_gantt_chartvue_type_script_lang_js);
969
+ // EXTERNAL MODULE: ./src/components/sdy-gantt-chart.vue?vue&type=style&index=0&id=72a2d2e2&prod&lang=less&scoped=true
970
+ var sdy_gantt_chartvue_type_style_index_0_id_72a2d2e2_prod_lang_less_scoped_true = __webpack_require__("b9f5");
971
+
972
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
973
+ /* globals __VUE_SSR_CONTEXT__ */
974
+
975
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
976
+ // This module is a runtime utility for cleaner component module output and will
977
+ // be included in the final webpack user bundle.
978
+
979
+ function normalizeComponent(
980
+ scriptExports,
981
+ render,
982
+ staticRenderFns,
983
+ functionalTemplate,
984
+ injectStyles,
985
+ scopeId,
986
+ moduleIdentifier /* server only */,
987
+ shadowMode /* vue-cli only */
988
+ ) {
989
+ // Vue.extend constructor export interop
990
+ var options =
991
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
992
+
993
+ // render functions
994
+ if (render) {
995
+ options.render = render
996
+ options.staticRenderFns = staticRenderFns
997
+ options._compiled = true
998
+ }
999
+
1000
+ // functional template
1001
+ if (functionalTemplate) {
1002
+ options.functional = true
1003
+ }
1004
+
1005
+ // scopedId
1006
+ if (scopeId) {
1007
+ options._scopeId = 'data-v-' + scopeId
1008
+ }
1009
+
1010
+ var hook
1011
+ if (moduleIdentifier) {
1012
+ // server build
1013
+ hook = function (context) {
1014
+ // 2.3 injection
1015
+ context =
1016
+ context || // cached call
1017
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
1018
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
1019
+ // 2.2 with runInNewContext: true
1020
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
1021
+ context = __VUE_SSR_CONTEXT__
1022
+ }
1023
+ // inject component styles
1024
+ if (injectStyles) {
1025
+ injectStyles.call(this, context)
1026
+ }
1027
+ // register component module identifier for async chunk inferrence
1028
+ if (context && context._registeredComponents) {
1029
+ context._registeredComponents.add(moduleIdentifier)
1030
+ }
1031
+ }
1032
+ // used by ssr in case component is cached and beforeCreate
1033
+ // never gets called
1034
+ options._ssrRegister = hook
1035
+ } else if (injectStyles) {
1036
+ hook = shadowMode
1037
+ ? function () {
1038
+ injectStyles.call(
1039
+ this,
1040
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
1041
+ )
1042
+ }
1043
+ : injectStyles
1044
+ }
1045
+
1046
+ if (hook) {
1047
+ if (options.functional) {
1048
+ // for template-only hot-reload because in that case the render fn doesn't
1049
+ // go through the normalizer
1050
+ options._injectStyles = hook
1051
+ // register for functional component in vue file
1052
+ var originalRender = options.render
1053
+ options.render = function renderWithStyleInjection(h, context) {
1054
+ hook.call(context)
1055
+ return originalRender(h, context)
1056
+ }
1057
+ } else {
1058
+ // inject component registration as beforeCreate hook
1059
+ var existing = options.beforeCreate
1060
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
1061
+ }
1062
+ }
1063
+
1064
+ return {
1065
+ exports: scriptExports,
1066
+ options: options
1067
+ }
1068
+ }
1069
+
1070
+ // CONCATENATED MODULE: ./src/components/sdy-gantt-chart.vue
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+ /* normalize component */
1078
+
1079
+ var component = normalizeComponent(
1080
+ components_sdy_gantt_chartvue_type_script_lang_js,
1081
+ render,
1082
+ staticRenderFns,
1083
+ false,
1084
+ null,
1085
+ "72a2d2e2",
1086
+ null
1087
+
1088
+ )
1089
+
1090
+ /* harmony default export */ var sdy_gantt_chart = (component.exports);
1091
+ // CONCATENATED MODULE: ./src/components/index.js
1092
+
1093
+
1094
+ const install = function (Vue) {
1095
+ Vue.component(sdy_gantt_chart.name, sdy_gantt_chart)
1096
+ }
1097
+
1098
+ /* harmony default export */ var components = ({
1099
+ install,
1100
+ SdyGantt: sdy_gantt_chart,
1101
+ });
1102
+
1103
+ if (typeof window !== 'undefined' && window.Vue) {
1104
+ window.Vue.use(install)
1105
+ }
1106
+
1107
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
1108
+
1109
+
1110
+ /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components);
1111
+
1112
+
1113
+
1114
+ /***/ })
1115
+
1116
+ /******/ })["default"];
1117
+ });