bri-components 1.5.21 → 1.6.0
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/README.md +83 -83
- package/lib/styles/bundle.css +12 -12
- package/lib/styles/font/fontello.svg +31 -31
- package/package.json +125 -125
- package/src/components/Error/Error403.vue +42 -42
- package/src/components/Error/Error404.vue +40 -40
- package/src/components/Error/Error500.vue +51 -51
- package/src/components/Error/error.less +162 -162
- package/src/components/Error/errorBack.vue +40 -40
- package/src/components/controls/DshControlInput.vue +195 -195
- package/src/components/controls/base/BriUpload/BriUpload.vue +434 -434
- package/src/components/controls/base/BriUpload/BriUploadImage.vue +377 -377
- package/src/components/controls/base/BriUpload/uploadList.vue +727 -727
- package/src/components/controls/base/BriUpload/uploadMixin.js +446 -446
- package/src/components/controls/base/DshCascader/DshCascader.vue +215 -215
- package/src/components/controls/base/DshCascader/components/cascaderModal.vue +366 -366
- package/src/components/controls/base/DshCascader/components/cascaderPicker.vue +416 -416
- package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -141
- package/src/components/controls/base/DshCascader/components/cascaderTree.vue +151 -151
- package/src/components/controls/base/DshCoordinates.vue +585 -577
- package/src/components/controls/base/DshDate/DshDate.vue +191 -191
- package/src/components/controls/base/DshDate/DshDaterange.vue +186 -186
- package/src/components/controls/base/DshDivider.vue +201 -201
- package/src/components/controls/base/DshEditor.vue +274 -274
- package/src/components/controls/base/DshInput/BriInputs.vue +166 -166
- package/src/components/controls/base/DshInput/DshInput.vue +260 -260
- package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +435 -435
- package/src/components/controls/base/DshNumber/BriInputNumber/mixins/emitter.js +34 -34
- package/src/components/controls/base/DshNumber/BriInputNumber/mixins/form.js +14 -14
- package/src/components/controls/base/DshNumber/BriInputNumber/utils/assist.js +322 -322
- package/src/components/controls/base/DshNumber/DshNumber.vue +143 -143
- package/src/components/controls/base/DshNumber/DshNumberange.vue +109 -109
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +168 -168
- package/src/components/controls/base/DshSelect/DshSelect.vue +180 -180
- package/src/components/controls/base/DshSelect/DshSelectAll.vue +269 -269
- package/src/components/controls/base/DshSwitch/DshSwitch.vue +115 -115
- package/src/components/controls/control.less +324 -324
- package/src/components/controls/controlMap.js +117 -117
- package/src/components/controls/extra/DshColor.vue +81 -81
- package/src/components/controls/extra/DshThemeColor.vue +100 -100
- package/src/components/controls/extra/DshThemeIcon.vue +122 -122
- package/src/components/controls/mixins/cascaderMixin.js +325 -325
- package/src/components/controls/mixins/cascaderPickerMixin.js +227 -227
- package/src/components/controls/mixins/cascaderTableMixin.js +130 -130
- package/src/components/controls/mixins/controlMixin.js +393 -393
- package/src/components/controls/mixins/dateMixin.js +149 -149
- package/src/components/controls/mixins/flatTableMixin.js +111 -111
- package/src/components/controls/mixins/numberMixin.js +112 -112
- package/src/components/controls/mixins/selectMixin.js +233 -233
- package/src/components/controls/mixins/switchMixin.js +87 -87
- package/src/components/controls/mixins/userAndDepartMixin.js +260 -260
- package/src/components/controls/senior/DshLabels.vue +333 -333
- package/src/components/controls/senior/DshPackage.vue +57 -57
- package/src/components/controls/senior/cascaderTable.vue +213 -213
- package/src/components/controls/senior/correlation.vue +135 -135
- package/src/components/controls/senior/flatTable.vue +138 -138
- package/src/components/controls/senior/selectDepartments.vue +399 -399
- package/src/components/controls/senior/selectUsers/departMenu.vue +293 -293
- package/src/components/controls/senior/selectUsers/selectUsers.vue +712 -712
- package/src/components/controls/special/DshBack.vue +42 -42
- package/src/components/controls/special/DshUndeveloped.vue +41 -41
- package/src/components/form/DshAdvSearch.vue +510 -510
- package/src/components/form/DshDefaultSearch.vue +260 -260
- package/src/components/form/DshForm.vue +494 -494
- package/src/components/form/searchMixin.js +376 -376
- package/src/components/list/BriCard.vue +95 -95
- package/src/components/list/BriTable.vue +205 -205
- package/src/components/list/BriTree.vue +529 -529
- package/src/components/list/BriTreeItem.vue +163 -163
- package/src/components/list/DshBox/DshBox.vue +219 -219
- package/src/components/list/DshBox/DshCard.vue +446 -446
- package/src/components/list/DshBox/DshCrossTable.vue +827 -827
- package/src/components/list/DshBox/DshList.vue +404 -404
- package/src/components/list/DshBox/DshPanel.vue +669 -669
- package/src/components/list/DshBox/DshSingleData.vue +119 -119
- package/src/components/list/DshBox/DshTable.vue +239 -239
- package/src/components/list/DshCascaderTable.vue +115 -115
- package/src/components/list/DshFlatTable.vue +337 -337
- package/src/components/list/DshPage.vue +194 -194
- package/src/components/list/DshTreeTable.vue +113 -113
- package/src/components/list/common/importModal.vue +243 -243
- package/src/components/list/common/quoteListModal.vue +206 -206
- package/src/components/list/mixins/DshCascaderTableMixin.js +278 -278
- package/src/components/list/mixins/DshFlatTableMixin.js +509 -509
- package/src/components/list/mixins/DshTreeTableMixin.js +286 -286
- package/src/components/list/mixins/tableBaseMixin.js +1653 -1653
- package/src/components/list/mixins/treeTableBaseMixin.js +145 -145
- package/src/components/other/BriAvatar.vue +166 -166
- package/src/components/other/BriCode.vue +125 -125
- package/src/components/other/BriCollapseTree.vue +207 -207
- package/src/components/other/BriGantt.vue +1087 -1087
- package/src/components/other/BriIframe.vue +116 -116
- package/src/components/other/BriLoading.vue +171 -171
- package/src/components/other/BriSvg.vue +27 -27
- package/src/components/other/DshColorPanel.vue +128 -128
- package/src/components/other/DshMenuNav.vue +188 -188
- package/src/components/small/BriButton.vue +71 -71
- package/src/components/small/BriDrawer.vue +169 -169
- package/src/components/small/BriTooltip.vue +87 -87
- package/src/components/small/DshBtnModal.vue +68 -68
- package/src/components/small/DshButtons.vue +324 -324
- package/src/components/small/DshDropdown.vue +225 -225
- package/src/components/small/DshIcons.vue +59 -59
- package/src/components/small/DshListRender.js +21 -21
- package/src/components/small/DshModal.vue +160 -160
- package/src/components/small/DshSteps.vue +141 -141
- package/src/components/small/DshTabs.vue +598 -598
- package/src/components/small/DshTabsSet.vue +309 -309
- package/src/components/small/DshTags.vue +251 -251
- package/src/components/small/DshTitle.vue +50 -50
- package/src/components/small/render.js +20 -20
- package/src/components/unit/DshFormUnit.vue +398 -398
- package/src/components/unit/DshListUnit.vue +115 -115
- package/src/components/unit/unitMixin.js +86 -86
- package/src/data/index.js +4 -4
- package/src/index.js +285 -285
- package/src/styles/bundle.css +12 -12
- package/src/styles/components/BriButton.less +307 -307
- package/src/styles/components/BriTable.less +344 -344
- package/src/styles/components/DshModal.less +257 -257
- package/src/styles/components/index.less +3 -3
- package/src/styles/global/animate.less +11 -11
- package/src/styles/global/base.less +45 -45
- package/src/styles/global/box.less +186 -186
- package/src/styles/global/control.less +122 -122
- package/src/styles/global/flex.less +282 -282
- package/src/styles/global/global.less +8 -8
- package/src/styles/global/text.less +59 -59
- package/src/styles/global/variables.less +85 -85
- package/src/styles/iconfont/iconfont.css +254 -254
- package/src/styles/iconfont/iconfont.json +422 -422
- package/src/styles/iconfont/iconfont.svg +137 -137
- package/src/styles/index.less +26 -26
- package/src/styles/reset-easytable.less +21 -21
- package/src/styles/reset-iview-controls.less +145 -145
- package/src/styles/reset-iview-other.less +49 -49
- package/src/styles/reset-iview-variables.less +43 -43
- package/src/styles/reset.less +45 -45
- package/src/utils/index.js +3 -5
- package/lib/0.bri-components.min.js +0 -1
- package/lib/1.bri-components.min.js +0 -1
- package/lib/10.bri-components.min.js +0 -1
- package/lib/11.bri-components.min.js +0 -1
- package/lib/2.bri-components.min.js +0 -1
- package/lib/3.bri-components.min.js +0 -1
- package/lib/4.bri-components.min.js +0 -1
- package/lib/5.bri-components.min.js +0 -1
- package/lib/6.bri-components.min.js +0 -1
- package/lib/7.bri-components.min.js +0 -1
- package/lib/8.bri-components.min.js +0 -1
- package/lib/9.bri-components.min.js +0 -1
- package/lib/bri-components.min.js +0 -18
- package/src/utils/table.js +0 -175
|
@@ -1,669 +1,669 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="DshPanel">
|
|
3
|
-
<!-- 加载 -->
|
|
4
|
-
<bri-loading
|
|
5
|
-
v-if="isLoading"
|
|
6
|
-
class="DshPanel-loading"
|
|
7
|
-
></bri-loading>
|
|
8
|
-
<template v-else>
|
|
9
|
-
<!-- 有数据 -->
|
|
10
|
-
<template v-if="data.length">
|
|
11
|
-
<div
|
|
12
|
-
v-for="(groupItem, groupIndex) in data"
|
|
13
|
-
:key="groupIndex"
|
|
14
|
-
class="DshPanel-group"
|
|
15
|
-
>
|
|
16
|
-
<!-- 组 标头 -->
|
|
17
|
-
<div
|
|
18
|
-
class="DshPanel-group-header"
|
|
19
|
-
:style="{
|
|
20
|
-
'border-color': getBgColor(groupItem)
|
|
21
|
-
}"
|
|
22
|
-
>
|
|
23
|
-
<!-- 左 -->
|
|
24
|
-
<Checkbox
|
|
25
|
-
v-if="multiple"
|
|
26
|
-
class="header-checkbox"
|
|
27
|
-
v-model="groupItem.isSelectAll"
|
|
28
|
-
@on-change="selectGroupAll(groupItem, $event)"
|
|
29
|
-
></Checkbox>
|
|
30
|
-
|
|
31
|
-
<!-- 左 -->
|
|
32
|
-
<div class="header-left">
|
|
33
|
-
<bri-tooltip
|
|
34
|
-
:content="groupItem.name"
|
|
35
|
-
placement="top"
|
|
36
|
-
:transfer="true"
|
|
37
|
-
class="header-left-tooltip"
|
|
38
|
-
>
|
|
39
|
-
<span class="header-left-name">
|
|
40
|
-
{{ groupItem.name }}
|
|
41
|
-
</span>
|
|
42
|
-
</bri-tooltip>
|
|
43
|
-
<span
|
|
44
|
-
class="header-left-num"
|
|
45
|
-
:style="{
|
|
46
|
-
'color': getBgColor(groupItem)
|
|
47
|
-
}"
|
|
48
|
-
>
|
|
49
|
-
{{ groupItem.total }}
|
|
50
|
-
</span>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<!-- 右 -->
|
|
54
|
-
<span class="header-right">
|
|
55
|
-
<dsh-buttons
|
|
56
|
-
:list="groupBtnOperationList"
|
|
57
|
-
@click="$dshEmit($event, { [groupField]: groupItem._key })"
|
|
58
|
-
></dsh-buttons>
|
|
59
|
-
</span>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<!-- 组 数据列 -->
|
|
63
|
-
<div class="DshPanel-group-list">
|
|
64
|
-
<div :class="{
|
|
65
|
-
'list': true,
|
|
66
|
-
'list-nodata': !groupItem.list.length
|
|
67
|
-
}">
|
|
68
|
-
<CheckboxGroup
|
|
69
|
-
class="list-drag"
|
|
70
|
-
v-model="groupItem.selectIds"
|
|
71
|
-
@on-change="selectRow(groupItem, $event)"
|
|
72
|
-
>
|
|
73
|
-
<dsh-draggable
|
|
74
|
-
class="list-drag-draggable"
|
|
75
|
-
v-model="groupItem.list"
|
|
76
|
-
group="panel"
|
|
77
|
-
animation="300"
|
|
78
|
-
:disabled="!dragOperationObj"
|
|
79
|
-
@update="$dshEmit(dragOperationObj, $event, groupItem, data.find(item => item._key === $event.from.id), { [groupField]: groupItem._key })"
|
|
80
|
-
@add="$dshEmit(dragOperationObj, $event, groupItem, data.find(item => item._key === $event.from.id), { [groupField]: groupItem._key })"
|
|
81
|
-
>
|
|
82
|
-
<transition-group
|
|
83
|
-
:id="groupItem._key"
|
|
84
|
-
class="list-drag-transition"
|
|
85
|
-
@scroll.native="groupScroll(groupItem, groupIndex, $event)"
|
|
86
|
-
>
|
|
87
|
-
<div
|
|
88
|
-
v-for="(dataItem, dataIndex) in groupItem.list"
|
|
89
|
-
:key="dataItem._id"
|
|
90
|
-
:id="dataItem._id"
|
|
91
|
-
class="row-item"
|
|
92
|
-
@click="clickRow(dataItem, dataIndex)"
|
|
93
|
-
>
|
|
94
|
-
<dsh-icons
|
|
95
|
-
v-if="dragOperationObj"
|
|
96
|
-
class="row-item-move"
|
|
97
|
-
:list="[{
|
|
98
|
-
customIcon: 'bico-tuodong',
|
|
99
|
-
size: '14px'
|
|
100
|
-
}]"
|
|
101
|
-
></dsh-icons>
|
|
102
|
-
<!-- 内容 -->
|
|
103
|
-
<div class="row-item-info">
|
|
104
|
-
<div class="title">
|
|
105
|
-
<!-- 复选框 -->
|
|
106
|
-
<Checkbox
|
|
107
|
-
v-if="multiple"
|
|
108
|
-
class="title-checkbox"
|
|
109
|
-
:label="dataItem._id"
|
|
110
|
-
@click.native.stop="clickRowCheckbox(dataItem)"
|
|
111
|
-
>{{ "" }}</Checkbox>
|
|
112
|
-
|
|
113
|
-
<!-- 标题 -->
|
|
114
|
-
<bri-tooltip
|
|
115
|
-
class="title-tooltip"
|
|
116
|
-
:content="dataItem[titleField]"
|
|
117
|
-
placement="top"
|
|
118
|
-
:transfer="true"
|
|
119
|
-
>
|
|
120
|
-
<div class="title-name">
|
|
121
|
-
{{ dataItem[titleField] }}
|
|
122
|
-
</div>
|
|
123
|
-
</bri-tooltip>
|
|
124
|
-
<!-- 下拉操作 -->
|
|
125
|
-
<dsh-dropdown
|
|
126
|
-
v-if="operationList.length"
|
|
127
|
-
class="title-dropdown"
|
|
128
|
-
:dropdownObj="dropdownObj"
|
|
129
|
-
:list="operationList"
|
|
130
|
-
@click="$dshEmit($event, dataItem, dataIndex)"
|
|
131
|
-
@click.native.stop="0"
|
|
132
|
-
></dsh-dropdown>
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<!-- 显示字段 -->
|
|
136
|
-
<div
|
|
137
|
-
v-for="colItem in selfColumns"
|
|
138
|
-
:key="colItem._key"
|
|
139
|
-
class="unit"
|
|
140
|
-
>
|
|
141
|
-
<dsh-list-render
|
|
142
|
-
v-if="colItem.renderBodyCell"
|
|
143
|
-
:row="dataItem"
|
|
144
|
-
:column="colItem"
|
|
145
|
-
:index="0"
|
|
146
|
-
:render="colItem.renderBodyCell"
|
|
147
|
-
></dsh-list-render>
|
|
148
|
-
|
|
149
|
-
<div
|
|
150
|
-
v-else-if="colItem.formatter"
|
|
151
|
-
v-html="colItem.formatter(dataItem, 0)"
|
|
152
|
-
></div>
|
|
153
|
-
|
|
154
|
-
<span
|
|
155
|
-
v-else
|
|
156
|
-
class="unit-control-text"
|
|
157
|
-
>
|
|
158
|
-
{{ dataItem[colItem._key] }}
|
|
159
|
-
</span>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</transition-group>
|
|
164
|
-
</dsh-draggable>
|
|
165
|
-
</CheckboxGroup>
|
|
166
|
-
|
|
167
|
-
<!-- 空数据 -->
|
|
168
|
-
<bri-loading
|
|
169
|
-
v-if="!groupItem.list.length"
|
|
170
|
-
class="list-loading"
|
|
171
|
-
:value="2"
|
|
172
|
-
:noText="selfPropsObj.noDataText"
|
|
173
|
-
></bri-loading>
|
|
174
|
-
<!-- 提示语 -->
|
|
175
|
-
<div
|
|
176
|
-
v-if="groupItem.loading"
|
|
177
|
-
class="list-tip"
|
|
178
|
-
:style="{
|
|
179
|
-
paddingTop: '3px',
|
|
180
|
-
paddingBottom: '5px'
|
|
181
|
-
}"
|
|
182
|
-
>
|
|
183
|
-
{{ getTip(groupItem) }}
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
188
|
-
</template>
|
|
189
|
-
|
|
190
|
-
<!-- 无数据 -->
|
|
191
|
-
<div
|
|
192
|
-
v-else
|
|
193
|
-
class="DshCard-nodata"
|
|
194
|
-
>
|
|
195
|
-
{{ noDataText }}
|
|
196
|
-
</div>
|
|
197
|
-
</template>
|
|
198
|
-
</div>
|
|
199
|
-
</template>
|
|
200
|
-
|
|
201
|
-
<script>
|
|
202
|
-
import { resourceData } from "../../../data/index.js";
|
|
203
|
-
|
|
204
|
-
export default {
|
|
205
|
-
name: "DshPanel",
|
|
206
|
-
props: {
|
|
207
|
-
isLoading: {
|
|
208
|
-
type: Boolean,
|
|
209
|
-
default: false
|
|
210
|
-
},
|
|
211
|
-
data: {
|
|
212
|
-
type: Array,
|
|
213
|
-
default () {
|
|
214
|
-
return [];
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
columns: {
|
|
218
|
-
type: Array,
|
|
219
|
-
default () {
|
|
220
|
-
return [];
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
propsObj: {
|
|
224
|
-
type: Object,
|
|
225
|
-
default () {
|
|
226
|
-
return {};
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
operationList: {
|
|
231
|
-
type: Array,
|
|
232
|
-
default () {
|
|
233
|
-
return [];
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
extraOperationList: {
|
|
237
|
-
type: Array,
|
|
238
|
-
default () {
|
|
239
|
-
return [];
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
data () {
|
|
244
|
-
return {
|
|
245
|
-
selections: [],
|
|
246
|
-
// curRow: null // 可以不声明
|
|
247
|
-
|
|
248
|
-
// 下拉菜单的配置
|
|
249
|
-
dropdownObj: {
|
|
250
|
-
icon: "ios-more",
|
|
251
|
-
size: 22,
|
|
252
|
-
showDropdownItemIcon: false
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
},
|
|
256
|
-
computed: {
|
|
257
|
-
selfPropsObj () {
|
|
258
|
-
return {
|
|
259
|
-
multiple: false,
|
|
260
|
-
groupField: "",
|
|
261
|
-
titleField: "",
|
|
262
|
-
loadingText: "加载中,请稍等……",
|
|
263
|
-
finishedText: "暂无更多数据!",
|
|
264
|
-
noDataText: "暂无数据",
|
|
265
|
-
|
|
266
|
-
...this.propsObj
|
|
267
|
-
};
|
|
268
|
-
},
|
|
269
|
-
multiple () {
|
|
270
|
-
return !!this.selfPropsObj.multiple;
|
|
271
|
-
},
|
|
272
|
-
loadingText () {
|
|
273
|
-
return this.selfPropsObj.loadingText;
|
|
274
|
-
},
|
|
275
|
-
finishedText () {
|
|
276
|
-
return this.selfPropsObj.finishedText;
|
|
277
|
-
},
|
|
278
|
-
noDataText () {
|
|
279
|
-
return this.selfPropsObj.noDataText;
|
|
280
|
-
},
|
|
281
|
-
groupField () {
|
|
282
|
-
return this.selfPropsObj.groupField;
|
|
283
|
-
},
|
|
284
|
-
groupFieldObj () {
|
|
285
|
-
return this.columns.find(colItem => colItem._key === this.groupField) || {};
|
|
286
|
-
},
|
|
287
|
-
groupData () {
|
|
288
|
-
return this.groupFieldObj._data || [];
|
|
289
|
-
},
|
|
290
|
-
titleField () {
|
|
291
|
-
return this.selfPropsObj.titleField;
|
|
292
|
-
},
|
|
293
|
-
// titleFieldObj () {
|
|
294
|
-
// return this.columns.find(colItem => colItem._key === this.titleField) || {};
|
|
295
|
-
// },
|
|
296
|
-
selfColumns () {
|
|
297
|
-
return this.columns
|
|
298
|
-
.filter(colItem => ![this.groupField, this.titleField].includes(colItem._key))
|
|
299
|
-
.slice(0, 1);
|
|
300
|
-
},
|
|
301
|
-
groupBtnOperationList () {
|
|
302
|
-
return this.extraOperationList
|
|
303
|
-
.filter(item =>
|
|
304
|
-
["canCreate", "canCustomCreate"].includes(item.type) || item.type.includes("canCustomCreate")
|
|
305
|
-
)
|
|
306
|
-
.map(item => ({
|
|
307
|
-
...item,
|
|
308
|
-
name: "",
|
|
309
|
-
btnType: "text",
|
|
310
|
-
size: "small"
|
|
311
|
-
}));
|
|
312
|
-
},
|
|
313
|
-
dragOperationObj () {
|
|
314
|
-
return this.extraOperationList.find(item =>
|
|
315
|
-
["canDrag", "canCustomDrag"].includes(item.type) || item.type.includes("canCustomDrag")
|
|
316
|
-
);
|
|
317
|
-
},
|
|
318
|
-
|
|
319
|
-
selectIds: {
|
|
320
|
-
get () {
|
|
321
|
-
return this.selections.map(item => item._id);
|
|
322
|
-
},
|
|
323
|
-
set (val) {
|
|
324
|
-
this.selections = this.data
|
|
325
|
-
.reduce((arr, groupItem) => [...arr, ...groupItem.list], [])
|
|
326
|
-
.filter(item => val.includes(item._id));
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
created () {},
|
|
331
|
-
mounted () {
|
|
332
|
-
this.initGroupScroll();
|
|
333
|
-
},
|
|
334
|
-
methods: {
|
|
335
|
-
// 初始化是否滚动加载
|
|
336
|
-
initGroupScroll () {
|
|
337
|
-
const groupDoms = this.$el.querySelectorAll(".list-drag-transition");
|
|
338
|
-
const groupDomsArr = Array.prototype.slice.call(groupDoms);
|
|
339
|
-
groupDomsArr.forEach((groupElement, groupIndex) => {
|
|
340
|
-
const groupItem = this.data[groupIndex];
|
|
341
|
-
|
|
342
|
-
this.groupLoad(groupItem, groupElement);
|
|
343
|
-
groupElement.addEventListener("DOMSubtreeModified", (ele) => {
|
|
344
|
-
this.groupLoad(groupItem, groupElement);
|
|
345
|
-
}, false);
|
|
346
|
-
});
|
|
347
|
-
},
|
|
348
|
-
// 分组滚动条滚动
|
|
349
|
-
groupScroll (groupItem, groupIndex, e) {
|
|
350
|
-
const groupElement = e.srcElement;
|
|
351
|
-
|
|
352
|
-
this.$emit("groupScroll", groupItem, e);
|
|
353
|
-
this.groupLoad(groupItem, groupElement);
|
|
354
|
-
},
|
|
355
|
-
// 判断是否要滚动加载
|
|
356
|
-
groupLoad (groupItem, groupElement) {
|
|
357
|
-
if (
|
|
358
|
-
groupItem &&
|
|
359
|
-
groupItem.loading !== true &&
|
|
360
|
-
groupItem.finished !== true &&
|
|
361
|
-
groupElement.children.length === groupItem.list.length &&
|
|
362
|
-
groupElement.clientHeight + groupElement.scrollTop > groupElement.scrollHeight - 80
|
|
363
|
-
) {
|
|
364
|
-
this.$emit("groupLoad", groupItem, groupElement);
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
// 点击某行
|
|
369
|
-
clickRow (row) {
|
|
370
|
-
this.$emit("clickRow", row);
|
|
371
|
-
},
|
|
372
|
-
// 点击某行的选择框
|
|
373
|
-
clickRowCheckbox (row) {
|
|
374
|
-
this.curRow = row;
|
|
375
|
-
this.curRow.bool = !this.selectIds.includes(row._id);
|
|
376
|
-
},
|
|
377
|
-
|
|
378
|
-
// 切换全选
|
|
379
|
-
selectGroupAll (groupItem, bool) {
|
|
380
|
-
const groupListIds = groupItem.list.map(item => item._id);
|
|
381
|
-
groupItem.selectIds = groupItem.isSelectAll === true
|
|
382
|
-
? groupListIds
|
|
383
|
-
: [];
|
|
384
|
-
this.selectIds = groupItem.isSelectAll === true
|
|
385
|
-
? [...new Set([...this.selectIds, ...groupListIds])]
|
|
386
|
-
: this.selectIds.filter(id => !groupListIds.includes(id));
|
|
387
|
-
|
|
388
|
-
this.$emit("selectAll", this.selectIds, this.selections, groupItem.isSelectAll);
|
|
389
|
-
this.changeSelect();
|
|
390
|
-
},
|
|
391
|
-
// 选择行
|
|
392
|
-
selectRow (groupItem, ids) {
|
|
393
|
-
const groupListIds = groupItem.list.map(item => item._id);
|
|
394
|
-
this.selectIds = [
|
|
395
|
-
...this.selectIds.filter(id => !groupListIds.includes(id)),
|
|
396
|
-
...groupItem.selectIds
|
|
397
|
-
];
|
|
398
|
-
groupItem.isSelectAll = groupListIds.length > 0 && groupItem.selectIds.length === groupListIds.length;
|
|
399
|
-
|
|
400
|
-
this.$emit("selectRow", this.selectIds, this.selections, this.curRow.bool, this.curRow);
|
|
401
|
-
this.changeSelect();
|
|
402
|
-
},
|
|
403
|
-
// 改变选择项
|
|
404
|
-
changeSelect () {
|
|
405
|
-
this.$emit("changeSelect", this.selectIds, this.selections);
|
|
406
|
-
},
|
|
407
|
-
|
|
408
|
-
/* -------- 方法 -------- */
|
|
409
|
-
getBgColor (groupItem) {
|
|
410
|
-
const colorType = (this.groupData.find(item => item._key === groupItem._key) || { color: "color-default" }).color;
|
|
411
|
-
return this.groupFieldObj._useColor
|
|
412
|
-
? resourceData.colorMap[colorType]
|
|
413
|
-
: resourceData.colorMap["color-default"];
|
|
414
|
-
},
|
|
415
|
-
getTip (groupItem) {
|
|
416
|
-
return !groupItem.list.length
|
|
417
|
-
? this.noDataText
|
|
418
|
-
: groupItem.loading
|
|
419
|
-
? this.loadingText
|
|
420
|
-
: groupItem.finished
|
|
421
|
-
? this.finishedText
|
|
422
|
-
: "滑动加载更多数据...";
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
watch: {
|
|
426
|
-
data () {
|
|
427
|
-
this.initGroupScroll();
|
|
428
|
-
this.data.forEach(groupItem => {
|
|
429
|
-
groupItem.isSelectAll = groupItem.list.length > 0 && groupItem.selectIds.length === groupItem.list.length;
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
</script>
|
|
435
|
-
|
|
436
|
-
<style lang="less" scoped>
|
|
437
|
-
.DshPanel {
|
|
438
|
-
min-width: 100%;
|
|
439
|
-
height: 100%;
|
|
440
|
-
display: flex;
|
|
441
|
-
flex-direction: row;
|
|
442
|
-
overflow: auto;
|
|
443
|
-
.bri-scrollbar6();
|
|
444
|
-
|
|
445
|
-
&-group {
|
|
446
|
-
width: 254px;
|
|
447
|
-
min-width:254px;
|
|
448
|
-
max-width:254px;
|
|
449
|
-
height: 100%;
|
|
450
|
-
overflow: hidden;
|
|
451
|
-
display: flex;
|
|
452
|
-
flex-direction: column;
|
|
453
|
-
background: #fff;
|
|
454
|
-
padding: 0 8px;
|
|
455
|
-
|
|
456
|
-
&:first-of-type {
|
|
457
|
-
padding-left: 0px;
|
|
458
|
-
}
|
|
459
|
-
&:last-of-type {
|
|
460
|
-
padding-right: 0px;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
&-header {
|
|
464
|
-
width: 100%;
|
|
465
|
-
height: 34px;
|
|
466
|
-
padding-bottom: 10px;
|
|
467
|
-
margin-bottom: 8px;
|
|
468
|
-
font-size: 14px;
|
|
469
|
-
border-bottom: 2px solid @themeColor;
|
|
470
|
-
display: flex;
|
|
471
|
-
justify-content: space-between;
|
|
472
|
-
align-items: center;
|
|
473
|
-
|
|
474
|
-
.header {
|
|
475
|
-
&-left {
|
|
476
|
-
flex: 1;
|
|
477
|
-
min-width: 0px;
|
|
478
|
-
display: flex;
|
|
479
|
-
&-tooltip {
|
|
480
|
-
max-width: calc(100% - 20px);
|
|
481
|
-
width: auto!important;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
&-name {
|
|
485
|
-
.dsh-ellipsis();
|
|
486
|
-
font-size: 16px;
|
|
487
|
-
font-weight: 500;
|
|
488
|
-
line-height: 24px;
|
|
489
|
-
color: @textColor;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
&-num {
|
|
493
|
-
color: @themeColor;
|
|
494
|
-
font-size: 16px;
|
|
495
|
-
font-weight: 500;
|
|
496
|
-
line-height: 24px;
|
|
497
|
-
margin-left: 8px;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
&-right {
|
|
502
|
-
margin-left: 5px;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
&-list {
|
|
508
|
-
width: 100%;
|
|
509
|
-
flex: 1;
|
|
510
|
-
min-height: 0px;
|
|
511
|
-
border-top: none;
|
|
512
|
-
display: flex;
|
|
513
|
-
flex-direction: column;
|
|
514
|
-
justify-content: space-between;
|
|
515
|
-
background: #f5f5f5;
|
|
516
|
-
border-radius: 4px;
|
|
517
|
-
|
|
518
|
-
.list {
|
|
519
|
-
width: 100%;
|
|
520
|
-
flex: 1;
|
|
521
|
-
min-height: 0px;
|
|
522
|
-
display: flex;
|
|
523
|
-
flex-direction: column;
|
|
524
|
-
|
|
525
|
-
&-drag {
|
|
526
|
-
width: 100%;
|
|
527
|
-
flex: 1;
|
|
528
|
-
min-height: 0px;
|
|
529
|
-
overflow: hidden;
|
|
530
|
-
|
|
531
|
-
&-draggable {
|
|
532
|
-
width: 100%;
|
|
533
|
-
height: 100%;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
&-transition {
|
|
537
|
-
display: block;
|
|
538
|
-
width: 100%;
|
|
539
|
-
height: 100%;
|
|
540
|
-
padding: 8px;
|
|
541
|
-
overflow: auto;
|
|
542
|
-
.bri-scrollbar6();
|
|
543
|
-
|
|
544
|
-
.row-item {
|
|
545
|
-
min-height: 70px;
|
|
546
|
-
margin-bottom: 8px;
|
|
547
|
-
padding: 8px;
|
|
548
|
-
border-radius: 4px;
|
|
549
|
-
background: #fff;
|
|
550
|
-
border: 1px solid #fff;
|
|
551
|
-
cursor: pointer;
|
|
552
|
-
overflow: hidden;
|
|
553
|
-
position: relative;
|
|
554
|
-
&:hover {
|
|
555
|
-
border-color: @themeColor;
|
|
556
|
-
.row-item-move {
|
|
557
|
-
display: block;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
&-move {
|
|
562
|
-
position: absolute;
|
|
563
|
-
bottom: 0px;
|
|
564
|
-
right: 0px;
|
|
565
|
-
background: @themeColor;
|
|
566
|
-
color: #fff;
|
|
567
|
-
width: 16px;
|
|
568
|
-
height: 16px;
|
|
569
|
-
border-top-left-radius: 4px;
|
|
570
|
-
line-height: 14px;
|
|
571
|
-
text-align: center;
|
|
572
|
-
display: none;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
&-info {
|
|
576
|
-
.title {
|
|
577
|
-
display: flex;
|
|
578
|
-
align-items: center;
|
|
579
|
-
justify-content: space-around;
|
|
580
|
-
margin-bottom: 4px;
|
|
581
|
-
&-tooltip {
|
|
582
|
-
flex: 1;
|
|
583
|
-
width: auto;
|
|
584
|
-
white-space: nowrap;
|
|
585
|
-
overflow: hidden;
|
|
586
|
-
text-overflow: ellipsis;
|
|
587
|
-
}
|
|
588
|
-
&-name {
|
|
589
|
-
.dsh-ellipsis();
|
|
590
|
-
color: @textColor;
|
|
591
|
-
font-size: 14px;
|
|
592
|
-
line-height: 22px;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
&-right {
|
|
596
|
-
margin-left: 4px;
|
|
597
|
-
color: @contentColor;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.unit {
|
|
602
|
-
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
&:last-child {
|
|
607
|
-
margin-bottom: 0px;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
&-tip {
|
|
614
|
-
#dsh-nodata-small();
|
|
615
|
-
line-height: 16px;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
&-loading {
|
|
619
|
-
height: calc(100% - 100px);
|
|
620
|
-
margin-bottom: 10px;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
&-nodata {
|
|
624
|
-
background: #fff;
|
|
625
|
-
border: 1px solid @borderColor;
|
|
626
|
-
border-radius: 4px;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
</style>
|
|
633
|
-
<style lang="less">
|
|
634
|
-
.DshPanel {
|
|
635
|
-
&-group {
|
|
636
|
-
&-header {
|
|
637
|
-
.ivu-tooltip-rel {
|
|
638
|
-
width: 100%;
|
|
639
|
-
}
|
|
640
|
-
.ivu-checkbox-inner {
|
|
641
|
-
outline: none;
|
|
642
|
-
box-shadow: none;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
.BriButton {
|
|
646
|
-
width: 24px;
|
|
647
|
-
padding: 0px;
|
|
648
|
-
color: @contentColor;
|
|
649
|
-
span {
|
|
650
|
-
display: none;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
&-list {
|
|
656
|
-
.list {
|
|
657
|
-
&-loading {
|
|
658
|
-
svg {
|
|
659
|
-
width: 70%;
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
.ivu-tooltip-rel {
|
|
663
|
-
width: 100%;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="DshPanel">
|
|
3
|
+
<!-- 加载 -->
|
|
4
|
+
<bri-loading
|
|
5
|
+
v-if="isLoading"
|
|
6
|
+
class="DshPanel-loading"
|
|
7
|
+
></bri-loading>
|
|
8
|
+
<template v-else>
|
|
9
|
+
<!-- 有数据 -->
|
|
10
|
+
<template v-if="data.length">
|
|
11
|
+
<div
|
|
12
|
+
v-for="(groupItem, groupIndex) in data"
|
|
13
|
+
:key="groupIndex"
|
|
14
|
+
class="DshPanel-group"
|
|
15
|
+
>
|
|
16
|
+
<!-- 组 标头 -->
|
|
17
|
+
<div
|
|
18
|
+
class="DshPanel-group-header"
|
|
19
|
+
:style="{
|
|
20
|
+
'border-color': getBgColor(groupItem)
|
|
21
|
+
}"
|
|
22
|
+
>
|
|
23
|
+
<!-- 左 -->
|
|
24
|
+
<Checkbox
|
|
25
|
+
v-if="multiple"
|
|
26
|
+
class="header-checkbox"
|
|
27
|
+
v-model="groupItem.isSelectAll"
|
|
28
|
+
@on-change="selectGroupAll(groupItem, $event)"
|
|
29
|
+
></Checkbox>
|
|
30
|
+
|
|
31
|
+
<!-- 左 -->
|
|
32
|
+
<div class="header-left">
|
|
33
|
+
<bri-tooltip
|
|
34
|
+
:content="groupItem.name"
|
|
35
|
+
placement="top"
|
|
36
|
+
:transfer="true"
|
|
37
|
+
class="header-left-tooltip"
|
|
38
|
+
>
|
|
39
|
+
<span class="header-left-name">
|
|
40
|
+
{{ groupItem.name }}
|
|
41
|
+
</span>
|
|
42
|
+
</bri-tooltip>
|
|
43
|
+
<span
|
|
44
|
+
class="header-left-num"
|
|
45
|
+
:style="{
|
|
46
|
+
'color': getBgColor(groupItem)
|
|
47
|
+
}"
|
|
48
|
+
>
|
|
49
|
+
{{ groupItem.total }}
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<!-- 右 -->
|
|
54
|
+
<span class="header-right">
|
|
55
|
+
<dsh-buttons
|
|
56
|
+
:list="groupBtnOperationList"
|
|
57
|
+
@click="$dshEmit($event, { [groupField]: groupItem._key })"
|
|
58
|
+
></dsh-buttons>
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<!-- 组 数据列 -->
|
|
63
|
+
<div class="DshPanel-group-list">
|
|
64
|
+
<div :class="{
|
|
65
|
+
'list': true,
|
|
66
|
+
'list-nodata': !groupItem.list.length
|
|
67
|
+
}">
|
|
68
|
+
<CheckboxGroup
|
|
69
|
+
class="list-drag"
|
|
70
|
+
v-model="groupItem.selectIds"
|
|
71
|
+
@on-change="selectRow(groupItem, $event)"
|
|
72
|
+
>
|
|
73
|
+
<dsh-draggable
|
|
74
|
+
class="list-drag-draggable"
|
|
75
|
+
v-model="groupItem.list"
|
|
76
|
+
group="panel"
|
|
77
|
+
animation="300"
|
|
78
|
+
:disabled="!dragOperationObj"
|
|
79
|
+
@update="$dshEmit(dragOperationObj, $event, groupItem, data.find(item => item._key === $event.from.id), { [groupField]: groupItem._key })"
|
|
80
|
+
@add="$dshEmit(dragOperationObj, $event, groupItem, data.find(item => item._key === $event.from.id), { [groupField]: groupItem._key })"
|
|
81
|
+
>
|
|
82
|
+
<transition-group
|
|
83
|
+
:id="groupItem._key"
|
|
84
|
+
class="list-drag-transition"
|
|
85
|
+
@scroll.native="groupScroll(groupItem, groupIndex, $event)"
|
|
86
|
+
>
|
|
87
|
+
<div
|
|
88
|
+
v-for="(dataItem, dataIndex) in groupItem.list"
|
|
89
|
+
:key="dataItem._id"
|
|
90
|
+
:id="dataItem._id"
|
|
91
|
+
class="row-item"
|
|
92
|
+
@click="clickRow(dataItem, dataIndex)"
|
|
93
|
+
>
|
|
94
|
+
<dsh-icons
|
|
95
|
+
v-if="dragOperationObj"
|
|
96
|
+
class="row-item-move"
|
|
97
|
+
:list="[{
|
|
98
|
+
customIcon: 'bico-tuodong',
|
|
99
|
+
size: '14px'
|
|
100
|
+
}]"
|
|
101
|
+
></dsh-icons>
|
|
102
|
+
<!-- 内容 -->
|
|
103
|
+
<div class="row-item-info">
|
|
104
|
+
<div class="title">
|
|
105
|
+
<!-- 复选框 -->
|
|
106
|
+
<Checkbox
|
|
107
|
+
v-if="multiple"
|
|
108
|
+
class="title-checkbox"
|
|
109
|
+
:label="dataItem._id"
|
|
110
|
+
@click.native.stop="clickRowCheckbox(dataItem)"
|
|
111
|
+
>{{ "" }}</Checkbox>
|
|
112
|
+
|
|
113
|
+
<!-- 标题 -->
|
|
114
|
+
<bri-tooltip
|
|
115
|
+
class="title-tooltip"
|
|
116
|
+
:content="dataItem[titleField]"
|
|
117
|
+
placement="top"
|
|
118
|
+
:transfer="true"
|
|
119
|
+
>
|
|
120
|
+
<div class="title-name">
|
|
121
|
+
{{ dataItem[titleField] }}
|
|
122
|
+
</div>
|
|
123
|
+
</bri-tooltip>
|
|
124
|
+
<!-- 下拉操作 -->
|
|
125
|
+
<dsh-dropdown
|
|
126
|
+
v-if="operationList.length"
|
|
127
|
+
class="title-dropdown"
|
|
128
|
+
:dropdownObj="dropdownObj"
|
|
129
|
+
:list="operationList"
|
|
130
|
+
@click="$dshEmit($event, dataItem, dataIndex)"
|
|
131
|
+
@click.native.stop="0"
|
|
132
|
+
></dsh-dropdown>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<!-- 显示字段 -->
|
|
136
|
+
<div
|
|
137
|
+
v-for="colItem in selfColumns"
|
|
138
|
+
:key="colItem._key"
|
|
139
|
+
class="unit"
|
|
140
|
+
>
|
|
141
|
+
<dsh-list-render
|
|
142
|
+
v-if="colItem.renderBodyCell"
|
|
143
|
+
:row="dataItem"
|
|
144
|
+
:column="colItem"
|
|
145
|
+
:index="0"
|
|
146
|
+
:render="colItem.renderBodyCell"
|
|
147
|
+
></dsh-list-render>
|
|
148
|
+
|
|
149
|
+
<div
|
|
150
|
+
v-else-if="colItem.formatter"
|
|
151
|
+
v-html="colItem.formatter(dataItem, 0)"
|
|
152
|
+
></div>
|
|
153
|
+
|
|
154
|
+
<span
|
|
155
|
+
v-else
|
|
156
|
+
class="unit-control-text"
|
|
157
|
+
>
|
|
158
|
+
{{ dataItem[colItem._key] }}
|
|
159
|
+
</span>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</transition-group>
|
|
164
|
+
</dsh-draggable>
|
|
165
|
+
</CheckboxGroup>
|
|
166
|
+
|
|
167
|
+
<!-- 空数据 -->
|
|
168
|
+
<bri-loading
|
|
169
|
+
v-if="!groupItem.list.length"
|
|
170
|
+
class="list-loading"
|
|
171
|
+
:value="2"
|
|
172
|
+
:noText="selfPropsObj.noDataText"
|
|
173
|
+
></bri-loading>
|
|
174
|
+
<!-- 提示语 -->
|
|
175
|
+
<div
|
|
176
|
+
v-if="groupItem.loading"
|
|
177
|
+
class="list-tip"
|
|
178
|
+
:style="{
|
|
179
|
+
paddingTop: '3px',
|
|
180
|
+
paddingBottom: '5px'
|
|
181
|
+
}"
|
|
182
|
+
>
|
|
183
|
+
{{ getTip(groupItem) }}
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</template>
|
|
189
|
+
|
|
190
|
+
<!-- 无数据 -->
|
|
191
|
+
<div
|
|
192
|
+
v-else
|
|
193
|
+
class="DshCard-nodata"
|
|
194
|
+
>
|
|
195
|
+
{{ noDataText }}
|
|
196
|
+
</div>
|
|
197
|
+
</template>
|
|
198
|
+
</div>
|
|
199
|
+
</template>
|
|
200
|
+
|
|
201
|
+
<script>
|
|
202
|
+
import { resourceData } from "../../../data/index.js";
|
|
203
|
+
|
|
204
|
+
export default {
|
|
205
|
+
name: "DshPanel",
|
|
206
|
+
props: {
|
|
207
|
+
isLoading: {
|
|
208
|
+
type: Boolean,
|
|
209
|
+
default: false
|
|
210
|
+
},
|
|
211
|
+
data: {
|
|
212
|
+
type: Array,
|
|
213
|
+
default () {
|
|
214
|
+
return [];
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
columns: {
|
|
218
|
+
type: Array,
|
|
219
|
+
default () {
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
propsObj: {
|
|
224
|
+
type: Object,
|
|
225
|
+
default () {
|
|
226
|
+
return {};
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
operationList: {
|
|
231
|
+
type: Array,
|
|
232
|
+
default () {
|
|
233
|
+
return [];
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
extraOperationList: {
|
|
237
|
+
type: Array,
|
|
238
|
+
default () {
|
|
239
|
+
return [];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
data () {
|
|
244
|
+
return {
|
|
245
|
+
selections: [],
|
|
246
|
+
// curRow: null // 可以不声明
|
|
247
|
+
|
|
248
|
+
// 下拉菜单的配置
|
|
249
|
+
dropdownObj: {
|
|
250
|
+
icon: "ios-more",
|
|
251
|
+
size: 22,
|
|
252
|
+
showDropdownItemIcon: false
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
computed: {
|
|
257
|
+
selfPropsObj () {
|
|
258
|
+
return {
|
|
259
|
+
multiple: false,
|
|
260
|
+
groupField: "",
|
|
261
|
+
titleField: "",
|
|
262
|
+
loadingText: "加载中,请稍等……",
|
|
263
|
+
finishedText: "暂无更多数据!",
|
|
264
|
+
noDataText: "暂无数据",
|
|
265
|
+
|
|
266
|
+
...this.propsObj
|
|
267
|
+
};
|
|
268
|
+
},
|
|
269
|
+
multiple () {
|
|
270
|
+
return !!this.selfPropsObj.multiple;
|
|
271
|
+
},
|
|
272
|
+
loadingText () {
|
|
273
|
+
return this.selfPropsObj.loadingText;
|
|
274
|
+
},
|
|
275
|
+
finishedText () {
|
|
276
|
+
return this.selfPropsObj.finishedText;
|
|
277
|
+
},
|
|
278
|
+
noDataText () {
|
|
279
|
+
return this.selfPropsObj.noDataText;
|
|
280
|
+
},
|
|
281
|
+
groupField () {
|
|
282
|
+
return this.selfPropsObj.groupField;
|
|
283
|
+
},
|
|
284
|
+
groupFieldObj () {
|
|
285
|
+
return this.columns.find(colItem => colItem._key === this.groupField) || {};
|
|
286
|
+
},
|
|
287
|
+
groupData () {
|
|
288
|
+
return this.groupFieldObj._data || [];
|
|
289
|
+
},
|
|
290
|
+
titleField () {
|
|
291
|
+
return this.selfPropsObj.titleField;
|
|
292
|
+
},
|
|
293
|
+
// titleFieldObj () {
|
|
294
|
+
// return this.columns.find(colItem => colItem._key === this.titleField) || {};
|
|
295
|
+
// },
|
|
296
|
+
selfColumns () {
|
|
297
|
+
return this.columns
|
|
298
|
+
.filter(colItem => ![this.groupField, this.titleField].includes(colItem._key))
|
|
299
|
+
.slice(0, 1);
|
|
300
|
+
},
|
|
301
|
+
groupBtnOperationList () {
|
|
302
|
+
return this.extraOperationList
|
|
303
|
+
.filter(item =>
|
|
304
|
+
["canCreate", "canCustomCreate"].includes(item.type) || item.type.includes("canCustomCreate")
|
|
305
|
+
)
|
|
306
|
+
.map(item => ({
|
|
307
|
+
...item,
|
|
308
|
+
name: "",
|
|
309
|
+
btnType: "text",
|
|
310
|
+
size: "small"
|
|
311
|
+
}));
|
|
312
|
+
},
|
|
313
|
+
dragOperationObj () {
|
|
314
|
+
return this.extraOperationList.find(item =>
|
|
315
|
+
["canDrag", "canCustomDrag"].includes(item.type) || item.type.includes("canCustomDrag")
|
|
316
|
+
);
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
selectIds: {
|
|
320
|
+
get () {
|
|
321
|
+
return this.selections.map(item => item._id);
|
|
322
|
+
},
|
|
323
|
+
set (val) {
|
|
324
|
+
this.selections = this.data
|
|
325
|
+
.reduce((arr, groupItem) => [...arr, ...groupItem.list], [])
|
|
326
|
+
.filter(item => val.includes(item._id));
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
created () {},
|
|
331
|
+
mounted () {
|
|
332
|
+
this.initGroupScroll();
|
|
333
|
+
},
|
|
334
|
+
methods: {
|
|
335
|
+
// 初始化是否滚动加载
|
|
336
|
+
initGroupScroll () {
|
|
337
|
+
const groupDoms = this.$el.querySelectorAll(".list-drag-transition");
|
|
338
|
+
const groupDomsArr = Array.prototype.slice.call(groupDoms);
|
|
339
|
+
groupDomsArr.forEach((groupElement, groupIndex) => {
|
|
340
|
+
const groupItem = this.data[groupIndex];
|
|
341
|
+
|
|
342
|
+
this.groupLoad(groupItem, groupElement);
|
|
343
|
+
groupElement.addEventListener("DOMSubtreeModified", (ele) => {
|
|
344
|
+
this.groupLoad(groupItem, groupElement);
|
|
345
|
+
}, false);
|
|
346
|
+
});
|
|
347
|
+
},
|
|
348
|
+
// 分组滚动条滚动
|
|
349
|
+
groupScroll (groupItem, groupIndex, e) {
|
|
350
|
+
const groupElement = e.srcElement;
|
|
351
|
+
|
|
352
|
+
this.$emit("groupScroll", groupItem, e);
|
|
353
|
+
this.groupLoad(groupItem, groupElement);
|
|
354
|
+
},
|
|
355
|
+
// 判断是否要滚动加载
|
|
356
|
+
groupLoad (groupItem, groupElement) {
|
|
357
|
+
if (
|
|
358
|
+
groupItem &&
|
|
359
|
+
groupItem.loading !== true &&
|
|
360
|
+
groupItem.finished !== true &&
|
|
361
|
+
groupElement.children.length === groupItem.list.length &&
|
|
362
|
+
groupElement.clientHeight + groupElement.scrollTop > groupElement.scrollHeight - 80
|
|
363
|
+
) {
|
|
364
|
+
this.$emit("groupLoad", groupItem, groupElement);
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
|
|
368
|
+
// 点击某行
|
|
369
|
+
clickRow (row) {
|
|
370
|
+
this.$emit("clickRow", row);
|
|
371
|
+
},
|
|
372
|
+
// 点击某行的选择框
|
|
373
|
+
clickRowCheckbox (row) {
|
|
374
|
+
this.curRow = row;
|
|
375
|
+
this.curRow.bool = !this.selectIds.includes(row._id);
|
|
376
|
+
},
|
|
377
|
+
|
|
378
|
+
// 切换全选
|
|
379
|
+
selectGroupAll (groupItem, bool) {
|
|
380
|
+
const groupListIds = groupItem.list.map(item => item._id);
|
|
381
|
+
groupItem.selectIds = groupItem.isSelectAll === true
|
|
382
|
+
? groupListIds
|
|
383
|
+
: [];
|
|
384
|
+
this.selectIds = groupItem.isSelectAll === true
|
|
385
|
+
? [...new Set([...this.selectIds, ...groupListIds])]
|
|
386
|
+
: this.selectIds.filter(id => !groupListIds.includes(id));
|
|
387
|
+
|
|
388
|
+
this.$emit("selectAll", this.selectIds, this.selections, groupItem.isSelectAll);
|
|
389
|
+
this.changeSelect();
|
|
390
|
+
},
|
|
391
|
+
// 选择行
|
|
392
|
+
selectRow (groupItem, ids) {
|
|
393
|
+
const groupListIds = groupItem.list.map(item => item._id);
|
|
394
|
+
this.selectIds = [
|
|
395
|
+
...this.selectIds.filter(id => !groupListIds.includes(id)),
|
|
396
|
+
...groupItem.selectIds
|
|
397
|
+
];
|
|
398
|
+
groupItem.isSelectAll = groupListIds.length > 0 && groupItem.selectIds.length === groupListIds.length;
|
|
399
|
+
|
|
400
|
+
this.$emit("selectRow", this.selectIds, this.selections, this.curRow.bool, this.curRow);
|
|
401
|
+
this.changeSelect();
|
|
402
|
+
},
|
|
403
|
+
// 改变选择项
|
|
404
|
+
changeSelect () {
|
|
405
|
+
this.$emit("changeSelect", this.selectIds, this.selections);
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
/* -------- 方法 -------- */
|
|
409
|
+
getBgColor (groupItem) {
|
|
410
|
+
const colorType = (this.groupData.find(item => item._key === groupItem._key) || { color: "color-default" }).color;
|
|
411
|
+
return this.groupFieldObj._useColor
|
|
412
|
+
? resourceData.colorMap[colorType]
|
|
413
|
+
: resourceData.colorMap["color-default"];
|
|
414
|
+
},
|
|
415
|
+
getTip (groupItem) {
|
|
416
|
+
return !groupItem.list.length
|
|
417
|
+
? this.noDataText
|
|
418
|
+
: groupItem.loading
|
|
419
|
+
? this.loadingText
|
|
420
|
+
: groupItem.finished
|
|
421
|
+
? this.finishedText
|
|
422
|
+
: "滑动加载更多数据...";
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
watch: {
|
|
426
|
+
data () {
|
|
427
|
+
this.initGroupScroll();
|
|
428
|
+
this.data.forEach(groupItem => {
|
|
429
|
+
groupItem.isSelectAll = groupItem.list.length > 0 && groupItem.selectIds.length === groupItem.list.length;
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
</script>
|
|
435
|
+
|
|
436
|
+
<style lang="less" scoped>
|
|
437
|
+
.DshPanel {
|
|
438
|
+
min-width: 100%;
|
|
439
|
+
height: 100%;
|
|
440
|
+
display: flex;
|
|
441
|
+
flex-direction: row;
|
|
442
|
+
overflow: auto;
|
|
443
|
+
.bri-scrollbar6();
|
|
444
|
+
|
|
445
|
+
&-group {
|
|
446
|
+
width: 254px;
|
|
447
|
+
min-width:254px;
|
|
448
|
+
max-width:254px;
|
|
449
|
+
height: 100%;
|
|
450
|
+
overflow: hidden;
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
background: #fff;
|
|
454
|
+
padding: 0 8px;
|
|
455
|
+
|
|
456
|
+
&:first-of-type {
|
|
457
|
+
padding-left: 0px;
|
|
458
|
+
}
|
|
459
|
+
&:last-of-type {
|
|
460
|
+
padding-right: 0px;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
&-header {
|
|
464
|
+
width: 100%;
|
|
465
|
+
height: 34px;
|
|
466
|
+
padding-bottom: 10px;
|
|
467
|
+
margin-bottom: 8px;
|
|
468
|
+
font-size: 14px;
|
|
469
|
+
border-bottom: 2px solid @themeColor;
|
|
470
|
+
display: flex;
|
|
471
|
+
justify-content: space-between;
|
|
472
|
+
align-items: center;
|
|
473
|
+
|
|
474
|
+
.header {
|
|
475
|
+
&-left {
|
|
476
|
+
flex: 1;
|
|
477
|
+
min-width: 0px;
|
|
478
|
+
display: flex;
|
|
479
|
+
&-tooltip {
|
|
480
|
+
max-width: calc(100% - 20px);
|
|
481
|
+
width: auto!important;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
&-name {
|
|
485
|
+
.dsh-ellipsis();
|
|
486
|
+
font-size: 16px;
|
|
487
|
+
font-weight: 500;
|
|
488
|
+
line-height: 24px;
|
|
489
|
+
color: @textColor;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
&-num {
|
|
493
|
+
color: @themeColor;
|
|
494
|
+
font-size: 16px;
|
|
495
|
+
font-weight: 500;
|
|
496
|
+
line-height: 24px;
|
|
497
|
+
margin-left: 8px;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
&-right {
|
|
502
|
+
margin-left: 5px;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
&-list {
|
|
508
|
+
width: 100%;
|
|
509
|
+
flex: 1;
|
|
510
|
+
min-height: 0px;
|
|
511
|
+
border-top: none;
|
|
512
|
+
display: flex;
|
|
513
|
+
flex-direction: column;
|
|
514
|
+
justify-content: space-between;
|
|
515
|
+
background: #f5f5f5;
|
|
516
|
+
border-radius: 4px;
|
|
517
|
+
|
|
518
|
+
.list {
|
|
519
|
+
width: 100%;
|
|
520
|
+
flex: 1;
|
|
521
|
+
min-height: 0px;
|
|
522
|
+
display: flex;
|
|
523
|
+
flex-direction: column;
|
|
524
|
+
|
|
525
|
+
&-drag {
|
|
526
|
+
width: 100%;
|
|
527
|
+
flex: 1;
|
|
528
|
+
min-height: 0px;
|
|
529
|
+
overflow: hidden;
|
|
530
|
+
|
|
531
|
+
&-draggable {
|
|
532
|
+
width: 100%;
|
|
533
|
+
height: 100%;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
&-transition {
|
|
537
|
+
display: block;
|
|
538
|
+
width: 100%;
|
|
539
|
+
height: 100%;
|
|
540
|
+
padding: 8px;
|
|
541
|
+
overflow: auto;
|
|
542
|
+
.bri-scrollbar6();
|
|
543
|
+
|
|
544
|
+
.row-item {
|
|
545
|
+
min-height: 70px;
|
|
546
|
+
margin-bottom: 8px;
|
|
547
|
+
padding: 8px;
|
|
548
|
+
border-radius: 4px;
|
|
549
|
+
background: #fff;
|
|
550
|
+
border: 1px solid #fff;
|
|
551
|
+
cursor: pointer;
|
|
552
|
+
overflow: hidden;
|
|
553
|
+
position: relative;
|
|
554
|
+
&:hover {
|
|
555
|
+
border-color: @themeColor;
|
|
556
|
+
.row-item-move {
|
|
557
|
+
display: block;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
&-move {
|
|
562
|
+
position: absolute;
|
|
563
|
+
bottom: 0px;
|
|
564
|
+
right: 0px;
|
|
565
|
+
background: @themeColor;
|
|
566
|
+
color: #fff;
|
|
567
|
+
width: 16px;
|
|
568
|
+
height: 16px;
|
|
569
|
+
border-top-left-radius: 4px;
|
|
570
|
+
line-height: 14px;
|
|
571
|
+
text-align: center;
|
|
572
|
+
display: none;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
&-info {
|
|
576
|
+
.title {
|
|
577
|
+
display: flex;
|
|
578
|
+
align-items: center;
|
|
579
|
+
justify-content: space-around;
|
|
580
|
+
margin-bottom: 4px;
|
|
581
|
+
&-tooltip {
|
|
582
|
+
flex: 1;
|
|
583
|
+
width: auto;
|
|
584
|
+
white-space: nowrap;
|
|
585
|
+
overflow: hidden;
|
|
586
|
+
text-overflow: ellipsis;
|
|
587
|
+
}
|
|
588
|
+
&-name {
|
|
589
|
+
.dsh-ellipsis();
|
|
590
|
+
color: @textColor;
|
|
591
|
+
font-size: 14px;
|
|
592
|
+
line-height: 22px;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
&-right {
|
|
596
|
+
margin-left: 4px;
|
|
597
|
+
color: @contentColor;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.unit {
|
|
602
|
+
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
&:last-child {
|
|
607
|
+
margin-bottom: 0px;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
&-tip {
|
|
614
|
+
#dsh-nodata-small();
|
|
615
|
+
line-height: 16px;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
&-loading {
|
|
619
|
+
height: calc(100% - 100px);
|
|
620
|
+
margin-bottom: 10px;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
&-nodata {
|
|
624
|
+
background: #fff;
|
|
625
|
+
border: 1px solid @borderColor;
|
|
626
|
+
border-radius: 4px;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
</style>
|
|
633
|
+
<style lang="less">
|
|
634
|
+
.DshPanel {
|
|
635
|
+
&-group {
|
|
636
|
+
&-header {
|
|
637
|
+
.ivu-tooltip-rel {
|
|
638
|
+
width: 100%;
|
|
639
|
+
}
|
|
640
|
+
.ivu-checkbox-inner {
|
|
641
|
+
outline: none;
|
|
642
|
+
box-shadow: none;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.BriButton {
|
|
646
|
+
width: 24px;
|
|
647
|
+
padding: 0px;
|
|
648
|
+
color: @contentColor;
|
|
649
|
+
span {
|
|
650
|
+
display: none;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
&-list {
|
|
656
|
+
.list {
|
|
657
|
+
&-loading {
|
|
658
|
+
svg {
|
|
659
|
+
width: 70%;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
.ivu-tooltip-rel {
|
|
663
|
+
width: 100%;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
</style>
|