完善自定义首页设置

This commit is contained in:
lai
2024-10-17 10:30:21 +08:00
parent c5c2926d99
commit 41fa214137
2 changed files with 43 additions and 15 deletions

View File

@@ -1782,10 +1782,10 @@ export default {
reset: "System Reset",
resetInstruction: "A system reset will erase all data in the current system, please proceed with caution!!!!",
resetTipContent: 'Are you sure you want to clear all data from the current system and insist on continuing?',
homeInstruction:'Set the system home page',
home: 'System home page',
homeInstruction:'Set the home page',
home: 'Home Page',
homeTip:'Do you want to submit the current interface as the system interface?',
homeSet:'System home page Settings',
homeSet:'Home Page Settings',
},
role:{
allScopeOptions:'All data permissions',

View File

@@ -39,6 +39,7 @@ function fnSave() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('views.system.setting.saveSuccess'), 3);
fnEdit(false);
} else {
message.error(res.msg, 3);
}
@@ -51,6 +52,12 @@ function fnSave() {
});
}
/**进入可编辑 */
function fnEdit(v: boolean) {
state.edite = v;
state.open = v;
}
onMounted(() => {
listMenu(toRaw({ status: 1 })).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
@@ -78,11 +85,13 @@ onMounted(() => {
<template>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24" style="margin-bottom: 30px">
<template v-if="state.edite">
<a-form-item :label="t('views.system.setting.home')">
<a-select
ref="select"
v-model:value="state.default"
style="width: 240px"
:disabled="false"
:options="state.options"
></a-select>
</a-form-item>
@@ -90,6 +99,25 @@ onMounted(() => {
<a-button type="primary" @click="fnSave">
{{ t('views.system.setting.saveSubmit') }}
</a-button>
<a-button style="margin-left: 10px" @click="fnEdit(false)">
{{ t('common.cancel') }}
</a-button>
</template>
<template v-else>
<a-form-item :label="t('views.system.setting.home')">
<a-select
ref="select"
v-model:value="state.default"
style="width: 240px"
:disabled="true"
:options="state.options"
></a-select>
</a-form-item>
<a-button type="dashed" @click="fnEdit(true)">
{{ t('common.editText') }}
</a-button>
</template>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-typography>