完善自定义首页设置

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

View File

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