bri-components 1.2.2 → 1.2.3

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.
Files changed (27) hide show
  1. package/lib/0.bri-components.min.js +1 -1
  2. package/lib/2.bri-components.min.js +1 -1
  3. package/lib/5.bri-components.min.js +1 -1
  4. package/lib/bri-components.min.js +5 -5
  5. package/package.json +1 -1
  6. package/src/abolish/DshCascaders.vue +3 -0
  7. package/src/abolish/DshTexts.vue +3 -0
  8. package/src/components/controls/base/BriUpload/BriUploadImage.vue +1 -1
  9. package/src/components/controls/base/BriUpload/uploadMixin.js +4 -3
  10. package/src/components/controls/base/DshCascader/DshCascader.vue +22 -11
  11. package/src/components/controls/base/DshCheckbox.vue +0 -3
  12. package/src/components/controls/base/DshCoordinates.vue +2 -2
  13. package/src/components/controls/base/DshDaterange.vue +2 -2
  14. package/src/components/controls/controlMixin.js +9 -0
  15. package/src/components/controls/senior/BriLabels.vue +97 -93
  16. package/src/components/controls/senior/selectDepartments.vue +16 -11
  17. package/src/components/controls/senior/selectUsers/selectUsers.vue +18 -15
  18. package/src/components/small/BriDrawer.vue +1 -1
  19. package/src/components/small/DshDropdown.vue +1 -0
  20. package/src/components/small/DshModal.vue +1 -1
  21. package/src/components/small/DshTags.vue +29 -25
  22. package/src/styles/common/control.less +18 -16
  23. package/src/styles/components/controls/base/DshCascader/DshCascader.less +4 -7
  24. package/src/styles/components/controls/base/DshCheckbox.less +16 -25
  25. package/src/styles/components/small/DshDropdown.less +6 -5
  26. package/src/styles/components/small/DshTags.less +1 -1
  27. package/src/styles/variables.less +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -22,6 +22,9 @@
22
22
  <dsh-tags
23
23
  class="dsh-margin-top5"
24
24
  :list="tags"
25
+ :propsObj="{
26
+ closable: true
27
+ }"
25
28
  @delete="$dispatchEvent(operationMap.deleteTag, arguments)"
26
29
  ></dsh-tags>
27
30
  </div>
@@ -19,6 +19,9 @@
19
19
  <dsh-tags
20
20
  class="dsh-margin-top5"
21
21
  :list="value[propsObj._key]"
22
+ :propsObj="{
23
+ closable: true
24
+ }"
22
25
  @delete="$dispatchEvent(operationMap.deleteTag, arguments)"
23
26
  ></dsh-tags>
24
27
  </div>
@@ -140,7 +140,7 @@
140
140
  computed: {
141
141
  modalPropsObj () {
142
142
  return {
143
- title: this.propsObj._name,
143
+ title: this.propsObj._name || "修改头像",
144
144
  class: "bri-modal",
145
145
  width: 450
146
146
  };
@@ -64,7 +64,8 @@ export default {
64
64
  callback: res => {
65
65
  this.inputType = "file";
66
66
  if (res.ossType === "ali-oss") {
67
- // 上传到阿里云
67
+ console.log(this.computedOssType, res);
68
+ // 上传到阿里云res
68
69
  this[this.computedOssType](file, res, callback);
69
70
  } else if (res.ossType === "local") {
70
71
  this.localUpload(file, res, callback);
@@ -259,7 +260,7 @@ export default {
259
260
  binaryMultipartUpload (file, res, callback) {
260
261
  let type = "jpg";
261
262
  let remoteName = `${this.randomTimeStampFn()}.${type}`;
262
-
263
+ console.log("调binaryMultipartUpload");
263
264
  // 上传成功的回调参数
264
265
  let callbackBody = {
265
266
  name: remoteName,
@@ -277,7 +278,7 @@ export default {
277
278
  callbackBodyType: "application/json",
278
279
  callbackBody: this.transferCallBody(callbackBody)
279
280
  };
280
-
281
+ console.log("调binaryMultipartUpload22");
281
282
  new this.$aliOss(res.ossConfig).multipartUpload(remoteName, file, {
282
283
  progress: (percentage) => {
283
284
  this.inProgress(Number((percentage * 100).toFixed(0)));
@@ -25,6 +25,8 @@
25
25
  'DshCascader-edit-multiple-edit': true,
26
26
  'DshCascader-row-edit': isMultipleRow,
27
27
  }"
28
+ @mouseenter="isHover = true"
29
+ @mouseleave="isHover = false"
28
30
  @click="clickInput"
29
31
  >
30
32
  <!-- 有值 -->
@@ -37,17 +39,26 @@
37
39
  }"
38
40
  @delete="deleteItem"
39
41
  ></dsh-tags>
40
-
41
- <Icon
42
- class="icon-default"
43
- type="ios-arrow-down"
44
- />
45
42
  </template>
46
-
47
43
  <!-- 无值 -->
48
44
  <template v-else>
49
45
  {{ emptyShowVal }}
50
46
  </template>
47
+
48
+ <!-- 图标 -->
49
+ <template>
50
+ <Icon
51
+ v-if="!$isEmptyData(curValList) && selfPropsObj._clearable && isHover"
52
+ class="icon-close"
53
+ type="ios-close-circle"
54
+ @click.stop="clickClear"
55
+ />
56
+ <Icon
57
+ v-else
58
+ class="icon-default"
59
+ :type="inputIcon"
60
+ />
61
+ </template>
51
62
  </div>
52
63
  </Cascader>
53
64
  </template>
@@ -74,7 +85,7 @@
74
85
  <Icon
75
86
  v-if="selfPropsObj._clearable && isHover"
76
87
  class="icon-close"
77
- type="md-close"
88
+ type="ios-close-circle"
78
89
  @click.stop="clickClear"
79
90
  />
80
91
  <Icon
@@ -139,9 +150,6 @@
139
150
  v-if="!$isEmptyData(curValList)"
140
151
  class="text"
141
152
  :list="curValNameList"
142
- :propsObj="{
143
- closable: false
144
- }"
145
153
  ></dsh-tags>
146
154
 
147
155
  <!-- 无值 -->
@@ -229,7 +237,7 @@
229
237
  return {
230
238
  _filterable: true,
231
239
  _showMode: false,
232
- _transfer: false,
240
+ _transfer: true,
233
241
  ...this.propsObj,
234
242
  ...this.commonDealPropsObj
235
243
  };
@@ -268,6 +276,9 @@
268
276
  showMode () {
269
277
  return this.selfPropsObj._showMode;
270
278
  },
279
+ inputIcon () {
280
+ return this.isVisible ? "ios-arrow-up" : "ios-arrow-down";
281
+ },
271
282
 
272
283
  // 多选用 名字组成的列表
273
284
  curValNameList () {
@@ -95,9 +95,6 @@
95
95
  v-if="!$isEmptyData(curValList)"
96
96
  class="text"
97
97
  :list="curValObjList"
98
- :propsObj="{
99
- closable: false
100
- }"
101
98
  ></dsh-tags>
102
99
 
103
100
  <!-- 无值 -->
@@ -11,7 +11,7 @@
11
11
  ...commonClass,
12
12
  'DshCoordinates-edit': true
13
13
  }"
14
- @click.stop="clickOpenModal"
14
+ @click.stop="clickOpenModal"
15
15
  >
16
16
  <div class="text">
17
17
  {{ showText }}
@@ -20,7 +20,7 @@
20
20
  <Icon
21
21
  v-if="finalCanEdit && selfPropsObj._clearable"
22
22
  class="icon-close"
23
- type="md-close"
23
+ type="ios-close-circle"
24
24
  @click.stop="clickDelete"
25
25
  />
26
26
  </div>
@@ -40,7 +40,7 @@
40
40
  <span class="DshDaterange-item-icon">
41
41
  <Icon
42
42
  v-show="val0"
43
- type="md-close"
43
+ type="ios-close-circle"
44
44
  @click.stop="clickClear('', 0)"
45
45
  />
46
46
  <Icon
@@ -77,7 +77,7 @@
77
77
  <span class="DshDaterange-item-icon">
78
78
  <Icon
79
79
  v-show="val1"
80
- type="md-close"
80
+ type="ios-close-circle"
81
81
  @click.stop="clickClear('', 1)"
82
82
  />
83
83
  <Icon
@@ -70,6 +70,12 @@ export default {
70
70
  controlKey () {
71
71
  return this.propsObj._key;
72
72
  },
73
+ // 字段的真实key
74
+ fieldKey () {
75
+ return this.controlKey === "_default"
76
+ ? this.value._key
77
+ : (this.propsObj.__realKey__ || this.controlKey);
78
+ },
73
79
  controlType () {
74
80
  return this.propsObj._type;
75
81
  },
@@ -111,6 +117,9 @@ export default {
111
117
  },
112
118
 
113
119
  // 部分控件或部分条件下 才使用的属性
120
+ isCore () {
121
+ return !!this.propsObj.isCore;
122
+ },
114
123
  inTable () {
115
124
  return !!this.propsObj.inTable;
116
125
  },
@@ -7,7 +7,7 @@
7
7
  class="BriLabels-dropdown"
8
8
  trigger="custom"
9
9
  placement="bottom-start"
10
- :visible="listVisible"
10
+ :visible="isVisible"
11
11
  transfer
12
12
  @on-clickoutside="clickInput"
13
13
  >
@@ -17,59 +17,68 @@
17
17
  ...commonClass,
18
18
  'BriLabels-edit': true
19
19
  }"
20
+ @mouseenter="isHover = true"
21
+ @mouseleave="isHover = false"
20
22
  @click="clickInput"
21
23
  >
22
- <template v-if="!$isEmptyData(val)">
24
+ <!-- 有值 -->
25
+ <template v-if="!$isEmptyData(curValList)">
23
26
  <dsh-tags
24
27
  class="overflow"
25
- :list="val"
28
+ :list="curValList"
26
29
  :propsObj="{
27
30
  disabled: !finalCanEdit
28
31
  }"
29
32
  :autoEllipsis="true"
30
33
  @delete="clickDeleteItem"
31
- >
32
- <span slot-scope="{ tagItem }">
33
- {{ tagItem.name }}
34
- </span>
35
- </dsh-tags>
34
+ ></dsh-tags>
35
+ </template>
36
+ <!-- 无值 -->
37
+ <template v-else>
38
+ {{ emptyShowVal }}
39
+ </template>
36
40
 
41
+ <!-- 图标 -->
42
+ <template>
43
+ <Icon
44
+ v-if="!$isEmptyData(curValList) && selfPropsObj._clearable && isHover"
45
+ class="icon-close"
46
+ type="ios-close-circle"
47
+ @click.stop="clickClear"
48
+ />
37
49
  <Icon
50
+ v-else
38
51
  class="icon-default"
39
52
  :type="inputIcon"
40
53
  />
41
54
  </template>
42
-
43
- <template v-else>
44
- {{ emptyShowVal }}
45
- </template>
46
55
  </div>
47
56
 
48
57
  <template #list>
49
58
  <DropdownMenu class="BriLabels-dropdown-menu">
50
59
  <DropdownItem
51
- v-for="item in listData"
52
- :key="item._key"
60
+ v-for="listItem in listData"
61
+ :key="listItem._key"
53
62
  :class="{
54
63
  'item': true,
55
- 'item-active': !!val.find(i=>i._key == item._key)
64
+ 'item-active': !!curValList.find(item => item._key === listItem._key)
56
65
  }"
57
- @click.native="clickItem(item)"
66
+ @click.native="clickItem(listItem)"
58
67
  >
59
68
 
60
69
  <div
61
- v-if="item.isEdit"
70
+ v-if="listItem.isEdit"
62
71
  class="item-edit"
63
72
  >
64
73
  <Input
65
- v-model="item.name"
74
+ v-model="listItem.name"
66
75
  @click.native="clickEditInput($event)"
67
76
  >
68
77
  <template #suffix>
69
78
  <Icon
70
79
  color="#3DB8C5"
71
80
  custom="bri bri-duigou"
72
- @click.native.stop="clickConfirm(item)"
81
+ @click.native.stop="clickConfirm(listItem)"
73
82
  />
74
83
  </template>
75
84
  </Input>
@@ -79,13 +88,13 @@
79
88
  v-else
80
89
  class="item-show"
81
90
  >
82
- {{ item.name }}
91
+ {{ listItem.name }}
83
92
  <span class="item-show-icons">
84
93
  <Icon
85
- v-if="!item.coreLabel"
94
+ v-if="!listItem.coreLabel"
86
95
  class="item-show-icons-edit"
87
96
  custom="bri bri-bianji"
88
- @click.stop="clickEditIcon(item)"
97
+ @click.stop="clickEditIcon(listItem)"
89
98
  />
90
99
  <!-- 暂时不需要删除 -->
91
100
  <!-- <Icon
@@ -97,7 +106,7 @@
97
106
  </DropdownItem>
98
107
 
99
108
  <div
100
- v-if="!selfPropsObj._onlySelect"
109
+ v-if="!onlySelect"
101
110
  class="btns"
102
111
  >
103
112
  <bri-button
@@ -117,7 +126,7 @@
117
126
  <!-- 查看 -->
118
127
  <template v-else>
119
128
  <bri-tooltip
120
- :content="showValStr"
129
+ :content="showVal"
121
130
  maxWidth="200"
122
131
  :transfer="true"
123
132
  >
@@ -126,17 +135,10 @@
126
135
  'BriLabels-show': true
127
136
  }">
128
137
  <dsh-tags
129
- v-if="!$isEmptyData(val)"
138
+ v-if="!$isEmptyData(curValList)"
130
139
  class="text"
131
- :list="val"
132
- :propsObj="{
133
- closable: false
134
- }"
135
- >
136
- <span slot-scope="{ tagItem }">
137
- {{ tagItem.name }}
138
- </span>
139
- </dsh-tags>
140
+ :list="curValList"
141
+ ></dsh-tags>
140
142
 
141
143
  <template v-else>
142
144
  {{ emptyShowVal }}
@@ -157,97 +159,99 @@
157
159
  ],
158
160
  data () {
159
161
  return {
162
+ isHover: false,
163
+
160
164
  listData: [],
161
- listVisible: false,
162
- inputIcon: "ios-arrow-down",
165
+ isVisible: false,
163
166
  renderList: false
164
167
  };
165
168
  },
166
169
  computed: {
167
170
  selfPropsObj () {
168
171
  return {
172
+ _labelType: "entity",
173
+ _onlySelect: false,
174
+ _originLabels: [],
175
+
169
176
  ...this.propsObj,
170
177
  ...this.commonDealPropsObj
171
178
  };
172
179
  },
173
- val: {
174
- get () {
175
- return this.value[this.controlKey] || [];
176
- },
177
- set (val) {
178
- this.value[this.controlKey] = val;
179
- }
180
- },
181
180
 
182
- isCore () {
183
- return this.selfPropsObj.isCore;
181
+ labelType () {
182
+ return this.selfPropsObj._labelType;
183
+ },
184
+ onlySelect () {
185
+ return this.selfPropsObj._onlySelect;
184
186
  },
185
- showValStr () {
186
- let valArr = this.val && this.val.map(item => item.name);
187
- return valArr && valArr.join("、");
187
+ originLabels () {
188
+ return this.selfPropsObj._originLabels;
189
+ },
190
+ inputIcon () {
191
+ return this.isVisible ? "ios-arrow-up" : "ios-arrow-down";
192
+ },
193
+
194
+ showVal () {
195
+ return this.$isEmptyData(this.curValList)
196
+ ? this.emptyShowVal
197
+ : this.curValList.map(item => item.name).join("、");
188
198
  }
189
199
  },
190
200
  created () {},
191
201
  methods: {
192
- init () {
193
- if (this.isCore) {
194
- this.listData = this.selfPropsObj._originLabels.map(item => {
195
- return {
196
- ...item,
197
- isEdit: false
198
- };
199
- });
200
- } else {
201
- this.getListData();
202
- }
203
- },
204
-
205
202
  clickInput () {
206
- if (!this.finalCanEdit) return;
207
- if (!this.renderList) {
208
- this.init();
209
- }
210
- this.renderList = true;
211
- this.listVisible = !this.listVisible;
212
- if (this.listVisible) {
213
- this.inputIcon = "ios-arrow-up";
214
- } else {
215
- this.inputIcon = "ios-arrow-down";
203
+ if (this.finalCanEdit) {
204
+ if (!this.renderList) {
205
+ if (this.isCore) {
206
+ this.listData = this.originLabels.map(item => {
207
+ return {
208
+ ...item,
209
+ isEdit: false
210
+ };
211
+ });
212
+ } else {
213
+ this.getListData();
214
+ }
215
+ }
216
+ this.renderList = true;
217
+ this.isVisible = !this.isVisible;
216
218
  }
217
219
  },
218
220
  clickEditInput (e) {
219
221
  e.stopPropagation();
220
222
  },
221
- clickEditIcon (item) {
222
- item.isEdit = true;
223
+ clickEditIcon (listItem) {
224
+ listItem.isEdit = true;
223
225
  this.$forceUpdate();
224
226
  },
225
- clickConfirm (item) {
226
- if (item.name == "") return;
227
- item.isEdit = false;
228
- this.$forceUpdate();
229
- this.change();
227
+ clickConfirm (listItem) {
228
+ if (listItem.name) {
229
+ listItem.isEdit = false;
230
+ this.$forceUpdate();
231
+ };
230
232
  },
231
233
 
232
- clickItem (item) {
233
- if (this.val.findIndex(i => i._key == item._key) > -1) {
234
- this.val = this.val.filter(i => i._key != item._key);
234
+ clickItem (listItem) {
235
+ if (this.curValList.some(item => item._key === listItem._key)) {
236
+ this.curValList = this.curValList.filter(item => item._key !== listItem._key);
235
237
  } else {
236
- this.val.push(item);
238
+ this.curValList = [...this.curValList, listItem];
237
239
  }
238
- this.change();
239
- },
240
- clickDeleteItem (item) {
241
- this.change();
242
240
  },
243
241
  clickAddItem () {
244
242
  this.listData.push({
245
243
  _key: this.$randomB36("Labels"),
246
244
  isEdit: true,
247
245
  name: "",
248
- labelType: this.selfPropsObj._labelType
246
+ labelType: this.labelType
249
247
  });
250
- this.change();
248
+ },
249
+ clickDeleteItem (deleteItem) {
250
+ this.curValList = this.curValList.filter(item => item._key !== deleteItem._key);
251
+ },
252
+ // 点击清除选择项
253
+ clickClear () {
254
+ this.curValList = [];
251
255
  },
252
256
 
253
257
  // 接口 -获取列表数据
@@ -259,10 +263,10 @@
259
263
  },
260
264
  params: {
261
265
  search: {
262
- entityKey: this.entityKey, // 当前工作表关联的数据表Key
263
- fieldKey: this.selfPropsObj._key === "_default" ? this.value._key : (this.selfPropsObj.__realKey__ || this.selfPropsObj._key), // 当前字段Key
264
- labelType: this.selfPropsObj._labelType,
265
- modKey: this.modKey
266
+ entityKey: this.entityKey,
267
+ modKey: this.modKey,
268
+ fieldKey: this.fieldKey, // 当前字段Key
269
+ labelType: this.labelType
266
270
  },
267
271
  pagination: {
268
272
  page: 1,
@@ -17,6 +17,7 @@
17
17
  @mouseleave="isHover = false"
18
18
  @click="clickInput"
19
19
  >
20
+ <!-- 有值 -->
20
21
  <template v-if="!$isEmptyData(curValList)">
21
22
  <dsh-tags
22
23
  class="text"
@@ -26,23 +27,26 @@
26
27
  }"
27
28
  @delete="clickDeleteItem"
28
29
  ></dsh-tags>
30
+ </template>
31
+ <!-- 无值 -->
32
+ <template v-else>
33
+ {{ emptyShowVal }}
34
+ </template>
29
35
 
36
+ <!-- 图标 -->
37
+ <template>
30
38
  <Icon
31
- v-if="selfPropsObj._clearable && isHover"
39
+ v-if="!$isEmptyData(curValList) && selfPropsObj._clearable && isHover"
32
40
  class="icon-close"
33
- type="md-close"
41
+ type="ios-close-circle"
34
42
  @click.stop="clickClear"
35
43
  />
36
44
  <Icon
37
45
  v-else
38
46
  class="icon-default"
39
- :type="`${multiple ? 'ios-people' : 'ios-person'}`"
47
+ :type="inputIcon"
40
48
  />
41
49
  </template>
42
-
43
- <template v-else>
44
- {{ emptyShowVal }}
45
- </template>
46
50
  </div>
47
51
 
48
52
  <!-- 查看模式 -->
@@ -57,9 +61,6 @@
57
61
  v-if="!$isEmptyData(curValList)"
58
62
  class="text"
59
63
  :list="curValList"
60
- :propsObj="{
61
- closable: false
62
- }"
63
64
  ></dsh-tags>
64
65
 
65
66
  <template v-else>
@@ -93,7 +94,7 @@
93
94
  </span>
94
95
  <Icon
95
96
  class="item-delete"
96
- type="md-close"
97
+ type="ios-close-circle"
97
98
  @click="deleteSelect(selectItem, selectIndex, newValList)"
98
99
  />
99
100
  </span>
@@ -246,6 +247,10 @@
246
247
  highSearch () {
247
248
  return this.selfPropsObj._highSearch;
248
249
  },
250
+ inputIcon () {
251
+ return this.multiple ? "ios-people" : "ios-person";
252
+ },
253
+
249
254
  // 暂时没配置
250
255
  isCascader () {
251
256
  return this.selfPropsObj._isCascader;