bri-components 1.1.2 → 1.1.3
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/package.json +1 -1
- package/src/components/controls/base/DshCascader.vue +14 -11
- package/src/components/controls/base/DshCascaderMultiple.vue +13 -4
- package/src/components/controls/base/DshCheckbox.vue +16 -19
- package/src/components/controls/base/DshCoordinates.vue +9 -8
- 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 +72 -59
- package/src/components/controls/base/DshInput.vue +66 -59
- package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +1 -1
- package/src/components/controls/base/DshNumber/DshNumber.vue +50 -48
- package/src/components/controls/base/DshNumberange.vue +11 -21
- package/src/components/controls/base/DshSelect.vue +12 -16
- package/src/components/controls/base/YSerialNumber.vue +10 -3
- package/src/components/controls/base/ZUpload/index.vue +16 -12
- package/src/components/controls/base/ZUpload/upload-list.vue +20 -13
- package/src/components/controls/base/ZUpload/uploadMixin.js +5 -1
- package/src/components/controls/base/textMultiple/DshTextMultiple.vue +13 -5
- package/src/components/controls/base/textMultiple/MultipleInput.vue +5 -5
- package/src/components/controls/controlMap.js +6 -4
- package/src/components/controls/controlMixin.js +36 -26
- 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/DshCard.vue +2 -2
- package/src/components/list/DshBox/DshCrossTable.vue +4 -8
- package/src/components/list/DshCascaderTable.vue +1 -1
- package/src/components/small/DshControlDefine.vue +1 -1
- package/src/components/small/DshModal.vue +0 -134
- 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 +5 -10
- package/src/styles/common/control.less +49 -12
- package/src/styles/components/controls/BriLabels.less +4 -2
- package/src/styles/components/controls/DshCheckbox.less +45 -42
- package/src/styles/components/controls/DshCoordinates.less +24 -27
- 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 +33 -0
- package/src/styles/components/controls/DshNumberange.less +8 -3
- package/src/styles/components/controls/DshSelect.less +78 -92
- package/src/styles/components/controls/ZUpload.less +1 -2
- 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 +2 -1
- package/src/styles/components/other/InfoCascader.less +4 -4
- 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/utils/table.js +3 -3
- package/src/components/controls/base/DshLabels.vue +0 -309
- package/src/components/controls/base/controlShow.vue +0 -52
- package/src/styles/components/controls/DshLabels.less +0 -187
|
@@ -1,52 +1,65 @@
|
|
|
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
|
-
slot="prepend"
|
|
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
|
+
:disabled="!finalCanEdit"
|
|
10
|
+
:clearable="selfPropsObj._clearable"
|
|
11
|
+
:size="selfPropsObj._size"
|
|
12
|
+
:rows="selfPropsObj._rows"
|
|
13
|
+
:search="selfPropsObj._search"
|
|
14
|
+
:show-word-limit="selfPropsObj._showWordLimit"
|
|
15
|
+
:maxlength="selfPropsObj._maxlength"
|
|
16
|
+
:autosize="selfPropsObj._autosize"
|
|
17
|
+
@on-enter="onEnter"
|
|
18
|
+
@on-search="onSearch"
|
|
19
|
+
@on-focus="onFocus"
|
|
20
|
+
@on-change="onChange"
|
|
21
|
+
@on-blur="onBlur"
|
|
22
|
+
@on-clear="onClear"
|
|
23
|
+
>
|
|
24
|
+
<span
|
|
25
|
+
v-if="selfPropsObj._prepend"
|
|
26
|
+
slot="prepend"
|
|
27
|
+
>{{ selfPropsObj._prepend }}</span>
|
|
42
28
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
<span
|
|
30
|
+
v-if="selfPropsObj._append"
|
|
31
|
+
slot="append"
|
|
32
|
+
>{{ selfPropsObj._append }}</span>
|
|
33
|
+
</Input>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<!-- 查看 -->
|
|
37
|
+
<template v-else>
|
|
38
|
+
<!-- 表格 里的查看 -->
|
|
39
|
+
<template v-if="isUnitShow">
|
|
40
|
+
<control-show
|
|
41
|
+
:showVal="curVal"
|
|
42
|
+
:emptyShowVal="emptyShowVal"
|
|
43
|
+
:propsObj="selfPropsObj"
|
|
44
|
+
></control-show>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<!-- 查看页 里的查看 (textarea单独处理) -->
|
|
48
|
+
<template v-else>
|
|
49
|
+
<p
|
|
50
|
+
v-if="subType === 'textarea' && curVal"
|
|
51
|
+
class="DshInput-show-textarea"
|
|
52
|
+
v-text="curVal"
|
|
53
|
+
></p>
|
|
54
|
+
|
|
55
|
+
<control-show
|
|
56
|
+
v-else
|
|
57
|
+
:showVal="curVal"
|
|
58
|
+
:emptyShowVal="emptyShowVal"
|
|
59
|
+
:propsObj="selfPropsObj"
|
|
60
|
+
></control-show>
|
|
61
|
+
</template>
|
|
62
|
+
</template>
|
|
50
63
|
</div>
|
|
51
64
|
</template>
|
|
52
65
|
|
|
@@ -55,7 +68,9 @@
|
|
|
55
68
|
|
|
56
69
|
export default {
|
|
57
70
|
name: "DshInput",
|
|
58
|
-
mixins: [
|
|
71
|
+
mixins: [
|
|
72
|
+
controlMixin
|
|
73
|
+
],
|
|
59
74
|
props: {},
|
|
60
75
|
data () {
|
|
61
76
|
return {
|
|
@@ -74,20 +89,12 @@
|
|
|
74
89
|
};
|
|
75
90
|
},
|
|
76
91
|
subType () {
|
|
77
|
-
return this.selfPropsObj._type
|
|
78
|
-
|
|
79
|
-
inputType () {
|
|
80
|
-
return ["text", "password", "textarea", "url", "email", "number", "tel"].includes(this.subType)
|
|
81
|
-
? this.subType
|
|
92
|
+
return ["text", "password", "textarea", "url", "email", "number", "tel"].includes(this.selfPropsObj._type)
|
|
93
|
+
? this.selfPropsObj._type
|
|
82
94
|
: undefined;
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
showVal () {
|
|
86
|
-
return this.value[this.controlKey] || "";
|
|
87
95
|
}
|
|
88
96
|
},
|
|
89
|
-
created () {
|
|
90
|
-
},
|
|
97
|
+
created () {},
|
|
91
98
|
methods: {
|
|
92
99
|
onSearch (...params) {
|
|
93
100
|
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,15 +1,10 @@
|
|
|
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"
|
|
@@ -20,36 +15,53 @@
|
|
|
20
15
|
<div
|
|
21
16
|
v-if="unitStr"
|
|
22
17
|
slot="suffix"
|
|
23
|
-
|
|
18
|
+
class="DshNumber-suffix"
|
|
24
19
|
>
|
|
25
20
|
{{ unitStr }}
|
|
26
21
|
</div>
|
|
27
22
|
</BriInputNumber>
|
|
28
23
|
</template>
|
|
29
24
|
|
|
30
|
-
<!--
|
|
25
|
+
<!-- 查看 -->
|
|
31
26
|
<template v-else>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
<!-- 表格 里的查看 -->
|
|
28
|
+
<template v-if="isUnitShow">
|
|
29
|
+
<!-- 进度条模式 -->
|
|
30
|
+
<Progress
|
|
31
|
+
v-if="selfPropsObj._showProgress"
|
|
32
|
+
:percent="curVal > 100 ? 100 : toDecimal(curVal)"
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
<!-- 文字模式 -->
|
|
36
|
+
<control-show
|
|
37
|
+
v-else
|
|
38
|
+
:showVal="showVal"
|
|
39
|
+
:emptyShowVal="emptyShowVal"
|
|
40
|
+
:propsObj="selfPropsObj"
|
|
41
|
+
></control-show>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<!-- 查看页 里的查看 -->
|
|
45
|
+
<template v-else>
|
|
46
|
+
<control-show
|
|
47
|
+
:showVal="showVal"
|
|
48
|
+
:emptyShowVal="emptyShowVal"
|
|
49
|
+
:propsObj="selfPropsObj"
|
|
50
|
+
></control-show>
|
|
51
|
+
</template>
|
|
42
52
|
</template>
|
|
43
53
|
</div>
|
|
44
54
|
</template>
|
|
45
55
|
|
|
46
56
|
<script>
|
|
47
|
-
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
48
57
|
import controlMixin from "../../controlMixin.js";
|
|
58
|
+
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
49
59
|
|
|
50
60
|
export default {
|
|
51
61
|
name: "DshNumber",
|
|
52
|
-
mixins: [
|
|
62
|
+
mixins: [
|
|
63
|
+
controlMixin
|
|
64
|
+
],
|
|
53
65
|
components: {
|
|
54
66
|
BriInputNumber
|
|
55
67
|
},
|
|
@@ -60,22 +72,25 @@
|
|
|
60
72
|
computed: {
|
|
61
73
|
selfPropsObj () {
|
|
62
74
|
return {
|
|
63
|
-
...this.propsObj
|
|
75
|
+
...this.propsObj,
|
|
76
|
+
...this.commonDealPropsObj
|
|
64
77
|
};
|
|
65
78
|
},
|
|
66
79
|
formatterFunc () {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return value => `${value}`;
|
|
71
|
-
}
|
|
80
|
+
return this.separator
|
|
81
|
+
? this.$numToSeparator
|
|
82
|
+
: value => `${value}`;
|
|
72
83
|
},
|
|
73
84
|
|
|
74
85
|
maxNum () {
|
|
75
|
-
return this.selfPropsObj._max || this.selfPropsObj._max === 0
|
|
86
|
+
return this.selfPropsObj._max || this.selfPropsObj._max === 0
|
|
87
|
+
? this.selfPropsObj._max
|
|
88
|
+
: Infinity;
|
|
76
89
|
},
|
|
77
90
|
minNum () {
|
|
78
|
-
return this.selfPropsObj._min || this.selfPropsObj._min === 0
|
|
91
|
+
return this.selfPropsObj._min || this.selfPropsObj._min === 0
|
|
92
|
+
? this.selfPropsObj._min
|
|
93
|
+
: -Infinity;
|
|
79
94
|
},
|
|
80
95
|
// round, decimal, 为其他值不处理
|
|
81
96
|
round () {
|
|
@@ -111,24 +126,11 @@
|
|
|
111
126
|
},
|
|
112
127
|
created () {},
|
|
113
128
|
methods: {
|
|
114
|
-
toDecimal (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
f = Math.round(x * 100) / 100;
|
|
120
|
-
return f;
|
|
129
|
+
toDecimal (num) {
|
|
130
|
+
return isNaN(parseFloat(num))
|
|
131
|
+
? undefined
|
|
132
|
+
: Math.round(num * 100) / 100;
|
|
121
133
|
}
|
|
122
134
|
}
|
|
123
135
|
};
|
|
124
136
|
</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) : ''
|
|
@@ -106,12 +100,7 @@
|
|
|
106
100
|
v-else
|
|
107
101
|
class="control-nodata-text 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 () {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div class="YSerialNumber">
|
|
3
3
|
<dsh-input
|
|
4
4
|
:value="value"
|
|
5
|
-
:propsObj="
|
|
6
|
-
:canEdit="
|
|
5
|
+
:propsObj="selfPropsObj"
|
|
6
|
+
:canEdit="canEdit"
|
|
7
7
|
></dsh-input>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
@@ -18,7 +18,14 @@
|
|
|
18
18
|
data () {
|
|
19
19
|
return {};
|
|
20
20
|
},
|
|
21
|
-
computed: {
|
|
21
|
+
computed: {
|
|
22
|
+
selfPropsObj () {
|
|
23
|
+
return {
|
|
24
|
+
...this.propsObj,
|
|
25
|
+
canEdit: false
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
},
|
|
22
29
|
created () {},
|
|
23
30
|
methods: {}
|
|
24
31
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<y-upload-image
|
|
3
3
|
v-if="propsObj._kind === 'uploadImage'"
|
|
4
|
-
:propsObj="propsObj"
|
|
5
4
|
:value="value"
|
|
6
5
|
ossType="putUpload"
|
|
6
|
+
:propsObj="propsObj"
|
|
7
7
|
@change="change"
|
|
8
8
|
></y-upload-image>
|
|
9
9
|
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
prefixCls,
|
|
14
14
|
'ZUpload',
|
|
15
15
|
`ZUpload-${showType}`,
|
|
16
|
-
{
|
|
17
|
-
|
|
16
|
+
{
|
|
17
|
+
'ZUpload-readonly': !canEdit,
|
|
18
|
+
'ZUpload-disabled': !finalCanEdit
|
|
19
|
+
}
|
|
18
20
|
]"
|
|
19
21
|
>
|
|
20
22
|
<!-- 上传 -->
|
|
@@ -62,17 +64,16 @@
|
|
|
62
64
|
</div>
|
|
63
65
|
</slot>
|
|
64
66
|
</div>
|
|
67
|
+
|
|
65
68
|
<!-- 列表 -->
|
|
66
69
|
<slot name="list">
|
|
67
70
|
<upload-list
|
|
68
71
|
v-if="showUploadList"
|
|
69
|
-
:
|
|
70
|
-
:showType="showType"
|
|
72
|
+
:canEdit="finalCanEdit"
|
|
71
73
|
:files="val"
|
|
72
|
-
:
|
|
73
|
-
:
|
|
74
|
-
:
|
|
75
|
-
:isUnit="isUnit"
|
|
74
|
+
:emptyShowVal="emptyShowVal"
|
|
75
|
+
:showType="showType"
|
|
76
|
+
:propsObj="propsObj"
|
|
76
77
|
@on-file-remove="handleRemove"
|
|
77
78
|
@on-file-preview="handlePreview"
|
|
78
79
|
></upload-list>
|
|
@@ -81,15 +82,18 @@
|
|
|
81
82
|
</template>
|
|
82
83
|
|
|
83
84
|
<script>
|
|
84
|
-
import YUploadImage from "./YUploadImage.vue";
|
|
85
|
-
import uploadList from "./upload-list.vue";
|
|
86
85
|
import controlMixin from "../../controlMixin.js";
|
|
87
86
|
import uploadMixin from "./uploadMixin.js";
|
|
87
|
+
import YUploadImage from "./YUploadImage.vue";
|
|
88
|
+
import uploadList from "./upload-list.vue";
|
|
88
89
|
|
|
89
90
|
const prefixCls = "ivu-upload";
|
|
90
91
|
export default {
|
|
91
92
|
name: "Upload",
|
|
92
|
-
mixins: [
|
|
93
|
+
mixins: [
|
|
94
|
+
controlMixin,
|
|
95
|
+
uploadMixin
|
|
96
|
+
],
|
|
93
97
|
components: {
|
|
94
98
|
YUploadImage,
|
|
95
99
|
uploadList
|
|
@@ -90,10 +90,14 @@
|
|
|
90
90
|
></dsh-icons>
|
|
91
91
|
</div>
|
|
92
92
|
</div>
|
|
93
|
-
<span
|
|
93
|
+
<span
|
|
94
|
+
v-else
|
|
95
|
+
class="uploadList-inline-nodata"
|
|
96
|
+
>{{ noText }}</span>
|
|
94
97
|
</template>
|
|
95
98
|
</div>
|
|
96
99
|
</template>
|
|
100
|
+
|
|
97
101
|
<script>
|
|
98
102
|
import Viewer from "viewerjs";
|
|
99
103
|
import axios from "axios";
|
|
@@ -101,6 +105,10 @@
|
|
|
101
105
|
export default {
|
|
102
106
|
name: "uploadList",
|
|
103
107
|
props: {
|
|
108
|
+
canEdit: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: true
|
|
111
|
+
},
|
|
104
112
|
files: {
|
|
105
113
|
type: Array,
|
|
106
114
|
default () {
|
|
@@ -111,11 +119,13 @@
|
|
|
111
119
|
type: String,
|
|
112
120
|
default: "old" // inline, old, normal
|
|
113
121
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
emptyShowVal: String,
|
|
123
|
+
propsObj: {
|
|
124
|
+
type: Object,
|
|
125
|
+
default () {
|
|
126
|
+
return {};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
119
129
|
},
|
|
120
130
|
computed: {
|
|
121
131
|
operationMap () {
|
|
@@ -125,7 +135,7 @@
|
|
|
125
135
|
icon: "ios-trash-outline",
|
|
126
136
|
size: "16",
|
|
127
137
|
event: "handleRemove",
|
|
128
|
-
canShow: this.
|
|
138
|
+
canShow: this.canEdit
|
|
129
139
|
},
|
|
130
140
|
download: {
|
|
131
141
|
name: "下载",
|
|
@@ -151,19 +161,16 @@
|
|
|
151
161
|
if (this.files && this.files.length) {
|
|
152
162
|
return "";
|
|
153
163
|
} else {
|
|
154
|
-
if (this.
|
|
164
|
+
if (this.canEdit) {
|
|
155
165
|
return `未上传${this.propsObj._fileType === "image" ? "图片" : "文件"} `;
|
|
156
|
-
} else if (this.isUnit) {
|
|
157
|
-
return "-";
|
|
158
166
|
} else {
|
|
159
|
-
return
|
|
167
|
+
return this.emptyShowVal;
|
|
160
168
|
}
|
|
161
169
|
}
|
|
162
170
|
}
|
|
163
171
|
},
|
|
164
172
|
data () {
|
|
165
|
-
return {
|
|
166
|
-
};
|
|
173
|
+
return {};
|
|
167
174
|
},
|
|
168
175
|
methods: {
|
|
169
176
|
getBtns (canPreview) {
|
|
@@ -97,7 +97,11 @@ export default {
|
|
|
97
97
|
}
|
|
98
98
|
})
|
|
99
99
|
.then(response => {
|
|
100
|
-
|
|
100
|
+
const newResponse = {
|
|
101
|
+
data: response,
|
|
102
|
+
res: {}
|
|
103
|
+
};
|
|
104
|
+
this.handleSuccess && this.handleSuccess(newResponse, newResponse.data, file);
|
|
101
105
|
callback && callback(response.data);
|
|
102
106
|
}).catch(error => {
|
|
103
107
|
this.handleError && this.handleError(error, {}, file);
|