ljw 1 год назад
Родитель
Сommit
5c05a56ed6
4 измененных файлов с 24 добавлено и 0 удалено
  1. 8 0
      src/api/peer.js
  2. 14 0
      src/views/address_book/index.js
  3. 1 0
      src/views/address_book/index.vue
  4. 1 0
      src/views/my/address_book/index.vue

+ 8 - 0
src/api/peer.js

@@ -44,3 +44,11 @@ export function batchRemove (data) {
44
     data,
44
     data,
45
   })
45
   })
46
 }
46
 }
47
+
48
+export function simpleData (data) {
49
+  return request({
50
+    url: '/peer/simpleData',
51
+    method: 'post',
52
+    data,
53
+  })
54
+}

+ 14 - 0
src/views/address_book/index.js

@@ -5,6 +5,7 @@ import { T } from '@/utils/i18n'
5
 import { useRepositories as useCollectionRepositories } from '@/views/address_book/collection'
5
 import { useRepositories as useCollectionRepositories } from '@/views/address_book/collection'
6
 import { useRepositories as useTagRepositories } from '@/views/tag/index'
6
 import { useRepositories as useTagRepositories } from '@/views/tag/index'
7
 import { loadAllUsers } from '@/global'
7
 import { loadAllUsers } from '@/global'
8
+import { simpleData } from '@/api/peer'
8
 
9
 
9
 export function useRepositories (is_my = 0) {
10
 export function useRepositories (is_my = 0) {
10
 
11
 
@@ -42,6 +43,19 @@ export function useRepositories (is_my = 0) {
42
     const res = await list(listQuery).catch(_ => false)
43
     const res = await list(listQuery).catch(_ => false)
43
     listRes.loading = false
44
     listRes.loading = false
44
     if (res) {
45
     if (res) {
46
+      const ids = res.data.list.map(item => item.id)
47
+      if (ids.length) {
48
+        const peer_data = await simpleData({ ids }).catch(_ => false)
49
+        if (peer_data) {
50
+          res.data.list.forEach(item => {
51
+            const peer = peer_data.data.list.find(peer => peer.id === item.id)
52
+            if (peer) {
53
+              item.peer = peer
54
+            }
55
+          })
56
+        }
57
+      }
58
+
45
       listRes.list = res.data.list
59
       listRes.list = res.data.list
46
       listRes.total = res.data.total
60
       listRes.total = res.data.total
47
     }
61
     }

+ 1 - 0
src/views/address_book/index.vue

@@ -64,6 +64,7 @@
64
         <!--        <el-table-column prop="created_at" label="创建时间" align="center"/>-->
64
         <!--        <el-table-column prop="created_at" label="创建时间" align="center"/>-->
65
         <!--        <el-table-column prop="updated_at" label="更新时间" align="center"/>-->
65
         <!--        <el-table-column prop="updated_at" label="更新时间" align="center"/>-->
66
         <el-table-column prop="alias" :label="T('Alias')" align="center" width="150"/>
66
         <el-table-column prop="alias" :label="T('Alias')" align="center" width="150"/>
67
+        <el-table-column prop="peer.version" :label="T('Version')" align="center" width="100"/>
67
         <el-table-column prop="hash" :label="T('Hash')" align="center" width="150" show-overflow-tooltip/>
68
         <el-table-column prop="hash" :label="T('Hash')" align="center" width="150" show-overflow-tooltip/>
68
         <el-table-column :label="T('Actions')" align="center" class-name="table-actions" width="500" fixed="right">
69
         <el-table-column :label="T('Actions')" align="center" class-name="table-actions" width="500" fixed="right">
69
           <template #default="{row}">
70
           <template #default="{row}">

+ 1 - 0
src/views/my/address_book/index.vue

@@ -50,6 +50,7 @@
50
         <!--        <el-table-column prop="created_at" label="创建时间" align="center"/>-->
50
         <!--        <el-table-column prop="created_at" label="创建时间" align="center"/>-->
51
         <!--        <el-table-column prop="updated_at" label="更新时间" align="center"/>-->
51
         <!--        <el-table-column prop="updated_at" label="更新时间" align="center"/>-->
52
         <el-table-column prop="alias" :label="T('Alias')" align="center" width="150"/>
52
         <el-table-column prop="alias" :label="T('Alias')" align="center" width="150"/>
53
+        <el-table-column prop="peer.version" :label="T('Version')" align="center" width="100"/>
53
         <el-table-column prop="hash" :label="T('Hash')" align="center" width="150" show-overflow-tooltip/>
54
         <el-table-column prop="hash" :label="T('Hash')" align="center" width="150" show-overflow-tooltip/>
54
         <el-table-column :label="T('Actions')" align="center" class-name="table-actions" width="600" fixed="right">
55
         <el-table-column :label="T('Actions')" align="center" class-name="table-actions" width="600" fixed="right">
55
           <template #default="{row}">
56
           <template #default="{row}">