重构代码.

This commit is contained in:
lijiahangmax
2023-09-25 00:07:51 +08:00
parent 024a8b4596
commit f8cc8c4233
16 changed files with 18 additions and 17 deletions

View File

@@ -101,8 +101,7 @@
};
const formatUnreadLength = (type: string) => {
const list = getUnreadList(type);
// FIXME
return list.length ? `(${list.length})` : ``;
return list.length ? `(${list.length})` : '';
};
const handleItemClick = (items: MessageListType) => {
if (renderList.value.length) readMessage([...items]);

View File

@@ -85,7 +85,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<HostIdentityUpdateRequest & Record<string, any>>(defaultForm());
const emits = defineEmits(['added', 'updated']);

View File

@@ -116,7 +116,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<HostKeyUpdateRequest & Record<string, any>>(defaultForm());
const emits = defineEmits(['added', 'updated']);

View File

@@ -60,7 +60,6 @@
config.value[s.type] = s;
});
} catch ({ message }) {
// FIXME
Message.error(`配置加载失败 ${message}`);
setVisible(false);
} finally {

View File

@@ -158,7 +158,7 @@
version: undefined,
});
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<HostSshConfig & Record<string, any>>({
username: undefined,
port: undefined,

View File

@@ -76,7 +76,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<HostUpdateRequest & Record<string, any>>(defaultForm());
const emits = defineEmits(['added', 'updated']);

View File

@@ -151,7 +151,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<MenuUpdateRequest & Record<string, any>>(defaultForm());
const emits = defineEmits(['added', 'updated']);

View File

@@ -181,13 +181,13 @@
const cacheStore = useCacheStore();
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<MenuQueryRequest>({
name: undefined,
status: undefined
});
const tableRef = ref<any>();
const tableRef = ref();
const expandStatus = ref<boolean>(false);
const tableRenderData = ref<MenuQueryResponse[]>([]);

View File

@@ -24,8 +24,8 @@
import { onUnmounted, ref } from 'vue';
import { useCacheStore } from '@/store';
const table = ref<any>();
const modal = ref<any>();
const table = ref();
const modal = ref();
// 卸载时清除 menu cache
onUnmounted(() => {

View File

@@ -61,7 +61,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<RoleUpdateRequest & Record<string, any>>(defaultForm());
const emits = defineEmits(['added', 'updated']);

View File

@@ -56,7 +56,7 @@
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
const tree = ref<any>();
const tree = ref();
const roleRecord = reactive<Record<string, any>>({
id: undefined,
name: undefined,

View File

@@ -62,6 +62,8 @@
</template>
<!-- 状态 -->
<template #status="{ record }">
<!-- FIXME -->
<span class="circle"></span>
<a-tag :color="getEnumValue(record.status, RoleStatusEnum,'color')">
{{ getEnumValue(record.status, RoleStatusEnum) }}
</a-tag>

View File

@@ -79,7 +79,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<UserUpdateRequest & Record<string, any>>(defaultForm());
const emits = defineEmits(['added', 'updated']);

View File

@@ -67,7 +67,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<Record<string, any>>(defaultForm());
const cacheStore = useCacheStore();

View File

@@ -63,7 +63,7 @@
};
};
const formRef = ref<any>();
const formRef = ref();
const formModel = reactive<Record<string, any>>(defaultForm());
// 打开

View File

@@ -72,6 +72,7 @@
:bordered="false">
<!-- 状态 -->
<template #status="{ record }">
<!-- FIXME -->
<a-tag :color="getEnumValue(record.status, UserStatusEnum,'color')">
{{ getEnumValue(record.status, UserStatusEnum) }}
</a-tag>