leisure-core 0.6.85 → 0.6.86
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 +9 -9
- package/le-media/src/main.vue +28 -3
- package/le-media-list/src/main.vue +6 -2
- package/le-media-upload/src/main.vue +26 -8
- package/package.json +1 -1
- package/le-button-select-media/index.js +0 -7
- package/le-button-select-media/src/main.vue +0 -74
- package/le-button-upload/index.js +0 -7
- package/le-button-upload/src/main.vue +0 -50
- package/le-image-container/index.js +0 -7
- package/le-image-container/src/main.vue +0 -155
package/index.js
CHANGED
|
@@ -16,10 +16,10 @@ import LeMedia from "./le-media/index.js";
|
|
|
16
16
|
import LeMediaUpload from "./le-media-upload/index.js";
|
|
17
17
|
import LeMediaList from "./le-media-list/index.js";
|
|
18
18
|
|
|
19
|
-
import LeButtonUpload from "./le-button-upload/index.js";
|
|
20
|
-
import LeButtonSelectMedia from "./le-button-select-media/index.js";
|
|
19
|
+
// import LeButtonUpload from "./le-button-upload/index.js";
|
|
20
|
+
// import LeButtonSelectMedia from "./le-button-select-media/index.js";
|
|
21
21
|
import LeImage from "./le-image/index.js";
|
|
22
|
-
import LeImageContainer from "./le-image-container/index.js";
|
|
22
|
+
// import LeImageContainer from "./le-image-container/index.js";
|
|
23
23
|
|
|
24
24
|
import LeUpload from "./le-upload/index.js";
|
|
25
25
|
|
|
@@ -60,9 +60,9 @@ const components = [
|
|
|
60
60
|
LeMediaUpload,
|
|
61
61
|
LeMediaList,
|
|
62
62
|
|
|
63
|
-
LeButtonUpload,
|
|
64
|
-
LeButtonSelectMedia,
|
|
65
|
-
LeImageContainer,
|
|
63
|
+
// LeButtonUpload,
|
|
64
|
+
// LeButtonSelectMedia,
|
|
65
|
+
// LeImageContainer,
|
|
66
66
|
LeImage,
|
|
67
67
|
|
|
68
68
|
LeUpload,
|
|
@@ -173,9 +173,9 @@ export default {
|
|
|
173
173
|
LeMediaUpload,
|
|
174
174
|
LeMediaList,
|
|
175
175
|
|
|
176
|
-
LeButtonUpload,
|
|
177
|
-
LeButtonSelectMedia,
|
|
178
|
-
LeImageContainer,
|
|
176
|
+
// LeButtonUpload,
|
|
177
|
+
// LeButtonSelectMedia,
|
|
178
|
+
// LeImageContainer,
|
|
179
179
|
LeImage,
|
|
180
180
|
LeUpload,
|
|
181
181
|
LeHelp,
|
package/le-media/src/main.vue
CHANGED
|
@@ -79,16 +79,41 @@
|
|
|
79
79
|
v-if="uploadMediaShow"
|
|
80
80
|
@cancel="cancelUploadMedia"
|
|
81
81
|
:mediaObj="mediaObj"
|
|
82
|
+
:systemMaterialCreateApi="systemMaterialCreateApi"
|
|
83
|
+
:systemMaterialEditApi="systemMaterialEditApi"
|
|
84
|
+
:uploadFileApi="uploadFileApi"
|
|
82
85
|
></le-media-upload>
|
|
83
86
|
</el-dialog>
|
|
84
87
|
</div>
|
|
85
88
|
</template>
|
|
86
89
|
<script>
|
|
87
|
-
import { systemMaterialDel, systemMaterialList } from "@/api/media";
|
|
90
|
+
// import { systemMaterialDel, systemMaterialList } from "@/api/media";
|
|
88
91
|
import { mapGetters } from "vuex";
|
|
89
92
|
|
|
90
93
|
export default {
|
|
91
94
|
name: "le-media",
|
|
95
|
+
props: {
|
|
96
|
+
systemMaterialDelApi: {
|
|
97
|
+
type: Function,
|
|
98
|
+
required: true,
|
|
99
|
+
},
|
|
100
|
+
systemMaterialListApi: {
|
|
101
|
+
type: Function,
|
|
102
|
+
required: true,
|
|
103
|
+
},
|
|
104
|
+
systemMaterialCreateApi: {
|
|
105
|
+
type: Function,
|
|
106
|
+
required: true,
|
|
107
|
+
},
|
|
108
|
+
systemMaterialEditApi: {
|
|
109
|
+
type: Function,
|
|
110
|
+
required: true,
|
|
111
|
+
},
|
|
112
|
+
uploadFileApi: {
|
|
113
|
+
type: Function,
|
|
114
|
+
required: true,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
92
117
|
data() {
|
|
93
118
|
return {
|
|
94
119
|
tableData: [],
|
|
@@ -124,7 +149,7 @@ export default {
|
|
|
124
149
|
type: "error",
|
|
125
150
|
})
|
|
126
151
|
.then(() => {
|
|
127
|
-
|
|
152
|
+
this.systemMaterialDelApi({ id: id }).then((res) => {
|
|
128
153
|
this.list();
|
|
129
154
|
if (res.data.code == "10000") {
|
|
130
155
|
this.$message.success("删除成功");
|
|
@@ -166,7 +191,7 @@ export default {
|
|
|
166
191
|
group: this.group,
|
|
167
192
|
title: this.title,
|
|
168
193
|
};
|
|
169
|
-
|
|
194
|
+
this.systemMaterialListApi(params).then((res) => {
|
|
170
195
|
if (res.data.code == "10000") {
|
|
171
196
|
this.mediaList = res.data.data.list;
|
|
172
197
|
this.total = res.data.data.count;
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
</div>
|
|
84
84
|
</template>
|
|
85
85
|
<script>
|
|
86
|
-
import { systemMaterialList } from "@/api/media";
|
|
86
|
+
// import { systemMaterialList } from "@/api/media";
|
|
87
87
|
import leMixins from "../../le-libs/mixins/main"; //
|
|
88
88
|
export default {
|
|
89
89
|
name: "le-media-list",
|
|
@@ -93,6 +93,10 @@ export default {
|
|
|
93
93
|
type: Boolean,
|
|
94
94
|
default: true,
|
|
95
95
|
},
|
|
96
|
+
systemMaterialListApi: {
|
|
97
|
+
type: Function,
|
|
98
|
+
required: true,
|
|
99
|
+
},
|
|
96
100
|
},
|
|
97
101
|
data() {
|
|
98
102
|
return {
|
|
@@ -146,7 +150,7 @@ export default {
|
|
|
146
150
|
title: this.title,
|
|
147
151
|
types: this.types,
|
|
148
152
|
};
|
|
149
|
-
|
|
153
|
+
this.systemMaterialListApi(params).then((res) => {
|
|
150
154
|
if (res.data.code == "10000") {
|
|
151
155
|
this.resultData = res.data.data.list;
|
|
152
156
|
this.total = res.data.data.count;
|
|
@@ -98,11 +98,29 @@
|
|
|
98
98
|
</el-form>
|
|
99
99
|
</template>
|
|
100
100
|
<script>
|
|
101
|
-
import { uploadFile } from "@/api/upload";
|
|
102
|
-
import { systemMaterialCreate, systemMaterialEdit } from "@/api/media";
|
|
101
|
+
// import { uploadFile } from "@/api/upload";
|
|
102
|
+
// import { systemMaterialCreate, systemMaterialEdit } from "@/api/media";
|
|
103
103
|
export default {
|
|
104
104
|
name: "le-media-upload",
|
|
105
|
-
props: ["mediaObj"],
|
|
105
|
+
// props: ["mediaObj"],
|
|
106
|
+
props: {
|
|
107
|
+
mediaObj: {
|
|
108
|
+
type: Object,
|
|
109
|
+
required: true,
|
|
110
|
+
},
|
|
111
|
+
systemMaterialCreateApi: {
|
|
112
|
+
type: Function,
|
|
113
|
+
required: true,
|
|
114
|
+
},
|
|
115
|
+
systemMaterialEditApi: {
|
|
116
|
+
type: Function,
|
|
117
|
+
required: true,
|
|
118
|
+
},
|
|
119
|
+
uploadFileApi: {
|
|
120
|
+
type: Function,
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
106
124
|
data() {
|
|
107
125
|
return {
|
|
108
126
|
form: {
|
|
@@ -164,7 +182,7 @@ export default {
|
|
|
164
182
|
}
|
|
165
183
|
} else {
|
|
166
184
|
this.$message.error(
|
|
167
|
-
"请上传素材" + (this.form.types == 1 ? "图片" : "视频")
|
|
185
|
+
"请上传素材" + (this.form.types == 1 ? "图片" : "视频"),
|
|
168
186
|
);
|
|
169
187
|
}
|
|
170
188
|
},
|
|
@@ -196,7 +214,7 @@ export default {
|
|
|
196
214
|
this.$message.error("上传图片总大小不能超过 100MB!");
|
|
197
215
|
return;
|
|
198
216
|
}
|
|
199
|
-
|
|
217
|
+
this.uploadFileApi(formData).then((res) => {
|
|
200
218
|
let address = res.data.data;
|
|
201
219
|
if (address && address.length > 0) {
|
|
202
220
|
if (this.form.id) {
|
|
@@ -223,7 +241,7 @@ export default {
|
|
|
223
241
|
this.$message.error("上传视频总大小不能超过 100MB!");
|
|
224
242
|
return;
|
|
225
243
|
}
|
|
226
|
-
|
|
244
|
+
this.uploadFileApi(formData).then((res) => {
|
|
227
245
|
let address = res.data.data;
|
|
228
246
|
if (address && address.length > 0) {
|
|
229
247
|
if (this.form.id) {
|
|
@@ -245,7 +263,7 @@ export default {
|
|
|
245
263
|
};
|
|
246
264
|
this.$refs["ruleForm"].validate((valid) => {
|
|
247
265
|
if (valid) {
|
|
248
|
-
|
|
266
|
+
this.systemMaterialCreateApi(params).then((res) => {
|
|
249
267
|
if (res.data.code == "10000") {
|
|
250
268
|
this.$emit("callMdiaUrl", urls);
|
|
251
269
|
this.$message.success("创建素材成功");
|
|
@@ -276,7 +294,7 @@ export default {
|
|
|
276
294
|
};
|
|
277
295
|
this.$refs["ruleForm"].validate((valid) => {
|
|
278
296
|
if (valid) {
|
|
279
|
-
|
|
297
|
+
this.systemMaterialEditApi(params).then((res) => {
|
|
280
298
|
if (res.data.code == "10000") {
|
|
281
299
|
this.$emit("callMdiaUrl", urls);
|
|
282
300
|
this.$message.success("修改素材成功");
|
package/package.json
CHANGED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="le-button-select-media">
|
|
3
|
-
<le-button type="primary" id="btnSelectMedia" @click="onClick">{{
|
|
4
|
-
btnTitle
|
|
5
|
-
}}</le-button>
|
|
6
|
-
<le-dialog-container :title="title" :showDialog="showDialog" :showFooter="showFooter" :width="width"
|
|
7
|
-
:showCloseBtnTop="showCloseBtnTop" @close="closeDialog">
|
|
8
|
-
<le-media-list :multiple="multiple" ref="selectMedias" v-if="showDialog"
|
|
9
|
-
@selectContent="selectContent"></le-media-list>
|
|
10
|
-
</le-dialog-container>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
<script>
|
|
14
|
-
import LeButton from "../../le-button/index";
|
|
15
|
-
export default {
|
|
16
|
-
name: "le-button-select-media",
|
|
17
|
-
components: { LeButton },
|
|
18
|
-
props: {
|
|
19
|
-
btnTitle: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "选择素材",
|
|
22
|
-
},
|
|
23
|
-
width: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: "70%",
|
|
26
|
-
},
|
|
27
|
-
title: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: "选择素材",
|
|
30
|
-
},
|
|
31
|
-
param: {
|
|
32
|
-
type: [Object, String, Number],
|
|
33
|
-
default: () => { },
|
|
34
|
-
},
|
|
35
|
-
multiple: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: true,
|
|
38
|
-
},
|
|
39
|
-
showFooter: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false,
|
|
42
|
-
},
|
|
43
|
-
showCloseBtnTop: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: true
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
data() {
|
|
49
|
-
return {
|
|
50
|
-
showDialog: false,
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
methods: {
|
|
54
|
-
onClick() {
|
|
55
|
-
this.showDialog = true;
|
|
56
|
-
},
|
|
57
|
-
closeDialog() {
|
|
58
|
-
this.showDialog = false;
|
|
59
|
-
},
|
|
60
|
-
selectContent(value) {
|
|
61
|
-
this.$emit("selectContent", value, this.param);
|
|
62
|
-
if (!this.multiple) {
|
|
63
|
-
this.closeDialog();
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
</script>
|
|
69
|
-
<style lang="scss" scoped>
|
|
70
|
-
.le-button-select-media {
|
|
71
|
-
margin-left: 8px;
|
|
72
|
-
margin-right: 8px;
|
|
73
|
-
}
|
|
74
|
-
</style>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<le-button type="primary" id="btnUpload" @click="onClick">{{
|
|
4
|
-
title
|
|
5
|
-
}}</le-button>
|
|
6
|
-
<le-dialog-container :title="title" :showDialog="showDialog" :width="width" :showCloseBtnTop="showCloseBtnTop"
|
|
7
|
-
@close="closeDialog">
|
|
8
|
-
<le-media-upload v-if="showDialog" @cancel="closeDialog" @callMdiaUrl="callMdiaUrl"></le-media-upload>
|
|
9
|
-
</le-dialog-container>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
<script>
|
|
13
|
-
import LeButton from "../../le-button/index";
|
|
14
|
-
export default {
|
|
15
|
-
name: "le-button-upload",
|
|
16
|
-
components: {
|
|
17
|
-
LeButton,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
width: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: "60%",
|
|
23
|
-
},
|
|
24
|
-
title: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: "上传素材",
|
|
27
|
-
},
|
|
28
|
-
showCloseBtnTop: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: true
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
data() {
|
|
34
|
-
return {
|
|
35
|
-
showDialog: false,
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
onClick() {
|
|
40
|
-
this.showDialog = true;
|
|
41
|
-
},
|
|
42
|
-
closeDialog() {
|
|
43
|
-
this.showDialog = false;
|
|
44
|
-
},
|
|
45
|
-
callMdiaUrl(param) {
|
|
46
|
-
this.$emit("callMdiaUrl", param);
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
</script>
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="le-image-container">
|
|
3
|
-
<div
|
|
4
|
-
class="list"
|
|
5
|
-
@mouseover="mouseOverImg"
|
|
6
|
-
@mouseleave="mouseLeaveImg"
|
|
7
|
-
v-for="(item, index) in imageList"
|
|
8
|
-
:key="index"
|
|
9
|
-
>
|
|
10
|
-
<le-image :src="item" class="img">
|
|
11
|
-
<div slot="placeholder" class="image-slot">
|
|
12
|
-
加载中<span class="dot">...</span>
|
|
13
|
-
</div>
|
|
14
|
-
</le-image>
|
|
15
|
-
<span
|
|
16
|
-
class="delete"
|
|
17
|
-
@click="delImgList(item)"
|
|
18
|
-
:id="index"
|
|
19
|
-
:style="imgDeleCss"
|
|
20
|
-
>
|
|
21
|
-
<i class="el-icon-delete"></i>
|
|
22
|
-
</span>
|
|
23
|
-
</div>
|
|
24
|
-
<div style="display: flex">
|
|
25
|
-
<div class="img">
|
|
26
|
-
<le-button-upload
|
|
27
|
-
title="上传素材"
|
|
28
|
-
@callMdiaUrl="selectContent"
|
|
29
|
-
></le-button-upload>
|
|
30
|
-
<le-button-select-media
|
|
31
|
-
title="选择素材"
|
|
32
|
-
:multiple="false"
|
|
33
|
-
@selectContent="selectContent"
|
|
34
|
-
></le-button-select-media>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
<script>
|
|
40
|
-
export default {
|
|
41
|
-
name: "le-image-container",
|
|
42
|
-
props: {
|
|
43
|
-
images: {
|
|
44
|
-
type: Array,
|
|
45
|
-
default: () => [],
|
|
46
|
-
},
|
|
47
|
-
limit: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: 99999,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
data() {
|
|
53
|
-
return {
|
|
54
|
-
imgDeleCss: "display:none",
|
|
55
|
-
imageList: [],
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
watch: {
|
|
59
|
-
images: {
|
|
60
|
-
handler(val) {
|
|
61
|
-
this.imageList = val;
|
|
62
|
-
},
|
|
63
|
-
immediate: true,
|
|
64
|
-
deep: true,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
mounted() {},
|
|
68
|
-
methods: {
|
|
69
|
-
mouseOverImg() {
|
|
70
|
-
this.imgDeleCss = "display:block;cursor:pointer";
|
|
71
|
-
},
|
|
72
|
-
mouseLeaveImg() {
|
|
73
|
-
this.imgDeleCss = "display:none";
|
|
74
|
-
},
|
|
75
|
-
delImgList(item) {
|
|
76
|
-
let lenp = this.imageList.indexOf(item);
|
|
77
|
-
this.imageList.splice(lenp, 1);
|
|
78
|
-
this.$emit("getImages", this.imageList);
|
|
79
|
-
},
|
|
80
|
-
selectContent(val) {
|
|
81
|
-
let images = this.imageList;
|
|
82
|
-
let num = images && images.length > 0 ? images.length : 0;
|
|
83
|
-
if (num < this.limit) {
|
|
84
|
-
if (!Array.isArray(val)) {
|
|
85
|
-
if (!val) return;
|
|
86
|
-
this.imageList.push(val);
|
|
87
|
-
this.$emit("getImages", this.imageList);
|
|
88
|
-
} else {
|
|
89
|
-
this.imageList.push(...val);
|
|
90
|
-
this.$emit("getImages", this.imageList);
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
this.$message.warning(`图片数量最多${this.limit}张!`);
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
</script>
|
|
99
|
-
<style lang="scss" scoped>
|
|
100
|
-
.le-image-container {
|
|
101
|
-
display: flex;
|
|
102
|
-
display: -webkit-flex;
|
|
103
|
-
flex-wrap: wrap;
|
|
104
|
-
.list {
|
|
105
|
-
position: relative;
|
|
106
|
-
width: 100px;
|
|
107
|
-
height: 100px;
|
|
108
|
-
left: 0;
|
|
109
|
-
top: 0;
|
|
110
|
-
cursor: default;
|
|
111
|
-
text-align: center;
|
|
112
|
-
color: #fff;
|
|
113
|
-
opacity: 100;
|
|
114
|
-
font-size: 20px;
|
|
115
|
-
/* background-color: rgba(0, 0, 0, 0.5); */
|
|
116
|
-
/* transition: opacity 0.3s; */
|
|
117
|
-
display: inline;
|
|
118
|
-
|
|
119
|
-
.img {
|
|
120
|
-
width: 100px;
|
|
121
|
-
height: 100px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.delete {
|
|
125
|
-
position: absolute;
|
|
126
|
-
right: 0px;
|
|
127
|
-
bottom: 0;
|
|
128
|
-
font-size: 20px;
|
|
129
|
-
color: #fff;
|
|
130
|
-
display: block;
|
|
131
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
132
|
-
transition: opacity 0.3s;
|
|
133
|
-
width: 100%;
|
|
134
|
-
height: 100%;
|
|
135
|
-
text-align: center;
|
|
136
|
-
padding-top: 30%;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
.img {
|
|
140
|
-
background-color: #fbfdff;
|
|
141
|
-
border: 1px dashed #c0ccda;
|
|
142
|
-
border-radius: 6px;
|
|
143
|
-
width: 100px;
|
|
144
|
-
height: 100px;
|
|
145
|
-
cursor: pointer;
|
|
146
|
-
font-size: 16px;
|
|
147
|
-
color: #8c939d;
|
|
148
|
-
display: flex;
|
|
149
|
-
display: -webkit-flex;
|
|
150
|
-
flex-direction: column;
|
|
151
|
-
justify-content: center;
|
|
152
|
-
align-items: center;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
</style>
|