leisure-core 0.4.64 → 0.4.66
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 +3 -0
- package/le-common-page/src/main.vue +79 -12
- package/le-common-page/src/sub.vue +68 -39
- package/le-mpurl/src/main.vue +1 -1
- package/le-option/index.js +7 -0
- package/le-option/src/main.vue +49 -0
- package/le-select/src/main.vue +1 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import LeInput from "./le-input/index.js";
|
|
|
34
34
|
import LeForm from "./le-form/index";
|
|
35
35
|
import LeFormItem from "./le-form-item/index";
|
|
36
36
|
import LeInputNumber from "./le-input-number/index.js";
|
|
37
|
+
import LeOption from "./le-option/index.js";
|
|
37
38
|
|
|
38
39
|
const components = [
|
|
39
40
|
LeArea,
|
|
@@ -67,6 +68,7 @@ const components = [
|
|
|
67
68
|
LeInputNumber,
|
|
68
69
|
LeForm,
|
|
69
70
|
LeFormItem,
|
|
71
|
+
LeOption,
|
|
70
72
|
];
|
|
71
73
|
|
|
72
74
|
const install = function (Vue) {
|
|
@@ -168,4 +170,5 @@ export default {
|
|
|
168
170
|
LeInputNumber,
|
|
169
171
|
LeForm,
|
|
170
172
|
LeFormItem,
|
|
173
|
+
LeOption,
|
|
171
174
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<le-button type="primary" @click="addItem()" v-if="isDispAddBtn"
|
|
9
9
|
>新建</le-button
|
|
10
10
|
>
|
|
11
|
+
<slot name="headerBtns"></slot>
|
|
11
12
|
</el-form-item>
|
|
12
13
|
</el-form>
|
|
13
14
|
<el-table
|
|
@@ -23,11 +24,11 @@
|
|
|
23
24
|
>
|
|
24
25
|
<el-table-column
|
|
25
26
|
v-for="column in tableColumns"
|
|
27
|
+
show-overflow-tooltip
|
|
26
28
|
:key="column.prop"
|
|
27
29
|
:prop="column.prop"
|
|
28
30
|
:label="column.label"
|
|
29
31
|
:width="column.width"
|
|
30
|
-
:formatter="column.formatter"
|
|
31
32
|
>
|
|
32
33
|
<template #default="scope">
|
|
33
34
|
<span v-if="column.type && column.type === 'url'">
|
|
@@ -39,16 +40,44 @@
|
|
|
39
40
|
{{ scope.row[column.prop] == 1 ? "是" : "否" }}
|
|
40
41
|
</span>
|
|
41
42
|
<span v-else>
|
|
42
|
-
|
|
43
|
+
<template v-if="column.formatter">
|
|
44
|
+
{{
|
|
45
|
+
column.formatter(
|
|
46
|
+
scope.rows,
|
|
47
|
+
scope.column,
|
|
48
|
+
scope.row[column.prop]
|
|
49
|
+
)
|
|
50
|
+
}}
|
|
51
|
+
</template>
|
|
52
|
+
<template v-else>
|
|
53
|
+
{{ scope.row[column.prop] }}
|
|
54
|
+
</template>
|
|
43
55
|
</span>
|
|
44
56
|
</template>
|
|
45
57
|
</el-table-column>
|
|
46
|
-
<el-table-column
|
|
58
|
+
<el-table-column
|
|
59
|
+
fixed="right"
|
|
60
|
+
label="操作"
|
|
61
|
+
:width="opWidht"
|
|
62
|
+
align="center"
|
|
63
|
+
>
|
|
47
64
|
<template slot-scope="scope">
|
|
48
65
|
<div class="rowBtns">
|
|
49
|
-
<el-button
|
|
50
|
-
|
|
66
|
+
<el-button
|
|
67
|
+
v-if="disBtn === 'edit'"
|
|
68
|
+
type="primary"
|
|
69
|
+
size="small"
|
|
70
|
+
@click="editItem(scope.row)"
|
|
51
71
|
>
|
|
72
|
+
编辑
|
|
73
|
+
</el-button>
|
|
74
|
+
<el-button
|
|
75
|
+
v-if="disBtn === 'detail'"
|
|
76
|
+
type="primary"
|
|
77
|
+
size="small"
|
|
78
|
+
@click="detail(scope.row)"
|
|
79
|
+
>详情
|
|
80
|
+
</el-button>
|
|
52
81
|
<el-popconfirm
|
|
53
82
|
v-if="isDispDelBtn"
|
|
54
83
|
:title="`该操作不可逆,确定删除?`"
|
|
@@ -61,7 +90,7 @@
|
|
|
61
90
|
</template>
|
|
62
91
|
</el-popconfirm>
|
|
63
92
|
<div class="rowBtnsExt">
|
|
64
|
-
<slot name="rowBtns"></slot>
|
|
93
|
+
<slot name="rowBtns" :scope="scope"></slot>
|
|
65
94
|
</div>
|
|
66
95
|
</div>
|
|
67
96
|
</template>
|
|
@@ -89,10 +118,13 @@
|
|
|
89
118
|
:formColumns="formColumns"
|
|
90
119
|
:field-options="fieldOptions"
|
|
91
120
|
:formData="rowItem"
|
|
121
|
+
:isEditMode="isEditMode"
|
|
92
122
|
@closeDialog="closeDialog"
|
|
93
123
|
@saveData="saveData"
|
|
94
|
-
v-if="showDialog"
|
|
95
|
-
|
|
124
|
+
v-if="showDialog && isUserInnerSub"
|
|
125
|
+
>
|
|
126
|
+
</le-common-page-sub>
|
|
127
|
+
<slot name="sub" v-if="showDialog && !isUserInnerSub"></slot>
|
|
96
128
|
</le-dialog-container>
|
|
97
129
|
</div>
|
|
98
130
|
</template>
|
|
@@ -113,6 +145,10 @@ export default {
|
|
|
113
145
|
type: Array,
|
|
114
146
|
default: () => [],
|
|
115
147
|
},
|
|
148
|
+
opWidht: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: "100px",
|
|
151
|
+
},
|
|
116
152
|
totalData: {
|
|
117
153
|
type: Number,
|
|
118
154
|
default: 1,
|
|
@@ -121,6 +157,10 @@ export default {
|
|
|
121
157
|
type: Array,
|
|
122
158
|
default: () => [],
|
|
123
159
|
},
|
|
160
|
+
isUserInnerSub: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
default: true,
|
|
163
|
+
},
|
|
124
164
|
formColumns: {
|
|
125
165
|
type: Array,
|
|
126
166
|
default: () => [],
|
|
@@ -147,7 +187,7 @@ export default {
|
|
|
147
187
|
},
|
|
148
188
|
popFormWidth: {
|
|
149
189
|
type: String,
|
|
150
|
-
default: "
|
|
190
|
+
default: "60%",
|
|
151
191
|
},
|
|
152
192
|
popFormLabelWidth: {
|
|
153
193
|
type: String,
|
|
@@ -165,6 +205,10 @@ export default {
|
|
|
165
205
|
type: Object,
|
|
166
206
|
default: () => {},
|
|
167
207
|
},
|
|
208
|
+
disBtn: {
|
|
209
|
+
type: String,
|
|
210
|
+
default: "edit",
|
|
211
|
+
},
|
|
168
212
|
},
|
|
169
213
|
watch: {
|
|
170
214
|
searchParam: {
|
|
@@ -189,6 +233,7 @@ export default {
|
|
|
189
233
|
pageSize: 10,
|
|
190
234
|
},
|
|
191
235
|
showDialog: false,
|
|
236
|
+
isEditMode: true,
|
|
192
237
|
};
|
|
193
238
|
},
|
|
194
239
|
computed: {},
|
|
@@ -220,10 +265,31 @@ export default {
|
|
|
220
265
|
});
|
|
221
266
|
},
|
|
222
267
|
editItem(row) {
|
|
223
|
-
this.
|
|
224
|
-
this
|
|
268
|
+
this.isEditMode = true;
|
|
269
|
+
if (this.$listeners["handleData"]) {
|
|
270
|
+
this.$emit("handleData", row, (res) => {
|
|
271
|
+
this.rowItem = res;
|
|
272
|
+
this.showDialog = true;
|
|
273
|
+
});
|
|
274
|
+
} else {
|
|
275
|
+
this.rowItem = row;
|
|
276
|
+
this.showDialog = true;
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
detail(row) {
|
|
280
|
+
this.isEditMode = false;
|
|
281
|
+
if (this.$listeners["handleData"]) {
|
|
282
|
+
this.$emit("handleData", row, (res) => {
|
|
283
|
+
this.rowItem = res;
|
|
284
|
+
this.showDialog = true;
|
|
285
|
+
});
|
|
286
|
+
} else {
|
|
287
|
+
this.rowItem = row;
|
|
288
|
+
this.showDialog = true;
|
|
289
|
+
}
|
|
225
290
|
},
|
|
226
291
|
addItem() {
|
|
292
|
+
this.isEditMode = true;
|
|
227
293
|
this.initFormItem();
|
|
228
294
|
this.showDialog = true;
|
|
229
295
|
},
|
|
@@ -243,10 +309,11 @@ export default {
|
|
|
243
309
|
.rowBtns {
|
|
244
310
|
display: flex;
|
|
245
311
|
display: -webkit-flex;
|
|
312
|
+
flex-direction: row;
|
|
246
313
|
justify-content: center;
|
|
247
314
|
}
|
|
248
315
|
|
|
249
316
|
.rowBtnsExt {
|
|
250
|
-
margin-left:
|
|
317
|
+
margin-left: 3px;
|
|
251
318
|
}
|
|
252
319
|
</style>
|
|
@@ -11,43 +11,58 @@
|
|
|
11
11
|
:label="item.label"
|
|
12
12
|
:prop="item.prop"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
v-
|
|
31
|
-
:label="option.id"
|
|
32
|
-
:key="index + '_radio'"
|
|
33
|
-
>{{ option.label }}</el-radio
|
|
14
|
+
<div class="comContainerClass">
|
|
15
|
+
<le-input
|
|
16
|
+
v-if="!item.type || item.type === 'input'"
|
|
17
|
+
v-model="formPop[item.prop]"
|
|
18
|
+
v-bind="item.attr || {}"
|
|
19
|
+
/>
|
|
20
|
+
<le-input-number
|
|
21
|
+
v-else-if="item.type === 'number'"
|
|
22
|
+
v-model="formPop[item.prop]"
|
|
23
|
+
v-bind="item.attr || {}"
|
|
24
|
+
:min="item.min || 0"
|
|
25
|
+
:max="item.max || 9999999999"
|
|
26
|
+
label="item.label||''"
|
|
27
|
+
/>
|
|
28
|
+
<el-radio-group
|
|
29
|
+
v-else-if="item.type === 'radio'"
|
|
30
|
+
v-model="formPop[item.prop]"
|
|
34
31
|
>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
<el-radio
|
|
33
|
+
v-for="(option, index) in item.options"
|
|
34
|
+
:label="option.id"
|
|
35
|
+
:key="index + '_radio'"
|
|
36
|
+
>{{ option.label }}</el-radio
|
|
37
|
+
>
|
|
38
|
+
</el-radio-group>
|
|
39
|
+
<el-date-picker
|
|
40
|
+
v-else-if="item.type === 'date'"
|
|
41
|
+
v-model="formPop[item.prop]"
|
|
42
|
+
v-bind="item.attr || {}"
|
|
43
|
+
value-format="timestamp"
|
|
44
|
+
type="date"
|
|
45
|
+
placeholder="选择日期"
|
|
46
46
|
/>
|
|
47
|
-
|
|
47
|
+
<le-select
|
|
48
|
+
v-else-if="item.type === 'select'"
|
|
49
|
+
v-model="formPop[item.prop]"
|
|
50
|
+
v-bind="item.attr || {}"
|
|
51
|
+
placeholder="请选择"
|
|
52
|
+
>
|
|
53
|
+
<le-option
|
|
54
|
+
:options="fieldOptions[item.prop]"
|
|
55
|
+
:label="item.kv.label"
|
|
56
|
+
:value="item.kv.key"
|
|
57
|
+
:keyNum="item.keyNum"
|
|
58
|
+
/>
|
|
59
|
+
</le-select>
|
|
60
|
+
</div>
|
|
48
61
|
</el-form-item>
|
|
49
62
|
<el-form-item v-rfooter>
|
|
50
|
-
<le-button type="primary" @click="saveData"
|
|
63
|
+
<le-button type="primary" @click="saveData" v-if="isEditMode"
|
|
64
|
+
>保存</le-button
|
|
65
|
+
>
|
|
51
66
|
<le-button type="info" @click="close()">关闭</le-button>
|
|
52
67
|
</el-form-item>
|
|
53
68
|
</el-form>
|
|
@@ -56,9 +71,10 @@
|
|
|
56
71
|
import LeSelect from "../../le-select/index";
|
|
57
72
|
import LeInput from "../../le-input/index";
|
|
58
73
|
import LeButton from "../../le-button/index";
|
|
74
|
+
import LeOption from "../../le-option/index";
|
|
59
75
|
export default {
|
|
60
76
|
name: "le-common-page-sub",
|
|
61
|
-
components: { LeSelect, LeInput, LeButton },
|
|
77
|
+
components: { LeSelect, LeInput, LeButton, LeOption },
|
|
62
78
|
props: {
|
|
63
79
|
formColumns: {
|
|
64
80
|
type: Array,
|
|
@@ -80,6 +96,10 @@ export default {
|
|
|
80
96
|
type: Object,
|
|
81
97
|
default: () => {},
|
|
82
98
|
},
|
|
99
|
+
isEditMode: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: true,
|
|
102
|
+
},
|
|
83
103
|
},
|
|
84
104
|
watch: {
|
|
85
105
|
formData: {
|
|
@@ -89,10 +109,18 @@ export default {
|
|
|
89
109
|
deep: true,
|
|
90
110
|
immediate: true,
|
|
91
111
|
},
|
|
112
|
+
fieldOptions: {
|
|
113
|
+
handler(val) {
|
|
114
|
+
this.options = val;
|
|
115
|
+
},
|
|
116
|
+
deep: true,
|
|
117
|
+
immediate: true,
|
|
118
|
+
},
|
|
92
119
|
},
|
|
93
120
|
data() {
|
|
94
121
|
return {
|
|
95
122
|
formPop: {},
|
|
123
|
+
options: {}, //{field1:[{value:1,label:'选项1'},{value:2,label:'选项2'}]}
|
|
96
124
|
};
|
|
97
125
|
},
|
|
98
126
|
computed: {},
|
|
@@ -110,11 +138,12 @@ export default {
|
|
|
110
138
|
}
|
|
111
139
|
});
|
|
112
140
|
},
|
|
113
|
-
getOptions(prop) {
|
|
114
|
-
let options = this.fieldOptions[`${prop}Options`] || [];
|
|
115
|
-
return options;
|
|
116
|
-
},
|
|
117
141
|
},
|
|
118
142
|
};
|
|
119
143
|
</script>
|
|
120
|
-
<style lang="
|
|
144
|
+
<style lang="scss" scoped>
|
|
145
|
+
.comContainerClass {
|
|
146
|
+
display: flex;
|
|
147
|
+
display: -webkit-flex;
|
|
148
|
+
}
|
|
149
|
+
</style>
|
package/le-mpurl/src/main.vue
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<el-table-column prop="mp_param" label="参数" width="50"> </el-table-column>
|
|
16
16
|
<el-table-column prop="wx_url" label="微信url" width="100">
|
|
17
17
|
</el-table-column>
|
|
18
|
-
<el-table-column prop="url_jump" label="推广链接" width="200">
|
|
18
|
+
<el-table-column prop="url_jump" label="推广链接(仅系统使用)" width="200">
|
|
19
19
|
</el-table-column>
|
|
20
20
|
<!-- <el-table-column prop="url_wx" label="小程序url地址"> </el-table-column> -->
|
|
21
21
|
<el-table-column prop="cdate" label="时间" width="150">
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-option
|
|
4
|
+
v-for="item in options"
|
|
5
|
+
:key="handleKv('key', item)"
|
|
6
|
+
:label="handleKv('label', item)"
|
|
7
|
+
:value="handleKv('value', item)"
|
|
8
|
+
></el-option>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: "le-options",
|
|
14
|
+
props: {
|
|
15
|
+
options: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default() {
|
|
18
|
+
return [];
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
value: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "",
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "",
|
|
28
|
+
},
|
|
29
|
+
keyNum: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 1,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
handleKv(type, item) {
|
|
36
|
+
if (this.keyNum == 1) {
|
|
37
|
+
if (type == "key" || type == "value") {
|
|
38
|
+
return item[this.value];
|
|
39
|
+
} else if (type == "label") {
|
|
40
|
+
return item[this.label];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (this.keyNum == 2) {
|
|
44
|
+
return item[this.value] + "-" + item[this.label];
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
</script>
|
package/le-select/src/main.vue
CHANGED