修改AI模块

This commit is contained in:
lichenguang
2025-07-29 12:10:08 +07:00
parent 57b0328c18
commit 489bbb37b0
19 changed files with 612 additions and 324 deletions
+1 -3
View File
@@ -17,9 +17,7 @@
"proto": "pbjs -t json-module -w commonjs -o src/proto/proto.js src/proto/pub/*.proto src/proto/web/*.proto" "proto": "pbjs -t json-module -w commonjs -o src/proto/proto.js src/proto/pub/*.proto src/proto/web/*.proto"
}, },
"husky": { "husky": {
"hooks": { "hooks": {}
}
}, },
"lint-staged": { "lint-staged": {
"src/**/*.{js,vue}": [ "src/**/*.{js,vue}": [
+28 -1
View File
@@ -19,10 +19,37 @@ export function aiTextToImageList(data) {
data data
}) })
} }
// 查询ai小说列表
export function aiTextToNovelList(data) {
return request({
url: '/api/web/aitexttonovel/list',
method: 'post',
filterParam: true,
data
})
}
// 删除ai小说列表
export function deleteNovel(data) {
return request({
url: '/api/web/aitexttonovel/del',
method: 'post',
filterParam: true,
data
})
}
// 退款AI小说
export function updateNovel(data) {
return request({
url: '/api/web/aitexttonovel/update',
method: 'post',
filterParam: true,
data
})
}
// 修改图生视频列表 // 修改图生视频列表
export function aiTextToImageUpdate(data) { export function aiTextToImageUpdate(data) {
return request({ return request({
url: '/api/web/aitexttoimage/modify', url: '/api/web/aitexttoimage/update',
method: 'post', method: 'post',
data data
}) })
+6
View File
@@ -1097,6 +1097,12 @@ export const serverRouter = [
name: 'AiTxtToImg', name: 'AiTxtToImg',
api_url: [], api_url: [],
meta: { title: 'AI文生图', noCache: true, icon: 'el-icon-chat-dot-square' } meta: { title: 'AI文生图', noCache: true, icon: 'el-icon-chat-dot-square' }
},
{
path: 'aiNovelList',
name: 'AiNovelList',
api_url: [],
meta: { title: 'AI小说', noCache: true, icon: 'el-icon-chat-dot-square' }
} }
] ]
}, },
+1
View File
@@ -189,6 +189,7 @@ const map = {
AiStripOrder: () => import('@/views/aiManagement/aiStripOrder/index.vue'), // ai脱衣订单 AiStripOrder: () => import('@/views/aiManagement/aiStripOrder/index.vue'), // ai脱衣订单
AiImgToVideo: () => import('@/views/aiManagement/aiImgToVideo/index.vue'), // ai图生视频 AiImgToVideo: () => import('@/views/aiManagement/aiImgToVideo/index.vue'), // ai图生视频
AiTxtToImg: () => import('@/views/aiManagement/aiTxtToImg/index.vue'), // ai文生图 AiTxtToImg: () => import('@/views/aiManagement/aiTxtToImg/index.vue'), // ai文生图
AiNovelList: () => import('@/views/aiManagement/aiNovelList/index.vue'), // ai文生图
// 其他管理 // 其他管理
OtherConfig: Layout, OtherConfig: Layout,
Jumptab: () => import('@/views/otherConfig/jumptab/index.vue'), // 首页跳转按钮 Jumptab: () => import('@/views/otherConfig/jumptab/index.vue'), // 首页跳转按钮
@@ -25,6 +25,14 @@
<el-option label="AI脱衣" :value="3" /> <el-option label="AI脱衣" :value="3" />
<el-option label="AI女友" :value="4" /> <el-option label="AI女友" :value="4" />
<el-option label="文生图" :value="5" /> <el-option label="文生图" :value="5" />
<el-option label="图生视频" :value="6" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="广告模式" prop="advertisingId">
<el-select placeholder="请选择广告模式" clearable v-model="form.adsType" filterable>
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in videoTypeMode" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -46,6 +54,8 @@
<script> <script>
import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate' import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate'
import { aitemplateCategoryAdd, aitemplateCategoryUpdate } from '@/api/aiManagement/aiOrder' import { aitemplateCategoryAdd, aitemplateCategoryUpdate } from '@/api/aiManagement/aiOrder'
import { videoTypeMode } from '@/filters/videoManagement/videoType'
export default { export default {
name: 'AddOrEdit', name: 'AddOrEdit',
props: ['data'], props: ['data'],
@@ -53,6 +63,7 @@ export default {
data() { data() {
return { return {
AiContentTypeList: AiContentTypeList(), AiContentTypeList: AiContentTypeList(),
videoTypeMode: videoTypeMode(),
Visible: true, Visible: true,
title: '', title: '',
time: [], time: [],
@@ -67,7 +78,8 @@ export default {
rank: undefined, rank: undefined,
showType: undefined, showType: undefined,
status: undefined, status: undefined,
updatedAt: undefined updatedAt: undefined,
adsType: undefined
}, },
rules: {} rules: {}
} }
@@ -31,6 +31,9 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="展示方式"> <el-table-column align="center" label="展示方式">
<template slot-scope="scope">{{ scope.row.showType | changeAiContentType }}</template> <template slot-scope="scope">{{ scope.row.showType | changeAiContentType }}</template>
</el-table-column>
<el-table-column align="center" label="广告模式" width="80">
<template slot-scope="scope">{{ scope.row.adsType | changeVideoTypeMode }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="是否启用"> <el-table-column align="center" label="是否启用">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -1,8 +1,20 @@
<template> <template>
<el-dialog :title="title" :visible.sync="Visible" width="780px" center class="ac-dialog" :close-on-click-modal="false" <el-dialog
:title="title"
:visible.sync="Visible"
width="780px"
center
class="ac-dialog"
:close-on-click-modal="false"
@close="close"> @close="close">
<el-form :inline="true" :model="form" :rules="rules" ref="form" class="demo-form-inline" label-width="120px" <el-form
:inline="true"
:model="form"
:rules="rules"
ref="form"
class="demo-form-inline"
label-width="120px"
label-position="right"> label-position="right">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12"> <el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
@@ -32,7 +44,6 @@
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button> <el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="submit('form')"> </el-button> <el-button type="primary" @click="submit('form')"> </el-button>
@@ -64,15 +75,15 @@ export default {
formData: {}, formData: {},
// 表单数据 // 表单数据
form: { form: {
"byWay": undefined, 'byWay': undefined,
"id": undefined, 'id': undefined,
"modifyImgs": undefined, 'modifyImgs': undefined,
"modifyVideoUrl": undefined, 'modifyVideoUrl': undefined,
"reason": undefined, 'reason': undefined,
"status": 0, 'status': 0,
"updatedAt": undefined 'updatedAt': undefined
}, },
rules: {}, rules: {}
} }
}, },
mounted() { mounted() {
@@ -90,7 +101,6 @@ export default {
}, },
// TODO:编辑应用列表数据 // TODO:编辑应用列表数据
update(data) { update(data) {
aiorderFacechangeUpdate(data).then((res) => { aiorderFacechangeUpdate(data).then((res) => {
if (res && res.code === 200) { if (res && res.code === 200) {
this.$message.success(res.data ? res.data : '更新成功') this.$message.success(res.data ? res.data : '更新成功')
@@ -98,7 +108,6 @@ export default {
this.$message.error(res.data ? res.data : '更新失败') this.$message.error(res.data ? res.data : '更新失败')
} }
this.Visible = false this.Visible = false
}) })
}, },
// 提交按钮 // 提交按钮
@@ -141,8 +150,8 @@ export default {
onClear(data) { onClear(data) {
this.form[data] = undefined this.form[data] = undefined
}, }
}, }
} }
</script> </script>
@@ -1,45 +1,25 @@
<template> <template>
<el-dialog <el-dialog :title="title" :visible.sync="Visible" width="780px" center class="ac-dialog" :close-on-click-modal="false"
:title="title"
:visible.sync="Visible"
width="780px"
center
class="ac-dialog"
:close-on-click-modal="false"
@close="close"> @close="close">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col > <el-col >
<h3>AI生成的视频URl</h3> <h3>AI生成的视频URl</h3>
<div v-if="form.vidUrl" style="width: 380px; height: 240px; overflow: hidden"> <div v-if="form.vidUrl" style="width: 380px; height: 240px; overflow: hidden">
<DPlayer <DPlayer ref="player" v-if="form.vidUrl.indexOf('mp4') === -1" :video="{
ref="player"
v-if="form.vidUrl.indexOf('mp4') === -1"
:video="{
url: '/api/web/media/m3u8/' + filterM3u8(form.vidUrl), url: '/api/web/media/m3u8/' + filterM3u8(form.vidUrl),
type: 'hls', type: 'hls',
pic: '', pic: '',
}" }" hotkey ></DPlayer>
hotkey ></DPlayer> <DPlayer ref="player" v-else :video="{
<DPlayer
ref="player"
v-else
:video="{
url: this.$store.getters.getSystemConfig.mp4Url + form.vidUrl, url: this.$store.getters.getSystemConfig.mp4Url + form.vidUrl,
type: 'mp4', type: 'mp4',
pic: '', pic: '',
}" }" hotkey ></DPlayer>
hotkey ></DPlayer>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-form <el-form :inline="true" :model="form" :rules="rules" ref="form" class="demo-form-inline" label-width="120px"
:inline="true"
:model="form"
:rules="rules"
ref="form"
class="demo-form-inline"
label-width="120px"
label-position="right"> label-position="right">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12"> <el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
@@ -64,6 +44,7 @@ label-width="120px"
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button> <el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="submit('form')"> </el-button> <el-button type="primary" @click="submit('form')"> </el-button>
@@ -95,15 +76,15 @@ export default {
formData: {}, formData: {},
// 表单数据 // 表单数据
form: { form: {
'byWay': undefined, "byWay": undefined,
'id': undefined, "id": undefined,
'modifyImgs': undefined, "modifyImgs": undefined,
'vidUrl': undefined, "vidUrl": undefined,
'reason': undefined, "reason": undefined,
'status': 0, "status": 0,
'updatedAt': undefined "updatedAt": undefined
}, },
rules: {} rules: {},
} }
}, },
mounted() { mounted() {
@@ -121,6 +102,7 @@ export default {
}, },
//TODO:编辑应用列表数据 //TODO:编辑应用列表数据
update(data) { update(data) {
aiorderFacechangeUpdate(data).then((res) => { aiorderFacechangeUpdate(data).then((res) => {
if (res && res.code === 200) { if (res && res.code === 200) {
this.$message.success(res.data ? res.data : '更新成功') this.$message.success(res.data ? res.data : '更新成功')
@@ -128,6 +110,7 @@ export default {
this.$message.error(res.data ? res.data : '更新失败') this.$message.error(res.data ? res.data : '更新失败')
} }
this.Visible = false this.Visible = false
}) })
}, },
// 提交按钮 // 提交按钮
@@ -170,8 +153,8 @@ export default {
onClear(data) { onClear(data) {
this.form[data] = undefined this.form[data] = undefined
} },
} },
} }
</script> </script>
+49 -51
View File
@@ -116,8 +116,7 @@
:total="total" :total="total"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
@size-change="handleSizeChange" @size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"/>
/>
</div> </div>
<!-- 新增及编辑 --> <!-- 新增及编辑 -->
<Edit :data="editData" v-if="editVisible" @close="closeEdit" /> <Edit :data="editData" v-if="editVisible" @close="closeEdit" />
@@ -126,18 +125,18 @@
</template> </template>
<script> <script>
// 引入模块 // 引入模块
import Edit from './components/AddOrEditPhoto'; import Edit from './components/AddOrEditPhoto'
import ShowImg from '@/components/ShowImg/index.vue'; import ShowImg from '@/components/ShowImg/index.vue'
import ShowVideo from '@/components/ShowVideo/index.vue'; import ShowVideo from '@/components/ShowVideo/index.vue'
import { aiFacechangeSearch,facechangeResubmit } from '@/api/aiManagement/aiOrder'; import { aiFacechangeSearch, facechangeResubmit } from '@/api/aiManagement/aiOrder'
import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate'; import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate'
import { aiOrderFaceChangeList, aiFaceOrderList } from '@/filters/aiManagement/aiFaceOrder'; import { aiOrderFaceChangeList, aiFaceOrderList } from '@/filters/aiManagement/aiFaceOrder'
export default { export default {
name: 'AiOrder', name: 'AiOrder',
components: { components: {
ShowImg, ShowImg,
ShowVideo, ShowVideo,
Edit, Edit
}, },
data() { data() {
return { return {
@@ -151,7 +150,7 @@ export default {
byWay: undefined, byWay: undefined,
aoContentType: 1, aoContentType: 1,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10
}, },
resData: [], // el-table表格数据 resData: [], // el-table表格数据
editVisible: false, editVisible: false,
@@ -159,12 +158,12 @@ export default {
loading: true, // 列表加载状态 loading: true, // 列表加载状态
AiContentTypeList: AiContentTypeList(), AiContentTypeList: AiContentTypeList(),
aiOrderFaceChangeList: aiOrderFaceChangeList(), aiOrderFaceChangeList: aiOrderFaceChangeList(),
aiFaceOrderList: aiFaceOrderList(), aiFaceOrderList: aiFaceOrderList()
}; }
}, },
mounted() { mounted() {
this.getGameInfo(); this.getGameInfo()
}, },
methods: { methods: {
orderSumbit(index, row) { orderSumbit(index, row) {
@@ -179,100 +178,99 @@ export default {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '提交成功!' message: '提交成功!'
}); })
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '提交失败!' message: '提交失败!'
}); })
} }
}).catch(() => { }).catch(() => {
}); })
}, },
// TODO:请求应用列表数据 // TODO:请求应用列表数据
getGameInfo() { getGameInfo() {
aiFacechangeSearch(this.searchData).then(res => { aiFacechangeSearch(this.searchData).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.resData = res.data.list; this.resData = res.data.list
this.total = res.data.total; this.total = res.data.total
} else { } else {
this.resData = []; this.resData = []
this.total = 0; this.total = 0
this.$message.error('请求列表失败!'); this.$message.error('请求列表失败!')
} }
this.loading = false; this.loading = false
}); })
}, },
// TODO:删除应用列表数据 // TODO:删除应用列表数据
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('确定删除?', '警告', { this.$confirm('确定删除?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}).then(() => { }).then(() => {
AppInfoDel({ id: row.id }).then(res => { AppInfoDel({ id: row.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.getGameInfo(); this.getGameInfo()
this.$message.success('成功删除!'); this.$message.success('成功删除!')
} else { } else {
this.$message.error('操作失败'); this.$message.error('操作失败')
} }
}); })
}); })
}, },
onSearch() { onSearch() {
this.searchData.pageNum = 1; this.searchData.pageNum = 1
this.searchData.pageSize = 10; this.searchData.pageSize = 10
this.getGameInfo(); this.getGameInfo()
}, },
// 切换每页数据量 // 切换每页数据量
handleSizeChange(val) { handleSizeChange(val) {
this.searchData.pageSize = val; this.searchData.pageSize = val
this.getGameInfo(); this.getGameInfo()
}, },
// 切换页数 // 切换页数
handleCurrentChange(val) { handleCurrentChange(val) {
this.searchData.pageNum = val; this.searchData.pageNum = val
this.getGameInfo(); this.getGameInfo()
}, },
// 新增按钮 // 新增按钮
add() { add() {
this.editVisible = true; this.editVisible = true
}, },
// 编辑按钮 // 编辑按钮
handleEdit(index, row) { handleEdit(index, row) {
this.editVisible = true; this.editVisible = true
this.editData = { this.editData = {
title: '编辑', title: '编辑',
data: row, data: row
}; }
}, },
// 关闭编辑弹窗 // 关闭编辑弹窗
closeEdit() { closeEdit() {
this.editData = { this.editData = {
title: '新增', title: '新增',
data: {}, data: {}
}; }
this.editVisible = false; this.editVisible = false
this.getGameInfo(); this.getGameInfo()
}, },
// 清空某一项筛选列表 // 清空某一项筛选列表
onClear(key) { onClear(key) {
this.searchData[key] = undefined; this.searchData[key] = undefined
this.getGameInfo(); this.getGameInfo()
}, },
// 视频查看 // 视频查看
checkMedia(url, data) { checkMedia(url, data) {
this.$refs.showvideo.open(url, data, data.id); this.$refs.showvideo.open(url, data, data.id)
}, }
}, }
}; }
</script> </script>
+49 -51
View File
@@ -124,8 +124,7 @@
:total="total" :total="total"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
@size-change="handleSizeChange" @size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"/>
/>
</div> </div>
<!-- 新增及编辑 --> <!-- 新增及编辑 -->
<Edit :data="editData" v-if="editVisible" @close="closeEdit" /> <Edit :data="editData" v-if="editVisible" @close="closeEdit" />
@@ -134,18 +133,18 @@
</template> </template>
<script> <script>
// 引入模块 // 引入模块
import Edit from './components/AddOrEditVideo'; import Edit from './components/AddOrEditVideo'
import ShowImg from '@/components/ShowImg/index.vue'; import ShowImg from '@/components/ShowImg/index.vue'
import ShowVideo from '@/components/ShowVideo/index.vue'; import ShowVideo from '@/components/ShowVideo/index.vue'
import { aiFacechangeSearch,facechangeResubmit } from '@/api/aiManagement/aiOrder'; import { aiFacechangeSearch, facechangeResubmit } from '@/api/aiManagement/aiOrder'
import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate'; import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate'
import { aiOrderFaceChangeList, aiFaceOrderList } from '@/filters/aiManagement/aiFaceOrder'; import { aiOrderFaceChangeList, aiFaceOrderList } from '@/filters/aiManagement/aiFaceOrder'
export default { export default {
name: 'AiOrder', name: 'AiOrder',
components: { components: {
ShowImg, ShowImg,
ShowVideo, ShowVideo,
Edit, Edit
}, },
data() { data() {
return { return {
@@ -159,7 +158,7 @@ export default {
byWay: undefined, byWay: undefined,
aoContentType: 2, aoContentType: 2,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10
}, },
resData: [], // el-table表格数据 resData: [], // el-table表格数据
editVisible: false, editVisible: false,
@@ -167,12 +166,12 @@ export default {
loading: true, // 列表加载状态 loading: true, // 列表加载状态
AiContentTypeList: AiContentTypeList(), AiContentTypeList: AiContentTypeList(),
aiOrderFaceChangeList: aiOrderFaceChangeList(), aiOrderFaceChangeList: aiOrderFaceChangeList(),
aiFaceOrderList: aiFaceOrderList(), aiFaceOrderList: aiFaceOrderList()
}; }
}, },
mounted() { mounted() {
this.getGameInfo(); this.getGameInfo()
}, },
methods: { methods: {
orderSumbit(index, row) { orderSumbit(index, row) {
@@ -187,100 +186,99 @@ export default {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '提交成功!' message: '提交成功!'
}); })
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '提交失败!' message: '提交失败!'
}); })
} }
}).catch(() => { }).catch(() => {
}); })
}, },
// TODO:请求应用列表数据 // TODO:请求应用列表数据
getGameInfo() { getGameInfo() {
aiFacechangeSearch(this.searchData).then(res => { aiFacechangeSearch(this.searchData).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.resData = res.data.list; this.resData = res.data.list
this.total = res.data.total; this.total = res.data.total
} else { } else {
this.resData = []; this.resData = []
this.total = 0; this.total = 0
this.$message.error('请求列表失败!'); this.$message.error('请求列表失败!')
} }
this.loading = false; this.loading = false
}); })
}, },
// TODO:删除应用列表数据 // TODO:删除应用列表数据
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('确定删除?', '警告', { this.$confirm('确定删除?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}).then(() => { }).then(() => {
AppInfoDel({ id: row.id }).then(res => { AppInfoDel({ id: row.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.getGameInfo(); this.getGameInfo()
this.$message.success('成功删除!'); this.$message.success('成功删除!')
} else { } else {
this.$message.error('操作失败'); this.$message.error('操作失败')
} }
}); })
}); })
}, },
onSearch() { onSearch() {
this.searchData.pageNum = 1; this.searchData.pageNum = 1
this.searchData.pageSize = 10; this.searchData.pageSize = 10
this.getGameInfo(); this.getGameInfo()
}, },
// 切换每页数据量 // 切换每页数据量
handleSizeChange(val) { handleSizeChange(val) {
this.searchData.pageSize = val; this.searchData.pageSize = val
this.getGameInfo(); this.getGameInfo()
}, },
// 切换页数 // 切换页数
handleCurrentChange(val) { handleCurrentChange(val) {
this.searchData.pageNum = val; this.searchData.pageNum = val
this.getGameInfo(); this.getGameInfo()
}, },
// 新增按钮 // 新增按钮
add() { add() {
this.editVisible = true; this.editVisible = true
}, },
// 编辑按钮 // 编辑按钮
handleEdit(index, row) { handleEdit(index, row) {
this.editVisible = true; this.editVisible = true
this.editData = { this.editData = {
title: '编辑', title: '编辑',
data: row, data: row
}; }
}, },
// 关闭编辑弹窗 // 关闭编辑弹窗
closeEdit() { closeEdit() {
this.editData = { this.editData = {
title: '新增', title: '新增',
data: {}, data: {}
}; }
this.editVisible = false; this.editVisible = false
this.getGameInfo(); this.getGameInfo()
}, },
// 清空某一项筛选列表 // 清空某一项筛选列表
onClear(key) { onClear(key) {
this.searchData[key] = undefined; this.searchData[key] = undefined
this.getGameInfo(); this.getGameInfo()
}, },
// 视频查看 // 视频查看
checkMedia(url, data) { checkMedia(url, data) {
this.$refs.showvideo.open(url, data, data.id); this.$refs.showvideo.open(url, data, data.id)
}, }
}, }
}; }
</script> </script>
@@ -14,6 +14,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="场景类型">
<el-select placeholder="请选择场景类型" clearable v-model="form.sceneType">
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in sceneTypes" />
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@@ -37,8 +44,18 @@ export default {
// 表单数据 // 表单数据
form: { form: {
remark: undefined, // 备注 remark: undefined, // 备注
status: undefined // 状态 status: undefined, // 状态
} sceneType: undefined
},
sceneTypes: [
{ label: '掀衣露乳', value: 0 },
{ label: '男人撕衣', value: 1 },
{ label: '神屌射脸', value: 2 },
{ label: '阿黑颜', value: 3 },
{ label: '接吻', value: 4 },
{ label: '吸奶', value: 5 },
{ label: '露逼', value: 6 }
]
} }
}, },
@@ -39,6 +39,11 @@
<el-button :type="scope.row.isDelete ? 'danger' : 'success'" plain size="mini">{{ scope.row.isDelete ? '已删除' : '未删除' }}</el-button> <el-button :type="scope.row.isDelete ? 'danger' : 'success'" plain size="mini">{{ scope.row.isDelete ? '已删除' : '未删除' }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="center" label="场景类型">
<template slot-scope="scope">
{{ sceneTypes[scope.row.sceneType] }}
</template>
</el-table-column>
<el-table-column width="100" align="center" label="是否使用免费次数"> <el-table-column width="100" align="center" label="是否使用免费次数">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :type="scope.row.isFreeTimes ? 'danger' : 'success'" plain size="mini">{{ scope.row.isFreeTimes ? '是' : '否' }}</el-button> <el-button :type="scope.row.isFreeTimes ? 'danger' : 'success'" plain size="mini">{{ scope.row.isFreeTimes ? '是' : '否' }}</el-button>
@@ -115,7 +120,7 @@ export default {
{ id: 4, name: '生成失败' }, { id: 4, name: '生成失败' },
{ id: 5, name: '退款' } { id: 5, name: '退款' }
], ],
sceneTypes: ['掀衣露乳', '男人撕衣', '神屌射脸', '阿黑颜', '接吻', '吸奶', '露逼'],
// 请求列表参数 // 请求列表参数
searchData: { searchData: {
userId: undefined, userId: undefined,
@@ -0,0 +1,251 @@
<template>
<div class="pf-warpper">
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" size="mini">
<el-form-item>
<el-input clearable placeholder="ID" v-model="searchData.id" @clear="onClear('id')" />
</el-form-item>
<el-form-item>
<el-input clearable placeholder="用户ID" v-model.number="searchData.uid" @clear="onClear('userId')" />
</el-form-item>
<el-form-item>
<el-select placeholder="请选择任务进度" clearable v-model="searchData.status" @clear="onClear('status')">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in aiImgToVideoStatusList" />
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList" plain>搜索</el-button>
</el-form-item>
<el-form-item>
<el-button @click="refreshView" icon="el-icon-refresh" plain type="info">刷新</el-button>
</el-form-item>
</el-form>
</el-row>
<el-table :data="resData" element-loading-text="拼命加载中" border height="750" highlight-current-row style="width: 100%">
<el-table-column label="ID" prop="id" />
<el-table-column label="用户ID" prop="uid" />
<el-table-column label="故事情节" prop="description" />
<el-table-column label="小说正文" prop="content" width="200">
<template slot-scope="scope">
<div style="display: flex;" v-if="scope.row.content">
<span class="ellipsis2">
{{ scope.row.content }}
</span>
<el-button class="view-btn" type="text" @click="view(scope.row.content)" plain icon="el-icon-zoom-in"></el-button>
</div>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="status">
<template slot-scope="scope">
{{ handleStatus(scope.row.status) }}
</template>
</el-table-column>
<el-table-column label="地点场景" prop="scene" />
<el-table-column label="故事背景" prop="background" />
<el-table-column label="其他要求" prop="other" />
<el-table-column label="小说模型" prop="modelType">
<template slot-scope="scope">
{{ handleModelType(scope.row.modelType) }}
</template>
</el-table-column>
<el-table-column label="金币" prop="coin" />
<el-table-column label="扣除金币个数" prop="debitAmountCoin" />
<el-table-column label="扣除收益金币个数" prop="debitIncomeCoin" />
<el-table-column label="备注" prop="remark" />
<el-table-column label="创建时间" prop="createdAt">
<template slot-scope="scope">
{{scope.row.createdAt | BeiJingTime}}
</template>
</el-table-column>
<el-table-column label="更新时间" prop="updatedAt">
<template slot-scope="scope">
{{scope.row.updatedAt | BeiJingTime}}
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button @click="changeStatus(scope.row)" size="mini">退款</el-button>
<el-button @click="handleDelete(scope.row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-pagination">
<el-pagination
:current-page="searchData.pageNum"
:page-size="searchData.pageSize"
:page-sizes="[10, 20, 30, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper"/>
</div>
<el-dialog
title="预览"
:visible.sync="dialogVisible"
width="600px"
:before-handleClose="handleClose"
:handleClose-on-click-modal="false"
class="look-dialog">
<div class="viewContent" v-html="currentContent"></div>
</el-dialog>
</div>
</template>
<script>
import { aiTextToNovelList, updateNovel, deleteNovel } from '@/api/aiManagement/aiTxtToImg.js'
export default {
name: 'AiNovelList',
data() {
return {
aiImgToVideoStatusList: [
{ id: 1, name: '下单成功' },
{ id: 2, name: '已提交' },
{ id: 3, name: '生成成功' },
{ id: 4, name: '生成失败' },
{ id: 5, name: '退款' }
],
// 请求列表参数
searchData: {
userId: undefined,
status: undefined,
id: undefined,
pageNum: 1,
pageSize: 10
},
total: 0,
resData: [],
appOpts: [],
currentContent: '',
dialogVisible: false
}
},
watch: {},
mounted() {
this.getDataList()
},
methods: {
handleStatus(status) {
if (!status) {
return '--'
}
const obj = this.aiImgToVideoStatusList.find(item => item.id === status)
return obj.name || '--'
},
handleModelType(type) {
if (!type) {
return '--'
}
return type === 1 ? 'AI小艺' : 'AI小萌'
},
async getDataList() {
try {
const r = await aiTextToNovelList(this.searchData)
const data = r.data
this.total = data.total
this.resData = data.list
} catch (error) {
console.error('查询失败:', error)
}
},
// 刷新数据
refreshView() {
this.searchData = {
pageNum: 1,
pageSize: 10
}
this.getDataList()
},
// TODO:删除金币管理列表数据
handleDelete(row) {
this.$confirm('确定删除?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteNovel({ id: row.id }).then(res => {
if (res.code === 200) {
this.getDataList()
this.$message.success('成功删除!')
} else {
this.$message.error('操作失败')
}
})
})
},
changeStatus(row) {
this.$confirm('确定退款?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateNovel({ id: row.id, status: 5 }).then(res => {
if (res.code === 200) {
this.getDataList()
this.$message.success('已退款!')
} else {
this.$message.error('操作失败')
}
})
})
},
view(text) {
this.currentContent = text.replace(/\n/g, '<br>')
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
// 切换每页数据量
handleSizeChange(val) {
this.searchData.pageSize = val
this.getDataList()
},
// 切换页数
handleCurrentChange(val) {
this.searchData.pageNum = val
this.getDataList()
}
}
}
</script>
<style lang="scss" scoped>
.ai-novel-list {
/deep/ .el-button {
padding: 9px 15px;
}
/deep/ .el-image {
width: 100px;
height: 100px;
img {
object-fit: contain;
}
}
}
.ellipsis2 {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-right: 5px;
}
.view-btn {
width: 35px;
}
.look-dialog {
text-align: center;
}
.viewContent {
border: 2px solid;
color: #121327;
border-radius: 8px;
padding: 10px 4px;
}
</style>
@@ -1,46 +1,26 @@
<template> <template>
<el-dialog <el-dialog :title="title" :visible.sync="Visible" width="780px" center class="ac-dialog" :close-on-click-modal="false"
:title="title"
:visible.sync="Visible"
width="780px"
center
class="ac-dialog"
:close-on-click-modal="false"
@close="close"> @close="close">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col> <el-col>
<h3>AI生成的视频URl</h3> <h3>AI生成的视频URl</h3>
<div v-if="form.modifyVideoUrl" style="width: 380px; height: 240px; overflow: hidden"> <div v-if="form.modifyVideoUrl" style="width: 380px; height: 240px; overflow: hidden">
<DPlayer <DPlayer ref="player" v-if="form.modifyVideoUrl.indexOf('mp4') === -1" :video="{
ref="player"
v-if="form.modifyVideoUrl.indexOf('mp4') === -1"
:video="{
url: '/api/web/media/m3u8/' + filterM3u8(form.modifyVideoUrl), url: '/api/web/media/m3u8/' + filterM3u8(form.modifyVideoUrl),
type: 'hls', type: 'hls',
pic: '', pic: '',
}" }" hotkey ></DPlayer>
hotkey ></DPlayer> <DPlayer ref="player" v-else :video="{
<DPlayer
ref="player"
v-else
:video="{
url: this.$store.getters.getSystemConfig.mp4Url + form.modifyVideoUrl, url: this.$store.getters.getSystemConfig.mp4Url + form.modifyVideoUrl,
type: 'mp4', type: 'mp4',
pic: '', pic: '',
}" }" hotkey ></DPlayer>
hotkey ></DPlayer>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-form <el-form :inline="true" :model="form" :rules="rules" ref="form" class="demo-form-inline" label-width="120px"
:inline="true"
:model="form"
:rules="rules"
ref="form"
class="demo-form-inline"
label-width="120px"
label-position="right"> label-position="right">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12"> <el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
@@ -51,10 +31,7 @@ label-width="120px"
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12"> <el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="换脸方式"> <el-form-item label="换脸方式">
<el-select placeholder="请选择换脸方式" clearable v-model="form.byWay"> <el-select placeholder="请选择换脸方式" clearable v-model="form.byWay">
<el-option <el-option :key="item.value" :label="item.label" :value="item.value"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in aiOrderFaceChangeList" /> v-for="item in aiOrderFaceChangeList" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -74,6 +51,7 @@ label-width="120px"
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button> <el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="submit('form')"> </el-button> <el-button type="primary" @click="submit('form')"> </el-button>
@@ -105,15 +83,15 @@ export default {
formData: {}, formData: {},
// 表单数据 // 表单数据
form: { form: {
'byWay': undefined, "byWay": undefined,
'id': undefined, "id": undefined,
'modifyImgs': undefined, "modifyImgs": undefined,
'modifyVideoUrl': undefined, "modifyVideoUrl": undefined,
'reason': undefined, "reason": undefined,
'status': 0, "status": 0,
'updatedAt': undefined "updatedAt": undefined
}, },
rules: {} rules: {},
} }
}, },
mounted() { mounted() {
@@ -131,7 +109,10 @@ export default {
}, },
//TODO:编辑应用列表数据 //TODO:编辑应用列表数据
update(data) { update(data) {
aiorderStripUpdate(data).then((res) => { aiorderStripUpdate(data).then((res) => {
if (res && res.code === 200) { if (res && res.code === 200) {
this.$message.success(res.data ? res.data : '更新成功') this.$message.success(res.data ? res.data : '更新成功')
} else { } else {
@@ -180,8 +161,8 @@ export default {
onClear(data) { onClear(data) {
this.form[data] = undefined this.form[data] = undefined
} },
} },
} }
</script> </script>
+46 -47
View File
@@ -106,8 +106,7 @@
:total="total" :total="total"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
@size-change="handleSizeChange" @size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"/>
/>
</div> </div>
<!-- 新增及编辑 --> <!-- 新增及编辑 -->
<Edit :data="editData" v-if="editVisible" @close="closeEdit" /> <Edit :data="editData" v-if="editVisible" @close="closeEdit" />
@@ -116,18 +115,18 @@
</template> </template>
<script> <script>
// 引入模块 // 引入模块
import Edit from './components/AddOrEdit'; import Edit from './components/AddOrEdit'
import ShowImg from '@/components/ShowImg/index.vue'; import ShowImg from '@/components/ShowImg/index.vue'
import ShowVideo from '@/components/ShowVideo/index.vue'; import ShowVideo from '@/components/ShowVideo/index.vue'
import { aiStripSearch } from '@/api/aiManagement/aiOrder'; import { aiStripSearch } from '@/api/aiManagement/aiOrder'
import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate'; import { AiContentTypeList } from '@/filters/aiManagement/aiTemplate'
import { aiOrderFaceChangeList, aiFaceOrderList } from '@/filters/aiManagement/aiFaceOrder'; import { aiOrderFaceChangeList, aiFaceOrderList } from '@/filters/aiManagement/aiFaceOrder'
export default { export default {
name: 'AiOrder', name: 'AiOrder',
components: { components: {
ShowImg, ShowImg,
ShowVideo, ShowVideo,
Edit, Edit
}, },
data() { data() {
return { return {
@@ -141,7 +140,7 @@ export default {
byWay: undefined, byWay: undefined,
aoContentType: undefined, aoContentType: undefined,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10
}, },
resData: [], // el-table表格数据 resData: [], // el-table表格数据
editVisible: false, editVisible: false,
@@ -149,96 +148,96 @@ export default {
loading: true, // 列表加载状态 loading: true, // 列表加载状态
AiContentTypeList: AiContentTypeList(), AiContentTypeList: AiContentTypeList(),
aiOrderFaceChangeList: aiOrderFaceChangeList(), aiOrderFaceChangeList: aiOrderFaceChangeList(),
aiFaceOrderList: aiFaceOrderList(), aiFaceOrderList: aiFaceOrderList()
}; }
}, },
mounted() { mounted() {
this.getGameInfo(); this.getGameInfo()
}, },
methods: { methods: {
// TODO:请求应用列表数据 // TODO:请求应用列表数据
getGameInfo() { getGameInfo() {
aiStripSearch(this.searchData).then(res => { aiStripSearch(this.searchData).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.resData = res.data.list; this.resData = res.data.list
this.total = res.data.total; this.total = res.data.total
} else { } else {
this.resData = []; this.resData = []
this.total = 0; this.total = 0
this.$message.error('请求列表失败!'); this.$message.error('请求列表失败!')
} }
this.loading = false; this.loading = false
}); })
}, },
// TODO:删除应用列表数据 // TODO:删除应用列表数据
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('确定删除?', '警告', { this.$confirm('确定删除?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}).then(() => { }).then(() => {
AppInfoDel({ id: row.id }).then(res => { AppInfoDel({ id: row.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.getGameInfo(); this.getGameInfo()
this.$message.success('成功删除!'); this.$message.success('成功删除!')
} else { } else {
this.$message.error('操作失败'); this.$message.error('操作失败')
} }
}); })
}); })
}, },
onSearch() { onSearch() {
this.searchData.pageNum = 1; this.searchData.pageNum = 1
this.searchData.pageSize = 10; this.searchData.pageSize = 10
this.getGameInfo(); this.getGameInfo()
}, },
// 切换每页数据量 // 切换每页数据量
handleSizeChange(val) { handleSizeChange(val) {
this.searchData.pageSize = val; this.searchData.pageSize = val
this.getGameInfo(); this.getGameInfo()
}, },
// 切换页数 // 切换页数
handleCurrentChange(val) { handleCurrentChange(val) {
this.searchData.pageNum = val; this.searchData.pageNum = val
this.getGameInfo(); this.getGameInfo()
}, },
// 新增按钮 // 新增按钮
add() { add() {
this.editVisible = true; this.editVisible = true
}, },
// 编辑按钮 // 编辑按钮
handleEdit(index, row) { handleEdit(index, row) {
this.editVisible = true; this.editVisible = true
this.editData = { this.editData = {
title: '编辑', title: '编辑',
data: row, data: row
}; }
}, },
// 关闭编辑弹窗 // 关闭编辑弹窗
closeEdit() { closeEdit() {
this.editData = { this.editData = {
title: '新增', title: '新增',
data: {}, data: {}
}; }
this.editVisible = false; this.editVisible = false
this.getGameInfo(); this.getGameInfo()
}, },
// 清空某一项筛选列表 // 清空某一项筛选列表
onClear(key) { onClear(key) {
this.searchData[key] = undefined; this.searchData[key] = undefined
this.getGameInfo(); this.getGameInfo()
}, },
// 视频查看 // 视频查看
checkMedia(url, data) { checkMedia(url, data) {
this.$refs.showvideo.open(url, data, data.id); this.$refs.showvideo.open(url, data, data.id)
}, }
}, }
}; }
</script> </script>
+3 -3
View File
@@ -98,7 +98,7 @@
// 引入模块 // 引入模块
import Edit from './components/AddOrEdit' import Edit from './components/AddOrEdit'
import ShowImg from '@/components/ShowImg/index.vue' import ShowImg from '@/components/ShowImg/index.vue'
import { aiTextToImageList, aiTextToImageeDel, aiTextToImageeUpdate } from '@/api/aiManagement/aiTxtToImg.js' import { aiTextToImageList, aiTextToImageDel, aiTextToImageUpdate } from '@/api/aiManagement/aiTxtToImg.js'
export default { export default {
name: 'Gold', name: 'Gold',
@@ -179,7 +179,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
aiTextToImageeDel({ id: row.id }).then(res => { aiTextToImageDel({ id: row.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.getGoldList() this.getGoldList()
this.$message.success('成功删除!') this.$message.success('成功删除!')
@@ -195,7 +195,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
aiTextToImageeUpdate({ id: row.id, status: 5 }).then(res => { aiTextToImageUpdate({ id: row.id, status: 5 }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.getGoldList() this.getGoldList()
this.$message.success('已退款!') this.$message.success('已退款!')