重构代码.
This commit is contained in:
@@ -101,8 +101,7 @@
|
|||||||
};
|
};
|
||||||
const formatUnreadLength = (type: string) => {
|
const formatUnreadLength = (type: string) => {
|
||||||
const list = getUnreadList(type);
|
const list = getUnreadList(type);
|
||||||
// FIXME
|
return list.length ? `(${list.length})` : '';
|
||||||
return list.length ? `(${list.length})` : ``;
|
|
||||||
};
|
};
|
||||||
const handleItemClick = (items: MessageListType) => {
|
const handleItemClick = (items: MessageListType) => {
|
||||||
if (renderList.value.length) readMessage([...items]);
|
if (renderList.value.length) readMessage([...items]);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostIdentityUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<HostIdentityUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostKeyUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<HostKeyUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
config.value[s.type] = s;
|
config.value[s.type] = s;
|
||||||
});
|
});
|
||||||
} catch ({ message }) {
|
} catch ({ message }) {
|
||||||
// FIXME
|
|
||||||
Message.error(`配置加载失败 ${message}`);
|
Message.error(`配置加载失败 ${message}`);
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -158,7 +158,7 @@
|
|||||||
version: undefined,
|
version: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostSshConfig & Record<string, any>>({
|
const formModel = reactive<HostSshConfig & Record<string, any>>({
|
||||||
username: undefined,
|
username: undefined,
|
||||||
port: undefined,
|
port: undefined,
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<HostUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<HostUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -151,7 +151,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<MenuUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<MenuUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -181,13 +181,13 @@
|
|||||||
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<MenuQueryRequest>({
|
const formModel = reactive<MenuQueryRequest>({
|
||||||
name: undefined,
|
name: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableRef = ref<any>();
|
const tableRef = ref();
|
||||||
const expandStatus = ref<boolean>(false);
|
const expandStatus = ref<boolean>(false);
|
||||||
|
|
||||||
const tableRenderData = ref<MenuQueryResponse[]>([]);
|
const tableRenderData = ref<MenuQueryResponse[]>([]);
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
import { onUnmounted, ref } from 'vue';
|
import { onUnmounted, ref } from 'vue';
|
||||||
import { useCacheStore } from '@/store';
|
import { useCacheStore } from '@/store';
|
||||||
|
|
||||||
const table = ref<any>();
|
const table = ref();
|
||||||
const modal = ref<any>();
|
const modal = ref();
|
||||||
|
|
||||||
// 卸载时清除 menu cache
|
// 卸载时清除 menu cache
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<RoleUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<RoleUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
const { visible, setVisible } = useVisible();
|
const { visible, setVisible } = useVisible();
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
|
|
||||||
const tree = ref<any>();
|
const tree = ref();
|
||||||
const roleRecord = reactive<Record<string, any>>({
|
const roleRecord = reactive<Record<string, any>>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
|
|||||||
@@ -62,6 +62,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- 状态 -->
|
<!-- 状态 -->
|
||||||
<template #status="{ record }">
|
<template #status="{ record }">
|
||||||
|
<!-- FIXME -->
|
||||||
|
<span class="circle"></span>
|
||||||
<a-tag :color="getEnumValue(record.status, RoleStatusEnum,'color')">
|
<a-tag :color="getEnumValue(record.status, RoleStatusEnum,'color')">
|
||||||
{{ getEnumValue(record.status, RoleStatusEnum) }}
|
{{ getEnumValue(record.status, RoleStatusEnum) }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<UserUpdateRequest & Record<string, any>>(defaultForm());
|
const formModel = reactive<UserUpdateRequest & Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
const emits = defineEmits(['added', 'updated']);
|
const emits = defineEmits(['added', 'updated']);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<Record<string, any>>(defaultForm());
|
const formModel = reactive<Record<string, any>>(defaultForm());
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const formRef = ref<any>();
|
const formRef = ref();
|
||||||
const formModel = reactive<Record<string, any>>(defaultForm());
|
const formModel = reactive<Record<string, any>>(defaultForm());
|
||||||
|
|
||||||
// 打开
|
// 打开
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
:bordered="false">
|
:bordered="false">
|
||||||
<!-- 状态 -->
|
<!-- 状态 -->
|
||||||
<template #status="{ record }">
|
<template #status="{ record }">
|
||||||
|
<!-- FIXME -->
|
||||||
<a-tag :color="getEnumValue(record.status, UserStatusEnum,'color')">
|
<a-tag :color="getEnumValue(record.status, UserStatusEnum,'color')">
|
||||||
{{ getEnumValue(record.status, UserStatusEnum) }}
|
{{ getEnumValue(record.status, UserStatusEnum) }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
|
|||||||
Reference in New Issue
Block a user