后台前端修改

This commit is contained in:
linfeng 2022-12-20 10:09:48 +08:00
parent f720ccea0f
commit 97dd13a2d1

View File

@ -19,7 +19,8 @@
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
@ -32,7 +33,6 @@
:disabled="dataListSelections.length <= 0" :disabled="dataListSelections.length <= 0"
>批量删除</el-button >批量删除</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -118,8 +118,18 @@
label="文件" label="文件"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.type == 2" type="text" @click="openVideo(scope.row.media[0])">点击预览</el-button> <el-button
<el-button v-if="scope.row.type == 1 && scope.row.media[0]" type="text" @click="openPic(scope.row.media)">点击查看</el-button> v-if="scope.row.type == 2"
type="text"
@click="openVideo(scope.row.media[0])"
>点击预览</el-button
>
<el-button
v-if="scope.row.type == 1 && scope.row.media[0]"
type="text"
@click="openPic(scope.row.media)"
>点击查看</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -187,13 +197,15 @@
label="操作" label="操作"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.status==1 || scope.row.status==2" <el-button
v-if="scope.row.status == 1 || scope.row.status == 2"
type="text" type="text"
size="small" size="small"
@click="statusHandle(scope.row.id)" @click="statusHandle(scope.row.id)"
>上架</el-button >上架</el-button
> >
<el-button v-if="scope.row.status==0" <el-button
v-if="scope.row.status == 0"
type="text" type="text"
size="small" size="small"
@click="statusDownHandle(scope.row.id)" @click="statusDownHandle(scope.row.id)"
@ -261,7 +273,11 @@
<div class="images"> <div class="images">
<div v-for="(item, index) in media" :key="index" class="image-middle"> <div v-for="(item, index) in media" :key="index" class="image-middle">
<el-card shadow="hover" :body-style="{ padding: '10px' }"> <el-card shadow="hover" :body-style="{ padding: '10px' }">
<img :src="media[index]" class="image" @click="goPic(media[index])"/> <img
:src="media[index]"
class="image"
@click="goPic(media[index])"
/>
<div style="text-align: center; padding-top: 12px"> <div style="text-align: center; padding-top: 12px">
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</div> </div>
@ -286,7 +302,7 @@ export default {
return { return {
dataForm: { dataForm: {
key: "", key: "",
status:'', status: "",
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
@ -299,16 +315,20 @@ export default {
dialogVisible2: false, dialogVisible2: false,
videoUrl: "", videoUrl: "",
media: [], media: [],
options: [{ options: [
{
value: 0, value: 0,
label: '正常' label: "正常",
}, { },
{
value: 1, value: 1,
label: '待审核' label: "待审核",
}, { },
{
value: 2, value: 2,
label: '已下架' label: "已下架",
}], },
],
// value: '' // value: ''
}; };
}, },
@ -320,8 +340,8 @@ export default {
}, },
methods: { methods: {
refresh() { refresh() {
this.dataForm.key=''; this.dataForm.key = "";
this.dataForm.status=''; this.dataForm.status = "";
this.pageIndex = 1; this.pageIndex = 1;
this.pageSize = 10; this.pageSize = 10;
this.getDataList(); this.getDataList();
@ -336,7 +356,7 @@ export default {
page: this.pageIndex, page: this.pageIndex,
limit: this.pageSize, limit: this.pageSize,
key: this.dataForm.key, key: this.dataForm.key,
status:this.dataForm.status status: this.dataForm.status,
}), }),
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -479,11 +499,11 @@ export default {
}); });
}, },
handleClose(done) { handleClose(done) {
this.$confirm('确认关闭?') this.$confirm("确认关闭?")
.then(_ => { .then((_) => {
done(); done();
}) })
.catch(_ => {}); .catch((_) => {});
}, },
openVideo(url) { openVideo(url) {
this.dialogVisible = true; this.dialogVisible = true;
@ -494,11 +514,9 @@ export default {
this.media = media; this.media = media;
}, },
goPic(url) { goPic(url) {
console.log('==>',url); console.log("==>", url);
window.open(url); window.open(url);
} },
}, },
}; };
</script> </script>
@ -530,5 +548,4 @@ export default {
width: 110px; width: 110px;
height: 110px; height: 110px;
} }
</style> </style>