Bläddra i källkod

fix: #修正bug

loki 3 år sedan
förälder
incheckning
161486dbc8

+ 2 - 2
src/api/base/trend.js

@@ -2,8 +2,8 @@ import api from '@/utils/request';
 
 
 export const getList = params =>
 export const getList = params =>
 	api.post(`/yxl-back-end/admin/top-search-keywords/page`, params);
 	api.post(`/yxl-back-end/admin/top-search-keywords/page`, params);
-export const getItem = ({ id, ...params }) =>
-	api.get(`/yxl-back-end/admin/top-search-keywords/${id}`, params);
+// export const getItem = ({ id, ...params }) =>
+// api.get(`/yxl-back-end/admin/top-search-keywords/${id}`, params);
 export const saveItem = params => {
 export const saveItem = params => {
 	if (params.id) {
 	if (params.id) {
 		return api.post(`/yxl-back-end/admin/top-search-keywords/update`, params);
 		return api.post(`/yxl-back-end/admin/top-search-keywords/update`, params);

+ 3 - 3
src/components/Upload.vue

@@ -10,7 +10,7 @@
       :file-list="imgList"
       :file-list="imgList"
       :on-success="handleAvatarSuccess"
       :on-success="handleAvatarSuccess"
       :disabled="limit <= value.length"
       :disabled="limit <= value.length"
-      >{{ newUrl }}
+    >
       <i slot="default" class="el-icon-plus" />
       <i slot="default" class="el-icon-plus" />
       <div slot="file" slot-scope="{ file }">
       <div slot="file" slot-scope="{ file }">
         <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
         <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
@@ -63,7 +63,7 @@ export default {
       type: String,
       type: String,
       default: ''
       default: ''
     },
     },
-    url: {
+    uploadUrl: {
       type: String,
       type: String,
       default: ''
       default: ''
     }
     }
@@ -86,7 +86,7 @@ export default {
   computed: {
   computed: {
     newUrl() {
     newUrl() {
       const params = this.params;
       const params = this.params;
-      const url = this.url;
+      const url = this.uploadUrl;
       let baseUrl = UPLOAD_URL;
       let baseUrl = UPLOAD_URL;
       if (url !== '') {
       if (url !== '') {
         baseUrl = url;
         baseUrl = url;

+ 1 - 1
src/views/baseManagement/problemFeedbackManagement/index.vue

@@ -24,7 +24,7 @@ export default {
 
 
   mixins: [
   mixins: [
     mxFilterList({
     mxFilterList({
-      // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getList // 在下方data再声明一个 fetchList: iGetList 同等效果
     })
     })
   ],
   ],
 
 

+ 6 - 1
src/views/baseManagement/trending/index.vue

@@ -75,7 +75,12 @@ export default {
                   on: {
                   on: {
                     click: () =>
                     click: () =>
                       this.$TrendItemModal({
                       this.$TrendItemModal({
-                        id: row.id
+                        id: row.id,
+                        info: {
+                          name: row.name,
+                          sort: row.sort,
+                          isShow: row.isShow
+                        }
                       })
                       })
                   }
                   }
                 },
                 },

+ 28 - 13
src/views/baseManagement/trending/modal/ItemModal.vue

@@ -38,7 +38,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getItem, saveItem } from '@/api/base/trend';
+import { saveItem } from '@/api/base/trend';
 
 
 export default {
 export default {
   name: 'TrendingItemModal',
   name: 'TrendingItemModal',
@@ -47,6 +47,14 @@ export default {
     id: {
     id: {
       type: String,
       type: String,
       default: ''
       default: ''
+    },
+    info: {
+      type: Object,
+      default: () => ({
+        name: '',
+        isShow: false,
+        sort: 1
+      })
     }
     }
   },
   },
 
 
@@ -78,25 +86,32 @@ export default {
   },
   },
 
 
   watch: {
   watch: {
-    id: {
-      handler(id) {
-        id && this.loadData();
+    // id: {
+    //   handler(id) {
+    //     id && this.loadData();
+    //   },
+    //   immediate: true
+    // },
+    info: {
+      handler(obj) {
+        this.form = obj;
       },
       },
-      immediate: true
+      immediate: true,
+      deep: true
     }
     }
   },
   },
 
 
   mounted() {},
   mounted() {},
 
 
   methods: {
   methods: {
-    async loadData() {
-      const { success, data, msg } = await getItem({
-        id: this.id
-      });
-      if (success) {
-        this.form = data;
-      }
-    },
+    // async loadData() {
+    //   const { success, data, msg } = await getItem({
+    //     id: this.id
+    //   });
+    //   if (success) {
+    //     this.form = data;
+    //   }
+    // },
 
 
     handleConfirm() {
     handleConfirm() {
       this.$refs.form.validate(async valid => {
       this.$refs.form.validate(async valid => {

+ 2 - 1
src/views/sceneManagement/sceneVerify/modal/ItemModal.vue

@@ -196,7 +196,8 @@ export default {
             auditStatus: this.form.auditStatus,
             auditStatus: this.form.auditStatus,
             auditMsg: this.form.auditMsg
             auditMsg: this.form.auditMsg
           };
           };
-          if (this.id) params.id = this.id;
+          console.log(params);
+          if (this.id) params.id = this.form.infoId;
           const { success, msg } = await auditItem(params);
           const { success, msg } = await auditItem(params);
           if (success) {
           if (success) {
             this.$success('保存成功!');
             this.$success('保存成功!');