bri-components 1.1.2 → 1.1.4
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/10.bri-components.min.js +1 -0
- package/lib/2.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/7.bri-components.min.js +1 -1
- package/lib/8.bri-components.min.js +1 -1
- package/lib/9.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +6 -6
- package/lib/styles/bri-components.css +1 -1
- package/package.json +1 -1
- package/src/abolish/DshCascaders.less +11 -0
- package/src/{components/controls/base/DshCascaderMultiple.vue → abolish/DshCascaders.vue} +17 -27
- package/src/{components/list → abolish}/DshFlatTable.vue +1 -1
- package/src/abolish/DshTexts.less +13 -0
- package/src/{components/controls/base/textMultiple/DshTextMultiple.vue → abolish/DshTexts.vue} +17 -25
- package/src/components/controls/base/{textMultiple/MultipleInput.vue → BriInputs.vue} +18 -17
- package/src/components/controls/base/{ZUpload/YUploadImage.vue → BriUpload/BriUploadImage.vue} +56 -15
- package/src/components/controls/base/{ZUpload → BriUpload}/index.vue +24 -21
- package/src/components/controls/base/{ZUpload → BriUpload}/upload-list.vue +20 -13
- package/src/components/controls/base/{ZUpload → BriUpload}/uploadMixin.js +7 -3
- package/src/components/controls/base/{DshCascader.vue → DshCascader/DshCascader.vue} +33 -26
- package/src/components/controls/base/DshCheckbox.vue +17 -20
- package/src/components/controls/base/DshCoordinates.vue +119 -110
- package/src/components/controls/base/DshDate.vue +24 -37
- package/src/components/controls/base/DshDaterange.vue +3 -1
- package/src/components/controls/base/DshEditor.vue +73 -60
- package/src/components/controls/base/DshInput.vue +72 -60
- package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +1 -1
- package/src/components/controls/base/DshNumber/DshNumber.vue +52 -48
- package/src/components/controls/base/DshNumberange.vue +11 -21
- package/src/components/controls/base/DshSelect.vue +13 -17
- package/src/components/controls/controlMap.js +12 -11
- package/src/components/controls/controlMixin.js +40 -29
- package/src/components/controls/controlShow.vue +44 -0
- package/src/components/controls/{base → senior}/BriLabels.vue +7 -12
- package/src/components/controls/{base → senior}/DshPackage.vue +6 -25
- package/src/components/controls/senior/cascaderTable.vue +52 -51
- package/src/components/controls/senior/flatTable.vue +20 -17
- package/src/components/controls/{base → special}/DshBack.vue +4 -4
- package/src/components/controls/{base → special}/DshUndeveloped.vue +3 -1
- package/src/components/form/DshAdvSearchForm.vue +10 -1
- package/src/components/form/DshForm.vue +10 -3
- package/src/components/list/BriFlatTable.vue +5 -5
- package/src/components/list/BriTable.vue +6 -8
- package/src/components/list/DshBox/DshBox.vue +7 -24
- package/src/components/list/DshBox/DshCard.vue +15 -74
- package/src/components/list/DshBox/DshCrossTable.vue +4 -8
- package/src/components/list/DshBox/DshList.vue +8 -136
- package/src/components/list/DshBox/DshPanel.vue +0 -110
- package/src/components/list/DshBox/DshTable.vue +1 -4
- package/src/components/list/DshCascaderTable.vue +1 -1
- package/src/components/list/ZTree.vue +0 -58
- package/src/components/other/ZIframe.vue +5 -0
- package/src/components/small/DshControlDefine.vue +6 -2
- package/src/components/small/DshModal.vue +0 -134
- package/src/components/small/DshPage.vue +1 -0
- package/src/components/unit/DshFormItem.vue +7 -10
- package/src/components/unit/DshUnit.vue +1 -11
- package/src/components/unit/unitMixin.js +8 -5
- package/src/index.js +16 -33
- package/src/styles/common/control.less +63 -27
- package/src/styles/components/controls/{MultipleInput.less → BriInputs.less} +1 -1
- package/src/styles/components/controls/BriLabels.less +4 -2
- package/src/styles/components/controls/{ZUpload.less → BriUpload.less} +5 -6
- package/src/styles/components/controls/DshCheckbox.less +45 -42
- package/src/styles/components/controls/DshCoordinates.less +66 -59
- package/src/styles/components/controls/DshDate.less +1 -52
- package/src/styles/components/controls/DshEditor.less +51 -34
- package/src/styles/components/controls/DshInput.less +13 -34
- package/src/styles/components/controls/DshNumber.less +51 -0
- package/src/styles/components/controls/DshNumberange.less +8 -3
- package/src/styles/components/controls/DshSelect.less +78 -92
- package/src/styles/components/{other → controls}/InfoCascader.less +4 -4
- package/src/styles/components/controls/cascaderTable.less +10 -24
- package/src/styles/components/controls/controlShow.less +3 -1
- package/src/styles/components/controls/flatTable.less +10 -23
- package/src/styles/components/form/DshAdvSearchForm.less +0 -9
- package/src/styles/components/form/DshDefaultSearch.less +0 -20
- package/src/styles/components/index.less +24 -17
- package/src/styles/components/list/DshBox/DshBox.less +20 -0
- package/src/styles/components/list/DshBox/DshCard.less +59 -0
- package/src/styles/components/list/DshBox/DshList.less +142 -0
- package/src/styles/components/list/DshBox/DshPanel.less +107 -0
- package/src/styles/components/list/DshBox/DshTable.less +4 -0
- package/src/styles/components/list/ZTree.less +52 -0
- package/src/styles/components/small/DshControlDefine.less +4 -7
- package/src/styles/components/small/DshDropdown.less +1 -0
- package/src/styles/components/small/DshModal.less +207 -0
- package/src/styles/components/unit/DshFormItem.less +2 -0
- package/src/styles/reset.less +14 -0
- package/src/styles/variables.less +1 -0
- package/src/utils/table.js +5 -4
- package/src/components/controls/base/DshLabels.vue +0 -309
- package/src/components/controls/base/YSerialNumber.vue +0 -36
- package/src/components/controls/base/controlShow.vue +0 -52
- package/src/components/list/easyTable/index.js +0 -23
- package/src/components/list/easyTable/src/directives/clickoutside.js +0 -32
- package/src/components/list/easyTable/src/mixins/layerAdjustment.js +0 -62
- package/src/components/list/easyTable/src/settings/settings.js +0 -11
- package/src/components/list/easyTable/src/utils/deepClone.js +0 -256
- package/src/components/list/easyTable/src/utils/dom.js +0 -41
- package/src/components/list/easyTable/src/utils/utils.js +0 -190
- package/src/components/list/easyTable/v-checkbox/index.js +0 -7
- package/src/components/list/easyTable/v-checkbox/src/checkbox.vue +0 -127
- package/src/components/list/easyTable/v-checkbox-group/index.js +0 -7
- package/src/components/list/easyTable/v-checkbox-group/src/checkbox-group.vue +0 -68
- package/src/components/list/easyTable/v-dropdown/index.js +0 -7
- package/src/components/list/easyTable/v-dropdown/src/dropdown.vue +0 -337
- package/src/components/list/easyTable/v-table/index.js +0 -7
- package/src/components/list/easyTable/v-table/src/body-cell-merge-mixin.js +0 -141
- package/src/components/list/easyTable/v-table/src/cell-edit-mixin.js +0 -102
- package/src/components/list/easyTable/v-table/src/checkbox-selection-mixin.js +0 -189
- package/src/components/list/easyTable/v-table/src/classes-mixin.js +0 -56
- package/src/components/list/easyTable/v-table/src/drag-width-mixin.js +0 -202
- package/src/components/list/easyTable/v-table/src/export-csv.js +0 -74
- package/src/components/list/easyTable/v-table/src/frozen-columns-mixin.js +0 -134
- package/src/components/list/easyTable/v-table/src/loading.vue +0 -49
- package/src/components/list/easyTable/v-table/src/scroll-bar-control-mixin.js +0 -21
- package/src/components/list/easyTable/v-table/src/scroll-control-mixin.js +0 -92
- package/src/components/list/easyTable/v-table/src/sort-control-mixin.js +0 -108
- package/src/components/list/easyTable/v-table/src/table-empty-mixin.js +0 -73
- package/src/components/list/easyTable/v-table/src/table-empty.vue +0 -66
- package/src/components/list/easyTable/v-table/src/table-filters-mixin.js +0 -126
- package/src/components/list/easyTable/v-table/src/table-footer-mixin.js +0 -122
- package/src/components/list/easyTable/v-table/src/table-resize-mixin.js +0 -279
- package/src/components/list/easyTable/v-table/src/table-row-mouse-events-mixin.js +0 -123
- package/src/components/list/easyTable/v-table/src/table.vue +0 -1565
- package/src/components/list/easyTable/v-table/src/title-cell-merge-mixin.js +0 -115
- package/src/components/list/evTable/EvTable.vue +0 -321
- package/src/components/list/evTable/EvTableMixin.js +0 -26
- package/src/styles/components/controls/DshLabels.less +0 -187
- package/src/styles/components/list/evTable.less +0 -79
- package/src/styles/components/list/evtable/animation.less +0 -141
- package/src/styles/components/list/evtable/font/fontello.eot +0 -0
- package/src/styles/components/list/evtable/font/fontello.svg +0 -32
- package/src/styles/components/list/evtable/font/fontello.ttf +0 -0
- package/src/styles/components/list/evtable/font/fontello.woff +0 -0
- package/src/styles/components/list/evtable/font/fontello.woff2 +0 -0
- package/src/styles/components/list/evtable/fontello.less +0 -68
- package/src/styles/components/list/evtable/index.less +0 -5
- package/src/styles/components/list/evtable/v-checkbox.less +0 -167
- package/src/styles/components/list/evtable/v-dropdown.less +0 -235
- package/src/styles/components/list/evtable/v-table.less +0 -334
- package/src/styles/components/list/ivu_reset.less +0 -49
- /package/src/{styles/components/list → abolish}/DshFlatTable.less +0 -0
- /package/src/components/{pages/Error → Error}/Error403.vue +0 -0
- /package/src/components/{pages/Error → Error}/Error404.vue +0 -0
- /package/src/components/{pages/Error → Error}/Error500.vue +0 -0
- /package/src/components/{pages/Error → Error}/error.less +0 -0
- /package/src/components/{pages/Error → Error}/errorBack.vue +0 -0
- /package/src/components/controls/base/{ZUpload → BriUpload}/upload-listItem.vue +0 -0
- /package/src/components/{other → controls/base/DshCascader}/InfoCascader.vue +0 -0
- /package/src/styles/components/list/{DshCrossTable.less → DshBox/DshCrossTable.less} +0 -0
- /package/src/styles/components/list/{DshSingleData.less → DshBox/DshSingleData.less} +0 -0
|
@@ -1,52 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
>{{ selfPropsObj._prepend }}</span>
|
|
30
|
-
<span
|
|
31
|
-
v-if="selfPropsObj._append"
|
|
32
|
-
slot="append"
|
|
33
|
-
>{{ selfPropsObj._append }}</span>
|
|
34
|
-
</Input>
|
|
35
|
-
<!-- textarea特殊处理 -->
|
|
36
|
-
<p
|
|
37
|
-
v-else-if="subType === 'textarea' && showVal"
|
|
38
|
-
:class="['control-show-text', 'DshInput-textarea-show']"
|
|
39
|
-
v-text="showVal"
|
|
40
|
-
>
|
|
41
|
-
</p>
|
|
2
|
+
<div class="DshInput">
|
|
3
|
+
<!-- 编辑 -->
|
|
4
|
+
<template v-if="canEdit">
|
|
5
|
+
<Input
|
|
6
|
+
v-model="value[controlKey]"
|
|
7
|
+
:type="subType"
|
|
8
|
+
:placeholder="selfPropsObj._placeholder"
|
|
9
|
+
:readonly="selfPropsObj._readonly"
|
|
10
|
+
:disabled="!finalCanEdit || selfPropsObj._disabled"
|
|
11
|
+
:clearable="selfPropsObj._clearable"
|
|
12
|
+
:size="selfPropsObj._size"
|
|
13
|
+
:rows="selfPropsObj._rows"
|
|
14
|
+
:search="selfPropsObj._search"
|
|
15
|
+
:show-word-limit="selfPropsObj._showWordLimit"
|
|
16
|
+
:maxlength="selfPropsObj._maxlength"
|
|
17
|
+
:autosize="selfPropsObj._autosize"
|
|
18
|
+
@on-enter="onEnter"
|
|
19
|
+
@on-search="onSearch"
|
|
20
|
+
@on-focus="onFocus"
|
|
21
|
+
@on-change="onChange"
|
|
22
|
+
@on-blur="onBlur"
|
|
23
|
+
@on-clear="onClear"
|
|
24
|
+
>
|
|
25
|
+
<span
|
|
26
|
+
v-if="selfPropsObj._prepend"
|
|
27
|
+
slot="prepend"
|
|
28
|
+
>{{ selfPropsObj._prepend }}</span>
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
<span
|
|
31
|
+
v-if="selfPropsObj._append"
|
|
32
|
+
slot="append"
|
|
33
|
+
>{{ selfPropsObj._append }}</span>
|
|
34
|
+
</Input>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<!-- 查看 -->
|
|
38
|
+
<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>
|
|
50
|
+
<p
|
|
51
|
+
v-if="subType === 'textarea' && curVal"
|
|
52
|
+
class="DshInput-show-textarea"
|
|
53
|
+
v-text="curVal"
|
|
54
|
+
></p>
|
|
55
|
+
|
|
56
|
+
<control-show
|
|
57
|
+
v-else
|
|
58
|
+
:showVal="curVal"
|
|
59
|
+
:emptyShowVal="emptyShowVal"
|
|
60
|
+
:propsObj="selfPropsObj"
|
|
61
|
+
></control-show>
|
|
62
|
+
</template>
|
|
63
|
+
</template>
|
|
50
64
|
</div>
|
|
51
65
|
</template>
|
|
52
66
|
|
|
@@ -55,7 +69,9 @@
|
|
|
55
69
|
|
|
56
70
|
export default {
|
|
57
71
|
name: "DshInput",
|
|
58
|
-
mixins: [
|
|
72
|
+
mixins: [
|
|
73
|
+
controlMixin
|
|
74
|
+
],
|
|
59
75
|
props: {},
|
|
60
76
|
data () {
|
|
61
77
|
return {
|
|
@@ -65,6 +81,8 @@
|
|
|
65
81
|
computed: {
|
|
66
82
|
selfPropsObj () {
|
|
67
83
|
return {
|
|
84
|
+
_readonly: ["serialNumber"].includes(this.propsObj._type),
|
|
85
|
+
// _disabled: ["serialNumber"].includes(this.propsObj._type),
|
|
68
86
|
_showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
|
|
69
87
|
_autosize: {
|
|
70
88
|
minRows: 2
|
|
@@ -74,20 +92,14 @@
|
|
|
74
92
|
};
|
|
75
93
|
},
|
|
76
94
|
subType () {
|
|
77
|
-
return this.selfPropsObj._type
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
: undefined;
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
showVal () {
|
|
86
|
-
return this.value[this.controlKey] || "";
|
|
95
|
+
return ["serialNumber"].includes(this.selfPropsObj._type)
|
|
96
|
+
? "text"
|
|
97
|
+
: ["text", "textarea", "password", "url", "email", "number", "tel"].includes(this.selfPropsObj._type)
|
|
98
|
+
? this.selfPropsObj._type
|
|
99
|
+
: "text";
|
|
87
100
|
}
|
|
88
101
|
},
|
|
89
|
-
created () {
|
|
90
|
-
},
|
|
102
|
+
created () {},
|
|
91
103
|
methods: {
|
|
92
104
|
onSearch (...params) {
|
|
93
105
|
this.$emit("search", ...params);
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
:name="name"
|
|
49
49
|
:value="formatterValue"
|
|
50
50
|
:placeholder="placeholder"
|
|
51
|
-
:style="{textAlign:itemDisabled ? 'right':'left'}"
|
|
52
51
|
>
|
|
53
52
|
<slot name="suffix"></slot>
|
|
54
53
|
</div>
|
|
55
54
|
</div>
|
|
56
55
|
</template>
|
|
56
|
+
|
|
57
57
|
<script>
|
|
58
58
|
import { findComponentUpward } from "./utils/assist";
|
|
59
59
|
import Emitter from "./mixins/emitter";
|
|
@@ -1,55 +1,68 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<!--
|
|
4
|
-
<template v-if="
|
|
2
|
+
<div class="DshNumber">
|
|
3
|
+
<!-- 编辑 -->
|
|
4
|
+
<template v-if="canEdit">
|
|
5
5
|
<BriInputNumber
|
|
6
|
-
style="width: 100%"
|
|
7
|
-
:class="{
|
|
8
|
-
'DshNumber-readonly': $isReadonly(canEdit, selfPropsObj),
|
|
9
|
-
'DshNumber-disabled': $isDisabled(canEdit, selfPropsObj)
|
|
10
|
-
}"
|
|
11
6
|
v-model="value[controlKey]"
|
|
12
|
-
:placeholder="
|
|
7
|
+
:placeholder="selfPropsObj._placeholder"
|
|
13
8
|
:disabled="!finalCanEdit"
|
|
14
9
|
:formatter="formatterFunc"
|
|
15
10
|
:max="maxNum"
|
|
16
11
|
:min="minNum"
|
|
17
12
|
:precision="digit"
|
|
13
|
+
:numberAdjust="selfPropsObj._numberAdjust"
|
|
18
14
|
@on-change="change"
|
|
19
15
|
>
|
|
20
16
|
<div
|
|
21
17
|
v-if="unitStr"
|
|
22
18
|
slot="suffix"
|
|
23
|
-
|
|
19
|
+
class="DshNumber-suffix"
|
|
24
20
|
>
|
|
25
21
|
{{ unitStr }}
|
|
26
22
|
</div>
|
|
27
23
|
</BriInputNumber>
|
|
28
24
|
</template>
|
|
29
25
|
|
|
30
|
-
<!--
|
|
26
|
+
<!-- 查看 -->
|
|
31
27
|
<template v-else>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
<!-- 表格 里的查看 -->
|
|
29
|
+
<template v-if="isUnitShow">
|
|
30
|
+
<!-- 进度条模式 -->
|
|
31
|
+
<Progress
|
|
32
|
+
v-if="selfPropsObj._showProgress"
|
|
33
|
+
:percent="curVal > 100 ? 100 : toDecimal(curVal)"
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<!-- 文字模式 -->
|
|
37
|
+
<control-show
|
|
38
|
+
v-else
|
|
39
|
+
:showVal="showVal"
|
|
40
|
+
:emptyShowVal="emptyShowVal"
|
|
41
|
+
:propsObj="selfPropsObj"
|
|
42
|
+
></control-show>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<!-- 查看页 里的查看 -->
|
|
46
|
+
<template v-else>
|
|
47
|
+
<control-show
|
|
48
|
+
:showVal="showVal"
|
|
49
|
+
:emptyShowVal="emptyShowVal"
|
|
50
|
+
:propsObj="selfPropsObj"
|
|
51
|
+
></control-show>
|
|
52
|
+
</template>
|
|
42
53
|
</template>
|
|
43
54
|
</div>
|
|
44
55
|
</template>
|
|
45
56
|
|
|
46
57
|
<script>
|
|
47
|
-
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
48
58
|
import controlMixin from "../../controlMixin.js";
|
|
59
|
+
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
49
60
|
|
|
50
61
|
export default {
|
|
51
62
|
name: "DshNumber",
|
|
52
|
-
mixins: [
|
|
63
|
+
mixins: [
|
|
64
|
+
controlMixin
|
|
65
|
+
],
|
|
53
66
|
components: {
|
|
54
67
|
BriInputNumber
|
|
55
68
|
},
|
|
@@ -60,22 +73,26 @@
|
|
|
60
73
|
computed: {
|
|
61
74
|
selfPropsObj () {
|
|
62
75
|
return {
|
|
63
|
-
|
|
76
|
+
_numberAdjust: true,
|
|
77
|
+
...this.propsObj,
|
|
78
|
+
...this.commonDealPropsObj
|
|
64
79
|
};
|
|
65
80
|
},
|
|
66
81
|
formatterFunc () {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return value => `${value}`;
|
|
71
|
-
}
|
|
82
|
+
return this.separator
|
|
83
|
+
? this.$numToSeparator
|
|
84
|
+
: value => `${value}`;
|
|
72
85
|
},
|
|
73
86
|
|
|
74
87
|
maxNum () {
|
|
75
|
-
return this.selfPropsObj._max || this.selfPropsObj._max === 0
|
|
88
|
+
return this.selfPropsObj._max || this.selfPropsObj._max === 0
|
|
89
|
+
? this.selfPropsObj._max
|
|
90
|
+
: Infinity;
|
|
76
91
|
},
|
|
77
92
|
minNum () {
|
|
78
|
-
return this.selfPropsObj._min || this.selfPropsObj._min === 0
|
|
93
|
+
return this.selfPropsObj._min || this.selfPropsObj._min === 0
|
|
94
|
+
? this.selfPropsObj._min
|
|
95
|
+
: -Infinity;
|
|
79
96
|
},
|
|
80
97
|
// round, decimal, 为其他值不处理
|
|
81
98
|
round () {
|
|
@@ -111,24 +128,11 @@
|
|
|
111
128
|
},
|
|
112
129
|
created () {},
|
|
113
130
|
methods: {
|
|
114
|
-
toDecimal (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
f = Math.round(x * 100) / 100;
|
|
120
|
-
return f;
|
|
131
|
+
toDecimal (num) {
|
|
132
|
+
return isNaN(parseFloat(num))
|
|
133
|
+
? undefined
|
|
134
|
+
: Math.round(num * 100) / 100;
|
|
121
135
|
}
|
|
122
136
|
}
|
|
123
137
|
};
|
|
124
138
|
</script>
|
|
125
|
-
|
|
126
|
-
<style lang="less">
|
|
127
|
-
.DshNumber {
|
|
128
|
-
width: 100%;
|
|
129
|
-
|
|
130
|
-
.ivu-input-number-disabled .ivu-input-number-input {
|
|
131
|
-
color:#999;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
</style>
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
<!-- 最小值 -->
|
|
5
5
|
<div class="DshNumberange-left">
|
|
6
6
|
<BriInputNumber
|
|
7
|
-
style="width: 100%;"
|
|
8
|
-
:class="{
|
|
9
|
-
'DshNumberange-left-readonly': $isReadonly(canEdit, propsObj),
|
|
10
|
-
'DshNumberange-left-disabled': $isDisabled(canEdit, propsObj)
|
|
11
|
-
}"
|
|
12
7
|
v-model="value[propsObj._key][0]"
|
|
13
|
-
:placeholder="
|
|
8
|
+
:placeholder="selfPropsObj._placeholder ? `${selfPropsObj._placeholder}最小值` : ''"
|
|
14
9
|
:disabled="!finalCanEdit"
|
|
15
10
|
:formatter="formatterFunc"
|
|
16
11
|
:max="maxNum"
|
|
@@ -22,7 +17,7 @@
|
|
|
22
17
|
<div
|
|
23
18
|
v-if="unitStr"
|
|
24
19
|
slot="suffix"
|
|
25
|
-
|
|
20
|
+
class="DshNumberange-suffix"
|
|
26
21
|
>
|
|
27
22
|
{{ unitStr }}
|
|
28
23
|
</div>
|
|
@@ -35,13 +30,8 @@
|
|
|
35
30
|
<!-- 最大值 -->
|
|
36
31
|
<div class="DshNumberange-right">
|
|
37
32
|
<BriInputNumber
|
|
38
|
-
style="width: 100%;"
|
|
39
|
-
:class="{
|
|
40
|
-
'DshNumberange-right-readonly': $isReadonly(canEdit, propsObj),
|
|
41
|
-
'DshNumberange-right-disabled': $isDisabled(canEdit, propsObj)
|
|
42
|
-
}"
|
|
43
33
|
v-model="value[propsObj._key][1]"
|
|
44
|
-
:placeholder="
|
|
34
|
+
:placeholder="selfPropsObj._placeholder ? `${selfPropsObj._placeholder}最大值` : ''"
|
|
45
35
|
:disabled="!finalCanEdit"
|
|
46
36
|
:max="maxNum"
|
|
47
37
|
:min="minNum"
|
|
@@ -52,7 +42,7 @@
|
|
|
52
42
|
<div
|
|
53
43
|
v-if="unitStr"
|
|
54
44
|
slot="suffix"
|
|
55
|
-
|
|
45
|
+
class="DshNumberange-suffix"
|
|
56
46
|
>
|
|
57
47
|
{{ unitStr }}
|
|
58
48
|
</div>
|
|
@@ -67,7 +57,9 @@
|
|
|
67
57
|
|
|
68
58
|
export default {
|
|
69
59
|
name: "DshNumberange",
|
|
70
|
-
mixins: [
|
|
60
|
+
mixins: [
|
|
61
|
+
controlMixin
|
|
62
|
+
],
|
|
71
63
|
components: {
|
|
72
64
|
BriInputNumber
|
|
73
65
|
},
|
|
@@ -78,9 +70,11 @@
|
|
|
78
70
|
computed: {
|
|
79
71
|
selfPropsObj () {
|
|
80
72
|
return {
|
|
81
|
-
...this.propsObj
|
|
73
|
+
...this.propsObj,
|
|
74
|
+
...this.commonDealPropsObj
|
|
82
75
|
};
|
|
83
76
|
},
|
|
77
|
+
|
|
84
78
|
formatterFunc () {
|
|
85
79
|
if (this.propsObj._separator) {
|
|
86
80
|
return this.$numToSeparator;
|
|
@@ -128,10 +122,6 @@
|
|
|
128
122
|
}
|
|
129
123
|
},
|
|
130
124
|
created () {},
|
|
131
|
-
methods: {
|
|
132
|
-
change (...params) {
|
|
133
|
-
this.$emit("change", ...params);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
125
|
+
methods: {}
|
|
136
126
|
};
|
|
137
127
|
</script>
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
:class="{
|
|
9
9
|
'DshSelect-radioGroup': true,
|
|
10
10
|
'DshSelect-radioGroup-useColor': selfPropsObj._useColor,
|
|
11
|
-
'DshSelect-radioGroup-readonly': $isReadonly(canEdit, selfPropsObj),
|
|
12
|
-
'DshSelect-radioGroup-disabled': $isDisabled(canEdit, selfPropsObj),
|
|
13
11
|
'DshSelect-radioGroup-scroll': selfPropsObj._span < 24 && !selfPropsObj._br
|
|
14
12
|
}"
|
|
15
13
|
v-model="value[controlKey]"
|
|
@@ -48,10 +46,6 @@
|
|
|
48
46
|
<Select
|
|
49
47
|
v-else
|
|
50
48
|
v-model="value[controlKey]"
|
|
51
|
-
:class="{
|
|
52
|
-
'DshSelect-select-readonly': $isReadonly(canEdit, selfPropsObj),
|
|
53
|
-
'DshSelect-select-disabled': $isDisabled(canEdit, selfPropsObj)
|
|
54
|
-
}"
|
|
55
49
|
:placeholder="selfPropsObj._placeholder"
|
|
56
50
|
:multiple="selfPropsObj._multiple"
|
|
57
51
|
:disabled="!finalCanEdit"
|
|
@@ -89,13 +83,13 @@
|
|
|
89
83
|
>
|
|
90
84
|
<div
|
|
91
85
|
v-if="curSelectItem"
|
|
92
|
-
class="
|
|
86
|
+
class="DshSelect-value-wrapper"
|
|
93
87
|
:style="{
|
|
94
88
|
justifyContent: flatShowAlign
|
|
95
89
|
}"
|
|
96
90
|
>
|
|
97
91
|
<span
|
|
98
|
-
class="
|
|
92
|
+
class="DshSelect-value dsh-ellipsis"
|
|
99
93
|
:style="{
|
|
100
94
|
background: selfPropsObj._useColor ? getBgColor(curSelectItem.color, 0.1) : '',
|
|
101
95
|
color: selfPropsObj._useColor ? getColor(curSelectItem.color) : ''
|
|
@@ -104,14 +98,9 @@
|
|
|
104
98
|
</div>
|
|
105
99
|
<div
|
|
106
100
|
v-else
|
|
107
|
-
class="control-
|
|
101
|
+
class="control-notext dsh-ellipsis"
|
|
108
102
|
>
|
|
109
|
-
|
|
110
|
-
-
|
|
111
|
-
</template>
|
|
112
|
-
<template v-else>
|
|
113
|
-
暂无内容
|
|
114
|
-
</template>
|
|
103
|
+
{{ emptyShowVal }}
|
|
115
104
|
</div>
|
|
116
105
|
</Ctooltip>
|
|
117
106
|
|
|
@@ -127,7 +116,10 @@
|
|
|
127
116
|
|
|
128
117
|
export default {
|
|
129
118
|
name: "DshSelect",
|
|
130
|
-
mixins: [
|
|
119
|
+
mixins: [
|
|
120
|
+
controlMixin,
|
|
121
|
+
selectMixin
|
|
122
|
+
],
|
|
131
123
|
props: {},
|
|
132
124
|
data () {
|
|
133
125
|
return {
|
|
@@ -186,7 +178,11 @@
|
|
|
186
178
|
return this.valStr;
|
|
187
179
|
},
|
|
188
180
|
flatShowAlign () {
|
|
189
|
-
return !this.propsObj._align || this.propsObj._align
|
|
181
|
+
return !this.propsObj._align || this.propsObj._align === "left" || !this.isUnitShow
|
|
182
|
+
? "flex-start"
|
|
183
|
+
: this.propsObj._align === "right"
|
|
184
|
+
? "flex-end"
|
|
185
|
+
: "center";
|
|
190
186
|
}
|
|
191
187
|
},
|
|
192
188
|
created () {
|
|
@@ -16,8 +16,8 @@ const componentNameMap = {
|
|
|
16
16
|
phone: "DshInput",
|
|
17
17
|
url: "DshInput",
|
|
18
18
|
password: "DshInput",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
serialNumber: "DshInput",
|
|
20
|
+
texts: "BriInputs",
|
|
21
21
|
number: "DshNumber",
|
|
22
22
|
numberange: "DshNumberange",
|
|
23
23
|
date: "DshDate",
|
|
@@ -29,10 +29,11 @@ const componentNameMap = {
|
|
|
29
29
|
regions: "DshCascader",
|
|
30
30
|
cascader: "DshCascader",
|
|
31
31
|
cascaders: "DshCascader",
|
|
32
|
-
file: "
|
|
32
|
+
file: "BriUpload",
|
|
33
33
|
coordinates: "DshCoordinates",
|
|
34
34
|
editor: "DshEditor",
|
|
35
35
|
tag: "DshDivider",
|
|
36
|
+
|
|
36
37
|
labels: "BriLabels",
|
|
37
38
|
package: "DshPackage",
|
|
38
39
|
flatTable: "flatTable",
|
|
@@ -48,8 +49,7 @@ const componentNameMap = {
|
|
|
48
49
|
const pathMap = {
|
|
49
50
|
base: {
|
|
50
51
|
// DshInput: "./base/DshInput.vue", // 全局已注册
|
|
51
|
-
|
|
52
|
-
YSerialNumber: "./base/YSerialNumber.vue",
|
|
52
|
+
BriInputs: "./base/BriInputs.vue",
|
|
53
53
|
// DshNumber: "./base/DshNumber/DshNumber.vue", // 全局已注册
|
|
54
54
|
DshNumberange: "./base/DshNumberange.vue",
|
|
55
55
|
DshDate: "./base/DshDate.vue",
|
|
@@ -57,18 +57,19 @@ const pathMap = {
|
|
|
57
57
|
DshSwitch: "./base/DshSwitch.vue",
|
|
58
58
|
// DshSelect: "./base/DshSelect.vue", // 全局已注册
|
|
59
59
|
// DshCheckbox: "./base/DshCheckbox.vue", // 全局已注册
|
|
60
|
-
// DshCascader: "./base/DshCascader.vue", // 全局已注册
|
|
61
|
-
|
|
60
|
+
// DshCascader: "./base/DshCascader/DshCascader.vue", // 全局已注册
|
|
61
|
+
BriUpload: "./base/BriUpload/index.vue",
|
|
62
62
|
DshCoordinates: "./base/DshCoordinates.vue",
|
|
63
63
|
DshEditor: "./base/DshEditor.vue",
|
|
64
64
|
DshDivider: "./base/DshDivider.vue",
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
|
|
66
|
+
BriLabels: "./senior/BriLabels.vue",
|
|
67
|
+
DshPackage: "./senior/DshPackage.vue",
|
|
67
68
|
flatTable: "./senior/flatTable.vue",
|
|
68
69
|
cascaderTable: "./senior/cascaderTable",
|
|
69
70
|
|
|
70
|
-
DshBack: "./
|
|
71
|
-
DshUndeveloped: "./
|
|
71
|
+
DshBack: "./special/DshBack.vue",
|
|
72
|
+
DshUndeveloped: "./special/DshUndeveloped.vue"
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import controlShow from "./controlShow.vue";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
4
|
+
components: {
|
|
5
|
+
controlShow
|
|
6
|
+
},
|
|
2
7
|
props: {
|
|
8
|
+
canEdit: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: true
|
|
11
|
+
},
|
|
3
12
|
value: {
|
|
4
13
|
type: Object,
|
|
5
14
|
default () {
|
|
@@ -13,16 +22,15 @@ export default {
|
|
|
13
22
|
}
|
|
14
23
|
},
|
|
15
24
|
|
|
16
|
-
/*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
+
/* 表单形式下用到的 */
|
|
26
|
+
// 暂时是dshDate里在用,时间对比时需要用其他时间字段
|
|
27
|
+
allFormList: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default () {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
25
32
|
},
|
|
33
|
+
/* 列表形式下用到的 */
|
|
26
34
|
parentData: {
|
|
27
35
|
type: Array,
|
|
28
36
|
default () {
|
|
@@ -40,35 +48,47 @@ export default {
|
|
|
40
48
|
curVal () {
|
|
41
49
|
return this.value[this.controlKey];
|
|
42
50
|
},
|
|
51
|
+
emptyShowVal () {
|
|
52
|
+
return this.isUnitShow ? "--" : "暂无内容";
|
|
53
|
+
},
|
|
43
54
|
showText () {
|
|
44
|
-
return this.curVal ||
|
|
55
|
+
return this.curVal || this.emptyShowVal;
|
|
45
56
|
},
|
|
46
57
|
|
|
58
|
+
isUnitShow () {
|
|
59
|
+
return !this.canEdit && this.inTable;
|
|
60
|
+
},
|
|
47
61
|
finalCanEdit () {
|
|
48
|
-
return this
|
|
62
|
+
return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
|
|
49
63
|
},
|
|
50
64
|
commonDealPropsObj () {
|
|
51
65
|
const selectControlTypes = ["date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "coordinates", "users", "departments"];
|
|
52
66
|
return {
|
|
53
67
|
// TODO: 此处的请输入可能还有请选择之类的,待处理
|
|
54
|
-
_placeholder: this
|
|
68
|
+
_placeholder: this.canEdit && this.propsObj._enterType !== "calculate"
|
|
55
69
|
? (this.propsObj._placeholder || `请${selectControlTypes.includes(this.propsObj._type) ? "选择" : "输入"}${this.propsObj._name}`)
|
|
56
|
-
:
|
|
70
|
+
: undefined,
|
|
57
71
|
_clearable: this.finalCanEdit && (this.propsObj._clearable === undefined ? true : this.propsObj._clearable)
|
|
58
72
|
};
|
|
59
73
|
},
|
|
60
74
|
commonClass () {
|
|
61
75
|
return {
|
|
62
76
|
"dsh-ellipsis": true,
|
|
63
|
-
"control-edit": this.finalCanEdit,
|
|
64
|
-
"control-disabled": this
|
|
65
|
-
|
|
66
|
-
"control-show": !this.canEdit,
|
|
67
|
-
"control-notext":
|
|
77
|
+
"control-edit": this.canEdit && this.finalCanEdit,
|
|
78
|
+
"control-disabled": this.canEdit && !this.finalCanEdit,
|
|
79
|
+
"control-unit": !this.canEdit && this.isUnitShow,
|
|
80
|
+
"control-show": !this.canEdit && !this.isUnitShow,
|
|
81
|
+
"control-notext": this.$isEmptyData(this.curVal)
|
|
68
82
|
};
|
|
69
83
|
},
|
|
70
84
|
|
|
71
85
|
// 部分控件或部分条件下 才使用的属性
|
|
86
|
+
inTable () {
|
|
87
|
+
return !!this.propsObj.inTable;
|
|
88
|
+
},
|
|
89
|
+
isShare () {
|
|
90
|
+
return !!this.propsObj.isShare;
|
|
91
|
+
},
|
|
72
92
|
compKey () {
|
|
73
93
|
return this.propsObj.compKey;
|
|
74
94
|
},
|
|
@@ -77,23 +97,14 @@ export default {
|
|
|
77
97
|
},
|
|
78
98
|
entityKey () {
|
|
79
99
|
return this.propsObj.entityKey;
|
|
80
|
-
},
|
|
81
|
-
inTable () {
|
|
82
|
-
return !!this.propsObj.inTable;
|
|
83
|
-
},
|
|
84
|
-
stopModInit () {
|
|
85
|
-
return this.inTable;
|
|
86
|
-
},
|
|
87
|
-
isShare () {
|
|
88
|
-
return !!this.propsObj.isShare;
|
|
89
100
|
}
|
|
90
101
|
},
|
|
91
102
|
methods: {
|
|
92
103
|
change (...params) {
|
|
93
|
-
this.$emit("change", this.
|
|
104
|
+
this.$emit("change", this.curVal);
|
|
94
105
|
},
|
|
95
106
|
refChange (...params) {
|
|
96
|
-
this.$emit("refChange", this.
|
|
107
|
+
this.$emit("refChange", this.curVal);
|
|
97
108
|
}
|
|
98
109
|
}
|
|
99
110
|
};
|