bri-components 1.4.65 → 1.4.67
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/package.json
CHANGED
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<!-- 日期、日期时间、年、月 -->
|
|
22
|
-
<template v-else>
|
|
22
|
+
<template v-else-if="['date', 'datetime', 'year', 'month'].includes(subType)">
|
|
23
23
|
<DatePicker
|
|
24
24
|
class="DshDate-edit"
|
|
25
|
-
:
|
|
25
|
+
:value="curVal"
|
|
26
26
|
:type="subType"
|
|
27
27
|
:disabled="disabled"
|
|
28
28
|
:options="options"
|
|
@@ -114,9 +114,7 @@
|
|
|
114
114
|
},
|
|
115
115
|
props: {},
|
|
116
116
|
data () {
|
|
117
|
-
return {
|
|
118
|
-
open: false
|
|
119
|
-
};
|
|
117
|
+
return {};
|
|
120
118
|
},
|
|
121
119
|
computed: {
|
|
122
120
|
selfPropsObj () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="DshDaterange">
|
|
3
3
|
<template v-if="['time'].includes(subType)">
|
|
4
|
-
<!--
|
|
4
|
+
<!-- 时间子类型 -->
|
|
5
5
|
<TimePicker
|
|
6
6
|
style="width: 100%;"
|
|
7
7
|
v-model="value[controlKey]"
|
|
@@ -14,59 +14,91 @@
|
|
|
14
14
|
></TimePicker>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<!--
|
|
17
|
+
<!-- 日期、日期时间、年、月 -->
|
|
18
18
|
<template v-else-if="['date', 'datetime', 'year', 'month'].includes(subType)">
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
<!-- 整体模式 -->
|
|
20
|
+
<template v-if="showMode === 'whole'">
|
|
21
|
+
<DatePicker
|
|
22
|
+
v-if="['date', 'datetime'].includes(subType)"
|
|
23
|
+
class="DshDate-edit"
|
|
24
|
+
:value="curValList"
|
|
25
|
+
:type="`${subType}range`"
|
|
26
|
+
:disabled="disabled"
|
|
27
|
+
:options="options"
|
|
28
|
+
:open="open"
|
|
29
|
+
:transfer="selfPropsObj._transfer"
|
|
30
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
31
|
+
@on-change="changeVal($event, 'List')"
|
|
32
|
+
@on-open-change="changeOpen($event, '')"
|
|
33
|
+
>
|
|
34
|
+
<dsh-control-input
|
|
35
|
+
:class="{
|
|
36
|
+
...commonClass,
|
|
37
|
+
'bri-control-nodata': this.$isEmptyData(this.curValList)
|
|
38
|
+
}"
|
|
39
|
+
:value="mulShowVal"
|
|
40
|
+
:disabled="disabled"
|
|
41
|
+
:propsObj="selfPropsObj"
|
|
42
|
+
@clear="clickClear([], 'List')"
|
|
43
|
+
@click.native="changeOpen(true, '')"
|
|
44
|
+
></dsh-control-input>
|
|
45
|
+
</DatePicker>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<!-- 默认模式 -->
|
|
49
|
+
<template v-else>
|
|
50
|
+
<DatePicker
|
|
51
|
+
class="DshDaterange-left"
|
|
52
|
+
:value="curVal0"
|
|
53
|
+
:type="subType"
|
|
37
54
|
:disabled="disabled"
|
|
38
|
-
:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
55
|
+
:options="options0"
|
|
56
|
+
:open="open0"
|
|
57
|
+
:transfer="selfPropsObj._transfer"
|
|
58
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
59
|
+
@on-change="changeVal($event, 0)"
|
|
60
|
+
@on-open-change="changeOpen($event, 0)"
|
|
61
|
+
>
|
|
62
|
+
<dsh-control-input
|
|
63
|
+
:class="{
|
|
64
|
+
...commonClass,
|
|
65
|
+
'bri-control-nodata': this.$isEmptyData(this.curVal0)
|
|
66
|
+
}"
|
|
67
|
+
:value="showVal0"
|
|
68
|
+
:disabled="disabled"
|
|
69
|
+
:propsObj="selfPropsObj"
|
|
70
|
+
@clear="clickClear('', 0)"
|
|
71
|
+
@click.native="changeOpen(true, 0)"
|
|
72
|
+
></dsh-control-input>
|
|
73
|
+
</DatePicker>
|
|
43
74
|
|
|
44
|
-
|
|
75
|
+
<span class="DshDaterange-center"> — </span>
|
|
45
76
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
:disabled="disabled"
|
|
51
|
-
:options="options1"
|
|
52
|
-
:open="open1"
|
|
53
|
-
:transfer="selfPropsObj._transfer"
|
|
54
|
-
:transfer-class-name="selfPropsObj._transferClassName"
|
|
55
|
-
@on-change="changeVal($event, 1)"
|
|
56
|
-
@on-open-change="changeOpen($event, 1)"
|
|
57
|
-
>
|
|
58
|
-
<dsh-control-input
|
|
59
|
-
:class="{
|
|
60
|
-
...commonClass,
|
|
61
|
-
'bri-control-nodata': this.$isEmptyData(this.curVal1)
|
|
62
|
-
}"
|
|
63
|
-
:value="showVal1"
|
|
77
|
+
<DatePicker
|
|
78
|
+
class="DshDaterange-right"
|
|
79
|
+
:value="curVal1"
|
|
80
|
+
:type="subType"
|
|
64
81
|
:disabled="disabled"
|
|
65
|
-
:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
:options="options1"
|
|
83
|
+
:open="open1"
|
|
84
|
+
:transfer="selfPropsObj._transfer"
|
|
85
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
86
|
+
@on-change="changeVal($event, 1)"
|
|
87
|
+
@on-open-change="changeOpen($event, 1)"
|
|
88
|
+
>
|
|
89
|
+
<dsh-control-input
|
|
90
|
+
:class="{
|
|
91
|
+
...commonClass,
|
|
92
|
+
'bri-control-nodata': this.$isEmptyData(this.curVal1)
|
|
93
|
+
}"
|
|
94
|
+
:value="showVal1"
|
|
95
|
+
:disabled="disabled"
|
|
96
|
+
:propsObj="selfPropsObj"
|
|
97
|
+
@clear="clickClear('', 1)"
|
|
98
|
+
@click.native="changeOpen(true, 1)"
|
|
99
|
+
></dsh-control-input>
|
|
100
|
+
</DatePicker>
|
|
101
|
+
</template>
|
|
70
102
|
</template>
|
|
71
103
|
</div>
|
|
72
104
|
</template>
|
|
@@ -82,50 +114,29 @@
|
|
|
82
114
|
components: {},
|
|
83
115
|
props: {},
|
|
84
116
|
data () {
|
|
85
|
-
return {
|
|
86
|
-
open0: false,
|
|
87
|
-
open1: false
|
|
88
|
-
};
|
|
117
|
+
return {};
|
|
89
118
|
},
|
|
90
119
|
computed: {
|
|
91
120
|
selfPropsObj () {
|
|
92
121
|
return {
|
|
93
122
|
// _icon: "ios-calendar-outline",
|
|
123
|
+
_showMode: "default", // "default", "whole"
|
|
94
124
|
|
|
95
125
|
...this.basePropsObj
|
|
96
126
|
};
|
|
97
127
|
},
|
|
128
|
+
showMode () {
|
|
129
|
+
return this.selfPropsObj._showMode;
|
|
130
|
+
},
|
|
98
131
|
|
|
132
|
+
options () {
|
|
133
|
+
return this.getOptions();
|
|
134
|
+
},
|
|
99
135
|
options0 () {
|
|
100
136
|
return this.getOptions(0);
|
|
101
137
|
},
|
|
102
138
|
options1 () {
|
|
103
139
|
return this.getOptions(1);
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
curVal0: {
|
|
107
|
-
get () {
|
|
108
|
-
return this.getVal(this.value[this.controlKey][0]);
|
|
109
|
-
},
|
|
110
|
-
set (val) {
|
|
111
|
-
this.$set(this.value, this.controlKey, [this.transformVal(val), this.value[this.controlKey][1] || ""]);
|
|
112
|
-
this.change();
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
curVal1: {
|
|
116
|
-
get () {
|
|
117
|
-
return this.getVal(this.value[this.controlKey][1]);
|
|
118
|
-
},
|
|
119
|
-
set (val) {
|
|
120
|
-
this.$set(this.value, this.controlKey, [this.value[this.controlKey][0] || "", this.transformVal(val)]);
|
|
121
|
-
this.change();
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
showVal0 () {
|
|
125
|
-
return this.getShowVal(this.curVal0);
|
|
126
|
-
},
|
|
127
|
-
showVal1 () {
|
|
128
|
-
return this.getShowVal(this.curVal1);
|
|
129
140
|
}
|
|
130
141
|
},
|
|
131
142
|
created () {},
|
|
@@ -19,6 +19,8 @@ const componentNameMap = {
|
|
|
19
19
|
serialNumber: "DshInput",
|
|
20
20
|
number: "DshNumber",
|
|
21
21
|
date: "DshDate",
|
|
22
|
+
daterange: "DshDaterange",
|
|
23
|
+
|
|
22
24
|
switch: "DshSwitch",
|
|
23
25
|
select: "DshSelect",
|
|
24
26
|
checkbox: "DshCheckbox",
|
|
@@ -26,6 +28,7 @@ const componentNameMap = {
|
|
|
26
28
|
regions: "DshCascader",
|
|
27
29
|
cascader: "DshCascader",
|
|
28
30
|
cascaders: "DshCascader",
|
|
31
|
+
|
|
29
32
|
file: "BriUpload",
|
|
30
33
|
coordinates: "DshCoordinates",
|
|
31
34
|
editor: "DshEditor",
|
|
@@ -54,6 +57,7 @@ const pathMap = {
|
|
|
54
57
|
// DshInput: "./base/DshInput/DshInput.vue", // 全局已注册
|
|
55
58
|
// DshNumber: "./base/DshNumber/DshNumber.vue", // 全局已注册
|
|
56
59
|
DshDate: "./base/DshDate/DshDate.vue",
|
|
60
|
+
DshDaterange: "./base/DshDate/DshDaterange.vue",
|
|
57
61
|
DshSwitch: "./base/DshSwitch/DshSwitch.vue",
|
|
58
62
|
// DshSelect: "./base/DshSelect/DshSelect.vue", // 全局已注册
|
|
59
63
|
// DshCheckbox: "./base/DshSelect/DshCheckbox.vue", // 全局已注册
|
|
@@ -8,14 +8,18 @@ export default {
|
|
|
8
8
|
components: {},
|
|
9
9
|
props: {},
|
|
10
10
|
data () {
|
|
11
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
open: false,
|
|
13
|
+
open0: false,
|
|
14
|
+
open1: false
|
|
15
|
+
};
|
|
12
16
|
},
|
|
13
17
|
computed: {
|
|
14
18
|
basePropsObj () {
|
|
15
19
|
return {
|
|
16
20
|
_dateType: "date", // 子类型5种,"date", "datetime", "year", "month", "time"
|
|
17
21
|
|
|
18
|
-
_useDynDate:
|
|
22
|
+
_useDynDate: true, // 使用动态时间
|
|
19
23
|
_dynDateType: undefined, // 使用什么类型的动态时间,"start","end"
|
|
20
24
|
_dynDateKeys: [], // 仅使用一些指定的动态时间
|
|
21
25
|
_dynSearchKeys: [], // 筛选时-仅使用一些指定的动态时间
|
|
@@ -55,6 +59,36 @@ export default {
|
|
|
55
59
|
.filter(dynDateItem => !!dynDateItem)
|
|
56
60
|
: dynDateData
|
|
57
61
|
).filter(dynDateItem => dynDateItem.dateTypes.includes(this.subType));
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
curVal0: {
|
|
65
|
+
get () {
|
|
66
|
+
return this.getVal(this.value[this.controlKey][0]);
|
|
67
|
+
},
|
|
68
|
+
set (val) {
|
|
69
|
+
this.$set(this.value, this.controlKey, [this.transformVal(val), this.value[this.controlKey][1] || ""]);
|
|
70
|
+
this.change();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
curVal1: {
|
|
74
|
+
get () {
|
|
75
|
+
return this.getVal(this.value[this.controlKey][1]);
|
|
76
|
+
},
|
|
77
|
+
set (val) {
|
|
78
|
+
this.$set(this.value, this.controlKey, [this.value[this.controlKey][0] || "", this.transformVal(val)]);
|
|
79
|
+
this.change();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
showVal0 () {
|
|
83
|
+
return this.getShowVal(this.curVal0);
|
|
84
|
+
},
|
|
85
|
+
showVal1 () {
|
|
86
|
+
return this.getShowVal(this.curVal1);
|
|
87
|
+
},
|
|
88
|
+
mulShowVal () {
|
|
89
|
+
return this.$isEmptyData(this.curValList[0]) && this.$isEmptyData(this.curValList[1])
|
|
90
|
+
? this.emptyShowVal
|
|
91
|
+
: `${this.$transformToDateStr(this.curValList[0], "-", this.subType)} - ${this.$transformToDateStr(this.curValList[1], "-", this.subType)}`;
|
|
58
92
|
}
|
|
59
93
|
},
|
|
60
94
|
created () { },
|
|
@@ -80,26 +114,20 @@ export default {
|
|
|
80
114
|
|
|
81
115
|
/* -------- 方法 ------- */
|
|
82
116
|
getVal (val) {
|
|
83
|
-
return this
|
|
117
|
+
return this.$isDynDate(val)
|
|
84
118
|
? val
|
|
85
|
-
: this.$
|
|
119
|
+
: this.$transformToDateObj(val);
|
|
86
120
|
},
|
|
87
121
|
transformVal (val) {
|
|
88
|
-
return this
|
|
122
|
+
return this.$isDynDate(val)
|
|
89
123
|
? val
|
|
90
124
|
: this.$transformToDateStr(val, "-", this.subType);
|
|
91
125
|
},
|
|
92
126
|
getShowVal (val) {
|
|
93
|
-
return this
|
|
127
|
+
return this.$isDynDate(val)
|
|
94
128
|
? (this.dynDateList.find(dynDateItem => dynDateItem._key === val) || { name: `"${val}"动态时间不存在` }).name
|
|
95
129
|
: this.$transformToDateStr(val, "-", this.subType);
|
|
96
130
|
},
|
|
97
|
-
isDynDate (val) {
|
|
98
|
-
return val && typeof val === "string" && (
|
|
99
|
-
this.dynDateList.some(dynDateItem => dynDateItem._key === val) ||
|
|
100
|
-
["dyn", "year", "month", "days", "start", "end"].some(str => val.includes(str))
|
|
101
|
-
);
|
|
102
|
-
},
|
|
103
131
|
|
|
104
132
|
getShortCuts (index) {
|
|
105
133
|
return this.useDynDate
|