@tongfun/tf-widget 0.1.21 → 0.1.22
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/README.md +49 -49
- package/lib/tf-widget.common.js +547 -503
- package/lib/tf-widget.css +1 -1
- package/lib/tf-widget.umd.js +547 -503
- package/lib/tf-widget.umd.min.js +4 -4
- package/package/svg-icon/index.js +8 -8
- package/package/svg-icon/src/SvgIcon.vue +59 -59
- package/package/t-data-list/index.js +6 -6
- package/package/t-data-list/main.vue +193 -193
- package/package/t-data-list/src/condition-input/basic.vue +31 -31
- package/package/t-data-list/src/condition-input/date.vue +106 -106
- package/package/t-data-list/src/condition-input/index.vue +100 -100
- package/package/t-data-list/src/condition-input/input.vue +31 -31
- package/package/t-data-list/src/condition-input/number.vue +115 -115
- package/package/t-data-list/src/condition-input/select.vue +86 -86
- package/package/t-data-list/src/js/fieldTypeEnum.js +10 -10
- package/package/t-data-list/src/js/operatorEnum.js +108 -108
- package/package/t-data-list/src/js/qureyParamsEnum.js +4 -4
- package/package/t-data-list/src/js/util.js +34 -34
- package/package/t-data-list/src/mixins/button-controll-mixin.js +93 -93
- package/package/t-data-list/src/pushdown/push-down.vue +158 -158
- package/package/t-data-list/src/t-list-search.vue +36 -36
- package/package/t-data-list/src/t-plan/condition-always-item.vue +143 -143
- package/package/t-data-list/src/t-plan/condition-mult-item.vue +222 -222
- package/package/t-data-list/src/t-plan/index.vue +195 -195
- package/package/t-data-list/src/t-plan/plan-content.vue +389 -389
- package/package/t-data-list/src/t-table/index.vue +129 -129
- package/package/t-data-list/src/t-table/table-group-item-edit.vue +238 -238
- package/package/t-data-list/src/t-table/table-group-item.vue +87 -87
- package/package/t-data-list/src/t-table/table-group.vue +180 -180
- package/package/t-data-list/src/t-table/table-records-header-popover.vue +246 -246
- package/package/t-data-list/src/t-table/table-records-selected.vue +159 -159
- package/package/t-data-list/src/t-table/table-records.vue +337 -337
- package/package/t-input/children/address.vue +101 -101
- package/package/t-input/children/basic-display.vue +41 -41
- package/package/t-input/children/basic.vue +253 -253
- package/package/t-input/children/date.vue +89 -89
- package/package/t-input/children/group-components/group-dialog.vue +344 -344
- package/package/t-input/children/group.vue +126 -126
- package/package/t-input/children/input.vue +72 -72
- package/package/t-input/children/number.vue +74 -74
- package/package/t-input/children/select.vue +89 -89
- package/package/t-input/children/tfile/fiile-enclosure.vue +233 -233
- package/package/t-input/index.js +7 -7
- package/package/t-input/index.vue +337 -337
- package/package/t-input/tInputCache.js +24 -24
- package/package/tf-icon-picker/README.md +7 -7
- package/package/tf-icon-picker/index.js +8 -8
- package/package/tf-icon-picker/src/tf-icon-picker.vue +266 -266
- package/package/tf-layout/README.md +115 -115
- package/package/tf-layout/index.js +8 -8
- package/package/tf-layout/src/components/tf-labelbar.vue +394 -394
- package/package/tf-layout/src/components/tf-menu.vue +180 -180
- package/package/tf-layout/src/components/tf-right-menu.vue +89 -89
- package/package/tf-layout/src/components/tf-rotate-box.vue +50 -50
- package/package/tf-layout/src/tf-layout.vue +140 -140
- package/package/tf-widget/index.js +8 -8
- package/package/tf-widget/src/assets/common-input.less +10 -10
- package/package/tf-widget/src/children/basic-data/basic-data.vue +361 -361
- package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +1087 -1087
- package/package/tf-widget/src/children/basic-data/dependcy/common-table.vue +750 -750
- package/package/tf-widget/src/children/basic-data/dependcy/condition-filter.vue +519 -519
- package/package/tf-widget/src/children/basic-data/dependcy/pagination.vue +93 -93
- package/package/tf-widget/src/children/basic-data/dependcy/table-control.vue +240 -240
- package/package/tf-widget/src/children/basic-data/dependcy/view-picture.vue +108 -108
- package/package/tf-widget/src/children/date-time.vue +103 -103
- package/package/tf-widget/src/children/date.vue +103 -103
- package/package/tf-widget/src/children/decimal.vue +115 -115
- package/package/tf-widget/src/children/integer.vue +104 -104
- package/package/tf-widget/src/children/property.vue +59 -59
- package/package/tf-widget/src/children/single-line-text.vue +82 -82
- package/package/tf-widget/src/children/small-pictures.vue +223 -223
- package/package/tf-widget/src/children/text-area.vue +74 -74
- package/package/tf-widget/src/children/tf-select.vue +113 -113
- package/package/tf-widget/src/tf-widget.vue +175 -175
- package/package.json +44 -44
- package/src/api/edit.js +97 -97
- package/src/api/file-enclosure.js +26 -26
- package/src/api/push-down.js +19 -19
- package/src/api/table.js +294 -294
- package/src/api/tableV3.js +166 -160
- package/src/assets/images/icons/index.js +9 -9
- package/src/assets/images/icons/svg/add.svg +5 -5
- package/src/assets/images/icons/svg/push-down.svg +1 -1
- package/src/assets/images/icons/svg/remove.svg +1 -1
- package/src/assets/styles/common-table.less +202 -202
- package/src/directives/debounce.js +24 -24
- package/src/index.js +31 -31
- package/src/mixins/t-data-query-mixin.js +290 -290
- package/src/utils/auth.js +22 -22
- package/src/utils/request.js +42 -42
- package/src/utils/stato-anormale.js +59 -59
- package/src/utils/utils.js +109 -109
- package/src/utils/validate.js +84 -84
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
title="查看图片"
|
|
4
|
-
:visible.sync="dialogVisible"
|
|
5
|
-
width="50%"
|
|
6
|
-
:append-to-body="true"
|
|
7
|
-
:before-close="handleCloseMethod"
|
|
8
|
-
>
|
|
9
|
-
<div class="picture-warp">
|
|
10
|
-
<el-carousel trigger="click" :autoplay="false">
|
|
11
|
-
<el-carousel-item v-for="item in pictures" :key="item">
|
|
12
|
-
<div>
|
|
13
|
-
<el-image :src="item" alt="" fit="contain" />
|
|
14
|
-
</div>
|
|
15
|
-
</el-carousel-item>
|
|
16
|
-
</el-carousel>
|
|
17
|
-
</div>
|
|
18
|
-
<span slot="footer" class="dialog-footer">
|
|
19
|
-
<el-button class="common-header-button" type="primary" @click="handelClose">取 消</el-button>
|
|
20
|
-
<el-button class="common-header-button button-sure" type="primary" @click="handelClose">确 定</el-button>
|
|
21
|
-
</span>
|
|
22
|
-
</el-dialog>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script>
|
|
26
|
-
export default {
|
|
27
|
-
props: {
|
|
28
|
-
dialogVisible: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
|
-
viewPictureData: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: ''
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
data () {
|
|
38
|
-
return {
|
|
39
|
-
pictures: []
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
watch: {
|
|
43
|
-
viewPictureData: function (newVal, oldVal) {
|
|
44
|
-
this.pictures = newVal.split(',')
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
methods: {
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 弹框关闭前
|
|
51
|
-
*/
|
|
52
|
-
handleCloseMethod (done) {
|
|
53
|
-
this.$emit('handelClose', false)
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* 弹框关闭
|
|
58
|
-
*/
|
|
59
|
-
handelClose () {
|
|
60
|
-
this.$emit('handelClose', false)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
</script>
|
|
67
|
-
<style lang='less' scoped>
|
|
68
|
-
@import "@/assets/styles/common-table.less";
|
|
69
|
-
/deep/ .el-dialog__body{
|
|
70
|
-
height: 50vh;
|
|
71
|
-
overflow: auto;
|
|
72
|
-
padding: 1vh 1vw;
|
|
73
|
-
box-sizing: border-box;
|
|
74
|
-
.picture-warp{
|
|
75
|
-
height: 100%;
|
|
76
|
-
.el-carousel{
|
|
77
|
-
height: 100%;
|
|
78
|
-
.el-carousel__container{
|
|
79
|
-
height: 100% !important;
|
|
80
|
-
}
|
|
81
|
-
.el-carousel__item{
|
|
82
|
-
height: 100% !important;
|
|
83
|
-
>div{
|
|
84
|
-
height: 100% !important;
|
|
85
|
-
display: flex;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
::v-deep .el-button{
|
|
94
|
-
width: 2.5vw;
|
|
95
|
-
height: 2.222vh;
|
|
96
|
-
opacity: 1;
|
|
97
|
-
background: #0c4c8e;
|
|
98
|
-
color: #fff;
|
|
99
|
-
padding: 0;
|
|
100
|
-
border-radius: 2px 0 0 2px;
|
|
101
|
-
border: 1px solid #0c4c8e;
|
|
102
|
-
margin-right: 0;
|
|
103
|
-
}
|
|
104
|
-
.button-sure{
|
|
105
|
-
margin-left: 1vw !important;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
title="查看图片"
|
|
4
|
+
:visible.sync="dialogVisible"
|
|
5
|
+
width="50%"
|
|
6
|
+
:append-to-body="true"
|
|
7
|
+
:before-close="handleCloseMethod"
|
|
8
|
+
>
|
|
9
|
+
<div class="picture-warp">
|
|
10
|
+
<el-carousel trigger="click" :autoplay="false">
|
|
11
|
+
<el-carousel-item v-for="item in pictures" :key="item">
|
|
12
|
+
<div>
|
|
13
|
+
<el-image :src="item" alt="" fit="contain" />
|
|
14
|
+
</div>
|
|
15
|
+
</el-carousel-item>
|
|
16
|
+
</el-carousel>
|
|
17
|
+
</div>
|
|
18
|
+
<span slot="footer" class="dialog-footer">
|
|
19
|
+
<el-button class="common-header-button" type="primary" @click="handelClose">取 消</el-button>
|
|
20
|
+
<el-button class="common-header-button button-sure" type="primary" @click="handelClose">确 定</el-button>
|
|
21
|
+
</span>
|
|
22
|
+
</el-dialog>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
props: {
|
|
28
|
+
dialogVisible: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
viewPictureData: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
data () {
|
|
38
|
+
return {
|
|
39
|
+
pictures: []
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
watch: {
|
|
43
|
+
viewPictureData: function (newVal, oldVal) {
|
|
44
|
+
this.pictures = newVal.split(',')
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 弹框关闭前
|
|
51
|
+
*/
|
|
52
|
+
handleCloseMethod (done) {
|
|
53
|
+
this.$emit('handelClose', false)
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 弹框关闭
|
|
58
|
+
*/
|
|
59
|
+
handelClose () {
|
|
60
|
+
this.$emit('handelClose', false)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
</script>
|
|
67
|
+
<style lang='less' scoped>
|
|
68
|
+
@import "@/assets/styles/common-table.less";
|
|
69
|
+
/deep/ .el-dialog__body{
|
|
70
|
+
height: 50vh;
|
|
71
|
+
overflow: auto;
|
|
72
|
+
padding: 1vh 1vw;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
.picture-warp{
|
|
75
|
+
height: 100%;
|
|
76
|
+
.el-carousel{
|
|
77
|
+
height: 100%;
|
|
78
|
+
.el-carousel__container{
|
|
79
|
+
height: 100% !important;
|
|
80
|
+
}
|
|
81
|
+
.el-carousel__item{
|
|
82
|
+
height: 100% !important;
|
|
83
|
+
>div{
|
|
84
|
+
height: 100% !important;
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
::v-deep .el-button{
|
|
94
|
+
width: 2.5vw;
|
|
95
|
+
height: 2.222vh;
|
|
96
|
+
opacity: 1;
|
|
97
|
+
background: #0c4c8e;
|
|
98
|
+
color: #fff;
|
|
99
|
+
padding: 0;
|
|
100
|
+
border-radius: 2px 0 0 2px;
|
|
101
|
+
border: 1px solid #0c4c8e;
|
|
102
|
+
margin-right: 0;
|
|
103
|
+
}
|
|
104
|
+
.button-sure{
|
|
105
|
+
margin-left: 1vw !important;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
</style>
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-date-picker
|
|
3
|
-
:value="value"
|
|
4
|
-
type="datetime"
|
|
5
|
-
:placeholder="placeholder"
|
|
6
|
-
value-format="yyyy-MM-dd HH:mm:ss"
|
|
7
|
-
format="yyyy-MM-dd HH:mm:ss"
|
|
8
|
-
:disabled="JSON.parse(disabled)"
|
|
9
|
-
:clearable="false"
|
|
10
|
-
@input="handleInput"
|
|
11
|
-
v-on="$listeners"
|
|
12
|
-
/>
|
|
13
|
-
</template>
|
|
14
|
-
<script>
|
|
15
|
-
export default {
|
|
16
|
-
components: {
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
value: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: ''
|
|
22
|
-
},
|
|
23
|
-
disabled: {
|
|
24
|
-
type: [Boolean, String],
|
|
25
|
-
default: false
|
|
26
|
-
},
|
|
27
|
-
placeholder: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: ''
|
|
30
|
-
},
|
|
31
|
-
defaultValue: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: ''
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
data () {
|
|
37
|
-
return {
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
watch: {
|
|
41
|
-
value () {
|
|
42
|
-
if (!this.value) {
|
|
43
|
-
this.handleInput(null)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
created () {
|
|
48
|
-
if (this.defaultValue && this.defaultValue !== 'now' && !this.value) {
|
|
49
|
-
return this.handleInput(this.defaultValue)
|
|
50
|
-
}
|
|
51
|
-
if (this.defaultValue && this.defaultValue === 'now' && !this.value) {
|
|
52
|
-
return this.handleInput(this.getNowTime())
|
|
53
|
-
}
|
|
54
|
-
// 时间类型初始化成null
|
|
55
|
-
if (!this.value) {
|
|
56
|
-
this.handleInput(null)
|
|
57
|
-
} else {
|
|
58
|
-
this.handleInput(this.value)
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
methods: {
|
|
62
|
-
handleInput (v) {
|
|
63
|
-
this.$emit('input', v)
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
// 获取当前日期
|
|
67
|
-
getNowTime () {
|
|
68
|
-
const time = new Date()
|
|
69
|
-
const year = time.getFullYear()
|
|
70
|
-
const month = (time.getMonth() + 1).toString().padStart(2, '0')
|
|
71
|
-
const date = (time.getDate()).toString().padStart(2, '0')
|
|
72
|
-
const hours = (time.getHours()).toString().padStart(2, '0')
|
|
73
|
-
const minute = (time.getMinutes()).toString().padStart(2, '0')
|
|
74
|
-
const second = (time.getSeconds()).toString().padStart(2, '0')
|
|
75
|
-
return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<style lang="less" scoped>
|
|
83
|
-
@import '../assets/common-input.less';
|
|
84
|
-
::v-deep .el-input__inner{
|
|
85
|
-
width: 100%;
|
|
86
|
-
border: none;
|
|
87
|
-
border-bottom: 1px solid #DCDCDC;
|
|
88
|
-
border-radius: 0;
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
::v-deep .el-icon-time {
|
|
92
|
-
// background: red;
|
|
93
|
-
background-size: 20px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
::v-deep .el-icon-time:before {
|
|
97
|
-
content: "\e71f";
|
|
98
|
-
font-size: 16px;
|
|
99
|
-
position: absolute;
|
|
100
|
-
left: 760% !important;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker
|
|
3
|
+
:value="value"
|
|
4
|
+
type="datetime"
|
|
5
|
+
:placeholder="placeholder"
|
|
6
|
+
value-format="yyyy-MM-dd HH:mm:ss"
|
|
7
|
+
format="yyyy-MM-dd HH:mm:ss"
|
|
8
|
+
:disabled="JSON.parse(disabled)"
|
|
9
|
+
:clearable="false"
|
|
10
|
+
@input="handleInput"
|
|
11
|
+
v-on="$listeners"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
components: {
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
value: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: [Boolean, String],
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
placeholder: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
defaultValue: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ''
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
data () {
|
|
37
|
+
return {
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
watch: {
|
|
41
|
+
value () {
|
|
42
|
+
if (!this.value) {
|
|
43
|
+
this.handleInput(null)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
created () {
|
|
48
|
+
if (this.defaultValue && this.defaultValue !== 'now' && !this.value) {
|
|
49
|
+
return this.handleInput(this.defaultValue)
|
|
50
|
+
}
|
|
51
|
+
if (this.defaultValue && this.defaultValue === 'now' && !this.value) {
|
|
52
|
+
return this.handleInput(this.getNowTime())
|
|
53
|
+
}
|
|
54
|
+
// 时间类型初始化成null
|
|
55
|
+
if (!this.value) {
|
|
56
|
+
this.handleInput(null)
|
|
57
|
+
} else {
|
|
58
|
+
this.handleInput(this.value)
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
methods: {
|
|
62
|
+
handleInput (v) {
|
|
63
|
+
this.$emit('input', v)
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
// 获取当前日期
|
|
67
|
+
getNowTime () {
|
|
68
|
+
const time = new Date()
|
|
69
|
+
const year = time.getFullYear()
|
|
70
|
+
const month = (time.getMonth() + 1).toString().padStart(2, '0')
|
|
71
|
+
const date = (time.getDate()).toString().padStart(2, '0')
|
|
72
|
+
const hours = (time.getHours()).toString().padStart(2, '0')
|
|
73
|
+
const minute = (time.getMinutes()).toString().padStart(2, '0')
|
|
74
|
+
const second = (time.getSeconds()).toString().padStart(2, '0')
|
|
75
|
+
return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="less" scoped>
|
|
83
|
+
@import '../assets/common-input.less';
|
|
84
|
+
::v-deep .el-input__inner{
|
|
85
|
+
width: 100%;
|
|
86
|
+
border: none;
|
|
87
|
+
border-bottom: 1px solid #DCDCDC;
|
|
88
|
+
border-radius: 0;
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
::v-deep .el-icon-time {
|
|
92
|
+
// background: red;
|
|
93
|
+
background-size: 20px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
::v-deep .el-icon-time:before {
|
|
97
|
+
content: "\e71f";
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
position: absolute;
|
|
100
|
+
left: 760% !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
</style>
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-date-picker
|
|
3
|
-
ref="date"
|
|
4
|
-
:value="value"
|
|
5
|
-
type="date"
|
|
6
|
-
:placeholder="placeholder"
|
|
7
|
-
value-format="yyyy-MM-dd"
|
|
8
|
-
format="yyyy-MM-dd"
|
|
9
|
-
:disabled="JSON.parse(disabled)"
|
|
10
|
-
:clearable="false"
|
|
11
|
-
@input="handleInput"
|
|
12
|
-
v-on="$listeners"
|
|
13
|
-
/>
|
|
14
|
-
</template>
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
components: {
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
value: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: ''
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
type: [Boolean, String],
|
|
27
|
-
default: false
|
|
28
|
-
},
|
|
29
|
-
placeholder: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: ''
|
|
32
|
-
},
|
|
33
|
-
defaultValue: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ''
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
data () {
|
|
39
|
-
return {
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
watch: {
|
|
43
|
-
value () {
|
|
44
|
-
if (!this.value) {
|
|
45
|
-
this.handleInput(null)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
created () {
|
|
50
|
-
if (this.defaultValue && this.defaultValue !== 'now' && !this.value) {
|
|
51
|
-
return this.handleInput(this.defaultValue)
|
|
52
|
-
}
|
|
53
|
-
if (this.defaultValue && this.defaultValue === 'now' && !this.value) {
|
|
54
|
-
return this.handleInput(this.getNowTime())
|
|
55
|
-
}
|
|
56
|
-
// 时间类型初始化成null
|
|
57
|
-
if (!this.value) {
|
|
58
|
-
this.handleInput(null)
|
|
59
|
-
} else {
|
|
60
|
-
this.handleInput(this.value)
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
methods: {
|
|
64
|
-
handleInput (v) {
|
|
65
|
-
this.$emit('input', v)
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
// 获取当前日期
|
|
69
|
-
getNowTime () {
|
|
70
|
-
const time = new Date()
|
|
71
|
-
const year = time.getFullYear()
|
|
72
|
-
const month = (time.getMonth() + 1).toString().padStart(2, '0')
|
|
73
|
-
const date = (time.getDate()).toString().padStart(2, '0')
|
|
74
|
-
return year + '-' + month + '-' + date
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<style lang="less" scoped>
|
|
82
|
-
@import '../assets/common-input.less';
|
|
83
|
-
::v-deep .el-input__inner{
|
|
84
|
-
width: 100%;
|
|
85
|
-
border: none;
|
|
86
|
-
border-bottom: 1px solid #DCDCDC;
|
|
87
|
-
padding-left: 15px !important;
|
|
88
|
-
border-radius: 0;
|
|
89
|
-
box-sizing: border-box;
|
|
90
|
-
}
|
|
91
|
-
::v-deep .el-icon-date {
|
|
92
|
-
// background: red;
|
|
93
|
-
background-size: 20px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
::v-deep .el-icon-date:before {
|
|
97
|
-
content: "\e78e";
|
|
98
|
-
font-size: 16px;
|
|
99
|
-
position: absolute;
|
|
100
|
-
left: 760% !important;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker
|
|
3
|
+
ref="date"
|
|
4
|
+
:value="value"
|
|
5
|
+
type="date"
|
|
6
|
+
:placeholder="placeholder"
|
|
7
|
+
value-format="yyyy-MM-dd"
|
|
8
|
+
format="yyyy-MM-dd"
|
|
9
|
+
:disabled="JSON.parse(disabled)"
|
|
10
|
+
:clearable="false"
|
|
11
|
+
@input="handleInput"
|
|
12
|
+
v-on="$listeners"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
components: {
|
|
18
|
+
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
value: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
type: [Boolean, String],
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
placeholder: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
defaultValue: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ''
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
data () {
|
|
39
|
+
return {
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
watch: {
|
|
43
|
+
value () {
|
|
44
|
+
if (!this.value) {
|
|
45
|
+
this.handleInput(null)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
created () {
|
|
50
|
+
if (this.defaultValue && this.defaultValue !== 'now' && !this.value) {
|
|
51
|
+
return this.handleInput(this.defaultValue)
|
|
52
|
+
}
|
|
53
|
+
if (this.defaultValue && this.defaultValue === 'now' && !this.value) {
|
|
54
|
+
return this.handleInput(this.getNowTime())
|
|
55
|
+
}
|
|
56
|
+
// 时间类型初始化成null
|
|
57
|
+
if (!this.value) {
|
|
58
|
+
this.handleInput(null)
|
|
59
|
+
} else {
|
|
60
|
+
this.handleInput(this.value)
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
methods: {
|
|
64
|
+
handleInput (v) {
|
|
65
|
+
this.$emit('input', v)
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// 获取当前日期
|
|
69
|
+
getNowTime () {
|
|
70
|
+
const time = new Date()
|
|
71
|
+
const year = time.getFullYear()
|
|
72
|
+
const month = (time.getMonth() + 1).toString().padStart(2, '0')
|
|
73
|
+
const date = (time.getDate()).toString().padStart(2, '0')
|
|
74
|
+
return year + '-' + month + '-' + date
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="less" scoped>
|
|
82
|
+
@import '../assets/common-input.less';
|
|
83
|
+
::v-deep .el-input__inner{
|
|
84
|
+
width: 100%;
|
|
85
|
+
border: none;
|
|
86
|
+
border-bottom: 1px solid #DCDCDC;
|
|
87
|
+
padding-left: 15px !important;
|
|
88
|
+
border-radius: 0;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
}
|
|
91
|
+
::v-deep .el-icon-date {
|
|
92
|
+
// background: red;
|
|
93
|
+
background-size: 20px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
::v-deep .el-icon-date:before {
|
|
97
|
+
content: "\e78e";
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
position: absolute;
|
|
100
|
+
left: 760% !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
</style>
|