bri-components 1.5.22 → 1.6.0
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 +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 +585 -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 +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 +285 -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,125 +1,125 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="BriCode">
|
|
3
|
-
<codemirror
|
|
4
|
-
style="height:100%"
|
|
5
|
-
v-model="computedVal"
|
|
6
|
-
:options="option"
|
|
7
|
-
@ready="ready"
|
|
8
|
-
@input="input"
|
|
9
|
-
@changes="changes"
|
|
10
|
-
></codemirror>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import { JSHINT } from "jshint";
|
|
16
|
-
|
|
17
|
-
import { codemirror } from "vue-codemirror";
|
|
18
|
-
// 这里引入的模式的js,根据设置的mode引入
|
|
19
|
-
import "codemirror/mode/javascript/javascript.js";
|
|
20
|
-
// 光标行背景高亮,配置里面也需要styleActiveLine设置为true
|
|
21
|
-
import "codemirror/addon/selection/active-line.js";
|
|
22
|
-
import "codemirror/addon/edit/matchbrackets.js";
|
|
23
|
-
|
|
24
|
-
// JavaScript代码提示功能需要引入三个依赖
|
|
25
|
-
import "codemirror/addon/hint/javascript-hint.js";
|
|
26
|
-
import "codemirror/addon/hint/show-hint.js";
|
|
27
|
-
|
|
28
|
-
// 折叠
|
|
29
|
-
import "codemirror/addon/fold/foldcode.js";
|
|
30
|
-
import "codemirror/addon/fold/foldgutter.js";
|
|
31
|
-
import "codemirror/addon/fold/brace-fold.js";
|
|
32
|
-
import "codemirror/addon/fold/comment-fold.js";
|
|
33
|
-
|
|
34
|
-
// 下面这几个引入的主要是验证提示类的,配置里的lint需要设置true,gutters: ['CodeMirror-lint-markers']
|
|
35
|
-
// 如果需要验证 json 的话
|
|
36
|
-
import "codemirror/addon/lint/lint.js";
|
|
37
|
-
import "codemirror/addon/lint/javascript-lint.js";
|
|
38
|
-
import "codemirror/addon/display/autorefresh"; // 及时自动更新,配置里面也需要设置autoRefresh为true
|
|
39
|
-
|
|
40
|
-
export default {
|
|
41
|
-
name: "BriCode",
|
|
42
|
-
components: {
|
|
43
|
-
codemirror
|
|
44
|
-
},
|
|
45
|
-
props: {
|
|
46
|
-
value: String,
|
|
47
|
-
option: {
|
|
48
|
-
type: Object,
|
|
49
|
-
default: function () {
|
|
50
|
-
return {
|
|
51
|
-
mode: "javascript",
|
|
52
|
-
theme: "cobalt",
|
|
53
|
-
dragDrop: true, // 拖拽
|
|
54
|
-
lineWrapping: true, // 换行
|
|
55
|
-
autofocus: true,
|
|
56
|
-
lineNumbers: true, // 行号
|
|
57
|
-
foldGutter: true, // 代码折叠
|
|
58
|
-
line: true,
|
|
59
|
-
matchBrackets: true, // 括号匹配
|
|
60
|
-
extraKeys: { Ctrl: "autocomplete" },
|
|
61
|
-
showCursorWhenSelecting: true, // 在选择时是否显示光标,默认为false
|
|
62
|
-
lineWiseCopyCut: true, // 启用时,如果在复制或剪切时没有选择文本,那么就会自动操作光标所在的整行]
|
|
63
|
-
autorefresh: true, // 及时自动更新
|
|
64
|
-
lint: true, // json检查
|
|
65
|
-
hint: true,
|
|
66
|
-
styleActiveLine: true,
|
|
67
|
-
gutters: [
|
|
68
|
-
"CodeMirror-linenumbers", // 显示行号
|
|
69
|
-
"CodeMirror-foldgutter", // 代码折叠
|
|
70
|
-
"CodeMirror-lint-markers" // json检查
|
|
71
|
-
]
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
model: {
|
|
77
|
-
prop: "value",
|
|
78
|
-
event: "change"
|
|
79
|
-
},
|
|
80
|
-
data () {
|
|
81
|
-
return {};
|
|
82
|
-
},
|
|
83
|
-
computed: {
|
|
84
|
-
computedVal: {
|
|
85
|
-
get () {
|
|
86
|
-
return this.value;
|
|
87
|
-
},
|
|
88
|
-
set (val) {
|
|
89
|
-
this.handleChange(val);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
created () {
|
|
94
|
-
window.JSHINT = JSHINT;
|
|
95
|
-
},
|
|
96
|
-
methods: {
|
|
97
|
-
ready (cm) {
|
|
98
|
-
cm.setSize("100%", "100%");
|
|
99
|
-
this.$emit("ready", cm);
|
|
100
|
-
},
|
|
101
|
-
input (cm) {
|
|
102
|
-
this.$emit("input", cm);
|
|
103
|
-
},
|
|
104
|
-
changes (cm, value) {
|
|
105
|
-
this.$emit("changes", cm, value);
|
|
106
|
-
},
|
|
107
|
-
handleChange (val) {
|
|
108
|
-
// 0 no, 1 warning 2 error
|
|
109
|
-
JSHINT(val);
|
|
110
|
-
let errors = (JSHINT.data().errors || [])
|
|
111
|
-
.map(error => error.code ? (error.code.startsWith("W") ? 1 : 2) : 2);
|
|
112
|
-
|
|
113
|
-
this.$emit("jshint", errors.some(errorNum => errorNum === 2), errors);
|
|
114
|
-
this.$emit("change", val);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
</script>
|
|
119
|
-
|
|
120
|
-
<style lang="less" scoped>
|
|
121
|
-
.BriCode {
|
|
122
|
-
width: 100%;
|
|
123
|
-
height: 100%;
|
|
124
|
-
}
|
|
125
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="BriCode">
|
|
3
|
+
<codemirror
|
|
4
|
+
style="height:100%"
|
|
5
|
+
v-model="computedVal"
|
|
6
|
+
:options="option"
|
|
7
|
+
@ready="ready"
|
|
8
|
+
@input="input"
|
|
9
|
+
@changes="changes"
|
|
10
|
+
></codemirror>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import { JSHINT } from "jshint";
|
|
16
|
+
|
|
17
|
+
import { codemirror } from "vue-codemirror";
|
|
18
|
+
// 这里引入的模式的js,根据设置的mode引入
|
|
19
|
+
import "codemirror/mode/javascript/javascript.js";
|
|
20
|
+
// 光标行背景高亮,配置里面也需要styleActiveLine设置为true
|
|
21
|
+
import "codemirror/addon/selection/active-line.js";
|
|
22
|
+
import "codemirror/addon/edit/matchbrackets.js";
|
|
23
|
+
|
|
24
|
+
// JavaScript代码提示功能需要引入三个依赖
|
|
25
|
+
import "codemirror/addon/hint/javascript-hint.js";
|
|
26
|
+
import "codemirror/addon/hint/show-hint.js";
|
|
27
|
+
|
|
28
|
+
// 折叠
|
|
29
|
+
import "codemirror/addon/fold/foldcode.js";
|
|
30
|
+
import "codemirror/addon/fold/foldgutter.js";
|
|
31
|
+
import "codemirror/addon/fold/brace-fold.js";
|
|
32
|
+
import "codemirror/addon/fold/comment-fold.js";
|
|
33
|
+
|
|
34
|
+
// 下面这几个引入的主要是验证提示类的,配置里的lint需要设置true,gutters: ['CodeMirror-lint-markers']
|
|
35
|
+
// 如果需要验证 json 的话
|
|
36
|
+
import "codemirror/addon/lint/lint.js";
|
|
37
|
+
import "codemirror/addon/lint/javascript-lint.js";
|
|
38
|
+
import "codemirror/addon/display/autorefresh"; // 及时自动更新,配置里面也需要设置autoRefresh为true
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
name: "BriCode",
|
|
42
|
+
components: {
|
|
43
|
+
codemirror
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
value: String,
|
|
47
|
+
option: {
|
|
48
|
+
type: Object,
|
|
49
|
+
default: function () {
|
|
50
|
+
return {
|
|
51
|
+
mode: "javascript",
|
|
52
|
+
theme: "cobalt",
|
|
53
|
+
dragDrop: true, // 拖拽
|
|
54
|
+
lineWrapping: true, // 换行
|
|
55
|
+
autofocus: true,
|
|
56
|
+
lineNumbers: true, // 行号
|
|
57
|
+
foldGutter: true, // 代码折叠
|
|
58
|
+
line: true,
|
|
59
|
+
matchBrackets: true, // 括号匹配
|
|
60
|
+
extraKeys: { Ctrl: "autocomplete" },
|
|
61
|
+
showCursorWhenSelecting: true, // 在选择时是否显示光标,默认为false
|
|
62
|
+
lineWiseCopyCut: true, // 启用时,如果在复制或剪切时没有选择文本,那么就会自动操作光标所在的整行]
|
|
63
|
+
autorefresh: true, // 及时自动更新
|
|
64
|
+
lint: true, // json检查
|
|
65
|
+
hint: true,
|
|
66
|
+
styleActiveLine: true,
|
|
67
|
+
gutters: [
|
|
68
|
+
"CodeMirror-linenumbers", // 显示行号
|
|
69
|
+
"CodeMirror-foldgutter", // 代码折叠
|
|
70
|
+
"CodeMirror-lint-markers" // json检查
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
model: {
|
|
77
|
+
prop: "value",
|
|
78
|
+
event: "change"
|
|
79
|
+
},
|
|
80
|
+
data () {
|
|
81
|
+
return {};
|
|
82
|
+
},
|
|
83
|
+
computed: {
|
|
84
|
+
computedVal: {
|
|
85
|
+
get () {
|
|
86
|
+
return this.value;
|
|
87
|
+
},
|
|
88
|
+
set (val) {
|
|
89
|
+
this.handleChange(val);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
created () {
|
|
94
|
+
window.JSHINT = JSHINT;
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
ready (cm) {
|
|
98
|
+
cm.setSize("100%", "100%");
|
|
99
|
+
this.$emit("ready", cm);
|
|
100
|
+
},
|
|
101
|
+
input (cm) {
|
|
102
|
+
this.$emit("input", cm);
|
|
103
|
+
},
|
|
104
|
+
changes (cm, value) {
|
|
105
|
+
this.$emit("changes", cm, value);
|
|
106
|
+
},
|
|
107
|
+
handleChange (val) {
|
|
108
|
+
// 0 no, 1 warning 2 error
|
|
109
|
+
JSHINT(val);
|
|
110
|
+
let errors = (JSHINT.data().errors || [])
|
|
111
|
+
.map(error => error.code ? (error.code.startsWith("W") ? 1 : 2) : 2);
|
|
112
|
+
|
|
113
|
+
this.$emit("jshint", errors.some(errorNum => errorNum === 2), errors);
|
|
114
|
+
this.$emit("change", val);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style lang="less" scoped>
|
|
121
|
+
.BriCode {
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="BriCollapseTree">
|
|
3
|
-
<ul>
|
|
4
|
-
<li
|
|
5
|
-
v-for="listItem in list"
|
|
6
|
-
:key="listItem._key"
|
|
7
|
-
>
|
|
8
|
-
<!-- 有children -->
|
|
9
|
-
<Collapse
|
|
10
|
-
v-if="listItem.children && listItem.children.length"
|
|
11
|
-
class="BriCollapseTree-collapse"
|
|
12
|
-
:accordion="listItem._accordion"
|
|
13
|
-
:simple="listItem._simple === false ? false : true"
|
|
14
|
-
:hide-arrow="true"
|
|
15
|
-
:value="listItem.expansion ? [listItem._key] : []"
|
|
16
|
-
>
|
|
17
|
-
<Panel :name="listItem._key">
|
|
18
|
-
<div
|
|
19
|
-
:class="{
|
|
20
|
-
'BriCollapseTree-collapseItem': true,
|
|
21
|
-
'BriCollapseTree-listItem-disabled': listItem.disabled
|
|
22
|
-
}"
|
|
23
|
-
@click.stop="click(listItem)"
|
|
24
|
-
>
|
|
25
|
-
<div class="BriCollapseTree-listItem-text">
|
|
26
|
-
{{ listItem.name }}
|
|
27
|
-
<span
|
|
28
|
-
class="BriCollapseTree-listItem-current"
|
|
29
|
-
v-if="listItem.current"
|
|
30
|
-
>(当前)</span>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="BriCollapseTree-listItem-grey">
|
|
33
|
-
{{ listItem._simpleDescription }}
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<bri-collapse-tree
|
|
38
|
-
slot="content"
|
|
39
|
-
:list="listItem.children"
|
|
40
|
-
@click="click"
|
|
41
|
-
></bri-collapse-tree>
|
|
42
|
-
</Panel>
|
|
43
|
-
</Collapse>
|
|
44
|
-
|
|
45
|
-
<!-- 直接展示 -->
|
|
46
|
-
<div
|
|
47
|
-
v-else
|
|
48
|
-
:class="{
|
|
49
|
-
'BriCollapseTree-collapseItem': true,
|
|
50
|
-
'BriCollapseTree-listItem-disabled': listItem.disabled
|
|
51
|
-
}"
|
|
52
|
-
@click.stop="click(listItem)"
|
|
53
|
-
>
|
|
54
|
-
<div class="BriCollapseTree-listItem-text">
|
|
55
|
-
{{ listItem.name }}
|
|
56
|
-
<span
|
|
57
|
-
v-if="listItem.current"
|
|
58
|
-
class="BriCollapseTree-listItem-current"
|
|
59
|
-
>(当前)</span>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<div class="BriCollapseTree-listItem-grey">
|
|
63
|
-
<Tooltip
|
|
64
|
-
v-if="listItem._description"
|
|
65
|
-
placement="right"
|
|
66
|
-
max-width="300"
|
|
67
|
-
:content="listItem._description"
|
|
68
|
-
>
|
|
69
|
-
<span class="BriCollapseTree-listItem-rightText">
|
|
70
|
-
{{ listItem._simpleDescription }}
|
|
71
|
-
</span>
|
|
72
|
-
</Tooltip>
|
|
73
|
-
<span
|
|
74
|
-
v-else
|
|
75
|
-
class="BriCollapseTree-listItem-rightText"
|
|
76
|
-
>{{ listItem._simpleDescription }}</span>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
</li>
|
|
80
|
-
</ul>
|
|
81
|
-
</div>
|
|
82
|
-
</template>
|
|
83
|
-
|
|
84
|
-
<script>
|
|
85
|
-
export default {
|
|
86
|
-
name: "BriCollapseTree",
|
|
87
|
-
props: {
|
|
88
|
-
list: {
|
|
89
|
-
type: Array,
|
|
90
|
-
default () {
|
|
91
|
-
return [];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
data () {
|
|
96
|
-
return {
|
|
97
|
-
};
|
|
98
|
-
},
|
|
99
|
-
computed: {},
|
|
100
|
-
created () {},
|
|
101
|
-
methods: {
|
|
102
|
-
click (listItem) {
|
|
103
|
-
if (listItem.disabled) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
this.$emit("click", listItem);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
</script>
|
|
111
|
-
|
|
112
|
-
<style lang="less" scoped>
|
|
113
|
-
.BriCollapseTree {
|
|
114
|
-
&-listItem {
|
|
115
|
-
display: flex;
|
|
116
|
-
justify-content: space-between;
|
|
117
|
-
padding: 6px 12px;
|
|
118
|
-
line-height: 20px;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
|
|
121
|
-
&-text {
|
|
122
|
-
word-break: break-word;
|
|
123
|
-
flex: 1;
|
|
124
|
-
min-width: 120px;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&-grey {
|
|
128
|
-
text-align: right;
|
|
129
|
-
color: @textColor;
|
|
130
|
-
margin-left: 0px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&-rightText {
|
|
134
|
-
min-width: 50px;
|
|
135
|
-
.dsh-ellipsis2();
|
|
136
|
-
-webkit-line-clamp: 3;
|
|
137
|
-
word-break: break-word;
|
|
138
|
-
color: @contentColor;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&:hover {
|
|
142
|
-
background: @bgColor;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
&-current {
|
|
146
|
-
font-weight: normal;
|
|
147
|
-
color: @themeColor;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
&-disabled {
|
|
151
|
-
cursor: not-allowed;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
&-collapseItem {
|
|
156
|
-
padding: 4px 0px;
|
|
157
|
-
flex: 1;
|
|
158
|
-
display: flex;
|
|
159
|
-
justify-content: space-between;
|
|
160
|
-
cursor: pointer;
|
|
161
|
-
|
|
162
|
-
&:hover {
|
|
163
|
-
background: @bgColor;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
</style>
|
|
168
|
-
<style lang="less">
|
|
169
|
-
.BriCollapseTree {
|
|
170
|
-
&-collapse {
|
|
171
|
-
&.ivu-collapse {
|
|
172
|
-
border: none;
|
|
173
|
-
|
|
174
|
-
.ivu-collapse-item > .ivu-collapse-header {
|
|
175
|
-
padding: 0px;
|
|
176
|
-
height: auto;
|
|
177
|
-
min-height: 32px;
|
|
178
|
-
line-height: 18px;
|
|
179
|
-
display: flex;
|
|
180
|
-
align-items: center;
|
|
181
|
-
|
|
182
|
-
i {
|
|
183
|
-
margin-right: 0px;
|
|
184
|
-
display: flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
justify-content: center;
|
|
187
|
-
width: 30px;
|
|
188
|
-
height: 30px;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
&:hover {
|
|
192
|
-
background: @bgColor;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.ivu-collapse-content {
|
|
197
|
-
padding: 0px;
|
|
198
|
-
|
|
199
|
-
& > .ivu-collapse-content-box {
|
|
200
|
-
padding: 0px;
|
|
201
|
-
padding-left: 18px;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="BriCollapseTree">
|
|
3
|
+
<ul>
|
|
4
|
+
<li
|
|
5
|
+
v-for="listItem in list"
|
|
6
|
+
:key="listItem._key"
|
|
7
|
+
>
|
|
8
|
+
<!-- 有children -->
|
|
9
|
+
<Collapse
|
|
10
|
+
v-if="listItem.children && listItem.children.length"
|
|
11
|
+
class="BriCollapseTree-collapse"
|
|
12
|
+
:accordion="listItem._accordion"
|
|
13
|
+
:simple="listItem._simple === false ? false : true"
|
|
14
|
+
:hide-arrow="true"
|
|
15
|
+
:value="listItem.expansion ? [listItem._key] : []"
|
|
16
|
+
>
|
|
17
|
+
<Panel :name="listItem._key">
|
|
18
|
+
<div
|
|
19
|
+
:class="{
|
|
20
|
+
'BriCollapseTree-collapseItem': true,
|
|
21
|
+
'BriCollapseTree-listItem-disabled': listItem.disabled
|
|
22
|
+
}"
|
|
23
|
+
@click.stop="click(listItem)"
|
|
24
|
+
>
|
|
25
|
+
<div class="BriCollapseTree-listItem-text">
|
|
26
|
+
{{ listItem.name }}
|
|
27
|
+
<span
|
|
28
|
+
class="BriCollapseTree-listItem-current"
|
|
29
|
+
v-if="listItem.current"
|
|
30
|
+
>(当前)</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="BriCollapseTree-listItem-grey">
|
|
33
|
+
{{ listItem._simpleDescription }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<bri-collapse-tree
|
|
38
|
+
slot="content"
|
|
39
|
+
:list="listItem.children"
|
|
40
|
+
@click="click"
|
|
41
|
+
></bri-collapse-tree>
|
|
42
|
+
</Panel>
|
|
43
|
+
</Collapse>
|
|
44
|
+
|
|
45
|
+
<!-- 直接展示 -->
|
|
46
|
+
<div
|
|
47
|
+
v-else
|
|
48
|
+
:class="{
|
|
49
|
+
'BriCollapseTree-collapseItem': true,
|
|
50
|
+
'BriCollapseTree-listItem-disabled': listItem.disabled
|
|
51
|
+
}"
|
|
52
|
+
@click.stop="click(listItem)"
|
|
53
|
+
>
|
|
54
|
+
<div class="BriCollapseTree-listItem-text">
|
|
55
|
+
{{ listItem.name }}
|
|
56
|
+
<span
|
|
57
|
+
v-if="listItem.current"
|
|
58
|
+
class="BriCollapseTree-listItem-current"
|
|
59
|
+
>(当前)</span>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div class="BriCollapseTree-listItem-grey">
|
|
63
|
+
<Tooltip
|
|
64
|
+
v-if="listItem._description"
|
|
65
|
+
placement="right"
|
|
66
|
+
max-width="300"
|
|
67
|
+
:content="listItem._description"
|
|
68
|
+
>
|
|
69
|
+
<span class="BriCollapseTree-listItem-rightText">
|
|
70
|
+
{{ listItem._simpleDescription }}
|
|
71
|
+
</span>
|
|
72
|
+
</Tooltip>
|
|
73
|
+
<span
|
|
74
|
+
v-else
|
|
75
|
+
class="BriCollapseTree-listItem-rightText"
|
|
76
|
+
>{{ listItem._simpleDescription }}</span>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</li>
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script>
|
|
85
|
+
export default {
|
|
86
|
+
name: "BriCollapseTree",
|
|
87
|
+
props: {
|
|
88
|
+
list: {
|
|
89
|
+
type: Array,
|
|
90
|
+
default () {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
data () {
|
|
96
|
+
return {
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
computed: {},
|
|
100
|
+
created () {},
|
|
101
|
+
methods: {
|
|
102
|
+
click (listItem) {
|
|
103
|
+
if (listItem.disabled) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this.$emit("click", listItem);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<style lang="less" scoped>
|
|
113
|
+
.BriCollapseTree {
|
|
114
|
+
&-listItem {
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
padding: 6px 12px;
|
|
118
|
+
line-height: 20px;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
|
|
121
|
+
&-text {
|
|
122
|
+
word-break: break-word;
|
|
123
|
+
flex: 1;
|
|
124
|
+
min-width: 120px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&-grey {
|
|
128
|
+
text-align: right;
|
|
129
|
+
color: @textColor;
|
|
130
|
+
margin-left: 0px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&-rightText {
|
|
134
|
+
min-width: 50px;
|
|
135
|
+
.dsh-ellipsis2();
|
|
136
|
+
-webkit-line-clamp: 3;
|
|
137
|
+
word-break: break-word;
|
|
138
|
+
color: @contentColor;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:hover {
|
|
142
|
+
background: @bgColor;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&-current {
|
|
146
|
+
font-weight: normal;
|
|
147
|
+
color: @themeColor;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&-disabled {
|
|
151
|
+
cursor: not-allowed;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&-collapseItem {
|
|
156
|
+
padding: 4px 0px;
|
|
157
|
+
flex: 1;
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: space-between;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
|
|
162
|
+
&:hover {
|
|
163
|
+
background: @bgColor;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
168
|
+
<style lang="less">
|
|
169
|
+
.BriCollapseTree {
|
|
170
|
+
&-collapse {
|
|
171
|
+
&.ivu-collapse {
|
|
172
|
+
border: none;
|
|
173
|
+
|
|
174
|
+
.ivu-collapse-item > .ivu-collapse-header {
|
|
175
|
+
padding: 0px;
|
|
176
|
+
height: auto;
|
|
177
|
+
min-height: 32px;
|
|
178
|
+
line-height: 18px;
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
|
|
182
|
+
i {
|
|
183
|
+
margin-right: 0px;
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
width: 30px;
|
|
188
|
+
height: 30px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&:hover {
|
|
192
|
+
background: @bgColor;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.ivu-collapse-content {
|
|
197
|
+
padding: 0px;
|
|
198
|
+
|
|
199
|
+
& > .ivu-collapse-content-box {
|
|
200
|
+
padding: 0px;
|
|
201
|
+
padding-left: 18px;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
</style>
|