leisure-core 0.4.51 → 0.4.53
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/index.js +19 -72
- package/le-button/src/main.vue +6 -12
- package/le-button-msg/src/main.vue +9 -5
- package/le-button-select-media/src/main.vue +4 -2
- package/le-button-upload/src/main.vue +6 -2
- package/le-common-page/src/main.vue +27 -75
- package/le-common-page/src/sub.vue +122 -0
- package/le-form/index.js +7 -0
- package/le-form/src/main.vue +13 -0
- package/le-form-item/index.js +7 -0
- package/le-form-item/src/main.vue +13 -0
- package/le-help/src/main.vue +6 -2
- package/le-input/index.js +7 -0
- package/le-input/src/main.vue +17 -0
- package/le-input-number/index.js +7 -0
- package/le-input-number/src/main.vue +16 -0
- package/le-media-list/src/main.vue +1 -1
- package/le-role/src/main.vue +5 -5
- package/le-select/index.js +7 -0
- package/le-select/src/main.vue +27 -0
- package/le-select-search/index.js +7 -0
- package/le-select-search/src/main.vue +46 -0
- package/le-user/src/main.vue +1 -1
- package/package.json +5 -7
- package/le-ad/index.js +0 -7
- package/le-ad/src/main.vue +0 -137
- package/le-ad/src/sub.vue +0 -180
- package/le-ad-space/index.js +0 -7
- package/le-ad-space/src/main.vue +0 -135
- package/le-ad-space/src/sub.vue +0 -119
- package/le-commission/index.js +0 -7
- package/le-commission/src/main.vue +0 -175
- package/le-commission/src/sub.vue +0 -213
- package/le-commission-cp/index.js +0 -7
- package/le-commission-cp/src/main.vue +0 -170
- package/le-company/index.js +0 -7
- package/le-company/src/main.vue +0 -101
- package/le-company/src/sub.vue +0 -111
- package/le-coupon/index.js +0 -17
- package/le-coupon/src/details.vue +0 -196
- package/le-coupon/src/main.vue +0 -193
- package/le-coupon/src/sub.vue +0 -362
- package/le-coupon-give/index.js +0 -7
- package/le-coupon-give/src/main.vue +0 -110
- package/le-cp/index.js +0 -7
- package/le-cp/src/main.vue +0 -166
- package/le-cp/src/sub.vue +0 -174
- package/le-depart/index.js +0 -7
- package/le-depart/src/main.vue +0 -162
- package/le-distribution/index.js +0 -7
- package/le-distribution/src/main.vue +0 -85
- package/le-distribution-category/index.js +0 -7
- package/le-distribution-category/src/main.vue +0 -106
- package/le-distribution-category/src/sub.vue +0 -112
- package/le-integral/index.js +0 -7
- package/le-integral/src/main.vue +0 -198
- package/le-member/index.js +0 -7
- package/le-member/src/main.vue +0 -494
- package/le-member/src/other.vue +0 -240
- package/le-member-level/index.js +0 -7
- package/le-member-level/src/main.vue +0 -93
- package/le-member-level/src/sub.vue +0 -112
- package/le-promotions/index.js +0 -9
- package/le-promotions/src/main.vue +0 -220
- package/le-promotions/src/sub.vue +0 -248
- package/le-promotions-activities/index.js +0 -7
- package/le-promotions-activities/src/main.vue +0 -208
- package/le-promotions-activities/src/sub.vue +0 -212
- package/le-rate/index.js +0 -7
- package/le-rate/src/main.vue +0 -194
- package/le-rate/src/qrinfo.vue +0 -32
- package/le-rate/src/sub.vue +0 -183
- package/le-seting/index.js +0 -7
- package/le-seting/src/main.vue +0 -154
- package/le-user-type/index.js +0 -7
- package/le-user-type/src/main.vue +0 -39
package/index.js
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import LeDrag from "leisure-js/drag/drag.js";
|
|
2
1
|
import {
|
|
3
2
|
parseTime,
|
|
4
3
|
formatMoney,
|
|
5
4
|
formatCurrency,
|
|
6
5
|
} from "leisure-js/common/dformat";
|
|
7
6
|
import LeCommonPage from "./le-common-page/index.js";
|
|
8
|
-
import LeArea from "./le-area/index.js";
|
|
9
7
|
import LeLogin from "./le-login/index.js";
|
|
10
8
|
import LeHome from "./le-home/index.js";
|
|
11
9
|
import LeButton from "./le-button/index.js";
|
|
12
10
|
import LeButtonQr from "./le-button-qr/index.js";
|
|
13
11
|
import LeButtonMsg from "./le-button-msg/index.js";
|
|
14
|
-
import LeCompany from "./le-company/index.js";
|
|
15
12
|
import LeDialogContainer from "./le-dialog-container/index.js";
|
|
16
13
|
import LeRole from "./le-role/index.js";
|
|
17
14
|
import LeMenu from "./le-menu/index.js";
|
|
18
15
|
import LeRoleUser from "./le-role-user/index.js";
|
|
19
|
-
import LeDepart from "./le-depart/index.js";
|
|
20
|
-
import LeCouponGive from "./le-coupon-give/index.js";
|
|
21
16
|
import LeUser from "./le-user/index.js";
|
|
22
|
-
import LeUserType from "./le-user-type/index.js";
|
|
23
17
|
import LeMedia from "./le-media/index.js";
|
|
24
|
-
import LeIntegral from "./le-integral/index.js";
|
|
25
|
-
import LeMember from "./le-member/index.js";
|
|
26
|
-
import LeMemberLevel from "./le-member-level/index.js";
|
|
27
18
|
import LeMediaUpload from "./le-media-upload/index.js";
|
|
28
19
|
import LeMediaList from "./le-media-list/index.js";
|
|
29
20
|
import LeRichText from "./le-rich-text/index.js";
|
|
@@ -31,70 +22,50 @@ import LeButtonUpload from "./le-button-upload/index.js";
|
|
|
31
22
|
import LeButtonSelectMedia from "./le-button-select-media/index.js";
|
|
32
23
|
import LeImage from "./le-image/index.js";
|
|
33
24
|
import LeBackUp from "./le-backup/index.js";
|
|
34
|
-
import LeSeting from "./le-seting/index.js";
|
|
35
|
-
import LeRate from "./le-rate/index.js";
|
|
36
|
-
import { LeCoupon, LeCouponSub, LeCouponDetails } from "./le-coupon/index.js";
|
|
37
25
|
import LeUpload from "./le-upload/index.js";
|
|
38
|
-
import LePromotions from "./le-promotions/index.js";
|
|
39
|
-
import LePromotionsActivities from "./le-promotions-activities/index.js";
|
|
40
|
-
import LeCommission from "./le-commission/index.js";
|
|
41
|
-
import LeCommissionCp from "./le-commission-cp/index.js";
|
|
42
26
|
import LeMpurl from "./le-mpurl/index.js";
|
|
43
27
|
import { LeHelp, LeHelpDetail } from "./le-help/index.js";
|
|
44
|
-
import LeDistribution from "./le-distribution/index.js";
|
|
45
|
-
import LeDistributionCategory from "./le-distribution-category/index.js";
|
|
46
28
|
import LeSelectUser from "./le-select-user/index.js";
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
29
|
+
import LeArea from "./le-area/index.js";
|
|
30
|
+
import LeSelect from "./le-select/index.js";
|
|
31
|
+
import LeSelectSearch from "./le-select-search/index.js";
|
|
32
|
+
import LeInput from "./le-input/index.js";
|
|
33
|
+
import LeForm from "./le-form/index";
|
|
34
|
+
import LeFormItem from "./le-form-item/index";
|
|
35
|
+
import LeInputNumber from "./le-input-number/index.js";
|
|
50
36
|
|
|
51
37
|
const components = [
|
|
52
38
|
LeArea,
|
|
53
39
|
LeButton,
|
|
54
40
|
LeButtonQr,
|
|
55
41
|
LeButtonMsg,
|
|
56
|
-
LeCompany,
|
|
57
42
|
LeDialogContainer,
|
|
58
43
|
LeLogin,
|
|
59
44
|
LeHome,
|
|
60
45
|
LeMenu,
|
|
61
46
|
LeRole,
|
|
62
47
|
LeRoleUser,
|
|
63
|
-
LeDepart,
|
|
64
|
-
LeCouponGive,
|
|
65
48
|
LeUser,
|
|
66
|
-
LeUserType,
|
|
67
49
|
LeMedia,
|
|
68
50
|
LeMediaUpload,
|
|
69
|
-
LeIntegral,
|
|
70
|
-
LeMember,
|
|
71
|
-
LeMemberLevel,
|
|
72
51
|
LeMediaList,
|
|
73
52
|
LeRichText,
|
|
74
53
|
LeButtonUpload,
|
|
75
54
|
LeButtonSelectMedia,
|
|
76
55
|
LeImage,
|
|
77
56
|
LeBackUp,
|
|
78
|
-
LeSeting,
|
|
79
|
-
LeRate,
|
|
80
57
|
LeUpload,
|
|
81
|
-
LeCoupon,
|
|
82
|
-
LeCouponSub,
|
|
83
|
-
LeCouponDetails,
|
|
84
|
-
LePromotions,
|
|
85
|
-
LePromotionsActivities,
|
|
86
|
-
LeCommission,
|
|
87
|
-
LeCommissionCp,
|
|
88
58
|
LeMpurl,
|
|
89
59
|
LeHelp,
|
|
90
60
|
LeHelpDetail,
|
|
91
|
-
LeDistribution,
|
|
92
|
-
LeDistributionCategory,
|
|
93
61
|
LeSelectUser,
|
|
94
|
-
LeAdSpace,
|
|
95
|
-
LeAd,
|
|
96
|
-
LeCp,
|
|
97
62
|
LeCommonPage,
|
|
63
|
+
LeSelect,
|
|
64
|
+
LeSelectSearch,
|
|
65
|
+
LeInput,
|
|
66
|
+
LeInputNumber,
|
|
67
|
+
LeForm,
|
|
68
|
+
LeFormItem,
|
|
98
69
|
];
|
|
99
70
|
|
|
100
71
|
const install = function (Vue) {
|
|
@@ -126,8 +97,6 @@ const install = function (Vue) {
|
|
|
126
97
|
},
|
|
127
98
|
});
|
|
128
99
|
|
|
129
|
-
Vue.directive("el-drag-dialog", LeDrag);
|
|
130
|
-
|
|
131
100
|
// Vue.directive("rtable", {
|
|
132
101
|
// bind(el) {
|
|
133
102
|
// const { componentInstance: $table } = vnode;
|
|
@@ -158,59 +127,37 @@ const install = function (Vue) {
|
|
|
158
127
|
});
|
|
159
128
|
};
|
|
160
129
|
|
|
161
|
-
//判断是否是直接引入文件
|
|
162
|
-
if (typeof window !== "undefined" && window.Vue) {
|
|
163
|
-
window["el-drag-dialog"] = LeDrag;
|
|
164
|
-
install(window.Vue);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
130
|
export default {
|
|
168
131
|
install,
|
|
169
132
|
LeArea,
|
|
170
133
|
LeButton,
|
|
171
134
|
LeButtonQr,
|
|
172
135
|
LeButtonMsg,
|
|
173
|
-
LeCompany,
|
|
174
136
|
LeDialogContainer,
|
|
175
137
|
LeLogin,
|
|
176
138
|
LeHome,
|
|
177
139
|
LeMenu,
|
|
178
140
|
LeRole,
|
|
179
141
|
LeRoleUser,
|
|
180
|
-
LeDrag,
|
|
181
|
-
LeDepart,
|
|
182
|
-
LeCouponGive,
|
|
183
142
|
LeUser,
|
|
184
|
-
LeUserType,
|
|
185
143
|
LeMedia,
|
|
186
144
|
LeMediaUpload,
|
|
187
|
-
LeIntegral,
|
|
188
|
-
LeMember,
|
|
189
|
-
LeMemberLevel,
|
|
190
145
|
LeMediaList,
|
|
191
146
|
LeRichText,
|
|
192
147
|
LeButtonUpload,
|
|
193
148
|
LeButtonSelectMedia,
|
|
194
149
|
LeImage,
|
|
195
150
|
LeBackUp,
|
|
196
|
-
LeSeting,
|
|
197
|
-
LeRate,
|
|
198
151
|
LeUpload,
|
|
199
|
-
LeCoupon,
|
|
200
|
-
LeCouponSub,
|
|
201
|
-
LeCouponDetails,
|
|
202
|
-
LePromotions,
|
|
203
|
-
LePromotionsActivities,
|
|
204
|
-
LeCommission,
|
|
205
|
-
LeCommissionCp,
|
|
206
152
|
LeMpurl,
|
|
207
153
|
LeHelp,
|
|
208
154
|
LeHelpDetail,
|
|
209
|
-
LeDistribution,
|
|
210
|
-
LeDistributionCategory,
|
|
211
155
|
LeSelectUser,
|
|
212
|
-
LeAdSpace,
|
|
213
|
-
LeAd,
|
|
214
|
-
LeCp,
|
|
215
156
|
LeCommonPage,
|
|
157
|
+
LeSelect,
|
|
158
|
+
LeSelectSearch,
|
|
159
|
+
LeInput,
|
|
160
|
+
LeInputNumber,
|
|
161
|
+
LeForm,
|
|
162
|
+
LeFormItem,
|
|
216
163
|
};
|
package/le-button/src/main.vue
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-button
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
v-on="$listeners"
|
|
5
|
+
:class="['customClass', $attrs.class]"
|
|
6
|
+
:style="$attrs.style"
|
|
3
7
|
:id="id"
|
|
4
8
|
:type="type"
|
|
5
9
|
:size="size"
|
|
6
10
|
v-permission="$route.params.btns"
|
|
7
|
-
@click="click"
|
|
8
|
-
:disabled="disabled"
|
|
9
|
-
style="margin-left: 2px; margin-right: 2px"
|
|
10
11
|
v-if="disp"
|
|
11
|
-
>{{ text }}</el-button
|
|
12
|
+
><slot></slot>{{ text }}</el-button
|
|
12
13
|
>
|
|
13
14
|
</template>
|
|
14
15
|
<script>
|
|
@@ -33,21 +34,14 @@ export default {
|
|
|
33
34
|
},
|
|
34
35
|
text: {
|
|
35
36
|
type: String,
|
|
36
|
-
default: "
|
|
37
|
+
default: "",
|
|
37
38
|
},
|
|
38
39
|
disp: {
|
|
39
40
|
type: Boolean,
|
|
40
41
|
default: true,
|
|
41
42
|
},
|
|
42
|
-
disabled: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: false,
|
|
45
|
-
},
|
|
46
43
|
},
|
|
47
44
|
methods: {
|
|
48
|
-
click(param) {
|
|
49
|
-
this.$emit("click", param);
|
|
50
|
-
},
|
|
51
45
|
},
|
|
52
46
|
};
|
|
53
47
|
</script>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-popconfirm
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
v-on="$listeners"
|
|
5
|
+
:class="['customClass', $attrs.class]"
|
|
3
6
|
:title="title"
|
|
4
7
|
:id="id"
|
|
5
8
|
@confirm="click"
|
|
@@ -8,16 +11,17 @@
|
|
|
8
11
|
v-if="disp"
|
|
9
12
|
>
|
|
10
13
|
<template #reference>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
></el-button>
|
|
14
|
+
<le-button :type="type" :size="size" :text="text">
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</le-button>
|
|
15
17
|
</template>
|
|
16
18
|
</el-popconfirm>
|
|
17
19
|
</template>
|
|
18
20
|
<script>
|
|
21
|
+
import LeButton from "../../le-button/index";
|
|
19
22
|
export default {
|
|
20
23
|
name: "le-button-msg",
|
|
24
|
+
components: { LeButton },
|
|
21
25
|
props: {
|
|
22
26
|
id: {
|
|
23
27
|
type: String,
|
|
@@ -37,7 +41,7 @@ export default {
|
|
|
37
41
|
},
|
|
38
42
|
text: {
|
|
39
43
|
type: String,
|
|
40
|
-
default: "
|
|
44
|
+
default: "",
|
|
41
45
|
},
|
|
42
46
|
title: {
|
|
43
47
|
type: String,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="le-button-select-media">
|
|
3
|
-
<
|
|
4
|
-
>选择素材</
|
|
3
|
+
<le-button type="primary" id="btnSelectMedia" @click="onClick"
|
|
4
|
+
>选择素材</le-button
|
|
5
5
|
>
|
|
6
6
|
<le-dialog-container
|
|
7
7
|
:title="title"
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
<script>
|
|
22
|
+
import LeButton from "../../le-button/index";
|
|
22
23
|
export default {
|
|
23
24
|
name: "le-button-select-media",
|
|
25
|
+
components: { LeButton },
|
|
24
26
|
props: {
|
|
25
27
|
width: {
|
|
26
28
|
type: String,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
3
|
+
<le-button type="primary" id="btnUpload" @click="onClick">{{
|
|
4
4
|
title
|
|
5
|
-
}}</
|
|
5
|
+
}}</le-button>
|
|
6
6
|
<le-dialog-container
|
|
7
7
|
:title="title"
|
|
8
8
|
:showDialog="showDialog"
|
|
@@ -18,8 +18,12 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
<script>
|
|
21
|
+
import LeButton from "../../le-button/index";
|
|
21
22
|
export default {
|
|
22
23
|
name: "le-button-upload",
|
|
24
|
+
components: {
|
|
25
|
+
LeButton,
|
|
26
|
+
},
|
|
23
27
|
props: {
|
|
24
28
|
width: {
|
|
25
29
|
type: String,
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<slot name="paramSlot"></slot>
|
|
5
5
|
<el-form-item>
|
|
6
6
|
<slot></slot>
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
>新建</
|
|
7
|
+
<le-button type="primary" @click="onClickQuery()">查询</le-button>
|
|
8
|
+
<le-button type="primary" @click="addItem()" v-if="isDispAddBtn"
|
|
9
|
+
>新建</le-button
|
|
10
10
|
>
|
|
11
11
|
</el-form-item>
|
|
12
12
|
</el-form>
|
|
@@ -82,67 +82,32 @@
|
|
|
82
82
|
:title="popFormTitle"
|
|
83
83
|
:width="popFormWidth"
|
|
84
84
|
:showDialog="showDialog"
|
|
85
|
-
@close="closeDialog"
|
|
86
|
-
:showFooter="true"
|
|
87
|
-
@saveData="saveData"
|
|
88
85
|
>
|
|
89
|
-
<
|
|
90
|
-
:
|
|
91
|
-
:
|
|
92
|
-
|
|
93
|
-
:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
:prop="item.prop"
|
|
100
|
-
>
|
|
101
|
-
<el-input
|
|
102
|
-
v-if="!item.type || item.type === 'input'"
|
|
103
|
-
v-model="formPop[item.prop]"
|
|
104
|
-
/>
|
|
105
|
-
<el-input-number
|
|
106
|
-
v-else-if="item.type === 'number'"
|
|
107
|
-
v-model="formPop[item.prop]"
|
|
108
|
-
:min="item.min || 0"
|
|
109
|
-
:max="item.max || 9999999999"
|
|
110
|
-
label="item.label||''"
|
|
111
|
-
/>
|
|
112
|
-
<el-radio-group
|
|
113
|
-
v-else-if="item.type === 'radio'"
|
|
114
|
-
v-model="formPop[item.prop]"
|
|
115
|
-
>
|
|
116
|
-
<el-radio
|
|
117
|
-
v-for="(option, index) in item.options"
|
|
118
|
-
:label="option.id"
|
|
119
|
-
:key="index + '_radio'"
|
|
120
|
-
>{{ option.label }}</el-radio
|
|
121
|
-
>
|
|
122
|
-
</el-radio-group>
|
|
123
|
-
<el-select
|
|
124
|
-
v-else-if="item.type === 'select'"
|
|
125
|
-
v-model="formPop[item.prop]"
|
|
126
|
-
placeholder="请选择"
|
|
127
|
-
>
|
|
128
|
-
<el-option
|
|
129
|
-
v-for="option in getOptions(item.prop)"
|
|
130
|
-
:key="option.value"
|
|
131
|
-
:label="option.label"
|
|
132
|
-
:value="option.value"
|
|
133
|
-
/>
|
|
134
|
-
</el-select>
|
|
135
|
-
</el-form-item>
|
|
136
|
-
</el-form>
|
|
86
|
+
<le-common-page-sub
|
|
87
|
+
:rulePop="rules"
|
|
88
|
+
:popFormLabelWidth="popFormLabelWidth"
|
|
89
|
+
:formColumns="formColumns"
|
|
90
|
+
:field-options="fieldOptions"
|
|
91
|
+
:formData="rowItem"
|
|
92
|
+
@closeDialog="closeDialog"
|
|
93
|
+
@saveData="saveData"
|
|
94
|
+
v-if="showDialog"
|
|
95
|
+
></le-common-page-sub>
|
|
137
96
|
</le-dialog-container>
|
|
138
97
|
</div>
|
|
139
98
|
</template>
|
|
140
99
|
<script>
|
|
141
100
|
import { Number } from "core-js";
|
|
142
101
|
import leMixins from "../../le-libs/mixins/main";
|
|
102
|
+
import LeCommonPageSub from "./sub.vue";
|
|
103
|
+
import LeButton from "../../le-button/index";
|
|
143
104
|
export default {
|
|
144
105
|
name: "le-common-page",
|
|
145
106
|
mixins: [leMixins],
|
|
107
|
+
components: {
|
|
108
|
+
LeCommonPageSub,
|
|
109
|
+
LeButton,
|
|
110
|
+
},
|
|
146
111
|
props: {
|
|
147
112
|
tableData: {
|
|
148
113
|
type: Array,
|
|
@@ -164,7 +129,7 @@ export default {
|
|
|
164
129
|
type: Object,
|
|
165
130
|
default: () => {},
|
|
166
131
|
},
|
|
167
|
-
|
|
132
|
+
rules: {
|
|
168
133
|
type: Object,
|
|
169
134
|
default: () => {},
|
|
170
135
|
},
|
|
@@ -217,7 +182,7 @@ export default {
|
|
|
217
182
|
},
|
|
218
183
|
data() {
|
|
219
184
|
return {
|
|
220
|
-
|
|
185
|
+
rowItem: {},
|
|
221
186
|
searchData: {
|
|
222
187
|
pageNo: 1,
|
|
223
188
|
total: 1,
|
|
@@ -232,7 +197,7 @@ export default {
|
|
|
232
197
|
},
|
|
233
198
|
methods: {
|
|
234
199
|
initFormItem() {
|
|
235
|
-
this.
|
|
200
|
+
this.rowItem = this.formColumns.reduce((acc, item) => {
|
|
236
201
|
acc[item.prop] = item.default;
|
|
237
202
|
return acc;
|
|
238
203
|
}, {});
|
|
@@ -255,35 +220,22 @@ export default {
|
|
|
255
220
|
});
|
|
256
221
|
},
|
|
257
222
|
editItem(row) {
|
|
258
|
-
this.
|
|
223
|
+
this.rowItem = row;
|
|
259
224
|
this.showDialog = true;
|
|
260
225
|
},
|
|
261
226
|
addItem() {
|
|
262
227
|
this.initFormItem();
|
|
263
228
|
this.showDialog = true;
|
|
264
229
|
},
|
|
265
|
-
saveData() {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
if (valid) {
|
|
270
|
-
this.$emit("saveForm", this.formPop, () => {
|
|
271
|
-
this.getList();
|
|
272
|
-
this.closeDialog();
|
|
273
|
-
});
|
|
274
|
-
} else {
|
|
275
|
-
return false;
|
|
276
|
-
}
|
|
230
|
+
saveData(params) {
|
|
231
|
+
this.$emit("saveForm", params, () => {
|
|
232
|
+
this.getList();
|
|
233
|
+
this.closeDialog();
|
|
277
234
|
});
|
|
278
235
|
},
|
|
279
236
|
closeDialog() {
|
|
280
|
-
this.initFormItem();
|
|
281
237
|
this.showDialog = false;
|
|
282
238
|
},
|
|
283
|
-
getOptions(prop) {
|
|
284
|
-
let options = this.fieldOptions[`${prop}Options`] || [];
|
|
285
|
-
return options;
|
|
286
|
-
},
|
|
287
239
|
},
|
|
288
240
|
};
|
|
289
241
|
</script>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form
|
|
3
|
+
:model="formPop"
|
|
4
|
+
:rules="rulePop"
|
|
5
|
+
ref="ruleForm"
|
|
6
|
+
:label-width="popFormLabelWidth"
|
|
7
|
+
>
|
|
8
|
+
<el-form-item
|
|
9
|
+
v-for="(item, index) in formColumns"
|
|
10
|
+
:key="index"
|
|
11
|
+
:label="item.label"
|
|
12
|
+
:prop="item.prop"
|
|
13
|
+
>
|
|
14
|
+
<le-input
|
|
15
|
+
v-if="!item.type || item.type === 'input'"
|
|
16
|
+
v-model="formPop[item.prop]"
|
|
17
|
+
/>
|
|
18
|
+
<le-input-number
|
|
19
|
+
v-else-if="item.type === 'number'"
|
|
20
|
+
v-model="formPop[item.prop]"
|
|
21
|
+
:min="item.min || 0"
|
|
22
|
+
:max="item.max || 9999999999"
|
|
23
|
+
label="item.label||''"
|
|
24
|
+
/>
|
|
25
|
+
<el-radio-group
|
|
26
|
+
v-else-if="item.type === 'radio'"
|
|
27
|
+
v-model="formPop[item.prop]"
|
|
28
|
+
>
|
|
29
|
+
<el-radio
|
|
30
|
+
v-for="(option, index) in item.options"
|
|
31
|
+
:label="option.id"
|
|
32
|
+
:key="index + '_radio'"
|
|
33
|
+
>{{ option.label }}</el-radio
|
|
34
|
+
>
|
|
35
|
+
</el-radio-group>
|
|
36
|
+
<le-select
|
|
37
|
+
v-else-if="item.type === 'select'"
|
|
38
|
+
v-model="formPop[item.prop]"
|
|
39
|
+
placeholder="请选择"
|
|
40
|
+
>
|
|
41
|
+
<el-option
|
|
42
|
+
v-for="option in getOptions(item.prop)"
|
|
43
|
+
:key="option.value"
|
|
44
|
+
:label="option.label"
|
|
45
|
+
:value="option.value"
|
|
46
|
+
/>
|
|
47
|
+
</le-select>
|
|
48
|
+
</el-form-item>
|
|
49
|
+
<el-form-item v-rfooter>
|
|
50
|
+
<le-button type="primary" @click="saveData">保存</le-button>
|
|
51
|
+
<le-button type="info" @click="close()">关闭</le-button>
|
|
52
|
+
</el-form-item>
|
|
53
|
+
</el-form>
|
|
54
|
+
</template>
|
|
55
|
+
<script>
|
|
56
|
+
import LeSelect from "../../le-select/index";
|
|
57
|
+
import LeInput from "../../le-input/index";
|
|
58
|
+
import LeButton from "../../le-button/index";
|
|
59
|
+
// import LeForm from "../../le-form/index";
|
|
60
|
+
// import LeFormItem from "../../le-form-item/index";
|
|
61
|
+
export default {
|
|
62
|
+
name: "le-common-page-sub",
|
|
63
|
+
components: { LeSelect, LeInput, LeButton },
|
|
64
|
+
props: {
|
|
65
|
+
formColumns: {
|
|
66
|
+
type: Array,
|
|
67
|
+
default: () => [],
|
|
68
|
+
},
|
|
69
|
+
formData: {
|
|
70
|
+
type: Object,
|
|
71
|
+
default: () => {},
|
|
72
|
+
},
|
|
73
|
+
rulePop: {
|
|
74
|
+
type: Object,
|
|
75
|
+
default: () => {},
|
|
76
|
+
},
|
|
77
|
+
popFormLabelWidth: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: "100px",
|
|
80
|
+
},
|
|
81
|
+
fieldOptions: {
|
|
82
|
+
type: Object,
|
|
83
|
+
default: () => {},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
watch: {
|
|
87
|
+
formData: {
|
|
88
|
+
handler(val) {
|
|
89
|
+
this.formPop = val;
|
|
90
|
+
},
|
|
91
|
+
deep: true,
|
|
92
|
+
immediate: true,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
data() {
|
|
96
|
+
return {
|
|
97
|
+
formPop: {},
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
computed: {},
|
|
101
|
+
mounted() {},
|
|
102
|
+
methods: {
|
|
103
|
+
close() {
|
|
104
|
+
this.$emit("closeDialog");
|
|
105
|
+
},
|
|
106
|
+
saveData() {
|
|
107
|
+
this.$refs["ruleForm"].validate((valid) => {
|
|
108
|
+
if (valid) {
|
|
109
|
+
this.$emit("saveData", this.formPop, () => {});
|
|
110
|
+
} else {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
getOptions(prop) {
|
|
116
|
+
let options = this.fieldOptions[`${prop}Options`] || [];
|
|
117
|
+
return options;
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
</script>
|
|
122
|
+
<style lang="less" scoped></style>
|
package/le-form/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<le-form-item v-bind="$attrs" v-on="$listeners" :style="$attrs.style">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</le-form-item>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
export default {
|
|
8
|
+
name: "le-form-item",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: {},
|
|
11
|
+
methods: {},
|
|
12
|
+
};
|
|
13
|
+
</script>
|
package/le-help/src/main.vue
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
</el-table-column>
|
|
13
13
|
<el-table-column fixed="right" label="操作" align="center" width="180">
|
|
14
14
|
<template slot-scope="scope">
|
|
15
|
-
<le-button
|
|
16
|
-
<le-button-msg @click="del(scope.row.id)"
|
|
15
|
+
<le-button @click="edit(scope.row)">编辑</le-button>
|
|
16
|
+
<le-button-msg @click="del(scope.row.id)">删除</le-button-msg>
|
|
17
17
|
</template>
|
|
18
18
|
</el-table-column>
|
|
19
19
|
</el-table>
|
|
@@ -47,10 +47,14 @@
|
|
|
47
47
|
<script>
|
|
48
48
|
import { list, edit, del } from "@/api/SystemHelp";
|
|
49
49
|
import { LeEditor } from "leisure-editor";
|
|
50
|
+
import leButton from "../../le-button/index";
|
|
51
|
+
import LeButtonMsg from "../../le-button-msg/index";
|
|
50
52
|
export default {
|
|
51
53
|
name: "le-help",
|
|
52
54
|
components: {
|
|
53
55
|
LeEditor,
|
|
56
|
+
leButton,
|
|
57
|
+
LeButtonMsg,
|
|
54
58
|
},
|
|
55
59
|
data() {
|
|
56
60
|
return {
|