bri-components 1.4.69 → 1.4.71

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.71",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -145,7 +145,7 @@
145
145
  computed: {
146
146
  selfPropsObj () {
147
147
  return {
148
- _fileType: "file",
148
+ _fileType: "file", // "file", "image"
149
149
  _showMode: this.isHeightAuto ? "old" : "inline", // 宽度为100%、且不在表格字段里的 显示老版
150
150
 
151
151
  _multiple: true,
@@ -157,10 +157,6 @@
157
157
  ...this.commonDealPropsObj
158
158
  };
159
159
  },
160
- isShowEditIcon () {
161
- // 因为编辑name 需要这三个参数,因此没有这三个参数时不显示此按钮
162
- return this.compKey && this.appKey && this.modKey && !!(this.$getHttpPathMap({}).file && this.$getHttpPathMap({}).file.updateFileName);
163
- },
164
160
  subType () {
165
161
  return this.selfPropsObj._fileType;
166
162
  },
@@ -180,13 +176,16 @@
180
176
  maxSize () {
181
177
  return this.selfPropsObj._maxSize;
182
178
  },
183
-
184
179
  // 限制文件格式
185
180
  accept () {
186
181
  return (this.subType === "image" ? imageType : fileTypes)
187
182
  .map(type => `.${type}`)
188
183
  .join();
189
184
  },
185
+ isShowEditIcon () {
186
+ // 因为编辑name 需要这三个参数,因此没有这三个参数时不显示此按钮
187
+ return this.compKey && this.appKey && this.modKey && !!(this.$getHttpPathMap({}).file && this.$getHttpPathMap({}).file.updateFileName);
188
+ },
190
189
  classes () {
191
190
  return {
192
191
  [`${prefixCls}`]: true,
@@ -223,6 +223,7 @@
223
223
  computed: {
224
224
  selfPropsObj () {
225
225
  return {
226
+ _mapType: "2D", // "2D", "3D"
226
227
  _showType: "marker", // "marker", "multipleMarker", "polyline", "polygon", "rectangle"
227
228
  _icon: "ios-map-outline",
228
229
 
@@ -230,6 +231,9 @@
230
231
  ...this.commonDealPropsObj
231
232
  };
232
233
  },
234
+ subType () {
235
+ return this.selfPropsObj._mapType;
236
+ },
233
237
  showMode () {
234
238
  return this.selfPropsObj._showType;
235
239
  },
@@ -309,7 +313,7 @@
309
313
  pitchEnable: true,
310
314
  zoom: this.propsObj._zoom || 12,
311
315
  pitch: 50,
312
- viewMode: this.propsObj._mapType || "2D", // 开启3D视图,默认为关闭
316
+ viewMode: this.subType,
313
317
  center: this.propsObj._center && this.propsObj._center.split(",").map(i => Number(i)) || undefined
314
318
  });
315
319
 
@@ -141,7 +141,8 @@
141
141
  computed: {
142
142
  selfPropsObj () {
143
143
  return {
144
- _textType: "default", // ["default", "url"]
144
+ _textType: "default", // 子类型"default", "url",只在type="text"有效
145
+
145
146
  _readonly: ["serialNumber"].includes(this.controlType),
146
147
  _showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
147
148
  _autosize: {
@@ -154,7 +155,6 @@
154
155
  ...this.commonDealPropsObj
155
156
  };
156
157
  },
157
- // 子类型,只在type="text"有效
158
158
  subType () {
159
159
  return ["textarea", "email", "password", "url", "number", "tel"].includes(this.controlType)
160
160
  ? this.controlType
@@ -39,7 +39,7 @@ export default {
39
39
  _joinSymbol: _joinSymbol // 级联拼接符
40
40
  };
41
41
  },
42
- regionType () {
42
+ subType () {
43
43
  return this.selfPropsObj._regionType;
44
44
  },
45
45
  showMode () {
@@ -84,7 +84,7 @@ export default {
84
84
  return ["userIndustry"].includes(this.controlType)
85
85
  ? userIndustryData
86
86
  : ["region", "regions"].includes(this.controlType)
87
- ? this.regionType === "benji"
87
+ ? this.subType === "benji"
88
88
  ? benjiRegionData
89
89
  : regionData
90
90
  : this.selfPropsObj._data;
@@ -165,7 +165,7 @@
165
165
  ...this.commonDealPropsObj
166
166
  };
167
167
  },
168
- labelType () {
168
+ subType () {
169
169
  return this.selfPropsObj._labelType;
170
170
  },
171
171
  onlySelect () {
@@ -227,7 +227,7 @@
227
227
  _key: this.$randomB36("Labels"),
228
228
  isEdit: true,
229
229
  name: "",
230
- labelType: this.labelType
230
+ labelType: this.subType
231
231
  });
232
232
  },
233
233
  clickDeleteItem (deleteItem) {
@@ -246,7 +246,7 @@
246
246
  entityKey: this.entityKey,
247
247
  modKey: this.modKey,
248
248
  fieldKey: this.fieldKey, // 当前字段Key
249
- labelType: this.labelType
249
+ labelType: this.subType
250
250
  },
251
251
  pagination: {
252
252
  page: 1,
@@ -203,7 +203,7 @@
203
203
  "users", "departments", "labels", "flatTable", "cascaderTable", "reference", "referenceBy"
204
204
  ],
205
205
  ignoreProperties: [
206
- "_name", "_key", "_span", "_br", "_line", "_noLabel", "_required", "_regStr", "_regMessage", "_clearable", "_default"
206
+ "_name", "_key", "_span", "_br", "_line", "_noLabel", "_required", "_clearable", "_default"
207
207
  ]
208
208
  // subIgnoreProperties: []
209
209
  };
@@ -409,7 +409,7 @@
409
409
  // 格式校验(不依赖必填)
410
410
  if (ruleConfig.regs && ruleConfig.regs.length) {
411
411
  rules.push({
412
- message: formItem._regMessage || `"${formItem._name}"格式不正确!`,
412
+ message: formItem._regMessage || ruleConfig._regMessage || `"${formItem._name}"格式不正确!`,
413
413
  trigger: "blur, change",
414
414
  type: "string",
415
415
  transform: (val) => {
@@ -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>
@@ -138,9 +138,12 @@
138
138
  unitStyle () {
139
139
  return {
140
140
  width: `calc(${(this.formItem._br && this.formItem._span ? this.formItem._span / 24 : 1) * 100}% - 12px)`,
141
- height: this.formItem._br || [undefined, 0, 24].includes(this.formItem._span)
142
- ? undefined
143
- : `${this.height - (this.canEdit ? 0 : 10)}px`, // 去掉下padding
141
+ height: this.formItem._formHeight
142
+ ? `${this.formItem._formHeight}px`
143
+ : (this.formItem._br || [undefined, 0, 24].includes(this.formItem._span)
144
+ ? undefined
145
+ : `${this.height - (this.canEdit ? 0 : 10)}px`// 去掉下padding
146
+ ),
144
147
  minHeight: "42px",
145
148
  paddingBottom: this.canEdit ? undefined : "0px", // 详情查看页时,不要上下的padding,为了美观
146
149