Jelajahi Sumber

新增视频优化建议功能

lushixing 2 minggu lalu
induk
melakukan
b3782878af

+ 16 - 0
src/api/video.js

@@ -14,3 +14,19 @@ export function deleteOralVideoList(data) {
     data
   })
 }
+
+export function addSuggestion(data) {
+  return request({
+    url: '/videoOperation/add',
+    method: 'post',
+    data
+  })
+}
+
+export function fetchSuggestionList(params) {
+  return request({
+    url: '/videoOperation/page',
+    method: 'get',
+    params
+  })
+}

+ 23 - 13
src/views/catwalk-video/component/editSuggestion.vue → src/components/Suggestion/editSuggestion.vue

@@ -1,7 +1,7 @@
 <template>
   <el-dialog :title="'优化建议 - ' + rows.videoTitle" width="540px" :visible.sync="dialogVisible">
     <el-form :model="form" :rules="rules" ref="suggestionForm" >
-      <el-form-item>
+      <el-form-item prop="suggestion">
         <el-input type="textarea" :autosize="{ minRows: 6, maxRows: 10 }" placeholder="请输入内容" v-model="form.suggestion">
         </el-input>
       </el-form-item>
@@ -15,19 +15,15 @@
 </template>
 
 <script>
-import { editSuggestion } from "@/api/video";
+import { addSuggestion } from "@/api/video";
 export default {
   name: "EditSuggestion",
   props: {
-    rows: {
-      type: Object,
-      required: true
-    }
   },
   data() {
     return {
       form: {
-        suggestion: null
+        suggestion: ''
       },
       dialogVisible: false,
       comfirmLoading: false,
@@ -35,20 +31,35 @@ export default {
         suggestion: [
           { required: true, message: "请输入建议", trigger: "blur" }
         ]
-      }
+      },
+      rows: {}
     };
   },
   methods: {
-    show() {
-      this.dialogVisible = !this.dialogVisible;
+    show(row) {
+      this.dialogVisible = true;
+      this.comfirmLoading = false;
+      this.rows = row;
+      this.form = {
+        suggestion: ''
+      }
+      this.$nextTick(() => {
+        this.$refs.suggestionForm.resetFields()
+      })
     },
     handleConfirm() {
       this.$refs.suggestionForm.validate(valid => {
         if (valid) {
           this.comfirmLoading = true;
-          editSuggestion(this.form).then(res =>{
+          const params = {
+            "remark": this.form.suggestion,
+            "videoId": this.rows.id,
+            "operationType": 1
+          }
+          addSuggestion(params).then(res =>{
+            this.dialogVisible = false;
             if(res.code == 200){
-              this.$message.success("修改成功");
+              this.$message.success(res.msg || "操作成功");
               this.$emit("confirm");
             }
           }).finally(()=>{
@@ -58,7 +69,6 @@ export default {
           return false;
         }
       });
-      this.dialogVisible = false;
     }
   }
 };

+ 14 - 9
src/views/catwalk-video/component/suggestionTable.vue → src/components/Suggestion/suggestionTable.vue

@@ -7,24 +7,23 @@
   <el-table style="width: 100%" v-loading="listLoading" :key="tableKey" :data="list" row-key="id" stripe border fit
   highlight-current-row>
   <el-table-column label="序号" type="index" width="60" align="center" />
-  <el-table-column label="优化建议" min-width="100" align="center" prop="suggestion" />
-  <el-table-column label="建议人" min-width="100" align="center" prop="name" />
+  <el-table-column label="建议内容" min-width="100" align="center" prop="remark" />
+  <el-table-column label="操作人" min-width="100" align="center" prop="creator" />
+  <el-table-column label="创建时间" min-width="100" align="center" prop="createTime" />
   </el-table>
+  <div class="pages-black" style="overflow: hidden;">
     <!-- 分页 -->
     <swPage v-if="total > 0" key="2" :listQuery="listQuery" :total="total" pos="btmRight" @retPage="retPage" />
+  </div>
   </el-dialog>
 </template>
 
 <script>
-import { fetchSuggestionList } from "@/api/catwalkVideo";
+import { fetchSuggestionList } from "@/api/video";
 import swPage from "@/views/common/swPage";
 export default {
   name: "SuggestionTable",
   props: {
-    rows: {
-      type: Object,
-      required: true
-    }
   },
   components: {
     swPage,
@@ -39,12 +38,18 @@ export default {
       listQuery: {
         currentPage: 1,
         pageSize: 10,
+        videoId: '',
+        operationType: 1
       },
+      rows: {}
     };
   },
   methods: {
-    show() {
-      this.dialogVisible = !this.dialogVisible;
+    show(row) {
+      this.dialogVisible = true;
+      this.rows = row;
+      this.listQuery.videoId = row.id;
+      this.getList()
     },
     getList() {
       this.listLoading = true;

+ 0 - 1
src/views/catwalk-video/catwalkVideo.vue

@@ -14,7 +14,6 @@
 
 <script>
 export default {
-  name: 'catwalkVideoIndex',
   data() {
     return {
       iframeUrl: 'https://ai-app.gloria.com.cn/walk_show_cut/',

+ 29 - 11
src/views/catwalk-video/index.vue

@@ -41,7 +41,11 @@
         <el-table-column label="SKU" min-width="100" align="center" prop="sku" />
         <el-table-column label="店铺名称" min-width="100" align="center" prop="storeName" />
         <el-table-column label="创建时间" min-width="100" align="center" prop="createTime" />
-        <el-table-column label="下载次数" min-width="100" align="center" prop="downloadCount" />
+        <el-table-column label="下载次数" min-width="100" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.downlaodCount ? scope.row.downlaodCount : '-' }}
+          </template>
+        </el-table-column>
         <!-- <el-table-column label="优化建议" min-width="100" align="center" prop="createTime">
           <template slot-scope="scope">
             <p v-if="roles.includes('superAdmin')">
@@ -77,6 +81,15 @@
               <el-button type="danger" size="mini" icon="el-icon-delete-solid" circle
                 @click="handleDelete(scope.row)" />
             </el-tooltip>
+            <el-tooltip class="more" style="margin: 10px 0 0 0;" effect="dark" content="更多操作" placement="top">
+              <el-dropdown trigger="click" @command="command => handleAdvise(command, scope.row)">
+                <el-button size="mini" type="primary" icon="el-icon-more" circle title="更多操作" />
+                <el-dropdown-menu class="dropdown-menu" slot="dropdown">
+                  <el-dropdown-item command="addAdvise">优化建议</el-dropdown-item>
+                  <el-dropdown-item command="editAdvise">查看建议</el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </el-tooltip>
             <!-- <el-tooltip class="more" effect="dark" content="更多" placement="top">
               <el-dropdown trigger="click" @command="command => handleMore(command, scope.row)">
                 <el-button size="mini" type="primary" icon="el-icon-more" circle title="更多" />
@@ -97,9 +110,9 @@
     <video-player ref="videoPlayer" :video-url="currentVideoUrl" :video-title="currentVideoTitle"
       @close="handlePlayerClose" />
     <!-- 优化建议 -->
-    <suggestion-table ref="suggestionTable" :rows="currentVideo" />
+    <suggestion-table ref="suggestionTable" />
     <!-- 编辑优化建议 -->
-    <edit-suggestion ref="editSuggestion" :rows="currentVideo" @confirm="handleCofirmSuggestion" />
+    <edit-suggestion ref="editSuggestion" @confirm="handleCofirmSuggestion" />
   </div>
 </template>
 
@@ -109,8 +122,8 @@ import swPage from "@/views/common/swPage";
 import { auditStatus } from "@/constants/index";
 import { getValueByKey } from "@/utils/index";
 // import ExcelImport from "@/components/ExcelImport";
-import EditSuggestion from "./component/editSuggestion";
-import SuggestionTable from "./component/suggestionTable";
+import EditSuggestion from "@/components/Suggestion/editSuggestion";
+import SuggestionTable from "@/components/Suggestion/suggestionTable";
 
 import { fetchOralVideoList, deleteOralVideoList } from "@/api/video";
 import downloadUtil from "@/utils/downloadUtil";
@@ -152,8 +165,7 @@ export default {
         // sku: null,
       },
       currentVideoUrl: null,
-      currentVideoTitle: null,
-      currentVideo: {},
+      currentVideoTitle: null
     };
   },
   //页面创建的时候执行
@@ -230,6 +242,14 @@ export default {
         });
       });
     },
+    handleAdvise(command, row) {
+      if (command == 'addAdvise') {
+        this.handleEditSuggestions(row)
+      }
+      if (command == 'editAdvise') {
+        this.handleViewSuggestions(row)
+      }
+    },
     //更多
     handleMore(command, row) {
       if (command === "delete") {
@@ -239,12 +259,10 @@ export default {
       }
     },
     handleViewSuggestions(row) {
-      this.currentVideo = row
-      this.$refs.suggestionTable.show();
+      this.$refs.suggestionTable.show(row);
     },
     handleEditSuggestions(row) {
-      this.currentVideo = row
-      this.$refs.editSuggestion.show();
+      this.$refs.editSuggestion.show(row);
     },
     handleCofirmSuggestion() {
       this.retPage()

+ 0 - 67
src/views/face-swap-video/component/editSuggestion.vue

@@ -1,67 +0,0 @@
-<template>
-  <el-dialog :title="'优化建议 - ' + rows.videoTitle" width="540px" :visible.sync="dialogVisible">
-    <el-form :model="form" :rules="rules" ref="suggestionForm" >
-      <el-form-item>
-        <el-input type="textarea" :autosize="{ minRows: 6, maxRows: 10 }" placeholder="请输入内容" v-model="form.suggestion">
-        </el-input>
-      </el-form-item>
-    </el-form>
-
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="dialogVisible = false">取消</el-button>
-      <el-button type="primary" :loading="comfirmLoading" @click="handleConfirm">确定</el-button>
-    </span>
-  </el-dialog>
-</template>
-
-<script>
-import { editSuggestion } from "@/api/video";
-export default {
-  name: "EditSuggestion",
-  props: {
-    rows: {
-      type: Object,
-      required: true
-    }
-  },
-  data() {
-    return {
-      form: {
-        suggestion: null
-      },
-      dialogVisible: false,
-      comfirmLoading: false,
-      rules: {
-        suggestion: [
-          { required: true, message: "请输入建议", trigger: "blur" }
-        ]
-      }
-    };
-  },
-  methods: {
-    show() {
-      this.dialogVisible = !this.dialogVisible;
-    },
-    handleConfirm() {
-      this.$refs.suggestionForm.validate(valid => {
-        if (valid) {
-          this.comfirmLoading = true;
-          editSuggestion(this.form).then(res =>{
-            if(res.code == 200){
-              this.$message.success("修改成功");
-              this.$emit("confirm");
-            }
-          }).finally(()=>{
-            this.comfirmLoading = false;
-          })
-        } else {
-          return false;
-        }
-      });
-      this.dialogVisible = false;
-    }
-  }
-};
-</script>
-
-

+ 0 - 71
src/views/face-swap-video/component/suggestionTable.vue

@@ -1,71 +0,0 @@
-<template>
-  <el-dialog
-    title="查看优化建议"
-    width="700px"
-    :visible.sync="dialogVisible"
-  >
-  <el-table style="width: 100%" v-loading="listLoading" :key="tableKey" :data="list" row-key="id" stripe border fit
-  highlight-current-row>
-  <el-table-column label="序号" type="index" width="60" align="center" />
-  <el-table-column label="优化建议" min-width="100" align="center" prop="suggestion" />
-  <el-table-column label="建议人" min-width="100" align="center" prop="name" />
-  </el-table>
-    <!-- 分页 -->
-    <swPage v-if="total > 0" key="2" :listQuery="listQuery" :total="total" pos="btmRight" @retPage="retPage" />
-  </el-dialog>
-</template>
-
-<script>
-import { fetchSuggestionList } from "@/api/catwalkVideo";
-import swPage from "@/views/common/swPage";
-export default {
-  name: "SuggestionTable",
-  props: {
-    rows: {
-      type: Object,
-      required: true
-    }
-  },
-  components: {
-    swPage,
-  },
-  data() {
-    return {
-      dialogVisible: false,
-      listLoading: false,
-      tableKey: 0,
-      list: [],
-      total:0,
-      listQuery: {
-        currentPage: 1,
-        pageSize: 10,
-      },
-    };
-  },
-  methods: {
-    show() {
-      this.dialogVisible = !this.dialogVisible;
-    },
-    getList() {
-      this.listLoading = true;
-      fetchSuggestionList(this.listQuery).then(res => {
-        if (200 == res.code) {
-          this.total = res.data.total;
-          this.list = res.data.rows;
-        }
-        this.listLoading = false;
-      });
-    },
-    retPage() {
-      //分页
-      this.getList();
-    },
-  }
-};
-</script>
-
-<style scoped>
-.el-select {
-  width: 100%;
-}
-</style>

+ 0 - 1
src/views/face-swap-video/faceSwapVideo.vue

@@ -14,7 +14,6 @@
 
 <script>
 export default {
-  name: 'catwalkVideoIndex',
   data() {
     return {
       iframeUrl: 'https://ai-app.gloria.com.cn/change-face/',

+ 28 - 9
src/views/face-swap-video/index.vue

@@ -69,7 +69,11 @@
         </el-table-column>
         <!-- <el-table-column label="操作人" min-width="100" align="center" prop="creator" /> -->
         <el-table-column label="创建时间" min-width="100" align="center" prop="createTime" />
-        <el-table-column label="下载次数" min-width="100" align="center" prop="downlaodCount" />
+        <el-table-column label="下载次数" min-width="100" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.downlaodCount ? scope.row.downlaodCount : '-' }}
+          </template>
+        </el-table-column>
         <!-- <el-table-column label="优化建议" min-width="100" align="center" prop="remark">
           <template slot-scope="scope">
             <p v-if="roles.includes('superAdmin')">
@@ -106,6 +110,15 @@
               <el-button type="danger" size="mini" icon="el-icon-delete-solid" circle
                 @click="handleDelete(scope.row)" />
             </el-tooltip>
+            <el-tooltip class="more" style="margin: 10px 0 0 0;" effect="dark" content="更多操作" placement="top">
+              <el-dropdown trigger="click" @command="command => handleAdvise(command, scope.row)">
+                <el-button size="mini" type="primary" icon="el-icon-more" circle title="更多操作" />
+                <el-dropdown-menu class="dropdown-menu" slot="dropdown">
+                  <el-dropdown-item command="addAdvise">优化建议</el-dropdown-item>
+                  <el-dropdown-item command="editAdvise">查看建议</el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </el-tooltip>
             <!-- <el-tooltip class="more" effect="dark" content="更多" placement="top">
               <el-dropdown trigger="click" @command="command => handleMore(command, scope.row)">
                 <el-button size="mini" type="primary" icon="el-icon-more" circle title="更多" />
@@ -126,9 +139,9 @@
     <video-player ref="videoPlayer" :video-url="currentVideoUrl" :video-title="currentVideoTitle"
       @close="handlePlayerClose" />
     <!-- 优化建议 -->
-    <suggestion-table ref="suggestionTable" :rows="currentVideo" />
+    <suggestion-table ref="suggestionTable" />
     <!-- 编辑优化建议 -->
-    <edit-suggestion ref="editSuggestion" :rows="currentVideo" @confirm="handleCofirmSuggestion" />
+    <edit-suggestion ref="editSuggestion" />
     <el-image ref="elImage" style="width: 0; height: 0;" :src="imageUrl" :preview-src-list="[imageUrl]">
     </el-image>
   </div>
@@ -140,8 +153,8 @@ import swPage from "@/views/common/swPage";
 import { auditStatus } from "@/constants/index";
 import { getValueByKey } from "@/utils/index";
 // import ExcelImport from "@/components/ExcelImport";
-import EditSuggestion from "./component/editSuggestion";
-import SuggestionTable from "./component/suggestionTable";
+import EditSuggestion from "@/components/Suggestion/editSuggestion";
+import SuggestionTable from "@/components/Suggestion/suggestionTable";
 
 import { fetchOralVideoList, deleteOralVideoList } from "@/api/video";
 import downloadUtil from "@/utils/downloadUtil";
@@ -296,13 +309,19 @@ export default {
         this.changeTopic(row); // 修改话题
       }
     },
+    handleAdvise(command, row) {
+      if (command == 'addAdvise') {
+        this.handleEditSuggestions(row)
+      }
+      if (command == 'editAdvise') {
+        this.handleViewSuggestions(row)
+      }
+    },
     handleViewSuggestions(row) {
-      this.currentVideo = row;
-      this.$refs.suggestionTable.show();
+      this.$refs.suggestionTable.show(row);
     },
     handleEditSuggestions(row) {
-      this.currentVideo = row;
-      this.$refs.editSuggestion.show();
+      this.$refs.editSuggestion.show(row);
     },
     handleCofirmSuggestion() {
       this.retPage();

+ 1 - 1
src/views/login/index.vue

@@ -157,7 +157,7 @@ export default {
         this.passwordType = "password";
       }
       this.$nextTick(() => {
-        this.$refs.password.focus();
+        this.$refs.password && this.$refs.password.focus();
       });
     },
     handleLogin() {

+ 38 - 2
src/views/oral-video/index.vue

@@ -84,6 +84,11 @@
         <el-table-column label="操作人" min-width="100" align="center" prop="creator" />
 
         <el-table-column label="创建时间" min-width="100" align="center" prop="createTime" />
+        <el-table-column label="下载次数" min-width="100" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.downlaodCount ? scope.row.downlaodCount : '-' }}
+          </template>
+        </el-table-column>
         <el-table-column label="操作" align="center" min-width="160"
           v-bind="device !== 'mobile' ? { fixed: 'right' } : {}">
           <template slot-scope="scope">
@@ -110,6 +115,15 @@
                 @click="handleDelete(scope.row)"
               />
             </el-tooltip>
+            <el-tooltip class="more" style="margin: 10px 0 0 0;" effect="dark" content="更多操作" placement="top">
+              <el-dropdown trigger="click" @command="command => handleAdvise(command, scope.row)">
+                <el-button size="mini" type="primary" icon="el-icon-more" circle title="更多操作" />
+                <el-dropdown-menu class="dropdown-menu" slot="dropdown">
+                  <el-dropdown-item command="addAdvise">优化建议</el-dropdown-item>
+                  <el-dropdown-item command="editAdvise">查看建议</el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </el-tooltip>
             <!-- <el-tooltip class="more" effect="dark" content="更多操作" placement="top">
               <el-dropdown trigger="click" @command="command => handleMore(command, scope.row)">
                 <el-button size="mini" type="primary" icon="el-icon-more" circle title="更多操作" />
@@ -130,7 +144,11 @@
     <video-player ref="videoPlayer" :video-url="currentVideoUrl" :video-title="currentVideoTitle"
       @close="handlePlayerClose" />
     <!-- 修改话题-->
-     <change-topic ref="changeTopicRef" :rows="currentVideo" @confirm="handleTopicChange" />
+    <change-topic ref="changeTopicRef" :rows="currentVideo" @confirm="handleTopicChange" />
+    <!-- 优化建议 -->
+    <suggestion-table ref="suggestionTable" />
+    <!-- 编辑优化建议 -->
+    <edit-suggestion ref="editSuggestion" />
   </div>
 </template>
 
@@ -141,6 +159,8 @@ import { auditStatus } from "@/constants/index";
 import { getValueByKey } from "@/utils/index";
 import ExcelImport from "@/components/ExcelImport";
 import changeTopic from "@/views/oral-video/component/changeTopic";
+import EditSuggestion from "@/components/Suggestion/editSuggestion";
+import SuggestionTable from "@/components/Suggestion/suggestionTable";
 
 import { fetchOralVideoList, deleteOralVideoList } from "@/api/video";
 import downloadUtil from "@/utils/downloadUtil";
@@ -157,7 +177,9 @@ export default {
     swPage,
     VideoPlayer,
     ExcelImport,
-    changeTopic
+    changeTopic,
+    EditSuggestion,
+    SuggestionTable
   },
   computed: {
     ...mapGetters(["device"]) // 从 vuex 中获取设备类型
@@ -265,6 +287,20 @@ export default {
       console.log("原始文件:", file);
       // 处理导入的数据
     },
+    handleAdvise(command, row) {
+      if (command == 'addAdvise') {
+        this.handleEditSuggestions(row)
+      }
+      if (command == 'editAdvise') {
+        this.handleViewSuggestions(row)
+      }
+    },
+    handleViewSuggestions(row) {
+      this.$refs.suggestionTable.show(row);
+    },
+    handleEditSuggestions(row) {
+      this.$refs.editSuggestion.show(row);
+    },
     //更多
     handleMore(command, row) {
       if (command === "delete") {

+ 2 - 2
vue.config.js

@@ -34,8 +34,8 @@ module.exports = {
       //   }
       // },
       "/app": {
-        // target: "http://10.41.3.106:9093",
-        target: "https://portal.gloria.com.cn",
+        target: process.env.NODE_ENV == 'development' ? "http://10.41.3.106:9093" : 'https://portal.gloria.com.cn',
+        // target: "https://portal.gloria.com.cn",
         changeOrigin: true
       }
     }