bri-components 1.5.22 → 1.6.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/README.md +83 -83
- package/lib/styles/bundle.css +12 -12
- package/lib/styles/font/fontello.svg +31 -31
- package/package.json +127 -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 +435 -434
- package/src/components/controls/base/BriUpload/BriUploadImage.vue +430 -377
- package/src/components/controls/base/BriUpload/uploadList.vue +738 -727
- package/src/components/controls/base/BriUpload/uploadMixin.js +453 -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 +587 -585
- 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 +397 -399
- package/src/components/controls/senior/selectUsers/departMenu.vue +296 -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 +334 -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/other/DshVideoPlayer.vue +184 -0
- 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 +287 -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,333 +1,333 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 编辑 -->
|
|
3
|
-
<div
|
|
4
|
-
v-if="canEdit"
|
|
5
|
-
class="DshLabels"
|
|
6
|
-
>
|
|
7
|
-
<Dropdown
|
|
8
|
-
class="DshLabels-dropdown"
|
|
9
|
-
trigger="custom"
|
|
10
|
-
placement="bottom-start"
|
|
11
|
-
:visible="isVisible"
|
|
12
|
-
transfer
|
|
13
|
-
@on-clickoutside="clickInput"
|
|
14
|
-
>
|
|
15
|
-
<!-- 可编辑 -->
|
|
16
|
-
<dsh-control-input
|
|
17
|
-
:class="commonClass"
|
|
18
|
-
:value="curValList"
|
|
19
|
-
:disabled="disabled"
|
|
20
|
-
:heightAuto="isHeightAuto"
|
|
21
|
-
:propsObj="selfPropsObj"
|
|
22
|
-
@deleteItem="clickDeleteItem"
|
|
23
|
-
@clear="clickClear"
|
|
24
|
-
@click.native="clickInput"
|
|
25
|
-
></dsh-control-input>
|
|
26
|
-
|
|
27
|
-
<template #list>
|
|
28
|
-
<DropdownMenu class="DshLabels-dropdown-menu">
|
|
29
|
-
<DropdownItem
|
|
30
|
-
v-for="listItem in listData"
|
|
31
|
-
:key="listItem._key"
|
|
32
|
-
:class="{
|
|
33
|
-
'item': true,
|
|
34
|
-
'item-active': !!curValList.find(item => item._key === listItem._key)
|
|
35
|
-
}"
|
|
36
|
-
@click.native="clickItem(listItem)"
|
|
37
|
-
>
|
|
38
|
-
|
|
39
|
-
<div
|
|
40
|
-
v-if="listItem.isEdit"
|
|
41
|
-
class="item-edit"
|
|
42
|
-
>
|
|
43
|
-
<Input
|
|
44
|
-
v-model="listItem.name"
|
|
45
|
-
@click.native="clickEditInput($event)"
|
|
46
|
-
>
|
|
47
|
-
<template #suffix>
|
|
48
|
-
<Icon
|
|
49
|
-
class="item-edit-icon"
|
|
50
|
-
custom="bri bri-duigou"
|
|
51
|
-
@click.native.stop="clickConfirm(listItem)"
|
|
52
|
-
/>
|
|
53
|
-
</template>
|
|
54
|
-
</Input>
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
<div
|
|
58
|
-
v-else
|
|
59
|
-
class="item-show"
|
|
60
|
-
>
|
|
61
|
-
{{ listItem.name }}
|
|
62
|
-
<span class="item-show-icons">
|
|
63
|
-
<Icon
|
|
64
|
-
v-if="!listItem.coreLabel"
|
|
65
|
-
class="item-show-icons-edit"
|
|
66
|
-
custom="bri bri-bianji"
|
|
67
|
-
@click.stop="clickEditIcon(listItem)"
|
|
68
|
-
/>
|
|
69
|
-
<!-- 暂时不需要删除 -->
|
|
70
|
-
<!-- <Icon
|
|
71
|
-
class="item-show-icons-del"
|
|
72
|
-
custom="bri bri-shanchu"
|
|
73
|
-
/> -->
|
|
74
|
-
</span>
|
|
75
|
-
</div>
|
|
76
|
-
</DropdownItem>
|
|
77
|
-
|
|
78
|
-
<div
|
|
79
|
-
v-if="!onlySelect"
|
|
80
|
-
class="btns"
|
|
81
|
-
>
|
|
82
|
-
<bri-button
|
|
83
|
-
class="btns-add"
|
|
84
|
-
:propsObj="{
|
|
85
|
-
btnType: 'default',
|
|
86
|
-
icon:'md-add'
|
|
87
|
-
}"
|
|
88
|
-
@click.native.stop="clickAddItem"
|
|
89
|
-
>添加选项</bri-button>
|
|
90
|
-
</div>
|
|
91
|
-
</DropdownMenu>
|
|
92
|
-
</template>
|
|
93
|
-
</Dropdown>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
<!-- 查看 -->
|
|
97
|
-
<div
|
|
98
|
-
v-else
|
|
99
|
-
class="DshLabels-show"
|
|
100
|
-
>
|
|
101
|
-
<!-- 有值 -->
|
|
102
|
-
<template v-if="!$isEmptyData(curValList)">
|
|
103
|
-
<!-- 高度自由时 -->
|
|
104
|
-
<dsh-tags
|
|
105
|
-
v-if="isHeightAuto"
|
|
106
|
-
:class="{
|
|
107
|
-
...commonClass,
|
|
108
|
-
'DshLabels-show-auto': true
|
|
109
|
-
}"
|
|
110
|
-
itemClass="DshLabels-show-auto-tag"
|
|
111
|
-
:list="curValList"
|
|
112
|
-
></dsh-tags>
|
|
113
|
-
|
|
114
|
-
<!-- 高度不自由(不换行) -->
|
|
115
|
-
<bri-tooltip
|
|
116
|
-
v-else
|
|
117
|
-
:content="showMulVal"
|
|
118
|
-
:transfer="true"
|
|
119
|
-
>
|
|
120
|
-
<dsh-tags
|
|
121
|
-
:class="{
|
|
122
|
-
...commonClass,
|
|
123
|
-
'DshLabels-show-ellipsis': true
|
|
124
|
-
}"
|
|
125
|
-
itemClass="DshLabels-show-ellipsis-tag"
|
|
126
|
-
:list="curValList"
|
|
127
|
-
></dsh-tags>
|
|
128
|
-
</bri-tooltip>
|
|
129
|
-
</template>
|
|
130
|
-
|
|
131
|
-
<!-- 无值 -->
|
|
132
|
-
<div
|
|
133
|
-
v-else
|
|
134
|
-
:class="commonClass"
|
|
135
|
-
>
|
|
136
|
-
{{ emptyShowVal }}
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
</template>
|
|
140
|
-
|
|
141
|
-
<script>
|
|
142
|
-
import controlMixin from "../mixins/controlMixin.js";
|
|
143
|
-
|
|
144
|
-
export default {
|
|
145
|
-
name: "DshLabels",
|
|
146
|
-
mixins: [
|
|
147
|
-
controlMixin
|
|
148
|
-
],
|
|
149
|
-
data () {
|
|
150
|
-
return {
|
|
151
|
-
listData: [],
|
|
152
|
-
isVisible: false,
|
|
153
|
-
renderList: false
|
|
154
|
-
};
|
|
155
|
-
},
|
|
156
|
-
computed: {
|
|
157
|
-
selfPropsObj () {
|
|
158
|
-
return {
|
|
159
|
-
_icon: this.isVisible ? "ios-arrow-up" : "ios-arrow-down",
|
|
160
|
-
_labelType: "entity",
|
|
161
|
-
_onlySelect: false,
|
|
162
|
-
_originLabels: [],
|
|
163
|
-
|
|
164
|
-
...this.propsObj,
|
|
165
|
-
...this.commonDealPropsObj
|
|
166
|
-
};
|
|
167
|
-
},
|
|
168
|
-
subType () {
|
|
169
|
-
return this.selfPropsObj._labelType;
|
|
170
|
-
},
|
|
171
|
-
onlySelect () {
|
|
172
|
-
return this.isInAnySearch ? true : this.selfPropsObj._onlySelect;
|
|
173
|
-
},
|
|
174
|
-
originLabels () {
|
|
175
|
-
return this.selfPropsObj._originLabels;
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
showMulVal () {
|
|
179
|
-
return this.$isEmptyData(this.curValList)
|
|
180
|
-
? this.emptyShowVal
|
|
181
|
-
: this.curValList.map(item => item.name).join("、");
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
created () {},
|
|
185
|
-
methods: {
|
|
186
|
-
clickInput () {
|
|
187
|
-
if (!this.disabled) {
|
|
188
|
-
if (!this.renderList) {
|
|
189
|
-
if (this.isDftSet) {
|
|
190
|
-
this.listData = this.originLabels.map(item => {
|
|
191
|
-
return {
|
|
192
|
-
...item,
|
|
193
|
-
isEdit: false
|
|
194
|
-
};
|
|
195
|
-
});
|
|
196
|
-
} else {
|
|
197
|
-
this.getListData();
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
this.renderList = true;
|
|
201
|
-
this.isVisible = !this.isVisible;
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
clickEditInput (e) {
|
|
205
|
-
e.stopPropagation();
|
|
206
|
-
},
|
|
207
|
-
clickEditIcon (listItem) {
|
|
208
|
-
listItem.isEdit = true;
|
|
209
|
-
this.$forceUpdate();
|
|
210
|
-
},
|
|
211
|
-
clickConfirm (listItem) {
|
|
212
|
-
if (listItem.name) {
|
|
213
|
-
listItem.isEdit = false;
|
|
214
|
-
this.$forceUpdate();
|
|
215
|
-
};
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
clickItem (listItem) {
|
|
219
|
-
if (this.curValList.some(item => item._key === listItem._key)) {
|
|
220
|
-
this.curValList = this.curValList.filter(item => item._key !== listItem._key);
|
|
221
|
-
} else {
|
|
222
|
-
this.curValList = [...this.curValList, listItem];
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
clickAddItem () {
|
|
226
|
-
this.listData.push({
|
|
227
|
-
_key: this.$randomB36("Labels"),
|
|
228
|
-
isEdit: true,
|
|
229
|
-
name: "",
|
|
230
|
-
labelType: this.subType
|
|
231
|
-
});
|
|
232
|
-
},
|
|
233
|
-
clickDeleteItem (deleteItem) {
|
|
234
|
-
this.curValList = this.curValList.filter(item => item._key !== deleteItem._key);
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
// 接口 -获取列表数据
|
|
238
|
-
getListData () {
|
|
239
|
-
this.$https({
|
|
240
|
-
url: {
|
|
241
|
-
module: "sheet",
|
|
242
|
-
name: "memberAll"
|
|
243
|
-
},
|
|
244
|
-
params: {
|
|
245
|
-
search: {
|
|
246
|
-
entityKey: this.entityKey,
|
|
247
|
-
modKey: this.modKey,
|
|
248
|
-
fieldKey: this.fieldKey, // 当前字段Key
|
|
249
|
-
labelType: this.subType
|
|
250
|
-
},
|
|
251
|
-
pagination: {
|
|
252
|
-
page: 1,
|
|
253
|
-
pagesize: 999
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
callback: data => {
|
|
257
|
-
this.listData = data.list.map(item => {
|
|
258
|
-
return {
|
|
259
|
-
...item,
|
|
260
|
-
isEdit: false
|
|
261
|
-
};
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
</script>
|
|
269
|
-
|
|
270
|
-
<style lang="less">
|
|
271
|
-
@import url("../control.less");
|
|
272
|
-
|
|
273
|
-
.DshLabels {
|
|
274
|
-
#control-show();
|
|
275
|
-
|
|
276
|
-
&-dropdown {
|
|
277
|
-
width: 100%;
|
|
278
|
-
|
|
279
|
-
&-menu {
|
|
280
|
-
.item {
|
|
281
|
-
margin: 4px 8px;
|
|
282
|
-
border-radius: @borderRadius;
|
|
283
|
-
|
|
284
|
-
&-active {
|
|
285
|
-
background-color: @theme-focus;
|
|
286
|
-
color: @themeColor;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
&-edit {
|
|
290
|
-
&-icon {
|
|
291
|
-
color: @themeColor;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
&-show {
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.btns {
|
|
301
|
-
border-top: 1px solid #E7E7E7;
|
|
302
|
-
margin: 12px 8px 0;
|
|
303
|
-
padding-top: 8px;
|
|
304
|
-
|
|
305
|
-
&-add {
|
|
306
|
-
width: 100%;
|
|
307
|
-
margin-bottom: 8px;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.ivu-select-dropdown {
|
|
314
|
-
width: fit-content;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.ivu-input-suffix {
|
|
318
|
-
display: flex;
|
|
319
|
-
align-items: center;
|
|
320
|
-
|
|
321
|
-
i {
|
|
322
|
-
width: 24px;
|
|
323
|
-
height: 24px;
|
|
324
|
-
line-height: 24px;
|
|
325
|
-
|
|
326
|
-
&:hover {
|
|
327
|
-
background-color: @btn-hover;
|
|
328
|
-
border-radius: @borderRadius;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 编辑 -->
|
|
3
|
+
<div
|
|
4
|
+
v-if="canEdit"
|
|
5
|
+
class="DshLabels"
|
|
6
|
+
>
|
|
7
|
+
<Dropdown
|
|
8
|
+
class="DshLabels-dropdown"
|
|
9
|
+
trigger="custom"
|
|
10
|
+
placement="bottom-start"
|
|
11
|
+
:visible="isVisible"
|
|
12
|
+
transfer
|
|
13
|
+
@on-clickoutside="clickInput"
|
|
14
|
+
>
|
|
15
|
+
<!-- 可编辑 -->
|
|
16
|
+
<dsh-control-input
|
|
17
|
+
:class="commonClass"
|
|
18
|
+
:value="curValList"
|
|
19
|
+
:disabled="disabled"
|
|
20
|
+
:heightAuto="isHeightAuto"
|
|
21
|
+
:propsObj="selfPropsObj"
|
|
22
|
+
@deleteItem="clickDeleteItem"
|
|
23
|
+
@clear="clickClear"
|
|
24
|
+
@click.native="clickInput"
|
|
25
|
+
></dsh-control-input>
|
|
26
|
+
|
|
27
|
+
<template #list>
|
|
28
|
+
<DropdownMenu class="DshLabels-dropdown-menu">
|
|
29
|
+
<DropdownItem
|
|
30
|
+
v-for="listItem in listData"
|
|
31
|
+
:key="listItem._key"
|
|
32
|
+
:class="{
|
|
33
|
+
'item': true,
|
|
34
|
+
'item-active': !!curValList.find(item => item._key === listItem._key)
|
|
35
|
+
}"
|
|
36
|
+
@click.native="clickItem(listItem)"
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
v-if="listItem.isEdit"
|
|
41
|
+
class="item-edit"
|
|
42
|
+
>
|
|
43
|
+
<Input
|
|
44
|
+
v-model="listItem.name"
|
|
45
|
+
@click.native="clickEditInput($event)"
|
|
46
|
+
>
|
|
47
|
+
<template #suffix>
|
|
48
|
+
<Icon
|
|
49
|
+
class="item-edit-icon"
|
|
50
|
+
custom="bri bri-duigou"
|
|
51
|
+
@click.native.stop="clickConfirm(listItem)"
|
|
52
|
+
/>
|
|
53
|
+
</template>
|
|
54
|
+
</Input>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div
|
|
58
|
+
v-else
|
|
59
|
+
class="item-show"
|
|
60
|
+
>
|
|
61
|
+
{{ listItem.name }}
|
|
62
|
+
<span class="item-show-icons">
|
|
63
|
+
<Icon
|
|
64
|
+
v-if="!listItem.coreLabel"
|
|
65
|
+
class="item-show-icons-edit"
|
|
66
|
+
custom="bri bri-bianji"
|
|
67
|
+
@click.stop="clickEditIcon(listItem)"
|
|
68
|
+
/>
|
|
69
|
+
<!-- 暂时不需要删除 -->
|
|
70
|
+
<!-- <Icon
|
|
71
|
+
class="item-show-icons-del"
|
|
72
|
+
custom="bri bri-shanchu"
|
|
73
|
+
/> -->
|
|
74
|
+
</span>
|
|
75
|
+
</div>
|
|
76
|
+
</DropdownItem>
|
|
77
|
+
|
|
78
|
+
<div
|
|
79
|
+
v-if="!onlySelect"
|
|
80
|
+
class="btns"
|
|
81
|
+
>
|
|
82
|
+
<bri-button
|
|
83
|
+
class="btns-add"
|
|
84
|
+
:propsObj="{
|
|
85
|
+
btnType: 'default',
|
|
86
|
+
icon:'md-add'
|
|
87
|
+
}"
|
|
88
|
+
@click.native.stop="clickAddItem"
|
|
89
|
+
>添加选项</bri-button>
|
|
90
|
+
</div>
|
|
91
|
+
</DropdownMenu>
|
|
92
|
+
</template>
|
|
93
|
+
</Dropdown>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<!-- 查看 -->
|
|
97
|
+
<div
|
|
98
|
+
v-else
|
|
99
|
+
class="DshLabels-show"
|
|
100
|
+
>
|
|
101
|
+
<!-- 有值 -->
|
|
102
|
+
<template v-if="!$isEmptyData(curValList)">
|
|
103
|
+
<!-- 高度自由时 -->
|
|
104
|
+
<dsh-tags
|
|
105
|
+
v-if="isHeightAuto"
|
|
106
|
+
:class="{
|
|
107
|
+
...commonClass,
|
|
108
|
+
'DshLabels-show-auto': true
|
|
109
|
+
}"
|
|
110
|
+
itemClass="DshLabels-show-auto-tag"
|
|
111
|
+
:list="curValList"
|
|
112
|
+
></dsh-tags>
|
|
113
|
+
|
|
114
|
+
<!-- 高度不自由(不换行) -->
|
|
115
|
+
<bri-tooltip
|
|
116
|
+
v-else
|
|
117
|
+
:content="showMulVal"
|
|
118
|
+
:transfer="true"
|
|
119
|
+
>
|
|
120
|
+
<dsh-tags
|
|
121
|
+
:class="{
|
|
122
|
+
...commonClass,
|
|
123
|
+
'DshLabels-show-ellipsis': true
|
|
124
|
+
}"
|
|
125
|
+
itemClass="DshLabels-show-ellipsis-tag"
|
|
126
|
+
:list="curValList"
|
|
127
|
+
></dsh-tags>
|
|
128
|
+
</bri-tooltip>
|
|
129
|
+
</template>
|
|
130
|
+
|
|
131
|
+
<!-- 无值 -->
|
|
132
|
+
<div
|
|
133
|
+
v-else
|
|
134
|
+
:class="commonClass"
|
|
135
|
+
>
|
|
136
|
+
{{ emptyShowVal }}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|
|
140
|
+
|
|
141
|
+
<script>
|
|
142
|
+
import controlMixin from "../mixins/controlMixin.js";
|
|
143
|
+
|
|
144
|
+
export default {
|
|
145
|
+
name: "DshLabels",
|
|
146
|
+
mixins: [
|
|
147
|
+
controlMixin
|
|
148
|
+
],
|
|
149
|
+
data () {
|
|
150
|
+
return {
|
|
151
|
+
listData: [],
|
|
152
|
+
isVisible: false,
|
|
153
|
+
renderList: false
|
|
154
|
+
};
|
|
155
|
+
},
|
|
156
|
+
computed: {
|
|
157
|
+
selfPropsObj () {
|
|
158
|
+
return {
|
|
159
|
+
_icon: this.isVisible ? "ios-arrow-up" : "ios-arrow-down",
|
|
160
|
+
_labelType: "entity",
|
|
161
|
+
_onlySelect: false,
|
|
162
|
+
_originLabels: [],
|
|
163
|
+
|
|
164
|
+
...this.propsObj,
|
|
165
|
+
...this.commonDealPropsObj
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
subType () {
|
|
169
|
+
return this.selfPropsObj._labelType;
|
|
170
|
+
},
|
|
171
|
+
onlySelect () {
|
|
172
|
+
return this.isInAnySearch ? true : this.selfPropsObj._onlySelect;
|
|
173
|
+
},
|
|
174
|
+
originLabels () {
|
|
175
|
+
return this.selfPropsObj._originLabels;
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
showMulVal () {
|
|
179
|
+
return this.$isEmptyData(this.curValList)
|
|
180
|
+
? this.emptyShowVal
|
|
181
|
+
: this.curValList.map(item => item.name).join("、");
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
created () {},
|
|
185
|
+
methods: {
|
|
186
|
+
clickInput () {
|
|
187
|
+
if (!this.disabled) {
|
|
188
|
+
if (!this.renderList) {
|
|
189
|
+
if (this.isDftSet) {
|
|
190
|
+
this.listData = this.originLabels.map(item => {
|
|
191
|
+
return {
|
|
192
|
+
...item,
|
|
193
|
+
isEdit: false
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
} else {
|
|
197
|
+
this.getListData();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
this.renderList = true;
|
|
201
|
+
this.isVisible = !this.isVisible;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
clickEditInput (e) {
|
|
205
|
+
e.stopPropagation();
|
|
206
|
+
},
|
|
207
|
+
clickEditIcon (listItem) {
|
|
208
|
+
listItem.isEdit = true;
|
|
209
|
+
this.$forceUpdate();
|
|
210
|
+
},
|
|
211
|
+
clickConfirm (listItem) {
|
|
212
|
+
if (listItem.name) {
|
|
213
|
+
listItem.isEdit = false;
|
|
214
|
+
this.$forceUpdate();
|
|
215
|
+
};
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
clickItem (listItem) {
|
|
219
|
+
if (this.curValList.some(item => item._key === listItem._key)) {
|
|
220
|
+
this.curValList = this.curValList.filter(item => item._key !== listItem._key);
|
|
221
|
+
} else {
|
|
222
|
+
this.curValList = [...this.curValList, listItem];
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
clickAddItem () {
|
|
226
|
+
this.listData.push({
|
|
227
|
+
_key: this.$randomB36("Labels"),
|
|
228
|
+
isEdit: true,
|
|
229
|
+
name: "",
|
|
230
|
+
labelType: this.subType
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
clickDeleteItem (deleteItem) {
|
|
234
|
+
this.curValList = this.curValList.filter(item => item._key !== deleteItem._key);
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
// 接口 -获取列表数据
|
|
238
|
+
getListData () {
|
|
239
|
+
this.$https({
|
|
240
|
+
url: {
|
|
241
|
+
module: "sheet",
|
|
242
|
+
name: "memberAll"
|
|
243
|
+
},
|
|
244
|
+
params: {
|
|
245
|
+
search: {
|
|
246
|
+
entityKey: this.entityKey,
|
|
247
|
+
modKey: this.modKey,
|
|
248
|
+
fieldKey: this.fieldKey, // 当前字段Key
|
|
249
|
+
labelType: this.subType
|
|
250
|
+
},
|
|
251
|
+
pagination: {
|
|
252
|
+
page: 1,
|
|
253
|
+
pagesize: 999
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
callback: data => {
|
|
257
|
+
this.listData = data.list.map(item => {
|
|
258
|
+
return {
|
|
259
|
+
...item,
|
|
260
|
+
isEdit: false
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
</script>
|
|
269
|
+
|
|
270
|
+
<style lang="less">
|
|
271
|
+
@import url("../control.less");
|
|
272
|
+
|
|
273
|
+
.DshLabels {
|
|
274
|
+
#control-show();
|
|
275
|
+
|
|
276
|
+
&-dropdown {
|
|
277
|
+
width: 100%;
|
|
278
|
+
|
|
279
|
+
&-menu {
|
|
280
|
+
.item {
|
|
281
|
+
margin: 4px 8px;
|
|
282
|
+
border-radius: @borderRadius;
|
|
283
|
+
|
|
284
|
+
&-active {
|
|
285
|
+
background-color: @theme-focus;
|
|
286
|
+
color: @themeColor;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
&-edit {
|
|
290
|
+
&-icon {
|
|
291
|
+
color: @themeColor;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&-show {
|
|
296
|
+
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.btns {
|
|
301
|
+
border-top: 1px solid #E7E7E7;
|
|
302
|
+
margin: 12px 8px 0;
|
|
303
|
+
padding-top: 8px;
|
|
304
|
+
|
|
305
|
+
&-add {
|
|
306
|
+
width: 100%;
|
|
307
|
+
margin-bottom: 8px;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.ivu-select-dropdown {
|
|
314
|
+
width: fit-content;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.ivu-input-suffix {
|
|
318
|
+
display: flex;
|
|
319
|
+
align-items: center;
|
|
320
|
+
|
|
321
|
+
i {
|
|
322
|
+
width: 24px;
|
|
323
|
+
height: 24px;
|
|
324
|
+
line-height: 24px;
|
|
325
|
+
|
|
326
|
+
&:hover {
|
|
327
|
+
background-color: @btn-hover;
|
|
328
|
+
border-radius: @borderRadius;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
</style>
|