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 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
  };
@@ -35,9 +35,7 @@
35
35
  :src="item.url"
36
36
  alt=""
37
37
  />
38
- <video class="video" v-else controls>
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>
@@ -55,9 +55,7 @@
55
55
  :src="scope.row.url"
56
56
  alt=""
57
57
  ></le-image>
58
- <video class="video" v-else controls>
59
- <source :src="scope.row.url" type="video/mp4" />
60
- </video>
58
+ <le-video v-else :src="scope.row.url"></le-video>
61
59
  </template>
62
60
  </el-table-column>
63
61
 
@@ -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,7 @@
1
+ import LeVideo from "./src/main.vue";
2
+
3
+ LeVideo.install = function (Vue) {
4
+ Vue.component(LeVideo.name, LeVideo);
5
+ };
6
+
7
+ export default LeVideo;
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.4.83",
3
+ "version": "0.4.84",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",