|
@@ -1,5 +1,5 @@
|
|
|
<script setup>
|
|
|
-import { ref, shallowRef } from 'vue'
|
|
|
+import { ref, shallowRef, computed } from 'vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import { PlusOutlined } from '@ant-design/icons-vue'
|
|
|
import CrudTableModal from './components/ip-list-modal.vue'
|
|
@@ -8,13 +8,15 @@ import { useTableQuery } from '~@/composables/table-query'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const message = useMessage()
|
|
|
-const gatewayGroupId = Number(route.query.id)
|
|
|
+const gatewayGroupId = computed(() => Number(route.query.id || 0))
|
|
|
|
|
|
const columns = shallowRef([
|
|
|
{ title: 'ID', dataIndex: 'id', key: 'id' },
|
|
|
{ title: '网关组ID', dataIndex: 'gatewayGroupId', key: 'gatewayGroupId' },
|
|
|
{ title: '网关组名称', dataIndex: 'tag', key: 'tag' },
|
|
|
{ title: 'IP地址', dataIndex: 'ip', key: 'ip' },
|
|
|
+ { title: '标签', dataIndex: 'tag', key: 'tag' },
|
|
|
+ { title: '归属地', dataIndex: 'originPlace', key: 'originPlace' },
|
|
|
{ title: '备注', dataIndex: 'comment', key: 'comment' },
|
|
|
{ title: '创建时间', dataIndex: 'createdAt', key: 'createdAt' },
|
|
|
{ title: '更新时间', dataIndex: 'updatedAt', key: 'updatedAt' },
|
|
@@ -24,7 +26,7 @@ const columns = shallowRef([
|
|
|
const { state, initQuery, resetQuery, query } = useTableQuery({
|
|
|
queryApi: getListApi,
|
|
|
queryParams: {
|
|
|
- gatewayGroupId: gatewayGroupId,
|
|
|
+ gatewayGroupId: gatewayGroupId.value,
|
|
|
ip: undefined,
|
|
|
},
|
|
|
afterQuery: (res) => {
|
|
@@ -53,7 +55,7 @@ async function handleDelete(record) {
|
|
|
}
|
|
|
|
|
|
function handleAdd() {
|
|
|
- crudTableModal.value?.open({ gatewayGroupId: gatewayGroupId })
|
|
|
+ crudTableModal.value?.open({ gatewayGroupId: gatewayGroupId.value })
|
|
|
}
|
|
|
|
|
|
function handleEdit(record) {
|