wl-design-mobile 0.0.1 → 0.0.2
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/api/doc.js +25 -0
- package/api/x1.js +56 -0
- package/btn/lambo-big-button.vue +125 -121
- package/btn/lambo-button-group.vue +47 -47
- package/btn/lambo-medium-button.vue +123 -121
- package/btn/lambo-small-button-group.vue +31 -31
- package/btn/lambo-small-button-select.vue +53 -53
- package/btn/lambo-small-button.vue +123 -121
- package/card-item/card-row-icon.vue +0 -1
- package/card-item/filtrate-row.vue +1 -0
- package/collapse/lambo-collapse.vue +80 -80
- package/config/config.js +14 -0
- package/detail/lambo-detail-grid.vue +87 -57
- package/detail/lambo-detail-row.vue +59 -59
- package/doc/file/lambo-file-upload.vue +176 -179
- package/doc/file/styles/css/index.css +118 -118
- package/doc/img/lambo-img-upload.vue +109 -109
- package/edit/list/Lambo-edit-list.vue +90 -90
- package/edit/list/lambo-edit-card-group.vue +103 -103
- package/edit/select/lambo-edit-date-range.vue +135 -135
- package/edit/select/lambo-edit-date-time.vue +105 -0
- package/edit/select/lambo-edit-date.vue +108 -108
- package/edit/select/lambo-edit-input-textarea.vue +92 -92
- package/edit/select/lambo-edit-input.vue +92 -92
- package/edit/select/lambo-edit-multi-select.vue +160 -160
- package/edit/select/lambo-edit-single-select.vue +153 -153
- package/flow/lambo-flow-detail.vue +30 -30
- package/flow/lambo-flow-edit.vue +30 -30
- package/icon/lambo-required-red-star.vue +47 -47
- package/list/lambo-list.vue +1 -1
- package/nav/lambo-top-nav.vue +89 -89
- package/package.json +4 -2
- package/search/lambo-date-range-page.vue +191 -191
- package/search/lambo-date-range.vue +107 -107
- package/search/lambo-input.vue +74 -74
- package/search/lambo-multi-select.vue +125 -125
- package/search/lambo-org-select-page.vue +109 -109
- package/search/lambo-search-box.vue +55 -55
- package/search/lambo-single-select.vue +119 -119
- package/styles/base.less +75 -75
- package/styles/components/btn.less +7 -7
- package/styles/components/search.less +33 -33
- package/styles/components/tag.less +181 -181
- package/styles/index.less +4 -4
- package/tag/lambo-tag.vue +25 -0
- package/title/lambo-title1.vue +129 -129
- package/title/lambo-title2.vue +37 -37
- package/util/assist.js +43 -0
- package/util/axios/cacheconf.js +19 -0
- package/util/axios/index.js +11 -0
- package/util/axios/interceptors.js +101 -0
- package/util/bus.js +4 -0
- package/util/token.js +36 -0
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="edit-box">
|
|
3
|
-
<div class="edit-left-box">
|
|
4
|
-
<div class="edit-left-top">
|
|
5
|
-
<div v-if="required" class="edit-red-icon">
|
|
6
|
-
<lambo-required-red-star :required="required"></lambo-required-red-star>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="edit-title">{{ title }}</div>
|
|
9
|
-
</div>
|
|
10
|
-
<van-field v-model="valName" :placeholder="placeholder" :readonly="true"
|
|
11
|
-
class="edit-lambo-input" clear-trigger="focus"></van-field>
|
|
12
|
-
<van-calendar v-model:show="showBottom" :default-date="defaultDate" :max-date="maxDate" :min-date="minDate"
|
|
13
|
-
:style="{ maxHeight: '65%' }" color="#0070D2" type="single" @confirm="onConfirm"/>
|
|
14
|
-
</div>
|
|
15
|
-
<div v-if="icon" class="edit-right-icon">
|
|
16
|
-
<lambo-vector-icon :icon="icon" @click="changeColor"></lambo-vector-icon>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
<script>
|
|
21
|
-
import LamboVectorIcon from '
|
|
22
|
-
import LamboRequiredRedStar from '
|
|
23
|
-
import moment from "moment/moment";
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
name: 'LamboEditDate',
|
|
27
|
-
components: {LamboRequiredRedStar, LamboVectorIcon},
|
|
28
|
-
props: {
|
|
29
|
-
icon: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: "date.png",
|
|
32
|
-
},
|
|
33
|
-
required: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: false,
|
|
36
|
-
},
|
|
37
|
-
title: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: false,
|
|
40
|
-
},
|
|
41
|
-
placeholder: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: '请选择',
|
|
44
|
-
},
|
|
45
|
-
defaultDate: {
|
|
46
|
-
type: Date,
|
|
47
|
-
default: () => null
|
|
48
|
-
},
|
|
49
|
-
minDate: {
|
|
50
|
-
type: Date,
|
|
51
|
-
default: () => new Date((new Date()).getFullYear() - 3, (new Date()).getMonth(), (new Date()).getDate())
|
|
52
|
-
},
|
|
53
|
-
maxDate: {
|
|
54
|
-
type: Date,
|
|
55
|
-
default: () => new Date((new Date()).getFullYear() + 3, (new Date()).getMonth(), (new Date()).getDate())
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
data() {
|
|
59
|
-
return {
|
|
60
|
-
valName: '',
|
|
61
|
-
showBottom: false,
|
|
62
|
-
selectItem: {
|
|
63
|
-
dateStr: '',
|
|
64
|
-
dateFormat: ''
|
|
65
|
-
},
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
methods: {
|
|
69
|
-
changeColor() {
|
|
70
|
-
this.showBottom = !this.showBottom
|
|
71
|
-
let searchRows = document.querySelectorAll('.edit-box')
|
|
72
|
-
Array.from(searchRows).forEach(function (row, index) {
|
|
73
|
-
row.addEventListener('click', function () {
|
|
74
|
-
Array.from(searchRows).forEach(function (row) {
|
|
75
|
-
row.style.borderBottom = '1px solid var(--scl-white-2)'
|
|
76
|
-
})
|
|
77
|
-
row.style.borderBottom = '1px solid var(--scl-blue)'
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
},
|
|
81
|
-
onConfirm(time) {
|
|
82
|
-
console.log(" onConfirm time:", time)
|
|
83
|
-
let dateStr = moment(time).format("yyyyMMDD") || ''
|
|
84
|
-
let dateFormat = moment(time).format("yyyy-MM-DD") || ''
|
|
85
|
-
this.valName = dateFormat
|
|
86
|
-
this.selectItem.dateStr = dateStr
|
|
87
|
-
this.selectItem.dateFormat = dateFormat
|
|
88
|
-
this.$emit("on-ok", this.selectItem)
|
|
89
|
-
this.showBottom = false
|
|
90
|
-
},
|
|
91
|
-
initDefaultVal() {
|
|
92
|
-
// 默认值处理
|
|
93
|
-
if (this.defaultDate) {
|
|
94
|
-
this.onConfirm(this.defaultDate)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
created() {
|
|
99
|
-
this.initDefaultVal()
|
|
100
|
-
},
|
|
101
|
-
mounted() {
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
</script>
|
|
105
|
-
<style scoped>
|
|
106
|
-
@import "../../styles/index.less";
|
|
107
|
-
@import "styles/css/index.css";
|
|
108
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="edit-box">
|
|
3
|
+
<div class="edit-left-box">
|
|
4
|
+
<div class="edit-left-top">
|
|
5
|
+
<div v-if="required" class="edit-red-icon">
|
|
6
|
+
<lambo-required-red-star :required="required"></lambo-required-red-star>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="edit-title">{{ title }}</div>
|
|
9
|
+
</div>
|
|
10
|
+
<van-field v-model="valName" :placeholder="placeholder" :readonly="true"
|
|
11
|
+
class="edit-lambo-input" clear-trigger="focus"></van-field>
|
|
12
|
+
<van-calendar v-model:show="showBottom" :default-date="defaultDate" :max-date="maxDate" :min-date="minDate"
|
|
13
|
+
:style="{ maxHeight: '65%' }" color="#0070D2" type="single" @confirm="onConfirm"/>
|
|
14
|
+
</div>
|
|
15
|
+
<div v-if="icon" class="edit-right-icon">
|
|
16
|
+
<lambo-vector-icon :icon="icon" @click="changeColor"></lambo-vector-icon>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
import LamboVectorIcon from '../../icon/lambo-vector-icon.vue'
|
|
22
|
+
import LamboRequiredRedStar from '../../icon/lambo-required-red-star.vue'
|
|
23
|
+
import moment from "moment/moment";
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: 'LamboEditDate',
|
|
27
|
+
components: {LamboRequiredRedStar, LamboVectorIcon},
|
|
28
|
+
props: {
|
|
29
|
+
icon: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "date.png",
|
|
32
|
+
},
|
|
33
|
+
required: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: '请选择',
|
|
44
|
+
},
|
|
45
|
+
defaultDate: {
|
|
46
|
+
type: Date,
|
|
47
|
+
default: () => null
|
|
48
|
+
},
|
|
49
|
+
minDate: {
|
|
50
|
+
type: Date,
|
|
51
|
+
default: () => new Date((new Date()).getFullYear() - 3, (new Date()).getMonth(), (new Date()).getDate())
|
|
52
|
+
},
|
|
53
|
+
maxDate: {
|
|
54
|
+
type: Date,
|
|
55
|
+
default: () => new Date((new Date()).getFullYear() + 3, (new Date()).getMonth(), (new Date()).getDate())
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
data() {
|
|
59
|
+
return {
|
|
60
|
+
valName: '',
|
|
61
|
+
showBottom: false,
|
|
62
|
+
selectItem: {
|
|
63
|
+
dateStr: '',
|
|
64
|
+
dateFormat: ''
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
changeColor() {
|
|
70
|
+
this.showBottom = !this.showBottom
|
|
71
|
+
let searchRows = document.querySelectorAll('.edit-box')
|
|
72
|
+
Array.from(searchRows).forEach(function (row, index) {
|
|
73
|
+
row.addEventListener('click', function () {
|
|
74
|
+
Array.from(searchRows).forEach(function (row) {
|
|
75
|
+
row.style.borderBottom = '1px solid var(--scl-white-2)'
|
|
76
|
+
})
|
|
77
|
+
row.style.borderBottom = '1px solid var(--scl-blue)'
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
onConfirm(time) {
|
|
82
|
+
console.log(" onConfirm time:", time)
|
|
83
|
+
let dateStr = moment(time).format("yyyyMMDD") || ''
|
|
84
|
+
let dateFormat = moment(time).format("yyyy-MM-DD") || ''
|
|
85
|
+
this.valName = dateFormat
|
|
86
|
+
this.selectItem.dateStr = dateStr
|
|
87
|
+
this.selectItem.dateFormat = dateFormat
|
|
88
|
+
this.$emit("on-ok", this.selectItem)
|
|
89
|
+
this.showBottom = false
|
|
90
|
+
},
|
|
91
|
+
initDefaultVal() {
|
|
92
|
+
// 默认值处理
|
|
93
|
+
if (this.defaultDate) {
|
|
94
|
+
this.onConfirm(this.defaultDate)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
created() {
|
|
99
|
+
this.initDefaultVal()
|
|
100
|
+
},
|
|
101
|
+
mounted() {
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
<style scoped>
|
|
106
|
+
@import "../../styles/index.less";
|
|
107
|
+
@import "styles/css/index.css";
|
|
108
|
+
</style>
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="edit-box" @click="changeColor">
|
|
3
|
-
<div class="edit-left-box">
|
|
4
|
-
<div class="edit-left-top">
|
|
5
|
-
<div v-if="required" class="edit-red-icon">
|
|
6
|
-
<lambo-required-red-star :required="required"></lambo-required-red-star>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="edit-title">{{ title }}</div>
|
|
9
|
-
</div>
|
|
10
|
-
<van-field v-model="innerValue" :autosize="true" :clearable="true" :maxlength="maxlength"
|
|
11
|
-
:placeholder="placeholder" :show-word-limit="showWordLimit" :type="type"
|
|
12
|
-
class="edit-lambo-input-textarea" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
|
|
13
|
-
</div>
|
|
14
|
-
<div v-if="icon" class="edit-right-icon">
|
|
15
|
-
<lambo-vector-icon :icon="icon"></lambo-vector-icon>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
<script>
|
|
20
|
-
import redIcon from '
|
|
21
|
-
import LamboRequiredRedStar from '
|
|
22
|
-
import LamboVectorIcon from "
|
|
23
|
-
|
|
24
|
-
export default {
|
|
25
|
-
name: 'LamboEditInputTextarea',
|
|
26
|
-
components: {LamboVectorIcon, LamboRequiredRedStar},
|
|
27
|
-
model: {
|
|
28
|
-
prop: 'value',
|
|
29
|
-
event: 'input',
|
|
30
|
-
},
|
|
31
|
-
props: {
|
|
32
|
-
required: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false,
|
|
35
|
-
},
|
|
36
|
-
type: {
|
|
37
|
-
default: 'textarea',
|
|
38
|
-
},
|
|
39
|
-
maxlength: {
|
|
40
|
-
type: [String, Number],
|
|
41
|
-
},
|
|
42
|
-
placeholder: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: '',
|
|
45
|
-
},
|
|
46
|
-
title: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: false,
|
|
49
|
-
},
|
|
50
|
-
value: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: '',
|
|
53
|
-
},
|
|
54
|
-
showWordLimit: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
icon: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
data() {
|
|
64
|
-
return {
|
|
65
|
-
requiredReadIcon: redIcon,
|
|
66
|
-
innerValue: this.value
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
methods: {
|
|
70
|
-
changeColor() {
|
|
71
|
-
let searchRows = document.querySelectorAll('.edit-box')
|
|
72
|
-
Array.from(searchRows).forEach(function (row, index) {
|
|
73
|
-
row.addEventListener('click', function () {
|
|
74
|
-
Array.from(searchRows).forEach(function (row) {
|
|
75
|
-
row.style.borderBottom = '1px solid var(--scl-white-2)'
|
|
76
|
-
})
|
|
77
|
-
row.style.borderBottom = '1px solid var(--scl-blue)'
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
watch: {
|
|
83
|
-
value(newVal) {
|
|
84
|
-
this.innerValue = newVal
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
</script>
|
|
89
|
-
<style scoped>
|
|
90
|
-
@import "../../styles/index.less";
|
|
91
|
-
@import "styles/css/index.css";
|
|
92
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="edit-box" @click="changeColor">
|
|
3
|
+
<div class="edit-left-box">
|
|
4
|
+
<div class="edit-left-top">
|
|
5
|
+
<div v-if="required" class="edit-red-icon">
|
|
6
|
+
<lambo-required-red-star :required="required"></lambo-required-red-star>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="edit-title">{{ title }}</div>
|
|
9
|
+
</div>
|
|
10
|
+
<van-field v-model="innerValue" :autosize="true" :clearable="true" :maxlength="maxlength"
|
|
11
|
+
:placeholder="placeholder" :show-word-limit="showWordLimit" :type="type"
|
|
12
|
+
class="edit-lambo-input-textarea" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-if="icon" class="edit-right-icon">
|
|
15
|
+
<lambo-vector-icon :icon="icon"></lambo-vector-icon>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import redIcon from '../../assets/icon/required.png'
|
|
21
|
+
import LamboRequiredRedStar from '../../icon/lambo-required-red-star.vue'
|
|
22
|
+
import LamboVectorIcon from "../../icon/lambo-vector-icon.vue"
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'LamboEditInputTextarea',
|
|
26
|
+
components: {LamboVectorIcon, LamboRequiredRedStar},
|
|
27
|
+
model: {
|
|
28
|
+
prop: 'value',
|
|
29
|
+
event: 'input',
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
required: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
type: {
|
|
37
|
+
default: 'textarea',
|
|
38
|
+
},
|
|
39
|
+
maxlength: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
},
|
|
42
|
+
placeholder: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: '',
|
|
45
|
+
},
|
|
46
|
+
title: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
value: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: '',
|
|
53
|
+
},
|
|
54
|
+
showWordLimit: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
icon: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
requiredReadIcon: redIcon,
|
|
66
|
+
innerValue: this.value
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
changeColor() {
|
|
71
|
+
let searchRows = document.querySelectorAll('.edit-box')
|
|
72
|
+
Array.from(searchRows).forEach(function (row, index) {
|
|
73
|
+
row.addEventListener('click', function () {
|
|
74
|
+
Array.from(searchRows).forEach(function (row) {
|
|
75
|
+
row.style.borderBottom = '1px solid var(--scl-white-2)'
|
|
76
|
+
})
|
|
77
|
+
row.style.borderBottom = '1px solid var(--scl-blue)'
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
value(newVal) {
|
|
84
|
+
this.innerValue = newVal
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
<style scoped>
|
|
90
|
+
@import "../../styles/index.less";
|
|
91
|
+
@import "styles/css/index.css";
|
|
92
|
+
</style>
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="edit-box" @click="changeColor">
|
|
3
|
-
<div class="edit-left-box">
|
|
4
|
-
<div class="edit-left-top">
|
|
5
|
-
<div class="edit-red-icon" v-if="required">
|
|
6
|
-
<lambo-required-red-star :required="required"></lambo-required-red-star>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="edit-title">{{ title }}</div>
|
|
9
|
-
</div>
|
|
10
|
-
<van-field v-model="innerValue" :clearable="true" :maxlength="maxlength" :placeholder="placeholder"
|
|
11
|
-
class="edit-lambo-input" :show-word-limit="showWordLimit"
|
|
12
|
-
:type="type" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="edit-right-icon" v-if="icon">
|
|
15
|
-
<lambo-vector-icon :icon="icon"></lambo-vector-icon>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
<script>
|
|
20
|
-
import redIcon from '
|
|
21
|
-
import LamboRequiredRedStar from '
|
|
22
|
-
import LamboVectorIcon from "
|
|
23
|
-
|
|
24
|
-
export default {
|
|
25
|
-
name: 'LamboEditInput',
|
|
26
|
-
components: {LamboVectorIcon, LamboRequiredRedStar},
|
|
27
|
-
model: {
|
|
28
|
-
prop: 'value',
|
|
29
|
-
event: 'input',
|
|
30
|
-
},
|
|
31
|
-
props: {
|
|
32
|
-
required: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false,
|
|
35
|
-
},
|
|
36
|
-
type: {
|
|
37
|
-
default: 'text',
|
|
38
|
-
},
|
|
39
|
-
maxlength: {
|
|
40
|
-
type: [String, Number],
|
|
41
|
-
},
|
|
42
|
-
placeholder: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: '',
|
|
45
|
-
},
|
|
46
|
-
title: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: false,
|
|
49
|
-
},
|
|
50
|
-
value: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: '',
|
|
53
|
-
},
|
|
54
|
-
showWordLimit: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
icon: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
data() {
|
|
64
|
-
return {
|
|
65
|
-
requiredReadIcon: redIcon,
|
|
66
|
-
innerValue: this.value
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
methods: {
|
|
70
|
-
changeColor() {
|
|
71
|
-
let searchRows = document.querySelectorAll('.edit-box')
|
|
72
|
-
Array.from(searchRows).forEach(function (row, index) {
|
|
73
|
-
row.addEventListener('click', function () {
|
|
74
|
-
Array.from(searchRows).forEach(function (row) {
|
|
75
|
-
row.style.borderBottom = '1px solid var(--scl-white-2)'
|
|
76
|
-
})
|
|
77
|
-
row.style.borderBottom = '1px solid var(--scl-blue)'
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
watch: {
|
|
83
|
-
value(newVal) {
|
|
84
|
-
this.innerValue = newVal
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
</script>
|
|
89
|
-
<style scoped>
|
|
90
|
-
@import "../../styles/index.less";
|
|
91
|
-
@import "styles/css/index.css";
|
|
92
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="edit-box" @click="changeColor">
|
|
3
|
+
<div class="edit-left-box">
|
|
4
|
+
<div class="edit-left-top">
|
|
5
|
+
<div class="edit-red-icon" v-if="required">
|
|
6
|
+
<lambo-required-red-star :required="required"></lambo-required-red-star>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="edit-title">{{ title }}</div>
|
|
9
|
+
</div>
|
|
10
|
+
<van-field v-model="innerValue" :clearable="true" :maxlength="maxlength" :placeholder="placeholder"
|
|
11
|
+
class="edit-lambo-input" :show-word-limit="showWordLimit"
|
|
12
|
+
:type="type" label="" v-bind="$attrs" @input="$emit('input', $event)"/>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="edit-right-icon" v-if="icon">
|
|
15
|
+
<lambo-vector-icon :icon="icon"></lambo-vector-icon>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import redIcon from '../../assets/icon/required.png'
|
|
21
|
+
import LamboRequiredRedStar from '../../icon/lambo-required-red-star.vue'
|
|
22
|
+
import LamboVectorIcon from "../../icon/lambo-vector-icon.vue"
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'LamboEditInput',
|
|
26
|
+
components: {LamboVectorIcon, LamboRequiredRedStar},
|
|
27
|
+
model: {
|
|
28
|
+
prop: 'value',
|
|
29
|
+
event: 'input',
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
required: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
type: {
|
|
37
|
+
default: 'text',
|
|
38
|
+
},
|
|
39
|
+
maxlength: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
},
|
|
42
|
+
placeholder: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: '',
|
|
45
|
+
},
|
|
46
|
+
title: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
value: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: '',
|
|
53
|
+
},
|
|
54
|
+
showWordLimit: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
icon: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
requiredReadIcon: redIcon,
|
|
66
|
+
innerValue: this.value
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
changeColor() {
|
|
71
|
+
let searchRows = document.querySelectorAll('.edit-box')
|
|
72
|
+
Array.from(searchRows).forEach(function (row, index) {
|
|
73
|
+
row.addEventListener('click', function () {
|
|
74
|
+
Array.from(searchRows).forEach(function (row) {
|
|
75
|
+
row.style.borderBottom = '1px solid var(--scl-white-2)'
|
|
76
|
+
})
|
|
77
|
+
row.style.borderBottom = '1px solid var(--scl-blue)'
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
value(newVal) {
|
|
84
|
+
this.innerValue = newVal
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
<style scoped>
|
|
90
|
+
@import "../../styles/index.less";
|
|
91
|
+
@import "styles/css/index.css";
|
|
92
|
+
</style>
|