Skip to content

Commit 10a3587

Browse files
fix: optimization
* fix: Style optimization * perf: SCAN login setting views Style optimization * fix: markdown preview i18n --------- Co-authored-by: wangdan-fit2cloud <[email protected]>
1 parent d31fed9 commit 10a3587

File tree

9 files changed

+38
-63
lines changed

9 files changed

+38
-63
lines changed
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
<template>
2-
<MdPreview noIconfont noPrettier :codeFoldable="false" v-bind="$attrs" />
2+
<MdPreview :language="language" noIconfont noPrettier :codeFoldable="false" v-bind="$attrs" />
33
</template>
44

55
<script setup lang="ts">
6-
import { MdPreview } from 'md-editor-v3'
6+
import { computed } from 'vue'
7+
import { MdPreview, config } from 'md-editor-v3'
8+
import { getBrowserLang } from '@/locales/index'
9+
import useStore from '@/stores'
10+
// 引入公共库中的语言配置
11+
import ZH_TW from '@vavt/cm-extension/dist/locale/zh-TW'
12+
713
defineOptions({ name: 'MdPreview' })
14+
const { user } = useStore()
15+
const language = computed(() => user.getLanguage() || getBrowserLang() || '')
16+
config({
17+
editorConfig: {
18+
languageUserDefined: {
19+
'zh-Hant': ZH_TW
20+
}
21+
}
22+
})
823
</script>

ui/src/locales/lang/en-US/views/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
permissionType: {
5454
label: 'Permission',
5555
privateDesc: 'Only the current user can use',
56-
publicDesc: 'All users can use, but can not be edited',
56+
publicDesc: 'All users can use',
5757
requiredMessage: 'Permission cannot be empty'
5858
},
5959
model_type: {

ui/src/locales/lang/zh-CN/views/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
permissionType: {
5454
label: '权限',
5555
privateDesc: '仅当前用户使用',
56-
publicDesc: '所有用户都可使用,不能编辑',
56+
publicDesc: '所有用户都可使用',
5757
requiredMessage: '权限不能为空'
5858
},
5959
model_type: {

ui/src/locales/lang/zh-Hant/views/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
permissionType: {
5454
label: '權限',
5555
privateDesc: '僅當前使用者使用',
56-
publicDesc: '所有使用者都可使用,但不能編輯',
56+
publicDesc: '所有使用者都可使用',
5757
requiredMessage: '權限不能為空'
5858
},
5959
model_type: {

ui/src/views/application-overview/component/DisplaySettingDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<span>{{
1111
$t('views.applicationOverview.appInfo.SettingDisplayDialog.languageLabel')
1212
}}</span>
13-
<el-select v-model="form.language">
13+
<el-select v-model="form.language" clearable>
1414
<el-option
1515
v-for="item in langList"
1616
:key="item.value"

ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
/>
5151
</div>
5252

53-
<h4>
53+
<h4 class="ellipsis">
5454
{{ detail?.name || $t('views.application.applicationForm.form.appName.label') }}
5555
</h4>
5656
</div>
@@ -174,7 +174,7 @@
174174
<h5 class="mb-8">
175175
{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.languageLabel') }}
176176
</h5>
177-
<el-select v-model="form.language">
177+
<el-select v-model="form.language" clearable>
178178
<el-option
179179
v-for="item in langList"
180180
:key="item.value"
@@ -383,7 +383,7 @@ import type { FormInstance, FormRules, UploadFiles } from 'element-plus'
383383
import { isAppIcon, isWorkFlow } from '@/utils/application'
384384
import applicationXpackApi from '@/api/application-xpack'
385385
import { MsgSuccess, MsgError } from '@/utils/message'
386-
import { getBrowserLang, langList, t } from '@/locales'
386+
import { langList, t } from '@/locales'
387387
import useStore from '@/stores'
388388
import { cloneDeep } from 'lodash'
389389
@@ -398,7 +398,7 @@ const emit = defineEmits(['refresh'])
398398
399399
const defaultSetting = {
400400
show_source: false,
401-
language: getBrowserLang(),
401+
language: '',
402402
show_history: true,
403403
draggable: true,
404404
show_guide: true,
@@ -427,7 +427,7 @@ const form = ref<any>({
427427
428428
const xpackForm = ref<any>({
429429
show_source: false,
430-
language: getBrowserLang(),
430+
language: '',
431431
show_history: false,
432432
draggable: false,
433433
show_guide: false,

ui/src/views/authentication/component/EditModal.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ template
99
>
1010
<template #header>
1111
<div class="flex align-center" style="margin-left: -8px">
12-
<h4>{{ currentPlatform.name + ' ' + $t('common.setting') }}</h4>
12+
<h4>{{ currentPlatform.name }}</h4>
1313
</div>
1414
</template>
1515

@@ -225,5 +225,4 @@ function saveConfig() {
225225
</script>
226226

227227
<style lang="scss" scoped>
228-
// 保持原有的样式
229228
</style>

ui/src/views/authentication/component/SCAN.vue

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<div v-loading="loading">
3-
<el-card shadow="hover" class="border-none cursor" style="--el-card-padding: 16px 24px">
2+
<div v-loading="loading" class="scan-height">
3+
<el-scrollbar>
44
<div v-for="item in platforms" :key="item.key" class="mb-16">
5-
<el-card class="mb-16" shadow="hover" style="--el-card-padding: 16px">
5+
<el-card class="border-none mb-16" shadow="none">
66
<div class="flex-between">
7-
<div class="flex align-center ml-8 mr-8">
8-
<img :src="item.logoSrc" alt="" class="icon" />
9-
<h5 style="margin-left: 8px">{{ item.name }}</h5>
10-
<el-tag v-if="item.isValid" type="success" class="ml-4"
7+
<div class="flex align-center">
8+
<img :src="item.logoSrc" alt="" width="24px" />
9+
<h5 class="ml-8">{{ item.name }}</h5>
10+
<el-tag v-if="item.isValid" type="success" class="ml-8"
1111
>{{ $t('views.system.authentication.scanTheQRCode.effective') }}
1212
</el-tag>
1313
</div>
@@ -81,7 +81,7 @@
8181
</el-card>
8282
</div>
8383
<EditModel ref="EditModelRef" @refresh="refresh" />
84-
</el-card>
84+
</el-scrollbar>
8585
</div>
8686
</template>
8787

@@ -230,46 +230,7 @@ function showDialog(platform: Platform) {
230230
</script>
231231

232232
<style lang="scss" scoped>
233-
.icon {
234-
width: 24px;
235-
height: 24px;
236-
}
237-
238-
.flex-between {
239-
display: flex;
240-
justify-content: space-between;
241-
align-items: center;
242-
}
243-
244-
.flex {
245-
display: flex;
246-
}
247-
248-
.align-center {
249-
align-items: center;
250-
}
251-
252-
.ml-4 {
253-
margin-left: 4px;
254-
}
255-
256-
.ml-8 {
257-
margin-left: 8px;
258-
}
259-
260-
.mr-8 {
261-
margin-right: 8px;
262-
}
263-
264-
.mb-16 {
265-
margin-bottom: 16px;
266-
}
267-
268-
.border-t {
269-
border-top: 1px solid #ebeef5;
270-
}
271-
272-
.vertical-middle {
273-
vertical-align: middle;
233+
.scan-height {
234+
height: calc(100vh - var(--app-header-height) - var(--app-view-padding) * 2 - 70px);
274235
}
275236
</style>

ui/src/views/authentication/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="authentication-setting p-16-24">
33
<h4>{{ $t('views.system.authentication.title') }}</h4>
4-
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
4+
<el-tabs v-model="activeName" class="mt-4" @tab-click="handleClick">
55
<template v-for="(item, index) in tabList" :key="index">
66
<el-tab-pane :label="item.label" :name="item.name">
77
<component :is="item.component" />

0 commit comments

Comments
 (0)