fix:项目初始化

This commit is contained in:
ouyangxiu
2025-06-10 17:11:41 +07:00
commit db9bffd2c5
713 changed files with 159746 additions and 0 deletions
+280
View File
@@ -0,0 +1,280 @@
<template>
<div class="pf-warpper">
<el-row class="table-form">
<el-form :inline="true" :model="searchData.param" class="form-inline" size="mini">
<el-form-item>
<el-input @clear="onClear('id')" clearable placeholder="请输入ID" v-model.number="searchData.param.id" />
</el-form-item>
<el-form-item>
<el-select @clear="onClear('topicId')" clearable placeholder="请选择视频分类" v-model="searchData.param.topicId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in videoType" />
</el-select>
</el-form-item>
<el-form-item>
<el-select @clear="onClear('sort')" clearable placeholder="请选择排序" v-model="searchData.param.sort">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in sortList" />
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker :default-time="['00:00:00', '23:59:59']" end-placeholder="结束日期" range-separator="" start-placeholder="开始日期" type="datetimerange" v-model="time" value-format="yyyy-MM-ddTHH:mm:ss+08:00" />
</el-form-item>
<el-form-item>
<el-button @click="onSearch()" icon="el-icon-search" plain type="primary">搜索</el-button>
<el-button @click="refreshView" icon="el-icon-refresh" plain type="info">刷新</el-button>
<el-button @click="exportExcel" icon="el-icon-download" plain type="primary">导出</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table :data="tableData" element-loading-text="拼命加载中" v-loading="loading" border height="700" highlight-current-row style="width: 100%">
<el-table-column align="center" fixed="left" width="300" label="标题">
<template slot-scope="scope">{{ scope.row.title }}</template>
</el-table-column>
<el-table-column align="center" width="160" label="总销售金额">
<template slot-scope="scope">{{
scope.row.totalSaleMoney | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column label="上架时间" width="160">
<template slot-scope="scope" width="160">{{
scope.row.addedTime | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="封面" width="100">
<template slot-scope="scope">
<ShowImg style="width: 70px; height: 40px; margin: 0 auto" :urls="scope.row.coverImg"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" label="格式类型" width="120">
<template slot-scope="scope">{{
scope.row.formatType | filterSaleTypeStatus
}}</template>
</el-table-column>
<el-table-column fixed="left" align="center" label="id">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column align="center" label="观影券使用数量" width="150">
<template slot-scope="scope">{{
scope.row.movieTicketCount
}}</template>
</el-table-column>
<el-table-column align="center" label="预售结束时间(预览)" width="150">
<template slot-scope="scope">{{
scope.row.preSaleEndAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="预售(折扣)">
<template slot-scope="scope">{{
scope.row.preSaleDiscount
}}</template>
</el-table-column>
<el-table-column align="center" label="预售价格" prop="devType">
<template slot-scope="scope">{{
scope.row.preSalePrice | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column align="center" label="总预售金额" prop="devType" width="160">
<template slot-scope="scope">{{
scope.row.totalPreSaleMoney | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column align="center" label="售价" width="160">
<template slot-scope="scope">{{
scope.row.price | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column align="center" label="总销售数量" width="120">
<template slot-scope="scope">{{ scope.row.saleCount }}</template>
</el-table-column>
<el-table-column align="center" label="总预售数量" width="120">
<template slot-scope="scope">{{ scope.row.preSaleCount }}</template>
</el-table-column>
<el-table-column align="center" label="视频发布者" width="150">
<template slot-scope="scope">{{ scope.row.publish }}</template>
</el-table-column>
<el-table-column align="center" label="视频状态">
<template slot-scope="scope">{{
scope.row.status | filterSaleVideoStatus
}}</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<!-- 分页 -->
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[10, 20, 30, 50, 100]" :total="totals" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
</div>
</template>
<script>
import ShowImg from '@/components/ShowImg/index.vue'
import { saleinfoList, saleinfoExport } from '@/api/tran/saleinfo'
import { topicSearch } from '@/api/videoManagement/topic'
export default {
name: 'Saleinfo',
components: {
ShowImg,
},
filters: {
filterSaleVideoStatus(v) {
switch (v) {
case 0:
return '待上架'
case 1:
return '上架'
case 2:
return '取消上架'
}
},
filterSaleTypeStatus(v) {
switch (v) {
case 0:
return '无意义'
case 1:
return '女生短视频'
case 2:
return '长视频系列'
case 3:
return '女神'
case 4:
return '女神写真'
case 5:
return '资讯'
}
},
},
data() {
return {
loading: true, // 列表加载状态
totals: 0, // 数据总条数
time: undefined,
videoType: [],
searchData: {
param: {
// 表单参数
topicId: undefined,
id: undefined, // id
start: undefined, // 开始时间
end: undefined, // 结束时间
sort:undefined
},
pageNum: 1,
pageSize: 20,
},
tableData: [],
sortList:[
{
id:0,
name:'上架时间'
},
{
id:1,
name:'销售金额'
},
{
id:2,
name:'观影券使用数量'
},
{
id:3,
name:'总销售数量'
}
]
}
},
mounted() {
this.getMediacategoryList()
this.getSaleinfoList()
},
methods: {
// TODO:请求视频分类列表数据
getMediacategoryList() {
topicSearch({ pageNum: 1, pageSize: 500, param: {} }).then((res) => {
if (res.code === 200) {
this.videoType = res.data.list
} else {
this.videoType = []
this.$message.error('请求视频类型列表失败!')
}
})
},
//TODO:请求视频售卖统计列表
getSaleinfoList() {
this.loading = true
if (this.time) {
this.searchData.param.start = this.time[0]
this.searchData.param.end = this.time[1]
} else {
this.searchData.param.start = undefined
this.searchData.param.end = undefined
}
saleinfoList(this.searchData).then((res) => {
if (res.code === 200) {
this.tableData = res.data.list
this.totals = res.data.total
} else {
this.tableData = []
this.totals = 0
this.$message.error('请求列表失败')
}
this.loading = false
})
},
//TODO:导出视频售卖统计列表
exportExcel() {
saleinfoExport(this.searchData).then((res) => {
if (res.code) {
this.$message.error('导出列表失败!')
} else {
const a = document.createElement('a')
var blob = new Blob([res], {
type: 'application/vnd.ms-excel;charset=utf-8',
})
const t = BeiJingTime(new Date())
const url = window.URL.createObjectURL(blob)
a.setAttribute('href', url)
a.download = `视频售卖统计${t}.xlsx`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
},
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 20
this.getSaleinfoList()
},
// 刷新
refreshView() {
this.searchData.pageNum = 1
this.searchData.pageSize = 20
this.getSaleinfoList()
},
// 清理搜索框
onClear(key) {
this.searchData.param[key] = undefined
this.getSaleinfoList()
},
// 切换列表条数
handleSizeChange(val) {
this.searchData.pageSize = Number(val)
this.getSaleinfoList()
},
// 切换列表页码
handleCurrentChange(val) {
this.searchData.pageNum = Number(val)
this.getSaleinfoList()
},
},
}
</script>