bri-components 1.2.49 → 1.2.51
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/BriControlInput.vue +13 -9
- package/src/components/controls/base/DshCascader/DshCascader.vue +40 -23
- package/src/components/controls/base/DshCascader/InfoCascader.vue +7 -15
- package/src/components/controls/base/DshDate/DshDate.vue +146 -0
- package/src/components/controls/base/{DshDaterange.vue → DshDate/DshDaterange.vue} +74 -64
- package/src/components/controls/base/DshEditor.vue +1 -1
- package/src/components/controls/base/{BriInputs.vue → DshInput/BriInputs.vue} +1 -1
- package/src/components/controls/base/{DshInput.vue → DshInput/DshInput.vue} +21 -4
- package/src/components/controls/base/DshNumber/DshNumber.vue +33 -2
- package/src/components/controls/base/{DshNumberange.vue → DshNumber/DshNumberange.vue} +37 -2
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +280 -0
- package/src/components/controls/base/DshSelect/DshSelect.vue +319 -0
- package/src/components/controls/base/DshSelect/selectMixin.js +239 -0
- package/src/components/controls/base/DshSwitch/DshSwitch.vue +79 -0
- package/src/components/controls/base/DshSwitch/switchMixin.js +73 -0
- package/src/components/controls/controlMap.js +8 -11
- package/src/components/controls/controlMixin.js +38 -6
- package/src/components/controls/senior/BriLabels.vue +1 -1
- package/src/components/controls/senior/selectDepartments.vue +9 -13
- package/src/components/controls/senior/selectUsers/selectUsers.vue +23 -21
- package/src/components/controls/special/DshBack.vue +1 -1
- package/src/components/controls/special/DshUndeveloped.vue +1 -1
- package/src/components/form/DshAdvSearch.vue +155 -3
- package/src/components/form/DshDefaultSearch.vue +84 -40
- package/src/components/form/DshForm.vue +24 -0
- package/src/components/form/searchMixin.js +5 -18
- package/src/components/other/BriGantt.vue +2 -2
- package/src/components/unit/DshFormUnit.vue +111 -2
- package/src/components/unit/DshListUnit.vue +6 -0
- package/src/index.js +10 -10
- package/src/styles/components/controls/base/DshInput.less +0 -16
- package/src/styles/components/index.less +0 -14
- package/src/styles/components/other/BriGantt.less +1 -12
- package/src/styles/index.less +5 -3
- package/src/styles/reset-iview-controls.less +104 -0
- package/src/abolish/BriTransfer.less +0 -65
- package/src/abolish/BriTransfer.vue +0 -71
- package/src/abolish/BriTree.less +0 -57
- package/src/abolish/DshCascaders.less +0 -11
- package/src/abolish/DshCascaders.vue +0 -151
- package/src/abolish/DshCrumbs.less +0 -0
- package/src/abolish/DshCrumbs.vue +0 -62
- package/src/abolish/DshCrumbsItem.vue +0 -109
- package/src/abolish/DshEditPanel.less +0 -70
- package/src/abolish/DshEditPanel.vue +0 -152
- package/src/abolish/DshFileShow.less +0 -61
- package/src/abolish/DshFileShow.vue +0 -0
- package/src/abolish/DshFlatTable.less +0 -93
- package/src/abolish/DshFlatTable.vue +0 -605
- package/src/abolish/DshMenu.less +0 -37
- package/src/abolish/DshMenu.vue +0 -133
- package/src/abolish/DshTexts.less +0 -13
- package/src/abolish/DshTexts.vue +0 -89
- package/src/components/controls/base/DshCheckbox.vue +0 -213
- package/src/components/controls/base/DshDate.vue +0 -122
- package/src/components/controls/base/DshSelect.vue +0 -242
- package/src/components/controls/base/DshSwitch.vue +0 -70
- package/src/components/controls/base/selectMixin.js +0 -110
- package/src/styles/components/controls/base/DshCheckbox.less +0 -115
- package/src/styles/components/controls/base/DshDate.less +0 -15
- package/src/styles/components/controls/base/DshDaterange.less +0 -49
- package/src/styles/components/controls/base/DshNumber.less +0 -55
- package/src/styles/components/controls/base/DshNumberange.less +0 -29
- package/src/styles/components/controls/base/DshSelect.less +0 -190
- package/src/styles/components/form/DshAdvSearch.less +0 -149
- package/src/styles/components/form/DshDefaultSearch.less +0 -82
- package/src/styles/components/form/DshForm.less +0 -18
- package/src/styles/components/unit/DshFormUnit.less +0 -105
- package/src/styles/components/unit/DshListUnit.less +0 -3
- /package/src/{abolish/DshCrumbItem.less → styles/reset-iview-other.less} +0 -0
- /package/src/styles/{reset-iview.less → reset-iview-variables.less} +0 -0
package/src/index.js
CHANGED
|
@@ -25,10 +25,10 @@ import DshFormUnit from "./components/unit/DshFormUnit.vue";
|
|
|
25
25
|
import DshListUnit from "./components/unit/DshListUnit.vue";
|
|
26
26
|
// controls
|
|
27
27
|
import BriControlInput from "./components/controls/BriControlInput.vue";
|
|
28
|
-
import DshInput from "./components/controls/base/DshInput.vue";
|
|
28
|
+
import DshInput from "./components/controls/base/DshInput/DshInput.vue";
|
|
29
29
|
import DshNumber from "./components/controls/base/DshNumber/DshNumber.vue";
|
|
30
|
-
import DshSelect from "./components/controls/base/DshSelect.vue";
|
|
31
|
-
import DshCheckbox from "./components/controls/base/DshCheckbox.vue";
|
|
30
|
+
import DshSelect from "./components/controls/base/DshSelect/DshSelect.vue";
|
|
31
|
+
import DshCheckbox from "./components/controls/base/DshSelect/DshCheckbox.vue";
|
|
32
32
|
import DshCascader from "./components/controls/base/DshCascader/DshCascader.vue";
|
|
33
33
|
|
|
34
34
|
// other
|
|
@@ -65,11 +65,11 @@ import BriTree from "./components/list/BriTree.vue";
|
|
|
65
65
|
import BriTreeItem from "./components/list/BriTreeItem.vue";
|
|
66
66
|
|
|
67
67
|
// controls
|
|
68
|
-
import BriInputs from "./components/controls/base/BriInputs.vue";
|
|
69
|
-
import DshNumberange from "./components/controls/base/DshNumberange.vue";
|
|
70
|
-
import DshDate from "./components/controls/base/DshDate.vue";
|
|
71
|
-
import DshDaterange from "./components/controls/base/DshDaterange.vue";
|
|
72
|
-
import DshSwitch from "./components/controls/base/DshSwitch.vue";
|
|
68
|
+
// import BriInputs from "./components/controls/base/DshInput/BriInputs.vue";
|
|
69
|
+
// import DshNumberange from "./components/controls/base/DshNumber/DshNumberange.vue";
|
|
70
|
+
import DshDate from "./components/controls/base/DshDate/DshDate.vue";
|
|
71
|
+
import DshDaterange from "./components/controls/base/DshDate/DshDaterange.vue";
|
|
72
|
+
import DshSwitch from "./components/controls/base/DshSwitch/DshSwitch.vue";
|
|
73
73
|
import BriUpload from "./components/controls/base/BriUpload/BriUpload.vue";
|
|
74
74
|
import BriUploadImage from "./components/controls/base/BriUpload/BriUploadImage.vue";
|
|
75
75
|
import DshCoordinates from "./components/controls/base/DshCoordinates.vue";
|
|
@@ -232,8 +232,8 @@ export {
|
|
|
232
232
|
BriTree,
|
|
233
233
|
BriTreeItem,
|
|
234
234
|
|
|
235
|
-
BriInputs,
|
|
236
|
-
DshNumberange,
|
|
235
|
+
// BriInputs,
|
|
236
|
+
// DshNumberange,
|
|
237
237
|
DshDate,
|
|
238
238
|
DshDaterange,
|
|
239
239
|
DshSwitch,
|
|
@@ -10,20 +10,4 @@
|
|
|
10
10
|
min-height: 32px;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.ivu-input {
|
|
16
|
-
.bri-control-edit();
|
|
17
|
-
cursor: text;
|
|
18
|
-
|
|
19
|
-
&[disabled] {
|
|
20
|
-
.bri-control-disabled();
|
|
21
|
-
&:hover {
|
|
22
|
-
border-color: @border-disabled;
|
|
23
|
-
}
|
|
24
|
-
&::-webkit-input-placeholder {
|
|
25
|
-
color: @placeholder-disabled-color;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
13
|
}
|
|
@@ -15,22 +15,8 @@
|
|
|
15
15
|
@import "./list/BriTree.less";
|
|
16
16
|
@import "./list/BriTreeItem.less";
|
|
17
17
|
|
|
18
|
-
// form
|
|
19
|
-
@import "./form/DshForm.less";
|
|
20
|
-
@import "./form/DshAdvSearch.less";
|
|
21
|
-
@import "./form/DshDefaultSearch.less";
|
|
22
|
-
// unit
|
|
23
|
-
@import "./unit/DshFormUnit.less";
|
|
24
|
-
@import "./unit/DshListUnit.less";
|
|
25
|
-
|
|
26
18
|
@import "./controls/base/DshInput.less";
|
|
27
19
|
@import "./controls/base/BriInputs.less";
|
|
28
|
-
@import "./controls/base/DshNumber.less";
|
|
29
|
-
@import "./controls/base/DshNumberange.less";
|
|
30
|
-
@import "./controls/base/DshSelect.less";
|
|
31
|
-
@import "./controls/base/DshCheckbox.less";
|
|
32
|
-
@import "./controls/base/DshDate.less";
|
|
33
|
-
@import "./controls/base/DshDaterange.less";
|
|
34
20
|
@import "./controls/base/DshCascader/index.less";
|
|
35
21
|
@import "./controls/base/BriUpload/index.less";
|
|
36
22
|
@import "./controls/base/DshCoordinates.less";
|
|
@@ -258,21 +258,10 @@
|
|
|
258
258
|
height: 0px;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
+
|
|
261
262
|
// table 列表映射
|
|
262
263
|
&-tabledata {
|
|
263
264
|
overflow-y: auto;
|
|
264
265
|
border-right: none;
|
|
265
266
|
}
|
|
266
|
-
// 滚动条设置
|
|
267
|
-
&-scrollbar {
|
|
268
|
-
width: 100%;
|
|
269
|
-
&-main {
|
|
270
|
-
float: right;
|
|
271
|
-
overflow: auto;
|
|
272
|
-
div {
|
|
273
|
-
height: 2px;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
}
|
|
278
267
|
}
|
package/src/styles/index.less
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@import "~vue-easytable/packages/theme-default/index.less"; // 引入官方提供的less样式入口文件
|
|
2
2
|
@import "~view-design/src/styles/index.less"; // 第三方组件库样式
|
|
3
|
+
|
|
3
4
|
@import "./reset-easytable.less"; // 重置easytable样式
|
|
4
|
-
@import "./reset-iview.less"; // 重置iview
|
|
5
|
+
@import "./reset-iview-variables.less"; // 重置iview样式-变量
|
|
6
|
+
@import "./reset-iview-controls.less"; // 重置iview样式-控件相关
|
|
7
|
+
@import "./reset-iview-other.less"; // 重置iview样式-其它
|
|
5
8
|
@import "./reset.less"; // 重置样式
|
|
6
|
-
|
|
7
9
|
// @import "./global/global.less"; // 全局公共css
|
|
8
|
-
@import "./iconfont/iconfont.css"; // 字体图标样式
|
|
9
10
|
|
|
11
|
+
@import "./iconfont/iconfont.css"; // 字体图标样式
|
|
10
12
|
@import "./components/index.less"; // 组件样式
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
.ivu-input {
|
|
2
|
+
.bri-control-edit();
|
|
3
|
+
cursor: text;
|
|
4
|
+
|
|
5
|
+
&[disabled] {
|
|
6
|
+
.bri-control-disabled();
|
|
7
|
+
&:hover {
|
|
8
|
+
border-color: @border-disabled;
|
|
9
|
+
}
|
|
10
|
+
&::-webkit-input-placeholder {
|
|
11
|
+
color: @placeholder-disabled-color;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ivu-input-number {
|
|
18
|
+
width: 100%;
|
|
19
|
+
|
|
20
|
+
.ivu-input-number-input {
|
|
21
|
+
color: @textColor;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&-disabled {
|
|
25
|
+
.ivu-input-number-input {
|
|
26
|
+
opacity: 1;
|
|
27
|
+
background: @inputBg-disabled;
|
|
28
|
+
color: @textColor;
|
|
29
|
+
&::-webkit-input-placeholder {
|
|
30
|
+
color: @placeholder-disabled-color;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-handler {
|
|
36
|
+
&-wrap {
|
|
37
|
+
border-left: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-down {
|
|
41
|
+
border: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-down-inner,
|
|
45
|
+
&-up-inner {
|
|
46
|
+
color: @contentColor;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
background-color: @hoverBg;
|
|
51
|
+
|
|
52
|
+
.ivu-input-number-handler-down-inner,
|
|
53
|
+
.ivu-input-number-handler-up-inner {
|
|
54
|
+
color: @textColor;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ivu-select {
|
|
61
|
+
.ivu-select-selection {
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&-disabled {
|
|
66
|
+
.ivu-select-selection {
|
|
67
|
+
.bri-control-disabled();
|
|
68
|
+
|
|
69
|
+
&:hover {
|
|
70
|
+
border-color: @border-disabled;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ivu-select-input[disabled] {
|
|
75
|
+
color: @textColor;
|
|
76
|
+
-webkit-text-fill-color: @placeholder-disabled-color;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-item {
|
|
81
|
+
margin: 4px 8px;
|
|
82
|
+
border-radius: @borderRadius;
|
|
83
|
+
|
|
84
|
+
&:hover {
|
|
85
|
+
background: @bgColor;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&-selected {
|
|
89
|
+
background-color: @theme-focus;
|
|
90
|
+
color: @themeColor;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&-disabled {
|
|
94
|
+
.ivu-select-selection {
|
|
95
|
+
.bri-control-disabled();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&-input[disabled] {
|
|
100
|
+
color: @textColor-disabled;
|
|
101
|
+
-webkit-text-fill-color: @textColor-disabled;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
.BriTransfer {
|
|
2
|
-
.ivu-transfer {
|
|
3
|
-
&-list {
|
|
4
|
-
width: 200px;
|
|
5
|
-
height: 346px;
|
|
6
|
-
|
|
7
|
-
&-header {
|
|
8
|
-
background-color: #fff;
|
|
9
|
-
border-radius: 4px 4px 0 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&-body {
|
|
13
|
-
border-radius: 0 0 4px 4px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&-content-not-found {
|
|
17
|
-
margin-top: 138px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&-content-item {
|
|
21
|
-
display: flex;
|
|
22
|
-
margin: 4px 8px;
|
|
23
|
-
padding: 5px 12px;
|
|
24
|
-
border-radius: 4px;
|
|
25
|
-
|
|
26
|
-
&:hover {
|
|
27
|
-
background-color: #E8F3FD;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&:has(.ivu-checkbox-wrapper-checked) {
|
|
31
|
-
background-color: @theme-focus ;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
>span {
|
|
35
|
-
word-break: normal;
|
|
36
|
-
display: block;
|
|
37
|
-
white-space: pre-wrap;
|
|
38
|
-
word-wrap: break-word;
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&-operation {
|
|
45
|
-
.ivu-btn-primary {
|
|
46
|
-
width: 24px;
|
|
47
|
-
height: 24px;
|
|
48
|
-
border-radius: 4px;
|
|
49
|
-
display: flex;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
align-items: center;
|
|
52
|
-
|
|
53
|
-
.ivu-icon {
|
|
54
|
-
font-size: 16px;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ivu-btn-primary[disabled] {
|
|
59
|
-
border: 1px solid #CCCCCC;
|
|
60
|
-
background: @borderColor;
|
|
61
|
-
color: @textColor-disabled;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="BriTransfer">
|
|
3
|
-
<Transfer
|
|
4
|
-
:data="selfData"
|
|
5
|
-
:target-keys="targetKeys"
|
|
6
|
-
:filterable="filterable"
|
|
7
|
-
:filter-method="filterMethod"
|
|
8
|
-
:titles="titles"
|
|
9
|
-
not-found-text="暂无内容"
|
|
10
|
-
@on-change="handleChange"
|
|
11
|
-
></Transfer>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
name: "BriTransfer",
|
|
18
|
-
props: {
|
|
19
|
-
data: {
|
|
20
|
-
type: Array,
|
|
21
|
-
default: () => {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
value: {
|
|
26
|
-
type: Array,
|
|
27
|
-
default: () => {
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
filterMethod: {
|
|
32
|
-
type: Function,
|
|
33
|
-
default: () => {
|
|
34
|
-
return {};
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
titles: {
|
|
38
|
-
type: Array,
|
|
39
|
-
default: () => {
|
|
40
|
-
return ["源列表", "目的列表"];
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
filterable: Boolean
|
|
44
|
-
},
|
|
45
|
-
data () {
|
|
46
|
-
return {
|
|
47
|
-
targetKeys: []
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
computed: {
|
|
51
|
-
selfData () {
|
|
52
|
-
return this.data.map(item => {
|
|
53
|
-
return {
|
|
54
|
-
key: item._key,
|
|
55
|
-
label: item._name || item.name || item.realname
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
created () {
|
|
61
|
-
this.targetKeys = this.value;
|
|
62
|
-
},
|
|
63
|
-
methods: {
|
|
64
|
-
handleChange (newTargetKeys) {
|
|
65
|
-
this.targetKeys = newTargetKeys;
|
|
66
|
-
this.$emit("input", this.targetKeys);
|
|
67
|
-
this.$emit("change", this.targetKeys);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
</script>
|
package/src/abolish/BriTree.less
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.BriTree {
|
|
3
|
-
border: 1px solid @btnCancelBg;
|
|
4
|
-
border-radius: @borderRadius;
|
|
5
|
-
width: 336px;
|
|
6
|
-
overflow: auto;
|
|
7
|
-
padding: 8px;
|
|
8
|
-
user-select: none;
|
|
9
|
-
max-width: 100%;
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
.ivu-tree {
|
|
13
|
-
.ivu-icon-ios-arrow-forward {
|
|
14
|
-
display: inline-block;
|
|
15
|
-
width: 16px;
|
|
16
|
-
height: 16px;
|
|
17
|
-
border-radius: @borderRadius;
|
|
18
|
-
&:before {
|
|
19
|
-
content: "\F341";
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
.dsh-flex-row-center-center();
|
|
23
|
-
}
|
|
24
|
-
&:hover {
|
|
25
|
-
background-color: @btnCancelBgDisabled;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
&-arrow {
|
|
29
|
-
width: auto;
|
|
30
|
-
color: @placeholderColor;
|
|
31
|
-
margin-top: 4px;
|
|
32
|
-
&-open {
|
|
33
|
-
color: @themeColor;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
&-title {
|
|
37
|
-
color: @textColor;
|
|
38
|
-
padding: 3px 8px 4px;
|
|
39
|
-
border-radius: @borderRadius;
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
width: calc(100% - 20px);
|
|
42
|
-
&:hover {
|
|
43
|
-
background-color: @bgColor;
|
|
44
|
-
}
|
|
45
|
-
&-selected {
|
|
46
|
-
color: @themeColor;
|
|
47
|
-
background-color: @theme-focus;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
.ivu-checkbox-wrapper+.ivu-tree-title {
|
|
51
|
-
margin-left: -30px;
|
|
52
|
-
padding-left: 30px;
|
|
53
|
-
}
|
|
54
|
-
.ivu-load-loop {
|
|
55
|
-
color: @themeColor;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="DshCascaders">
|
|
3
|
-
<Cascader
|
|
4
|
-
class="DshCascaders-control"
|
|
5
|
-
v-model="cascaderVal"
|
|
6
|
-
:placeholder="selfPropsObj._placeholder"
|
|
7
|
-
:data="renderCascaderData"
|
|
8
|
-
:load-data="loadData"
|
|
9
|
-
:disabled="!finalCanEdit"
|
|
10
|
-
:change-on-select="selfPropsObj._changeOnSelect"
|
|
11
|
-
:filterable="true"
|
|
12
|
-
:clearable="true"
|
|
13
|
-
:transfer="true"
|
|
14
|
-
></Cascader>
|
|
15
|
-
<dsh-buttons
|
|
16
|
-
class="DshCascaders-create"
|
|
17
|
-
:list="$getOperationList(['createTag'])"
|
|
18
|
-
@click="$dispatchEvent($event)"
|
|
19
|
-
></dsh-buttons>
|
|
20
|
-
|
|
21
|
-
<!-- 标签列表 -->
|
|
22
|
-
<dsh-tags
|
|
23
|
-
class="dsh-margin-top5"
|
|
24
|
-
:list="tags"
|
|
25
|
-
:propsObj="{
|
|
26
|
-
closable: true
|
|
27
|
-
}"
|
|
28
|
-
@delete="$dispatchEvent(operationMap.deleteTag, arguments)"
|
|
29
|
-
></dsh-tags>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script>
|
|
34
|
-
import { regionData } from "bri-datas";
|
|
35
|
-
import controlMixin from "../controlMixin.js";
|
|
36
|
-
|
|
37
|
-
const loop = function (data = [], level, parentCode, filterVals = []) {
|
|
38
|
-
if (data && filterVals.length) {
|
|
39
|
-
data = data.filter(item => filterVals.includes(item._key));
|
|
40
|
-
}
|
|
41
|
-
return data
|
|
42
|
-
? data.reduce((arr, item) => {
|
|
43
|
-
const newItem = {
|
|
44
|
-
...item,
|
|
45
|
-
value: item._key,
|
|
46
|
-
label: item.name,
|
|
47
|
-
codeArr: [ ...(parentCode || []), item._key ]
|
|
48
|
-
};
|
|
49
|
-
if (!level || level > item.level) {
|
|
50
|
-
newItem.children = loop(item.children, level, newItem.codeArr);
|
|
51
|
-
newItem.children.length && (newItem.loading = false); // 此代码为了所请求的级出现继续加载的箭头图标
|
|
52
|
-
} else {
|
|
53
|
-
newItem.children = [];
|
|
54
|
-
}
|
|
55
|
-
arr.push(newItem);
|
|
56
|
-
|
|
57
|
-
return arr;
|
|
58
|
-
}, [])
|
|
59
|
-
: [];
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default {
|
|
63
|
-
name: "DshCascaders",
|
|
64
|
-
mixins: [
|
|
65
|
-
controlMixin
|
|
66
|
-
],
|
|
67
|
-
props: {},
|
|
68
|
-
data () {
|
|
69
|
-
return {
|
|
70
|
-
cascaderVal: [],
|
|
71
|
-
|
|
72
|
-
operationMap: {
|
|
73
|
-
createTag: {
|
|
74
|
-
name: "添加",
|
|
75
|
-
type: "createTag",
|
|
76
|
-
size: "default",
|
|
77
|
-
event: "createTag"
|
|
78
|
-
},
|
|
79
|
-
deleteTag: {
|
|
80
|
-
name: "删除",
|
|
81
|
-
type: "deleteTag",
|
|
82
|
-
event: "deleteTag"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
computed: {
|
|
88
|
-
selfPropsObj () {
|
|
89
|
-
return {
|
|
90
|
-
...this.propsObj,
|
|
91
|
-
...this.commonDealPropsObj
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
cascaderData: {
|
|
96
|
-
get () {
|
|
97
|
-
return loop(
|
|
98
|
-
this.propsObj._subType === "region" ? regionData : this.propsObj._data,
|
|
99
|
-
this.propsObj._cascaderLevel,
|
|
100
|
-
undefined,
|
|
101
|
-
this.propsObj._cascaderFilterVals
|
|
102
|
-
);
|
|
103
|
-
},
|
|
104
|
-
set () {}
|
|
105
|
-
},
|
|
106
|
-
renderCascaderData () {
|
|
107
|
-
return this.cascaderData.map(item => {
|
|
108
|
-
return {
|
|
109
|
-
...item,
|
|
110
|
-
children: []
|
|
111
|
-
};
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
tags () {
|
|
115
|
-
return this.value[this.propsObj._key].map(item => this.$getTreeLinealDatas(item, this.cascaderData, "name").join("/"));
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
created () {},
|
|
119
|
-
methods: {
|
|
120
|
-
// 动态加载数据
|
|
121
|
-
loadData (treeItem, cb) {
|
|
122
|
-
let list = this.$getTreeLinealDatas(treeItem.codeArr, this.cascaderData);
|
|
123
|
-
treeItem.children = list[list.length - 1].children.map(item => ({ ...item, children: [] }));
|
|
124
|
-
|
|
125
|
-
cb();
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
// 添加
|
|
129
|
-
createTag (operationItem) {
|
|
130
|
-
if (this.cascaderVal.length) {
|
|
131
|
-
if (this.value[this.propsObj._key].some(item => JSON.stringify(item) == JSON.stringify(this.cascaderVal))) {
|
|
132
|
-
this.$Message.error({
|
|
133
|
-
content: `"${this.$getTreeLinealDatas(this.cascaderVal, this.cascaderData, "name").join("/")}"已选择,请勿重复选择!`,
|
|
134
|
-
duration: 5
|
|
135
|
-
});
|
|
136
|
-
} else {
|
|
137
|
-
this.value[this.propsObj._key].push([...this.cascaderVal]);
|
|
138
|
-
this.change();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
this.cascaderVal = [];
|
|
143
|
-
},
|
|
144
|
-
// 删除
|
|
145
|
-
deleteTag (operationItem, params) {
|
|
146
|
-
this.value[this.propsObj._key].splice(params[1], 1);
|
|
147
|
-
this.change();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
</script>
|
|
File without changes
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="classes">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
// const prefixCls = "ivu-breadcrumb";
|
|
9
|
-
const prefixCls = "dsh-crumb";
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
name: "DshCrumb",
|
|
13
|
-
props: {
|
|
14
|
-
separator: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: "/"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
computed: {
|
|
20
|
-
classes () {
|
|
21
|
-
return `${prefixCls}`;
|
|
22
|
-
},
|
|
23
|
-
linkUrl () {
|
|
24
|
-
const type = typeof this.to;
|
|
25
|
-
if (type !== "string") {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
if (this.to.includes("//")) {
|
|
29
|
-
/* Absolute URL, we do not need to route this */
|
|
30
|
-
return this.to;
|
|
31
|
-
}
|
|
32
|
-
const router = this.$router;
|
|
33
|
-
if (router) {
|
|
34
|
-
const current = this.$route;
|
|
35
|
-
const route = router.resolve(this.to, current, this.append);
|
|
36
|
-
return route ? route.href : this.to;
|
|
37
|
-
}
|
|
38
|
-
return this.to;
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
mounted () {
|
|
42
|
-
this.updateChildren();
|
|
43
|
-
},
|
|
44
|
-
updated () {
|
|
45
|
-
this.$nextTick(() => {
|
|
46
|
-
this.updateChildren();
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
methods: {
|
|
50
|
-
updateChildren () {
|
|
51
|
-
this.$children.forEach((child) => {
|
|
52
|
-
child.separator = this.separator;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
watch: {
|
|
57
|
-
separator () {
|
|
58
|
-
this.updateChildren();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
</script>
|