Browse Source

前台-单个取消收藏参数修改

chaihaorui 1 year ago
parent
commit
25fb61f1f8

+ 2 - 2
src/pages/homepage/components/entityDetail.vue

@@ -171,12 +171,12 @@ export default {
171 171
         id: this.id
172 172
       }).then(res => {
173 173
         this.basicData = res.data
174
+        this.getMessageTableData()
174 175
       })
175
-      this.getMessageTableData()
176 176
     },
177 177
     getMessageTableData() {
178 178
       api.getMqsPrivs({
179
-        mqsName: this.id,
179
+        mqsName: this.basicData.name,
180 180
         pageNum: this.pageNum,
181 181
         pageSize: this.pageSize
182 182
       }).then(res => {

+ 10 - 3
src/pages/homepage/components/searchPage.vue

@@ -13,8 +13,8 @@
13 13
         <div class="flex">
14 14
           <div class="tree-wrap">
15 15
             <el-button-group v-if="activeName === 'fourth'">
16
-              <el-button :type="serviceType === 'API' ? 'primary' : ''" @click="serviceBtnClick('API')" size="small">API服务</el-button>
17
-              <el-button :type="serviceType === 'MQ' ? 'primary' : ''" @click="serviceBtnClick('MQ')" size="small">消息队列</el-button>
16
+              <el-button :type="serviceType === 'API' ? 'primary' : ''" @click="() => serviceBtnClick('API')" size="small">API服务</el-button>
17
+              <el-button :type="serviceType === 'MQ' ? 'primary' : ''" @click="() => serviceBtnClick('MQ')" size="small">消息队列</el-button>
18 18
             </el-button-group>
19 19
             <div>{{item.name}}</div>
20 20
             <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
@@ -246,7 +246,13 @@ export default {
246 246
       this.cancelCollect([id])
247 247
     },
248 248
     cancelCollect(ids) {
249
-      const params = {resourceType: resourceTypeMap[this.activeName], resourceIds: ids,}
249
+      const resourceTypeMapB = {
250
+        first: 'theme',
251
+        second: 'specialSubject',
252
+        third: 'index',
253
+        fourth: this.serviceType === 'API' ? 'api' : 'mqs'
254
+      }
255
+      const params = {resourceType: resourceTypeMapB[this.activeName], resourceIds: ids,}
250 256
       api.deleteCollect(params).then(res => {
251 257
         if (res.success) {
252 258
           this.$message({
@@ -366,6 +372,7 @@ export default {
366 372
               this.list.push(newItem)
367 373
             })
368 374
           }
375
+          // console.log('this.list', this.list)
369 376
         })
370 377
       } else {
371 378
         api.searchData(params).then(res => {