bri-components 1.4.70 → 1.4.72

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.70",
3
+ "version": "1.4.72",
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
 
@@ -1,42 +1,42 @@
1
1
  <template>
2
2
  <div
3
3
  class="DshDivider"
4
- :style="propsObj._tagKind === 'flag' ? { marginRight:'36px' } : {}"
4
+ :style="showMode === 'flag' ? { marginRight:'36px' } : {}"
5
5
  >
6
6
  <!-- <div class="DshDivider-cli">
7
- <p>{{ propsObj._name }}</p>
7
+ <p>{{ controlName }}</p>
8
8
  </div> -->
9
9
 
10
10
  <div
11
- v-if="propsObj._tagKind === 'flag'"
11
+ v-if="showMode === 'flag'"
12
12
  class="DshDivider-flag"
13
13
  >
14
14
  <Icon
15
15
  size="15"
16
16
  style="margin-top: -1px"
17
- :custom="'bico-font ' + propsObj._tagIcon"
17
+ :custom="'bico-font ' + iconType"
18
18
  />
19
- <p>{{ propsObj._name }}</p>
19
+ <p>{{ controlName }}</p>
20
20
  <span class="triangle-topleft"></span>
21
21
  <span class="triangle-topright"></span>
22
22
  </div>
23
23
 
24
24
  <div
25
- v-else-if="propsObj._tagKind === 'line'"
25
+ v-else-if="showMode === 'line'"
26
26
  class="DshDivider-line"
27
27
  >
28
- <p>{{ propsObj._name }}</p>
28
+ <p>{{ controlName }}</p>
29
29
  <span></span>
30
30
  </div>
31
31
 
32
32
  <div
33
- v-else-if="propsObj._tagKind === 'circle'"
33
+ v-else-if="showMode === 'circle'"
34
34
  class="DshDivider-circle"
35
35
  >
36
36
  <span class="DshDivider-circle-icon">
37
- <Icon :custom="'bico-font ' + propsObj._tagIcon" />
37
+ <Icon :custom="'bico-font ' + iconType" />
38
38
  </span>
39
- <p>{{ propsObj._name }}</p>
39
+ <p>{{ controlName }}</p>
40
40
  </div>
41
41
  </div>
42
42
  </template>
@@ -53,7 +53,22 @@
53
53
  data () {
54
54
  return {};
55
55
  },
56
- computed: {},
56
+ computed: {
57
+ selfPropsObj () {
58
+ return {
59
+ _tagKind: "flag", // "flag", "line", "circle"
60
+ _tagIcon: "", // flag、circle下使用
61
+
62
+ ...this.propsObj
63
+ };
64
+ },
65
+ showMode () {
66
+ return this.selfPropsObj._tagKind;
67
+ },
68
+ iconType () {
69
+ return this.selfPropsObj._tagIcon;
70
+ }
71
+ },
57
72
  created () {},
58
73
  methods: {}
59
74
  };
@@ -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;
@@ -159,8 +159,8 @@ export default {
159
159
 
160
160
  return !this.$isEmptyData(val)
161
161
  ? {
162
- name: obj[this.nameKey], // 查看状态时tag用
163
162
  ...obj,
163
+ name: obj[this.nameKey] || obj.name || obj._name, // 查看状态时tag用
164
164
  style: {
165
165
  ...this.tagStyle,
166
166
  ...this.getItemColorStyle(obj),
@@ -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) => {
@@ -37,7 +37,7 @@
37
37
  <!-- loading -->
38
38
  <bri-loading
39
39
  class="bri-table-empty"
40
- :value="isLoading ? 1 : data.length? 0 : 2"
40
+ :value="isLoading ? 1 : data.length ? 0 : 2"
41
41
  >
42
42
  <template slot="nodata">
43
43
  {{ noDataText }}
@@ -179,7 +179,7 @@
179
179
  .reduce((obj, attr) => {
180
180
  return { sortType: params[attr], field: attr };
181
181
  }, {});
182
- this.$emit("sort-change", sortObj);
182
+ this.$emit("changeSort", sortObj);
183
183
  },
184
184
  ...(this.propsObj.sortOption || {})
185
185
  };
@@ -14,7 +14,7 @@
14
14
  :isLoading="isLoading ? isLoading : listPropsObj && listPropsObj.isLoading"
15
15
  :noDataText="listPropsObj && listPropsObj.noDataText || '暂无数据…'"
16
16
  @clickRow="clickRow"
17
- @sortChange="changeSort"
17
+ @changeSort="changeSort"
18
18
  @changeSelect="changeSelect"
19
19
  @selectAll="selectAll"
20
20
  @select="select"
@@ -9,7 +9,7 @@
9
9
  @changeSelect="changeSelect"
10
10
  @selectAll="changeSelect"
11
11
  @click-row="clickRow"
12
- @sort-change="changeSort"
12
+ @changeSort="changeSort"
13
13
  ></bri-table>
14
14
  </div>
15
15
  </template>
@@ -189,7 +189,7 @@
189
189
 
190
190
  // 改变选择项
191
191
  changeSort (...params) {
192
- this.$emit("sortChange", ...params);
192
+ this.$emit("changeSort", ...params);
193
193
  },
194
194
  // 改变选择项
195
195
  changeSelect (...params) {
@@ -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