gyyg-components 0.3.18 → 0.3.20
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 +312 -100
- package/lib/gyyg-components.umd.js +312 -100
- package/lib/gyyg-components.umd.min.js +312 -100
- package/package.json +1 -1
- package/src/components/MecDrawer/MecDrawer.js +5 -0
- package/src/components/MecDrawer/MecDrawer.vue +94 -0
- package/src/components/MecForm/MecForm.vue +118 -88
- package/src/components/MecInput/MecInput.vue +2 -0
- package/src/components/MecPopoverButton/MecPopoverButton.vue +4 -0
- package/src/components/MecRadio/MecRadio.vue +52 -3
- package/src/components/MecSelect/MecSelect.vue +20 -21
- package/src/components/MecSelectAndButton/MecSelectAndButton.js +5 -0
- package/src/components/MecSelectAndButton/MecSelectAndButton.vue +167 -0
- package/src/components/MecTable/MecTable.vue +9 -5
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-button-box">
|
|
3
|
+
<el-select
|
|
4
|
+
v-model="selected"
|
|
5
|
+
@clear="clear"
|
|
6
|
+
@change="handleChange"
|
|
7
|
+
:placeholder="placeholder"
|
|
8
|
+
:multiple="multiple || false"
|
|
9
|
+
:clearable="clearable"
|
|
10
|
+
:disabled="disabled"
|
|
11
|
+
:size="size"
|
|
12
|
+
v-bind="$attrs"
|
|
13
|
+
:filterable="filterable"
|
|
14
|
+
:value="selected"
|
|
15
|
+
style="width: 100%"
|
|
16
|
+
@visible-change="visibleChange"
|
|
17
|
+
>
|
|
18
|
+
<el-option
|
|
19
|
+
v-for="item in option"
|
|
20
|
+
:key="item[props.value]"
|
|
21
|
+
:label="item[props.label]"
|
|
22
|
+
:value="item[props.value]"
|
|
23
|
+
:disabled="item.disabled"
|
|
24
|
+
></el-option>
|
|
25
|
+
</el-select>
|
|
26
|
+
<el-button :icon="buttonIcon" :type="buttonType" @click="btnClick">{{
|
|
27
|
+
buttonText
|
|
28
|
+
}}</el-button>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
name: "MecSelectAndButton",
|
|
35
|
+
props: {
|
|
36
|
+
value: {
|
|
37
|
+
default: null,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
options: {
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
multiple: {
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
default() {
|
|
48
|
+
return {
|
|
49
|
+
label: "name",
|
|
50
|
+
value: "id",
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
placeholder: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "请选择",
|
|
57
|
+
},
|
|
58
|
+
clearable: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
},
|
|
61
|
+
disabled: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
defalut: false,
|
|
64
|
+
},
|
|
65
|
+
size: String,
|
|
66
|
+
filterable: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
defalut: false,
|
|
69
|
+
},
|
|
70
|
+
buttonIcon: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: "el-icon-plus",
|
|
73
|
+
},
|
|
74
|
+
buttonText: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "新增",
|
|
77
|
+
},
|
|
78
|
+
buttonType: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "",
|
|
81
|
+
},
|
|
82
|
+
isVisible: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
selected: "",
|
|
90
|
+
option: [],
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
watch: {
|
|
94
|
+
value: {
|
|
95
|
+
handler(val) {
|
|
96
|
+
this.selected = val;
|
|
97
|
+
},
|
|
98
|
+
immediate: true,
|
|
99
|
+
},
|
|
100
|
+
options: {
|
|
101
|
+
handler: function () {
|
|
102
|
+
if (!Array.isArray(this.options) && this.options) {
|
|
103
|
+
if (this.options instanceof Promise) {
|
|
104
|
+
this.options.then((val) => {
|
|
105
|
+
this.option = val.data || val;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (typeof this.options == "function") {
|
|
109
|
+
this.options().then((val) => {
|
|
110
|
+
this.option = val.data || val;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
this.option = this.options;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
deep: true,
|
|
118
|
+
immediate: true,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
methods: {
|
|
122
|
+
handleChange(val) {
|
|
123
|
+
this.selected = val;
|
|
124
|
+
let info = this.option.filter((item) => item[this.props.value] == val);
|
|
125
|
+
this.$emit("input", this.selected);
|
|
126
|
+
this.$emit("update:value", val);
|
|
127
|
+
this.$emit("change", val, info.length > 0 ? info[0] : {});
|
|
128
|
+
},
|
|
129
|
+
clear() {
|
|
130
|
+
this.selected = "";
|
|
131
|
+
this.$emit("clear");
|
|
132
|
+
},
|
|
133
|
+
visibleChange(val) {
|
|
134
|
+
if (val && this.isVisible) {
|
|
135
|
+
if (!Array.isArray(this.options) && this.options) {
|
|
136
|
+
if (this.options instanceof Promise) {
|
|
137
|
+
this.options.then((val) => {
|
|
138
|
+
this.option = val.data || val;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
if (typeof this.options == "function") {
|
|
142
|
+
this.options().then((val) => {
|
|
143
|
+
this.option = val.data || val;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
this.option = this.options;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
btnClick(btn) {
|
|
152
|
+
this.$emit("btnClick", btn);
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<style lang="less" scoped>
|
|
159
|
+
.select-button-box {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
}
|
|
163
|
+
/deep/ .el-button {
|
|
164
|
+
height: 40px;
|
|
165
|
+
margin-left: 10px;
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
:width="col.width"
|
|
48
48
|
:sortable="col.sortable"
|
|
49
49
|
:show-overflow-tooltip="col.showOverflowTooltip"
|
|
50
|
-
:key="
|
|
50
|
+
:key="col.id"
|
|
51
51
|
:fixed="col.fixed"
|
|
52
52
|
:prop="col.bind"
|
|
53
53
|
>
|
|
@@ -205,7 +205,7 @@ export default {
|
|
|
205
205
|
required: false,
|
|
206
206
|
default: () => {
|
|
207
207
|
return {
|
|
208
|
-
backgroundColor: "#
|
|
208
|
+
backgroundColor: "#efefef",
|
|
209
209
|
fontWeight: 'normal',
|
|
210
210
|
color: '#303133',
|
|
211
211
|
}
|
|
@@ -276,6 +276,7 @@ export default {
|
|
|
276
276
|
data() {
|
|
277
277
|
return {
|
|
278
278
|
multipleSelection: [],
|
|
279
|
+
column: []
|
|
279
280
|
}
|
|
280
281
|
},
|
|
281
282
|
methods: {
|
|
@@ -329,8 +330,8 @@ export default {
|
|
|
329
330
|
watch: {
|
|
330
331
|
columns: {
|
|
331
332
|
handler: function (val) {
|
|
332
|
-
|
|
333
|
-
this.column = val;
|
|
333
|
+
console.log(val);
|
|
334
|
+
this.column = [...val];
|
|
334
335
|
},
|
|
335
336
|
immediate: true,
|
|
336
337
|
deep: true,
|
|
@@ -343,7 +344,9 @@ export default {
|
|
|
343
344
|
background-color: #fff;
|
|
344
345
|
height: 100%;
|
|
345
346
|
}
|
|
346
|
-
|
|
347
|
+
/deep/ .el-table {
|
|
348
|
+
margin-bottom: 10px;
|
|
349
|
+
}
|
|
347
350
|
.pagination-layout {
|
|
348
351
|
text-align: right;
|
|
349
352
|
padding: 0px 10px 5px 0;
|
|
@@ -385,4 +388,5 @@ export default {
|
|
|
385
388
|
font-size: 15px;
|
|
386
389
|
color: #F56C6C;
|
|
387
390
|
}
|
|
391
|
+
|
|
388
392
|
</style>
|