leisure-core 0.5.21 → 0.5.23
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/le-home/src/main.vue +24 -88
- package/le-list-form/src/main.vue +69 -20
- package/package.json +1 -1
package/le-home/src/main.vue
CHANGED
|
@@ -25,31 +25,17 @@
|
|
|
25
25
|
</el-header>
|
|
26
26
|
<el-container>
|
|
27
27
|
<el-aside class="aside" :class="{ aside_hide: isHideMenu }">
|
|
28
|
-
<el-menu
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
background-color=" #3A3A3A"
|
|
32
|
-
text-color="#fff"
|
|
33
|
-
active-text-color="#ffd04b"
|
|
34
|
-
>
|
|
35
|
-
<el-submenu
|
|
36
|
-
:index="item1.name"
|
|
37
|
-
v-for="item1 in menuData"
|
|
38
|
-
:key="item1.id"
|
|
39
|
-
>
|
|
28
|
+
<el-menu :unique-opened="true" class="menu" background-color=" #3A3A3A" text-color="#fff"
|
|
29
|
+
active-text-color="#ffd04b">
|
|
30
|
+
<el-submenu :index="item1.name" v-for="item1 in menuData" :key="item1.id">
|
|
40
31
|
<template slot="title">
|
|
41
32
|
<div @click="clickTitle">
|
|
42
33
|
<i :class="item1.icon"></i>
|
|
43
34
|
<span>{{ item1.title }}</span>
|
|
44
35
|
</div>
|
|
45
36
|
</template>
|
|
46
|
-
<el-menu-item
|
|
47
|
-
|
|
48
|
-
v-for="item2 in item1.children"
|
|
49
|
-
:key="item2.id"
|
|
50
|
-
:index="item2.name"
|
|
51
|
-
@click="clickMenuItem(item2)"
|
|
52
|
-
>
|
|
37
|
+
<el-menu-item class="menuItem" v-for="item2 in item1.children" :key="item2.id" :index="item2.name"
|
|
38
|
+
@click="clickMenuItem(item2)">
|
|
53
39
|
|
|
54
40
|
<span>{{ item2.title }}</span>
|
|
55
41
|
</el-menu-item>
|
|
@@ -62,94 +48,40 @@
|
|
|
62
48
|
<i class="el-icon-arrow-right" v-else></i>
|
|
63
49
|
</div>
|
|
64
50
|
<div>
|
|
65
|
-
<el-tabs
|
|
66
|
-
|
|
67
|
-
v-
|
|
68
|
-
closable
|
|
69
|
-
@tab-click="handleTabClick"
|
|
70
|
-
@tab-remove="removeTab"
|
|
71
|
-
>
|
|
72
|
-
<el-tab-pane
|
|
73
|
-
v-for="item in tabsAll"
|
|
74
|
-
:key="item.name"
|
|
75
|
-
:label="item.title"
|
|
76
|
-
:name="item.name"
|
|
77
|
-
>
|
|
51
|
+
<el-tabs class="el-tabs_" v-model="tabNameCurrent" closable @tab-click="handleTabClick"
|
|
52
|
+
@tab-remove="removeTab">
|
|
53
|
+
<el-tab-pane v-for="item in tabsAll" :key="item.name" :label="item.title" :name="item.name">
|
|
78
54
|
</el-tab-pane>
|
|
79
55
|
</el-tabs>
|
|
80
56
|
<router-view :key="$route.fullPath"></router-view>
|
|
81
57
|
</div>
|
|
82
58
|
</el-main>
|
|
83
59
|
</el-container>
|
|
84
|
-
<el-dialog
|
|
85
|
-
|
|
86
|
-
ref="
|
|
87
|
-
:visible.sync="showChangePwd"
|
|
88
|
-
width="30%"
|
|
89
|
-
:close-on-click-modal="false"
|
|
90
|
-
@close="cancelChangePwd"
|
|
91
|
-
center
|
|
92
|
-
>
|
|
93
|
-
<el-form
|
|
94
|
-
:model="ruleForm"
|
|
95
|
-
status-icon
|
|
96
|
-
:rules="rules"
|
|
97
|
-
ref="ruleForm"
|
|
98
|
-
label-width="100px"
|
|
99
|
-
class="demo-ruleForm"
|
|
100
|
-
>
|
|
60
|
+
<el-dialog title="修改密码" ref="elDialog" :visible.sync="showChangePwd" width="30%" :close-on-click-modal="false"
|
|
61
|
+
@close="cancelChangePwd" center>
|
|
62
|
+
<el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
|
101
63
|
<el-form-item label="密码" prop="pwd">
|
|
102
|
-
<el-input
|
|
103
|
-
type="password"
|
|
104
|
-
v-model="ruleForm.pwd"
|
|
105
|
-
autocomplete="off"
|
|
106
|
-
></el-input>
|
|
64
|
+
<el-input type="password" v-model="ruleForm.pwd" autocomplete="off"></el-input>
|
|
107
65
|
</el-form-item>
|
|
108
66
|
<el-form-item label="确认密码" prop="confirmPwd">
|
|
109
|
-
<el-input
|
|
110
|
-
type="password"
|
|
111
|
-
v-model="ruleForm.confirmPwd"
|
|
112
|
-
autocomplete="off"
|
|
113
|
-
></el-input>
|
|
67
|
+
<el-input type="password" v-model="ruleForm.confirmPwd" autocomplete="off"></el-input>
|
|
114
68
|
</el-form-item>
|
|
115
69
|
</el-form>
|
|
116
|
-
<div
|
|
117
|
-
ref="pwdref"
|
|
118
|
-
style="display: flex; justify-content: center; color: red"
|
|
119
|
-
>
|
|
70
|
+
<div ref="pwdref" style="display: flex; justify-content: center; color: red">
|
|
120
71
|
{{ pwdinfo }}
|
|
121
72
|
</div>
|
|
122
73
|
<div slot="footer">
|
|
123
|
-
<el-button type="info" @click="cancelChangePwd('ruleForm')"
|
|
124
|
-
|
|
125
|
-
>
|
|
126
|
-
<el-button type="primary" @click="saveChangePwd('ruleForm')"
|
|
127
|
-
>确认修改</el-button
|
|
128
|
-
>
|
|
74
|
+
<el-button type="info" @click="cancelChangePwd('ruleForm')">取 消</el-button>
|
|
75
|
+
<el-button type="primary" @click="saveChangePwd('ruleForm')">确认修改</el-button>
|
|
129
76
|
</div>
|
|
130
77
|
</el-dialog>
|
|
131
78
|
<div v-show="contextMenuVisible">
|
|
132
|
-
<ul
|
|
133
|
-
:style="{ left: menuLeft + 'px', top: menuTop + 'px' }"
|
|
134
|
-
class="contextmenu"
|
|
135
|
-
>
|
|
79
|
+
<ul :style="{ left: menuLeft + 'px', top: menuTop + 'px' }" class="contextmenu">
|
|
136
80
|
<li>
|
|
137
|
-
<el-button
|
|
138
|
-
type="text"
|
|
139
|
-
size="mini"
|
|
140
|
-
icon="el-icon-refresh"
|
|
141
|
-
@click="closeOtherTab"
|
|
142
|
-
>关闭其它</el-button
|
|
143
|
-
>
|
|
81
|
+
<el-button type="text" size="mini" icon="el-icon-refresh" @click="closeOtherTab">关闭其它</el-button>
|
|
144
82
|
</li>
|
|
145
83
|
<li>
|
|
146
|
-
<el-button
|
|
147
|
-
type="text"
|
|
148
|
-
size="mini"
|
|
149
|
-
icon="el-icon-error"
|
|
150
|
-
@click="closeAllTabs"
|
|
151
|
-
>关闭所有</el-button
|
|
152
|
-
>
|
|
84
|
+
<el-button type="text" size="mini" icon="el-icon-error" @click="closeAllTabs">关闭所有</el-button>
|
|
153
85
|
</li>
|
|
154
86
|
</ul>
|
|
155
87
|
</div>
|
|
@@ -244,7 +176,6 @@ export default {
|
|
|
244
176
|
];
|
|
245
177
|
|
|
246
178
|
this.$store.commit("setDict", dict);
|
|
247
|
-
|
|
248
179
|
this.menuData = this.$store.getters.menu;
|
|
249
180
|
this.menuData = this.$store.getters.menu.filter(function (item) {
|
|
250
181
|
if (item.children) {
|
|
@@ -254,6 +185,7 @@ export default {
|
|
|
254
185
|
}
|
|
255
186
|
return item;
|
|
256
187
|
});
|
|
188
|
+
this.$emit("homeInit")
|
|
257
189
|
},
|
|
258
190
|
watch: {
|
|
259
191
|
contextMenuVisible() {
|
|
@@ -514,6 +446,7 @@ export default {
|
|
|
514
446
|
.el-icon-arrow-down {
|
|
515
447
|
font-size: 16px;
|
|
516
448
|
}
|
|
449
|
+
|
|
517
450
|
.el-dropdown-menu__item {
|
|
518
451
|
font-size: 15px !important;
|
|
519
452
|
}
|
|
@@ -528,6 +461,7 @@ export default {
|
|
|
528
461
|
.cursor {
|
|
529
462
|
cursor: pointer;
|
|
530
463
|
}
|
|
464
|
+
|
|
531
465
|
.aside_open_close {
|
|
532
466
|
position: absolute;
|
|
533
467
|
left: 0;
|
|
@@ -542,6 +476,7 @@ export default {
|
|
|
542
476
|
z-index: 1000;
|
|
543
477
|
cursor: pointer;
|
|
544
478
|
}
|
|
479
|
+
|
|
545
480
|
.aside_open_close:hover {
|
|
546
481
|
background-color: #ff8e2b;
|
|
547
482
|
color: #fff;
|
|
@@ -569,6 +504,7 @@ export default {
|
|
|
569
504
|
background: #f2f2f2;
|
|
570
505
|
cursor: pointer;
|
|
571
506
|
}
|
|
507
|
+
|
|
572
508
|
.button {
|
|
573
509
|
color: #2c3e50;
|
|
574
510
|
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-form :model="formPop" :rules="rules" ref="ruleForm" :label-width="labelWidth">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<el-form :model="formPop" :rules="rules" ref="ruleForm" :label-width="labelWidth" class="le-form-container">
|
|
3
|
+
<div class="form-grid" :style="gridStyle">
|
|
4
|
+
<el-form-item v-for="(item, index) in formColumns" :key="index" :label="item.label" :prop="item.prop"
|
|
5
|
+
class="leisure-form-item-class">
|
|
6
|
+
<div class="comContainerClass">
|
|
7
|
+
<component :is="componentType(item.type)" v-model="formPop[item.prop]"
|
|
8
|
+
v-bind="mergeProps(getComponentProps(item), item.attr || {})" v-on="item.event" class="compontClass">
|
|
9
|
+
<template v-if="item.type === 'radio'">
|
|
10
|
+
<el-radio v-for="(option, index) in item.options" :label="option.id" :key="index + '_radio'">{{
|
|
11
|
+
option.lable
|
|
12
|
+
}}</el-radio>
|
|
13
|
+
</template>
|
|
14
|
+
<template v-else-if="item.type === 'select'">
|
|
15
|
+
<le-select-option :options="fieldOptions[item.prop]" :label="item.kv.label" :value="item.kv.key"
|
|
16
|
+
:keyNum="item.keyNum" />
|
|
17
|
+
</template>
|
|
18
|
+
</component>
|
|
19
|
+
<slot :name="item.prop"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
</div>
|
|
20
23
|
<slot></slot>
|
|
21
|
-
<el-form-item v-rfooter>
|
|
24
|
+
<el-form-item v-rfooter class="form-footer">
|
|
22
25
|
<slot name="footerBtn"></slot>
|
|
23
26
|
<le-button type="primary" @click="saveData" v-if="handleStatus == 1 || handleStatus == 2">保存</le-button>
|
|
24
27
|
<le-button type="info" @click="close()">关闭</le-button>
|
|
@@ -46,6 +49,7 @@ export default {
|
|
|
46
49
|
type: String,
|
|
47
50
|
default: "100px",
|
|
48
51
|
},
|
|
52
|
+
|
|
49
53
|
fieldOptions: {
|
|
50
54
|
type: Object,
|
|
51
55
|
default: () => { },
|
|
@@ -54,6 +58,21 @@ export default {
|
|
|
54
58
|
type: Number,
|
|
55
59
|
default: 0, //0:详情 1:新增 2:编辑
|
|
56
60
|
},
|
|
61
|
+
columnsPerRow: {
|
|
62
|
+
type: Number,
|
|
63
|
+
default: 1,
|
|
64
|
+
validator: (value) => value > 0 && value <= 4 // 限制最大4列,避免太拥挤
|
|
65
|
+
},
|
|
66
|
+
// 新增属性:列间距
|
|
67
|
+
columnGap: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "20px"
|
|
70
|
+
},
|
|
71
|
+
// 新增属性:行间距
|
|
72
|
+
rowGap: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "16px"
|
|
75
|
+
}
|
|
57
76
|
},
|
|
58
77
|
watch: {
|
|
59
78
|
formData: {
|
|
@@ -105,7 +124,15 @@ export default {
|
|
|
105
124
|
options: {}, //{field1:[{value:1,label:'选项1'},{value:2,label:'选项2'}]}
|
|
106
125
|
};
|
|
107
126
|
},
|
|
108
|
-
computed: {
|
|
127
|
+
computed: {
|
|
128
|
+
gridStyle() {
|
|
129
|
+
return {
|
|
130
|
+
'grid-template-columns': `repeat(${this.columnsPerRow}, 1fr)`,
|
|
131
|
+
'column-gap': this.columnGap,
|
|
132
|
+
'row-gap': this.rowGap
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
},
|
|
109
136
|
mounted() { },
|
|
110
137
|
methods: {
|
|
111
138
|
componentType(type) {
|
|
@@ -143,6 +170,23 @@ export default {
|
|
|
143
170
|
};
|
|
144
171
|
</script>
|
|
145
172
|
<style lang="scss" scoped>
|
|
173
|
+
le-form-container {
|
|
174
|
+
width: 100%;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.form-grid {
|
|
178
|
+
display: grid;
|
|
179
|
+
|
|
180
|
+
// 响应式处理:在小屏幕上自动调整为1列
|
|
181
|
+
@media (max-width: 768px) {
|
|
182
|
+
grid-template-columns: 1fr !important;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.leisure-form-item-class {
|
|
187
|
+
margin-bottom: 0; // 使用grid的gap控制间距,不需要margin-bottom
|
|
188
|
+
}
|
|
189
|
+
|
|
146
190
|
.leisure-form-item-class {}
|
|
147
191
|
|
|
148
192
|
.comContainerClass {
|
|
@@ -154,4 +198,9 @@ export default {
|
|
|
154
198
|
flex: 1
|
|
155
199
|
}
|
|
156
200
|
}
|
|
201
|
+
|
|
202
|
+
.form-footer {
|
|
203
|
+
margin-top: 20px;
|
|
204
|
+
text-align: right;
|
|
205
|
+
}
|
|
157
206
|
</style>
|