leisure-core 0.4.83 → 0.4.84
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-media/src/main.vue +1 -3
- package/le-media-list/src/main.vue +1 -3
- package/le-media-upload/src/main.vue +3 -2
- package/le-video/index.js +7 -0
- package/le-video/src/main.vue +42 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -36,6 +36,7 @@ import LeForm from "./le-form/index";
|
|
|
36
36
|
import LeFormItem from "./le-form-item/index";
|
|
37
37
|
import LeInputNumber from "./le-input-number/index.js";
|
|
38
38
|
import LeSelectOption from "./le-select-option/index.js";
|
|
39
|
+
import LeVideo from "./le-video/index.js";
|
|
39
40
|
|
|
40
41
|
const components = [
|
|
41
42
|
LeArea,
|
|
@@ -71,6 +72,7 @@ const components = [
|
|
|
71
72
|
LeForm,
|
|
72
73
|
LeFormItem,
|
|
73
74
|
LeSelectOption,
|
|
75
|
+
LeVideo,
|
|
74
76
|
];
|
|
75
77
|
|
|
76
78
|
const install = function (Vue) {
|
|
@@ -174,4 +176,5 @@ export default {
|
|
|
174
176
|
LeForm,
|
|
175
177
|
LeFormItem,
|
|
176
178
|
LeSelectOption,
|
|
179
|
+
LeVideo,
|
|
177
180
|
};
|
package/le-media/src/main.vue
CHANGED
|
@@ -35,9 +35,7 @@
|
|
|
35
35
|
:src="item.url"
|
|
36
36
|
alt=""
|
|
37
37
|
/>
|
|
38
|
-
<video
|
|
39
|
-
<source :src="item.url" type="video/mp4" />
|
|
40
|
-
</video>
|
|
38
|
+
<le-video :src="item.url" v-else controls></le-video>
|
|
41
39
|
<div class="name">
|
|
42
40
|
{{ "(" + item.group_name + ")" + item.title }}
|
|
43
41
|
<el-button type="text" @click="editFun(item)">编辑</el-button>
|
|
@@ -82,9 +82,10 @@
|
|
|
82
82
|
|
|
83
83
|
<el-form-item label="素材" v-if="isEdit">
|
|
84
84
|
<le-image class="img" v-if="form.types == 1" :src="form.url" alt="" />
|
|
85
|
-
<video class="video" v-else controls>
|
|
85
|
+
<!-- <video class="video" v-else controls>
|
|
86
86
|
<source :src="form.url" type="video/mp4" />
|
|
87
|
-
</video>
|
|
87
|
+
</video> -->
|
|
88
|
+
<le-video v-else :src="form.url"></le-video>
|
|
88
89
|
<le-button type="text" @click="replaceFile">替换素材</le-button>
|
|
89
90
|
</el-form-item>
|
|
90
91
|
<el-form-item>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<video class="video" controls :src="secureSrc" :type="type"></video>
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
export default {
|
|
6
|
+
name: "le-video",
|
|
7
|
+
props: {
|
|
8
|
+
replaceHttp: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: true, // 标识是否需要替换
|
|
11
|
+
},
|
|
12
|
+
src: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "",
|
|
15
|
+
},
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "video/mp4",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
secureSrc() {
|
|
23
|
+
let src = this.src || "";
|
|
24
|
+
if (this.replaceHttp && src.startsWith("http:")) {
|
|
25
|
+
src = src.replace(/^http:/, "https:");
|
|
26
|
+
let portPattern = /:(\d+)/;
|
|
27
|
+
if (src.match(portPattern)) {
|
|
28
|
+
src = src.replace(portPattern, "");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return src;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
methods: {},
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
<style lang="less" scoped>
|
|
38
|
+
video {
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
height: auto;
|
|
41
|
+
}
|
|
42
|
+
</style>
|