bri-components 1.2.0 → 1.2.1
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/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/2.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/7.bri-components.min.js +1 -1
- package/lib/8.bri-components.min.js +1 -1
- package/lib/9.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +6 -6
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/abolish/DshFlatTable.vue +1 -1
- package/src/components/.DS_Store +0 -0
- package/src/components/controls/.DS_Store +0 -0
- package/src/components/controls/base/BriUpload/BriUpload.vue +2 -1
- package/src/components/controls/base/DshCascader/DshCascader.vue +53 -51
- package/src/components/controls/base/DshCascader/InfoCascader.vue +3 -4
- package/src/components/controls/base/DshCheckbox.vue +8 -8
- package/src/components/controls/base/DshSelect.vue +1 -1
- package/src/components/controls/controlMap.js +4 -0
- package/src/components/controls/controlMixin.js +14 -12
- package/src/components/controls/senior/.DS_Store +0 -0
- package/src/components/controls/senior/BriLabels.vue +169 -158
- package/src/components/controls/senior/selectDepartments.vue +380 -0
- package/src/components/controls/senior/selectUsers/DepartmentMenu.vue +191 -0
- package/src/components/controls/senior/selectUsers/selectUsers.vue +482 -0
- package/src/components/list/BriCard.vue +52 -0
- package/src/components/list/BriTreeItem.vue +110 -0
- package/src/components/small/DshTags.vue +1 -1
- package/src/index.js +7 -3
- package/src/styles/.DS_Store +0 -0
- package/src/styles/common/control.less +57 -54
- package/src/styles/components/.DS_Store +0 -0
- package/src/styles/components/controls/base/BriUpload/BriUpload.less +11 -3
- package/src/styles/components/controls/base/DshCascader/DshCascader.less +24 -77
- package/src/styles/components/controls/base/DshCheckbox.less +65 -69
- package/src/styles/components/controls/base/DshEditor.less +3 -2
- package/src/styles/components/controls/base/DshInput.less +4 -8
- package/src/styles/components/controls/base/DshNumber.less +2 -2
- package/src/styles/components/controls/base/DshSelect.less +3 -3
- package/src/styles/components/controls/senior/BriLabels.less +32 -118
- package/src/styles/components/controls/senior/cascaderTable.less +1 -1
- package/src/styles/components/controls/senior/flatTable.less +1 -1
- package/src/styles/components/controls/senior/selectDepartments.less +106 -0
- package/src/styles/components/controls/senior/selectUsers/DepartmentMenu.less +37 -0
- package/src/styles/components/controls/senior/selectUsers/index.less +2 -0
- package/src/styles/components/controls/senior/selectUsers/selectUsers.less +167 -0
- package/src/styles/components/form/DshDefaultSearch.less +1 -2
- package/src/styles/components/index.less +7 -3
- package/src/styles/components/list/BriCard.less +50 -0
- package/src/styles/components/list/BriTreeItem.less +50 -0
- package/src/styles/components/unit/DshFormItem.less +0 -1
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="selectUsers">
|
|
3
|
+
<bri-tooltip
|
|
4
|
+
:content="showVal"
|
|
5
|
+
placement="top"
|
|
6
|
+
:transfer="true"
|
|
7
|
+
maxWidth="200"
|
|
8
|
+
>
|
|
9
|
+
<!-- 编辑 -->
|
|
10
|
+
<div
|
|
11
|
+
v-if="canEdit"
|
|
12
|
+
:class="{
|
|
13
|
+
...commonClass,
|
|
14
|
+
'selectUsers-edit': true
|
|
15
|
+
}"
|
|
16
|
+
@mouseenter="isHover = true"
|
|
17
|
+
@mouseleave="isHover = false"
|
|
18
|
+
@click="clickInput"
|
|
19
|
+
>
|
|
20
|
+
<template v-if="!$isEmptyData(curValList)">
|
|
21
|
+
<dsh-tags
|
|
22
|
+
class="text"
|
|
23
|
+
:list="curValList"
|
|
24
|
+
:propsObj="{
|
|
25
|
+
disabled: !finalCanEdit
|
|
26
|
+
}"
|
|
27
|
+
@delete="clickDeleteItem"
|
|
28
|
+
></dsh-tags>
|
|
29
|
+
|
|
30
|
+
<Icon
|
|
31
|
+
v-if="selfPropsObj._clearable && isHover"
|
|
32
|
+
class="icon-close"
|
|
33
|
+
type="md-close"
|
|
34
|
+
@click.stop="clickClear"
|
|
35
|
+
/>
|
|
36
|
+
<Icon
|
|
37
|
+
v-else
|
|
38
|
+
class="icon-default"
|
|
39
|
+
:type="`${multiple ? 'ios-people' : 'ios-person'}`"
|
|
40
|
+
/>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<template v-else>
|
|
44
|
+
{{ emptyShowVal }}
|
|
45
|
+
</template>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<!-- 查看 -->
|
|
49
|
+
<div
|
|
50
|
+
v-else
|
|
51
|
+
:class="{
|
|
52
|
+
...commonClass,
|
|
53
|
+
'selectUsers-show': true
|
|
54
|
+
}"
|
|
55
|
+
>
|
|
56
|
+
<dsh-tags
|
|
57
|
+
v-if="!$isEmptyData(curValList)"
|
|
58
|
+
class="text"
|
|
59
|
+
:list="curValList"
|
|
60
|
+
:propsObj="{
|
|
61
|
+
closable: false
|
|
62
|
+
}"
|
|
63
|
+
></dsh-tags>
|
|
64
|
+
|
|
65
|
+
<template v-else>
|
|
66
|
+
{{ emptyShowVal }}
|
|
67
|
+
</template>
|
|
68
|
+
</div>
|
|
69
|
+
</bri-tooltip>
|
|
70
|
+
|
|
71
|
+
<!-- 搜索选择框 -->
|
|
72
|
+
<dsh-modal
|
|
73
|
+
v-if="finalCanEdit"
|
|
74
|
+
class="selectUsers-modal"
|
|
75
|
+
v-model="showModal"
|
|
76
|
+
:propsObj="modalPropsObj"
|
|
77
|
+
mode="custom"
|
|
78
|
+
@cancel="clickCancel"
|
|
79
|
+
>
|
|
80
|
+
<div class="selectUsers-modal-wrap">
|
|
81
|
+
<!-- 左 -->
|
|
82
|
+
<div class="selectUsers-modal-wrap-left">
|
|
83
|
+
<!-- 上 筛选 -->
|
|
84
|
+
<div
|
|
85
|
+
v-if="curDepartment._key !== '_highSearch'"
|
|
86
|
+
class="search"
|
|
87
|
+
>
|
|
88
|
+
<dsh-input
|
|
89
|
+
:value="searchData"
|
|
90
|
+
:propsObj="inputPropsObj"
|
|
91
|
+
@change="search"
|
|
92
|
+
></dsh-input>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<!-- 下 -->
|
|
96
|
+
<div class="content">
|
|
97
|
+
<!-- 左 部门 -->
|
|
98
|
+
<department-menu
|
|
99
|
+
class="content-menu"
|
|
100
|
+
:canEdit="false"
|
|
101
|
+
:list="departmentList"
|
|
102
|
+
@departClick="changeDepartment"
|
|
103
|
+
></department-menu>
|
|
104
|
+
|
|
105
|
+
<!-- 右 部门对应的成员 -->
|
|
106
|
+
<div class="content-users">
|
|
107
|
+
<bri-loading v-if="loading" />
|
|
108
|
+
|
|
109
|
+
<template v-else>
|
|
110
|
+
<!-- 有数据 -->
|
|
111
|
+
<div
|
|
112
|
+
v-if="userList.length"
|
|
113
|
+
class="content-users-list"
|
|
114
|
+
>
|
|
115
|
+
<!-- 上 全选 -->
|
|
116
|
+
<div
|
|
117
|
+
v-if="multiple"
|
|
118
|
+
class="content-users-list-checkAll"
|
|
119
|
+
>
|
|
120
|
+
<Checkbox
|
|
121
|
+
:indeterminate="false"
|
|
122
|
+
:value="curCheckAll"
|
|
123
|
+
@click.prevent.native="clickCheckAll"
|
|
124
|
+
>
|
|
125
|
+
全选
|
|
126
|
+
</Checkbox>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<!-- 下 列表-->
|
|
130
|
+
<div class="content-users-list-selects">
|
|
131
|
+
<div
|
|
132
|
+
v-for="userItem in userList"
|
|
133
|
+
:key="userItem._key"
|
|
134
|
+
class="content-users-list-selects-item"
|
|
135
|
+
>
|
|
136
|
+
<Checkbox
|
|
137
|
+
:value="isSelect(userItem._key)"
|
|
138
|
+
@on-change="clickSelectUserItem(userItem, ...arguments)"
|
|
139
|
+
>
|
|
140
|
+
{{ userItem.realname || userItem.mobile }}
|
|
141
|
+
</Checkbox>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<!-- 无数据 -->
|
|
147
|
+
<div
|
|
148
|
+
v-else
|
|
149
|
+
class="content-users-nodata"
|
|
150
|
+
>
|
|
151
|
+
<img
|
|
152
|
+
:src="$imageSrcMap.nodata"
|
|
153
|
+
alt="该部门暂无人员"
|
|
154
|
+
>
|
|
155
|
+
<div>
|
|
156
|
+
该部门暂无人员
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</template>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- 中 图标 -->
|
|
165
|
+
<div class="selectUsers-modal-wrap-center">
|
|
166
|
+
<Icon
|
|
167
|
+
class="icon"
|
|
168
|
+
type="ios-arrow-forward"
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<!-- 右 已选择项 -->
|
|
173
|
+
<div class="selectUsers-modal-wrap-right">
|
|
174
|
+
<div class="list">
|
|
175
|
+
<span
|
|
176
|
+
v-for="(userItem, userIndex) in newValList"
|
|
177
|
+
:key="userIndex"
|
|
178
|
+
class="list-item"
|
|
179
|
+
>
|
|
180
|
+
<span class="list-item-name">
|
|
181
|
+
{{ userItem.realname || userItem.mobile }}
|
|
182
|
+
</span>
|
|
183
|
+
<Icon
|
|
184
|
+
class="list-item-delete"
|
|
185
|
+
type="md-close"
|
|
186
|
+
@click="clickDeleteUserItem(userItem, userIndex, newValList)"
|
|
187
|
+
/>
|
|
188
|
+
</span>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<!-- footer -->
|
|
194
|
+
<div class="selectUsers-modal-wrap-footer">
|
|
195
|
+
<dsh-buttons
|
|
196
|
+
:list="$getOperationList(['cancel', 'confirm'])"
|
|
197
|
+
@click="$dispatchEvent($event)"
|
|
198
|
+
></dsh-buttons>
|
|
199
|
+
</div>
|
|
200
|
+
</dsh-modal>
|
|
201
|
+
</div>
|
|
202
|
+
</template>
|
|
203
|
+
|
|
204
|
+
<script>
|
|
205
|
+
import controlMixin from "../../controlMixin.js";
|
|
206
|
+
import departmentMenu from "./DepartmentMenu.vue";
|
|
207
|
+
|
|
208
|
+
export default {
|
|
209
|
+
name: "selectUsers",
|
|
210
|
+
mixins: [
|
|
211
|
+
controlMixin
|
|
212
|
+
],
|
|
213
|
+
components: {
|
|
214
|
+
departmentMenu
|
|
215
|
+
},
|
|
216
|
+
props: {
|
|
217
|
+
showSelectUserModalOnly: Boolean
|
|
218
|
+
},
|
|
219
|
+
data () {
|
|
220
|
+
return {
|
|
221
|
+
isHover: false,
|
|
222
|
+
|
|
223
|
+
// 弹框
|
|
224
|
+
newValList: [],
|
|
225
|
+
showModal: false,
|
|
226
|
+
modalPropsObj: {
|
|
227
|
+
title: "选择成员",
|
|
228
|
+
showSlotClose: false,
|
|
229
|
+
closable: true
|
|
230
|
+
},
|
|
231
|
+
// 筛选
|
|
232
|
+
searchData: {
|
|
233
|
+
name: ""
|
|
234
|
+
},
|
|
235
|
+
inputPropsObj: {
|
|
236
|
+
_name: "成员名称",
|
|
237
|
+
_key: "name",
|
|
238
|
+
_search: true,
|
|
239
|
+
_clearable: false
|
|
240
|
+
},
|
|
241
|
+
curDepartment: {},
|
|
242
|
+
hightUsers: [
|
|
243
|
+
{
|
|
244
|
+
_key: "dyn_myself",
|
|
245
|
+
realname: "当前用户"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
|
|
249
|
+
loading: false,
|
|
250
|
+
userList: [],
|
|
251
|
+
departmentList: [],
|
|
252
|
+
// 分页
|
|
253
|
+
total: 0,
|
|
254
|
+
pagePropsObj: {
|
|
255
|
+
page: 1,
|
|
256
|
+
pagesize: 500,
|
|
257
|
+
showSizer: false
|
|
258
|
+
},
|
|
259
|
+
isSelect (_key) {
|
|
260
|
+
return !!this.newValList.find(newItem => newItem._key === _key);
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
operationMap: {
|
|
264
|
+
cancel: {
|
|
265
|
+
name: "取消",
|
|
266
|
+
type: "clickCancel",
|
|
267
|
+
btnType: "cancel",
|
|
268
|
+
event: "clickCancel"
|
|
269
|
+
},
|
|
270
|
+
confirm: {
|
|
271
|
+
name: "完成",
|
|
272
|
+
btnType: "primary",
|
|
273
|
+
type: "clickConfirm",
|
|
274
|
+
event: "clickConfirm"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
computed: {
|
|
280
|
+
selfPropsObj () {
|
|
281
|
+
return {
|
|
282
|
+
_multiple: false,
|
|
283
|
+
_highSearch: false,
|
|
284
|
+
|
|
285
|
+
...this.propsObj,
|
|
286
|
+
...this.commonDealPropsObj
|
|
287
|
+
};
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
multiple () {
|
|
291
|
+
return this.selfPropsObj._multiple;
|
|
292
|
+
},
|
|
293
|
+
highSearch () {
|
|
294
|
+
return this.selfPropsObj._highSearch;
|
|
295
|
+
},
|
|
296
|
+
// 审签单定制需求使用字段
|
|
297
|
+
transmit_type () {
|
|
298
|
+
return this.selfPropsObj.transmit_type;
|
|
299
|
+
},
|
|
300
|
+
current_step_sp_user_key () {
|
|
301
|
+
return this.selfPropsObj.current_step_sp_user_key;
|
|
302
|
+
},
|
|
303
|
+
stepKey () {
|
|
304
|
+
return this.selfPropsObj.stepKey;
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
curCheckAll () {
|
|
308
|
+
return this.userList.every(userItem => this.newValList.find(newItem => newItem._key == userItem._key));
|
|
309
|
+
},
|
|
310
|
+
showVal () {
|
|
311
|
+
return this.$isEmptyData(this.curValList)
|
|
312
|
+
? this.emptyShowVal
|
|
313
|
+
: this.curValList.map(userItem => userItem.realname || userItem.mobile).join("、");
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
created () {},
|
|
317
|
+
methods: {
|
|
318
|
+
// 外部也在使用
|
|
319
|
+
openModal () {
|
|
320
|
+
this.showModal = true;
|
|
321
|
+
},
|
|
322
|
+
closeModal () {
|
|
323
|
+
this.showModal = false;
|
|
324
|
+
},
|
|
325
|
+
init () {
|
|
326
|
+
this.searchData = {
|
|
327
|
+
name: ""
|
|
328
|
+
};
|
|
329
|
+
this.curDepartment = {};
|
|
330
|
+
this.pagePropsObj.page = 1;
|
|
331
|
+
this.getUserList();
|
|
332
|
+
this.getDepartmentList();
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
search () {
|
|
336
|
+
this.pagePropsObj.page = 1;
|
|
337
|
+
this.getUserList();
|
|
338
|
+
},
|
|
339
|
+
// 选择部门
|
|
340
|
+
changeDepartment (departmentItem) {
|
|
341
|
+
this.pagePropsObj.page = 1;
|
|
342
|
+
this.curDepartment = departmentItem;
|
|
343
|
+
|
|
344
|
+
if (departmentItem._key === "_highSearch") {
|
|
345
|
+
this.userList = this.hightUsers;
|
|
346
|
+
this.total = 1;
|
|
347
|
+
} else {
|
|
348
|
+
this.getUserList();
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
clickInput () {
|
|
352
|
+
if (this.finalCanEdit) {
|
|
353
|
+
this.openModal();
|
|
354
|
+
this.newValList = this.$deepCopy(this.curValList);
|
|
355
|
+
this.init();
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
clickDeleteItem (deleteItem) {
|
|
359
|
+
this.curValList = this.curValList.filter(item => item._key !== deleteItem._key);
|
|
360
|
+
},
|
|
361
|
+
clickClear () {
|
|
362
|
+
this.curValList = [];
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
/* ---------- 弹框里 --------- */
|
|
366
|
+
clickCheckAll () {
|
|
367
|
+
if (this.curCheckAll) {
|
|
368
|
+
this.newValList = this.newValList.filter(newItem =>
|
|
369
|
+
!this.userList.some(userItem => newItem._key === userItem._key)
|
|
370
|
+
);
|
|
371
|
+
} else {
|
|
372
|
+
this.newValList = [
|
|
373
|
+
...this.newValList,
|
|
374
|
+
this.userList.filter(userItem =>
|
|
375
|
+
!this.newValList.some(newItem => newItem._key === userItem._key)
|
|
376
|
+
)
|
|
377
|
+
];
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
clickSelectUserItem (curUserItem, bool) {
|
|
381
|
+
if (this.multiple) {
|
|
382
|
+
if (this.newValList.some(newItem => newItem._key === curUserItem._key)) {
|
|
383
|
+
this.newValList = this.newValList.filter(newItem => newItem._key !== curUserItem._key);
|
|
384
|
+
} else {
|
|
385
|
+
this.newValList = [...this.newValList, curUserItem];
|
|
386
|
+
}
|
|
387
|
+
} else {
|
|
388
|
+
this.newValList = bool === true ? [curUserItem] : [];
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
clickDeleteUserItem (item, index, list) {
|
|
392
|
+
list.splice(index, 1);
|
|
393
|
+
},
|
|
394
|
+
clickCancel () {
|
|
395
|
+
this.closeModal();
|
|
396
|
+
},
|
|
397
|
+
clickConfirm () {
|
|
398
|
+
this.closeModal();
|
|
399
|
+
this.curValList = this.newValList;
|
|
400
|
+
},
|
|
401
|
+
|
|
402
|
+
/* ----------- 接口方法 ------------- */
|
|
403
|
+
getUserList () {
|
|
404
|
+
this.loading = true;
|
|
405
|
+
this.userList = [];
|
|
406
|
+
let searchName = this.searchData.name;
|
|
407
|
+
let search = {};
|
|
408
|
+
if (searchName && searchName !== "") {
|
|
409
|
+
search["realname"] = {
|
|
410
|
+
"$regex": `.*${this.$speciaWord(searchName)}.*`, $options: "i"
|
|
411
|
+
};
|
|
412
|
+
} else {
|
|
413
|
+
delete search["realname"];
|
|
414
|
+
}
|
|
415
|
+
this.$https({
|
|
416
|
+
url: {
|
|
417
|
+
module: "company",
|
|
418
|
+
name: "userIndex"
|
|
419
|
+
},
|
|
420
|
+
params: {
|
|
421
|
+
search: search,
|
|
422
|
+
department: this.curDepartment._key,
|
|
423
|
+
transmit_type: this.transmit_type,
|
|
424
|
+
current_step_sp_user_key: this.current_step_sp_user_key,
|
|
425
|
+
stepKey: this.stepKey,
|
|
426
|
+
pagination: {
|
|
427
|
+
page: this.pagePropsObj.page,
|
|
428
|
+
pagesize: this.pagePropsObj.pagesize
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
callback: data => {
|
|
432
|
+
this.total = data.total;
|
|
433
|
+
this.userList = data.list;
|
|
434
|
+
this.loading = false;
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
},
|
|
438
|
+
getDepartmentList () {
|
|
439
|
+
this.$https({
|
|
440
|
+
url: {
|
|
441
|
+
module: "company",
|
|
442
|
+
name: "compDepartCascaderAll"
|
|
443
|
+
},
|
|
444
|
+
params: {
|
|
445
|
+
transmit_type: this.transmit_type,
|
|
446
|
+
current_step_sp_user_key: this.current_step_sp_user_key,
|
|
447
|
+
stepKey: this.stepKey,
|
|
448
|
+
searchString: this.propsObj.searchString
|
|
449
|
+
},
|
|
450
|
+
callback: data => {
|
|
451
|
+
let depart = [{
|
|
452
|
+
is_leaf: true,
|
|
453
|
+
level: 1,
|
|
454
|
+
name: "全部",
|
|
455
|
+
_key: ""
|
|
456
|
+
}];
|
|
457
|
+
if (this.highSearch) {
|
|
458
|
+
depart.unshift({
|
|
459
|
+
is_leaf: true,
|
|
460
|
+
level: 1,
|
|
461
|
+
name: "高级选项",
|
|
462
|
+
_key: "_highSearch"
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
this.departmentList = depart.concat(data.list);
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
watch: {
|
|
471
|
+
showSelectUserModalOnly (nV, oV) {
|
|
472
|
+
nV && this.init();
|
|
473
|
+
nV && this.openModal();
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
filters: {
|
|
477
|
+
isActive (item, list) {
|
|
478
|
+
return list.some(o => o._key === item._key) ? "selectUsers-list-item-active" : "";
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="BriCard">
|
|
3
|
+
<template v-if="data.length">
|
|
4
|
+
<div
|
|
5
|
+
v-for="item in data"
|
|
6
|
+
:key="item._key"
|
|
7
|
+
class="item"
|
|
8
|
+
@click="change(item)"
|
|
9
|
+
>
|
|
10
|
+
<div :class="{
|
|
11
|
+
'item-normal': true,
|
|
12
|
+
'item-active': item.checked
|
|
13
|
+
}">
|
|
14
|
+
<span class="label">{{ item.name }}</span>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
v-else
|
|
21
|
+
class="BriCard-nodata"
|
|
22
|
+
>
|
|
23
|
+
暂无数据……
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
name: "BriCard",
|
|
31
|
+
mixins: [],
|
|
32
|
+
components: {},
|
|
33
|
+
props: {
|
|
34
|
+
data: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default () {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data () {
|
|
42
|
+
return {};
|
|
43
|
+
},
|
|
44
|
+
computed: {},
|
|
45
|
+
created () {},
|
|
46
|
+
methods: {
|
|
47
|
+
change () {
|
|
48
|
+
this.$emit("on-change", this.value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="BriTreeItem">
|
|
3
|
+
<!-- 当前节点 -->
|
|
4
|
+
<div class="BriTreeItem-content">
|
|
5
|
+
<!-- 展开icon -->
|
|
6
|
+
<div class="BriTreeItem-content-expand">
|
|
7
|
+
<i
|
|
8
|
+
v-if="hasChildren"
|
|
9
|
+
:class="{
|
|
10
|
+
'BriTreeItem-content-expand-icon': true,
|
|
11
|
+
'ivu-icon': true,
|
|
12
|
+
'ivu-icon-ios-arrow-down': expand,
|
|
13
|
+
'ivu-icon-ios-arrow-forward': !expand
|
|
14
|
+
}"
|
|
15
|
+
@click="toggleExpand"
|
|
16
|
+
></i>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<!-- 有选择框 意味着该节点可以选择 -->
|
|
20
|
+
<Checkbox
|
|
21
|
+
v-if="changeOnSelect || !hasChildren"
|
|
22
|
+
:class="{
|
|
23
|
+
'BriTreeItem-content-select': true,
|
|
24
|
+
'BriTreeItem-content-select-radio': !multiple
|
|
25
|
+
}"
|
|
26
|
+
v-model="value.checked"
|
|
27
|
+
@on-change="onChange(value)"
|
|
28
|
+
>
|
|
29
|
+
{{ value.title || value.name }}
|
|
30
|
+
</Checkbox>
|
|
31
|
+
<!-- 无选择框 -->
|
|
32
|
+
<span
|
|
33
|
+
v-else
|
|
34
|
+
class="BriTreeItem-content-text"
|
|
35
|
+
>
|
|
36
|
+
{{ value.title || value.name }}
|
|
37
|
+
</span>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<!-- 当前节点 的子节点列表 -->
|
|
41
|
+
<transition
|
|
42
|
+
name="default"
|
|
43
|
+
enter-class="default-enter"
|
|
44
|
+
leave-to-class="default-leave-to"
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
v-if="showChildren"
|
|
48
|
+
class="BriTreeItem-children"
|
|
49
|
+
>
|
|
50
|
+
<yc-tree-item
|
|
51
|
+
v-for="item in value.children"
|
|
52
|
+
:key="item._key"
|
|
53
|
+
:value="item"
|
|
54
|
+
:changeOnSelect="changeOnSelect"
|
|
55
|
+
:multiple="multiple"
|
|
56
|
+
@on-change="onChange"
|
|
57
|
+
></yc-tree-item>
|
|
58
|
+
</div>
|
|
59
|
+
</transition>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script>
|
|
64
|
+
export default {
|
|
65
|
+
name: "BriTreeItem",
|
|
66
|
+
props: {
|
|
67
|
+
value: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default: () => ({})
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
changeOnSelect: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: true
|
|
75
|
+
},
|
|
76
|
+
multiple: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
data () {
|
|
82
|
+
return {
|
|
83
|
+
expand: false
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
computed: {
|
|
87
|
+
hasChildren () {
|
|
88
|
+
return this.value.children && this.value.children.length;
|
|
89
|
+
},
|
|
90
|
+
showChildren () {
|
|
91
|
+
return this.expand && this.hasChildren;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
created () {
|
|
95
|
+
this.init();
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
init () {
|
|
99
|
+
this.expand = this.value.expand;
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
toggleExpand () {
|
|
103
|
+
this.expand = !this.expand;
|
|
104
|
+
},
|
|
105
|
+
onChange (item) {
|
|
106
|
+
this.$emit("on-change", item);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -12,8 +12,8 @@ import DshBox from "./components/list/DshBox/DshBox.vue";
|
|
|
12
12
|
import DshTable from "./components/list/DshBox/DshTable.vue";
|
|
13
13
|
import DshList from "./components/list/DshBox/DshList.vue";
|
|
14
14
|
|
|
15
|
-
import BriTable from "./components/list/BriTable.vue";
|
|
16
15
|
import BriFlatTable from "./components/list/BriFlatTable.vue";
|
|
16
|
+
import BriTable from "./components/list/BriTable.vue";
|
|
17
17
|
import DshCascaderTable from "./components/list/DshCascaderTable.vue";
|
|
18
18
|
import DshPage from "./components/list/DshPage.vue";
|
|
19
19
|
|
|
@@ -66,7 +66,9 @@ import Error403 from "./components/Error/Error403.vue";
|
|
|
66
66
|
import Error404 from "./components/Error/Error404.vue";
|
|
67
67
|
|
|
68
68
|
// list
|
|
69
|
+
import BriCard from "./components/list/BriCard.vue";
|
|
69
70
|
import BriTree from "./components/list/BriTree.vue";
|
|
71
|
+
import BriTreeItem from "./components/list/BriTreeItem.vue";
|
|
70
72
|
|
|
71
73
|
// controls
|
|
72
74
|
import BriInputs from "./components/controls/base/BriInputs.vue";
|
|
@@ -98,8 +100,8 @@ const map = {
|
|
|
98
100
|
DshTable,
|
|
99
101
|
DshList,
|
|
100
102
|
|
|
101
|
-
BriTable,
|
|
102
103
|
BriFlatTable, // 可取消全局
|
|
104
|
+
BriTable,
|
|
103
105
|
DshCascaderTable, // 可取消全局
|
|
104
106
|
DshPage,
|
|
105
107
|
|
|
@@ -186,9 +188,11 @@ export {
|
|
|
186
188
|
DshTable,
|
|
187
189
|
DshList,
|
|
188
190
|
|
|
191
|
+
BriCard,
|
|
192
|
+
BriFlatTable,
|
|
189
193
|
BriTable,
|
|
190
194
|
BriTree,
|
|
191
|
-
|
|
195
|
+
BriTreeItem,
|
|
192
196
|
DshCascaderTable,
|
|
193
197
|
DshPage,
|
|
194
198
|
|
|
Binary file
|