chore: code format

This commit is contained in:
xiaojunnuo
2025-06-29 14:09:09 +08:00
parent 04422a4637
commit 4fcfd089d8
644 changed files with 10845 additions and 13184 deletions
@@ -35,7 +35,7 @@ export default {
forEach(map, (item, key) => {
list.push({
key,
label: item.label
label: item.label,
});
});
return list;
@@ -54,9 +54,9 @@ export default {
return {
languages,
current,
changeLocale
changeLocale,
};
}
},
};
</script>
@@ -1,15 +1,15 @@
.fs-menu-wrapper{
.fs-menu-wrapper {
height: 100%;
overflow-y: auto;
&.fs-menu-better-scroll{
&.fs-menu-better-scroll {
overflow-y: hidden;
}
.menu-item-title{
.menu-item-title {
display: flex;
align-items: center;
.fs-icon{
font-size: 16px !important;
min-width: 16px !important;
.fs-icon {
font-size: 16px !important;
min-width: 16px !important;
}
}
}
@@ -10,7 +10,7 @@ import { utils } from "@fast-crud/fast-crud";
import * as _ from "lodash-es";
defineOptions({
name: "FsMenu"
name: "FsMenu",
});
const props = defineProps<{
@@ -37,7 +37,7 @@ function buildItemMenus(menus: any) {
title: sub.title,
icon: () => {
return <fsIcon icon={sub.icon ?? sub.meta?.icon} />;
}
},
};
list.push(item);
@@ -50,7 +50,7 @@ function buildItemMenus(menus: any) {
watch(
() => props.menus,
(menus) => {
menus => {
items.value = buildItemMenus(menus);
},
{ immediate: true }
@@ -77,7 +77,7 @@ function openSelectedParents(fullPath: any) {
return;
}
if (value.path === fullPath) {
_.forEach(context.parents, (item) => {
_.forEach(context.parents, item => {
if (item.value instanceof Array) {
return;
}
@@ -99,7 +99,7 @@ watch(
() => {
return route.fullPath;
},
(path) => {
path => {
// path = route.fullPath;
selectedKeys.value = [path];
const changed = openSelectedParents(path);
@@ -108,7 +108,7 @@ watch(
}
},
{
immediate: true
immediate: true,
}
);
</script>
@@ -6,7 +6,7 @@ import "./index.less";
import { utils } from "@fast-crud/fast-crud";
import { routerUtils } from "/@/utils/util.router";
defineOptions()
defineOptions();
export default defineComponent({
name: "FsMenu",
@@ -14,9 +14,9 @@ export default defineComponent({
props: {
menus: {},
expandSelected: {
default: false
default: false,
},
scroll: {}
scroll: {},
},
setup(props, ctx) {
async function onSelect(item: any) {
@@ -37,7 +37,7 @@ export default defineComponent({
title: sub.title,
icon: () => {
return <fsIcon icon={sub.icon ?? sub.meta?.icon} />;
}
},
};
list.push(item);
if (sub.children && sub.children.length > 0) {
@@ -80,7 +80,7 @@ export default defineComponent({
default: () => {
return buildMenus(sub.children);
},
title
title,
};
function onTitleClick() {
if (sub.path && ctx.attrs.mode === "horizontal") {
@@ -101,7 +101,7 @@ export default defineComponent({
const slots = {
default() {
return buildMenus(props.menus);
}
},
};
const selectedKeys = ref([]);
const openKeys = ref([]);
@@ -123,7 +123,7 @@ export default defineComponent({
return;
}
if (value.path === fullPath) {
_.forEach(context.parents, (item) => {
_.forEach(context.parents, item => {
if (item.value instanceof Array) {
return;
}
@@ -148,7 +148,7 @@ export default defineComponent({
() => {
return route.fullPath;
},
(path) => {
path => {
// path = route.fullPath;
selectedKeys.value = [path];
const changed = openSelectedParents(path);
@@ -157,7 +157,7 @@ export default defineComponent({
}
},
{
immediate: true
immediate: true,
}
);
return () => {
@@ -170,7 +170,7 @@ export default defineComponent({
// onOpenChange={onOpenChange}
v-models={[
[openKeys.value, "openKeys"],
[selectedKeys.value, "selectedKeys"]
[selectedKeys.value, "selectedKeys"],
]}
items={items.value}
inlineCollapsed={!props.expandSelected}
@@ -179,5 +179,5 @@ export default defineComponent({
const classNames = { "fs-menu-wrapper": true, "fs-menu-better-scroll": props.scroll };
return <div>{menu}</div>;
};
}
},
});
@@ -17,7 +17,7 @@ export default defineComponent({
() => {
return router.currentRoute.value.fullPath;
},
(value) => {
value => {
showSourceLink.value = value !== "/index";
},
{ immediate: true }
@@ -29,9 +29,9 @@ export default defineComponent({
}
return {
goSource,
showSourceLink
showSourceLink,
};
}
},
});
</script>
@@ -2,14 +2,7 @@
<div class="fs-multiple-page-control-group">
<div class="fs-multiple-page-control-content">
<div class="fs-multiple-page-control-content-inner">
<a-tabs
class="fs-multiple-page-control fs-multiple-page-sort"
:active-key="page.getCurrent"
type="editable-card"
hide-add
@tab-click="handleClick"
@edit="handleTabEdit"
>
<a-tabs class="fs-multiple-page-control fs-multiple-page-sort" :active-key="page.getCurrent" type="editable-card" hide-add @tab-click="handleClick" @edit="handleTabEdit">
<a-tab-pane v-for="item in page.getOpened" :key="item.fullPath" :name="item.fullPath" :closable="isTabClosable(item)">
<template #tab>
<span class="flex-o">
@@ -75,7 +68,7 @@ export default {
closeRight: pageStore.closeRight,
closeOther: pageStore.closeOther,
closeAll: pageStore.closeAll,
openedSort: pageStore.openedSort
openedSort: pageStore.openedSort,
};
const computeOpened = computed(() => {
return pageStore.getOpened;
@@ -84,7 +77,7 @@ export default {
return {
page: pageStore,
...actions,
computeOpened
computeOpened,
};
},
data() {
@@ -97,9 +90,9 @@ export default {
{ icon: "arrow-left", title: "关闭左侧", value: "left" },
{ icon: "arrow-right", title: "关闭右侧", value: "right" },
{ icon: "times", title: "关闭其它", value: "other" },
{ icon: "times-circle", title: "关闭全部", value: "all" }
{ icon: "times-circle", title: "关闭全部", value: "all" },
],
tagName: "/index"
tagName: "/index",
};
},
mounted() {
@@ -195,8 +188,8 @@ export default {
if (action === "remove") {
this.close({ tagName });
}
}
} as any
},
} as any,
};
</script>
<style lang="less">
@@ -19,44 +19,44 @@ import { defineComponent, ref } from "vue";
const colorListDefine = [
{
key: "薄暮",
color: "#f5222d"
color: "#f5222d",
},
{
key: "火山",
color: "#fa541c"
color: "#fa541c",
},
{
key: "日暮",
color: "#faad14"
color: "#faad14",
},
{
key: "明青",
color: "#13c2c2"
color: "#13c2c2",
},
{
key: "极光绿",
color: "#52c41a"
color: "#52c41a",
},
{
key: "拂晓蓝(默认)",
color: "#1890ff"
color: "#1890ff",
},
{
key: "极客蓝",
color: "#2f54eb"
color: "#2f54eb",
},
{
key: "酱紫",
color: "#722ed1"
}
color: "#722ed1",
},
];
export default defineComponent({
name: "FsThemeColorPicker",
props: {
primaryColor: {
type: String,
default: "#1890ff"
}
default: "#1890ff",
},
},
emits: ["change"],
setup(props, ctx) {
@@ -66,9 +66,9 @@ export default defineComponent({
}
return {
colorList,
changeColor
changeColor,
};
}
},
});
</script>
<style lang="less">
@@ -27,9 +27,9 @@ export default defineComponent({
visible,
show,
afterVisibleChange,
setting
setting,
};
}
},
});
</script>
@@ -29,9 +29,9 @@ export default defineComponent({
};
return {
setting,
onChange
onChange,
};
}
},
});
</script>
@@ -1,13 +1,13 @@
<template>
<a-dropdown>
<div class="fs-user-info">{{ t('user.greeting') }}{{ userStore.getUserInfo?.nickName || userStore.getUserInfo?.username }}</div>
<div class="fs-user-info">{{ t("user.greeting") }}{{ userStore.getUserInfo?.nickName || userStore.getUserInfo?.username }}</div>
<template #overlay>
<a-menu>
<a-menu-item>
<div @click="goUserProfile">{{ t('user.profile') }}</div>
<div @click="goUserProfile">{{ t("user.profile") }}</div>
</a-menu-item>
<a-menu-item>
<div @click="doLogout">{{ t('user.logout') }}</div>
<div @click="doLogout">{{ t("user.logout") }}</div>
</a-menu-item>
</a-menu>
</template>
@@ -20,6 +20,7 @@
<!-- <fs-menu class="header-menu" mode="horizontal" :expand-selected="false" :selectable="false" :menus="frameworkMenus" />-->
<div
v-for="menu of resourceStore.authedTopMenus"
:key="menu.name"
class="top-menu flex-center header-btn"
:class="{ current: resourceStore.currentTopMenu === menu }"
:style="{ color: resourceStore.currentTopMenu === menu ? token.colorPrimary : '' }"