Переглянути джерело

1. 前端,语言代码的分隔符由"_"改为"-"。
2. 优化菜单多语言设置弹窗样式;

夜鹰 7 місяців тому
батько
коміт
c42349a5ed

+ 1 - 1
Web/src/api-services/models/add-user-input.ts

@@ -392,7 +392,7 @@ export interface AddUserInput {
     signature?: string | null;
 
     /**
-     * 语言代码(如 zh_CN)
+     * 语言代码(如 zh-CN)
      *
      * @type {string}
      * @memberof AddUserInput

+ 1 - 1
Web/src/api-services/models/sys-lang-text.ts

@@ -85,7 +85,7 @@ export interface SysLangText {
     entityName?: string | null;
 
     /**
-     * 语言代码(如 zh_CN)
+     * 语言代码(如 zh-CN)
      *
      * @type {number}
      * @memberof SysLangText

+ 1 - 1
Web/src/api-services/models/sys-lang.ts

@@ -87,7 +87,7 @@ export interface SysLang {
     name?: string | null;
 
     /**
-     * 语言代码(如 zh_CN)
+     * 语言代码(如 zh-CN)
      *
      * @type {string}
      * @memberof SysLang

+ 1 - 1
Web/src/api-services/models/sys-user.ts

@@ -407,7 +407,7 @@ export interface SysUser {
     signature?: string | null;
 
     /**
-     * 语言代码(如 zh_CN)
+     * 语言代码(如 zh-CN)
      *
      * @type {string}
      * @memberof SysUser

+ 1 - 1
Web/src/api-services/models/update-user-input.ts

@@ -392,7 +392,7 @@ export interface UpdateUserInput {
     signature?: string | null;
 
     /**
-     * 语言代码(如 zh_CN)
+     * 语言代码(如 zh-CN)
      *
      * @type {string}
      * @memberof UpdateUserInput

+ 1 - 1
Web/src/api-services/models/user-output.ts

@@ -407,7 +407,7 @@ export interface UserOutput {
     signature?: string | null;
 
     /**
-     * 语言代码(如 zh_CN)
+     * 语言代码(如 zh-CN)
      *
      * @type {string}
      * @memberof UserOutput

+ 7 - 6
Web/src/components/multiLangInput/index.vue

@@ -10,10 +10,10 @@
             </template>
         </el-input>
 
-        <el-dialog v-model="dialogVisible" title="多语言设置" width="600px">
+        <el-dialog v-model="dialogVisible" title="多语言设置" draggable :close-on-click-modal="false" width="600px">
             <el-form ref="ruleFormRef" label-width="auto">
                 <el-row :gutter="35">
-                    <el-col v-for="lang in languages" :key="lang.code" :span="24">
+                    <el-col v-for="lang in languages" :key="lang.code" :span="24" class="mb10">
                         <el-form-item :label="lang.label">
                             <el-input v-model="multiLangValue[lang.code]" :placeholder="`请输入: ${lang.label}`" clearable />
                         </el-form-item>
@@ -62,8 +62,8 @@ const langStore = useLangStore();
 const languages = ref<any>([] as any);
 
 // 当前语言(可根据用户设置或浏览器设置)
-const currentLang = ref('zh_CN');
-const activeLang = ref('zh_CN');
+const currentLang = ref('zh-CN');
+const activeLang = ref('zh-CN');
 
 // 是否弹框
 const dialogVisible = ref(false);
@@ -87,7 +87,7 @@ onMounted(async () => {
     const globalI18n = themeConfig?.globalI18n;
     if (globalI18n) {
         const matched = langStore.languages.find(l => l.code === globalI18n);
-        const langCode = matched?.code || 'zh_CN';
+        const langCode = matched?.code || 'zh-CN';
         currentLang.value = langCode;
         activeLang.value = langCode;
     }
@@ -173,8 +173,9 @@ const confirmDialog = async () => {
 };
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 .multi-lang-input {
     width: 100%;
 }
+.mb10:last-child { margin-bottom: 0 !important; }
 </style>

+ 9 - 1
Web/src/theme/element.scss

@@ -357,13 +357,21 @@
 //     line-height: normal;
 // }
 .el-dialog__header {
+    --el-dialog-title-font-size: var(--el-font-size-base);
+
 	margin-right: 0;
 	padding: 8px;
     border-radius: var(--el-dialog-border-radius) var(--el-dialog-border-radius) 0 0;
 	background: var(--el-color-primary);
+    height: 37px;
+    line-height: 21px;
+
+    .el-dialog__title {
+        color: #FFF;
+    }
 }
 .el-dialog__footer {
-	padding: 15px;
+	padding: 0 15px 15px;
 	// border-top: 1px solid var(--el-color-primary-light-7);
 }
 .el-dialog__headerbtn {