-
-
- selectedGroup = e"
- @update:checked-keys="updateCheckedGroups" />
-
+
+
selectedGroup = e"
+ @update:checked-keys="updateCheckedGroups" />
@@ -62,32 +48,27 @@
diff --git a/orion-ops-ui/src/views/asset/grant/components/host-list.vue b/orion-ops-ui/src/views/asset/grant/components/host-list.vue
index 4aa3ffcc..ba475dc1 100644
--- a/orion-ops-ui/src/views/asset/grant/components/host-list.vue
+++ b/orion-ops-ui/src/views/asset/grant/components/host-list.vue
@@ -1,5 +1,6 @@
@@ -35,8 +36,10 @@
import type { PropType } from 'vue';
import useLoading from '@/hooks/loading';
import { useCacheStore } from '@/store';
- import { ref, watch } from 'vue';
+ import { onBeforeMount, ref, watch } from 'vue';
import { getHostGroupRelList } from '@/api/asset/host-group';
+ import { getHostList } from '@/api/asset/host';
+ import { Message } from '@arco-design/web-vue';
const props = defineProps({
group: {
@@ -63,12 +66,37 @@
const { data } = await getHostGroupRelList(groupId as number);
selectedGroupHosts.value = data.map(s => cacheStore.hosts.find(h => h.id === s) as HostQueryResponse)
.filter(Boolean);
+ for (let i = 1800; i < 2000; i++) {
+ selectedGroupHosts.value.push({
+ id: i,
+ name: i + '',
+ code: i + '',
+ } as any);
+ }
} catch (e) {
} finally {
setLoading(false);
}
});
+ // 加载主机列表
+ const loadHostList = async () => {
+ try {
+ const { data } = await getHostList();
+ // 设置到缓存
+ cacheStore.set('hosts', data);
+ } catch (e) {
+ Message.error('主机列表加载失败');
+ }
+ };
+
+ onBeforeMount(async () => {
+ if (!cacheStore.hosts.length) {
+ // 加载用户列表
+ await loadHostList();
+ }
+ });
+
diff --git a/orion-ops-ui/src/views/asset/grant/components/router-users.vue b/orion-ops-ui/src/views/asset/grant/components/router-users.vue
new file mode 100644
index 00000000..e717be19
--- /dev/null
+++ b/orion-ops-ui/src/views/asset/grant/components/router-users.vue
@@ -0,0 +1,90 @@
+
+
+
+
emits('change', key, item)" />
+
+
+
+ 暂无用户数据
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/asset/grant/index.vue b/orion-ops-ui/src/views/asset/grant/index.vue
index 9b0d86a1..46e9beba 100644
--- a/orion-ops-ui/src/views/asset/grant/index.vue
+++ b/orion-ops-ui/src/views/asset/grant/index.vue
@@ -1,28 +1,21 @@
-
-
+
-
-
-
-
-
- 角色授权
-
+
+
+
-
-
-
-
-
- 用户授权2323
-
+
+
+
@@ -37,28 +30,14 @@