bri-components 1.5.14 → 1.5.15
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/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/10.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 +4 -4
- 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 +577 -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/DshSwitch/DshSwitch.vue +115 -115
- package/src/components/controls/control.less +324 -324
- package/src/components/controls/controlMap.js +114 -114
- 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/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 +282 -282
- 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 +5 -5
- package/src/utils/table.js +175 -175
- package/lib/11.bri-components.min.js +0 -1
|
@@ -1,446 +1,446 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="DshCard">
|
|
3
|
-
<!-- 加载 -->
|
|
4
|
-
<bri-loading
|
|
5
|
-
v-if="isLoading"
|
|
6
|
-
class="DshCard-loading"
|
|
7
|
-
></bri-loading>
|
|
8
|
-
<template v-else>
|
|
9
|
-
<!-- 有数据 -->
|
|
10
|
-
<CheckboxGroup
|
|
11
|
-
v-if="data.length"
|
|
12
|
-
class="DshCard-list"
|
|
13
|
-
v-model="selectIds"
|
|
14
|
-
@on-change="selectRow"
|
|
15
|
-
>
|
|
16
|
-
<Row :gutter="16">
|
|
17
|
-
<i-col
|
|
18
|
-
v-for="(row, dataIndex) in data"
|
|
19
|
-
:key="dataIndex"
|
|
20
|
-
:xs="24"
|
|
21
|
-
:sm="subMode === 'logo' ? 24 : 12"
|
|
22
|
-
:md="12"
|
|
23
|
-
:lg="subMode === 'logo' ? 12 : 8"
|
|
24
|
-
:xl="subMode === 'logo' ? 8 : 6"
|
|
25
|
-
:xxl="subMode === 'logo' ? 6 : 4"
|
|
26
|
-
>
|
|
27
|
-
<div
|
|
28
|
-
:class="{
|
|
29
|
-
'row-item': true,
|
|
30
|
-
'row-item-logo': subMode === 'logo',
|
|
31
|
-
}"
|
|
32
|
-
@click="clickRow(row)"
|
|
33
|
-
>
|
|
34
|
-
<!-- 复选框 -->
|
|
35
|
-
<Checkbox
|
|
36
|
-
v-if="multiple"
|
|
37
|
-
class="row-item-checkbox"
|
|
38
|
-
:label="row._id"
|
|
39
|
-
@click.native.stop="clickRowCheckbox(row)"
|
|
40
|
-
>
|
|
41
|
-
{{ "" }}
|
|
42
|
-
</Checkbox>
|
|
43
|
-
|
|
44
|
-
<!-- 下拉操作(定位css) -->
|
|
45
|
-
<dsh-dropdown
|
|
46
|
-
v-if="operationList.length"
|
|
47
|
-
class="row-item-dropdown"
|
|
48
|
-
:dropdownObj="dropdownObj"
|
|
49
|
-
:list="operationList"
|
|
50
|
-
@click="$dshEmit($event, row, dataIndex)"
|
|
51
|
-
@click.native.stop="0"
|
|
52
|
-
></dsh-dropdown>
|
|
53
|
-
|
|
54
|
-
<!-- 图片 -->
|
|
55
|
-
<div class="row-item-image">
|
|
56
|
-
<img
|
|
57
|
-
:src="getCardBgImgSrc(row)"
|
|
58
|
-
alt=""
|
|
59
|
-
>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<!-- 内容 -->
|
|
63
|
-
<div class="row-item-info">
|
|
64
|
-
<!-- 标题 -->
|
|
65
|
-
<bri-tooltip
|
|
66
|
-
class="title"
|
|
67
|
-
:content="row[propsObj.titleField]"
|
|
68
|
-
placement="top"
|
|
69
|
-
:transfer="true"
|
|
70
|
-
>
|
|
71
|
-
<div class="title-name">
|
|
72
|
-
{{ row[propsObj.titleField] }}
|
|
73
|
-
</div>
|
|
74
|
-
</bri-tooltip>
|
|
75
|
-
|
|
76
|
-
<!-- 显示字段 -->
|
|
77
|
-
<div
|
|
78
|
-
v-for="colItem in selfColumns"
|
|
79
|
-
:key="colItem._key"
|
|
80
|
-
class="unit"
|
|
81
|
-
>
|
|
82
|
-
<!-- 左 label -->
|
|
83
|
-
<bri-tooltip
|
|
84
|
-
class="unit-label-tooltip"
|
|
85
|
-
:content="colItem._name"
|
|
86
|
-
:transfer="true"
|
|
87
|
-
>
|
|
88
|
-
<div class="unit-label">
|
|
89
|
-
<span class="unit-label-name">
|
|
90
|
-
{{ colItem._name }}
|
|
91
|
-
</span>
|
|
92
|
-
<span class="unit-label-colon">
|
|
93
|
-
:
|
|
94
|
-
</span>
|
|
95
|
-
</div>
|
|
96
|
-
</bri-tooltip>
|
|
97
|
-
|
|
98
|
-
<!-- 右 val -->
|
|
99
|
-
<div class="unit-control">
|
|
100
|
-
<dsh-list-render
|
|
101
|
-
v-if="colItem.renderBodyCell"
|
|
102
|
-
:row="row"
|
|
103
|
-
:column="colItem"
|
|
104
|
-
:index="0"
|
|
105
|
-
:render="colItem.renderBodyCell"
|
|
106
|
-
></dsh-list-render>
|
|
107
|
-
|
|
108
|
-
<div
|
|
109
|
-
v-else-if="colItem.formatter"
|
|
110
|
-
v-html="colItem.formatter(row, 0)"
|
|
111
|
-
></div>
|
|
112
|
-
|
|
113
|
-
<span
|
|
114
|
-
v-else
|
|
115
|
-
class="unit-control-text"
|
|
116
|
-
>
|
|
117
|
-
{{ row[colItem._key] }}
|
|
118
|
-
</span>
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
</i-col>
|
|
124
|
-
</Row>
|
|
125
|
-
</CheckboxGroup>
|
|
126
|
-
|
|
127
|
-
<!-- 无数据 -->
|
|
128
|
-
<div
|
|
129
|
-
v-else
|
|
130
|
-
class="DshCard-nodata"
|
|
131
|
-
>
|
|
132
|
-
<img :src="$imageSrcMap.app.nodata" />
|
|
133
|
-
</div>
|
|
134
|
-
</template>
|
|
135
|
-
</div>
|
|
136
|
-
</template>
|
|
137
|
-
|
|
138
|
-
<script>
|
|
139
|
-
export default {
|
|
140
|
-
name: "DshCard",
|
|
141
|
-
props: {
|
|
142
|
-
isLoading: {
|
|
143
|
-
type: Boolean,
|
|
144
|
-
default: false
|
|
145
|
-
},
|
|
146
|
-
data: {
|
|
147
|
-
type: Array,
|
|
148
|
-
default () {
|
|
149
|
-
return [];
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
columns: {
|
|
153
|
-
type: Array,
|
|
154
|
-
default () {
|
|
155
|
-
return [];
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
propsObj: {
|
|
160
|
-
type: Object,
|
|
161
|
-
default () {
|
|
162
|
-
return {};
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
operationList: {
|
|
166
|
-
type: Array,
|
|
167
|
-
default () {
|
|
168
|
-
return [];
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
data () {
|
|
173
|
-
return {
|
|
174
|
-
selections: [],
|
|
175
|
-
// curRow: null // 可以不声明
|
|
176
|
-
|
|
177
|
-
// 下拉菜单的配置
|
|
178
|
-
dropdownObj: {
|
|
179
|
-
icon: "ios-more",
|
|
180
|
-
size: 22,
|
|
181
|
-
showDropdownItemIcon: false
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
getCardBgImgSrc (row) {
|
|
185
|
-
const fileList = row[this.imageField] || [];
|
|
186
|
-
const imgObj = fileList.find(fileItem => fileItem.mimetype.includes("image")) || {
|
|
187
|
-
url: this.$imageSrcMap.app.projectCard
|
|
188
|
-
};
|
|
189
|
-
return imgObj.url;
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
},
|
|
193
|
-
computed: {
|
|
194
|
-
selfPropsObj () {
|
|
195
|
-
return {
|
|
196
|
-
subMode: "default", // "default", "logo"
|
|
197
|
-
multiple: false,
|
|
198
|
-
imageField: "",
|
|
199
|
-
titleField: "",
|
|
200
|
-
loadingText: "加载中,请稍等……",
|
|
201
|
-
finishedText: "暂无更多数据!",
|
|
202
|
-
noDataText: "暂无数据…",
|
|
203
|
-
|
|
204
|
-
...this.propsObj
|
|
205
|
-
};
|
|
206
|
-
},
|
|
207
|
-
subMode () {
|
|
208
|
-
return this.selfPropsObj.subMode;
|
|
209
|
-
},
|
|
210
|
-
multiple () {
|
|
211
|
-
return !!this.selfPropsObj.multiple;
|
|
212
|
-
},
|
|
213
|
-
loadingText () {
|
|
214
|
-
return this.selfPropsObj.loadingText;
|
|
215
|
-
},
|
|
216
|
-
finishedText () {
|
|
217
|
-
return this.selfPropsObj.finishedText;
|
|
218
|
-
},
|
|
219
|
-
noDataText () {
|
|
220
|
-
return this.selfPropsObj.noDataText;
|
|
221
|
-
},
|
|
222
|
-
imageField () {
|
|
223
|
-
return this.propsObj.imageField;
|
|
224
|
-
},
|
|
225
|
-
// imageFieldObj () {
|
|
226
|
-
// return this.columns.find(colItem => colItem._key === this.imageField) || {};
|
|
227
|
-
// },
|
|
228
|
-
titleField () {
|
|
229
|
-
return this.propsObj.titleField;
|
|
230
|
-
},
|
|
231
|
-
// titleFieldObj () {
|
|
232
|
-
// return this.columns.find(colItem => colItem._key === this.titleField) || {};
|
|
233
|
-
// },
|
|
234
|
-
selfColumns () {
|
|
235
|
-
return this.columns
|
|
236
|
-
.filter(colItem => ![this.imageField, this.titleField].includes(colItem._key))
|
|
237
|
-
.slice(0, this.subMode === "logo" ? 5 : 2);
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
selectIds: {
|
|
241
|
-
get () {
|
|
242
|
-
return this.selections.map(item => item._id);
|
|
243
|
-
},
|
|
244
|
-
set (val) {
|
|
245
|
-
this.selections = this.data.filter(item => val.includes(item._id));
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
isSelectAll: {
|
|
249
|
-
get () {
|
|
250
|
-
return this.data.length > 0 && this.selectIds.length === this.data.length;
|
|
251
|
-
},
|
|
252
|
-
set (bool) {
|
|
253
|
-
this.selections = bool ? this.data : [];
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
created () {},
|
|
258
|
-
methods: {
|
|
259
|
-
// 点击某行
|
|
260
|
-
clickRow (row) {
|
|
261
|
-
this.$emit("clickRow", row);
|
|
262
|
-
},
|
|
263
|
-
// 点击某行的选择框
|
|
264
|
-
clickRowCheckbox (row) {
|
|
265
|
-
this.curRow = row;
|
|
266
|
-
this.curRow.bool = !this.selectIds.includes(row._id);
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
// 切换全选
|
|
270
|
-
selectAll (bool) {
|
|
271
|
-
this.$emit("selectAll", this.selectIds, this.selections, bool);
|
|
272
|
-
this.changeSelect();
|
|
273
|
-
},
|
|
274
|
-
// 切换选择
|
|
275
|
-
selectRow (ids) {
|
|
276
|
-
this.$emit("selectRow", this.selectIds, this.selections, this.curRow.bool, this.curRow);
|
|
277
|
-
this.changeSelect();
|
|
278
|
-
},
|
|
279
|
-
// 改变选择项
|
|
280
|
-
changeSelect () {
|
|
281
|
-
this.$emit("changeSelect", this.selectIds, this.selections);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
</script>
|
|
286
|
-
|
|
287
|
-
<style lang="less" scoped>
|
|
288
|
-
.DshCard {
|
|
289
|
-
width: 100%;
|
|
290
|
-
height: 100%;
|
|
291
|
-
padding: 10px;
|
|
292
|
-
background-color: #ffffff;
|
|
293
|
-
overflow: auto;
|
|
294
|
-
|
|
295
|
-
&-list {
|
|
296
|
-
.row-item {
|
|
297
|
-
box-sizing: border-box;
|
|
298
|
-
width: 100%;
|
|
299
|
-
margin-bottom: 20px;
|
|
300
|
-
border-radius: 4px;
|
|
301
|
-
box-shadow: 0 4px 5px 5px rgba(0, 0, 0, 0.05), 0 4px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
|
|
302
|
-
background: #FFFFFF;
|
|
303
|
-
cursor: pointer;
|
|
304
|
-
overflow: hidden;
|
|
305
|
-
position: relative;
|
|
306
|
-
|
|
307
|
-
display: flex;
|
|
308
|
-
flex-direction: column;
|
|
309
|
-
|
|
310
|
-
&-checkbox {
|
|
311
|
-
margin-top: 0px;
|
|
312
|
-
padding-right: 4px;
|
|
313
|
-
padding-bottom: 4px;
|
|
314
|
-
position: absolute;
|
|
315
|
-
top: -3px;
|
|
316
|
-
left: 0px;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
&-dropdown {
|
|
320
|
-
position: absolute;
|
|
321
|
-
top: 5px;
|
|
322
|
-
right: 5px;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
&-image {
|
|
326
|
-
height: 122px;
|
|
327
|
-
overflow: hidden;
|
|
328
|
-
|
|
329
|
-
img {
|
|
330
|
-
width: 100%;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
&-info {
|
|
335
|
-
flex: 1;
|
|
336
|
-
min-height: 0px;
|
|
337
|
-
padding: 8px;
|
|
338
|
-
padding-bottom: 10px;
|
|
339
|
-
background: #F7FBFF;
|
|
340
|
-
overflow: hidden;
|
|
341
|
-
|
|
342
|
-
.title {
|
|
343
|
-
height: 24px;
|
|
344
|
-
font-size: 14px;
|
|
345
|
-
font-weight: 600;
|
|
346
|
-
|
|
347
|
-
&-name {
|
|
348
|
-
.dsh-ellipsis();
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.unit {
|
|
353
|
-
height: 32px;
|
|
354
|
-
display: flex;
|
|
355
|
-
flex-direction: row;
|
|
356
|
-
align-items: center;
|
|
357
|
-
|
|
358
|
-
&-label {
|
|
359
|
-
&-tooltip {
|
|
360
|
-
width: auto;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
font-weight: 400;
|
|
364
|
-
color: #515A6E;
|
|
365
|
-
display: flex;
|
|
366
|
-
flex-direction: row;
|
|
367
|
-
align-items: center;
|
|
368
|
-
|
|
369
|
-
&-name {
|
|
370
|
-
.dsh-ellipsis();
|
|
371
|
-
display: inline-block;
|
|
372
|
-
min-width: 29px;
|
|
373
|
-
max-width: 71px;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
&-colon {
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
&-control {
|
|
382
|
-
flex: 1;
|
|
383
|
-
min-width: 0px;
|
|
384
|
-
|
|
385
|
-
&-text {
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
&-logo {
|
|
393
|
-
padding: 10px;
|
|
394
|
-
border-radius: 6px;
|
|
395
|
-
flex-direction: row;
|
|
396
|
-
|
|
397
|
-
.row-item {
|
|
398
|
-
&-image {
|
|
399
|
-
width: 64px;
|
|
400
|
-
height: 64px;
|
|
401
|
-
margin-top: 8px;
|
|
402
|
-
border: 1px solid #e5e5e5;
|
|
403
|
-
border-radius: 8px;
|
|
404
|
-
|
|
405
|
-
img {
|
|
406
|
-
width: 100%;
|
|
407
|
-
height: 100%;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
&-info {
|
|
412
|
-
background-color: #ffffff;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
&:hover {
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
&-nodata {
|
|
425
|
-
#dsh-nodata();
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
</style>
|
|
429
|
-
<style lang="less">
|
|
430
|
-
.DshCard {
|
|
431
|
-
&-list {
|
|
432
|
-
.ivu-checkbox-inner {
|
|
433
|
-
border: none;
|
|
434
|
-
// border-radius: 4px;
|
|
435
|
-
box-shadow: 0px 1px 2px 0px rgba(222, 222, 222, 0.75);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.ivu-checkbox-checked {
|
|
439
|
-
.ivu-checkbox-inner:after {
|
|
440
|
-
top: 3px;
|
|
441
|
-
left: 6px;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="DshCard">
|
|
3
|
+
<!-- 加载 -->
|
|
4
|
+
<bri-loading
|
|
5
|
+
v-if="isLoading"
|
|
6
|
+
class="DshCard-loading"
|
|
7
|
+
></bri-loading>
|
|
8
|
+
<template v-else>
|
|
9
|
+
<!-- 有数据 -->
|
|
10
|
+
<CheckboxGroup
|
|
11
|
+
v-if="data.length"
|
|
12
|
+
class="DshCard-list"
|
|
13
|
+
v-model="selectIds"
|
|
14
|
+
@on-change="selectRow"
|
|
15
|
+
>
|
|
16
|
+
<Row :gutter="16">
|
|
17
|
+
<i-col
|
|
18
|
+
v-for="(row, dataIndex) in data"
|
|
19
|
+
:key="dataIndex"
|
|
20
|
+
:xs="24"
|
|
21
|
+
:sm="subMode === 'logo' ? 24 : 12"
|
|
22
|
+
:md="12"
|
|
23
|
+
:lg="subMode === 'logo' ? 12 : 8"
|
|
24
|
+
:xl="subMode === 'logo' ? 8 : 6"
|
|
25
|
+
:xxl="subMode === 'logo' ? 6 : 4"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
:class="{
|
|
29
|
+
'row-item': true,
|
|
30
|
+
'row-item-logo': subMode === 'logo',
|
|
31
|
+
}"
|
|
32
|
+
@click="clickRow(row)"
|
|
33
|
+
>
|
|
34
|
+
<!-- 复选框 -->
|
|
35
|
+
<Checkbox
|
|
36
|
+
v-if="multiple"
|
|
37
|
+
class="row-item-checkbox"
|
|
38
|
+
:label="row._id"
|
|
39
|
+
@click.native.stop="clickRowCheckbox(row)"
|
|
40
|
+
>
|
|
41
|
+
{{ "" }}
|
|
42
|
+
</Checkbox>
|
|
43
|
+
|
|
44
|
+
<!-- 下拉操作(定位css) -->
|
|
45
|
+
<dsh-dropdown
|
|
46
|
+
v-if="operationList.length"
|
|
47
|
+
class="row-item-dropdown"
|
|
48
|
+
:dropdownObj="dropdownObj"
|
|
49
|
+
:list="operationList"
|
|
50
|
+
@click="$dshEmit($event, row, dataIndex)"
|
|
51
|
+
@click.native.stop="0"
|
|
52
|
+
></dsh-dropdown>
|
|
53
|
+
|
|
54
|
+
<!-- 图片 -->
|
|
55
|
+
<div class="row-item-image">
|
|
56
|
+
<img
|
|
57
|
+
:src="getCardBgImgSrc(row)"
|
|
58
|
+
alt=""
|
|
59
|
+
>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<!-- 内容 -->
|
|
63
|
+
<div class="row-item-info">
|
|
64
|
+
<!-- 标题 -->
|
|
65
|
+
<bri-tooltip
|
|
66
|
+
class="title"
|
|
67
|
+
:content="row[propsObj.titleField]"
|
|
68
|
+
placement="top"
|
|
69
|
+
:transfer="true"
|
|
70
|
+
>
|
|
71
|
+
<div class="title-name">
|
|
72
|
+
{{ row[propsObj.titleField] }}
|
|
73
|
+
</div>
|
|
74
|
+
</bri-tooltip>
|
|
75
|
+
|
|
76
|
+
<!-- 显示字段 -->
|
|
77
|
+
<div
|
|
78
|
+
v-for="colItem in selfColumns"
|
|
79
|
+
:key="colItem._key"
|
|
80
|
+
class="unit"
|
|
81
|
+
>
|
|
82
|
+
<!-- 左 label -->
|
|
83
|
+
<bri-tooltip
|
|
84
|
+
class="unit-label-tooltip"
|
|
85
|
+
:content="colItem._name"
|
|
86
|
+
:transfer="true"
|
|
87
|
+
>
|
|
88
|
+
<div class="unit-label">
|
|
89
|
+
<span class="unit-label-name">
|
|
90
|
+
{{ colItem._name }}
|
|
91
|
+
</span>
|
|
92
|
+
<span class="unit-label-colon">
|
|
93
|
+
:
|
|
94
|
+
</span>
|
|
95
|
+
</div>
|
|
96
|
+
</bri-tooltip>
|
|
97
|
+
|
|
98
|
+
<!-- 右 val -->
|
|
99
|
+
<div class="unit-control">
|
|
100
|
+
<dsh-list-render
|
|
101
|
+
v-if="colItem.renderBodyCell"
|
|
102
|
+
:row="row"
|
|
103
|
+
:column="colItem"
|
|
104
|
+
:index="0"
|
|
105
|
+
:render="colItem.renderBodyCell"
|
|
106
|
+
></dsh-list-render>
|
|
107
|
+
|
|
108
|
+
<div
|
|
109
|
+
v-else-if="colItem.formatter"
|
|
110
|
+
v-html="colItem.formatter(row, 0)"
|
|
111
|
+
></div>
|
|
112
|
+
|
|
113
|
+
<span
|
|
114
|
+
v-else
|
|
115
|
+
class="unit-control-text"
|
|
116
|
+
>
|
|
117
|
+
{{ row[colItem._key] }}
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</i-col>
|
|
124
|
+
</Row>
|
|
125
|
+
</CheckboxGroup>
|
|
126
|
+
|
|
127
|
+
<!-- 无数据 -->
|
|
128
|
+
<div
|
|
129
|
+
v-else
|
|
130
|
+
class="DshCard-nodata"
|
|
131
|
+
>
|
|
132
|
+
<img :src="$imageSrcMap.app.nodata" />
|
|
133
|
+
</div>
|
|
134
|
+
</template>
|
|
135
|
+
</div>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<script>
|
|
139
|
+
export default {
|
|
140
|
+
name: "DshCard",
|
|
141
|
+
props: {
|
|
142
|
+
isLoading: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: false
|
|
145
|
+
},
|
|
146
|
+
data: {
|
|
147
|
+
type: Array,
|
|
148
|
+
default () {
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
columns: {
|
|
153
|
+
type: Array,
|
|
154
|
+
default () {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
propsObj: {
|
|
160
|
+
type: Object,
|
|
161
|
+
default () {
|
|
162
|
+
return {};
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
operationList: {
|
|
166
|
+
type: Array,
|
|
167
|
+
default () {
|
|
168
|
+
return [];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
data () {
|
|
173
|
+
return {
|
|
174
|
+
selections: [],
|
|
175
|
+
// curRow: null // 可以不声明
|
|
176
|
+
|
|
177
|
+
// 下拉菜单的配置
|
|
178
|
+
dropdownObj: {
|
|
179
|
+
icon: "ios-more",
|
|
180
|
+
size: 22,
|
|
181
|
+
showDropdownItemIcon: false
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
getCardBgImgSrc (row) {
|
|
185
|
+
const fileList = row[this.imageField] || [];
|
|
186
|
+
const imgObj = fileList.find(fileItem => fileItem.mimetype.includes("image")) || {
|
|
187
|
+
url: this.$imageSrcMap.app.projectCard
|
|
188
|
+
};
|
|
189
|
+
return imgObj.url;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
computed: {
|
|
194
|
+
selfPropsObj () {
|
|
195
|
+
return {
|
|
196
|
+
subMode: "default", // "default", "logo"
|
|
197
|
+
multiple: false,
|
|
198
|
+
imageField: "",
|
|
199
|
+
titleField: "",
|
|
200
|
+
loadingText: "加载中,请稍等……",
|
|
201
|
+
finishedText: "暂无更多数据!",
|
|
202
|
+
noDataText: "暂无数据…",
|
|
203
|
+
|
|
204
|
+
...this.propsObj
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
subMode () {
|
|
208
|
+
return this.selfPropsObj.subMode;
|
|
209
|
+
},
|
|
210
|
+
multiple () {
|
|
211
|
+
return !!this.selfPropsObj.multiple;
|
|
212
|
+
},
|
|
213
|
+
loadingText () {
|
|
214
|
+
return this.selfPropsObj.loadingText;
|
|
215
|
+
},
|
|
216
|
+
finishedText () {
|
|
217
|
+
return this.selfPropsObj.finishedText;
|
|
218
|
+
},
|
|
219
|
+
noDataText () {
|
|
220
|
+
return this.selfPropsObj.noDataText;
|
|
221
|
+
},
|
|
222
|
+
imageField () {
|
|
223
|
+
return this.propsObj.imageField;
|
|
224
|
+
},
|
|
225
|
+
// imageFieldObj () {
|
|
226
|
+
// return this.columns.find(colItem => colItem._key === this.imageField) || {};
|
|
227
|
+
// },
|
|
228
|
+
titleField () {
|
|
229
|
+
return this.propsObj.titleField;
|
|
230
|
+
},
|
|
231
|
+
// titleFieldObj () {
|
|
232
|
+
// return this.columns.find(colItem => colItem._key === this.titleField) || {};
|
|
233
|
+
// },
|
|
234
|
+
selfColumns () {
|
|
235
|
+
return this.columns
|
|
236
|
+
.filter(colItem => ![this.imageField, this.titleField].includes(colItem._key))
|
|
237
|
+
.slice(0, this.subMode === "logo" ? 5 : 2);
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
selectIds: {
|
|
241
|
+
get () {
|
|
242
|
+
return this.selections.map(item => item._id);
|
|
243
|
+
},
|
|
244
|
+
set (val) {
|
|
245
|
+
this.selections = this.data.filter(item => val.includes(item._id));
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
isSelectAll: {
|
|
249
|
+
get () {
|
|
250
|
+
return this.data.length > 0 && this.selectIds.length === this.data.length;
|
|
251
|
+
},
|
|
252
|
+
set (bool) {
|
|
253
|
+
this.selections = bool ? this.data : [];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
created () {},
|
|
258
|
+
methods: {
|
|
259
|
+
// 点击某行
|
|
260
|
+
clickRow (row) {
|
|
261
|
+
this.$emit("clickRow", row);
|
|
262
|
+
},
|
|
263
|
+
// 点击某行的选择框
|
|
264
|
+
clickRowCheckbox (row) {
|
|
265
|
+
this.curRow = row;
|
|
266
|
+
this.curRow.bool = !this.selectIds.includes(row._id);
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
// 切换全选
|
|
270
|
+
selectAll (bool) {
|
|
271
|
+
this.$emit("selectAll", this.selectIds, this.selections, bool);
|
|
272
|
+
this.changeSelect();
|
|
273
|
+
},
|
|
274
|
+
// 切换选择
|
|
275
|
+
selectRow (ids) {
|
|
276
|
+
this.$emit("selectRow", this.selectIds, this.selections, this.curRow.bool, this.curRow);
|
|
277
|
+
this.changeSelect();
|
|
278
|
+
},
|
|
279
|
+
// 改变选择项
|
|
280
|
+
changeSelect () {
|
|
281
|
+
this.$emit("changeSelect", this.selectIds, this.selections);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
</script>
|
|
286
|
+
|
|
287
|
+
<style lang="less" scoped>
|
|
288
|
+
.DshCard {
|
|
289
|
+
width: 100%;
|
|
290
|
+
height: 100%;
|
|
291
|
+
padding: 10px;
|
|
292
|
+
background-color: #ffffff;
|
|
293
|
+
overflow: auto;
|
|
294
|
+
|
|
295
|
+
&-list {
|
|
296
|
+
.row-item {
|
|
297
|
+
box-sizing: border-box;
|
|
298
|
+
width: 100%;
|
|
299
|
+
margin-bottom: 20px;
|
|
300
|
+
border-radius: 4px;
|
|
301
|
+
box-shadow: 0 4px 5px 5px rgba(0, 0, 0, 0.05), 0 4px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
|
|
302
|
+
background: #FFFFFF;
|
|
303
|
+
cursor: pointer;
|
|
304
|
+
overflow: hidden;
|
|
305
|
+
position: relative;
|
|
306
|
+
|
|
307
|
+
display: flex;
|
|
308
|
+
flex-direction: column;
|
|
309
|
+
|
|
310
|
+
&-checkbox {
|
|
311
|
+
margin-top: 0px;
|
|
312
|
+
padding-right: 4px;
|
|
313
|
+
padding-bottom: 4px;
|
|
314
|
+
position: absolute;
|
|
315
|
+
top: -3px;
|
|
316
|
+
left: 0px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
&-dropdown {
|
|
320
|
+
position: absolute;
|
|
321
|
+
top: 5px;
|
|
322
|
+
right: 5px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
&-image {
|
|
326
|
+
height: 122px;
|
|
327
|
+
overflow: hidden;
|
|
328
|
+
|
|
329
|
+
img {
|
|
330
|
+
width: 100%;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
&-info {
|
|
335
|
+
flex: 1;
|
|
336
|
+
min-height: 0px;
|
|
337
|
+
padding: 8px;
|
|
338
|
+
padding-bottom: 10px;
|
|
339
|
+
background: #F7FBFF;
|
|
340
|
+
overflow: hidden;
|
|
341
|
+
|
|
342
|
+
.title {
|
|
343
|
+
height: 24px;
|
|
344
|
+
font-size: 14px;
|
|
345
|
+
font-weight: 600;
|
|
346
|
+
|
|
347
|
+
&-name {
|
|
348
|
+
.dsh-ellipsis();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.unit {
|
|
353
|
+
height: 32px;
|
|
354
|
+
display: flex;
|
|
355
|
+
flex-direction: row;
|
|
356
|
+
align-items: center;
|
|
357
|
+
|
|
358
|
+
&-label {
|
|
359
|
+
&-tooltip {
|
|
360
|
+
width: auto;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
font-weight: 400;
|
|
364
|
+
color: #515A6E;
|
|
365
|
+
display: flex;
|
|
366
|
+
flex-direction: row;
|
|
367
|
+
align-items: center;
|
|
368
|
+
|
|
369
|
+
&-name {
|
|
370
|
+
.dsh-ellipsis();
|
|
371
|
+
display: inline-block;
|
|
372
|
+
min-width: 29px;
|
|
373
|
+
max-width: 71px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
&-colon {
|
|
377
|
+
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
&-control {
|
|
382
|
+
flex: 1;
|
|
383
|
+
min-width: 0px;
|
|
384
|
+
|
|
385
|
+
&-text {
|
|
386
|
+
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
&-logo {
|
|
393
|
+
padding: 10px;
|
|
394
|
+
border-radius: 6px;
|
|
395
|
+
flex-direction: row;
|
|
396
|
+
|
|
397
|
+
.row-item {
|
|
398
|
+
&-image {
|
|
399
|
+
width: 64px;
|
|
400
|
+
height: 64px;
|
|
401
|
+
margin-top: 8px;
|
|
402
|
+
border: 1px solid #e5e5e5;
|
|
403
|
+
border-radius: 8px;
|
|
404
|
+
|
|
405
|
+
img {
|
|
406
|
+
width: 100%;
|
|
407
|
+
height: 100%;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
&-info {
|
|
412
|
+
background-color: #ffffff;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
&:hover {
|
|
417
|
+
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
&-nodata {
|
|
425
|
+
#dsh-nodata();
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
</style>
|
|
429
|
+
<style lang="less">
|
|
430
|
+
.DshCard {
|
|
431
|
+
&-list {
|
|
432
|
+
.ivu-checkbox-inner {
|
|
433
|
+
border: none;
|
|
434
|
+
// border-radius: 4px;
|
|
435
|
+
box-shadow: 0px 1px 2px 0px rgba(222, 222, 222, 0.75);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.ivu-checkbox-checked {
|
|
439
|
+
.ivu-checkbox-inner:after {
|
|
440
|
+
top: 3px;
|
|
441
|
+
left: 6px;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
</style>
|