|
10 | 10 | @change="changeThemeHandle" |
11 | 11 | > |
12 | 12 | <template v-for="(item, index) in themeList" :key="index"> |
13 | | - <el-radio-button :label="item.label" :value="item.value" /> |
| 13 | + <el-radio-button :label="item.label" :value="item.value"/> |
14 | 14 | </template> |
15 | | - <el-radio-button :label="$t('theme.custom')" value="custom" /> |
| 15 | + <el-radio-button :label="$t('theme.custom')" value="custom"/> |
16 | 16 | </el-radio-group> |
17 | 17 | <div v-if="themeRadio === 'custom'"> |
18 | 18 | <h5 class="mt-16 mb-8">{{ $t('theme.customTheme') }}</h5> |
19 | | - <el-color-picker v-model="customColor" @change="customColorHandle" /> |
| 19 | + <el-color-picker v-model="customColor" @change="customColorHandle"/> |
20 | 20 | </div> |
21 | 21 | </el-card> |
22 | 22 |
|
|
33 | 33 | <div class="theme-preview"> |
34 | 34 | <el-row :gutter="8"> |
35 | 35 | <el-col :span="16"> |
36 | | - <LoginPreview :data="themeForm" /> |
| 36 | + <LoginPreview :data="themeForm"/> |
37 | 37 | </el-col> |
38 | 38 | <el-col :span="8"> |
39 | 39 | <div class="theme-form"> |
|
56 | 56 | </el-upload> |
57 | 57 | </div> |
58 | 58 | <el-text type="info" size="small" |
59 | | - >{{ $t('theme.websiteLogoTip') }} |
| 59 | + >{{ $t('theme.websiteLogoTip') }} |
60 | 60 | </el-text> |
61 | 61 | </el-card> |
62 | 62 | <el-card shadow="never" class="mb-8"> |
|
78 | 78 | </el-upload> |
79 | 79 | </div> |
80 | 80 | <el-text type="info" size="small" |
81 | | - >{{ $t('theme.loginLogoTip') }} |
| 81 | + >{{ $t('theme.loginLogoTip') }} |
82 | 82 | </el-text> |
83 | 83 | </el-card> |
84 | 84 | <el-card shadow="never" class="mb-8"> |
|
116 | 116 | <el-input |
117 | 117 | v-model="themeForm.title" |
118 | 118 | :placeholder="$t('theme.websiteNamePlaceholder')" |
| 119 | + show-word-limit |
| 120 | + maxlength="128" |
119 | 121 | > |
120 | 122 | </el-input> |
121 | 123 | <el-text type="info" |
122 | | - >{{ $t('theme.websiteNameTip') }} |
| 124 | + >{{ $t('theme.websiteNameTip') }} |
123 | 125 | </el-text> |
124 | 126 | </el-form-item> |
125 | 127 | <el-form-item :label="$t('theme.websiteSlogan')" prop="slogan"> |
|
131 | 133 | > |
132 | 134 | </el-input> |
133 | 135 | <el-text type="info" |
134 | | - >{{ $t('theme.websiteSloganTip') }} |
| 136 | + >{{ $t('theme.websiteSloganTip') }} |
135 | 137 | </el-text> |
136 | 138 | </el-form-item> |
137 | 139 | </el-form> |
|
166 | 168 | <div class="flex-center h-full"> |
167 | 169 | <div class="app-title-container cursor"> |
168 | 170 | <div class="logo flex-center"> |
169 | | - <LogoFull height="25px" /> |
| 171 | + <LogoFull height="25px"/> |
170 | 172 | </div> |
171 | 173 | </div> |
172 | 174 | </div> |
|
204 | 206 | <el-input |
205 | 207 | v-model="themeForm.userManualUrl" |
206 | 208 | :placeholder="$t('theme.urlPlaceholder')" |
| 209 | + show-word-limit |
| 210 | + maxlength="128" |
207 | 211 | /> |
208 | 212 | </div> |
209 | 213 | </div> |
|
216 | 220 | <el-input |
217 | 221 | v-model="themeForm.forumUrl" |
218 | 222 | :placeholder="$t('theme.urlPlaceholder')" |
| 223 | + show-word-limit |
| 224 | + maxlength="128" |
219 | 225 | /> |
220 | 226 | </div> |
221 | 227 | </div> |
|
228 | 234 | <el-input |
229 | 235 | v-model="themeForm.projectUrl" |
230 | 236 | :placeholder="$t('theme.urlPlaceholder')" |
| 237 | + show-word-limit |
| 238 | + maxlength="128" |
231 | 239 | /> |
232 | 240 | </div> |
233 | 241 | </div> |
|
245 | 253 | <div class="theme-setting__operate w-full p-16-24"> |
246 | 254 | <el-button @click="resetTheme">{{ $t('theme.abandonUpdate') }}</el-button> |
247 | 255 | <el-button type="primary" @click="updateTheme(themeFormRef)" |
248 | | - v-hasPermission=" |
| 256 | + v-hasPermission=" |
249 | 257 | new ComplexPermission( |
250 | 258 | [RoleConst.ADMIN], |
251 | 259 | [PermissionConst.APPEARANCE_SETTINGS_EDIT], |
|
258 | 266 | </template> |
259 | 267 |
|
260 | 268 | <script lang="ts" setup> |
261 | | -import { ref, reactive, onMounted, computed } from 'vue' |
262 | | -import { useRouter, onBeforeRouteLeave } from 'vue-router' |
263 | | -import type { FormInstance, FormRules, UploadFiles } from 'element-plus' |
264 | | -import { cloneDeep } from 'lodash' |
| 269 | +import {ref, reactive, onMounted, computed} from 'vue' |
| 270 | +import {useRouter, onBeforeRouteLeave} from 'vue-router' |
| 271 | +import type {FormInstance, FormRules, UploadFiles} from 'element-plus' |
| 272 | +import {cloneDeep} from 'lodash' |
265 | 273 | import LoginPreview from './LoginPreview.vue' |
266 | | -import { themeList, defaultSetting, defaultPlatformSetting } from '@/utils/theme' |
| 274 | +import {themeList, defaultSetting, defaultPlatformSetting} from '@/utils/theme' |
267 | 275 | import ThemeApi from '@/api/system-settings/theme' |
268 | | -import { MsgSuccess, MsgError } from '@/utils/message' |
| 276 | +import {MsgSuccess, MsgError} from '@/utils/message' |
269 | 277 | import useStore from '@/stores' |
270 | | -import { t } from '@/locales' |
271 | | -import { PermissionConst, RoleConst } from '@/utils/permission/data' |
272 | | -import { ComplexPermission } from '@/utils/permission/type' |
| 278 | +import {t} from '@/locales' |
| 279 | +import {PermissionConst, RoleConst} from '@/utils/permission/data' |
| 280 | +import {ComplexPermission} from '@/utils/permission/type' |
273 | 281 |
|
274 | | -const { theme } = useStore() |
| 282 | +const {theme} = useStore() |
275 | 283 | const router = useRouter() |
276 | 284 |
|
277 | 285 | onBeforeRouteLeave((to, from) => { |
@@ -300,10 +308,10 @@ const customColor = ref('') |
300 | 308 |
|
301 | 309 | const rules = reactive<FormRules>({ |
302 | 310 | title: [ |
303 | | - { required: true, message: t('theme.websiteNamePlaceholder'), trigger: 'blur' }, |
| 311 | + {required: true, message: t('theme.websiteNamePlaceholder'), trigger: 'blur'}, |
304 | 312 | ], |
305 | 313 | slogan: [ |
306 | | - { required: true, message: t('theme.websiteSloganPlaceholder'), trigger: 'blur' }, |
| 314 | + {required: true, message: t('theme.websiteSloganPlaceholder'), trigger: 'blur'}, |
307 | 315 | ], |
308 | 316 | }) |
309 | 317 |
|
@@ -340,15 +348,15 @@ function resetForm(val: string) { |
340 | 348 | themeForm.value = |
341 | 349 | val === 'login' |
342 | 350 | ? { |
343 | | - ...themeForm.value, |
344 | | - theme: themeForm.value.theme, |
345 | | - ...defaultSetting, |
346 | | - } |
| 351 | + ...themeForm.value, |
| 352 | + theme: themeForm.value.theme, |
| 353 | + ...defaultSetting, |
| 354 | + } |
347 | 355 | : { |
348 | | - ...themeForm.value, |
349 | | - theme: themeForm.value.theme, |
350 | | - ...defaultPlatformSetting, |
351 | | - } |
| 356 | + ...themeForm.value, |
| 357 | + theme: themeForm.value.theme, |
| 358 | + ...defaultPlatformSetting, |
| 359 | + } |
352 | 360 |
|
353 | 361 | theme.setTheme(themeForm.value) |
354 | 362 | } |
|
0 commit comments