bri-components 1.2.57 → 1.2.59
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/package.json +2 -2
- package/src/components/controls/base/BriUpload/BriUpload.vue +1 -1
- package/src/components/controls/base/DshCascader/DshCascader.vue +68 -231
- package/src/components/controls/base/DshCascader/{cascaderModal.vue → components/cascaderModal.vue} +22 -31
- package/src/components/controls/base/DshCascader/{cascaderPicker.vue → components/cascaderPicker.vue} +22 -18
- package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -0
- package/src/components/controls/base/DshCoordinates.vue +1 -1
- package/src/components/controls/base/DshDate/DshDate.vue +1 -1
- package/src/components/controls/base/DshDate/DshDaterange.vue +1 -1
- package/src/components/controls/base/DshDivider.vue +1 -1
- package/src/components/controls/base/DshEditor.vue +1 -1
- package/src/components/controls/base/DshInput/BriInputs.vue +1 -1
- package/src/components/controls/base/DshInput/DshInput.vue +1 -1
- package/src/components/controls/base/DshNumber/DshNumber.vue +1 -1
- package/src/components/controls/base/DshNumber/DshNumberange.vue +1 -1
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +187 -185
- package/src/components/controls/base/DshSelect/DshSelect.vue +140 -137
- package/src/components/controls/base/DshSwitch/switchMixin.js +1 -1
- package/src/components/controls/extra/themeColor.vue +1 -1
- package/src/components/controls/extra/themeIcon.vue +1 -1
- package/src/components/controls/{base/DshCascader → mixins}/cascaderMixin.js +16 -33
- package/src/components/controls/{base/DshCascader → mixins}/cascaderPickerMixin.js +52 -44
- package/src/components/controls/{controlMixin.js → mixins/controlMixin.js} +25 -4
- package/src/components/controls/mixins/selectMixin.js +192 -0
- package/src/components/controls/senior/BriLabels.vue +1 -1
- package/src/components/controls/senior/DshPackage.vue +1 -1
- package/src/components/controls/senior/cascaderTable.vue +1 -1
- package/src/components/controls/senior/flatTable.vue +1 -1
- package/src/components/controls/senior/selectDepartments.vue +1 -1
- package/src/components/controls/senior/selectUsers/selectUsers.vue +1 -1
- package/src/components/controls/special/DshBack.vue +1 -1
- package/src/components/controls/special/DshUndeveloped.vue +1 -1
- package/src/components/form/DshAdvSearch.vue +1 -1
- package/src/components/list/DshBox/DshCard.vue +153 -38
- package/src/components/list/DshBox/DshPanel.vue +260 -93
- package/src/components/small/BriTooltip.vue +2 -3
- package/src/components/unit/DshFormUnit.vue +7 -19
- package/src/styles/components/index.less +0 -2
- package/src/components/controls/base/DshSelect/selectMixin.js +0 -239
- package/src/styles/components/list/DshBox/DshCard.less +0 -59
- package/src/styles/components/list/DshBox/DshPanel.less +0 -107
- package/src/styles/components/small/BriTooltip.less +0 -0
|
@@ -1,111 +1,111 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- 单选模式 -->
|
|
2
|
+
<!-- 单选模式 编辑 -->
|
|
3
3
|
<div
|
|
4
|
-
v-if="!multipleMode"
|
|
4
|
+
v-if="!multipleMode && canEdit"
|
|
5
5
|
class="DshSelect"
|
|
6
6
|
>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
:class="{
|
|
7
|
+
<!-- 有选项 -->
|
|
8
|
+
<template v-if="listData.length">
|
|
9
|
+
<!-- flat方式 -->
|
|
10
|
+
<template v-if="['flat', 'button'].includes(showType)">
|
|
11
|
+
<RadioGroup
|
|
12
|
+
:class="{
|
|
14
13
|
'DshSelect-flat': true,
|
|
15
14
|
'DshSelect-flat-color': useColor,
|
|
16
|
-
'DshSelect-flat-scroll':
|
|
15
|
+
'DshSelect-flat-scroll': !isFullRow
|
|
17
16
|
}"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
:value="curVal"
|
|
18
|
+
:type="radioGroupType"
|
|
19
|
+
>
|
|
20
|
+
<Radio
|
|
21
|
+
v-for="(item, index) in listData"
|
|
22
|
+
:key="item._key"
|
|
23
|
+
:class="getItemClass(item)"
|
|
24
|
+
:style="getItemColorStyle(item)"
|
|
25
|
+
:label="item._key"
|
|
26
|
+
:disabled="getRadioItemDisabled(item)"
|
|
27
|
+
:border="useColor"
|
|
28
|
+
@click.native="clickRadioItem(item, index)"
|
|
21
29
|
>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:label="item._key"
|
|
28
|
-
:disabled="getItemDisabled(item)"
|
|
29
|
-
:border="useColor"
|
|
30
|
-
@click.native="cancelSelect(item)"
|
|
31
|
-
>
|
|
32
|
-
<span @click.stop="clickOpenTip(item)">
|
|
33
|
-
{{ item.name || item._name }}
|
|
34
|
-
</span>
|
|
35
|
-
</Radio>
|
|
36
|
-
</RadioGroup>
|
|
37
|
-
|
|
38
|
-
<!-- tip项弹框提示 -->
|
|
39
|
-
<dsh-render :render="tipModalRender"></dsh-render>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<!-- dropdown模式 -->
|
|
43
|
-
<template v-else>
|
|
44
|
-
<Select
|
|
45
|
-
v-model="curVal"
|
|
46
|
-
:placeholder="selfPropsObj._placeholder"
|
|
47
|
-
:multiple="false"
|
|
48
|
-
:disabled="!finalCanEdit"
|
|
49
|
-
:clearable="selfPropsObj._clearable"
|
|
50
|
-
:filterable="selfPropsObj._filterable"
|
|
51
|
-
:size="selfPropsObj._size"
|
|
52
|
-
:transfer="selfPropsObj._transfer"
|
|
53
|
-
:transfer-class-name="selfPropsObj._transferClassName"
|
|
54
|
-
@on-change="change"
|
|
55
|
-
>
|
|
56
|
-
<!-- </Option>必须和输出内容在一行,否则出现空格导致_filterable出bug -->
|
|
57
|
-
<Option
|
|
58
|
-
v-for="(item, index) in listData"
|
|
59
|
-
:key="index"
|
|
60
|
-
:value="item._key"
|
|
61
|
-
:label="item.name || item._name"
|
|
62
|
-
:disabled="getItemDisabled(item)"
|
|
63
|
-
>
|
|
64
|
-
<Icon
|
|
65
|
-
v-if="item.icon || item.customIcon"
|
|
66
|
-
:type="item.icon"
|
|
67
|
-
:custom="item.customIcon ? `bico-font ${item.customIcon}` : undefined"
|
|
68
|
-
:color="item.color"
|
|
69
|
-
:size="item.size || 20"
|
|
70
|
-
/>{{ item.name || item._name }}
|
|
71
|
-
</Option>
|
|
72
|
-
</Select>
|
|
73
|
-
</template>
|
|
30
|
+
<span>
|
|
31
|
+
{{ item.name || item._name }}
|
|
32
|
+
</span>
|
|
33
|
+
</Radio>
|
|
34
|
+
</RadioGroup>
|
|
74
35
|
</template>
|
|
75
36
|
|
|
76
|
-
<!--
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
37
|
+
<!-- dropdown模式 -->
|
|
38
|
+
<template v-else>
|
|
39
|
+
<Select
|
|
40
|
+
class="DshSelect-dropdown"
|
|
41
|
+
v-model="curVal"
|
|
42
|
+
:placeholder="selfPropsObj._placeholder"
|
|
43
|
+
:multiple="false"
|
|
44
|
+
:disabled="!finalCanEdit"
|
|
45
|
+
:clearable="selfPropsObj._clearable"
|
|
46
|
+
:filterable="selfPropsObj._filterable"
|
|
47
|
+
:size="selfPropsObj._size"
|
|
48
|
+
:transfer="selfPropsObj._transfer"
|
|
49
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
50
|
+
>
|
|
51
|
+
<!-- </Option>必须和输出内容在一行,否则出现空格导致_filterable出bug -->
|
|
52
|
+
<Option
|
|
53
|
+
v-for="(item, index) in listData"
|
|
54
|
+
:key="item._key"
|
|
55
|
+
:value="item._key"
|
|
56
|
+
:label="item.name || item._name"
|
|
57
|
+
:disabled="getRadioItemDisabled(item, index)"
|
|
58
|
+
>
|
|
59
|
+
<Icon
|
|
60
|
+
v-if="item.icon || item.customIcon"
|
|
61
|
+
:type="item.icon"
|
|
62
|
+
:custom="item.customIcon ? `bico-font ${item.customIcon}` : undefined"
|
|
63
|
+
:color="item.color"
|
|
64
|
+
:size="item.size || 20"
|
|
65
|
+
/>
|
|
66
|
+
|
|
67
|
+
<slot :item="item"></slot>
|
|
68
|
+
|
|
69
|
+
<span>{{ item.name || item._name }}</span>
|
|
70
|
+
</Option>
|
|
71
|
+
</Select>
|
|
72
|
+
</template>
|
|
81
73
|
</template>
|
|
82
74
|
|
|
83
|
-
<!--
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
<!-- 无选项 -->
|
|
76
|
+
<div
|
|
77
|
+
v-else
|
|
78
|
+
class="dsh-subtip"
|
|
79
|
+
>-- 无选择项 --</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<!-- 单选模式 查看 -->
|
|
83
|
+
<div
|
|
84
|
+
v-else-if="!multipleMode && !canEdit"
|
|
85
|
+
class="DshSelect-show"
|
|
86
|
+
>
|
|
87
|
+
<!-- 有值 -->
|
|
88
|
+
<bri-tooltip
|
|
89
|
+
v-if="!$isEmptyData(curVal)"
|
|
90
|
+
:content="showVal"
|
|
91
|
+
:transfer="true"
|
|
92
|
+
>
|
|
93
|
+
<dsh-tags
|
|
94
|
+
:class="{
|
|
92
95
|
...commonClass,
|
|
93
|
-
'DshSelect-show':
|
|
94
|
-
}"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</div>
|
|
107
|
-
</bri-tooltip>
|
|
108
|
-
</template>
|
|
96
|
+
'DshSelect-show-ellipsis': !(isDetailShow && isFullRow)
|
|
97
|
+
}"
|
|
98
|
+
:list="[curValObj]"
|
|
99
|
+
></dsh-tags>
|
|
100
|
+
</bri-tooltip>
|
|
101
|
+
|
|
102
|
+
<!-- 无值 -->
|
|
103
|
+
<div
|
|
104
|
+
v-else
|
|
105
|
+
:class="commonClass"
|
|
106
|
+
>
|
|
107
|
+
{{ emptyShowVal }}
|
|
108
|
+
</div>
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
111
|
<!-- 多选模式 -->
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
</template>
|
|
120
120
|
|
|
121
121
|
<script>
|
|
122
|
-
import selectMixin from "
|
|
122
|
+
import selectMixin from "../../mixins/selectMixin.js";
|
|
123
123
|
import DshCheckbox from "./DshCheckbox.vue";
|
|
124
124
|
|
|
125
125
|
export default {
|
|
@@ -138,7 +138,8 @@
|
|
|
138
138
|
selfPropsObj () {
|
|
139
139
|
return {
|
|
140
140
|
_transfer: true,
|
|
141
|
-
|
|
141
|
+
|
|
142
|
+
...this.basePropsObj
|
|
142
143
|
};
|
|
143
144
|
},
|
|
144
145
|
radioGroupType () {
|
|
@@ -146,45 +147,12 @@
|
|
|
146
147
|
}
|
|
147
148
|
},
|
|
148
149
|
created () {},
|
|
149
|
-
methods: {
|
|
150
|
-
// 取消flat模式的选择项
|
|
151
|
-
cancelSelect (item) {
|
|
152
|
-
if (item._disabled !== true && this.selfPropsObj._clearable !== false) {
|
|
153
|
-
if (item._key === this.curVal) {
|
|
154
|
-
this.value[this.controlKey] = "";
|
|
155
|
-
this.change();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
this.clickOpenTip(item);
|
|
160
|
-
},
|
|
161
|
-
change (...params) {
|
|
162
|
-
// 修复clear后值为undefined,数据库不更新数据bug
|
|
163
|
-
if (this.value[this.controlKey] == undefined) {
|
|
164
|
-
this.value[this.controlKey] = "";
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
this.$emit("change", this.curVal);
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
getItemColorClass (item) {
|
|
171
|
-
return this.colorMap[item.color] ? item.color : "color-1";
|
|
172
|
-
},
|
|
173
|
-
getItemStyle (item) {
|
|
174
|
-
const color = this.colorMap[item.color] || this.colorMap["color-1"];
|
|
175
|
-
return {
|
|
176
|
-
backgroundColor: this.useColor ? this.$getColor(color, 0.1) : undefined,
|
|
177
|
-
color: this.useColor ? color : undefined
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
150
|
+
methods: {}
|
|
181
151
|
};
|
|
182
152
|
</script>
|
|
183
153
|
|
|
184
154
|
<style lang="less">
|
|
185
155
|
.DshSelect {
|
|
186
|
-
width: 100%;
|
|
187
|
-
|
|
188
156
|
&-flat {
|
|
189
157
|
width: 100%;
|
|
190
158
|
|
|
@@ -249,10 +217,46 @@
|
|
|
249
217
|
}
|
|
250
218
|
|
|
251
219
|
&-scroll {
|
|
220
|
+
.bri-scrollbar3();
|
|
252
221
|
overflow: auto;
|
|
253
222
|
white-space: nowrap;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
254
225
|
|
|
255
|
-
|
|
226
|
+
&-dropdown {
|
|
227
|
+
.ivu-select-multiple {
|
|
228
|
+
.ivu-select-selection {
|
|
229
|
+
height: 32px;
|
|
230
|
+
.dsh-flex-row-between-center();
|
|
231
|
+
|
|
232
|
+
& > div {
|
|
233
|
+
width: 100%;
|
|
234
|
+
height: 100%;
|
|
235
|
+
word-break: keep-all;
|
|
236
|
+
white-space: nowrap;
|
|
237
|
+
overflow: auto;
|
|
238
|
+
.bri-scrollbar3();
|
|
239
|
+
|
|
240
|
+
.ivu-tag {
|
|
241
|
+
margin: 2px 4px 0px 0px;
|
|
242
|
+
background-color: @borderColor;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&.ivu-select-disabled {
|
|
248
|
+
.ivu-select-selection {
|
|
249
|
+
& > div {
|
|
250
|
+
.ivu-tag {
|
|
251
|
+
background-color: @border-disabled;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.ivu-select-item-selected:after {
|
|
258
|
+
content: none;
|
|
259
|
+
}
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
262
|
|
|
@@ -308,11 +312,10 @@
|
|
|
308
312
|
}
|
|
309
313
|
}
|
|
310
314
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
display: none;
|
|
315
|
+
// 查看
|
|
316
|
+
&-show {
|
|
317
|
+
&-ellipsis {
|
|
318
|
+
.dsh-ellipsis();
|
|
316
319
|
}
|
|
317
320
|
}
|
|
318
321
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import controlMixin from "
|
|
1
|
+
import controlMixin from "./controlMixin.js";
|
|
2
2
|
import { regionData, userIndustryData } from "bri-datas";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
@@ -15,6 +15,9 @@ export default {
|
|
|
15
15
|
const _joinSymbol = this.propsObj._joinSymbol || "/";
|
|
16
16
|
return {
|
|
17
17
|
_showMode: "default",
|
|
18
|
+
_saveKey: "_key",
|
|
19
|
+
_valueKey: "code",
|
|
20
|
+
_nameKey: "name",
|
|
18
21
|
_filterable: true,
|
|
19
22
|
_cascaderFilterVals: [], // 过滤级联数据,只保留的数组
|
|
20
23
|
_renderFormat: (labels) => labels.join(_joinSymbol),
|
|
@@ -22,9 +25,6 @@ export default {
|
|
|
22
25
|
...this.propsObj,
|
|
23
26
|
...this.commonDealPropsObj,
|
|
24
27
|
|
|
25
|
-
_saveKey: this.propsObj._saveKey || "_key",
|
|
26
|
-
_valueKey: this.propsObj._valueKey || "code",
|
|
27
|
-
_nameKey: this.propsObj._nameKey || "name",
|
|
28
28
|
_changeOnSelect: this.isOnSearch
|
|
29
29
|
? true
|
|
30
30
|
: this.propsObj._changeOnSelect == undefined ? false : this.propsObj._changeOnSelect, // 每级菜单都可取值 -默认取末级
|
|
@@ -34,18 +34,6 @@ export default {
|
|
|
34
34
|
showType () {
|
|
35
35
|
return this.selfPropsObj._showMode;
|
|
36
36
|
},
|
|
37
|
-
filterable () {
|
|
38
|
-
return this.selfPropsObj._filterable;
|
|
39
|
-
},
|
|
40
|
-
cascaderLevel () {
|
|
41
|
-
return this.selfPropsObj._cascaderLevel;
|
|
42
|
-
},
|
|
43
|
-
cascaderFilterVals () {
|
|
44
|
-
return this.selfPropsObj._cascaderFilterVals;
|
|
45
|
-
},
|
|
46
|
-
changeOnSelect () {
|
|
47
|
-
return this.selfPropsObj._changeOnSelect;
|
|
48
|
-
},
|
|
49
37
|
saveKey () {
|
|
50
38
|
return this.selfPropsObj._saveKey;
|
|
51
39
|
},
|
|
@@ -55,6 +43,12 @@ export default {
|
|
|
55
43
|
nameKey () {
|
|
56
44
|
return this.selfPropsObj._nameKey;
|
|
57
45
|
},
|
|
46
|
+
cascaderLevel () {
|
|
47
|
+
return this.selfPropsObj._cascaderLevel;
|
|
48
|
+
},
|
|
49
|
+
cascaderFilterVals () {
|
|
50
|
+
return this.selfPropsObj._cascaderFilterVals;
|
|
51
|
+
},
|
|
58
52
|
renderFormat () {
|
|
59
53
|
return this.selfPropsObj._renderFormat;
|
|
60
54
|
},
|
|
@@ -67,13 +61,13 @@ export default {
|
|
|
67
61
|
: this.selfPropsObj._data;
|
|
68
62
|
},
|
|
69
63
|
cascaderData () {
|
|
70
|
-
const loop = (
|
|
71
|
-
if (
|
|
72
|
-
|
|
64
|
+
const loop = (arr = [], level, parentKeys = [], filterVals = [], isMobile = false) => {
|
|
65
|
+
if (arr && filterVals.length) {
|
|
66
|
+
arr = arr.filter(item => filterVals.includes(item[this.saveKey]));
|
|
73
67
|
}
|
|
74
68
|
|
|
75
|
-
return
|
|
76
|
-
?
|
|
69
|
+
return arr
|
|
70
|
+
? arr.reduce((arr, item) => {
|
|
77
71
|
let newItem = {
|
|
78
72
|
keys: [...parentKeys, item[this.saveKey]], // !!此处就是用_key拼,不会用别的属性
|
|
79
73
|
code: [...parentKeys, item._key].join(""),
|
|
@@ -104,9 +98,7 @@ export default {
|
|
|
104
98
|
|
|
105
99
|
return loop(this.originData, this.cascaderLevel, undefined, this.cascaderFilterVals, this.isMobile);
|
|
106
100
|
},
|
|
107
|
-
|
|
108
|
-
return this.$getTreeLinealDatas(this.curValList, this.cascaderData, this.valueKey, this.saveKey);
|
|
109
|
-
},
|
|
101
|
+
|
|
110
102
|
curValName: {
|
|
111
103
|
get () {
|
|
112
104
|
return this.transformFullName(this.curValList);
|
|
@@ -133,15 +125,6 @@ export default {
|
|
|
133
125
|
},
|
|
134
126
|
created () { },
|
|
135
127
|
methods: {
|
|
136
|
-
// 点击选择框 进行选择
|
|
137
|
-
clickInput (e) {
|
|
138
|
-
if (!this.selfPropsObj._disabled) {
|
|
139
|
-
this.openModal();
|
|
140
|
-
} else {
|
|
141
|
-
e.stopPropagation();
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
|
|
145
128
|
// 点击清除
|
|
146
129
|
clickClear () {
|
|
147
130
|
this.curValList = [];
|
|
@@ -6,6 +6,10 @@ export default {
|
|
|
6
6
|
type: Boolean,
|
|
7
7
|
default: false
|
|
8
8
|
},
|
|
9
|
+
multipleMode: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
12
|
+
},
|
|
9
13
|
|
|
10
14
|
activeValue: {
|
|
11
15
|
type: Array,
|
|
@@ -13,10 +17,6 @@ export default {
|
|
|
13
17
|
return [];
|
|
14
18
|
}
|
|
15
19
|
},
|
|
16
|
-
activeStr: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: ""
|
|
19
|
-
},
|
|
20
20
|
data: {
|
|
21
21
|
type: Array,
|
|
22
22
|
drfault () {
|
|
@@ -36,7 +36,9 @@ export default {
|
|
|
36
36
|
showMode: "default", // "flat", "default"
|
|
37
37
|
maxFlatModeSearchNum: 80,
|
|
38
38
|
|
|
39
|
+
inputStr: "",
|
|
39
40
|
selectedValue: [],
|
|
41
|
+
activeCodeValue: [],
|
|
40
42
|
|
|
41
43
|
operationMap: {
|
|
42
44
|
canCancel: {
|
|
@@ -71,12 +73,6 @@ export default {
|
|
|
71
73
|
...this.propsObj
|
|
72
74
|
};
|
|
73
75
|
},
|
|
74
|
-
filterable () {
|
|
75
|
-
return this.selfPropsObj._filterable;
|
|
76
|
-
},
|
|
77
|
-
changeOnSelect () {
|
|
78
|
-
return this.selfPropsObj._changeOnSelect;
|
|
79
|
-
},
|
|
80
76
|
saveKey () {
|
|
81
77
|
return this.selfPropsObj._saveKey;
|
|
82
78
|
},
|
|
@@ -86,12 +82,18 @@ export default {
|
|
|
86
82
|
nameKey () {
|
|
87
83
|
return this.selfPropsObj._nameKey;
|
|
88
84
|
},
|
|
89
|
-
renderFormat () {
|
|
90
|
-
return this.selfPropsObj._renderFormat;
|
|
91
|
-
},
|
|
92
85
|
resourceKey () {
|
|
93
86
|
return this.selfPropsObj._resourceKey;
|
|
94
87
|
},
|
|
88
|
+
filterable () {
|
|
89
|
+
return this.selfPropsObj._filterable;
|
|
90
|
+
},
|
|
91
|
+
changeOnSelect () {
|
|
92
|
+
return this.selfPropsObj._changeOnSelect;
|
|
93
|
+
},
|
|
94
|
+
renderFormat () {
|
|
95
|
+
return this.selfPropsObj._renderFormat;
|
|
96
|
+
},
|
|
95
97
|
|
|
96
98
|
canUseModeSwitch () {
|
|
97
99
|
return this.searchName.trim() &&
|
|
@@ -107,15 +109,8 @@ export default {
|
|
|
107
109
|
将不支持使用模式切换,因为此时平级方式不方便,不适用`;
|
|
108
110
|
},
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return this.activeStr;
|
|
113
|
-
},
|
|
114
|
-
set (str) {
|
|
115
|
-
if (!str) {
|
|
116
|
-
this.$emit("clear", []);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
112
|
+
initData () {
|
|
113
|
+
return this.data;
|
|
119
114
|
},
|
|
120
115
|
matchFunc () {
|
|
121
116
|
return node => {
|
|
@@ -141,48 +136,44 @@ export default {
|
|
|
141
136
|
};
|
|
142
137
|
});
|
|
143
138
|
},
|
|
139
|
+
// activeCodeValue () {
|
|
140
|
+
// return this.$getTreeLinealDatas(this.activeValue, this.data, this.valueKey, this.saveKey);
|
|
141
|
+
// },
|
|
144
142
|
// 选中项 -各级数据对象集合
|
|
145
143
|
selectedOptions () {
|
|
146
144
|
return this.$getTreeLinealDatas(this.selectedValue, this.showTreeData, undefined, this.saveKey);
|
|
147
145
|
},
|
|
148
146
|
// 选中项 -最后一级数据对象
|
|
149
|
-
|
|
147
|
+
selectedObj () {
|
|
150
148
|
return this.selectedOptions.slice(-1)[0];
|
|
151
149
|
},
|
|
152
150
|
// 选中项 -名字
|
|
153
151
|
selectedName () {
|
|
154
|
-
return this.
|
|
152
|
+
return this.selectedObj ? this.selectedObj[this.nameKey] : "";
|
|
155
153
|
}
|
|
156
154
|
},
|
|
157
|
-
created () {
|
|
155
|
+
created () {
|
|
156
|
+
this.cascaderPickerInit();
|
|
157
|
+
},
|
|
158
158
|
methods: {
|
|
159
|
-
|
|
159
|
+
cascaderPickerInit () {
|
|
160
|
+
this.selectedValue = this.activeValue;
|
|
161
|
+
this.activeCodeValue = this.$getTreeLinealDatas(this.activeValue, this.data, this.valueKey, this.saveKey);
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
clickInput (e) {
|
|
160
165
|
if (!this.selfPropsObj._disabled) {
|
|
161
166
|
this.showModal = true;
|
|
167
|
+
} else {
|
|
168
|
+
e.stopPropagation();
|
|
162
169
|
}
|
|
163
170
|
},
|
|
164
|
-
clickItem (node) {
|
|
165
|
-
this.oldSelectedValue = this.selectedValue;
|
|
166
|
-
this.selectedValue = node.keys;
|
|
167
|
-
// 避免重复点击
|
|
168
|
-
if (JSON.stringify(this.selectedValue) !== JSON.stringify(this.oldSelectedValue)) {
|
|
169
|
-
const obj = {
|
|
170
|
-
value: this.selectedValue,
|
|
171
|
-
selectedOptions: this.selectedOptions,
|
|
172
|
-
tabIndex: this.curTabIndex
|
|
173
|
-
};
|
|
174
|
-
this.$emit("change", obj);
|
|
175
|
-
!node.children.length && this.$emit("finish", obj);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
this.clickItemCb && this.clickItemCb(node);
|
|
179
|
-
},
|
|
180
171
|
clickCancel () {
|
|
181
172
|
this.showModal = false;
|
|
182
173
|
},
|
|
183
174
|
clickConfirm () {
|
|
184
175
|
if (this.selectedValue.length && this.selectedOptions.length) {
|
|
185
|
-
if (!this.changeOnSelect && !this.
|
|
176
|
+
if (!this.changeOnSelect && !this.selectedObj.isLeaf) {
|
|
186
177
|
this.$Message.error({
|
|
187
178
|
content: "请选择到末级数据!",
|
|
188
179
|
duration: 2
|
|
@@ -196,7 +187,24 @@ export default {
|
|
|
196
187
|
duration: 2
|
|
197
188
|
});
|
|
198
189
|
}
|
|
190
|
+
},
|
|
191
|
+
getDescription (value = []) {
|
|
192
|
+
if (value.length) {
|
|
193
|
+
this.$https({
|
|
194
|
+
url: {
|
|
195
|
+
module: "sheet",
|
|
196
|
+
name: "getResourceDescription"
|
|
197
|
+
},
|
|
198
|
+
params: {
|
|
199
|
+
resourceKey: this.resourceKey,
|
|
200
|
+
nodeKeys: value
|
|
201
|
+
},
|
|
202
|
+
callback: data => {
|
|
203
|
+
this.description = data;
|
|
204
|
+
this.selectedObj.description = data;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
199
208
|
}
|
|
200
|
-
|
|
201
209
|
}
|
|
202
210
|
};
|