bri-components 1.2.1 → 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 (43) hide show
  1. package/lib/0.bri-components.min.js +1 -1
  2. package/lib/1.bri-components.min.js +1 -1
  3. package/lib/2.bri-components.min.js +1 -1
  4. package/lib/5.bri-components.min.js +1 -1
  5. package/lib/bri-components.min.js +5 -5
  6. package/package.json +1 -1
  7. package/src/abolish/DshCascaders.vue +3 -0
  8. package/src/abolish/DshTexts.vue +3 -0
  9. package/src/components/controls/base/BriUpload/BriUploadImage.vue +45 -32
  10. package/src/components/controls/base/BriUpload/uploadMixin.js +7 -5
  11. package/src/components/controls/base/DshCascader/DshCascader.vue +25 -17
  12. package/src/components/controls/base/DshCheckbox.vue +127 -137
  13. package/src/components/controls/base/DshCoordinates.vue +121 -147
  14. package/src/components/controls/base/DshDaterange.vue +3 -3
  15. package/src/components/controls/base/DshEditor.vue +2 -1
  16. package/src/components/controls/base/DshSelect.vue +3 -13
  17. package/src/components/controls/base/DshSwitch.vue +13 -20
  18. package/src/components/controls/controlMixin.js +19 -1
  19. package/src/components/controls/senior/BriLabels.vue +98 -93
  20. package/src/components/controls/senior/selectDepartments.vue +16 -11
  21. package/src/components/controls/senior/selectUsers/DepartmentMenu.vue +2 -2
  22. package/src/components/controls/senior/selectUsers/selectUsers.vue +18 -15
  23. package/src/components/small/BriDrawer.vue +1 -1
  24. package/src/components/small/DshDropdown.vue +1 -0
  25. package/src/components/small/DshModal.vue +1 -1
  26. package/src/components/small/DshTags.vue +135 -8
  27. package/src/styles/common/control.less +19 -15
  28. package/src/styles/components/controls/.DS_Store +0 -0
  29. package/src/styles/components/controls/base/BriUpload/BriUpload.less +1 -1
  30. package/src/styles/components/controls/base/BriUpload/BriUploadImage.less +6 -0
  31. package/src/styles/components/controls/base/DshCascader/DshCascader.less +13 -11
  32. package/src/styles/components/controls/base/DshCheckbox.less +39 -75
  33. package/src/styles/components/controls/base/DshCoordinates.less +1 -35
  34. package/src/styles/components/controls/base/DshSelect.less +16 -1
  35. package/src/styles/components/controls/base/DshSwitch.less +1 -31
  36. package/src/styles/components/controls/senior/.DS_Store +0 -0
  37. package/src/styles/components/controls/senior/BriLabels.less +1 -1
  38. package/src/styles/components/list/BriFlatTable.less +1 -1
  39. package/src/styles/components/small/DshDropdown.less +6 -5
  40. package/src/styles/components/small/DshModal.less +20 -42
  41. package/src/styles/components/small/DshTags.less +32 -14
  42. package/src/styles/components/unit/DshFormItem.less +3 -25
  43. package/src/styles/variables.less +2 -1
@@ -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,58 +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
  }"
32
+ :autoEllipsis="true"
29
33
  @delete="clickDeleteItem"
30
- >
31
- <span slot-scope="{ tagItem }">
32
- {{ tagItem.name }}
33
- </span>
34
- </dsh-tags>
34
+ ></dsh-tags>
35
+ </template>
36
+ <!-- 无值 -->
37
+ <template v-else>
38
+ {{ emptyShowVal }}
39
+ </template>
35
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
+ />
36
49
  <Icon
50
+ v-else
37
51
  class="icon-default"
38
52
  :type="inputIcon"
39
53
  />
40
54
  </template>
41
-
42
- <template v-else>
43
- {{ emptyShowVal }}
44
- </template>
45
55
  </div>
46
56
 
47
57
  <template #list>
48
58
  <DropdownMenu class="BriLabels-dropdown-menu">
49
59
  <DropdownItem
50
- v-for="item in listData"
51
- :key="item._key"
60
+ v-for="listItem in listData"
61
+ :key="listItem._key"
52
62
  :class="{
53
63
  'item': true,
54
- 'item-active': !!val.find(i=>i._key == item._key)
64
+ 'item-active': !!curValList.find(item => item._key === listItem._key)
55
65
  }"
56
- @click.native="clickItem(item)"
66
+ @click.native="clickItem(listItem)"
57
67
  >
58
68
 
59
69
  <div
60
- v-if="item.isEdit"
70
+ v-if="listItem.isEdit"
61
71
  class="item-edit"
62
72
  >
63
73
  <Input
64
- v-model="item.name"
74
+ v-model="listItem.name"
65
75
  @click.native="clickEditInput($event)"
66
76
  >
67
77
  <template #suffix>
68
78
  <Icon
69
79
  color="#3DB8C5"
70
80
  custom="bri bri-duigou"
71
- @click.native.stop="clickConfirm(item)"
81
+ @click.native.stop="clickConfirm(listItem)"
72
82
  />
73
83
  </template>
74
84
  </Input>
@@ -78,13 +88,13 @@
78
88
  v-else
79
89
  class="item-show"
80
90
  >
81
- {{ item.name }}
91
+ {{ listItem.name }}
82
92
  <span class="item-show-icons">
83
93
  <Icon
84
- v-if="!item.coreLabel"
94
+ v-if="!listItem.coreLabel"
85
95
  class="item-show-icons-edit"
86
96
  custom="bri bri-bianji"
87
- @click.stop="clickEditIcon(item)"
97
+ @click.stop="clickEditIcon(listItem)"
88
98
  />
89
99
  <!-- 暂时不需要删除 -->
90
100
  <!-- <Icon
@@ -96,7 +106,7 @@
96
106
  </DropdownItem>
97
107
 
98
108
  <div
99
- v-if="!selfPropsObj._onlySelect"
109
+ v-if="!onlySelect"
100
110
  class="btns"
101
111
  >
102
112
  <bri-button
@@ -116,7 +126,7 @@
116
126
  <!-- 查看 -->
117
127
  <template v-else>
118
128
  <bri-tooltip
119
- :content="showValStr"
129
+ :content="showVal"
120
130
  maxWidth="200"
121
131
  :transfer="true"
122
132
  >
@@ -125,17 +135,10 @@
125
135
  'BriLabels-show': true
126
136
  }">
127
137
  <dsh-tags
128
- v-if="!$isEmptyData(val)"
138
+ v-if="!$isEmptyData(curValList)"
129
139
  class="text"
130
- :list="val"
131
- :propsObj="{
132
- closable: false
133
- }"
134
- >
135
- <span slot-scope="{ tagItem }">
136
- {{ tagItem.name }}
137
- </span>
138
- </dsh-tags>
140
+ :list="curValList"
141
+ ></dsh-tags>
139
142
 
140
143
  <template v-else>
141
144
  {{ emptyShowVal }}
@@ -156,97 +159,99 @@
156
159
  ],
157
160
  data () {
158
161
  return {
162
+ isHover: false,
163
+
159
164
  listData: [],
160
- listVisible: false,
161
- inputIcon: "ios-arrow-down",
165
+ isVisible: false,
162
166
  renderList: false
163
167
  };
164
168
  },
165
169
  computed: {
166
170
  selfPropsObj () {
167
171
  return {
172
+ _labelType: "entity",
173
+ _onlySelect: false,
174
+ _originLabels: [],
175
+
168
176
  ...this.propsObj,
169
177
  ...this.commonDealPropsObj
170
178
  };
171
179
  },
172
- val: {
173
- get () {
174
- return this.value[this.controlKey] || [];
175
- },
176
- set (val) {
177
- this.value[this.controlKey] = val;
178
- }
179
- },
180
180
 
181
- isCore () {
182
- return this.selfPropsObj.isCore;
181
+ labelType () {
182
+ return this.selfPropsObj._labelType;
183
+ },
184
+ onlySelect () {
185
+ return this.selfPropsObj._onlySelect;
183
186
  },
184
- showValStr () {
185
- let valArr = this.val && this.val.map(item => item.name);
186
- 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("、");
187
198
  }
188
199
  },
189
200
  created () {},
190
201
  methods: {
191
- init () {
192
- if (this.isCore) {
193
- this.listData = this.selfPropsObj._originLabels.map(item => {
194
- return {
195
- ...item,
196
- isEdit: false
197
- };
198
- });
199
- } else {
200
- this.getListData();
201
- }
202
- },
203
-
204
202
  clickInput () {
205
- if (!this.finalCanEdit) return;
206
- if (!this.renderList) {
207
- this.init();
208
- }
209
- this.renderList = true;
210
- this.listVisible = !this.listVisible;
211
- if (this.listVisible) {
212
- this.inputIcon = "ios-arrow-up";
213
- } else {
214
- 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;
215
218
  }
216
219
  },
217
220
  clickEditInput (e) {
218
221
  e.stopPropagation();
219
222
  },
220
- clickEditIcon (item) {
221
- item.isEdit = true;
223
+ clickEditIcon (listItem) {
224
+ listItem.isEdit = true;
222
225
  this.$forceUpdate();
223
226
  },
224
- clickConfirm (item) {
225
- if (item.name == "") return;
226
- item.isEdit = false;
227
- this.$forceUpdate();
228
- this.change();
227
+ clickConfirm (listItem) {
228
+ if (listItem.name) {
229
+ listItem.isEdit = false;
230
+ this.$forceUpdate();
231
+ };
229
232
  },
230
233
 
231
- clickItem (item) {
232
- if (this.val.findIndex(i => i._key == item._key) > -1) {
233
- 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);
234
237
  } else {
235
- this.val.push(item);
238
+ this.curValList = [...this.curValList, listItem];
236
239
  }
237
- this.change();
238
- },
239
- clickDeleteItem (item) {
240
- this.change();
241
240
  },
242
241
  clickAddItem () {
243
242
  this.listData.push({
244
243
  _key: this.$randomB36("Labels"),
245
244
  isEdit: true,
246
245
  name: "",
247
- labelType: this.selfPropsObj._labelType
246
+ labelType: this.labelType
248
247
  });
249
- this.change();
248
+ },
249
+ clickDeleteItem (deleteItem) {
250
+ this.curValList = this.curValList.filter(item => item._key !== deleteItem._key);
251
+ },
252
+ // 点击清除选择项
253
+ clickClear () {
254
+ this.curValList = [];
250
255
  },
251
256
 
252
257
  // 接口 -获取列表数据
@@ -258,10 +263,10 @@
258
263
  },
259
264
  params: {
260
265
  search: {
261
- entityKey: this.entityKey, // 当前工作表关联的数据表Key
262
- fieldKey: this.selfPropsObj._key === "_default" ? this.value._key : (this.selfPropsObj.__realKey__ || this.selfPropsObj._key), // 当前字段Key
263
- labelType: this.selfPropsObj._labelType,
264
- modKey: this.modKey
266
+ entityKey: this.entityKey,
267
+ modKey: this.modKey,
268
+ fieldKey: this.fieldKey, // 当前字段Key
269
+ labelType: this.labelType
265
270
  },
266
271
  pagination: {
267
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;
@@ -36,7 +36,7 @@
36
36
  <span>
37
37
  <Icon
38
38
  v-if="depart.children && depart.children.length"
39
- :type="iconType(depart)"
39
+ :type="getIcon(depart)"
40
40
  @click.stop="toggleChildren(depart)"
41
41
  />
42
42
  <span class="DepartmentMenu-item-name-text">
@@ -124,7 +124,7 @@
124
124
  };
125
125
  },
126
126
  computed: {
127
- iconType () {
127
+ getIcon () {
128
128
  return function (depart) {
129
129
  return depart.isShowChildren ? "ios-arrow-down" : "ios-arrow-forward";
130
130
  };
@@ -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>
@@ -121,9 +122,7 @@
121
122
  :indeterminate="false"
122
123
  :value="curCheckAll"
123
124
  @click.prevent.native="clickCheckAll"
124
- >
125
- 全选
126
- </Checkbox>
125
+ >全选</Checkbox>
127
126
  </div>
128
127
 
129
128
  <!-- 下 列表-->
@@ -182,7 +181,7 @@
182
181
  </span>
183
182
  <Icon
184
183
  class="list-item-delete"
185
- type="md-close"
184
+ type="ios-close-circle"
186
185
  @click="clickDeleteUserItem(userItem, userIndex, newValList)"
187
186
  />
188
187
  </span>
@@ -293,6 +292,10 @@
293
292
  highSearch () {
294
293
  return this.selfPropsObj._highSearch;
295
294
  },
295
+ inputIcon () {
296
+ return this.multiple ? "ios-people" : "ios-person";
297
+ },
298
+
296
299
  // 审签单定制需求使用字段
297
300
  transmit_type () {
298
301
  return this.selfPropsObj.transmit_type;
@@ -305,7 +308,7 @@
305
308
  },
306
309
 
307
310
  curCheckAll () {
308
- return this.userList.every(userItem => this.newValList.find(newItem => newItem._key == userItem._key));
311
+ return this.userList.every(userItem => this.newValList.find(newItem => newItem._key === userItem._key));
309
312
  },
310
313
  showVal () {
311
314
  return this.$isEmptyData(this.curValList)
@@ -36,7 +36,7 @@
36
36
  v-if="selfPropsObj.closable"
37
37
  slot="close"
38
38
  class="BriDrawer-close"
39
- type="md-close"
39
+ type="ios-close-circle"
40
40
  size="20"
41
41
  @click.stop="clickClose"
42
42
  />
@@ -4,6 +4,7 @@
4
4
  :trigger="trigger"
5
5
  :placement="placement"
6
6
  :transfer="transfer"
7
+ transfer-class-name="DshDropdown"
7
8
  >
8
9
  <slot>
9
10
  <Icon
@@ -41,7 +41,7 @@
41
41
  <Icon
42
42
  v-if="selfPropsObj.showSlotClose !== false"
43
43
  class="DshModal-close"
44
- type="md-close"
44
+ type="ios-close-circle"
45
45
  size="20"
46
46
  @click.native.stop="visibleChange(false)"
47
47
  />