|
|
@@ -9,17 +9,19 @@
|
|
9
|
9
|
</el-form>
|
|
10
|
10
|
</el-card>
|
|
11
|
11
|
<el-card class="list-body" shadow="hover">
|
|
12
|
|
- <el-tag type="danger" effect="light" style="margin-bottom: 10px">{{T('MyAddressBookTips')}}</el-tag>
|
|
13
|
|
- <el-table :data="listRes.list" v-loading="listRes.loading" border>
|
|
|
12
|
+ <el-tag type="danger" effect="light" style="margin-bottom: 10px">{{ T('MyAddressBookTips') }}</el-tag>
|
|
|
13
|
+ <el-table :data="list" v-loading="listRes.loading" border>
|
|
14
|
14
|
<!-- <el-table-column prop="id" label="id" align="center"/>-->
|
|
15
|
15
|
<el-table-column prop="name" :label="T('Name')" align="center"/>
|
|
16
|
16
|
<el-table-column prop="created_at" :label="T('CreatedAt')" align="center"/>
|
|
17
|
17
|
<!-- <el-table-column prop="updated_at" label="更新时间" align="center"/>-->
|
|
18
|
18
|
<el-table-column :label="T('Actions')" align="center" class-name="table-actions" width="600" fixed="right">
|
|
19
|
19
|
<template #default="{row}">
|
|
20
|
|
- <el-button type="primary" @click="showRules(row)">{{ T('ShareRules') }}</el-button>
|
|
21
|
|
- <el-button @click="toEdit(row)">{{ T('Edit') }}</el-button>
|
|
22
|
|
- <el-button type="danger" @click="del(row)">{{ T('Delete') }}</el-button>
|
|
|
20
|
+ <template v-if="row.id>0">
|
|
|
21
|
+ <el-button type="primary" @click="showRules(row)">{{ T('ShareRules') }}</el-button>
|
|
|
22
|
+ <el-button @click="toEdit(row)">{{ T('Edit') }}</el-button>
|
|
|
23
|
+ <el-button type="danger" @click="del(row)">{{ T('Delete') }}</el-button>
|
|
|
24
|
+ </template>
|
|
23
|
25
|
</template>
|
|
24
|
26
|
</el-table-column>
|
|
25
|
27
|
</el-table>
|
|
|
@@ -53,7 +55,7 @@
|
|
53
|
55
|
|
|
54
|
56
|
<script setup>
|
|
55
|
57
|
import { T } from '@/utils/i18n'
|
|
56
|
|
- import { ref } from 'vue'
|
|
|
58
|
+ import { computed, ref } from 'vue'
|
|
57
|
59
|
import { useRepositories } from '@/views/address_book/collection'
|
|
58
|
60
|
import { onActivated, onMounted, watch } from 'vue'
|
|
59
|
61
|
import Rule from '@/views/address_book/rule.vue'
|
|
|
@@ -76,7 +78,16 @@
|
|
76
|
78
|
watch(() => listQuery.page, getList)
|
|
77
|
79
|
|
|
78
|
80
|
watch(() => listQuery.page_size, handlerQuery)
|
|
79
|
|
-
|
|
|
81
|
+ const list = computed(_ => {
|
|
|
82
|
+ if (listQuery.page > 1) {
|
|
|
83
|
+ return listRes.list
|
|
|
84
|
+ } else {
|
|
|
85
|
+ return [
|
|
|
86
|
+ { id: 0, name: T('MyAddressBook') },
|
|
|
87
|
+ ...listRes.list,
|
|
|
88
|
+ ]
|
|
|
89
|
+ }
|
|
|
90
|
+ })
|
|
80
|
91
|
const clickRow = ref({})
|
|
81
|
92
|
const rulesVisible = ref(false)
|
|
82
|
93
|
const showRules = (row) => {
|