mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
feat: 新增视频组件及配置功能
- 在 config.js 中添加视频类型配置,支持视频上传和样式设置。 - 创建 video-config.vue 组件,提供视频内容和样式的配置选项。 - 更新 decorate.vue 以支持视频类型的渲染和配置。
This commit is contained in:
@@ -559,6 +559,7 @@ export default {
|
||||
name: "",
|
||||
fileKey: "",
|
||||
fileType: "",
|
||||
fileCategory: "",
|
||||
userEnums: "MANAGER",
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 20, // 页面大小
|
||||
@@ -597,7 +598,7 @@ export default {
|
||||
width: 300,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
if (params.row.fileType.includes("image") > 0) {
|
||||
if (this.isImageFile(params.row)) {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.url || "",
|
||||
@@ -616,7 +617,7 @@ export default {
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if (params.row.fileType.includes("video") > 0) {
|
||||
} else if (this.isVideoFile(params.row)) {
|
||||
// 如果视频文件大小超过5MB不予加载video
|
||||
if (params.row.fileSize < 1024 * 1024 * 5) {
|
||||
return h(
|
||||
@@ -798,7 +799,7 @@ export default {
|
||||
// width: 150,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
if (params.row.fileType.includes("image") > 0) {
|
||||
if (this.isImageFile(params.row)) {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.url || "",
|
||||
@@ -817,7 +818,7 @@ export default {
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if (params.row.fileType.includes("video") > 0) {
|
||||
} else if (this.isVideoFile(params.row)) {
|
||||
// 如果视频文件大小超过5MB不予加载video
|
||||
if (params.row.fileSize < 1024 * 1024 * 5) {
|
||||
return h(
|
||||
@@ -1452,16 +1453,22 @@ export default {
|
||||
},
|
||||
// 文件类型筛选
|
||||
changeFileType() {
|
||||
let name = this.fileType;
|
||||
if (name == "all") {
|
||||
this.searchForm.fileType = "";
|
||||
} else if (name == "pic") {
|
||||
this.searchForm.fileType = "image";
|
||||
} else if (name == "video") {
|
||||
this.searchForm.fileType = "video";
|
||||
const name = this.fileType;
|
||||
this.searchForm.fileType = "";
|
||||
this.searchForm.fileCategory = "";
|
||||
if (name === "pic") {
|
||||
this.searchForm.fileCategory = "IMAGE";
|
||||
} else if (name === "video") {
|
||||
this.searchForm.fileCategory = "VIDEO";
|
||||
}
|
||||
this.handleSearch();
|
||||
},
|
||||
isImageFile(row) {
|
||||
return row?.fileCategory === "IMAGE" || (row?.fileType && row.fileType.includes("image"));
|
||||
},
|
||||
isVideoFile(row) {
|
||||
return row?.fileCategory === "VIDEO" || (row?.fileType && row.fileType.includes("video"));
|
||||
},
|
||||
// 上传文件超过大小限制
|
||||
handleMaxSize() {
|
||||
this.$Message.warning("所选文件大小过大,不得超过 20MB");
|
||||
|
||||
Reference in New Issue
Block a user