Browse Source

naster 换脸功能 增加全部列表

jiayufei 3 năm trước cách đây
mục cha
commit
432caa9559

+ 3 - 0
src/views/modules/Statistics/change-face/change-face.less

@@ -50,4 +50,7 @@
             }
         }
     }
+}
+.change-list-modal-show {
+    width: 1000px !important;
 }

+ 6 - 3
src/views/modules/Statistics/change-face/change-face.vue

@@ -187,15 +187,18 @@ export default {
             const paramsData = {
                 videoMd5: this.faceShowList.projectId ? this.faceShowList.code : this.faceShowList.videoCode
             };
-            // http://192.168.1.34:8000
+            // http://192.168.1.204:8000
             // http://faceswap.tjyourong.com.cn
-            postAction('http://faceswap.tjyourong.com.cn/jeecg-boot/task/query', paramsData).then(result => {
+            postAction('http://192.168.1.204:8000/jeecg-boot/task/query', paramsData).then(result => {
                 if (result.code === 0) {
                     this.dataAllList = result.data;
                     this.dataSource = result.data.slice(0, 2);
                     this.totalAll = result.data.length ? result.data.length : 0;
                 }
                 else {
+                    this.dataAllList = [];
+                    this.dataSource = [];
+                    this.totalAll = 0;
                     this.$message.error(result.message);
                 }
             }).catch(error => {
@@ -309,7 +312,7 @@ export default {
                     imageMd5: this.md5Result,
                     createBy: this.userInfo().id
                 };
-                postAction('http://faceswap.tjyourong.com.cn/jeecg-boot/task/single', paramsData).then(result => {
+                postAction('http://192.168.1.204:8000/jeecg-boot/task/single', paramsData).then(result => {
                     if (result.code === 0) {
                         this.handlePolicyOperationCancel();
                         this.$emit('sureface');

+ 132 - 1
src/views/modules/material/videoMaterial.vue

@@ -515,6 +515,14 @@ a {
         @click="tongbu('4')"
         >一键同步快手内广</a-button
       >
+      <a-button
+        v-if="active === '1'"
+        type="primary"
+        @click="handleAllChangeFace"
+      >
+        换脸列表
+      </a-button
+      >
     </div>
 
     <a-tabs @change="callbackTwo" v-model="active" type="card" id="material-card">
@@ -1743,6 +1751,50 @@ a {
 			@sureface="handleFaceSureModal"
 		>
 		</change-face>
+    <a-modal
+        v-if="faceShowStatus"
+        title="换脸操作"
+        :visible="faceShowStatus"
+        dialog-class="change-face-modal change-list-modal-show"
+        @ok="handlePolicyOperationSure"
+        @cancel="handlePolicyOperationCancel"
+    >
+      <a-table
+        class="face-right-table"
+        ref="table"
+        size="middle"
+        bordered
+        :columns="settlementColumns"
+        :dataSource="dataSource"
+        :pagination="false"
+      >
+          <span slot="input_video_url" slot-scope="text, record">
+              <video :src="record.input_video_url" style="width:100px" controls></video>
+          </span>
+          <span slot="output_video_url" slot-scope="text, record">
+              <video :src="record.output_video_url" style="width:100px" controls></video>
+          </span>
+          <span slot="input_image_url" slot-scope="text, record">
+              <img v-if="text" :src="text" style="width:100px">
+              <img v-if="!text" src="@/assets/noImg.png" style="width:60px">
+          </span>
+          <span slot="actions" slot-scope="text, record">
+              <a :disabled="record.status !== 'finished'" @click="handlePushData(record)">推送</a>
+              <a-divider type="vertical"/>
+              <a @click="handleDownLoadData(record)" :disabled="record.status !== 'finished'">下载</a>
+          </span>
+      </a-table>
+      <a-pagination
+          class="pagin-table-class"
+          :total="totalAll"
+          :show-total="total => `共 ${totalAll} 条`"
+          size="small"
+          :current="defaultCurrent"
+          :defaultPageSize="2"
+          @change="onShowSizeChange"
+          @showSizeChange="onShowSizeChange"
+      />
+    </a-modal>
   </a-card>
 </template>
 
@@ -1782,6 +1834,50 @@ export default {
 
   data() {
     return {
+      defaultCurrent: 1,
+      settlementColumns: [
+          {
+              title: '原视频',
+              dataIndex: 'input_video_url',
+              align: 'center',
+              width: 150,
+              scopedSlots: {customRender: 'input_video_url'}
+          },
+          {
+              title: '人脸',
+              dataIndex: 'input_image_url',
+              align: 'center',
+              width: 150,
+              scopedSlots: {customRender: 'input_image_url'}
+          },
+          {
+              title: '更换后视频',
+              dataIndex: 'output_video_url',
+              align: 'center',
+              width: 150,
+              scopedSlots: {customRender: 'output_video_url'}
+          },
+          {
+              title: '状态',
+              align: 'center',
+              dataIndex: 'status',
+              width: 100
+          },
+          {
+              title: '创建时间',
+              align: 'center',
+              dataIndex: 'create_time',
+              width: 160
+          },
+          {
+              title: '操作',
+              align: 'center',
+              dataIndex: 'actions',
+              width: 130,
+              scopedSlots: {customRender: 'actions'}
+          }
+      ],
+      faceShowStatus: false,
       faceTypeStatus: false,
       faceChangeList: {},
       designList: [],
@@ -1959,6 +2055,9 @@ export default {
       videoTag: [],
       videoVisibleChange: '',
       allDetailData: null,
+      dataAllList: [],
+      dataSource: [],
+      totalAll: 0
     }
   },
   filters: {
@@ -2076,8 +2175,40 @@ export default {
     },
   },
   methods: {
+    onShowSizeChange(current, pageSize) {
+        this.defaultCurrent = current;
+        const defaultData = [...this.dataAllList];
+        this.dataSource = [...defaultData.slice(2 * current - 2, 2 * current)];
+    },
+    handlePolicyOperationSure() {
+      this.faceShowStatus = false;
+    },
+    handlePolicyOperationCancel() {
+      this.faceShowStatus = false;
+    },
+    handleAllChangeFace() {
+      this.faceShowStatus = true;
+      postAction('http://192.168.1.204:8000/jeecg-boot/task/query', {}).then(result => {
+            if (result.code === 0) {
+              const defaultData = result.data;
+              defaultData.forEach(item => {
+                item.create_time = item.create_time.replace('T', ' ');
+              });
+              this.dataAllList = defaultData;
+              this.dataSource = defaultData.slice(0, 2);
+              this.totalAll = defaultData.length ? defaultData.length : 0;
+            }
+            else {
+                this.dataAllList = [];
+                this.dataSource = [];
+                this.totalAll = 0;
+                this.$message.error(result.message);
+            }
+        }).catch(error => {
+            console.log(error, 'eeee');
+        });
+    },
     handleChangeFace(data) {
-      console.log(data, '-------------------------')
       this.faceTypeStatus = true;
 			this.faceChangeList = data;
     },