|
@@ -23,18 +23,27 @@
|
|
|
>
|
|
|
<template #video_name="{ record }">
|
|
|
<div class="table-view-box">
|
|
|
- <div class="video-view">
|
|
|
+ <div class="video-view" @click="onOpenPreview(record.url)">
|
|
|
<i class="iconfont icon-ziyuan"></i>
|
|
|
+ <img
|
|
|
+ :src="
|
|
|
+ record.url + '?x-oss-process=video/snapshot,t_0,f_jpg,m_fast'
|
|
|
+ "
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
</div>
|
|
|
<span>{{ record.name }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #image_name="{ record }">
|
|
|
<div class="table-view-box">
|
|
|
- <div class="image-view"></div>
|
|
|
+ <div class="image-view" @click="onOpenPreview(record.url)">
|
|
|
+ <img :src="record.url" alt="" />
|
|
|
+ </div>
|
|
|
<span>{{ record.name }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #duration="{ record }">{{ record.duration }}秒</template>
|
|
|
<template #video_type="{ record }">
|
|
|
<span v-show="record.video_type === 'S'">竖版视频</span>
|
|
|
<span v-show="record.video_type === 'H'">横版视频</span>
|
|
@@ -73,6 +82,28 @@
|
|
|
}"
|
|
|
/>
|
|
|
</a-modal>
|
|
|
+ <a-modal
|
|
|
+ v-model:visible="previewVisible"
|
|
|
+ width="40%"
|
|
|
+ height="200px"
|
|
|
+ :footer="null"
|
|
|
+ :mask="true"
|
|
|
+ wrapClassName="preview"
|
|
|
+ style="max-height: 400px"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ style="max-width: 100%; max-height: 100%"
|
|
|
+ :src="currentUrl"
|
|
|
+ alt=""
|
|
|
+ v-show="type === 'picture'"
|
|
|
+ />
|
|
|
+ <video
|
|
|
+ v-show="type === 'video'"
|
|
|
+ style="max-width: 100%; max-height: 100%"
|
|
|
+ :src="currentUrl"
|
|
|
+ controls
|
|
|
+ ></video>
|
|
|
+ </a-modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -115,6 +146,8 @@ const CommonTable = defineComponent({
|
|
|
pushVisible: false,
|
|
|
currentId: 0, // 当前操作的素材id
|
|
|
advertiser: ref<string[]>([]), // 选择的广告主
|
|
|
+ previewVisible: false,
|
|
|
+ currentUrl: "",
|
|
|
});
|
|
|
const getList = async (page?: any) => {
|
|
|
state.loading = true;
|
|
@@ -126,17 +159,14 @@ const CommonTable = defineComponent({
|
|
|
});
|
|
|
state.loading = false;
|
|
|
state.list = data.list;
|
|
|
- console.log("返回的数据", data);
|
|
|
};
|
|
|
// 列表选项改变
|
|
|
const onSelectChange = (selectedRowKeys: any) => {
|
|
|
- console.log("selectedRowKeys changed: ", selectedRowKeys);
|
|
|
state.selectedRowKeys = selectedRowKeys;
|
|
|
};
|
|
|
watch(
|
|
|
() => props.searchForm,
|
|
|
(oldVal, newVal) => {
|
|
|
- console.log("单个监听", oldVal, newVal);
|
|
|
getList({ current: 1 });
|
|
|
}
|
|
|
);
|
|
@@ -151,8 +181,8 @@ const CommonTable = defineComponent({
|
|
|
methods: {
|
|
|
// 获取广告主列表
|
|
|
async getAdList() {
|
|
|
+ this.selectedRowKeys = [];
|
|
|
let { data } = await getAdvertiser();
|
|
|
- console.log("AD", data);
|
|
|
this.adList = data;
|
|
|
if (this.adList.length === 0) return;
|
|
|
this.adList.forEach((item) => {
|
|
@@ -195,7 +225,7 @@ const CommonTable = defineComponent({
|
|
|
try {
|
|
|
await pushMaterial({
|
|
|
material_id: this.currentId,
|
|
|
- advertiser_id: this.advertiser[0],
|
|
|
+ advertiser_id: this.advertiser[1],
|
|
|
});
|
|
|
this.pushVisible = false;
|
|
|
message.success("推送成功");
|
|
@@ -204,7 +234,13 @@ const CommonTable = defineComponent({
|
|
|
console.log(err);
|
|
|
}
|
|
|
},
|
|
|
+ // 点击预览
|
|
|
+ onOpenPreview(url: string) {
|
|
|
+ this.previewVisible = true;
|
|
|
+ this.currentUrl = url;
|
|
|
+ },
|
|
|
},
|
|
|
+ //https://firemanage.oss-cn-hangzhou.aliyuncs.com/material/video/S-20210739163739-E9XA.mp4?x-oss-process=video/snapshot,t_0,f_jpg,m_fast
|
|
|
});
|
|
|
|
|
|
export default CommonTable;
|
|
@@ -224,10 +260,19 @@ export default CommonTable;
|
|
|
border: 1px solid gray;
|
|
|
margin-right: 4px;
|
|
|
position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: rgb(94, 93, 93);
|
|
|
+ img {
|
|
|
+ max-width: 58px;
|
|
|
+ max-height: 58px;
|
|
|
+ }
|
|
|
.icon-ziyuan {
|
|
|
position: absolute;
|
|
|
top: 18px;
|
|
|
left: 32px;
|
|
|
+ color: white;
|
|
|
}
|
|
|
}
|
|
|
.image-view {
|
|
@@ -235,10 +280,17 @@ export default CommonTable;
|
|
|
height: 60px;
|
|
|
border: 1px solid gray;
|
|
|
margin-right: 4px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ img {
|
|
|
+ max-width: 58px;
|
|
|
+ max-height: 58px;
|
|
|
+ }
|
|
|
}
|
|
|
- &:hover span {
|
|
|
- color: rgb(0, 140, 255);
|
|
|
- }
|
|
|
+ // &:hover span {
|
|
|
+ // color: rgb(0, 140, 255);
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
</style>
|