<template>
|
<app-page-tab v-bind="tabPageProps">
|
<template #header-button="scope" v-if="view === 'index'">
|
<el-button
|
size="small"
|
type="primary"
|
icon="Edit"
|
:disabled="!scope.selected?.edit?.id"
|
@click="onOpenForm({...scope.selected.edit})"
|
>
|
{{ $t('common.button.text.edit') }}
|
</el-button>
|
</template>
|
<template #index="scope">
|
<index-page v-bind="indexPageProps"/>
|
</template>
|
<template #form="scope">
|
<form-page v-bind="formPageProps"/>
|
</template>
|
</app-page-tab>
|
</template>
|
|
<script setup name="systemNoticeConfig">
|
import {useI18n} from 'vue-i18n';
|
|
const {t} = useI18n();
|
|
import IndexPage from './IndexPage';
|
import FormPage from './FormPage';
|
|
const router = useRouter();
|
|
const tabPageRef = ref();
|
|
const indexPageRef = ref();
|
|
const indexPageProps = {
|
ref: indexPageRef,
|
subCurrent(row) {
|
tabPageRef.value.assignSelected(row);
|
}
|
}
|
|
const onOpenForm = (row)=> {
|
indexPageRef.value.onOpenForm(row);
|
}
|
|
const formPageRef = ref();
|
|
const formPageProps = {
|
ref: formPageRef
|
}
|
|
const params = router.currentRoute.value.query;
|
|
/**
|
* index form chart
|
*/
|
const view = params.view || 'index';
|
|
const tabPageProps = {
|
ref: tabPageRef,
|
tabList: [{name: view, title: '消息配置'}],
|
};
|
|
</script>
|