widget.qw 1.0.47 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/widget.qw.es.js +16 -11
- package/build/widget.qw.umd.js +16 -11
- package/package.json +1 -1
- package/src/components/DatetimePicker/index.vue +34 -32
package/build/widget.qw.es.js
CHANGED
|
@@ -17071,10 +17071,15 @@ const _sfc_main$o = {
|
|
|
17071
17071
|
isDisabled
|
|
17072
17072
|
} = util.props2auth(props);
|
|
17073
17073
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
17074
|
-
const formatTime = (
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
|
|
17074
|
+
const formatTime = computed({
|
|
17075
|
+
get() {
|
|
17076
|
+
let res = props.modelValue;
|
|
17077
|
+
return res;
|
|
17078
|
+
},
|
|
17079
|
+
set() {
|
|
17080
|
+
modelValue.value = "";
|
|
17081
|
+
}
|
|
17082
|
+
});
|
|
17078
17083
|
watch(() => props.modelValue, (n, o) => {
|
|
17079
17084
|
if (!props.defaultnow)
|
|
17080
17085
|
return;
|
|
@@ -17086,6 +17091,7 @@ const _sfc_main$o = {
|
|
|
17086
17091
|
immediate: true
|
|
17087
17092
|
});
|
|
17088
17093
|
function onToggleShow() {
|
|
17094
|
+
console.log("11111111");
|
|
17089
17095
|
if (isReadonly.value)
|
|
17090
17096
|
return;
|
|
17091
17097
|
data2.isShow = true;
|
|
@@ -17094,20 +17100,19 @@ const _sfc_main$o = {
|
|
|
17094
17100
|
const _component_van_field = resolveComponent("van-field");
|
|
17095
17101
|
return openBlock(), createElementBlock(Fragment, null, [!unref(isGone) ? (openBlock(), createBlock(_component_van_field, {
|
|
17096
17102
|
key: 0,
|
|
17097
|
-
modelValue:
|
|
17098
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
17103
|
+
modelValue: unref(formatTime),
|
|
17104
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(formatTime) ? formatTime.value = $event : null),
|
|
17099
17105
|
name: "datetimePicker",
|
|
17100
17106
|
label: props.label,
|
|
17107
|
+
disabled: unref(isDisabled),
|
|
17108
|
+
readonly: unref(isReadonly),
|
|
17109
|
+
clearable: "",
|
|
17101
17110
|
placeholder: props.placeholder,
|
|
17102
|
-
readonly: "",
|
|
17103
17111
|
required: unref(isRequired),
|
|
17104
17112
|
rules: props.rules,
|
|
17105
17113
|
"is-link": unref(isReadonly) ? false : true,
|
|
17106
17114
|
onClick: onToggleShow
|
|
17107
|
-
}, {
|
|
17108
|
-
input: withCtx(() => [createTextVNode(toDisplayString(formatTime(props.modelValue)), 1)]),
|
|
17109
|
-
_: 1
|
|
17110
|
-
}, 8, ["modelValue", "label", "placeholder", "required", "rules", "is-link"])) : createCommentVNode("", true), createVNode(_sfc_main$p, {
|
|
17115
|
+
}, null, 8, ["modelValue", "label", "disabled", "readonly", "placeholder", "required", "rules", "is-link"])) : createCommentVNode("", true), createVNode(_sfc_main$p, {
|
|
17111
17116
|
isShow: data2.isShow,
|
|
17112
17117
|
"onUpdate:isShow": _cache[1] || (_cache[1] = ($event) => data2.isShow = $event),
|
|
17113
17118
|
modelValue: unref(modelValue),
|
package/build/widget.qw.umd.js
CHANGED
|
@@ -17074,10 +17074,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17074
17074
|
isDisabled
|
|
17075
17075
|
} = util.props2auth(props);
|
|
17076
17076
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
17077
|
-
const formatTime = (
|
|
17078
|
-
|
|
17079
|
-
|
|
17080
|
-
|
|
17077
|
+
const formatTime = vue.computed({
|
|
17078
|
+
get() {
|
|
17079
|
+
let res = props.modelValue;
|
|
17080
|
+
return res;
|
|
17081
|
+
},
|
|
17082
|
+
set() {
|
|
17083
|
+
modelValue.value = "";
|
|
17084
|
+
}
|
|
17085
|
+
});
|
|
17081
17086
|
vue.watch(() => props.modelValue, (n, o) => {
|
|
17082
17087
|
if (!props.defaultnow)
|
|
17083
17088
|
return;
|
|
@@ -17089,6 +17094,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17089
17094
|
immediate: true
|
|
17090
17095
|
});
|
|
17091
17096
|
function onToggleShow() {
|
|
17097
|
+
console.log("11111111");
|
|
17092
17098
|
if (isReadonly.value)
|
|
17093
17099
|
return;
|
|
17094
17100
|
data2.isShow = true;
|
|
@@ -17097,20 +17103,19 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17097
17103
|
const _component_van_field = vue.resolveComponent("van-field");
|
|
17098
17104
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [!vue.unref(isGone) ? (vue.openBlock(), vue.createBlock(_component_van_field, {
|
|
17099
17105
|
key: 0,
|
|
17100
|
-
modelValue:
|
|
17101
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
17106
|
+
modelValue: vue.unref(formatTime),
|
|
17107
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(formatTime) ? formatTime.value = $event : null),
|
|
17102
17108
|
name: "datetimePicker",
|
|
17103
17109
|
label: props.label,
|
|
17110
|
+
disabled: vue.unref(isDisabled),
|
|
17111
|
+
readonly: vue.unref(isReadonly),
|
|
17112
|
+
clearable: "",
|
|
17104
17113
|
placeholder: props.placeholder,
|
|
17105
|
-
readonly: "",
|
|
17106
17114
|
required: vue.unref(isRequired),
|
|
17107
17115
|
rules: props.rules,
|
|
17108
17116
|
"is-link": vue.unref(isReadonly) ? false : true,
|
|
17109
17117
|
onClick: onToggleShow
|
|
17110
|
-
}, {
|
|
17111
|
-
input: vue.withCtx(() => [vue.createTextVNode(vue.toDisplayString(formatTime(props.modelValue)), 1)]),
|
|
17112
|
-
_: 1
|
|
17113
|
-
}, 8, ["modelValue", "label", "placeholder", "required", "rules", "is-link"])) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$p, {
|
|
17118
|
+
}, null, 8, ["modelValue", "label", "disabled", "readonly", "placeholder", "required", "rules", "is-link"])) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$p, {
|
|
17114
17119
|
isShow: data2.isShow,
|
|
17115
17120
|
"onUpdate:isShow": _cache[1] || (_cache[1] = ($event) => data2.isShow = $event),
|
|
17116
17121
|
modelValue: vue.unref(modelValue),
|
package/package.json
CHANGED
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field v-if="!isGone"
|
|
3
|
-
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{{ formatTime(props.modelValue) }}
|
|
9
|
-
</template>
|
|
2
|
+
<van-field v-if="!isGone" v-model="formatTime" name="datetimePicker" :label="props.label"
|
|
3
|
+
:disabled="isDisabled"
|
|
4
|
+
:readonly="isReadonly"
|
|
5
|
+
clearable
|
|
6
|
+
:placeholder="props.placeholder" :required="isRequired" :rules="props.rules"
|
|
7
|
+
:is-link="isReadonly ? false : true" @click="onToggleShow">
|
|
10
8
|
</van-field>
|
|
11
9
|
|
|
12
10
|
<!-- 弹出层 -->
|
|
13
|
-
<DatetimePop v-model:isShow="data.isShow"
|
|
14
|
-
v-model="modelValue"
|
|
15
|
-
:before="props.before"
|
|
16
|
-
:defaultnow="props.defaultnow"
|
|
11
|
+
<DatetimePop v-model:isShow="data.isShow" v-model="modelValue" :before="props.before" :defaultnow="props.defaultnow"
|
|
17
12
|
:columnsType="props.columnsType" />
|
|
18
13
|
</template>
|
|
19
14
|
|
|
20
15
|
|
|
21
16
|
<script setup>
|
|
22
|
-
import { ref,reactive, watch, getCurrentInstance, computed } from "vue"
|
|
17
|
+
import { ref, reactive, watch, getCurrentInstance, computed } from "vue"
|
|
23
18
|
import DatetimePop from './DatetimePop.vue'
|
|
24
19
|
import util from '../../util'
|
|
25
20
|
import { useVModel } from "@vueuse/core"
|
|
26
21
|
|
|
27
22
|
const props = defineProps({
|
|
28
|
-
modelValue:{
|
|
23
|
+
modelValue: {
|
|
29
24
|
type: String,
|
|
30
25
|
default: ''
|
|
31
26
|
},
|
|
32
27
|
label: {
|
|
33
|
-
type:String,
|
|
28
|
+
type: String,
|
|
34
29
|
default: ''
|
|
35
30
|
},
|
|
36
31
|
readonly: {
|
|
@@ -41,7 +36,7 @@ const props = defineProps({
|
|
|
41
36
|
type: Boolean,
|
|
42
37
|
default: false
|
|
43
38
|
},
|
|
44
|
-
before:{
|
|
39
|
+
before: {
|
|
45
40
|
type: Boolean,
|
|
46
41
|
default: false
|
|
47
42
|
},
|
|
@@ -53,35 +48,40 @@ const props = defineProps({
|
|
|
53
48
|
type: Array,
|
|
54
49
|
default: ['year', 'month', 'day', 'hour', 'minute', 'second']
|
|
55
50
|
},
|
|
56
|
-
placeholder:{
|
|
57
|
-
type:String,
|
|
58
|
-
default:''
|
|
51
|
+
placeholder: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: ''
|
|
59
54
|
},
|
|
60
|
-
auth:{
|
|
61
|
-
type:String,
|
|
62
|
-
default:''
|
|
55
|
+
auth: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ''
|
|
63
58
|
},
|
|
64
|
-
rules:{
|
|
59
|
+
rules: {
|
|
65
60
|
type: Array,
|
|
66
|
-
default:null
|
|
61
|
+
default: null
|
|
67
62
|
}
|
|
68
63
|
})
|
|
69
64
|
const data = reactive({
|
|
70
65
|
isShow: false, //是否显示弹出层
|
|
71
66
|
})
|
|
72
|
-
const {isRequired, isReadonly, isGone,isDisabled} = util.props2auth(props)
|
|
67
|
+
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
73
68
|
//定义要向父组件传递的事件
|
|
74
69
|
const emit = defineEmits(["update:modelValue"])
|
|
75
70
|
const modelValue = useVModel(props, "modelValue", emit)
|
|
76
71
|
|
|
77
|
-
const formatTime=(
|
|
78
|
-
|
|
72
|
+
const formatTime = computed({
|
|
73
|
+
get() {
|
|
74
|
+
let res = props.modelValue
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
// let week_day = util.date2week_day(time)
|
|
77
|
+
// res = time+'/'+week_day
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
}
|
|
79
|
+
return res
|
|
80
|
+
},
|
|
81
|
+
set() {
|
|
82
|
+
modelValue.value = ''
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
85
|
|
|
86
86
|
// 默认当前时间
|
|
87
87
|
watch(
|
|
@@ -95,7 +95,7 @@ watch(
|
|
|
95
95
|
if (n) {
|
|
96
96
|
return
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
// 没有值时,默认设置为当前时间
|
|
100
100
|
modelValue.value = util.date2yyyyMMddhhmmss(new Date())
|
|
101
101
|
},
|
|
@@ -105,6 +105,8 @@ watch(
|
|
|
105
105
|
)
|
|
106
106
|
|
|
107
107
|
function onToggleShow() {
|
|
108
|
+
console.log('11111111')
|
|
109
|
+
|
|
108
110
|
if (isReadonly.value)
|
|
109
111
|
return
|
|
110
112
|
|