2023-09-11 16:33:57 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="layout-container">
|
|
|
|
|
<!-- 表格 -->
|
|
|
|
|
<host-table ref="table"
|
2023-09-14 16:18:41 +08:00
|
|
|
@openAdd="() => modal.openAdd()"
|
2023-09-20 10:40:59 +08:00
|
|
|
@openUpdate="(e) => modal.openUpdate(e)"
|
|
|
|
|
@openUpdateConfig="(e) => config.open(e)" />
|
2023-09-11 16:33:57 +08:00
|
|
|
<!-- 添加修改模态框 -->
|
|
|
|
|
<host-form-modal ref="modal"
|
2023-09-14 16:18:41 +08:00
|
|
|
@added="() => table.addedCallback()"
|
|
|
|
|
@updated="() => table.updatedCallback()" />
|
2023-09-20 10:40:59 +08:00
|
|
|
<!-- 配置面板 -->
|
|
|
|
|
<host-config-drawer ref="config" />
|
2023-09-11 16:33:57 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
export default {
|
|
|
|
|
name: 'assetHost'
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import HostTable from './components/host-table.vue';
|
|
|
|
|
import HostFormModal from './components/host-form-modal.vue';
|
2023-09-14 16:18:41 +08:00
|
|
|
import { onUnmounted, ref } from 'vue';
|
|
|
|
|
import { useCacheStore } from '@/store';
|
2023-09-20 10:40:59 +08:00
|
|
|
import HostConfigDrawer from '@/views/asset/host/components/host-config-drawer.vue';
|
2023-09-11 16:33:57 +08:00
|
|
|
|
|
|
|
|
const table = ref();
|
|
|
|
|
const modal = ref();
|
2023-09-20 10:40:59 +08:00
|
|
|
const config = ref();
|
2023-09-11 16:33:57 +08:00
|
|
|
|
2023-09-14 16:18:41 +08:00
|
|
|
// 卸载时清除 tags cache
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
const cacheStore = useCacheStore();
|
|
|
|
|
cacheStore.set('tags', []);
|
|
|
|
|
});
|
|
|
|
|
|
2023-09-11 16:33:57 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|