Przeglądaj źródła

Merge commit 'af1589f3ebfd24304b5f9049c53db91bf82af678'

ith5 6 miesięcy temu
rodzic
commit
48337b4b3b

BIN
public/favicon.ico


BIN
public/logo.png


+ 42 - 42
src/i18n/zh_CN/menus.js

@@ -1,53 +1,53 @@
 export default {
   // 特殊页
-  'openForm': '公共表单',
+  openForm: "公共表单",
 
   // 首页菜单
-  'home': '首页',
-  'dashboard': '仪表盘',
-  'userCenter': '个人中心',
-  'message': '消息中心',
-  'setting:config': '系统配置',
-  'demo': '组件演示',
+  home: "首页",
+  dashboard: "仪表盘",
+  userCenter: "个人中心",
+  message: "消息中心",
+  "setting:config": "系统配置",
+  demo: "组件演示",
 
   // 权限
-  'permission': '权限',
-  'system:user': '用户管理',
-  'system:role': '角色管理',
-  'system:dept': '部门管理',
-  'system:menu': '菜单管理',
-  'system:post': '岗位管理',
+  permission: "权限管理",
+  "system:user": "用户管理",
+  "system:role": "角色管理",
+  "system:dept": "部门管理",
+  "system:menu": "菜单管理",
+  "system:post": "岗位管理",
 
-  'dataCenter': '数据',
-  'system:dict': '数据字典',
-  'system:attachment': '附件管理',
-  'system:dataMaintain': '数据表维护',
-  'system:notice': '系统公告',
-  'apps': '应用中心',
-  'system:appGroup': '应用分组',
-  'system:app': '应用管理',
-  'apis': '应用接口',
-  'system:apiGroup': '接口分组',
-  'system:api': '接口管理',
+  dataCenter: "数据",
+  "system:dict": "数据字典",
+  "system:attachment": "附件管理",
+  "system:dataMaintain": "数据表维护",
+  "system:notice": "系统公告",
+  apps: "应用中心",
+  "system:appGroup": "应用分组",
+  "system:app": "应用管理",
+  apis: "应用接口",
+  "system:apiGroup": "接口分组",
+  "system:api": "接口管理",
 
   // 监控
-  'monitor': '监控',
-  'system:monitor:server': '服务监控',
-  'system:onlineUser': '在线用户',
-  'system:cache': '缓存监控',
-  'system:monitor:rely': '依赖监控',
-  'logs': '日志监控',
-  'system:queueLog': '队列日志',
-  'system:loginLog': '登录日志',
-  'system:operLog': '操作日志',
-  'system:apiLog': '接口日志',
+  monitor: "监控",
+  "system:monitor:server": "服务监控",
+  "system:onlineUser": "在线用户",
+  "system:cache": "缓存监控",
+  "system:monitor:rely": "依赖监控",
+  logs: "日志监控",
+  "system:queueLog": "队列日志",
+  "system:loginLog": "登录日志",
+  "system:operLog": "操作日志",
+  "system:apiLog": "接口日志",
 
   // 工具
-  'devTools': '工具',
-  'setting:module': '模块管理',
-  'setting:code': '代码生成器',
-  'setting:code:update': '编辑生成信息',
-  'setting:crontab': '定时任务',
-  'setting:table': '数据表设计器',
-  'systemInterface': '系统接口',
-}
+  devTools: "工具",
+  "setting:module": "模块管理",
+  "setting:code": "代码生成器",
+  "setting:code:update": "编辑生成信息",
+  "setting:crontab": "定时任务",
+  "setting:table": "数据表设计器",
+  systemInterface: "系统接口",
+};

+ 2 - 2
src/layout/components/ma-operation.vue

@@ -76,11 +76,11 @@
     </a-space>
     <a-dropdown @select="handleSelect" trigger="hover">
       <div class="flex items-center cursor-pointer">
-        <a-avatar size="large" class="text-xl avatar bg-blue-500">
+        <!-- <a-avatar size="large" class="text-xl avatar bg-blue-500">
           <span class="text-white text-2xl">{{
             userStore.user.nickname.slice(0, 1)
           }}</span>
-        </a-avatar>
+        </a-avatar> -->
         <div class="ml-2 text-sm">欢迎,{{ userStore.user.nickname }}</div>
       </div>
 

+ 129 - 86
src/layout/setting.vue

@@ -6,12 +6,15 @@
     width="450px"
     :ok-text="$t('sys.saveToBackend')"
     @cancel="close"
-    unmountOnClose>
-    <template #title>{{ $t('sys.backendSettingTitle') }}</template>
+    unmountOnClose
+  >
+    <template #title>{{ $t("sys.backendSettingTitle") }}</template>
     <a-form :model="form" :auto-label-width="true">
       <a-row class="flex justify-center mb-5">
         <a-divider orientation="center"
-          ><span class="title">{{ $t('sys.systemPrimaryColor') }}</span></a-divider
+          ><span class="title">{{
+            $t("sys.systemPrimaryColor")
+          }}</span></a-divider
         >
         <ColorPicker
           theme="dark"
@@ -19,23 +22,30 @@
           :sucker-hide="true"
           :colors-default="defaultColorList"
           @changeColor="changeColor"
-          style="width: 218px" />
+          style="width: 218px"
+        />
       </a-row>
       <a-divider orientation="center"
-        ><span class="title">{{ $t('sys.personalizedConfig') }}</span></a-divider
+        ><span class="title">{{
+          $t("sys.personalizedConfig")
+        }}</span></a-divider
       >
       <a-form-item :label="$t('sys.skin')" :help="$t('sys.skinHelp')">
         {{ currentSkin }}
         <a-button type="primary" size="mini" class="ml-2" @click="skin.open()">
-          {{ $t('sys.changeSkin') }}
+          {{ $t("sys.changeSkin") }}
         </a-button>
       </a-form-item>
       <a-form-item :label="$t('sys.layouts')" :help="$t('sys.layoutsHelp')">
         <a-select v-model="form.layout" @change="handleLayout">
-          <a-option value="classic">{{ $t('sys.layout.classic') }}</a-option>
-          <a-option value="columns">{{ $t('sys.layout.columns') }}</a-option>
-          <a-option v-if="appStore.skin !== 'classics'" value="banner">{{ $t('sys.layout.banner') }}</a-option>
-          <a-option v-if="appStore.skin !== 'classics'" value="mixed">{{ $t('sys.layout.mixed') }}</a-option>
+          <a-option value="classic">{{ $t("sys.layout.classic") }}</a-option>
+          <a-option value="columns">{{ $t("sys.layout.columns") }}</a-option>
+          <a-option v-if="appStore.skin !== 'classics'" value="banner">{{
+            $t("sys.layout.banner")
+          }}</a-option>
+          <a-option v-if="appStore.skin !== 'classics'" value="mixed">{{
+            $t("sys.layout.mixed")
+          }}</a-option>
         </a-select>
       </a-form-item>
       <a-form-item :label="$t('sys.round')" :help="$t('sys.roundHelp')">
@@ -47,38 +57,69 @@
       <a-form-item :label="$t('sys.i18n')" :help="$t('sys.i18nHelp')">
         <a-switch v-model="form.i18n" @change="handleI18n" />
       </a-form-item>
-      <a-form-item :label="$t('sys.language')" :help="$t('sys.languageHelp')" v-if="form.i18n">
+      <a-form-item
+        :label="$t('sys.language')"
+        :help="$t('sys.languageHelp')"
+        v-if="form.i18n"
+      >
         <a-select v-model="form.language" @change="handleLanguage">
-          <a-option value="zh_CN">{{ $t('sys.chinese') }}</a-option>
-          <a-option value="en">{{ $t('sys.english') }}</a-option>
+          <a-option value="zh_CN">{{ $t("sys.chinese") }}</a-option>
+          <a-option value="en">{{ $t("sys.english") }}</a-option>
         </a-select>
       </a-form-item>
       <a-form-item :label="$t('sys.animation')" :help="$t('sys.animationHelp')">
         <a-select v-model="form.animation" @change="handleAnimation">
-          <a-option value="ma-fade">{{ $t('sys.animate.fade') }}</a-option>
-          <a-option value="ma-slide-left">{{ $t('sys.animate.sliderLeft') }}</a-option>
-          <a-option value="ma-slide-right">{{ $t('sys.animate.sliderRight') }}</a-option>
-          <a-option value="ma-slide-down">{{ $t('sys.animate.sliderDown') }}</a-option>
-          <a-option value="ma-slide-up">{{ $t('sys.animate.sliderUp') }}</a-option>
+          <a-option value="ma-fade">{{ $t("sys.animate.fade") }}</a-option>
+          <a-option value="ma-slide-left">{{
+            $t("sys.animate.sliderLeft")
+          }}</a-option>
+          <a-option value="ma-slide-right">{{
+            $t("sys.animate.sliderRight")
+          }}</a-option>
+          <a-option value="ma-slide-down">{{
+            $t("sys.animate.sliderDown")
+          }}</a-option>
+          <a-option value="ma-slide-up">{{
+            $t("sys.animate.sliderUp")
+          }}</a-option>
         </a-select>
       </a-form-item>
-      <a-form-item :label="$t('sys.dark')" :help="$t('sys.darkHelp')" v-if="currentSkin === 'Mine'">
+      <a-form-item
+        :label="$t('sys.dark')"
+        :help="$t('sys.darkHelp')"
+        v-if="currentSkin === 'Mine'"
+      >
         <a-switch v-model="form.mode" @change="handleSettingMode" />
       </a-form-item>
       <a-form-item :label="$t('sys.water')" :help="$t('sys.waterHelp')">
         <a-switch v-model="form.waterMark" @change="handleSettingWater" />
       </a-form-item>
       <a-form-item :label="$t('sys.waterContent')" v-if="form.waterMark">
-        <a-input v-model="form.waterContent" @blur="handleSettingWaterContent" />
+        <a-input
+          v-model="form.waterContent"
+          @blur="handleSettingWaterContent"
+        />
       </a-form-item>
       <a-form-item :label="$t('sys.tag')" :help="$t('sys.tagHelp')">
         <a-switch v-model="form.tag" @change="handleSettingTag" />
       </a-form-item>
-      <a-form-item v-if="form.layout !== 'banner'" :label="$t('sys.menuFold')" :help="$t('sys.menuFoldHelp')">
+      <a-form-item
+        v-if="form.layout !== 'banner'"
+        :label="$t('sys.menuFold')"
+        :help="$t('sys.menuFoldHelp')"
+      >
         <a-switch v-model="form.menuCollapse" @change="handleMenuCollapse" />
       </a-form-item>
-      <a-form-item v-if="form.layout !== 'banner'" :label="$t('sys.menuWidth')" :help="$t('sys.menuWidthHelp')">
-        <a-input-number v-model="form.menuWidth" mode="button" @change="handleMenuWidth" />
+      <a-form-item
+        v-if="form.layout !== 'banner'"
+        :label="$t('sys.menuWidth')"
+        :help="$t('sys.menuWidthHelp')"
+      >
+        <a-input-number
+          v-model="form.menuWidth"
+          mode="button"
+          @change="handleMenuWidth"
+        />
       </a-form-item>
     </a-form>
   </a-drawer>
@@ -87,25 +128,25 @@
 </template>
 
 <script setup>
-import { ref, reactive, watch } from 'vue'
-import { useAppStore, useUserStore } from '@/store'
-import { Message } from '@arco-design/web-vue'
-import user from '@/api/system/user'
-import Skin from './components/components/skin.vue'
-import skins from '@/config/skins'
-import { useI18n } from 'vue-i18n'
-import { ColorPicker } from 'vue-color-kit'
-import 'vue-color-kit/dist/vue-color-kit.css'
+import { ref, reactive, watch } from "vue";
+import { useAppStore, useUserStore } from "@/store";
+import { Message } from "@arco-design/web-vue";
+import user from "@/api/system/user";
+import Skin from "./components/components/skin.vue";
+import skins from "@/config/skins";
+import { useI18n } from "vue-i18n";
+import { ColorPicker } from "vue-color-kit";
+import "vue-color-kit/dist/vue-color-kit.css";
 
-const userStore = useUserStore()
-const appStore = useAppStore()
-const { t } = useI18n()
+const userStore = useUserStore();
+const appStore = useAppStore();
+const { t } = useI18n();
 
-const skin = ref(null)
-const visible = ref(false)
-const currentSkin = ref('')
+const skin = ref(null);
+const visible = ref(false);
+const currentSkin = ref("");
 const form = reactive({
-  mode: appStore.mode === 'dark',
+  mode: appStore.mode === "dark",
   tag: appStore.tag,
   menuCollapse: appStore.menuCollapse,
   menuWidth: appStore.menuWidth,
@@ -117,64 +158,64 @@ const form = reactive({
   waterContent: appStore.waterContent,
   ws: appStore.ws,
   roundOpen: appStore.roundOpen,
-})
+});
 
 const defaultColorList = reactive([
-  '#165DFF',
-  '#7166f0',
-  '#e84a6c',
-  '#efbd48',
-  '#0bd092',
-  '#bb1b1b',
-  '#0d9496',
-  '#18181b',
+  "#165DFF",
+  "#7166f0",
+  "#e84a6c",
+  "#efbd48",
+  "#0bd092",
+  "#bb1b1b",
+  "#0d9496",
+  "#18181b",
 
-  '#0960be',
-  '#4e69fd',
-  '#f5319d',
-  '#c1420b',
-  '#43a047',
-  '#f53f3f',
-  '#344256',
-  '#3f3f46',
-])
+  "#0960be",
+  "#4e69fd",
+  "#f5319d",
+  "#c1420b",
+  "#43a047",
+  "#f53f3f",
+  "#344256",
+  "#3f3f46",
+]);
 const changeColor = (color) => {
-  appStore.changeColor(color.hex)
-}
+  appStore.changeColor(color.hex);
+};
 
 skins.map((item) => {
-  if (item.name === appStore.skin) currentSkin.value = t('skin.' + item.name)
-})
+  if (item.name === appStore.skin) currentSkin.value = t("skin." + item.name);
+});
 
 watch(
   () => appStore.skin,
   (v) => {
     skins.map((item) => {
-      if (item.name === v) currentSkin.value = t('skin.' + item.name)
-    })
+      if (item.name === v) currentSkin.value = t("skin." + item.name);
+    });
   }
-)
+);
 
-const open = () => (visible.value = true)
-const close = () => (visible.value = false)
+const open = () => (visible.value = true);
+const close = () => (visible.value = false);
 
-const handleLayout = (val) => appStore.changeLayout(val)
-const handleI18n = (val) => appStore.toggleI18n(val)
-const handleWs = (val) => appStore.toggleWs(val)
-const handleRound = (val) => appStore.toggleRound(val)
-const handleLanguage = (val) => appStore.changeLanguage(val)
-const handleAnimation = (val) => appStore.changeAnimation(val)
-const handleSettingMode = (val) => appStore.toggleMode(val ? 'dark' : 'light')
-const handleSettingWater = (val) => appStore.toggleWater(val)
-const handleSettingWaterContent = (val) => appStore.changeWaterContent(val)
-const handleSettingTag = (val) => appStore.toggleTag(val)
-const handleMenuCollapse = (val) => appStore.toggleMenu(val)
-const handleMenuWidth = (val) => appStore.changeMenuWidth(val)
+const handleLayout = (val) => appStore.changeLayout(val);
+const handleI18n = (val) => appStore.toggleI18n(val);
+const handleWs = (val) => appStore.toggleWs(val);
+const handleRound = (val) => appStore.toggleRound(val);
+const handleLanguage = (val) => appStore.changeLanguage(val);
+const handleAnimation = (val) => appStore.changeAnimation(val);
+const handleSettingMode = (val) => appStore.toggleMode(val ? "dark" : "light");
+const handleSettingWater = (val) => appStore.toggleWater(val);
+const handleSettingWaterContent = (val) => appStore.changeWaterContent(val);
+const handleSettingTag = (val) => appStore.toggleTag(val);
+const handleMenuCollapse = (val) => appStore.toggleMenu(val);
+const handleMenuWidth = (val) => appStore.changeMenuWidth(val);
 
 watch(
   () => appStore.menuCollapse,
   (val) => (form.menuCollapse = val)
-)
+);
 
 const save = async (done) => {
   const data = {
@@ -192,13 +233,15 @@ const save = async (done) => {
     waterContent: appStore.waterContent,
     ws: appStore.ws,
     roundOpen: appStore.roundOpen,
-  }
+  };
 
-  user.updateInfo({ id: userStore.user.id, backend_setting: data }).then((res) => {
-    res.code === 200 && Message.success(res.message)
-  })
-  done(true)
-}
+  user
+    .updateInfo({ id: userStore.user.id, backend_setting: data })
+    .then((res) => {
+      res.code === 200 && Message.success(res.message);
+    });
+  done(true);
+};
 
-defineExpose({ open })
+defineExpose({ open });
 </script>