bri-components 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/2.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/7.bri-components.min.js +1 -1
- package/lib/8.bri-components.min.js +1 -1
- package/lib/9.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +6 -6
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/abolish/DshFlatTable.vue +1 -1
- package/src/components/.DS_Store +0 -0
- package/src/components/controls/.DS_Store +0 -0
- package/src/components/controls/base/BriUpload/BriUpload.vue +2 -1
- package/src/components/controls/base/DshCascader/DshCascader.vue +53 -51
- package/src/components/controls/base/DshCascader/InfoCascader.vue +3 -4
- package/src/components/controls/base/DshCheckbox.vue +8 -8
- package/src/components/controls/base/DshSelect.vue +1 -1
- package/src/components/controls/controlMap.js +4 -0
- package/src/components/controls/controlMixin.js +14 -12
- package/src/components/controls/senior/.DS_Store +0 -0
- package/src/components/controls/senior/BriLabels.vue +169 -158
- package/src/components/controls/senior/selectDepartments.vue +380 -0
- package/src/components/controls/senior/selectUsers/DepartmentMenu.vue +191 -0
- package/src/components/controls/senior/selectUsers/selectUsers.vue +482 -0
- package/src/components/list/BriCard.vue +52 -0
- package/src/components/list/BriTreeItem.vue +110 -0
- package/src/components/small/DshTags.vue +1 -1
- package/src/index.js +7 -3
- package/src/styles/.DS_Store +0 -0
- package/src/styles/common/control.less +57 -54
- package/src/styles/components/.DS_Store +0 -0
- package/src/styles/components/controls/base/BriUpload/BriUpload.less +11 -3
- package/src/styles/components/controls/base/DshCascader/DshCascader.less +24 -77
- package/src/styles/components/controls/base/DshCheckbox.less +65 -69
- package/src/styles/components/controls/base/DshEditor.less +3 -2
- package/src/styles/components/controls/base/DshInput.less +4 -8
- package/src/styles/components/controls/base/DshNumber.less +2 -2
- package/src/styles/components/controls/base/DshSelect.less +3 -3
- package/src/styles/components/controls/senior/BriLabels.less +32 -118
- package/src/styles/components/controls/senior/cascaderTable.less +1 -1
- package/src/styles/components/controls/senior/flatTable.less +1 -1
- package/src/styles/components/controls/senior/selectDepartments.less +106 -0
- package/src/styles/components/controls/senior/selectUsers/DepartmentMenu.less +37 -0
- package/src/styles/components/controls/senior/selectUsers/index.less +2 -0
- package/src/styles/components/controls/senior/selectUsers/selectUsers.less +167 -0
- package/src/styles/components/form/DshDefaultSearch.less +1 -2
- package/src/styles/components/index.less +7 -3
- package/src/styles/components/list/BriCard.less +50 -0
- package/src/styles/components/list/BriTreeItem.less +50 -0
- package/src/styles/components/unit/DshFormItem.less +0 -1
|
@@ -2,131 +2,141 @@
|
|
|
2
2
|
<template>
|
|
3
3
|
<div class="BriLabels">
|
|
4
4
|
<!-- 编辑页 -->
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
>
|
|
14
|
-
<!-- 可编辑 -->
|
|
15
|
-
<div
|
|
16
|
-
:class="{
|
|
17
|
-
'BriLabels-box': true,
|
|
18
|
-
...commonClass
|
|
19
|
-
}"
|
|
20
|
-
@click="clickInput"
|
|
5
|
+
<template v-if="canEdit">
|
|
6
|
+
<Dropdown
|
|
7
|
+
class="BriLabels-dropdown"
|
|
8
|
+
trigger="custom"
|
|
9
|
+
placement="bottom-start"
|
|
10
|
+
:visible="listVisible"
|
|
11
|
+
transfer
|
|
12
|
+
@on-clickoutside="clickInput"
|
|
21
13
|
>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
<!-- 可编辑 -->
|
|
15
|
+
<div
|
|
16
|
+
:class="{
|
|
17
|
+
...commonClass,
|
|
18
|
+
'BriLabels-edit': true
|
|
19
|
+
}"
|
|
20
|
+
@click="clickInput"
|
|
21
|
+
>
|
|
22
|
+
<template v-if="!$isEmptyData(val)">
|
|
23
|
+
<dsh-tags
|
|
24
|
+
class="overflow"
|
|
25
|
+
:list="val"
|
|
26
|
+
:propsObj="{
|
|
27
|
+
disabled: !finalCanEdit
|
|
28
|
+
}"
|
|
29
|
+
@delete="clickDeleteItem"
|
|
30
|
+
>
|
|
31
|
+
<span slot-scope="{ tagItem }">
|
|
32
|
+
{{ tagItem.name }}
|
|
33
|
+
</span>
|
|
34
|
+
</dsh-tags>
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
<Icon
|
|
37
|
+
class="icon-default"
|
|
38
|
+
:type="inputIcon"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
<template v-else>
|
|
43
|
+
{{ emptyShowVal }}
|
|
44
|
+
</template>
|
|
45
|
+
</div>
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
>
|
|
56
|
-
<div
|
|
57
|
-
class="BriLabels-dropdown-item-show"
|
|
58
|
-
v-if="!item.isEdit"
|
|
47
|
+
<template #list>
|
|
48
|
+
<DropdownMenu class="BriLabels-dropdown-menu">
|
|
49
|
+
<DropdownItem
|
|
50
|
+
v-for="item in listData"
|
|
51
|
+
:key="item._key"
|
|
52
|
+
:class="{
|
|
53
|
+
'item': true,
|
|
54
|
+
'item-active': !!val.find(i=>i._key == item._key)
|
|
55
|
+
}"
|
|
56
|
+
@click.native="clickItem(item)"
|
|
59
57
|
>
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
|
|
59
|
+
<div
|
|
60
|
+
v-if="item.isEdit"
|
|
61
|
+
class="item-edit"
|
|
62
|
+
>
|
|
63
|
+
<Input
|
|
64
|
+
v-model="item.name"
|
|
65
|
+
@click.native="clickEditInput($event)"
|
|
66
|
+
>
|
|
67
|
+
<template #suffix>
|
|
68
|
+
<Icon
|
|
69
|
+
color="#3DB8C5"
|
|
70
|
+
custom="bri bri-duigou"
|
|
71
|
+
@click.native.stop="clickConfirm(item)"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
</Input>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div
|
|
78
|
+
v-else
|
|
79
|
+
class="item-show"
|
|
80
|
+
>
|
|
81
|
+
{{ item.name }}
|
|
82
|
+
<span class="item-show-icons">
|
|
83
|
+
<Icon
|
|
84
|
+
v-if="!item.coreLabel"
|
|
85
|
+
class="item-show-icons-edit"
|
|
86
|
+
custom="bri bri-bianji"
|
|
87
|
+
@click.stop="clickEditIcon(item)"
|
|
88
|
+
/>
|
|
89
|
+
<!-- 暂时不需要删除 -->
|
|
90
|
+
<!-- <Icon
|
|
91
|
+
class="item-show-icons-del"
|
|
92
|
+
custom="bri bri-shanchu"
|
|
93
|
+
/> -->
|
|
94
|
+
</span>
|
|
95
|
+
</div>
|
|
96
|
+
</DropdownItem>
|
|
97
|
+
|
|
75
98
|
<div
|
|
76
|
-
|
|
77
|
-
|
|
99
|
+
v-if="!selfPropsObj._onlySelect"
|
|
100
|
+
class="btns"
|
|
78
101
|
>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
@click.native.stop="confirmEdit(item)"
|
|
88
|
-
/>
|
|
89
|
-
</template>
|
|
90
|
-
</Input>
|
|
102
|
+
<bri-button
|
|
103
|
+
class="btns-add"
|
|
104
|
+
:propsObj="{
|
|
105
|
+
btnType: 'default',
|
|
106
|
+
icon:'md-add'
|
|
107
|
+
}"
|
|
108
|
+
@click.native.stop="clickAddItem"
|
|
109
|
+
>添加选项</bri-button>
|
|
91
110
|
</div>
|
|
92
|
-
</
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
>
|
|
97
|
-
<bri-button
|
|
98
|
-
class="BriLabels-dropdown-add"
|
|
99
|
-
:propsObj="{
|
|
100
|
-
btnType: 'default',
|
|
101
|
-
icon:'md-add'
|
|
102
|
-
}"
|
|
103
|
-
@click.native.stop="addLabel"
|
|
104
|
-
>
|
|
105
|
-
添加选项
|
|
106
|
-
</bri-button>
|
|
107
|
-
</div>
|
|
108
|
-
</DropdownMenu>
|
|
109
|
-
</template>
|
|
110
|
-
</Dropdown>
|
|
111
|
+
</DropdownMenu>
|
|
112
|
+
</template>
|
|
113
|
+
</Dropdown>
|
|
114
|
+
</template>
|
|
111
115
|
|
|
112
|
-
<!--
|
|
116
|
+
<!-- 查看 -->
|
|
113
117
|
<template v-else>
|
|
114
118
|
<bri-tooltip
|
|
115
119
|
:content="showValStr"
|
|
116
120
|
maxWidth="200"
|
|
117
121
|
:transfer="true"
|
|
118
122
|
>
|
|
119
|
-
<div :class="
|
|
123
|
+
<div :class="{
|
|
124
|
+
...commonClass,
|
|
125
|
+
'BriLabels-show': true
|
|
126
|
+
}">
|
|
120
127
|
<dsh-tags
|
|
121
128
|
v-if="!$isEmptyData(val)"
|
|
122
|
-
class="
|
|
129
|
+
class="text"
|
|
123
130
|
:list="val"
|
|
124
131
|
:propsObj="{
|
|
125
132
|
closable: false
|
|
126
133
|
}"
|
|
127
134
|
>
|
|
128
|
-
<span slot-scope="{ tagItem }">
|
|
135
|
+
<span slot-scope="{ tagItem }">
|
|
136
|
+
{{ tagItem.name }}
|
|
137
|
+
</span>
|
|
129
138
|
</dsh-tags>
|
|
139
|
+
|
|
130
140
|
<template v-else>
|
|
131
141
|
{{ emptyShowVal }}
|
|
132
142
|
</template>
|
|
@@ -141,7 +151,9 @@
|
|
|
141
151
|
|
|
142
152
|
export default {
|
|
143
153
|
name: "BriLabels",
|
|
144
|
-
mixins: [
|
|
154
|
+
mixins: [
|
|
155
|
+
controlMixin
|
|
156
|
+
],
|
|
145
157
|
data () {
|
|
146
158
|
return {
|
|
147
159
|
listData: [],
|
|
@@ -157,31 +169,28 @@
|
|
|
157
169
|
...this.commonDealPropsObj
|
|
158
170
|
};
|
|
159
171
|
},
|
|
160
|
-
modKey () {
|
|
161
|
-
return this.selfPropsObj.modKey;
|
|
162
|
-
},
|
|
163
172
|
val: {
|
|
164
173
|
get () {
|
|
165
|
-
return this.value[this.
|
|
174
|
+
return this.value[this.controlKey] || [];
|
|
166
175
|
},
|
|
167
176
|
set (val) {
|
|
168
|
-
this.value[this.
|
|
177
|
+
this.value[this.controlKey] = val;
|
|
169
178
|
}
|
|
170
179
|
},
|
|
180
|
+
|
|
181
|
+
isCore () {
|
|
182
|
+
return this.selfPropsObj.isCore;
|
|
183
|
+
},
|
|
171
184
|
showValStr () {
|
|
172
185
|
let valArr = this.val && this.val.map(item => item.name);
|
|
173
186
|
return valArr && valArr.join("、");
|
|
174
|
-
},
|
|
175
|
-
isCore () {
|
|
176
|
-
return this.propsObj.isCore;
|
|
177
187
|
}
|
|
178
188
|
},
|
|
179
|
-
created () {
|
|
180
|
-
},
|
|
189
|
+
created () {},
|
|
181
190
|
methods: {
|
|
182
191
|
init () {
|
|
183
192
|
if (this.isCore) {
|
|
184
|
-
this.listData = this.
|
|
193
|
+
this.listData = this.selfPropsObj._originLabels.map(item => {
|
|
185
194
|
return {
|
|
186
195
|
...item,
|
|
187
196
|
isEdit: false
|
|
@@ -191,34 +200,7 @@
|
|
|
191
200
|
this.getListData();
|
|
192
201
|
}
|
|
193
202
|
},
|
|
194
|
-
|
|
195
|
-
this.$https({
|
|
196
|
-
url: {
|
|
197
|
-
module: "sheet",
|
|
198
|
-
name: "memberAll"
|
|
199
|
-
},
|
|
200
|
-
params: {
|
|
201
|
-
search: {
|
|
202
|
-
entityKey: this.entityKey, // 当前工作表关联的数据表Key
|
|
203
|
-
fieldKey: this.selfPropsObj._key === "_default" ? this.value._key : (this.selfPropsObj.__realKey__ || this.selfPropsObj._key), // 当前字段Key
|
|
204
|
-
labelType: this.selfPropsObj._labelType,
|
|
205
|
-
modKey: this.modKey
|
|
206
|
-
},
|
|
207
|
-
pagination: {
|
|
208
|
-
page: 1,
|
|
209
|
-
pagesize: 999
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
callback: data => {
|
|
213
|
-
this.listData = data.list.map(item => {
|
|
214
|
-
return {
|
|
215
|
-
...item,
|
|
216
|
-
isEdit: false
|
|
217
|
-
};
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
},
|
|
203
|
+
|
|
222
204
|
clickInput () {
|
|
223
205
|
if (!this.finalCanEdit) return;
|
|
224
206
|
if (!this.renderList) {
|
|
@@ -232,31 +214,32 @@
|
|
|
232
214
|
this.inputIcon = "ios-arrow-down";
|
|
233
215
|
}
|
|
234
216
|
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
this.val = this.val.filter(i => i._key != item._key);
|
|
238
|
-
} else {
|
|
239
|
-
this.val.push(item);
|
|
240
|
-
}
|
|
241
|
-
this.change();
|
|
217
|
+
clickEditInput (e) {
|
|
218
|
+
e.stopPropagation();
|
|
242
219
|
},
|
|
243
|
-
|
|
220
|
+
clickEditIcon (item) {
|
|
244
221
|
item.isEdit = true;
|
|
245
222
|
this.$forceUpdate();
|
|
246
223
|
},
|
|
247
|
-
|
|
248
|
-
e.stopPropagation();
|
|
249
|
-
},
|
|
250
|
-
confirmEdit (item) {
|
|
224
|
+
clickConfirm (item) {
|
|
251
225
|
if (item.name == "") return;
|
|
252
226
|
item.isEdit = false;
|
|
253
227
|
this.$forceUpdate();
|
|
254
228
|
this.change();
|
|
255
229
|
},
|
|
256
|
-
|
|
230
|
+
|
|
231
|
+
clickItem (item) {
|
|
232
|
+
if (this.val.findIndex(i => i._key == item._key) > -1) {
|
|
233
|
+
this.val = this.val.filter(i => i._key != item._key);
|
|
234
|
+
} else {
|
|
235
|
+
this.val.push(item);
|
|
236
|
+
}
|
|
237
|
+
this.change();
|
|
238
|
+
},
|
|
239
|
+
clickDeleteItem (item) {
|
|
257
240
|
this.change();
|
|
258
241
|
},
|
|
259
|
-
|
|
242
|
+
clickAddItem () {
|
|
260
243
|
this.listData.push({
|
|
261
244
|
_key: this.$randomB36("Labels"),
|
|
262
245
|
isEdit: true,
|
|
@@ -264,9 +247,37 @@
|
|
|
264
247
|
labelType: this.selfPropsObj._labelType
|
|
265
248
|
});
|
|
266
249
|
this.change();
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
// 接口 -获取列表数据
|
|
253
|
+
getListData () {
|
|
254
|
+
this.$https({
|
|
255
|
+
url: {
|
|
256
|
+
module: "sheet",
|
|
257
|
+
name: "memberAll"
|
|
258
|
+
},
|
|
259
|
+
params: {
|
|
260
|
+
search: {
|
|
261
|
+
entityKey: this.entityKey, // 当前工作表关联的数据表Key
|
|
262
|
+
fieldKey: this.selfPropsObj._key === "_default" ? this.value._key : (this.selfPropsObj.__realKey__ || this.selfPropsObj._key), // 当前字段Key
|
|
263
|
+
labelType: this.selfPropsObj._labelType,
|
|
264
|
+
modKey: this.modKey
|
|
265
|
+
},
|
|
266
|
+
pagination: {
|
|
267
|
+
page: 1,
|
|
268
|
+
pagesize: 999
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
callback: data => {
|
|
272
|
+
this.listData = data.list.map(item => {
|
|
273
|
+
return {
|
|
274
|
+
...item,
|
|
275
|
+
isEdit: false
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
});
|
|
267
280
|
}
|
|
268
|
-
},
|
|
269
|
-
watch: {
|
|
270
281
|
}
|
|
271
282
|
};
|
|
272
283
|
</script>
|