leisure-core 0.5.24 → 0.5.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/le-area/src/main.vue +2 -1
- package/le-list-form/src/main.vue +60 -27
- package/package.json +1 -1
package/le-area/src/main.vue
CHANGED
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
<script>
|
|
11
11
|
import { getAreas } from "@/api/system-area.js";
|
|
12
|
+
import { number } from "echarts";
|
|
12
13
|
export default {
|
|
13
14
|
name: "le-area",
|
|
14
15
|
props: {
|
|
15
16
|
level: {
|
|
16
|
-
type: String,
|
|
17
|
+
type: [String, Number],
|
|
17
18
|
default: "2",
|
|
18
19
|
},
|
|
19
20
|
isAny: {
|
|
@@ -1,19 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-form
|
|
2
|
+
<el-form
|
|
3
|
+
:model="formPop"
|
|
4
|
+
:rules="rules"
|
|
5
|
+
ref="ruleForm"
|
|
6
|
+
:label-width="labelWidth"
|
|
7
|
+
class="le-form-container"
|
|
8
|
+
>
|
|
3
9
|
<div class="form-grid" :style="gridStyle">
|
|
4
|
-
<el-form-item
|
|
5
|
-
|
|
10
|
+
<el-form-item
|
|
11
|
+
v-for="(item, index) in formColumns"
|
|
12
|
+
:key="index"
|
|
13
|
+
:label="item.label"
|
|
14
|
+
:prop="item.prop"
|
|
15
|
+
class="leisure-form-item-class"
|
|
16
|
+
>
|
|
6
17
|
<div class="comContainerClass">
|
|
7
|
-
<component
|
|
8
|
-
|
|
18
|
+
<component
|
|
19
|
+
:is="componentType(item.type)"
|
|
20
|
+
v-model="formPop[item.prop]"
|
|
21
|
+
v-bind="mergeProps(getComponentProps(item), item.attr || {})"
|
|
22
|
+
v-on="item.event"
|
|
23
|
+
class="compontClass"
|
|
24
|
+
>
|
|
9
25
|
<template v-if="item.type === 'radio'">
|
|
10
|
-
<el-radio
|
|
11
|
-
option.
|
|
12
|
-
|
|
26
|
+
<el-radio
|
|
27
|
+
v-for="(option, index) in item.options"
|
|
28
|
+
:label="option.id"
|
|
29
|
+
:key="index + '_radio'"
|
|
30
|
+
>{{ option.lable }}</el-radio
|
|
31
|
+
>
|
|
13
32
|
</template>
|
|
14
33
|
<template v-else-if="item.type === 'select'">
|
|
15
|
-
<le-select-option
|
|
16
|
-
:
|
|
34
|
+
<le-select-option
|
|
35
|
+
:options="fieldOptions[item.prop]"
|
|
36
|
+
:label="item.kv.label"
|
|
37
|
+
:value="item.kv.key"
|
|
38
|
+
:keyNum="item.keyNum"
|
|
39
|
+
/>
|
|
17
40
|
</template>
|
|
18
41
|
</component>
|
|
19
42
|
<slot :name="item.prop"></slot>
|
|
@@ -23,7 +46,12 @@
|
|
|
23
46
|
<slot></slot>
|
|
24
47
|
<el-form-item v-rfooter class="form-footer">
|
|
25
48
|
<slot name="footerBtn"></slot>
|
|
26
|
-
<le-button
|
|
49
|
+
<le-button
|
|
50
|
+
type="primary"
|
|
51
|
+
@click="saveData"
|
|
52
|
+
v-if="handleStatus == 1 || handleStatus == 2"
|
|
53
|
+
>保存</le-button
|
|
54
|
+
>
|
|
27
55
|
<le-button type="info" @click="close()">关闭</le-button>
|
|
28
56
|
</el-form-item>
|
|
29
57
|
</el-form>
|
|
@@ -39,11 +67,11 @@ export default {
|
|
|
39
67
|
},
|
|
40
68
|
formData: {
|
|
41
69
|
type: Object,
|
|
42
|
-
default: () => {
|
|
70
|
+
default: () => {},
|
|
43
71
|
},
|
|
44
72
|
rules: {
|
|
45
73
|
type: Object,
|
|
46
|
-
default: () => {
|
|
74
|
+
default: () => {},
|
|
47
75
|
},
|
|
48
76
|
labelWidth: {
|
|
49
77
|
type: String,
|
|
@@ -52,7 +80,7 @@ export default {
|
|
|
52
80
|
|
|
53
81
|
fieldOptions: {
|
|
54
82
|
type: Object,
|
|
55
|
-
default: () => {
|
|
83
|
+
default: () => {},
|
|
56
84
|
},
|
|
57
85
|
handleStatus: {
|
|
58
86
|
type: Number,
|
|
@@ -61,18 +89,18 @@ export default {
|
|
|
61
89
|
columnsPerRow: {
|
|
62
90
|
type: Number,
|
|
63
91
|
default: 1,
|
|
64
|
-
validator: (value) => value > 0 && value <= 4 // 限制最大4列,避免太拥挤
|
|
92
|
+
validator: (value) => value > 0 && value <= 4, // 限制最大4列,避免太拥挤
|
|
65
93
|
},
|
|
66
94
|
// 新增属性:列间距
|
|
67
95
|
columnGap: {
|
|
68
96
|
type: String,
|
|
69
|
-
default: "20px"
|
|
97
|
+
default: "20px",
|
|
70
98
|
},
|
|
71
99
|
// 新增属性:行间距
|
|
72
100
|
rowGap: {
|
|
73
101
|
type: String,
|
|
74
|
-
default: "16px"
|
|
75
|
-
}
|
|
102
|
+
default: "16px",
|
|
103
|
+
},
|
|
76
104
|
},
|
|
77
105
|
watch: {
|
|
78
106
|
formData: {
|
|
@@ -119,6 +147,10 @@ export default {
|
|
|
119
147
|
},
|
|
120
148
|
select: { component: "le-select", props: {} },
|
|
121
149
|
image: { component: "le-image-container", props: {} },
|
|
150
|
+
area: {
|
|
151
|
+
component: "le-area",
|
|
152
|
+
props: {},
|
|
153
|
+
},
|
|
122
154
|
},
|
|
123
155
|
formPop: {},
|
|
124
156
|
options: {}, //{field1:[{value:1,label:'选项1'},{value:2,label:'选项2'}]}
|
|
@@ -127,13 +159,13 @@ export default {
|
|
|
127
159
|
computed: {
|
|
128
160
|
gridStyle() {
|
|
129
161
|
return {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
162
|
+
"grid-template-columns": `repeat(${this.columnsPerRow}, 1fr)`,
|
|
163
|
+
"column-gap": this.columnGap,
|
|
164
|
+
"row-gap": this.rowGap,
|
|
133
165
|
};
|
|
134
|
-
}
|
|
166
|
+
},
|
|
135
167
|
},
|
|
136
|
-
mounted() {
|
|
168
|
+
mounted() {},
|
|
137
169
|
methods: {
|
|
138
170
|
componentType(type) {
|
|
139
171
|
let result = this.componentMap[type]?.component || "le-input";
|
|
@@ -145,7 +177,7 @@ export default {
|
|
|
145
177
|
if (type === "image") {
|
|
146
178
|
let images = [];
|
|
147
179
|
images.push(this.formPop[item.prop]);
|
|
148
|
-
props = { ...props,
|
|
180
|
+
props = { ...props, images: images };
|
|
149
181
|
return props;
|
|
150
182
|
}
|
|
151
183
|
return this.componentMap[item.type]?.props || {};
|
|
@@ -160,7 +192,7 @@ export default {
|
|
|
160
192
|
saveData() {
|
|
161
193
|
this.$refs["ruleForm"].validate((valid) => {
|
|
162
194
|
if (valid) {
|
|
163
|
-
this.$emit("saveData", this.formPop, () => {
|
|
195
|
+
this.$emit("saveData", this.formPop, () => {});
|
|
164
196
|
} else {
|
|
165
197
|
return false;
|
|
166
198
|
}
|
|
@@ -187,7 +219,8 @@ le-form-container {
|
|
|
187
219
|
margin-bottom: 0; // 使用grid的gap控制间距,不需要margin-bottom
|
|
188
220
|
}
|
|
189
221
|
|
|
190
|
-
.leisure-form-item-class {
|
|
222
|
+
.leisure-form-item-class {
|
|
223
|
+
}
|
|
191
224
|
|
|
192
225
|
.comContainerClass {
|
|
193
226
|
display: flex;
|
|
@@ -195,7 +228,7 @@ le-form-container {
|
|
|
195
228
|
line-height: inherit;
|
|
196
229
|
|
|
197
230
|
.compontClass {
|
|
198
|
-
flex: 1
|
|
231
|
+
flex: 1;
|
|
199
232
|
}
|
|
200
233
|
}
|
|
201
234
|
|