bri-components 1.4.66 → 1.4.68

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.4.66",
3
+ "version": "1.4.68",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -19,7 +19,7 @@
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"
@@ -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
- <DatePicker
20
- class="DshDaterange-left"
21
- :value="curVal0"
22
- :type="subType"
23
- :disabled="disabled"
24
- :options="options0"
25
- :open="open0"
26
- :transfer="selfPropsObj._transfer"
27
- :transfer-class-name="selfPropsObj._transferClassName"
28
- @on-change="changeVal($event, 0)"
29
- @on-open-change="changeOpen($event, 0)"
30
- >
31
- <dsh-control-input
32
- :class="{
33
- ...commonClass,
34
- 'bri-control-nodata': this.$isEmptyData(this.curVal0)
35
- }"
36
- :value="showVal0"
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
- :propsObj="selfPropsObj"
39
- @clear="clickClear('', 0)"
40
- @click.native="changeOpen(true, 0)"
41
- ></dsh-control-input>
42
- </DatePicker>
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
- <span class="DshDaterange-center"> — </span>
75
+ <span class="DshDaterange-center"> — </span>
45
76
 
46
- <DatePicker
47
- class="DshDaterange-right"
48
- :value="curVal1"
49
- :type="subType"
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
- :propsObj="selfPropsObj"
66
- @clear="clickClear('', 1)"
67
- @click.native="changeOpen(true, 1)"
68
- ></dsh-control-input>
69
- </DatePicker>
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", // 全局已注册
@@ -122,7 +122,7 @@ export default {
122
122
  multipleMode () {
123
123
  return this.isInDftSearch || this.isInSearch
124
124
  ? true
125
- : ["checkbox", "regions", "cascaders", "labels", "refCheckbox"].includes(this.controlType)
125
+ : ["daterange", "checkbox", "regions", "cascaders", "labels", "refCheckbox"].includes(this.controlType)
126
126
  ? true
127
127
  : !!this.selfPropsObj && !!this.selfPropsObj._multiple;
128
128
  },
@@ -8,7 +8,11 @@ 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 () {
@@ -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 () { },