Quellcode durchsuchen

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh vor 3 Monaten
Ursprung
Commit
87dae1b35c

+ 20 - 1
src/design/theme.less

@@ -1,4 +1,9 @@
+@import './themify/dark.less';
+@import './themify/light.less';
+@import './themify/vent1.less';
+
 @ventSpace: zxm;
+
 .bg-white {
   background-color: @component-background !important;
 }
@@ -7,22 +12,27 @@ html[data-theme='light'] {
   .text-secondary {
     color: rgba(0, 0, 0, 0.45);
   }
+
   /*【美化】自定义table字体颜色*/
   .@{ventSpace}-table {
     color: rgba(0, 0, 0, 0.65);
   }
+
   /*【美化】自定义table字体颜色*/
   /*【美化】自定义form字体颜色*/
   .@{ventSpace}-select-multiple .@{ventSpace}-select-selection-item-content {
     color: rgba(0, 0, 0, 0.65);
   }
-  .@{ventSpace}-input-affix-wrapper > input.@{ventSpace}-input {
+
+  .@{ventSpace}-input-affix-wrapper>input.@{ventSpace}-input {
     color: rgba(0, 0, 0, 0.65);
   }
+
   .@{ventSpace}-select-single.@{ventSpace}-select-show-arrow .@{ventSpace}-select-selection-item,
   .@{ventSpace}-select-single.@{ventSpace}-select-show-arrow .@{ventSpace}-select-selection-placeholder {
     color: rgba(0, 0, 0, 0.65);
   }
+
   /*【美化】自定义form字体颜色*/
 
   .@{ventSpace}-alert-success {
@@ -39,6 +49,7 @@ html[data-theme='light'] {
     background-color: #fffbe6;
     border: 1px solid #ffe58f;
   }
+
   :not(:root):fullscreen::backdrop {
     background-color: @layout-body-background !important;
   }
@@ -65,3 +76,11 @@ html[data-theme='light'] {
     color: rgba(0, 0, 0, 0.9);
   }
 }
+
+// 下面的代码负责将 themify 文件夹下声明的 css 变量赋给 less 变量
+@themify-text-primary: var(--themify-text-primary);
+
+// 下面的代码负责将主题相关的选择器、图片前缀等 less 变量声明
+@theme-dark: ~"html[data-theme='dark2']";
+@theme-light: ~"html[data-theme='light']";
+@theme-vent1: ~"html[data-theme='vent1']";

+ 3 - 0
src/design/themify/dark.less

@@ -0,0 +1,3 @@
+html[data-theme='dark2'] {
+    --themify-text-primary: #ddd;
+}

+ 3 - 0
src/design/themify/light.less

@@ -0,0 +1,3 @@
+html[data-theme='light'] {
+    --themify-text-primary: #333;
+}

+ 3 - 0
src/design/themify/vent1.less

@@ -0,0 +1,3 @@
+html[data-theme='vent1'] {
+    --themify-text-primary: #fff;
+}

+ 2 - 2
src/layouts/default/header/components/user-dropdown/ThemeSelect.vue

@@ -1,6 +1,6 @@
 <template>
-  <BasicModal v-bind="config" title="切换主题" v-model:visible="visible" wrapClassName="themeSelectModal">
-    <a-radio-group v-model:value="themeSelected" name="radioGroup" @change="change">
+  <BasicModal v-bind="config" title="切换主题" v-model:visible="visible" style="padding: 0 10px">
+    <a-radio-group v-model:value="themeSelected" @change="change">
       <a-radio v-for="item in options" :key="item.value" :value="item.value">{{ item.label }}</a-radio>
     </a-radio-group>
   </BasicModal>

+ 2 - 2
src/logics/theme/dark.ts

@@ -1,7 +1,7 @@
 import { darkCssIsReady, loadDarkThemeCss } from '@rys-fe/vite-plugin-theme/es/client';
 import { addClass, hasClass, removeClass } from '/@/utils/domUtils';
 
-export async function updateDarkTheme(mode: string | null = 'light') {
+export async function updateDarkTheme(mode: string = 'light') {
   const htmlRoot = document.getElementById('htmlRoot');
   if (!htmlRoot) {
     return;
@@ -16,7 +16,7 @@ export async function updateDarkTheme(mode: string | null = 'light') {
       addClass(htmlRoot, 'dark');
     }
   } else {
-    htmlRoot.setAttribute('data-theme', 'light');
+    htmlRoot.setAttribute('data-theme', mode);
     if (hasDarkClass) {
       removeClass(htmlRoot, 'dark');
     }

+ 11 - 0
src/views/sys/login/Login.vue

@@ -45,6 +45,7 @@
   handleBackLogin();
 </script>
 <style lang="less" scoped>
+  @import '/@/design/theme.less';
   @prefix-cls: ~'@{namespace}-login';
   @logo-prefix-cls: ~'@{namespace}-app-logo';
   @countdown-prefix-cls: ~'@{namespace}-countdown-input';
@@ -84,7 +85,17 @@
     }
   }
 
+  @{theme-dark} {
+    .login-container {
+      background: #021632;
+      &::before {
+        background-image: none;
+      }
+    }
+  }
+
   .login-container {
+    color: @themify-text-primary;
     width: 100vw;
     height: 100%;
     background: linear-gradient(to bottom, #000c37, #001e63);

+ 1 - 1
src/views/vent/deviceManager/configurationTable/configuration.data.ts

@@ -106,7 +106,7 @@ export const formSchema: FormSchema[] = [
     label: '原始预设名称',
     field: 'desc',
     component: 'Select',
-    required: true,
+    required: false,
     componentProps: {
       options: ModulePresetOptions,
     },

+ 1 - 1
src/views/vent/home/configurable/configurable.data.ts

@@ -615,7 +615,7 @@ export const testConfigDust: Config[] = [
     },
     showStyle: {
       size: 'width:450px;height:860px;',
-      version: '保德',
+      version: '新版',
       position: 'top:60px;left:0;',
     },
   },