gyyg-components 0.3.4 → 0.3.6
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 +99 -99
- package/lib/gyyg-components.umd.js +99 -99
- package/lib/gyyg-components.umd.min.js +99 -99
- package/package.json +1 -1
- package/src/components/MECDescriptions/MECDescriptions.vue +75 -7
- package/src/components/MecButtonGroup/MecButtonGroup.vue +78 -35
- package/src/components/MecDialog/MecDialog.vue +18 -0
- package/src/components/MecTags/MecTags.vue +16 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div :class="isCard ? 'card' : ''">
|
|
3
3
|
<el-descriptions
|
|
4
4
|
:column="column"
|
|
5
5
|
:title="title"
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
:class="!title ? 'no-title' : ''"
|
|
10
10
|
>
|
|
11
11
|
<template #title>
|
|
12
|
-
<div class="title">
|
|
12
|
+
<div class="title">
|
|
13
|
+
<el-icon :class="titleIcon"></el-icon><span>{{ title }}</span>
|
|
14
|
+
</div>
|
|
13
15
|
<div class="top-content">
|
|
14
16
|
<slot name="topContent"></slot>
|
|
15
17
|
</div>
|
|
@@ -20,11 +22,10 @@
|
|
|
20
22
|
:key="index"
|
|
21
23
|
:label="item.label"
|
|
22
24
|
:span="item.span || 1"
|
|
23
|
-
:contentClassName="item.contentClassName || ''"
|
|
24
|
-
:labelStyle="{width:labelWidth + 'px', textAlign: 'right'}"
|
|
25
|
+
:contentClassName="direction == 'vertical' ? 'vertical-content' : item.contentClassName || ''"
|
|
26
|
+
:labelStyle="direction == 'horizontal' ? { width: labelWidth + 'px', textAlign: 'right' } : {}"
|
|
25
27
|
:contentStyle="item.contentStyle || {}"
|
|
26
|
-
:labelClassName="item.labelClassName || ''"
|
|
27
|
-
|
|
28
|
+
:labelClassName="direction == 'vertical' ? 'vertical-label' : item.labelClassName || ''"
|
|
28
29
|
>
|
|
29
30
|
<div v-if="item.type === 'img'">
|
|
30
31
|
<el-image
|
|
@@ -53,16 +54,23 @@
|
|
|
53
54
|
<component
|
|
54
55
|
:is="item.componentName"
|
|
55
56
|
v-model="item.value"
|
|
57
|
+
:tableData="item"
|
|
56
58
|
v-bind="typeof item.componentProps === 'function' ? item.componentProps(item) : item.componentProps"
|
|
57
59
|
v-on="typeof item.componentListeners === 'function' ? item.componentListeners(item) : item.componentListeners || {}"
|
|
58
60
|
/>
|
|
59
61
|
</div>
|
|
60
|
-
<span
|
|
62
|
+
<span
|
|
63
|
+
v-else
|
|
64
|
+
:style="!item.value ? 'color: #C0C4CC; font-style: italic;' : ''"
|
|
65
|
+
>{{ item.value || '未填写' }}</span>
|
|
61
66
|
</el-descriptions-item>
|
|
62
67
|
</el-descriptions>
|
|
63
68
|
</div>
|
|
69
|
+
|
|
70
|
+
|
|
64
71
|
</template>
|
|
65
72
|
<script>
|
|
73
|
+
import styleText from '@/otherComponents/styleText.vue'
|
|
66
74
|
export default {
|
|
67
75
|
name: 'mec-descriptions',
|
|
68
76
|
props: {
|
|
@@ -105,8 +113,20 @@ export default {
|
|
|
105
113
|
type: [Number, String],
|
|
106
114
|
default: 100
|
|
107
115
|
},
|
|
116
|
+
isCard: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: false
|
|
119
|
+
},
|
|
120
|
+
titleIcon: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: ''
|
|
123
|
+
},
|
|
108
124
|
|
|
109
125
|
},
|
|
126
|
+
components: {
|
|
127
|
+
styleText
|
|
128
|
+
},
|
|
129
|
+
|
|
110
130
|
}
|
|
111
131
|
</script>
|
|
112
132
|
<style lang="less" scoped>
|
|
@@ -144,7 +164,55 @@ export default {
|
|
|
144
164
|
/deep/ .el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
|
|
145
165
|
white-space: pre-wrap;
|
|
146
166
|
}
|
|
167
|
+
|
|
147
168
|
/deep/ .el-progress-bar {
|
|
148
169
|
width: 200px
|
|
149
170
|
}
|
|
171
|
+
|
|
172
|
+
/deep/ .el-descriptions-item__content {
|
|
173
|
+
color: #000;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.card {
|
|
177
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
|
178
|
+
margin-bottom: 20px;
|
|
179
|
+
border-radius: 8px;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
|
|
182
|
+
/deep/ .el-descriptions {
|
|
183
|
+
.el-descriptions__body {
|
|
184
|
+
padding: 0 10px;
|
|
185
|
+
|
|
186
|
+
.vertical-content {
|
|
187
|
+
padding-bottom: 20px;
|
|
188
|
+
color: #000;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.vertical-label {
|
|
192
|
+
padding-bottom: 0;
|
|
193
|
+
color: #606266;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.title {
|
|
198
|
+
background-color: #fff;
|
|
199
|
+
margin-bottom: 0;
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.el-descriptions__title {
|
|
205
|
+
padding: 10px 0;
|
|
206
|
+
border-bottom: 1px solid #ebeef5;
|
|
207
|
+
|
|
208
|
+
i {
|
|
209
|
+
font-size: 20px;
|
|
210
|
+
color: #1890ff;
|
|
211
|
+
margin-right: 5px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
}
|
|
150
218
|
</style>
|
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<
|
|
4
|
-
v-
|
|
5
|
-
:
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
<div :class="showTags ? 'has-tags' : ''">
|
|
3
|
+
<mec-tags
|
|
4
|
+
v-if="showTags"
|
|
5
|
+
:tagsList="tagsData"
|
|
6
|
+
></mec-tags>
|
|
7
|
+
<div class="btn-group">
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
v-for="btn in btnList"
|
|
11
|
+
:key="btn.id"
|
|
12
|
+
v-has-permi="btn.hasPermi ? [btn.hasPermi] : undefined"
|
|
13
|
+
>
|
|
14
|
+
<template v-if="btn.isDot || btn.number">
|
|
15
|
+
<el-badge
|
|
16
|
+
:is-dot="btn.isDot"
|
|
17
|
+
:value="btn.number"
|
|
18
|
+
>
|
|
19
|
+
<el-button
|
|
20
|
+
v-if="!btn['componentType']"
|
|
21
|
+
:disabled="btn.disabled"
|
|
22
|
+
:size="btn.size || 'small'"
|
|
23
|
+
:type="btn.type"
|
|
24
|
+
:icon="!btn.rightIcon ? btn.icon : ''"
|
|
25
|
+
:loading="btn.loading"
|
|
26
|
+
@click="btnClick(btn)"
|
|
27
|
+
>{{ btn.text }}
|
|
28
|
+
<i
|
|
29
|
+
v-if="btn.rightIcon"
|
|
30
|
+
:class="btn.icon + ' el-icon--right'"
|
|
31
|
+
></i>
|
|
32
|
+
</el-button>
|
|
33
|
+
<div v-else>
|
|
34
|
+
<component
|
|
35
|
+
:is="btn['componentType']"
|
|
36
|
+
:btnInfo="btn"
|
|
37
|
+
></component>
|
|
38
|
+
</div>
|
|
39
|
+
</el-badge>
|
|
40
|
+
</template>
|
|
41
|
+
<template v-else>
|
|
13
42
|
<el-button
|
|
14
43
|
v-if="!btn['componentType']"
|
|
15
44
|
:disabled="btn.disabled"
|
|
@@ -30,33 +59,12 @@
|
|
|
30
59
|
:btnInfo="btn"
|
|
31
60
|
></component>
|
|
32
61
|
</div>
|
|
33
|
-
</
|
|
34
|
-
</template>
|
|
35
|
-
<template v-else>
|
|
36
|
-
<el-button
|
|
37
|
-
v-if="!btn['componentType']"
|
|
38
|
-
:disabled="btn.disabled"
|
|
39
|
-
:size="btn.size || 'small'"
|
|
40
|
-
:type="btn.type"
|
|
41
|
-
:icon="!btn.rightIcon ? btn.icon : ''"
|
|
42
|
-
:loading="btn.loading"
|
|
43
|
-
@click="btnClick(btn)"
|
|
44
|
-
>{{ btn.text }}
|
|
45
|
-
<i
|
|
46
|
-
v-if="btn.rightIcon"
|
|
47
|
-
:class="btn.icon + ' el-icon--right'"
|
|
48
|
-
></i>
|
|
49
|
-
</el-button>
|
|
50
|
-
<div v-else>
|
|
51
|
-
<component
|
|
52
|
-
:is="btn['componentType']"
|
|
53
|
-
:btnInfo="btn"
|
|
54
|
-
></component>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
62
|
+
</template>
|
|
57
63
|
|
|
58
64
|
|
|
65
|
+
</div>
|
|
59
66
|
</div>
|
|
67
|
+
|
|
60
68
|
</div>
|
|
61
69
|
</template>
|
|
62
70
|
<script>
|
|
@@ -68,6 +76,27 @@ export default {
|
|
|
68
76
|
btnList: {
|
|
69
77
|
required: true,
|
|
70
78
|
},
|
|
79
|
+
showTags: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
tagsList: {
|
|
84
|
+
type: [Array, Object],
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
tagsData: null
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
watch: {
|
|
93
|
+
tagsList: {
|
|
94
|
+
handler(val) {
|
|
95
|
+
this.tagsData = val
|
|
96
|
+
},
|
|
97
|
+
deep: true,
|
|
98
|
+
immediate: true
|
|
99
|
+
}
|
|
71
100
|
},
|
|
72
101
|
methods: {
|
|
73
102
|
// 按钮点击事件
|
|
@@ -81,6 +110,12 @@ export default {
|
|
|
81
110
|
}
|
|
82
111
|
</script>
|
|
83
112
|
<style lang="less" scoped>
|
|
113
|
+
/deep/ .el-button {
|
|
114
|
+
&:not(:disabled):hover {
|
|
115
|
+
transform: translateY(-1px);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
84
119
|
.btn-group {
|
|
85
120
|
display: flex;
|
|
86
121
|
align-items: center;
|
|
@@ -94,6 +129,14 @@ export default {
|
|
|
94
129
|
margin-left: 0;
|
|
95
130
|
}
|
|
96
131
|
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.has-tags {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-content: center;
|
|
139
|
+
justify-content: space-between;
|
|
97
140
|
}
|
|
98
141
|
|
|
99
142
|
/deep/ .el-badge__content.is-fixed {
|
|
@@ -18,7 +18,12 @@
|
|
|
18
18
|
@close="closeMethod"
|
|
19
19
|
:destroy-on-close="destroyOnClose"
|
|
20
20
|
:modal='modal'
|
|
21
|
+
:style="'height:' + height"
|
|
21
22
|
>
|
|
23
|
+
<div slot="title" style="font-size: 16px; color: #303133;">
|
|
24
|
+
<el-icon :class="titleIcon" style="color: #1890ff; font-size: 18px;margin-right: 5px;"></el-icon>
|
|
25
|
+
<span>{{ title }}</span>
|
|
26
|
+
</div>
|
|
22
27
|
<slot name="body" />
|
|
23
28
|
<div v-if="footer" slot="footer">
|
|
24
29
|
<slot name="footer" />
|
|
@@ -84,6 +89,14 @@ export default {
|
|
|
84
89
|
dialogClass: {
|
|
85
90
|
type: String,
|
|
86
91
|
default: ""
|
|
92
|
+
},
|
|
93
|
+
titleIcon: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: '',
|
|
96
|
+
},
|
|
97
|
+
height: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: 'auto'
|
|
87
100
|
}
|
|
88
101
|
},
|
|
89
102
|
data() {
|
|
@@ -127,6 +140,7 @@ export default {
|
|
|
127
140
|
display: flex;
|
|
128
141
|
justify-content: center;
|
|
129
142
|
align-items: center;
|
|
143
|
+
margin: auto 0;
|
|
130
144
|
.el-dialog {
|
|
131
145
|
display: flex;
|
|
132
146
|
flex-direction: column;
|
|
@@ -159,6 +173,7 @@ export default {
|
|
|
159
173
|
overflow: auto;
|
|
160
174
|
padding: 20px;
|
|
161
175
|
padding-bottom: 52px;
|
|
176
|
+
height: calc(100% - 50px);
|
|
162
177
|
}
|
|
163
178
|
|
|
164
179
|
.el-dialog__footer {
|
|
@@ -214,6 +229,9 @@ export default {
|
|
|
214
229
|
}
|
|
215
230
|
}
|
|
216
231
|
}
|
|
232
|
+
/deep/ .el-dialog {
|
|
233
|
+
height: 100%;
|
|
234
|
+
}
|
|
217
235
|
.shan-maintenance-dialog {
|
|
218
236
|
/deep/ .el-dialog {
|
|
219
237
|
height: 90%;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div>
|
|
3
|
+
<el-tag
|
|
4
|
+
v-for="tag in tagsList"
|
|
5
|
+
:key="tag.id"
|
|
6
|
+
closable
|
|
7
|
+
:type="tag.type || ''"
|
|
8
|
+
>
|
|
9
|
+
{{ tag.label }}: {{ tag.value }}
|
|
10
|
+
</el-tag>
|
|
11
|
+
</div>
|
|
3
12
|
</template>
|
|
4
13
|
<script>
|
|
5
14
|
export default {
|
|
6
|
-
name: 'MecTags'
|
|
15
|
+
name: 'MecTags',
|
|
16
|
+
props: {
|
|
17
|
+
tagsList: {
|
|
18
|
+
type: [Array, Object],
|
|
19
|
+
}
|
|
20
|
+
},
|
|
7
21
|
}
|
|
8
22
|
|
|
9
23
|
</script>
|