|
@@ -26,8 +26,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { useAppStore, useThemeStore } from '@/store';
|
|
|
import { ShortcutsCard, TechnologyCard } from './components';
|
|
|
-
|
|
|
defineOptions({ name: 'DashboardWorkbenchMain' });
|
|
|
|
|
|
interface Technology {
|
|
@@ -39,7 +39,8 @@ interface Technology {
|
|
|
icon: string;
|
|
|
iconColor?: string;
|
|
|
}
|
|
|
-
|
|
|
+const app = useAppStore();
|
|
|
+const theme = useThemeStore();
|
|
|
const technology: Technology[] = [
|
|
|
{
|
|
|
id: 0,
|
|
@@ -101,20 +102,39 @@ function getRandomColor(): string {
|
|
|
return `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
|
}
|
|
|
|
|
|
+type callback = () => void;
|
|
|
+
|
|
|
interface Shortcuts {
|
|
|
id: number;
|
|
|
label: string;
|
|
|
icon: string;
|
|
|
iconColor: string;
|
|
|
+ siteOrfunc: string | callback;
|
|
|
}
|
|
|
|
|
|
const shortcuts: Shortcuts[] = [
|
|
|
- { id: 0, label: '查档案', icon: 'icons8:student', iconColor: '#409eff' },
|
|
|
- { id: 2, label: '看管理', icon: 'arcticons:classroom', iconColor: '#f56c6c' },
|
|
|
- { id: 1, label: '个性化', icon: 'ic:outline-settings', iconColor: '#7238d1' },
|
|
|
- { id: 3, label: '改密码', icon: 'teenyicons:password-solid', iconColor: '#19a2f1' },
|
|
|
- { id: 4, label: '切主题', icon: 'icon-park-solid:theme', iconColor: '#fab251' },
|
|
|
- { id: 5, label: '说明', icon: 'gg:readme', iconColor: '#8aca6b' }
|
|
|
+ { id: 0, label: '查档案', icon: 'icons8:student', iconColor: '#409eff', siteOrfunc: '/archives/students' },
|
|
|
+ { id: 2, label: '查班级', icon: 'arcticons:classroom', iconColor: '#f56c6c', siteOrfunc: '/group/group' },
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ label: '个性化',
|
|
|
+ icon: 'ic:outline-settings',
|
|
|
+ iconColor: '#7238d1',
|
|
|
+ siteOrfunc: () => {
|
|
|
+ app.toggleSettingDrawerVisible();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { id: 3, label: '改密码', icon: 'teenyicons:password-solid', iconColor: '#19a2f1', siteOrfunc: '/system/profile' },
|
|
|
+ {
|
|
|
+ id: 4,
|
|
|
+ label: '切主题',
|
|
|
+ icon: 'icon-park-solid:theme',
|
|
|
+ iconColor: '#fab251',
|
|
|
+ siteOrfunc: () => {
|
|
|
+ theme.setDarkMode(!theme.darkMode);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { id: 5, label: '说明', icon: 'gg:readme', iconColor: '#8aca6b', siteOrfunc: '/about' }
|
|
|
];
|
|
|
</script>
|
|
|
|