bri-components 1.1.5 → 1.2.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/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/bri-components.min.js +6 -6
- package/lib/styles/bri-components.css +1 -1
- package/package.json +1 -1
- package/src/abolish/DshFileShow.less +61 -0
- package/src/{components/small → abolish}/DshFileShow.vue +30 -105
- package/src/components/controls/base/BriUpload/{index.vue → BriUpload.vue} +3 -3
- package/src/components/controls/base/BriUpload/{upload-list.vue → uploadList.vue} +17 -13
- package/src/components/controls/base/BriUpload/uploadMixin.js +1 -5
- package/src/components/controls/base/DshCascader/DshCascader.vue +91 -90
- package/src/components/controls/base/DshCheckbox.vue +3 -3
- package/src/components/controls/base/DshCoordinates.vue +2 -2
- package/src/components/controls/base/DshDate.vue +21 -10
- package/src/components/controls/base/DshEditor.vue +33 -48
- package/src/components/controls/base/DshInput.vue +21 -19
- package/src/components/controls/base/DshNumber/DshNumber.vue +23 -22
- package/src/components/controls/base/DshSelect.vue +10 -8
- package/src/components/controls/base/DshSwitch.vue +45 -87
- package/src/components/controls/controlMap.js +1 -1
- package/src/components/controls/controlMixin.js +5 -8
- package/src/components/controls/senior/BriLabels.vue +72 -54
- package/src/components/controls/special/DshUndeveloped.vue +0 -6
- package/src/components/form/DshDefaultSearch.vue +1 -1
- package/src/components/form/DshForm.vue +4 -13
- package/src/components/list/BriTable.vue +1 -1
- package/src/components/list/{ZTree.vue → BriTree.vue} +9 -8
- package/src/components/list/DshBox/DshCard.vue +4 -4
- package/src/components/list/DshBox/DshCrossTable.vue +4 -4
- package/src/components/list/DshBox/DshList.vue +2 -2
- package/src/components/list/DshBox/DshPanel.vue +5 -5
- package/src/components/list/DshBox/DshTable.vue +21 -80
- package/src/components/list/DshCascaderTable.vue +2 -2
- package/src/components/other/{ZCode.vue → BriCode.vue} +2 -9
- package/src/components/other/{ZCollapseTree.vue → BriCollapseTree.vue} +37 -16
- package/src/components/other/{ZIframe.vue → BriIframe.vue} +7 -23
- package/src/components/other/{ZLoading.vue → BriLoading.vue} +25 -11
- package/src/components/other/BriSvg.vue +2 -2
- package/src/components/other/DshAvatar.vue +21 -69
- package/src/components/other/DshColorPanel.vue +0 -43
- package/src/components/small/BriButton.vue +2 -2
- package/src/components/small/{Ctooltip.vue → BriTooltip.vue} +2 -2
- package/src/components/small/DshButtons.vue +28 -2
- package/src/components/small/DshCrumbs.vue +1 -0
- package/src/components/small/DshCrumbsItem.vue +5 -3
- package/src/components/small/DshIcons.vue +1 -15
- package/src/components/small/DshTags.vue +7 -2
- package/src/components/unit/DshFormItem.vue +6 -6
- package/src/components/unit/DshUnit.vue +0 -8
- package/src/index.js +93 -104
- package/src/styles/common/control.less +62 -53
- package/src/styles/components/controls/base/BriUpload/BriUpload.less +159 -0
- package/src/styles/components/controls/base/BriUpload/BriUploadImage.less +81 -0
- package/src/styles/components/controls/base/BriUpload/index.less +3 -0
- package/src/styles/components/controls/base/BriUpload/uploadList.less +164 -0
- package/src/styles/components/controls/base/DshCascader/DshCascader.less +124 -0
- package/src/styles/components/controls/base/DshCascader/index.less +2 -0
- package/src/styles/components/controls/{DshCheckbox.less → base/DshCheckbox.less} +3 -2
- package/src/styles/components/controls/base/DshDate.less +15 -0
- package/src/styles/components/controls/{DshEditor.less → base/DshEditor.less} +25 -47
- package/src/styles/components/controls/{DshInput.less → base/DshInput.less} +9 -1
- package/src/styles/components/controls/base/DshNumber.less +68 -0
- package/src/styles/components/controls/{DshSelect.less → base/DshSelect.less} +11 -0
- package/src/styles/components/controls/base/DshSwitch.less +37 -0
- package/src/styles/components/controls/{BriLabels.less → senior/BriLabels.less} +29 -12
- package/src/styles/components/controls/{DshDate.less → special/DshBack.less} +1 -1
- package/src/styles/components/controls/special/DshUndeveloped.less +3 -0
- package/src/styles/components/form/DshAdvSearchForm.less +0 -1
- package/src/styles/components/form/DshDefaultSearch.less +41 -9
- package/src/styles/components/form/DshForm.less +13 -0
- package/src/styles/components/index.less +51 -43
- package/src/styles/components/list/BriTable.less +9 -9
- package/src/styles/components/list/{ZTree.less → BriTree.less} +11 -7
- package/src/styles/components/list/DshBox/DshTable.less +11 -0
- package/src/styles/components/other/BriCode.less +5 -0
- package/src/styles/components/other/{ZCollapseTree.less → BriCollapseTree.less} +2 -2
- package/src/styles/components/other/BriIframe.less +16 -0
- package/src/styles/components/other/{ZLoading.less → BriLoading.less} +3 -3
- package/src/styles/components/other/DshAvatar.less +64 -0
- package/src/styles/components/other/DshBtnModal.less +3 -0
- package/src/styles/components/other/DshColorPanel.less +40 -0
- package/src/styles/components/other/DshEditPanel.less +2 -2
- package/src/styles/components/small/BriButton.less +35 -2
- package/src/styles/components/small/{Ctooltip.less → BriTooltip.less} +2 -1
- package/src/styles/components/small/DshCrumbs.less +0 -0
- package/src/styles/components/small/DshDropdown.less +5 -3
- package/src/styles/components/small/DshIcons.less +7 -0
- package/src/styles/components/small/DshTags.less +17 -0
- package/src/styles/components/unit/DshFormItem.less +5 -6
- package/src/styles/components/unit/DshUnit.less +5 -0
- package/src/utils/table.js +8 -0
- package/src/components/controls/controlShow.vue +0 -44
- package/src/components/other/YNoPermission.vue +0 -45
- package/src/components/small/BriTree.vue +0 -42
- package/src/styles/components/controls/BriUpload.less +0 -436
- package/src/styles/components/controls/DshCascader.less +0 -95
- package/src/styles/components/controls/DshNumber.less +0 -51
- package/src/styles/components/controls/controlShow.less +0 -12
- package/src/styles/components/other/ZCode.less +0 -1
- /package/src/{styles/components/other → abolish}/BriTransfer.less +0 -0
- /package/src/{components/other → abolish}/BriTransfer.vue +0 -0
- /package/src/{styles/components/small → abolish}/BriTree.less +0 -0
- /package/src/components/{small → list}/DshPage.vue +0 -0
- /package/src/components/other/{ZGantt.vue → BriGantt.vue} +0 -0
- /package/src/components/other/{menu/DshMenu.vue → DshMenu.vue} +0 -0
- /package/src/components/other/{menu/DshMenuNav.vue → DshMenuNav.vue} +0 -0
- /package/src/styles/components/controls/{BriInputs.less → base/BriInputs.less} +0 -0
- /package/src/styles/components/controls/{InfoCascader.less → base/DshCascader/InfoCascader.less} +0 -0
- /package/src/styles/components/controls/{DshCoordinates.less → base/DshCoordinates.less} +0 -0
- /package/src/styles/components/controls/{DshDaterange.less → base/DshDaterange.less} +0 -0
- /package/src/styles/components/controls/{DshDivider.less → base/DshDivider.less} +0 -0
- /package/src/styles/components/controls/{DshNumberange.less → base/DshNumberange.less} +0 -0
- /package/src/styles/components/controls/{DshPackage.less → senior/DshPackage.less} +0 -0
- /package/src/styles/components/controls/{cascaderTable.less → senior/cascaderTable.less} +0 -0
- /package/src/styles/components/controls/{flatTable.less → senior/flatTable.less} +0 -0
- /package/src/styles/components/{small → list}/DshPage.less +0 -0
- /package/src/styles/components/other/{ZGantt.less → BriGantt.less} +0 -0
- /package/src/{components/controls/base/BriUpload/upload-listItem.vue → styles/components/small/DshCrumbItem.less} +0 -0
|
@@ -1,49 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="DshEditor">
|
|
3
3
|
<!-- 编辑 -->
|
|
4
|
-
|
|
5
|
-
<!-- 可编辑 -->
|
|
6
|
-
<template v-if="finalCanEdit">
|
|
7
|
-
<div
|
|
8
|
-
class="DshEditor-show DshEditor-edit"
|
|
9
|
-
:class="value[controlKey] ? '': 'DshEditor-edit-placeholder'"
|
|
10
|
-
v-show="showType === 'show'"
|
|
11
|
-
v-html="editVal"
|
|
12
|
-
@click="handleEdit"
|
|
13
|
-
></div>
|
|
14
|
-
|
|
15
|
-
<div
|
|
16
|
-
v-show="showType === 'edit'"
|
|
17
|
-
class="DshEditor-wrap"
|
|
18
|
-
>
|
|
19
|
-
<div
|
|
20
|
-
ref="toolbar"
|
|
21
|
-
class="DshEditor-wrap-toolbar"
|
|
22
|
-
></div>
|
|
23
|
-
|
|
24
|
-
<div
|
|
25
|
-
ref="editor"
|
|
26
|
-
class="DshEditor-wrap-text"
|
|
27
|
-
></div>
|
|
28
|
-
|
|
29
|
-
<dsh-buttons
|
|
30
|
-
class="DshEditor-wrap-btn"
|
|
31
|
-
:list="$getOperationList(['canSave'])"
|
|
32
|
-
@click="$dispatchEvent($event)"
|
|
33
|
-
></dsh-buttons>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<!-- 不可编辑 -->
|
|
4
|
+
<template v-if="canEdit">
|
|
38
5
|
<div
|
|
39
|
-
v-else
|
|
40
6
|
:class="{
|
|
41
|
-
'DshEditor-
|
|
42
|
-
|
|
7
|
+
'DshEditor-edit': true,
|
|
8
|
+
...commonClass
|
|
43
9
|
}"
|
|
44
10
|
v-show="showType === 'show'"
|
|
45
11
|
v-html="showText"
|
|
12
|
+
@click="handleEdit"
|
|
46
13
|
></div>
|
|
14
|
+
|
|
15
|
+
<div
|
|
16
|
+
v-if="finalCanEdit"
|
|
17
|
+
v-show="showType === 'edit'"
|
|
18
|
+
class="DshEditor-wrap"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
ref="toolbar"
|
|
22
|
+
class="DshEditor-wrap-toolbar"
|
|
23
|
+
></div>
|
|
24
|
+
|
|
25
|
+
<div
|
|
26
|
+
ref="editor"
|
|
27
|
+
class="DshEditor-wrap-text"
|
|
28
|
+
></div>
|
|
29
|
+
|
|
30
|
+
<dsh-buttons
|
|
31
|
+
class="DshEditor-wrap-btn"
|
|
32
|
+
:list="$getOperationList(['canSave'])"
|
|
33
|
+
@click="$dispatchEvent($event)"
|
|
34
|
+
></dsh-buttons>
|
|
35
|
+
</div>
|
|
47
36
|
</template>
|
|
48
37
|
|
|
49
38
|
<!-- 查看 -->
|
|
@@ -52,11 +41,10 @@
|
|
|
52
41
|
<div
|
|
53
42
|
v-if="isUnitShow"
|
|
54
43
|
:class="{
|
|
55
|
-
'DshEditor-unit':
|
|
56
|
-
'DshEditor-unit-nodata': true,
|
|
44
|
+
'DshEditor-unit': !$isEmptyData(curVal)
|
|
57
45
|
}"
|
|
58
46
|
>
|
|
59
|
-
{{ curVal ? "富文本"
|
|
47
|
+
{{ $isEmptyData(curVal) ? emptyShowVal : "富文本" }}
|
|
60
48
|
</div>
|
|
61
49
|
|
|
62
50
|
<!-- 查看页里 的查看 -->
|
|
@@ -64,9 +52,8 @@
|
|
|
64
52
|
v-else
|
|
65
53
|
:class="{
|
|
66
54
|
'DshEditor-show': true,
|
|
67
|
-
'DshEditor-show-nodata':
|
|
55
|
+
'DshEditor-show-nodata': $isEmptyData(curVal)
|
|
68
56
|
}"
|
|
69
|
-
v-show="showType === 'show'"
|
|
70
57
|
v-html="showText"
|
|
71
58
|
></div>
|
|
72
59
|
</template>
|
|
@@ -106,10 +93,6 @@
|
|
|
106
93
|
...this.propsObj,
|
|
107
94
|
...this.commonDealPropsObj
|
|
108
95
|
};
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
editVal () {
|
|
112
|
-
return this.curVal || this.selfPropsObj._placeholder;
|
|
113
96
|
}
|
|
114
97
|
},
|
|
115
98
|
created () {},
|
|
@@ -181,8 +164,10 @@
|
|
|
181
164
|
this.editor = editor;
|
|
182
165
|
},
|
|
183
166
|
handleEdit () {
|
|
184
|
-
|
|
185
|
-
|
|
167
|
+
if (this.finalCanEdit) {
|
|
168
|
+
this.editor.txt.html(this.value[this.propsObj._key]);
|
|
169
|
+
this.showType = "edit";
|
|
170
|
+
}
|
|
186
171
|
},
|
|
187
172
|
clickSave () {
|
|
188
173
|
this.showType = "show";
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<!-- 编辑 -->
|
|
4
4
|
<template v-if="canEdit">
|
|
5
5
|
<Input
|
|
6
|
+
class="DshInput-edit"
|
|
6
7
|
v-model="value[controlKey]"
|
|
7
8
|
:type="subType"
|
|
8
9
|
:placeholder="selfPropsObj._placeholder"
|
|
@@ -36,29 +37,29 @@
|
|
|
36
37
|
|
|
37
38
|
<!-- 查看 -->
|
|
38
39
|
<template v-else>
|
|
39
|
-
<!--
|
|
40
|
-
<template v-if="isUnitShow">
|
|
41
|
-
<control-show
|
|
42
|
-
:showVal="curVal"
|
|
43
|
-
:emptyShowVal="emptyShowVal"
|
|
44
|
-
:propsObj="selfPropsObj"
|
|
45
|
-
></control-show>
|
|
46
|
-
</template>
|
|
47
|
-
|
|
48
|
-
<!-- 查看页 里的查看 (textarea单独处理) -->
|
|
49
|
-
<template v-else>
|
|
40
|
+
<!-- 查看页 的textarea单独处理 -->
|
|
41
|
+
<template v-if="!isUnitShow && subType === 'textarea' && !$isEmptyData(curVal)">
|
|
50
42
|
<p
|
|
51
|
-
v-if="subType === 'textarea' && curVal"
|
|
52
43
|
class="DshInput-show-textarea"
|
|
53
|
-
v-text="
|
|
44
|
+
v-text="showText"
|
|
54
45
|
></p>
|
|
46
|
+
</template>
|
|
55
47
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
:
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
<!-- 表格和查看页 里的查看 -->
|
|
49
|
+
<template v-else>
|
|
50
|
+
<bri-tooltip
|
|
51
|
+
:content="showText"
|
|
52
|
+
maxWidth="200"
|
|
53
|
+
:transfer="true"
|
|
54
|
+
>
|
|
55
|
+
<div :class="{
|
|
56
|
+
...commonClass,
|
|
57
|
+
'DshInput-unit': isUnitShow,
|
|
58
|
+
'DshInput-show': !isUnitShow
|
|
59
|
+
}">
|
|
60
|
+
{{ showText }}
|
|
61
|
+
</div>
|
|
62
|
+
</bri-tooltip>
|
|
62
63
|
</template>
|
|
63
64
|
</template>
|
|
64
65
|
</div>
|
|
@@ -87,6 +88,7 @@
|
|
|
87
88
|
_autosize: {
|
|
88
89
|
minRows: 2
|
|
89
90
|
},
|
|
91
|
+
|
|
90
92
|
...this.propsObj,
|
|
91
93
|
...this.commonDealPropsObj
|
|
92
94
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<!-- 编辑 -->
|
|
4
4
|
<template v-if="canEdit">
|
|
5
5
|
<BriInputNumber
|
|
6
|
+
class="DshNumber-edit"
|
|
6
7
|
v-model="value[controlKey]"
|
|
7
8
|
:placeholder="selfPropsObj._placeholder"
|
|
8
9
|
:disabled="!finalCanEdit"
|
|
@@ -10,13 +11,13 @@
|
|
|
10
11
|
:max="maxNum"
|
|
11
12
|
:min="minNum"
|
|
12
13
|
:precision="digit"
|
|
13
|
-
:numberAdjust="selfPropsObj._numberAdjust"
|
|
14
|
+
:numberAdjust="selfPropsObj._numberAdjust || !unitStr"
|
|
14
15
|
@on-change="change"
|
|
15
16
|
>
|
|
16
17
|
<div
|
|
17
18
|
v-if="unitStr"
|
|
18
19
|
slot="suffix"
|
|
19
|
-
class="DshNumber-suffix"
|
|
20
|
+
class="DshNumber-edit-suffix"
|
|
20
21
|
>
|
|
21
22
|
{{ unitStr }}
|
|
22
23
|
</div>
|
|
@@ -25,30 +26,29 @@
|
|
|
25
26
|
|
|
26
27
|
<!-- 查看 -->
|
|
27
28
|
<template v-else>
|
|
28
|
-
<!--
|
|
29
|
-
<template v-if="isUnitShow">
|
|
30
|
-
<!-- 进度条模式 -->
|
|
29
|
+
<!-- 单元格的查看 进度条模式 -->
|
|
30
|
+
<template v-if="isUnitShow && selfPropsObj._showProgress">
|
|
31
31
|
<Progress
|
|
32
32
|
v-if="selfPropsObj._showProgress"
|
|
33
33
|
:percent="curVal > 100 ? 100 : toDecimal(curVal)"
|
|
34
34
|
/>
|
|
35
|
-
|
|
36
|
-
<!-- 文字模式 -->
|
|
37
|
-
<control-show
|
|
38
|
-
v-else
|
|
39
|
-
:showVal="showVal"
|
|
40
|
-
:emptyShowVal="emptyShowVal"
|
|
41
|
-
:propsObj="selfPropsObj"
|
|
42
|
-
></control-show>
|
|
43
35
|
</template>
|
|
44
36
|
|
|
45
|
-
<!--
|
|
37
|
+
<!-- 单元格和查看页的查看 -->
|
|
46
38
|
<template v-else>
|
|
47
|
-
<
|
|
48
|
-
:
|
|
49
|
-
|
|
50
|
-
:
|
|
51
|
-
|
|
39
|
+
<bri-tooltip
|
|
40
|
+
:content="showText"
|
|
41
|
+
maxWidth="200"
|
|
42
|
+
:transfer="true"
|
|
43
|
+
>
|
|
44
|
+
<div :class="{
|
|
45
|
+
...commonClass,
|
|
46
|
+
'DshInput-unit': isUnitShow,
|
|
47
|
+
'DshInput-show': !isUnitShow
|
|
48
|
+
}">
|
|
49
|
+
{{ showText }}
|
|
50
|
+
</div>
|
|
51
|
+
</bri-tooltip>
|
|
52
52
|
</template>
|
|
53
53
|
</template>
|
|
54
54
|
</div>
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
computed: {
|
|
74
74
|
selfPropsObj () {
|
|
75
75
|
return {
|
|
76
|
-
_numberAdjust: true,
|
|
77
76
|
...this.propsObj,
|
|
78
77
|
...this.commonDealPropsObj
|
|
79
78
|
};
|
|
@@ -122,8 +121,10 @@
|
|
|
122
121
|
return this.selfPropsObj._separator;
|
|
123
122
|
},
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
return this.$
|
|
124
|
+
showText () {
|
|
125
|
+
return this.$isEmptyData(this.curVal)
|
|
126
|
+
? this.emptyShowVal
|
|
127
|
+
: this.$numToStrAndUnit(this.value[this.controlKey], this.selfPropsObj);
|
|
127
128
|
}
|
|
128
129
|
},
|
|
129
130
|
created () {},
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
</Select>
|
|
75
75
|
</template>
|
|
76
76
|
|
|
77
|
-
<
|
|
77
|
+
<bri-tooltip
|
|
78
78
|
v-else
|
|
79
79
|
:content="valStr"
|
|
80
80
|
maxWidth="200"
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
>
|
|
103
103
|
{{ emptyShowVal }}
|
|
104
104
|
</div>
|
|
105
|
-
</
|
|
105
|
+
</bri-tooltip>
|
|
106
106
|
|
|
107
107
|
<!-- tip项弹框提示 -->
|
|
108
108
|
<dsh-render :render="tipModalRender"></dsh-render>
|
|
@@ -203,12 +203,14 @@
|
|
|
203
203
|
..._customData.params
|
|
204
204
|
},
|
|
205
205
|
callback: data => {
|
|
206
|
-
this.initListData.push(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
206
|
+
this.initListData.push(
|
|
207
|
+
...data.list.map(item => (
|
|
208
|
+
{
|
|
209
|
+
_key: item[_customData._key || "_key"],
|
|
210
|
+
name: item[_customData._name || "name"]
|
|
211
|
+
}
|
|
212
|
+
))
|
|
213
|
+
);
|
|
212
214
|
}
|
|
213
215
|
});
|
|
214
216
|
},
|
|
@@ -1,48 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:disabled="!finalCanEdit"
|
|
12
|
-
@on-change="change"
|
|
13
|
-
>
|
|
14
|
-
<span
|
|
15
|
-
slot="open"
|
|
16
|
-
style="font-size: 12px;"
|
|
17
|
-
>{{ propsObj._openText }}</span>
|
|
18
|
-
<span slot="close">{{ propsObj._closeText }}</span>
|
|
19
|
-
</i-switch>
|
|
20
|
-
<!-- 查看 和 编辑下无编辑权限 -->
|
|
21
|
-
<Ctooltip
|
|
22
|
-
v-else
|
|
23
|
-
placement="top"
|
|
24
|
-
:transfer="true"
|
|
25
|
-
maxWidth="200"
|
|
26
|
-
:content="showVal"
|
|
27
|
-
>
|
|
28
|
-
<div
|
|
29
|
-
class="DshCheckbox-value-wrapper"
|
|
30
|
-
:style="{
|
|
31
|
-
textAlign: propsObj._textAlign,
|
|
32
|
-
flexGrow: 1,
|
|
33
|
-
display: 'flex',
|
|
34
|
-
justifyContent: getFlexLayout(propsObj._textAlign)
|
|
35
|
-
}"
|
|
2
|
+
<!-- 该组件无clearable -->
|
|
3
|
+
<div class="DshSwitch">
|
|
4
|
+
<!-- 编辑 -->
|
|
5
|
+
<template v-if="canEdit">
|
|
6
|
+
<i-switch
|
|
7
|
+
v-model="curVal"
|
|
8
|
+
:disabled="!finalCanEdit"
|
|
9
|
+
:size="propsObj._size"
|
|
10
|
+
@on-change="change"
|
|
36
11
|
>
|
|
37
|
-
<span
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
12
|
+
<span slot="open">
|
|
13
|
+
{{ propsObj._openText }}
|
|
14
|
+
</span>
|
|
15
|
+
<span slot="close">
|
|
16
|
+
{{ propsObj._closeText }}
|
|
17
|
+
</span>
|
|
18
|
+
</i-switch>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<!-- 查看 -->
|
|
22
|
+
<template v-else>
|
|
23
|
+
<bri-tooltip
|
|
24
|
+
:content="showText"
|
|
25
|
+
placement="top"
|
|
26
|
+
:transfer="true"
|
|
27
|
+
maxWidth="200"
|
|
28
|
+
>
|
|
29
|
+
<div class="DshSwitch-show">
|
|
30
|
+
<span
|
|
31
|
+
class="DshSwitch-show-name"
|
|
32
|
+
:style="{
|
|
33
|
+
background: curVal ? '#ECF3FD' : '#FEF6EB',
|
|
34
|
+
color: curVal ? '#3D84EE' : '#F4A135'
|
|
35
|
+
}"
|
|
36
|
+
>
|
|
37
|
+
{{ showText }}
|
|
38
|
+
</span>
|
|
39
|
+
</div>
|
|
40
|
+
</bri-tooltip>
|
|
41
|
+
</template>
|
|
46
42
|
</div>
|
|
47
43
|
</template>
|
|
48
44
|
|
|
@@ -51,58 +47,20 @@
|
|
|
51
47
|
|
|
52
48
|
export default {
|
|
53
49
|
name: "DshSwitch",
|
|
54
|
-
mixins: [
|
|
50
|
+
mixins: [
|
|
51
|
+
controlMixin
|
|
52
|
+
],
|
|
55
53
|
data () {
|
|
56
54
|
return {};
|
|
57
55
|
},
|
|
58
56
|
computed: {
|
|
59
|
-
|
|
57
|
+
showText () {
|
|
60
58
|
return this.value[this.controlKey]
|
|
61
59
|
? this.propsObj._openText
|
|
62
60
|
: this.propsObj._closeText;
|
|
63
61
|
}
|
|
64
62
|
},
|
|
65
|
-
created () {
|
|
66
|
-
}
|
|
67
|
-
methods: {
|
|
68
|
-
getFlexLayout (align) {
|
|
69
|
-
let map = {
|
|
70
|
-
left: "flex-start",
|
|
71
|
-
center: "center",
|
|
72
|
-
right: "flex-end"
|
|
73
|
-
};
|
|
74
|
-
if (align) {
|
|
75
|
-
return map[align];
|
|
76
|
-
} else {
|
|
77
|
-
return "flex-start";
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
63
|
+
created () {},
|
|
64
|
+
methods: {}
|
|
81
65
|
};
|
|
82
66
|
</script>
|
|
83
|
-
|
|
84
|
-
<style lang="less" scoped>
|
|
85
|
-
.DshSwitch {
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
</style>
|
|
89
|
-
<style lang="less">
|
|
90
|
-
.DshSwitch {
|
|
91
|
-
.ivu-switch {
|
|
92
|
-
width: 50px;
|
|
93
|
-
}
|
|
94
|
-
.ivu-switch-checked:after {
|
|
95
|
-
left: 29px;
|
|
96
|
-
}
|
|
97
|
-
.ivu-switch-inner {
|
|
98
|
-
color: #fff;
|
|
99
|
-
font-size: 12px;
|
|
100
|
-
position: absolute;
|
|
101
|
-
left: auto;
|
|
102
|
-
right: 4px;
|
|
103
|
-
}
|
|
104
|
-
.ivu-switch-checked .ivu-switch-inner {
|
|
105
|
-
left: 3px;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
</style>
|
|
@@ -58,7 +58,7 @@ const pathMap = {
|
|
|
58
58
|
// DshSelect: "./base/DshSelect.vue", // 全局已注册
|
|
59
59
|
// DshCheckbox: "./base/DshCheckbox.vue", // 全局已注册
|
|
60
60
|
// DshCascader: "./base/DshCascader/DshCascader.vue", // 全局已注册
|
|
61
|
-
BriUpload: "./base/BriUpload/
|
|
61
|
+
BriUpload: "./base/BriUpload/BriUpload.vue",
|
|
62
62
|
DshCoordinates: "./base/DshCoordinates.vue",
|
|
63
63
|
DshEditor: "./base/DshEditor.vue",
|
|
64
64
|
DshDivider: "./base/DshDivider.vue",
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import controlShow from "./controlShow.vue";
|
|
2
|
-
|
|
3
1
|
export default {
|
|
4
|
-
components: {
|
|
5
|
-
controlShow
|
|
6
|
-
},
|
|
2
|
+
components: {},
|
|
7
3
|
props: {
|
|
8
4
|
canEdit: {
|
|
9
5
|
type: Boolean,
|
|
@@ -72,7 +68,7 @@ export default {
|
|
|
72
68
|
: "暂无内容";
|
|
73
69
|
},
|
|
74
70
|
showText () {
|
|
75
|
-
return this.$isEmptyData(this.curVal) ? this.
|
|
71
|
+
return this.$isEmptyData(this.curVal) ? this.emptyShowVal : this.curVal;
|
|
76
72
|
},
|
|
77
73
|
|
|
78
74
|
isUnitShow () {
|
|
@@ -93,12 +89,13 @@ export default {
|
|
|
93
89
|
},
|
|
94
90
|
commonClass () {
|
|
95
91
|
return {
|
|
96
|
-
"dsh-ellipsis": true,
|
|
97
92
|
"control-edit": this.canEdit && this.finalCanEdit,
|
|
98
93
|
"control-disabled": this.canEdit && !this.finalCanEdit,
|
|
99
94
|
"control-unit": !this.canEdit && this.isUnitShow,
|
|
100
95
|
"control-show": !this.canEdit && !this.isUnitShow,
|
|
101
|
-
|
|
96
|
+
|
|
97
|
+
"dsh-ellipsis": true,
|
|
98
|
+
"control-notext": !this.isUnitShow && this.$isEmptyData(this.curVal)
|
|
102
99
|
};
|
|
103
100
|
},
|
|
104
101
|
|