|
@@ -4,6 +4,7 @@
|
|
|
v-if="faceShowStatus"
|
|
|
title="换脸操作"
|
|
|
:visible="faceShowStatus"
|
|
|
+ :confirmLoading="confirmLoading"
|
|
|
dialog-class="change-face-modal"
|
|
|
@ok="handlePolicyOperationSure"
|
|
|
@cancel="handlePolicyOperationCancel"
|
|
@@ -43,7 +44,8 @@
|
|
|
<div class="ant-upload-text">Upload</div>
|
|
|
</div>
|
|
|
</a-upload>
|
|
|
- <p>提示:上传人脸照片只会识别一次</p>
|
|
|
+ <p style="margin: 0;">1、请保证脸部无遮挡、光线充足</p>
|
|
|
+ <p style="margin: 0;">2、视频、照片中只能出现一张人脸</p>
|
|
|
</a-form-model-item>
|
|
|
</a-form-model>
|
|
|
<div v-else-if="faceType === 'b'" class="face-right-div">
|
|
@@ -64,9 +66,8 @@
|
|
|
<img v-if="!text" src="@/assets/noImg.png" style="width:60px">
|
|
|
</span>
|
|
|
<span slot="actions" slot-scope="text, record">
|
|
|
- <!-- TODO -->
|
|
|
- <!-- <a @click="handlePushData(record)">推送</a>
|
|
|
- <a-divider type="vertical"/> -->
|
|
|
+ <a :disabled="!faceShowList.projectId || record.status !== 'finished'" @click="handlePushData(record)">推送</a>
|
|
|
+ <a-divider type="vertical"/>
|
|
|
<a @click="handleDownLoadData(record)" :disabled="record.status !== 'finished'">下载</a>
|
|
|
</span>
|
|
|
</a-table>
|
|
@@ -109,13 +110,14 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ confirmLoading: false,
|
|
|
departValueInfoModality: [],
|
|
|
departValueInfoMod: [],
|
|
|
departValueInfoSence: [],
|
|
|
getProjectId: '',
|
|
|
defaultCurrent: 1,
|
|
|
dataAllList: [],
|
|
|
- totalAll: 100,
|
|
|
+ totalAll: 0,
|
|
|
uploadType: 'face',
|
|
|
dataSource: [],
|
|
|
settlementColumns: [
|
|
@@ -178,14 +180,15 @@ export default {
|
|
|
handleFaceTypeChange(e) {
|
|
|
if (e.target.value === 'b') {
|
|
|
this.handleInitTable();
|
|
|
- this.handleGetDetailList();
|
|
|
this.handleGetMaterialTagInfo();
|
|
|
}
|
|
|
},
|
|
|
handleInitTable() {
|
|
|
const paramsData = {
|
|
|
- videoMd5: this.faceShowList.videoCode
|
|
|
+ videoMd5: this.faceShowList.projectId ? this.faceShowList.code : this.faceShowList.videoCode
|
|
|
};
|
|
|
+ // http://192.168.1.34:8000
|
|
|
+ // http://faceswap.tjyourong.com.cn
|
|
|
postAction('http://faceswap.tjyourong.com.cn/jeecg-boot/task/query', paramsData).then(result => {
|
|
|
if (result.code === 0) {
|
|
|
this.dataAllList = result.data;
|
|
@@ -201,7 +204,7 @@ export default {
|
|
|
},
|
|
|
handleGetDetailList() {
|
|
|
getAction('/ctop/materialInfo/queryById', {
|
|
|
- id: this.faceShowList.videoCode
|
|
|
+ id: this.faceShowList.projectId ? this.faceShowList.code : this.faceShowList.videoCode
|
|
|
}).then(res => {
|
|
|
if (res.success) {
|
|
|
this.getProjectId = res.result.projectId;
|
|
@@ -210,7 +213,7 @@ export default {
|
|
|
},
|
|
|
handleGetMaterialTagInfo() {
|
|
|
getAction('/ctop/materialTagInfo/detail', {
|
|
|
- code: this.faceShowList.videoCode
|
|
|
+ code: this.faceShowList.projectId ? this.faceShowList.code : this.faceShowList.videoCode
|
|
|
}).then(res => {
|
|
|
if (res.success) {
|
|
|
this.departValueInfoModality = res.modalityTagList.map(item => item.tagId);
|
|
@@ -221,26 +224,44 @@ export default {
|
|
|
},
|
|
|
// TODO 推送操作
|
|
|
handlePushData(list) {
|
|
|
- console.log(list, '推送操作');
|
|
|
const paramsData = {
|
|
|
- projectId: this.getProjectId, // 项目选择
|
|
|
- planId: 'admin',
|
|
|
- shotId: 'admin',
|
|
|
- clipId: 'admin',
|
|
|
+ projectId: this.faceShowList.projectId, // 项目选择
|
|
|
+ ascription: {
|
|
|
+ planId: 'e9ca23d68d884d4ebb19d07889727dae',
|
|
|
+ shotId: 'e9ca23d68d884d4ebb19d07889727dae',
|
|
|
+ clipId: 'e9ca23d68d884d4ebb19d07889727dae'
|
|
|
+ },
|
|
|
+ status: '1',
|
|
|
+ code: list.output_video_md5,
|
|
|
+ url: list.output_video_url && list.output_video_url.split(':')[1],
|
|
|
+ type: 'VIDEO',
|
|
|
+ userId: this.userInfo().id,
|
|
|
modalityTagList: this.departValueInfoModality, // 形式标签
|
|
|
senceTagList: this.departValueInfoSence, // 场景标签
|
|
|
modTagList: this.departValueInfoMod // 基调标签
|
|
|
};
|
|
|
- fileInsertV2(paramsData).then(res => {
|
|
|
- if (res.success) {
|
|
|
- console.log(res, 'res---res推送');
|
|
|
+ const that = this;
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否进行推送操作',
|
|
|
+ onOk() {
|
|
|
+ fileInsertV2(paramsData).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ that.handlePolicyOperationCancel();
|
|
|
+ that.$emit('sureface');
|
|
|
+ that.$message.error('素材已经同步到未审核列表,请进入查看');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 下载操作
|
|
|
handleDownLoadData(list) {
|
|
|
const randomTime = new Date().getTime() + '_check.mp4';
|
|
|
- fetch(list.input_video_url)
|
|
|
+ fetch(list.output_video_url)
|
|
|
.then(res => res.blob())
|
|
|
.then(blob => {
|
|
|
const a = document.createElement('a');
|
|
@@ -262,18 +283,29 @@ export default {
|
|
|
this.defaultCurrent = 1;
|
|
|
this.handleInitTable();
|
|
|
},
|
|
|
+ checkTv(data) {
|
|
|
+ const index = data.lastIndexOf(".");
|
|
|
+ let tv_id = '';
|
|
|
+ tv_id = data.substring(index);
|
|
|
+ if(tv_id !== ".mp4" && tv_id !== ".rmvb" && tv_id !== ".avi" && tv_id !== ".ts") {
|
|
|
+ return data + '.mp4';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 确定按钮
|
|
|
handlePolicyOperationSure() {
|
|
|
if (this.faceType === 'a') {
|
|
|
+ this.confirmLoading = true;
|
|
|
if (!this.md5Result) {
|
|
|
this.$message.error('请上传图片');
|
|
|
return;
|
|
|
}
|
|
|
const paramsData = {
|
|
|
- inputVideoUrl: this.faceShowList.url,
|
|
|
- // inputVideoUrl: 'https://media-1301855440.cos.ap-chongqing.myqcloud.com/video/2021-08-05/%E4%BC%9A%E7%8E%A9-%E6%B1%9F%E6%96%8C%E7%BB%84-%E7%BC%96%E6%9C%B1%E6%B1%9F%E6%96%8C-%E6%91%84%E6%9D%A8%E5%A8%81-%E5%89%AA%E9%83%91%E7%BF%94%E7%82%9C-08.03%20%282%29-1628164520693.mp4',
|
|
|
+ inputVideoUrl: this.checkTv(this.faceShowList.url),
|
|
|
inputImageUrl: this.urlResult,
|
|
|
- videoMd5: this.faceShowList.videoCode,
|
|
|
+ videoMd5: this.faceShowList.projectId ? this.faceShowList.code : this.faceShowList.videoCode,
|
|
|
imageMd5: this.md5Result,
|
|
|
createBy: this.userInfo().id
|
|
|
};
|
|
@@ -281,12 +313,19 @@ export default {
|
|
|
if (result.code === 0) {
|
|
|
this.handlePolicyOperationCancel();
|
|
|
this.$emit('sureface');
|
|
|
+ this.$message.success('图片上传成功');
|
|
|
+ this.confirmLoading = false;
|
|
|
}
|
|
|
else {
|
|
|
- this.$message.error(result.message);
|
|
|
+ this.$message.success('目标图片已存在,请下载视频');
|
|
|
+ this.faceType = 'b';
|
|
|
+ this.handleInitTable();
|
|
|
+ this.handleGetMaterialTagInfo();
|
|
|
+ this.confirmLoading = false;
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
console.log(error, 'eeee');
|
|
|
+ this.confirmLoading = false;
|
|
|
});
|
|
|
}
|
|
|
else {
|