bri-components 1.4.69 → 1.4.70

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.69",
3
+ "version": "1.4.70",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -527,7 +527,7 @@
527
527
  endKey: getDate((step - 1) * 24 + 23.9999),
528
528
  name: "今天",
529
529
  colspan: 1,
530
- fullName: this.dateFormat(getDate(0), "yyyy-MM-dd"),
530
+ fullName: this.$dateFormat(getDate(0), "yyyy-MM-dd"),
531
531
  style: { color: this.simpleDataColor, fontWeight: 500 },
532
532
  now: true
533
533
  }
@@ -541,8 +541,8 @@
541
541
  key: key,
542
542
  endKey: getDate((i + step - 1) * 24 + 23.9999),
543
543
  name: this.getDayName(key, stepKind),
544
- fullName: this.dateFormat(key, "yyyy-MM-dd"),
545
- style: this.dateFormat(key, "d") == "1" && { fontWeight: 500 }
544
+ fullName: this.$dateFormat(key, "yyyy-MM-dd"),
545
+ style: this.$dateFormat(key, "d") == "1" && { fontWeight: 500 }
546
546
  });
547
547
  }
548
548
  // 大于今天
@@ -553,8 +553,8 @@
553
553
  key: key,
554
554
  endKey: getDate((i + step - 1) * 24 + 23.9999),
555
555
  name: this.getDayName(key, stepKind),
556
- fullName: this.dateFormat(key, "yyyy-MM-dd"),
557
- style: this.dateFormat(key, "d") == "1" && { fontWeight: 500 }
556
+ fullName: this.$dateFormat(key, "yyyy-MM-dd"),
557
+ style: this.$dateFormat(key, "d") == "1" && { fontWeight: 500 }
558
558
  });
559
559
  }
560
560
  return data;
@@ -574,11 +574,11 @@
574
574
  for (let i = startTime; i <= endTime; i++) {
575
575
  let key = getDate(i * 24);
576
576
  data.push({
577
- now: this.dateFormat(key, "yyyy-MM-dd") === this.dateFormat(new Date(), "yyyy-MM-dd"),
577
+ now: this.$dateFormat(key, "yyyy-MM-dd") === this.$dateFormat(new Date(), "yyyy-MM-dd"),
578
578
  key: key,
579
579
  endKey: getDate(i * 24 + 23.9999),
580
580
  name: this.getDayName(key, stepKind),
581
- fullName: this.dateFormat(key, "yyyy-MM-dd")
581
+ fullName: this.$dateFormat(key, "yyyy-MM-dd")
582
582
  });
583
583
  }
584
584
  return data;
@@ -680,14 +680,14 @@
680
680
  },
681
681
  // 获得日期显示格式
682
682
  getDayName (key, stepKind) {
683
- let name = this.dateFormat(key, "M月d日");
683
+ let name = this.$dateFormat(key, "M月d日");
684
684
  if (name === "1日") {
685
- name = this.dateFormat(key, "M月d日");
685
+ name = this.$dateFormat(key, "M月d日");
686
686
  }
687
687
  if (stepKind === "month") {
688
- name = this.dateFormat(key, "M月");
688
+ name = this.$dateFormat(key, "M月");
689
689
  if (name === "1月") {
690
- name = `${this.dateFormat(key, "yyyy年M月")}`;
690
+ name = `${this.$dateFormat(key, "yyyy年M月")}`;
691
691
  }
692
692
  }
693
693
  return name;
@@ -704,28 +704,6 @@
704
704
  // 重新渲染
705
705
  refresh () {
706
706
 
707
- },
708
- dateFormat (date, fmt) {
709
- let time = new Date(date);
710
- let o = {
711
- "M+": time.getMonth() + 1, // 月份
712
- "d+": time.getDate(), // 日
713
- "h+": time.getHours(), // 小时
714
- "m+": time.getMinutes(), // 分
715
- "s+": time.getSeconds(), // 秒
716
- "q+": Math.floor((time.getMonth() + 3) / 3), // 季度
717
- "S": time.getMilliseconds() // 毫秒
718
- };
719
- if (/(y+)/.test(fmt)) {
720
- fmt = fmt.replace(RegExp.$1, (time.getFullYear() + "").substr(4 - RegExp.$1.length));
721
- }
722
- for (let k in o) {
723
- if (new RegExp("(" + k + ")").test(fmt)) {
724
- fmt = fmt.replace(
725
- RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
726
- }
727
- }
728
- return fmt;
729
707
  },
730
708
  // 绑定同步滚动
731
709
  handleScroll (el, scrollList) {
@@ -76,55 +76,7 @@
76
76
  <div class="DshButtons-flex-right">
77
77
  <slot></slot>
78
78
 
79
- <div class="DshButtons-flex-left">
80
- <template v-for="(operationItem, index) in rightList">
81
- <Poptip
82
- v-if="operationItem.tipContent"
83
- :key="(operationItem._key || operationItem.type) + 'poptip'"
84
- trigger="hover"
85
- :title="operationItem.tipTitle"
86
- :content="operationItem.tipContent"
87
- word-wrap
88
- width="220"
89
- :transfer="true"
90
- >
91
- <bri-button
92
- :key="operationItem._key || operationItem.type"
93
- :style="operationItem.style"
94
- :class="[
95
- index ? 'dsh-margin-left8' : undefined,
96
- !operationItem.loading && !operationItem.customIcon && !operationItem.icon ? 'DshButtons-item' : undefined,
97
- itemClass,
98
- ]"
99
- :propsObj="operationItem"
100
- @click="emit(operationItem)"
101
- >
102
- {{ operationItem.name }}
103
- </bri-button>
104
- </Poptip>
105
-
106
- <bri-button
107
- v-else
108
- :key="operationItem._key || operationItem.type"
109
- :style="operationItem.style"
110
- :class="[
111
- index ? 'dsh-margin-left8' : undefined,
112
- !operationItem.loading && !operationItem.customIcon && !operationItem.icon ? 'DshButtons-item' : undefined,
113
- itemClass,
114
- ]"
115
- :propsObj="operationItem"
116
- @click="emit(operationItem)"
117
- >
118
- {{ operationItem.name }}
119
- </bri-button>
120
- </template>
121
- </div>
122
- </div>
123
- </div>
124
-
125
- <template v-else>
126
- <div class="DshButtons-flex-left">
127
- <template v-for="(operationItem, index) in flatList">
79
+ <template v-for="(operationItem, index) in rightList">
128
80
  <Poptip
129
81
  v-if="operationItem.tipContent"
130
82
  :key="(operationItem._key || operationItem.type) + 'poptip'"
@@ -133,7 +85,6 @@
133
85
  :content="operationItem.tipContent"
134
86
  word-wrap
135
87
  width="220"
136
- popper-class="DshButtons-poptip"
137
88
  :transfer="true"
138
89
  >
139
90
  <bri-button
@@ -159,7 +110,6 @@
159
110
  index ? 'dsh-margin-left8' : undefined,
160
111
  !operationItem.loading && !operationItem.customIcon && !operationItem.icon ? 'DshButtons-item' : undefined,
161
112
  itemClass,
162
- ...(Array.isArray(operationItem.class) ? operationItem.class : [operationItem.class])
163
113
  ]"
164
114
  :propsObj="operationItem"
165
115
  @click="emit(operationItem)"
@@ -167,27 +117,73 @@
167
117
  {{ operationItem.name }}
168
118
  </bri-button>
169
119
  </template>
120
+ </div>
121
+ </div>
170
122
 
171
- <!-- 更多 -->
172
- <dsh-dropdown
173
- v-if="moreList.length"
174
- class="DshButtons-dropdown"
175
- :list="moreList"
123
+ <template v-else>
124
+ <template v-for="(operationItem, index) in flatList">
125
+ <Poptip
126
+ v-if="operationItem.tipContent"
127
+ :key="(operationItem._key || operationItem.type) + 'poptip'"
176
128
  trigger="hover"
177
- @click="emit($event)"
129
+ :title="operationItem.tipTitle"
130
+ :content="operationItem.tipContent"
131
+ word-wrap
132
+ width="220"
133
+ popper-class="DshButtons-poptip"
134
+ :transfer="true"
178
135
  >
179
- <slot name="more">
180
- <bri-button
181
- class="DshButtons-dropdown-more"
182
- :propsObj="moreBtnOperationObj"
183
- >
184
- <span class="DshButtons-dropdown-more-name">
185
- {{ moreBtnOperationObj.name }}
186
- </span>
187
- </bri-button>
188
- </slot>
189
- </dsh-dropdown>
190
- </div>
136
+ <bri-button
137
+ :key="operationItem._key || operationItem.type"
138
+ :style="operationItem.style"
139
+ :class="[
140
+ index ? 'dsh-margin-left8' : undefined,
141
+ !operationItem.loading && !operationItem.customIcon && !operationItem.icon ? 'DshButtons-item' : undefined,
142
+ itemClass,
143
+ ]"
144
+ :propsObj="operationItem"
145
+ @click="emit(operationItem)"
146
+ >
147
+ {{ operationItem.name }}
148
+ </bri-button>
149
+ </Poptip>
150
+
151
+ <bri-button
152
+ v-else
153
+ :key="operationItem._key || operationItem.type"
154
+ :style="operationItem.style"
155
+ :class="[
156
+ index ? 'dsh-margin-left8' : undefined,
157
+ !operationItem.loading && !operationItem.customIcon && !operationItem.icon ? 'DshButtons-item' : undefined,
158
+ itemClass,
159
+ ...(Array.isArray(operationItem.class) ? operationItem.class : [operationItem.class])
160
+ ]"
161
+ :propsObj="operationItem"
162
+ @click="emit(operationItem)"
163
+ >
164
+ {{ operationItem.name }}
165
+ </bri-button>
166
+ </template>
167
+
168
+ <!-- 更多 -->
169
+ <dsh-dropdown
170
+ v-if="moreList.length"
171
+ class="DshButtons-dropdown"
172
+ :list="moreList"
173
+ trigger="hover"
174
+ @click="emit($event)"
175
+ >
176
+ <slot name="more">
177
+ <bri-button
178
+ class="DshButtons-dropdown-more"
179
+ :propsObj="moreBtnOperationObj"
180
+ >
181
+ <span class="DshButtons-dropdown-more-name">
182
+ {{ moreBtnOperationObj.name }}
183
+ </span>
184
+ </bri-button>
185
+ </slot>
186
+ </dsh-dropdown>
191
187
  </template>
192
188
  </div>
193
189
  </template>