|
@@ -13,7 +13,9 @@
|
|
|
<a-radio-button value="a">人脸合成</a-radio-button>
|
|
|
<a-radio-button value="b">合成列表</a-radio-button>
|
|
|
</a-radio-group>
|
|
|
- <span v-if="faceType === 'b'" class="add-acount-policy-btn"><a-button type="primary" @click="handleRefresh">刷新</a-button></span>
|
|
|
+ <span v-if="faceType === 'b'" class="add-acount-policy-btn">
|
|
|
+ <a-button type="primary" @click="handleRefresh">刷新</a-button>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<a-form-model
|
|
|
v-if="faceType === 'a'"
|
|
@@ -62,9 +64,10 @@
|
|
|
<img v-if="!text" src="@/assets/noImg.png" style="width:60px">
|
|
|
</span>
|
|
|
<span slot="actions" slot-scope="text, record">
|
|
|
- <a @click="handlePushData(record)">推送</a>
|
|
|
- <a-divider type="vertical"/>
|
|
|
- <a @click="handleDownLoadData(record)">下载</a>
|
|
|
+ <!-- TODO -->
|
|
|
+ <!-- <a @click="handlePushData(record)">推送</a>
|
|
|
+ <a-divider type="vertical"/> -->
|
|
|
+ <a @click="handleDownLoadData(record)" :disabled="record.status !== 'finished'">下载</a>
|
|
|
</span>
|
|
|
</a-table>
|
|
|
<a-pagination
|
|
@@ -83,7 +86,7 @@
|
|
|
<script>
|
|
|
import {mapGetters} from 'vuex';
|
|
|
import {fileInsertV2} from '@/api/actor';
|
|
|
-import {getAction, postAction, putAction, deleteAction} from '@/api/manage';
|
|
|
+import {getAction, postAction} from '@/api/manage';
|
|
|
|
|
|
import BMF from 'browser-md5-file';
|
|
|
let COS = require('cos-js-sdk-v5');
|
|
@@ -91,6 +94,7 @@ let cos = new COS({
|
|
|
SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
|
|
|
SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9'
|
|
|
});
|
|
|
+
|
|
|
export default {
|
|
|
name: 'change-face',
|
|
|
props: {
|
|
@@ -105,6 +109,10 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ departValueInfoModality: [],
|
|
|
+ departValueInfoMod: [],
|
|
|
+ departValueInfoSence: [],
|
|
|
+ getProjectId: '',
|
|
|
defaultCurrent: 1,
|
|
|
dataAllList: [],
|
|
|
totalAll: 100,
|
|
@@ -155,7 +163,6 @@ export default {
|
|
|
},
|
|
|
defaultList(newVal) {
|
|
|
if (newVal) {
|
|
|
- console.log(newVal, 'newVal--newVal');
|
|
|
this.faceShowList = newVal;
|
|
|
}
|
|
|
}
|
|
@@ -164,7 +171,6 @@ export default {
|
|
|
...mapGetters(['userInfo']),
|
|
|
// 分页操作按钮
|
|
|
onShowSizeChange(current, pageSize) {
|
|
|
- console.log(this.dataAllList, current, '-------00000');
|
|
|
this.defaultCurrent = current;
|
|
|
const defaultData = [...this.dataAllList];
|
|
|
this.dataSource = [...defaultData.slice(2 * current - 2, 2 * current)];
|
|
@@ -172,13 +178,15 @@ export default {
|
|
|
handleFaceTypeChange(e) {
|
|
|
if (e.target.value === 'b') {
|
|
|
this.handleInitTable();
|
|
|
+ this.handleGetDetailList();
|
|
|
+ this.handleGetMaterialTagInfo();
|
|
|
}
|
|
|
},
|
|
|
handleInitTable() {
|
|
|
const paramsData = {
|
|
|
videoMd5: this.faceShowList.videoCode
|
|
|
};
|
|
|
- postAction('http://192.168.1.34:8000/jeecg-boot/task/query', paramsData).then(result => {
|
|
|
+ postAction('/task/query', paramsData).then(result => {
|
|
|
if (result.code === 0) {
|
|
|
this.dataAllList = result.data;
|
|
|
this.dataSource = result.data.slice(0, 2);
|
|
@@ -191,10 +199,38 @@ export default {
|
|
|
console.log(error, 'eeee');
|
|
|
});
|
|
|
},
|
|
|
- // 推送操作
|
|
|
+ handleGetDetailList() {
|
|
|
+ getAction('/ctop/materialInfo/queryById', {
|
|
|
+ id: this.faceShowList.videoCode
|
|
|
+ }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.getProjectId = res.result.projectId;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleGetMaterialTagInfo() {
|
|
|
+ getAction('/ctop/materialTagInfo/detail', {
|
|
|
+ code: this.faceShowList.videoCode
|
|
|
+ }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.departValueInfoModality = res.modalityTagList.map(item => item.tagId);
|
|
|
+ this.departValueInfoMod = res.modTagList.map(item => item.tagId);
|
|
|
+ this.departValueInfoSence = res.senceTagList.map(item => item.tagId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // TODO 推送操作
|
|
|
handlePushData(list) {
|
|
|
console.log(list, '推送操作');
|
|
|
- const paramsData = {};
|
|
|
+ const paramsData = {
|
|
|
+ projectId: this.getProjectId, // 项目选择
|
|
|
+ planId: 'admin',
|
|
|
+ shotId: 'admin',
|
|
|
+ clipId: 'admin',
|
|
|
+ modalityTagList: this.departValueInfoModality, // 形式标签
|
|
|
+ senceTagList: this.departValueInfoSence, // 场景标签
|
|
|
+ modTagList: this.departValueInfoMod // 基调标签
|
|
|
+ };
|
|
|
fileInsertV2(paramsData).then(res => {
|
|
|
if (res.success) {
|
|
|
console.log(res, 'res---res推送');
|
|
@@ -203,7 +239,7 @@ export default {
|
|
|
},
|
|
|
// 下载操作
|
|
|
handleDownLoadData(list) {
|
|
|
- const randomTime = new Time().getTime() + '_check.mp4';
|
|
|
+ const randomTime = new Date().getTime() + '_check.mp4';
|
|
|
fetch(list.input_video_url)
|
|
|
.then(res => res.blob())
|
|
|
.then(blob => {
|
|
@@ -228,22 +264,22 @@ export default {
|
|
|
},
|
|
|
// 确定按钮
|
|
|
handlePolicyOperationSure() {
|
|
|
- console.log(this.urlResult, this.md5Result, '确定按钮');
|
|
|
if (this.faceType === 'a') {
|
|
|
if (!this.md5Result) {
|
|
|
this.$message.error('请上传图片');
|
|
|
return;
|
|
|
}
|
|
|
const paramsData = {
|
|
|
- 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.faceShowList.url,
|
|
|
+ // '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',
|
|
|
inputImageUrl: this.urlResult,
|
|
|
videoMd5: this.faceShowList.videoCode,
|
|
|
imageMd5: this.md5Result,
|
|
|
createBy: this.userInfo().id
|
|
|
};
|
|
|
- postAction('http://192.168.1.34:8000/jeecg-boot/task/single', paramsData).then(result => {
|
|
|
- console.log(result, 'v--确定按钮');
|
|
|
+ postAction('/task/single', paramsData).then(result => {
|
|
|
if (result.code === 0) {
|
|
|
+ this.handlePolicyOperationCancel();
|
|
|
this.$emit('sureface');
|
|
|
}
|
|
|
else {
|
|
@@ -272,7 +308,6 @@ export default {
|
|
|
},
|
|
|
beforeUpload(info) {
|
|
|
const isZip = info.type.includes('png') || info.type.includes('jpeg');
|
|
|
- // const fileOvesize = info.size > (1024 * 1024);
|
|
|
if (!isZip) {
|
|
|
this.$message.error('请上传正确类型的图片');
|
|
|
this.imageUrl = '';
|
|
@@ -285,35 +320,6 @@ export default {
|
|
|
this.getBase64(info, imageUrl => {
|
|
|
this.imageUrl = imageUrl;
|
|
|
});
|
|
|
- // if (fileOvesize) {
|
|
|
- // this.$message.error('图片大小不能超过1M');
|
|
|
- // this.imageUrl = '';
|
|
|
- // this.urlResult = '';
|
|
|
- // this.md5Result = '';
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // new Promise(function (resolve, reject) {
|
|
|
- // let width = 108;
|
|
|
- // let height = 108;
|
|
|
- // let _URL = window.URL || window.webkitURL;
|
|
|
- // let img = new Image();
|
|
|
- // img.onload = function () {
|
|
|
- // let valid = img.width === width && img.height === height;
|
|
|
- // valid ? resolve() : reject();
|
|
|
- // };
|
|
|
- // img.src = _URL.createObjectURL(info);
|
|
|
- // }).then(() => {
|
|
|
- // this.handleMd5(info);
|
|
|
- // this.getBase64(info, imageUrl => {
|
|
|
- // this.imageUrl = imageUrl;
|
|
|
- // });
|
|
|
- // }, () => {
|
|
|
- // this.$message.error('图片尺寸必须是108*108!');
|
|
|
- // this.imageUrl = '';
|
|
|
- // this.urlResult = '';
|
|
|
- // this.md5Result = '';
|
|
|
- // return Promise.reject();
|
|
|
- // });
|
|
|
},
|
|
|
handleMd5(file) {
|
|
|
let bmf = new BMF();
|
|
@@ -365,7 +371,7 @@ export default {
|
|
|
that.urlResult = 'http://' + data.Location;
|
|
|
}
|
|
|
);
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|