Ver código fonte

feat:编辑和查看优化建议

chenjiaxin 2 dias atrás
pai
commit
9879aa12a7

+ 18 - 0
src/api/catwalkVideo.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+//查看
+export function fetchSuggestionList(params) {
+  return request({
+    url: '/videoInfo/page',
+    method: 'get',
+    params
+  })
+}
+// 编辑优化建议
+export function editSuggestion(data) {
+  return request({
+    url: '/videoInfo/delete',
+    method: 'post',
+    data
+  })
+}

+ 12 - 3
src/views/catwalk-video/component/editSuggestion.vue

@@ -9,12 +9,13 @@
 
     <span slot="footer" class="dialog-footer">
       <el-button @click="dialogVisible = false">取消</el-button>
-      <el-button type="primary" @click="handleConfirm">确定</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: {
@@ -29,7 +30,7 @@ export default {
         suggestion: null
       },
       dialogVisible: false,
-      loading: false,
+      comfirmLoading: false,
       rules: {
         suggestion: [
           { required: true, message: "请输入建议", trigger: "blur" }
@@ -44,7 +45,15 @@ export default {
     handleConfirm() {
       this.$refs.suggestionForm.validate(valid => {
         if (valid) {
-          this.$emit("confirm", this.form);
+          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;
         }

+ 2 - 2
src/views/catwalk-video/component/suggestionTable.vue

@@ -16,7 +16,7 @@
 </template>
 
 <script>
-import { fetchOralVideoList } from "@/api/video";
+import { fetchSuggestionList } from "@/api/catwalkVideo";
 import swPage from "@/views/common/swPage";
 export default {
   name: "SuggestionTable",
@@ -48,7 +48,7 @@ export default {
     },
     getList() {
       this.listLoading = true;
-      fetchOralVideoList(this.listQuery).then(res => {
+      fetchSuggestionList(this.listQuery).then(res => {
         if (200 == res.code) {
           this.total = res.data.total;
           this.list = res.data.rows;