@@ -6,7 +6,7 @@ import request from "@/utils/request.js"; | |||||
* @params pageNum, pageSize | * @params pageNum, pageSize | ||||
* @returns data | * @returns data | ||||
*/ | */ | ||||
export function userPhotoVideoList(pageNum, pageSize, title) { | |||||
export function userPhotoVideoListApi(pageNum, pageSize, title) { | |||||
return request({ | return request({ | ||||
url: `/api/userPhotoVideo/list?pageNum=${pageNum}&pageSize=${pageSize}&title=${title}`, | url: `/api/userPhotoVideo/list?pageNum=${pageNum}&pageSize=${pageSize}&title=${title}`, | ||||
method: 'get' | method: 'get' | ||||
@@ -18,9 +18,21 @@ export function userPhotoVideoList(pageNum, pageSize, title) { | |||||
* @params videoID | * @params videoID | ||||
* @returns data | * @returns data | ||||
*/ | */ | ||||
export function delUserPhotoVideoByID(videoID) { | |||||
export function delUserPhotoVideoByIDApi(videoID) { | |||||
return request({ | return request({ | ||||
url: `/api/userPhotoVideo/del?id=${videoID}`, | url: `/api/userPhotoVideo/del?id=${videoID}`, | ||||
method: 'get' | method: 'get' | ||||
}) | }) | ||||
} | |||||
/** | |||||
* @description 提升画质 | |||||
* @params id | |||||
* @returns data | |||||
*/ | |||||
export function videoHyApi(id) { | |||||
return request({ | |||||
url: `/api/userPhotoVideo/videoHy?id=${id}`, | |||||
method: 'get' | |||||
}) | |||||
} | } |
@@ -74,7 +74,7 @@ export default { | |||||
searchMusic:'Search Music', | searchMusic:'Search Music', | ||||
comingSoon:'coming soon', | comingSoon:'coming soon', | ||||
hotMusic:'Hit song', | hotMusic:'Hit song', | ||||
inputRequirement:'Please enter your requirements', | |||||
inputRequirement:'Please enter your requirements, for example: Please generate a beverage advertisement of 500 words or less', | |||||
GeneratedText:'Generated Text', | GeneratedText:'Generated Text', | ||||
SmartText:'Smart Text', | SmartText:'Smart Text', | ||||
copy:'Copy to text', | copy:'Copy to text', | ||||
@@ -82,6 +82,7 @@ export default { | |||||
tooltip2:'Add Pause', | tooltip2:'Add Pause', | ||||
uploadImgTip1:'Click here to upload pictures', | uploadImgTip1:'Click here to upload pictures', | ||||
uploadImgTip2:'Please ensure that the uploaded image is an open face image', | uploadImgTip2:'Please ensure that the uploaded image is an open face image', | ||||
entered:'entered' | |||||
}, | }, | ||||
// 我的视频 | // 我的视频 | ||||
@@ -104,7 +105,9 @@ export default { | |||||
manuscriptText: "Manuscript", | manuscriptText: "Manuscript", | ||||
generatingText: "The video is generating, Please wait a moment", | generatingText: "The video is generating, Please wait a moment", | ||||
generationFailedText: "Video generation failed, you can click the button below to edit the generation again ", | generationFailedText: "Video generation failed, you can click the button below to edit the generation again ", | ||||
edit:'Edit' | |||||
edit:'Edit', | |||||
upSharpness:'Upgrade image quality', | |||||
upSharpnessTips:'If you are satisfied with the preview, you can click here to improve the video sharpness ~', | |||||
}, | }, | ||||
// 个人账户 | // 个人账户 | ||||
@@ -74,7 +74,7 @@ export default { | |||||
searchMusic:'搜索音乐', | searchMusic:'搜索音乐', | ||||
comingSoon:'敬请期待', | comingSoon:'敬请期待', | ||||
hotMusic:'热门歌曲', | hotMusic:'热门歌曲', | ||||
inputRequirement:'请输入您的需求', | |||||
inputRequirement:'请输入您的需求,例如:请生成一个500字以内的饮料广告', | |||||
GeneratedText:'生成文本', | GeneratedText:'生成文本', | ||||
SmartText:'智能文本', | SmartText:'智能文本', | ||||
copy:'复制到文案', | copy:'复制到文案', | ||||
@@ -82,6 +82,7 @@ export default { | |||||
tooltip2:'添加停顿', | tooltip2:'添加停顿', | ||||
uploadImgTip1:'点此上传图片', | uploadImgTip1:'点此上传图片', | ||||
uploadImgTip2:'请确保上传图片为无遮挡的正脸图片', | uploadImgTip2:'请确保上传图片为无遮挡的正脸图片', | ||||
entered:'已输入', | |||||
}, | }, | ||||
// 我的视频 | // 我的视频 | ||||
@@ -104,7 +105,9 @@ export default { | |||||
manuscriptText: "草稿", | manuscriptText: "草稿", | ||||
generatingText: "视频正在生成中,请稍等哦", | generatingText: "视频正在生成中,请稍等哦", | ||||
generationFailedText: "视频生成失败,您可以点击下方按钮重新编辑生成", | generationFailedText: "视频生成失败,您可以点击下方按钮重新编辑生成", | ||||
edit:'编辑' | |||||
edit:'编辑', | |||||
upSharpness:'升级画质', | |||||
upSharpnessTips:'如果对预览效果满意,您可以点击此处来提升视频清晰度~', | |||||
}, | }, | ||||
// 个人账户 | // 个人账户 | ||||
@@ -259,7 +259,7 @@ | |||||
<div class="text"> | <div class="text"> | ||||
<!-- 文本域 --> | <!-- 文本域 --> | ||||
<el-input | <el-input | ||||
maxlength="3000" | |||||
maxlength="500" | |||||
id="textInputId" | id="textInputId" | ||||
v-model="textareaContent" | v-model="textareaContent" | ||||
:rows="12" | :rows="12" | ||||
@@ -291,6 +291,10 @@ | |||||
🕗 | 🕗 | ||||
</el-tooltip></span | </el-tooltip></span | ||||
> | > | ||||
<i | |||||
>{{ $t("createVideo.entered") }} | |||||
{{ textareaContent.length }} / 500</i | |||||
> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<p>{{ $t("createVideo.languages") }}</p> | <p>{{ $t("createVideo.languages") }}</p> | ||||
@@ -625,7 +629,7 @@ | |||||
<div class="text"> | <div class="text"> | ||||
<!-- 文本域 --> | <!-- 文本域 --> | ||||
<el-input | <el-input | ||||
maxlength="300" | |||||
maxlength="200" | |||||
id="textInputId" | id="textInputId" | ||||
v-model="problemContent" | v-model="problemContent" | ||||
:rows="5" | :rows="5" | ||||
@@ -650,12 +654,17 @@ | |||||
<div class="text" style="cursor: text"> | <div class="text" style="cursor: text"> | ||||
<!-- 文本域 --> | <!-- 文本域 --> | ||||
<el-input | <el-input | ||||
maxlength="500" | |||||
id="textInputId" | id="textInputId" | ||||
v-model="answerContent" | v-model="answerContent" | ||||
:rows="15" | :rows="15" | ||||
type="textarea" | type="textarea" | ||||
disabled="" | disabled="" | ||||
/> | /> | ||||
<i | |||||
>{{ $t("createVideo.entered") }} {{ answerContent.length }} / | |||||
500</i | |||||
> | |||||
</div> | </div> | ||||
<!-- <div class="card4Btn" @click="copyAnswerContent"> | <!-- <div class="card4Btn" @click="copyAnswerContent"> | ||||
{{ $t("createVideo.copy") }} | {{ $t("createVideo.copy") }} | ||||
@@ -1616,6 +1625,7 @@ function createWS() { | |||||
mySocket.close(); | mySocket.close(); | ||||
return; | return; | ||||
} | } | ||||
answerContent.value = answerContent.value + event.data; | answerContent.value = answerContent.value + event.data; | ||||
}; | }; | ||||
@@ -1630,6 +1640,13 @@ function createWS() { | |||||
}; | }; | ||||
mySocket.onerror = (error) => { | mySocket.onerror = (error) => { | ||||
ElMessage.error( | |||||
lanChange.value == "zh-cn" | |||||
? `GPT服务器连接失败,请稍后重试!` | |||||
: `GPT Server connection failed, please try again later` | |||||
); | |||||
sendLoading.value = false; | |||||
mySocket.close(); | |||||
console.error("WebSocket 错误4:", error); | console.error("WebSocket 错误4:", error); | ||||
}; | }; | ||||
} | } | ||||
@@ -2259,6 +2276,10 @@ onUnmounted(() => { | |||||
text-align: center; | text-align: center; | ||||
width: 40px; | width: 40px; | ||||
} | } | ||||
i { | |||||
font-size: 14px; | |||||
float: right; | |||||
} | |||||
.previewAudioLoadingBox { | .previewAudioLoadingBox { | ||||
display: inline-block; | display: inline-block; | ||||
margin-top: -20px; | margin-top: -20px; | ||||
@@ -2520,7 +2541,7 @@ onUnmounted(() => { | |||||
} | } | ||||
.card4 { | .card4 { | ||||
.text { | .text { | ||||
padding: 10px; | |||||
padding: 10 px; | |||||
border: 1px solid #c0c4cc; | border: 1px solid #c0c4cc; | ||||
.el-button { | .el-button { | ||||
float: right; | float: right; | ||||
@@ -2533,6 +2554,10 @@ onUnmounted(() => { | |||||
resize: none; | resize: none; | ||||
box-shadow: none; | box-shadow: none; | ||||
} | } | ||||
i { | |||||
font-size: 14px; | |||||
float: right; | |||||
} | |||||
} | } | ||||
p { | p { | ||||
@@ -148,22 +148,49 @@ | |||||
<!-- 有视频路径的页脚 --> | <!-- 有视频路径的页脚 --> | ||||
<div class="footer" v-if="presentItem.videoPlayUrl"> | <div class="footer" v-if="presentItem.videoPlayUrl"> | ||||
<span class="dialog-footer"> | <span class="dialog-footer"> | ||||
<!-- dialog下载按钮 --> | |||||
<!-- dialog下载按钮 upGrades--> | |||||
<button | <button | ||||
class="elBtn" | class="elBtn" | ||||
type="primary" | type="primary" | ||||
@click.stop="handleDownload(presentItem.videoPlayUrl)" | @click.stop="handleDownload(presentItem.videoPlayUrl)" | ||||
> | > | ||||
<el-icon class="icon-delete"><i-ep-download /></el-icon | |||||
>{{ $t("myCreating.download") }} | |||||
<!-- <el-icon class="icon-delete"><i-ep-download /></el-icon> --> | |||||
{{ $t("myCreating.download") }} | |||||
</button> | </button> | ||||
<!-- 提升画质 --> | |||||
<el-tooltip | |||||
v-if="presentItem.isHy == 0" | |||||
class="box-item" | |||||
effect="light" | |||||
:content="$t('myCreating.upSharpnessTips')" | |||||
placement="top" | |||||
> | |||||
<button | |||||
class="elBtn upSharpness" | |||||
@click.stop="upGrades(presentItem.id)" | |||||
> | |||||
<div v-if="!upGradesLoading"> | |||||
<img src="../../assets//img/Upgrades.png" alt="" /> | |||||
{{ $t("myCreating.upSharpness") }} | |||||
</div> | |||||
<div v-if="upGradesLoading"> | |||||
<!-- <my-Loading-Icon | |||||
class="previewAudioLoadingBox" | |||||
v-if="!upGradesLoading" | |||||
></my-Loading-Icon> --> | |||||
<el-icon class="is-loading" style="font-size: 16px" | |||||
><i-ep-Loading | |||||
/></el-icon> | |||||
</div> | |||||
</button> | |||||
</el-tooltip> | |||||
<!-- dialog删除按钮 --> | <!-- dialog删除按钮 --> | ||||
<button | <button | ||||
class="elBtn" | class="elBtn" | ||||
@click.stop="handelDelete(presentItem.id, presentItem.title)" | @click.stop="handelDelete(presentItem.id, presentItem.title)" | ||||
> | > | ||||
<el-icon class="icon-delete"><i-ep-delete /></el-icon | |||||
>{{ $t("myCreating.delete") }} | |||||
<!-- <el-icon class="icon-delete"><i-ep-delete /></el-icon> --> | |||||
{{ $t("myCreating.delete") }} | |||||
</button> | </button> | ||||
</span> | </span> | ||||
</div> | </div> | ||||
@@ -207,7 +234,11 @@ | |||||
</template> | </template> | ||||
<script setup> | <script setup> | ||||
import { userPhotoVideoList, delUserPhotoVideoByID } from "@/apis/myCreating"; | |||||
import { | |||||
userPhotoVideoListApi, | |||||
delUserPhotoVideoByIDApi, | |||||
videoHyApi, | |||||
} from "@/apis/myCreating"; | |||||
import { timestampToTime } from "@/utils/tools"; | import { timestampToTime } from "@/utils/tools"; | ||||
import { useI18n } from "vue-i18n"; | import { useI18n } from "vue-i18n"; | ||||
import { getStatus } from "./videoStatus"; | import { getStatus } from "./videoStatus"; | ||||
@@ -277,11 +308,11 @@ function handleDownload(itemVideoPlayUrl) { | |||||
function goCreate() { | function goCreate() { | ||||
router.push("/createVideo"); | router.push("/createVideo"); | ||||
} | } | ||||
// 搜索 | |||||
function searchVideoList() { | function searchVideoList() { | ||||
getPhotoVideoList(pageNum.value, pageSize.value, title.value, true); | getPhotoVideoList(pageNum.value, pageSize.value, title.value, true); | ||||
} | } | ||||
// 删除 | |||||
function handelDelete(id, title) { | function handelDelete(id, title) { | ||||
const msg = | const msg = | ||||
lanChange.value == "zh-cn" | lanChange.value == "zh-cn" | ||||
@@ -297,13 +328,47 @@ function handelDelete(id, title) { | |||||
delPhotoVideo(id); | delPhotoVideo(id); | ||||
}); | }); | ||||
} | } | ||||
// 升级画质 | |||||
const upGradesLoading = ref(false); | |||||
function upGrades(id) { | |||||
const msg = | |||||
lanChange.value == "zh-cn" | |||||
? `确定要升级该作品吗?` | |||||
: `Are you sure you want to upgrade this work?`; | |||||
const notice = lanChange.value == "zh-cn" ? "提示" : "Notice"; | |||||
const confirm = lanChange.value == "zh-cn" ? "确定" : "Confirm"; | |||||
const cancel = lanChange.value == "zh-cn" ? "取消" : "Cancel"; | |||||
ElMessageBox.confirm(msg, notice, { | |||||
confirmButtonText: confirm, | |||||
cancelButtonText: cancel, | |||||
}).then(async () => { | |||||
upGradesLoading.value = true; | |||||
try { | |||||
const res = await videoHyApi(id); | |||||
ElMessage.error( | |||||
lanChange.value == "zh-cn" | |||||
? `升级成功!请稍等~` | |||||
: `Upgrade successful! Please wait a moment` | |||||
); | |||||
upGradesLoading.value = false; | |||||
getPhotoVideoList(pageNum.value, pageSize.value, title.value); | |||||
} catch (error) { | |||||
ElMessage.error( | |||||
lanChange.value == "zh-cn" | |||||
? `升级失败,请稍后重试` | |||||
: `Upgrade failed, please try again later` | |||||
); | |||||
upGradesLoading.value = false; | |||||
} | |||||
}); | |||||
} | |||||
/** | /** | ||||
* @description:获取我的视频作品 | * @description:获取我的视频作品 | ||||
* @return: data | * @return: data | ||||
*/ | */ | ||||
function getPhotoVideoList(pageNum, pageSize, title, searchFlag) { | function getPhotoVideoList(pageNum, pageSize, title, searchFlag) { | ||||
userPhotoVideoList(pageNum, pageSize, title) | |||||
userPhotoVideoListApi(pageNum, pageSize, title) | |||||
.then((res) => { | .then((res) => { | ||||
console.log(res, "res"); | console.log(res, "res"); | ||||
res.data.list.forEach((item) => { | res.data.list.forEach((item) => { | ||||
@@ -345,7 +410,7 @@ function getPhotoVideoList(pageNum, pageSize, title, searchFlag) { | |||||
* @return: data | * @return: data | ||||
*/ | */ | ||||
function delPhotoVideo(videoID) { | function delPhotoVideo(videoID) { | ||||
delUserPhotoVideoByID(videoID) | |||||
delUserPhotoVideoByIDApi(videoID) | |||||
.then((res) => { | .then((res) => { | ||||
console.log(res, "res"); | console.log(res, "res"); | ||||
const msg = lanChange.value == "zh-cn" ? `删除成功!` : `Success !`; | const msg = lanChange.value == "zh-cn" ? `删除成功!` : `Success !`; | ||||
@@ -671,7 +736,12 @@ onMounted(() => { | |||||
background-color: #15d1b8; | background-color: #15d1b8; | ||||
} | } | ||||
} | } | ||||
.upSharpness { | |||||
img { | |||||
width: 14px; | |||||
height: 14px; | |||||
} | |||||
} | |||||
:deep(.el-icon) { | :deep(.el-icon) { | ||||
margin-right: 5px; | margin-right: 5px; | ||||
font-weight: 700; | font-weight: 700; | ||||