gyyg-components 0.3.24 → 0.3.26
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/gyyg-components.common.js +105 -105
- package/lib/gyyg-components.umd.js +105 -105
- package/lib/gyyg-components.umd.min.js +105 -105
- package/package.json +1 -1
- package/src/components/MECDefaultText/MECDefaultText.vue +2 -2
- package/src/components/MecButtonGroup/MecButtonGroup.vue +121 -140
- package/src/components/MecForm/MecForm.vue +1 -2
- package/src/components/MecRadio/MecRadio.vue +9 -0
- package/src/components/MecTable/MecTable.vue +1 -1
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="textType == 'littleTitle' ? 'title' : ''" :style="
|
|
2
|
+
<div :class="textType == 'littleTitle' ? 'title' : ''" :style="customStyle">{{ value }}</div>
|
|
3
3
|
</template>
|
|
4
4
|
<script>
|
|
5
5
|
export default {
|
|
6
6
|
name: 'mec-defaultText',
|
|
7
|
-
props:['value', 'textType', '
|
|
7
|
+
props:['value', 'textType', 'customStyle']
|
|
8
8
|
}
|
|
9
9
|
</script>
|
|
10
10
|
<style lang="less" scoped>
|
|
@@ -1,171 +1,152 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:loading="btn.loading"
|
|
25
|
-
@click="btnClick(btn)"
|
|
26
|
-
>{{ btn.text }}
|
|
27
|
-
<i
|
|
28
|
-
v-if="btn.rightIcon"
|
|
29
|
-
:class="btn.icon + ' el-icon--right'"
|
|
30
|
-
></i>
|
|
31
|
-
</el-button>
|
|
32
|
-
<div v-else>
|
|
33
|
-
<component
|
|
34
|
-
:is="btn['componentType']"
|
|
35
|
-
:btnInfo="btn"
|
|
36
|
-
></component>
|
|
37
|
-
</div>
|
|
38
|
-
</el-badge>
|
|
39
|
-
</template>
|
|
40
|
-
<template v-else>
|
|
41
|
-
<el-button
|
|
42
|
-
v-if="!btn['componentType']"
|
|
43
|
-
:disabled="btn.disabled"
|
|
44
|
-
:size="btn.size || 'small'"
|
|
45
|
-
:type="btn.type"
|
|
46
|
-
:icon="!btn.rightIcon ? btn.icon : ''"
|
|
47
|
-
:loading="btn.loading"
|
|
48
|
-
@click="btnClick(btn)"
|
|
49
|
-
>{{ btn.text }}
|
|
50
|
-
<i
|
|
51
|
-
v-if="btn.rightIcon"
|
|
52
|
-
:class="btn.icon + ' el-icon--right'"
|
|
53
|
-
></i>
|
|
54
|
-
</el-button>
|
|
55
|
-
<div v-else>
|
|
56
|
-
<component
|
|
57
|
-
:is="btn['componentType']"
|
|
58
|
-
:btnInfo="btn"
|
|
59
|
-
></component>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
|
|
2
|
+
<div :class="showTags ? 'has-tags' : ''">
|
|
3
|
+
<div class="btn-group" ref="btnGroup">
|
|
4
|
+
<div
|
|
5
|
+
v-for="btn in btnList"
|
|
6
|
+
:key="btn.id"
|
|
7
|
+
v-has-permi="btn.hasPermi ? [btn.hasPermi] : undefined"
|
|
8
|
+
>
|
|
9
|
+
<template v-if="btn.isDot || btn.number">
|
|
10
|
+
<el-badge :is-dot="btn.isDot" :value="btn.number">
|
|
11
|
+
<el-button
|
|
12
|
+
v-if="!btn['componentType']"
|
|
13
|
+
:disabled="btn.disabled"
|
|
14
|
+
:size="btn.size || 'small'"
|
|
15
|
+
:type="btn.type"
|
|
16
|
+
:icon="!btn.rightIcon ? btn.icon : ''"
|
|
17
|
+
:loading="btn.loading"
|
|
18
|
+
@click="btnClick(btn)"
|
|
19
|
+
>{{ btn.text }}
|
|
20
|
+
<i v-if="btn.rightIcon" :class="btn.icon + ' el-icon--right'"></i>
|
|
21
|
+
</el-button>
|
|
22
|
+
<div v-else>
|
|
23
|
+
<component :is="btn['componentType']" :btnInfo="btn"></component>
|
|
64
24
|
</div>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
:
|
|
71
|
-
|
|
72
|
-
|
|
25
|
+
</el-badge>
|
|
26
|
+
</template>
|
|
27
|
+
<template v-else>
|
|
28
|
+
<el-button
|
|
29
|
+
v-if="!btn['componentType']"
|
|
30
|
+
:disabled="btn.disabled"
|
|
31
|
+
:size="btn.size || 'small'"
|
|
32
|
+
:type="btn.type"
|
|
33
|
+
:icon="!btn.rightIcon ? btn.icon : ''"
|
|
34
|
+
:loading="btn.loading"
|
|
35
|
+
@click="btnClick(btn)"
|
|
36
|
+
>{{ btn.text }}
|
|
37
|
+
<i v-if="btn.rightIcon" :class="btn.icon + ' el-icon--right'"></i>
|
|
38
|
+
</el-button>
|
|
39
|
+
<div v-else>
|
|
40
|
+
<component :is="btn['componentType']" :btnInfo="btn"></component>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
</div>
|
|
73
44
|
</div>
|
|
45
|
+
<mec-tags
|
|
46
|
+
v-if="showTags"
|
|
47
|
+
:tagsList="tagsData"
|
|
48
|
+
@tagClose="tagClose"
|
|
49
|
+
:btnWidth="btnWidth"
|
|
50
|
+
></mec-tags>
|
|
51
|
+
</div>
|
|
74
52
|
</template>
|
|
75
53
|
<script>
|
|
76
|
-
|
|
77
54
|
export default {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
showTags: {
|
|
85
|
-
type: Boolean,
|
|
86
|
-
default: false
|
|
87
|
-
},
|
|
88
|
-
tagsList: {
|
|
89
|
-
type: [Array, Object],
|
|
90
|
-
}
|
|
55
|
+
name: "MecButtonGroup",
|
|
56
|
+
props: {
|
|
57
|
+
// 按钮组数据
|
|
58
|
+
btnList: {
|
|
59
|
+
required: true,
|
|
91
60
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
btnWidth: 0
|
|
96
|
-
}
|
|
61
|
+
showTags: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false,
|
|
97
64
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
handler(val) {
|
|
101
|
-
this.tagsData = val
|
|
102
|
-
},
|
|
103
|
-
deep: true,
|
|
104
|
-
immediate: true
|
|
105
|
-
},
|
|
106
|
-
btnList: {
|
|
107
|
-
handler(val) {
|
|
108
|
-
if (this.$refs.btnGroup) {
|
|
109
|
-
this.btnWidth = this.$refs.btnGroup.offsetWidth
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
deep: true,
|
|
114
|
-
immediate: true
|
|
115
|
-
}
|
|
65
|
+
tagsList: {
|
|
66
|
+
type: [Array, Object],
|
|
116
67
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
})
|
|
68
|
+
currentIndex: {
|
|
69
|
+
type: [Number, String],
|
|
70
|
+
default: null,
|
|
121
71
|
},
|
|
72
|
+
},
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
tagsData: null,
|
|
76
|
+
btnWidth: 0,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
watch: {
|
|
80
|
+
tagsList: {
|
|
81
|
+
handler(val) {
|
|
82
|
+
this.tagsData = val;
|
|
83
|
+
},
|
|
84
|
+
deep: true,
|
|
85
|
+
immediate: true,
|
|
86
|
+
},
|
|
87
|
+
btnList: {
|
|
88
|
+
handler(val) {
|
|
89
|
+
if (this.$refs.btnGroup) {
|
|
90
|
+
this.btnWidth = this.$refs.btnGroup.offsetWidth;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
deep: true,
|
|
94
|
+
immediate: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
mounted() {
|
|
98
|
+
this.$nextTick(() => {
|
|
99
|
+
this.btnWidth = this.$refs.btnGroup.offsetWidth;
|
|
100
|
+
});
|
|
101
|
+
},
|
|
122
102
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
tagClose(key, tag) {
|
|
132
|
-
this.$emit('tagClose', key, tag);
|
|
103
|
+
methods: {
|
|
104
|
+
// 按钮点击事件
|
|
105
|
+
btnClick(btn) {
|
|
106
|
+
if (btn.trigger) {
|
|
107
|
+
if (this.currentIndex !== null) {
|
|
108
|
+
btn.trigger(this.currentIndex);
|
|
109
|
+
} else {
|
|
110
|
+
btn.trigger();
|
|
133
111
|
}
|
|
112
|
+
}
|
|
134
113
|
},
|
|
135
|
-
|
|
114
|
+
tagClose(key, tag) {
|
|
115
|
+
this.$emit("tagClose", key, tag);
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
136
119
|
</script>
|
|
137
120
|
<style lang="less" scoped>
|
|
138
121
|
/deep/ .el-button {
|
|
139
|
-
|
|
122
|
+
font-weight: normal;
|
|
140
123
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
124
|
+
&:not(:disabled):hover {
|
|
125
|
+
transform: translateY(-1px);
|
|
126
|
+
}
|
|
144
127
|
}
|
|
145
128
|
|
|
146
129
|
.btn-group {
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
149
132
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
133
|
+
& > div {
|
|
134
|
+
margin-left: 5px;
|
|
135
|
+
margin-bottom: 10px;
|
|
153
136
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
137
|
+
&:first-child {
|
|
138
|
+
margin-left: 0;
|
|
157
139
|
}
|
|
158
|
-
|
|
159
|
-
|
|
140
|
+
}
|
|
160
141
|
}
|
|
161
142
|
|
|
162
143
|
.has-tags {
|
|
163
|
-
|
|
164
|
-
|
|
144
|
+
display: flex;
|
|
145
|
+
align-content: center;
|
|
165
146
|
}
|
|
166
147
|
|
|
167
148
|
/deep/ .el-badge__content.is-fixed {
|
|
168
|
-
|
|
169
|
-
|
|
149
|
+
top: -2px;
|
|
150
|
+
right: 23px;
|
|
170
151
|
}
|
|
171
152
|
</style>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
:otherValue.sync="item.otherValue"
|
|
44
44
|
:delIdList.sync="item.delIdList"
|
|
45
45
|
v-bind="item"
|
|
46
|
-
v-on="item.componentListeners"
|
|
46
|
+
v-on="typeof item.componentListeners === 'function' ? item.componentListeners(formData, item) : item.componentListeners || {}"
|
|
47
47
|
:ref="item.componentRef"
|
|
48
48
|
></component>
|
|
49
49
|
</el-form-item>
|
|
@@ -94,7 +94,6 @@ export default {
|
|
|
94
94
|
} else {
|
|
95
95
|
let errorMsg = [];
|
|
96
96
|
for (let key in info) {
|
|
97
|
-
console.log(info[key]);
|
|
98
97
|
errorMsg.push(info[key][0].message);
|
|
99
98
|
}
|
|
100
99
|
if (this.showErrMsg) {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@change="handleChange"
|
|
6
6
|
v-bind="$attrs"
|
|
7
7
|
class="radio-group"
|
|
8
|
+
:disabled="disabled"
|
|
8
9
|
>
|
|
9
10
|
<el-radio
|
|
10
11
|
v-for="item in option"
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
v-model="inputValue"
|
|
20
21
|
:disabled="inputDisabled"
|
|
21
22
|
placeholder="请输入"
|
|
23
|
+
@input="inputChange"
|
|
22
24
|
style="display: inline-block; margin-top: 10px"
|
|
23
25
|
/>
|
|
24
26
|
<!-- @input="inputChange" -->
|
|
@@ -54,6 +56,10 @@ export default {
|
|
|
54
56
|
otherValue: {
|
|
55
57
|
default: "",
|
|
56
58
|
},
|
|
59
|
+
disabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
57
63
|
},
|
|
58
64
|
data() {
|
|
59
65
|
return {
|
|
@@ -143,6 +149,9 @@ export default {
|
|
|
143
149
|
this.props.label
|
|
144
150
|
];
|
|
145
151
|
},
|
|
152
|
+
inputChange(val){
|
|
153
|
+
this.$emit("otherInput", val)
|
|
154
|
+
}
|
|
146
155
|
},
|
|
147
156
|
};
|
|
148
157
|
</script>
|