refactor: 规范化代码.
This commit is contained in:
@@ -172,7 +172,7 @@
|
||||
address: undefined,
|
||||
favorite: undefined,
|
||||
tags: undefined,
|
||||
extra: true
|
||||
queryTag: true
|
||||
});
|
||||
|
||||
// 条件数量
|
||||
|
||||
@@ -32,6 +32,11 @@
|
||||
<a-form-item field="address" label="主机地址">
|
||||
<a-input v-model="formModel.address" placeholder="请输入主机地址" />
|
||||
</a-form-item>
|
||||
<!-- 主机分组 -->
|
||||
<a-form-item field="groupIdList" label="主机分组">
|
||||
<host-group-tree-selector v-model="formModel.groupIdList"
|
||||
placeholder="请选择主机分组" />
|
||||
</a-form-item>
|
||||
<!-- 主机标签 -->
|
||||
<a-form-item field="tags" label="主机标签">
|
||||
<tag-multi-selector v-model="formModel.tags"
|
||||
@@ -61,8 +66,9 @@
|
||||
import formRules from '../types/host.form.rules';
|
||||
import { createHost, getHost, updateHost } from '@/api/asset/host';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import TagMultiSelector from '@/components/meta/tag/tag-multi-selector.vue';
|
||||
import { pick } from 'lodash';
|
||||
import TagMultiSelector from '@/components/meta/tag/tag-multi-selector.vue';
|
||||
import HostGroupTreeSelector from '@/components/asset/host-group/host-group-tree-selector.vue';
|
||||
|
||||
const { visible, setVisible } = useVisible();
|
||||
const { loading, setLoading } = useLoading();
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
address: undefined,
|
||||
favorite: undefined,
|
||||
tags: undefined,
|
||||
extra: true
|
||||
queryTag: true
|
||||
});
|
||||
|
||||
// 删除当前行
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<host-table v-if="renderTable"
|
||||
ref="table"
|
||||
@openAdd="() => modal.openAdd()"
|
||||
@openUpdate="(e) => modal.openUpdate(e)"
|
||||
@openUpdate="(e) => modal.openUpdate(e.id)"
|
||||
@openUpdateConfig="(e) => config.open(e)" />
|
||||
<!-- 列表-卡片 -->
|
||||
<host-card-list v-else
|
||||
ref="card"
|
||||
@openAdd="() => modal.openAdd()"
|
||||
@openUpdate="(e) => modal.openUpdate(e)"
|
||||
@openUpdate="(e) => modal.openUpdate(e.id)"
|
||||
@openUpdateConfig="(e) => config.open(e)" />
|
||||
<!-- 添加修改模态框 -->
|
||||
<host-form-modal ref="modal"
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
// 卸载时清除 cache
|
||||
onUnmounted(() => {
|
||||
cacheStore.reset('hostTags', 'hostKeys', 'hostIdentities');
|
||||
cacheStore.reset('hostTags', 'hostKeys', 'hostIdentities', 'hostGroups');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user