widget.qw 1.0.83 → 1.0.84
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/.env.development +10 -10
- package/.env.production +8 -8
- package/README.md +75 -75
- package/build/style.css +471 -471
- package/build/widget.qw.es.js +141 -74
- package/build/widget.qw.umd.js +141 -74
- package/index.html +17 -17
- package/package.json +47 -47
- package/src/App.vue +26 -26
- package/src/api/index.js +165 -165
- package/src/components/AuditBar.vue +396 -396
- package/src/components/BillCard.vue +164 -164
- package/src/components/CascaderPicker.vue +132 -132
- package/src/components/CascaderPop.vue +373 -371
- package/src/components/CheckGroup.vue +113 -113
- package/src/components/DatetimeDropdown.vue +62 -0
- package/src/components/{DatetimePicker/index.vue → DatetimePicker.vue} +124 -124
- package/src/components/DayDropdown.vue +56 -56
- package/src/components/FilePicker.vue +169 -169
- package/src/components/Input.vue +80 -80
- package/src/components/MonthDropdown.vue +51 -51
- package/src/components/MultiPicker.vue +123 -123
- package/src/components/ObjsEditor.vue +334 -334
- package/src/components/SecretNotify.js +5 -5
- package/src/components/Sheet.vue +92 -92
- package/src/components/SingleApiPicker.vue +108 -108
- package/src/components/SinglePicker.vue +102 -102
- package/src/components/SingleUserSelector.vue +425 -425
- package/src/components/Switch.vue +64 -64
- package/src/components/TreePicker.vue +113 -113
- package/src/components/UserPicker.vue +106 -106
- package/src/components/UserProfile.vue +129 -129
- package/src/components/UsersPicker.vue +118 -118
- package/src/components/YearDropdown.vue +59 -59
- package/src/components/data_selector.vue +303 -303
- package/src/components/image_picker.vue +123 -123
- package/src/components/images_picker.vue +195 -195
- package/src/components/index.js +167 -162
- package/src/components/mult_list_selector.vue +155 -155
- package/src/components/subdepartment_selector.vue +481 -481
- package/src/components/user_selector.vue +639 -639
- package/src/components/widget/DataPop.vue +95 -95
- package/src/components/{DatetimePicker → widget}/DatetimePop.vue +342 -342
- package/src/components/widget/TreePop.vue +88 -88
- package/src/components/widget/UserPop.vue +347 -347
- package/src/main.js +117 -117
- package/src/router/index.ts +178 -173
- package/src/util/array_util.js +32 -32
- package/src/util/auth_util.js +72 -72
- package/src/util/bool_util.js +5 -5
- package/src/util/bus.js +1 -1
- package/src/util/cache_util.js +18 -18
- package/src/util/errer_code.js +6 -6
- package/src/util/eval_util.js +19 -19
- package/src/util/icon_util.js +36 -36
- package/src/util/image_util.js +27 -27
- package/src/util/index.js +57 -57
- package/src/util/num_util.js +70 -70
- package/src/util/obj_util.js +28 -28
- package/src/util/request.js +73 -73
- package/src/util/request_json.js +71 -71
- package/src/util/request_json_mute.js +65 -65
- package/src/util/request_upload.js +79 -79
- package/src/util/route_util.js +31 -31
- package/src/util/str_util.js +143 -143
- package/src/util/time_util.js +406 -406
- package/src/util/toast_util.js +24 -24
- package/src/util/tree_util.js +153 -153
- package/src/util/uuid_util.js +9 -9
- package/src/util/validate.js +182 -182
- package/src/util/vue_filter.js +223 -223
- package/src/views/auditbar/index.vue +78 -78
- package/src/views/billcard/index.vue +48 -48
- package/src/views/cascaderpicker/index.vue +0 -0
- package/src/views/cascaderpop/index.vue +90 -90
- package/src/views/checkgroup/index.vue +35 -35
- package/src/views/dataSelector/index.vue +48 -48
- package/src/views/datetimedropdown/index.vue +34 -0
- package/src/views/datetimepicker/index.vue +34 -34
- package/src/views/daydropdown/index.vue +31 -31
- package/src/views/filepicker/index.vue +32 -32
- package/src/views/home/index.vue +0 -0
- package/src/views/imagepicker/index.vue +31 -31
- package/src/views/imagespicker/index.vue +37 -37
- package/src/views/input/index.vue +35 -35
- package/src/views/monthdropdown/index.vue +31 -31
- package/src/views/multListSelector/index.vue +61 -61
- package/src/views/multipicker/index.vue +36 -36
- package/src/views/objseditor/index.vue +277 -277
- package/src/views/productSelector/index.vue +35 -35
- package/src/views/projectpicker/index.vue +41 -41
- package/src/views/secretnotify/index.vue +27 -27
- package/src/views/sheet/index.vue +45 -45
- package/src/views/singlepicker/index.vue +35 -35
- package/src/views/subdepartmentSelector/index.vue +40 -40
- package/src/views/switch/index.vue +34 -34
- package/src/views/treepicker/index.vue +41 -41
- package/src/views/userSelector/index.vue +54 -54
- package/src/views/userSelectorNew/index.vue +45 -45
- package/src/views/userpicker/index.vue +43 -43
- package/src/views/userprofile/index.vue +30 -30
- package/src/views/userspicker/index.vue +43 -43
- package/src/views/yeardropdown/index.vue +32 -32
- package/src/vm/index.js +1 -1
- package/vite.config.ts +122 -122
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="props.rules"
|
|
3
|
-
label-class="label" :placeholder="props.placeholder">
|
|
4
|
-
<template #input>
|
|
5
|
-
<div class="file-box">
|
|
6
|
-
<van-uploader v-model="files" :multiple="props.multiple" :max-count="maxCount" :afterRead="onAfterRead"
|
|
7
|
-
:disabled="isDisabled" :accept="props.accept" upload-icon="plus" :deletable="!isDisabled"
|
|
8
|
-
:before-delete="onBeforeDelete" @click-preview="onClickPreview" />
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
</van-field>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup>
|
|
15
|
-
import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
|
|
16
|
-
import util from '../util'
|
|
17
|
-
import { useVModel } from "@vueuse/core"
|
|
18
|
-
|
|
19
|
-
const props = defineProps({
|
|
20
|
-
modelValue: {
|
|
21
|
-
type: [String, Array],
|
|
22
|
-
default: null
|
|
23
|
-
},
|
|
24
|
-
label: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: ''
|
|
27
|
-
},
|
|
28
|
-
multiple: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
|
-
maxCount: {
|
|
33
|
-
type: Number,
|
|
34
|
-
default: 1000
|
|
35
|
-
},
|
|
36
|
-
required: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false
|
|
39
|
-
},
|
|
40
|
-
readonly: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
placeholder: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: ''
|
|
47
|
-
},
|
|
48
|
-
rules: {
|
|
49
|
-
type: Array,
|
|
50
|
-
default: () => []
|
|
51
|
-
},
|
|
52
|
-
accept: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: ""
|
|
55
|
-
},
|
|
56
|
-
auth: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: ''
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
const emit = defineEmits(['update:modelValue'])
|
|
63
|
-
const modelValue = useVModel(props, 'modelValue', emit)
|
|
64
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
65
|
-
|
|
66
|
-
const files = ref([])
|
|
67
|
-
const maxCount = computed(() => {
|
|
68
|
-
if (props.multiple)
|
|
69
|
-
return props.maxCount
|
|
70
|
-
else
|
|
71
|
-
return 1
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
onMounted(() => {
|
|
75
|
-
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
const onClickPreview = (e) => {
|
|
79
|
-
let url = (e.url || '')
|
|
80
|
-
if (url.includes('.jpg') || url.includes('.png') || url.includes('.jpeg'))
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
window.location.href = e.url
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const onAfterRead = async (e) => {
|
|
87
|
-
console.log('onAfterRead', e)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
let files = []
|
|
91
|
-
if (e && Array.isArray(e) && e.length > 0) {
|
|
92
|
-
files = e
|
|
93
|
-
}else{
|
|
94
|
-
files = [e]
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
for (var i = 0; i < files.length; i++) {
|
|
98
|
-
let params = {
|
|
99
|
-
file: files[i].file
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
let res = await util.file_upload(params)
|
|
103
|
-
if (res.code == 200) {
|
|
104
|
-
if(props.multiple)
|
|
105
|
-
modelValue.value = [...(modelValue.value || []), res.data]
|
|
106
|
-
else
|
|
107
|
-
modelValue.value = res.data
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return Promise.resolve(e)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const onBeforeDelete = (e) => {
|
|
115
|
-
console.log('onBeforeDelete', e)
|
|
116
|
-
|
|
117
|
-
if (props.multiple) {
|
|
118
|
-
let newUrls = props.modelValue.filter(item => {
|
|
119
|
-
return item != e.url
|
|
120
|
-
})
|
|
121
|
-
emit('update:modelValue', newUrls)
|
|
122
|
-
} else {
|
|
123
|
-
modelValue.value = ''
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return Promise.resolve(e)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
watch(() => props.modelValue,
|
|
130
|
-
(newVal, oldVal) => {
|
|
131
|
-
if (props.multiple) {
|
|
132
|
-
if (!props.modelValue || props.modelValue.length < 1) {
|
|
133
|
-
files.value = []
|
|
134
|
-
return
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
files.value = props.modelValue.map(item => {
|
|
138
|
-
return {
|
|
139
|
-
url: item
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
} else {
|
|
143
|
-
if (!props.modelValue) {
|
|
144
|
-
files.value = []
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
files.value = [{
|
|
149
|
-
url: props.modelValue
|
|
150
|
-
}]
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
immediate: true
|
|
155
|
-
}
|
|
156
|
-
)
|
|
157
|
-
</script>
|
|
158
|
-
|
|
159
|
-
<style lang="scss" scoped>
|
|
160
|
-
:deep(.label) {
|
|
161
|
-
color: #000 !important;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
:deep(.van-field__control:disabled) {
|
|
165
|
-
color: #000 !important;
|
|
166
|
-
cursor: not-allowed;
|
|
167
|
-
opacity: 1;
|
|
168
|
-
-webkit-text-fill-color: #000;
|
|
169
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="props.rules"
|
|
3
|
+
label-class="label" :placeholder="props.placeholder">
|
|
4
|
+
<template #input>
|
|
5
|
+
<div class="file-box">
|
|
6
|
+
<van-uploader v-model="files" :multiple="props.multiple" :max-count="maxCount" :afterRead="onAfterRead"
|
|
7
|
+
:disabled="isDisabled" :accept="props.accept" upload-icon="plus" :deletable="!isDisabled"
|
|
8
|
+
:before-delete="onBeforeDelete" @click-preview="onClickPreview" />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
</van-field>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
|
|
16
|
+
import util from '../util'
|
|
17
|
+
import { useVModel } from "@vueuse/core"
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: [String, Array],
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
label: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
},
|
|
28
|
+
multiple: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
maxCount: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 1000
|
|
35
|
+
},
|
|
36
|
+
required: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
readonly: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
placeholder: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ''
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
type: Array,
|
|
50
|
+
default: () => []
|
|
51
|
+
},
|
|
52
|
+
accept: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ""
|
|
55
|
+
},
|
|
56
|
+
auth: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ''
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const emit = defineEmits(['update:modelValue'])
|
|
63
|
+
const modelValue = useVModel(props, 'modelValue', emit)
|
|
64
|
+
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
65
|
+
|
|
66
|
+
const files = ref([])
|
|
67
|
+
const maxCount = computed(() => {
|
|
68
|
+
if (props.multiple)
|
|
69
|
+
return props.maxCount
|
|
70
|
+
else
|
|
71
|
+
return 1
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
onMounted(() => {
|
|
75
|
+
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const onClickPreview = (e) => {
|
|
79
|
+
let url = (e.url || '')
|
|
80
|
+
if (url.includes('.jpg') || url.includes('.png') || url.includes('.jpeg'))
|
|
81
|
+
return
|
|
82
|
+
|
|
83
|
+
window.location.href = e.url
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const onAfterRead = async (e) => {
|
|
87
|
+
console.log('onAfterRead', e)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
let files = []
|
|
91
|
+
if (e && Array.isArray(e) && e.length > 0) {
|
|
92
|
+
files = e
|
|
93
|
+
}else{
|
|
94
|
+
files = [e]
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
for (var i = 0; i < files.length; i++) {
|
|
98
|
+
let params = {
|
|
99
|
+
file: files[i].file
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let res = await util.file_upload(params)
|
|
103
|
+
if (res.code == 200) {
|
|
104
|
+
if(props.multiple)
|
|
105
|
+
modelValue.value = [...(modelValue.value || []), res.data]
|
|
106
|
+
else
|
|
107
|
+
modelValue.value = res.data
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return Promise.resolve(e)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const onBeforeDelete = (e) => {
|
|
115
|
+
console.log('onBeforeDelete', e)
|
|
116
|
+
|
|
117
|
+
if (props.multiple) {
|
|
118
|
+
let newUrls = props.modelValue.filter(item => {
|
|
119
|
+
return item != e.url
|
|
120
|
+
})
|
|
121
|
+
emit('update:modelValue', newUrls)
|
|
122
|
+
} else {
|
|
123
|
+
modelValue.value = ''
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return Promise.resolve(e)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
watch(() => props.modelValue,
|
|
130
|
+
(newVal, oldVal) => {
|
|
131
|
+
if (props.multiple) {
|
|
132
|
+
if (!props.modelValue || props.modelValue.length < 1) {
|
|
133
|
+
files.value = []
|
|
134
|
+
return
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
files.value = props.modelValue.map(item => {
|
|
138
|
+
return {
|
|
139
|
+
url: item
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
} else {
|
|
143
|
+
if (!props.modelValue) {
|
|
144
|
+
files.value = []
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
files.value = [{
|
|
149
|
+
url: props.modelValue
|
|
150
|
+
}]
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
immediate: true
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<style lang="scss" scoped>
|
|
160
|
+
:deep(.label) {
|
|
161
|
+
color: #000 !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:deep(.van-field__control:disabled) {
|
|
165
|
+
color: #000 !important;
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
opacity: 1;
|
|
168
|
+
-webkit-text-fill-color: #000;
|
|
169
|
+
}
|
|
170
170
|
</style>
|
package/src/components/Input.vue
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<van-field :label="props.label" v-model.number="modelValue" v-if="!isGone && props.type === 'number'"
|
|
3
|
-
:disabled="isDisabled" :required="isRequired" :placeholder="props.placeholder" :type="props.type"
|
|
4
|
-
:rows="props.rows" :autosize="props.autosize" :rules="props.rules" />
|
|
5
|
-
<van-field :label="props.label" v-model="modelValue" v-if="!isGone && props.type != 'number'" :disabled="isDisabled"
|
|
6
|
-
:required="isRequired" :placeholder="props.placeholder" :type="props.type" :rows="props.rows"
|
|
7
|
-
:autosize="props.autosize" :rules="props.rules" />
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script setup>
|
|
11
|
-
import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
|
|
12
|
-
import { useVModel } from '@vueuse/core'
|
|
13
|
-
import util from '../util'
|
|
14
|
-
|
|
15
|
-
const props = defineProps({
|
|
16
|
-
modelValue: {
|
|
17
|
-
type: [String, Number],
|
|
18
|
-
default: null
|
|
19
|
-
},
|
|
20
|
-
// 支持v-model.number写法
|
|
21
|
-
modelModifiers: {
|
|
22
|
-
type: Object,
|
|
23
|
-
default: () => ({})
|
|
24
|
-
},
|
|
25
|
-
label: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: ''
|
|
28
|
-
},
|
|
29
|
-
type: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: 'text'
|
|
32
|
-
},
|
|
33
|
-
rows: {
|
|
34
|
-
type: Number,
|
|
35
|
-
default: 1
|
|
36
|
-
},
|
|
37
|
-
autosize: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: false
|
|
40
|
-
},
|
|
41
|
-
placeholder: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: ''
|
|
44
|
-
},
|
|
45
|
-
readonly: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: true
|
|
48
|
-
},
|
|
49
|
-
required: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false
|
|
52
|
-
},
|
|
53
|
-
auth: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: ''
|
|
56
|
-
},
|
|
57
|
-
rules: {
|
|
58
|
-
type: Array,
|
|
59
|
-
default: null
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
const emit = defineEmits(['update:modelValue'])
|
|
63
|
-
const modelValue = useVModel(props, 'modelValue', emit)
|
|
64
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
65
|
-
|
|
66
|
-
onMounted(() => {
|
|
67
|
-
})
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<style lang="scss" scoped>
|
|
71
|
-
:deep(.label) {
|
|
72
|
-
color: #000 !important;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
:deep(.van-field__control:disabled) {
|
|
76
|
-
color: #000 !important;
|
|
77
|
-
cursor: not-allowed;
|
|
78
|
-
opacity: 1;
|
|
79
|
-
-webkit-text-fill-color: #000;
|
|
80
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<van-field :label="props.label" v-model.number="modelValue" v-if="!isGone && props.type === 'number'"
|
|
3
|
+
:disabled="isDisabled" :required="isRequired" :placeholder="props.placeholder" :type="props.type"
|
|
4
|
+
:rows="props.rows" :autosize="props.autosize" :rules="props.rules" />
|
|
5
|
+
<van-field :label="props.label" v-model="modelValue" v-if="!isGone && props.type != 'number'" :disabled="isDisabled"
|
|
6
|
+
:required="isRequired" :placeholder="props.placeholder" :type="props.type" :rows="props.rows"
|
|
7
|
+
:autosize="props.autosize" :rules="props.rules" />
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
|
|
12
|
+
import { useVModel } from '@vueuse/core'
|
|
13
|
+
import util from '../util'
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: [String, Number],
|
|
18
|
+
default: null
|
|
19
|
+
},
|
|
20
|
+
// 支持v-model.number写法
|
|
21
|
+
modelModifiers: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default: () => ({})
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
type: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'text'
|
|
32
|
+
},
|
|
33
|
+
rows: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 1
|
|
36
|
+
},
|
|
37
|
+
autosize: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ''
|
|
44
|
+
},
|
|
45
|
+
readonly: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
required: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
auth: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ''
|
|
56
|
+
},
|
|
57
|
+
rules: {
|
|
58
|
+
type: Array,
|
|
59
|
+
default: null
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
const emit = defineEmits(['update:modelValue'])
|
|
63
|
+
const modelValue = useVModel(props, 'modelValue', emit)
|
|
64
|
+
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
65
|
+
|
|
66
|
+
onMounted(() => {
|
|
67
|
+
})
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="scss" scoped>
|
|
71
|
+
:deep(.label) {
|
|
72
|
+
color: #000 !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:deep(.van-field__control:disabled) {
|
|
76
|
+
color: #000 !important;
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
opacity: 1;
|
|
79
|
+
-webkit-text-fill-color: #000;
|
|
80
|
+
}
|
|
81
81
|
</style>
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<van-dropdown-item v-model="modelValue" :options="data.monthOptions" />
|
|
3
|
-
</template>
|
|
4
|
-
<script setup>
|
|
5
|
-
import { reactive, onMounted, watch } from "vue";
|
|
6
|
-
import util from "../util"
|
|
7
|
-
import { useVModel } from '@vueuse/core'
|
|
8
|
-
|
|
9
|
-
const props = defineProps({
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: Number,
|
|
12
|
-
default: 0,
|
|
13
|
-
},
|
|
14
|
-
label: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: "选择月份",
|
|
17
|
-
},
|
|
18
|
-
placeholder: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "请选择月份",
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// 弹出层
|
|
25
|
-
const data = reactive({
|
|
26
|
-
monthOptions: []
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
// 定义emit
|
|
30
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
31
|
-
const modelValue = useVModel(props, 'modelValue', emit)
|
|
32
|
-
|
|
33
|
-
const setupOptions = () => {
|
|
34
|
-
data.monthOptions.push({
|
|
35
|
-
text: '月',
|
|
36
|
-
value: 0
|
|
37
|
-
})
|
|
38
|
-
for (var i = 1; i <= 12; i++) {
|
|
39
|
-
data.monthOptions.push({
|
|
40
|
-
text: i+'月',
|
|
41
|
-
value: i,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
//首页加载
|
|
47
|
-
onMounted(() => {
|
|
48
|
-
setupOptions()
|
|
49
|
-
})
|
|
50
|
-
</script>
|
|
51
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<van-dropdown-item v-model="modelValue" :options="data.monthOptions" />
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
|
+
import { reactive, onMounted, watch } from "vue";
|
|
6
|
+
import util from "../util"
|
|
7
|
+
import { useVModel } from '@vueuse/core'
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 0,
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "选择月份",
|
|
17
|
+
},
|
|
18
|
+
placeholder: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "请选择月份",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// 弹出层
|
|
25
|
+
const data = reactive({
|
|
26
|
+
monthOptions: []
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// 定义emit
|
|
30
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
31
|
+
const modelValue = useVModel(props, 'modelValue', emit)
|
|
32
|
+
|
|
33
|
+
const setupOptions = () => {
|
|
34
|
+
data.monthOptions.push({
|
|
35
|
+
text: '月',
|
|
36
|
+
value: 0
|
|
37
|
+
})
|
|
38
|
+
for (var i = 1; i <= 12; i++) {
|
|
39
|
+
data.monthOptions.push({
|
|
40
|
+
text: i+'月',
|
|
41
|
+
value: i,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//首页加载
|
|
47
|
+
onMounted(() => {
|
|
48
|
+
setupOptions()
|
|
49
|
+
})
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
52
|
<style scoped></style>
|