@netang/quasar 0.2.25 → 0.2.27
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.
|
@@ -135,14 +135,17 @@ export default {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
// 版本
|
|
138
|
-
const version = '0.
|
|
138
|
+
const version = '0.43.0'
|
|
139
|
+
|
|
140
|
+
// 协议
|
|
141
|
+
const protocol = `${location.protocol}//`
|
|
139
142
|
|
|
140
143
|
// 加载 script
|
|
141
144
|
script([
|
|
142
145
|
[
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
`${protocol}cdn.staticfile.org/monaco-editor/${version}/min/vs/loader.js`,
|
|
147
|
+
`${protocol}fastly.jsdelivr.net/npm/monaco-editor@${version}/min/vs/loader.js`,
|
|
148
|
+
`${protocol}unpkg.com/monaco-editor@${version}/min/vs/loader.js`,
|
|
146
149
|
]
|
|
147
150
|
])
|
|
148
151
|
.then(function ([ url ]) {
|
|
@@ -314,15 +314,24 @@ export default {
|
|
|
314
314
|
/**
|
|
315
315
|
* 监听声明值
|
|
316
316
|
*/
|
|
317
|
-
watch([()=>props.modelValue, ()=>props.end
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
317
|
+
watch([()=>props.modelValue, ()=>props.end], function() {
|
|
318
|
+
watchValue(false)
|
|
319
|
+
})
|
|
320
|
+
watch(()=>props.type, function() {
|
|
321
|
+
watchValue(true)
|
|
322
322
|
})
|
|
323
323
|
|
|
324
324
|
// ==========【方法】=============================================================================================
|
|
325
325
|
|
|
326
|
+
/**
|
|
327
|
+
* 监听值
|
|
328
|
+
*/
|
|
329
|
+
function watchValue(isEmit) {
|
|
330
|
+
dateValue.value = formatDateValue()
|
|
331
|
+
Object.assign(timeValue, formatTimeValue())
|
|
332
|
+
showValue.value = updateValue(dateValue.value, timeValue, isEmit)
|
|
333
|
+
}
|
|
334
|
+
|
|
326
335
|
/**
|
|
327
336
|
* 格式化日期值
|
|
328
337
|
*/
|
|
@@ -764,9 +773,9 @@ export default {
|
|
|
764
773
|
* 清空
|
|
765
774
|
*/
|
|
766
775
|
function onClear() {
|
|
767
|
-
emit('update:modelValue',
|
|
776
|
+
emit('update:modelValue', '')
|
|
768
777
|
if (isRange.value) {
|
|
769
|
-
emit('update:end',
|
|
778
|
+
emit('update:end', '')
|
|
770
779
|
}
|
|
771
780
|
popupRef.value.hide()
|
|
772
781
|
}
|
package/package.json
CHANGED
package/utils/useSearch.js
CHANGED
|
@@ -449,33 +449,96 @@ export function formatValue(rawSearchOptions, searchValue) {
|
|
|
449
449
|
// 否则为数字
|
|
450
450
|
} else {
|
|
451
451
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
//
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
452
|
+
// 如果是日期
|
|
453
|
+
if (type === 'date') {
|
|
454
|
+
|
|
455
|
+
// 如果 为 == || !=
|
|
456
|
+
const isEqual = value1.compare === dicts.SEARCH_COMPARE_TYPE__EQUAL
|
|
457
|
+
if (isEqual || value1.compare === dicts.SEARCH_COMPARE_TYPE__NOT_EQUAL) {
|
|
458
|
+
const { value, dateType } = value1
|
|
459
|
+
if ($n_isRequired(value)) {
|
|
460
|
+
|
|
461
|
+
// 当前时间
|
|
462
|
+
const now = $n_toDate(value)
|
|
463
|
+
|
|
464
|
+
let end
|
|
465
|
+
switch (dateType) {
|
|
466
|
+
// 年
|
|
467
|
+
case 'year':
|
|
468
|
+
// 月
|
|
469
|
+
case 'month':
|
|
470
|
+
// 日
|
|
471
|
+
case 'day':
|
|
472
|
+
end = quasarDate.endOfDate(now, dateType)
|
|
473
|
+
break
|
|
474
|
+
// 分
|
|
475
|
+
case 'datetime':
|
|
476
|
+
end = $n_toDate(quasarDate.formatDate(now, 'YYYY/MM/DD HH:mm:59'))
|
|
477
|
+
break
|
|
478
|
+
}
|
|
460
479
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
480
|
+
let compare1
|
|
481
|
+
let compare2
|
|
482
|
+
|
|
483
|
+
// 如果为 ==
|
|
484
|
+
if (isEqual) {
|
|
465
485
|
// ≥
|
|
466
|
-
|
|
467
|
-
value: $n_numberDeep(quasarDate.formatDate($n_toDate(`${res.date.from} ${res.time.from}`), 'X')),
|
|
468
|
-
},
|
|
469
|
-
// 日期止
|
|
470
|
-
{
|
|
471
|
-
field: name,
|
|
486
|
+
compare1 = dicts.SEARCH_COMPARE_TYPE__GTE
|
|
472
487
|
// ≤
|
|
473
|
-
|
|
474
|
-
|
|
488
|
+
compare2 = dicts.SEARCH_COMPARE_TYPE__LTE
|
|
489
|
+
|
|
490
|
+
// 否则为 !=
|
|
491
|
+
} else {
|
|
492
|
+
// <
|
|
493
|
+
compare1 = dicts.SEARCH_COMPARE_TYPE__LT
|
|
494
|
+
// >
|
|
495
|
+
compare2 = dicts.SEARCH_COMPARE_TYPE__GT
|
|
475
496
|
}
|
|
476
|
-
|
|
497
|
+
|
|
498
|
+
lists.push(
|
|
499
|
+
// 日期起
|
|
500
|
+
{
|
|
501
|
+
field: name,
|
|
502
|
+
// ≥
|
|
503
|
+
compare: compare1,
|
|
504
|
+
value,
|
|
505
|
+
},
|
|
506
|
+
// 日期止
|
|
507
|
+
{
|
|
508
|
+
field: name,
|
|
509
|
+
// ≤
|
|
510
|
+
compare: compare2,
|
|
511
|
+
value: $n_numberDeep(quasarDate.formatDate(end, 'X')),
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
}
|
|
515
|
+
return
|
|
516
|
+
|
|
517
|
+
// 如果类型为快捷日期
|
|
518
|
+
} else if (value1.compare >= 20) {
|
|
519
|
+
|
|
520
|
+
const res = getQuickRange(value1.compare - 20, true)
|
|
521
|
+
if (res) {
|
|
522
|
+
|
|
523
|
+
lists.push(
|
|
524
|
+
// 日期起
|
|
525
|
+
{
|
|
526
|
+
field: name,
|
|
527
|
+
// ≥
|
|
528
|
+
compare: dicts.SEARCH_COMPARE_TYPE__GTE,
|
|
529
|
+
value: $n_numberDeep(quasarDate.formatDate($n_toDate(`${res.date.from} ${res.time.from}`), 'X')),
|
|
530
|
+
},
|
|
531
|
+
// 日期止
|
|
532
|
+
{
|
|
533
|
+
field: name,
|
|
534
|
+
// ≤
|
|
535
|
+
compare: dicts.SEARCH_COMPARE_TYPE__LTE,
|
|
536
|
+
value: $n_numberDeep(quasarDate.formatDate($n_toDate(`${res.date.to} ${res.time.to}`), 'X')),
|
|
537
|
+
}
|
|
538
|
+
)
|
|
539
|
+
}
|
|
540
|
+
return
|
|
477
541
|
}
|
|
478
|
-
return
|
|
479
542
|
}
|
|
480
543
|
|
|
481
544
|
// 添加值1
|