gunter-kgd 1.0.11 → 1.0.12
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.
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
:style="{
|
|
10
10
|
cursor: DragObject.mouseDown ? 'grabbing' : 'grab',
|
|
11
11
|
width:current_data.width?current_data.width+'px':0,
|
|
12
|
-
transform: `translate3d(${current_data.left?current_data.left+'px':0},
|
|
12
|
+
transform: `translate3d(${current_data.left?current_data.left+'px':0},15px,0)`,
|
|
13
13
|
transition: !DragObject.mouseDown ? 'width .5s linear, opacity .2s ease' : 'null',
|
|
14
14
|
background:current_data.bg_color?current_data.bg_color:'#FD8A25',
|
|
15
15
|
borderColor: current_data.bg_color ? `${current_data.bg_color} ${current_data.bg_color} transparent`: '#00b0ff #00b0ff transparent'}"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
buildToastContent() {
|
|
83
83
|
if (!this.current_data || !this.current_data.params) {
|
|
84
84
|
this.toastClassResolved = (this.toastClass || '').trim();
|
|
85
|
-
return '';
|
|
85
|
+
return { content: '', canShow: false };
|
|
86
86
|
}
|
|
87
87
|
let list = '';
|
|
88
88
|
for (let i in this.th_data) {
|
|
@@ -114,7 +114,8 @@
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
this.toastClassResolved = resolvedClass;
|
|
117
|
-
|
|
117
|
+
const canShow = resolvedContent !== '';
|
|
118
|
+
return { content: resolvedContent, canShow };
|
|
118
119
|
},
|
|
119
120
|
showToast(e) {
|
|
120
121
|
this.canShow = true;
|
|
@@ -124,7 +125,14 @@
|
|
|
124
125
|
if(this.current_data && this.canShow){
|
|
125
126
|
if(this.current_data.params){
|
|
126
127
|
let toast = document.createElement('div'), add_toast = true
|
|
127
|
-
const
|
|
128
|
+
const toastInfo = this.buildToastContent();
|
|
129
|
+
if(!toastInfo.canShow){
|
|
130
|
+
if (document.getElementsByClassName('gante-toast-liu')[0]) {
|
|
131
|
+
document.getElementsByClassName('gante-toast-liu')[0].style.display = 'none';
|
|
132
|
+
}
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const content = toastInfo.content;
|
|
128
136
|
const toastClass = `gante-toast-liu${this.toastClassResolved ? ' ' + this.toastClassResolved : ''}`
|
|
129
137
|
toast.setAttribute('class', toastClass)
|
|
130
138
|
if (document.getElementsByClassName('gante-toast-liu')[0]) {
|
|
@@ -300,9 +308,14 @@
|
|
|
300
308
|
if (document.getElementsByClassName('gante-toast-liu')[0]) {
|
|
301
309
|
toast = document.getElementsByClassName('gante-toast-liu')[0]
|
|
302
310
|
toast.style.display = 'block';
|
|
303
|
-
const
|
|
304
|
-
if(
|
|
305
|
-
toast.
|
|
311
|
+
const toastInfo = this.buildToastContent();
|
|
312
|
+
if(!toastInfo.canShow){
|
|
313
|
+
toast.style.display = 'none';
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const content = toastInfo.content;
|
|
317
|
+
if(toast.innerHTML != content){
|
|
318
|
+
toast.innerHTML = content;
|
|
306
319
|
}
|
|
307
320
|
}
|
|
308
321
|
}
|
|
@@ -239,30 +239,109 @@
|
|
|
239
239
|
this.todayInfo.left = (new Date(new Date().toLocaleDateString()).getTime() - first_time.getTime())/time;
|
|
240
240
|
|
|
241
241
|
var list = [];
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
if (time_mode == 1) {
|
|
243
|
+
const dayMs = 24 * 60 * 60 * 1000;
|
|
244
|
+
let cursor = new Date(first_time);
|
|
245
|
+
while (cursor.getTime() <= all_width) {
|
|
246
|
+
const monthEnd = new Date(cursor.getFullYear(), cursor.getMonth() + 1, 1);
|
|
247
|
+
const remainingDays = Math.ceil((monthEnd.getTime() - cursor.getTime()) / dayMs);
|
|
248
|
+
if (remainingDays < 7 && list.length) {
|
|
249
|
+
const prev = list[list.length - 1];
|
|
250
|
+
const extraWidth = (monthEnd.getTime() - cursor.getTime()) / time;
|
|
251
|
+
prev.width += extraWidth;
|
|
252
|
+
this.header_width += extraWidth;
|
|
253
|
+
cursor = monthEnd;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
let next = new Date(cursor.getFullYear(), cursor.getMonth(), cursor.getDate() + 7);
|
|
257
|
+
if (next.getTime() > monthEnd.getTime()) {
|
|
258
|
+
next = monthEnd;
|
|
259
|
+
}
|
|
260
|
+
const width = (next.getTime() - cursor.getTime()) / time;
|
|
261
|
+
this.header_width += width;
|
|
262
|
+
list.push({
|
|
263
|
+
left: (cursor.getTime() - this.first_day.getTime()) / time,
|
|
264
|
+
width: width,
|
|
265
|
+
date: this.format(cursor, 2)
|
|
266
|
+
});
|
|
267
|
+
cursor = next;
|
|
268
|
+
this.future_time = cursor.getTime();
|
|
269
|
+
}
|
|
270
|
+
} else if (time_mode == 2) {
|
|
271
|
+
const weekMs = 7 * 24 * 60 * 60 * 1000;
|
|
272
|
+
let cursor = new Date(first_time);
|
|
273
|
+
while (cursor.getTime() <= all_width) {
|
|
274
|
+
const yearEnd = new Date(cursor.getFullYear() + 1, 0, 1);
|
|
275
|
+
const remainingWeeks = Math.ceil((yearEnd.getTime() - cursor.getTime()) / weekMs);
|
|
276
|
+
if (remainingWeeks < 4 && list.length) {
|
|
277
|
+
const prev = list[list.length - 1];
|
|
278
|
+
const extraWidth = (yearEnd.getTime() - cursor.getTime()) / time;
|
|
279
|
+
prev.width += extraWidth;
|
|
280
|
+
this.header_width += extraWidth;
|
|
281
|
+
cursor = yearEnd;
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
let next = new Date(cursor.getFullYear(), cursor.getMonth(), cursor.getDate() + 28);
|
|
285
|
+
if (next.getTime() > yearEnd.getTime()) {
|
|
286
|
+
next = yearEnd;
|
|
287
|
+
}
|
|
288
|
+
const width = (next.getTime() - cursor.getTime()) / time;
|
|
289
|
+
this.header_width += width;
|
|
290
|
+
list.push({
|
|
291
|
+
left: (cursor.getTime() - this.first_day.getTime()) / time,
|
|
292
|
+
width: width,
|
|
293
|
+
date: this.format(cursor, 5)
|
|
294
|
+
});
|
|
295
|
+
cursor = next;
|
|
296
|
+
this.future_time = cursor.getTime();
|
|
297
|
+
}
|
|
298
|
+
} else if (time_mode == 3) {
|
|
299
|
+
let cursor = new Date(first_time);
|
|
300
|
+
while (cursor.getTime() <= all_width) {
|
|
301
|
+
const yearEnd = new Date(cursor.getFullYear() + 1, 0, 1);
|
|
302
|
+
const remainingMonths = (yearEnd.getFullYear() - cursor.getFullYear()) * 12 + (yearEnd.getMonth() - cursor.getMonth());
|
|
303
|
+
if (remainingMonths < 3 && list.length) {
|
|
304
|
+
const prev = list[list.length - 1];
|
|
305
|
+
const extraWidth = (yearEnd.getTime() - cursor.getTime()) / time;
|
|
306
|
+
prev.width += extraWidth;
|
|
307
|
+
this.header_width += extraWidth;
|
|
308
|
+
cursor = yearEnd;
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
let next = new Date(cursor.getFullYear(), cursor.getMonth() + 3, 1);
|
|
312
|
+
if (next.getTime() > yearEnd.getTime()) {
|
|
313
|
+
next = yearEnd;
|
|
314
|
+
}
|
|
315
|
+
const width = (next.getTime() - cursor.getTime()) / time;
|
|
316
|
+
this.header_width += width;
|
|
317
|
+
list.push({
|
|
318
|
+
left: (cursor.getTime() - this.first_day.getTime()) / time,
|
|
319
|
+
width: width,
|
|
320
|
+
date: this.format(cursor, 5)
|
|
321
|
+
});
|
|
322
|
+
cursor = next;
|
|
323
|
+
this.future_time = cursor.getTime();
|
|
324
|
+
}
|
|
325
|
+
} else {
|
|
326
|
+
for (let i = 0; i <= all_width;) {
|
|
327
|
+
var old_time = first_time;
|
|
328
|
+
var date = '';
|
|
245
329
|
|
|
246
|
-
if (time_mode == 1) {
|
|
247
|
-
// 月的形式,保留月份显示
|
|
248
|
-
date = this.format(old_time, 2); // 格式: YYYY-MM
|
|
249
|
-
first_time = new Date(first_time.getFullYear(), first_time.getMonth() + 1, 1);
|
|
250
|
-
} else {
|
|
251
330
|
// 年的形式,只展示年份
|
|
252
331
|
date = this.format(old_time, 5); // 格式: YYYY
|
|
253
332
|
first_time = new Date(first_time.getFullYear() + 1, 0, 1);
|
|
254
|
-
}
|
|
255
333
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
334
|
+
var width = (first_time.getTime() - old_time.getTime()) / time;
|
|
335
|
+
this.header_width += width;
|
|
336
|
+
list.push({
|
|
337
|
+
left: (old_time.getTime() - this.first_day.getTime()) / time,
|
|
338
|
+
width: width,
|
|
339
|
+
date: date
|
|
340
|
+
});
|
|
263
341
|
|
|
264
|
-
|
|
265
|
-
|
|
342
|
+
i = first_time.getTime();
|
|
343
|
+
this.future_time = i;
|
|
344
|
+
}
|
|
266
345
|
}
|
|
267
346
|
|
|
268
347
|
this.top_time_data = list;
|
|
@@ -404,6 +483,9 @@
|
|
|
404
483
|
line-height: 25px;
|
|
405
484
|
position: relative;
|
|
406
485
|
background: #fff;
|
|
486
|
+
font-size: 14px;
|
|
487
|
+
font-weight: 800;
|
|
488
|
+
color: #000000D9;
|
|
407
489
|
/*display: flex;*/
|
|
408
490
|
/*justify-content: flex-start;*/
|
|
409
491
|
}
|
|
@@ -415,7 +497,7 @@
|
|
|
415
497
|
|
|
416
498
|
.ganteview-toptime .ganteview-headercell {
|
|
417
499
|
padding-left: 4px;
|
|
418
|
-
text-align:
|
|
500
|
+
text-align: center;
|
|
419
501
|
}
|
|
420
502
|
|
|
421
503
|
.ganteview-bottomtime .ganteview-headercell {
|
|
@@ -437,12 +519,11 @@
|
|
|
437
519
|
height: calc(100% - 54px);
|
|
438
520
|
z-index: 0;
|
|
439
521
|
box-sizing: border-box;
|
|
440
|
-
background: #
|
|
522
|
+
background: #5396e2;
|
|
441
523
|
}
|
|
442
524
|
|
|
443
525
|
.ganteview-headercell {
|
|
444
526
|
box-sizing: border-box;
|
|
445
|
-
color: #666;
|
|
446
527
|
border-right: 1px solid #ebeef5;
|
|
447
528
|
border-bottom: 1px solid #ebeef5;
|
|
448
529
|
overflow: hidden;
|
|
@@ -332,8 +332,11 @@
|
|
|
332
332
|
-ms-user-select: none;
|
|
333
333
|
user-select: none;
|
|
334
334
|
text-align: left;
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
background: #fff;
|
|
336
|
+
box-sizing: border-box;
|
|
337
|
+
font-size: 14px;
|
|
338
|
+
font-weight: 800;
|
|
339
|
+
color: #000000D9;
|
|
337
340
|
}
|
|
338
341
|
/*.gante-tr{*/
|
|
339
342
|
/*display: table-row;*/
|
package/gante.vue
CHANGED