Feat: optimize code

This commit is contained in:
unitwk 2024-01-17 11:36:33 +08:00
parent 6ba705e2a7
commit 28ce9646db
17 changed files with 14 additions and 18 deletions

View File

@ -3,7 +3,6 @@ import dayjs from "dayjs";
import { onUnmounted } from "vue";
import { onMounted } from "vue";
import { ref } from "vue";
import { t } from "@/lang/i18n";
defineProps<{
date: string;

View File

@ -1,6 +1,5 @@
import { initI18n, initInstallPageFlow, toStandardLang } from "@/lang/i18n";
import { initI18n } from "@/lang/i18n";
import { useAppStateStore } from "./stores/useAppStateStore";
import { panelStatus } from "./services/apis";
import { initLayoutConfig } from "./services/layout";
(async function () {

View File

@ -1,4 +1,3 @@
import { message } from "ant-design-vue";
import { reportError } from "@/tools/validator";
import type { IPanelResponseProtocol } from "./../../../common/global.d";
import { useAppStateStore } from "@/stores/useAppStateStore";

View File

@ -2,7 +2,7 @@ import { createGlobalState } from "@vueuse/core";
import { overviewInfo } from "./apis";
export const useAppToolsStore = createGlobalState(() => {
const { execute, state } = overviewInfo();
const { state } = overviewInfo();
return {
overviewData: state

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import { createGlobalState } from "@vueuse/core";
import { reactive } from "vue";

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import { t } from "@/lang/i18n";
export const CARD_FIXED_HEIGHT = 200;

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import type {
IGlobalInstanceConfig,
ILayoutCard as GlobalLayoutCard,

View File

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
declare module "vue-i18n-t" {
export function createI18n(option: any): any;
export function useI18n(option: any): { t: (t: string) => string };

View File

@ -3,7 +3,6 @@ import { onMounted, ref, reactive } from "vue";
import CardPanel from "@/components/CardPanel.vue";
import { t } from "@/lang/i18n";
import { panelInstall } from "@/services/apis";
import { message } from "ant-design-vue";
import { reportError } from "@/tools/validator";
import type { FormInstance } from "ant-design-vue";
import { useAppRouters } from "@/hooks/useAppRouters";

View File

@ -87,6 +87,7 @@ const loginSuccess = () => {
</script>
<template>
<!-- eslint-disable vue/no-v-html -->
<div
:class="{
logging: loginStep === 1,
@ -137,7 +138,6 @@ const loginSuccess = () => {
<div class="mt-24 flex-between align-center">
<div class="mcsmanager-link">
<!-- eslint-disable-next-line vue/no-v-html -->
<div
v-if="pageInfoResult?.loginInfo"
class="global-markdown-html"
@ -187,8 +187,6 @@ const loginSuccess = () => {
</style>
<style lang="scss" scoped>
.loginDone {
}
.logging {
.login-panel {
transform: scale(0.96);

View File

@ -2,7 +2,6 @@
import { ref, computed } from "vue";
import { t } from "@/lang/i18n";
import { useScreen } from "@/hooks/useScreen";
import { message } from "ant-design-vue";
import { reportError } from "@/tools/validator";
import { buildProgress } from "@/services/apis/envImage";
import Loading from "@/components/Loading.vue";

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
import { reactive, onMounted } from "vue";
import { t } from "@/lang/i18n";
import { message, notification } from "ant-design-vue";
import { notification } from "ant-design-vue";
import { imageList } from "@/services/apis/envImage";
const props = defineProps<{

View File

@ -1,7 +1,6 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { t } from "@/lang/i18n";
import { message } from "ant-design-vue";
import { reportError } from "@/tools/validator";
import CardPanel from "@/components/CardPanel.vue";
import BetweenMenus from "@/components/BetweenMenus.vue";

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from "vue";
import { ref, onMounted } from "vue";
import { t } from "@/lang/i18n";
import type { LayoutCard } from "@/types";
import { useScreen } from "@/hooks/useScreen";

View File

@ -4,7 +4,6 @@ import { t } from "@/lang/i18n";
import CardPanel from "@/components/CardPanel.vue";
import type { LayoutCard } from "@/types/index";
import { message } from "ant-design-vue";
import { reportError } from "@/tools/validator";
import {
CheckCircleOutlined,
ExclamationCircleOutlined,

View File

@ -5,15 +5,16 @@ import { message } from "ant-design-vue";
import { reportError } from "@/tools/validator";
import Editor from "@/components/Editor.vue";
import { fileContent } from "@/services/apis/fileManager";
import { useRoute } from "vue-router";
const route = useRoute();
const open = ref(false);
const openEditor = ref(false);
const editorText = ref("");
const fileName = ref("");
const path = ref("");
// eslint-disable-next-line no-unused-vars
let resolve: (t: string) => void;
// eslint-disable-next-line no-unused-vars
let reject: (e: Error) => void;
const props = defineProps<{

View File

@ -1,3 +1,4 @@
<!-- eslint-disable no-unused-vars -->
<script setup lang="ts">
import { ref } from "vue";
import { $t as t } from "@/lang/i18n";
@ -5,7 +6,6 @@ import CardPanel from "@/components/CardPanel.vue";
import { useLayoutContainerStore } from "@/stores/useLayoutContainerStore";
import { useLayoutCardTools } from "@/hooks/useCardTools";
import type { LayoutCard } from "@/types/index";
import { markdownToHTML } from "../../tools/safe";
enum EDIT_MODE {
PREVIEW = "PREVIEW",