<template>
|
<app-page-tab v-bind="tabPageProps">
|
<template #header-button="scope">
|
<el-button
|
:disabled="!scope.selected.edit?.id"
|
size="small"
|
type="danger"
|
icon="Delete"
|
@click="onDelete(scope.selected.edit)"
|
>
|
</el-button>
|
<el-button
|
size="small"
|
type="primary"
|
icon="Edit"
|
:disabled="!scope.selected.edit?.id"
|
@click="onDialog(scope.selected.edit)">
|
编辑
|
</el-button>
|
<el-button
|
icon="Plus"
|
size="small"
|
type="primary"
|
:disabled="!scope.selected.add?.parent_id"
|
@click="onDialog({parent:scope.selected.add})">
|
新增
|
</el-button>
|
</template>
|
<template #index="scope">
|
<index-page v-bind="indexTableProps"/>
|
</template>
|
</app-page-tab>
|
</template>
|
|
<script setup name="discountAgm">
|
import {useI18n} from 'vue-i18n';
|
|
const {t} = useI18n();
|
|
import IndexPage from './IndexPage';
|
|
const pageTabRef = ref();
|
|
|
const tabPageProps = {
|
ref: pageTabRef,
|
tabList: [{name: 'index', title: t('views.discount.discountAgm.title')}],
|
};
|
|
|
const indexTableRef = ref();
|
|
const indexTableProps = {
|
ref: indexTableRef,
|
subCurrent(row) {
|
pageTabRef.value.assignSelected(row);
|
},
|
};
|
|
|
const onDialog = (row) => {
|
indexTableRef.value.onDialog(row);
|
}
|
|
const onDelete = async (row) => {
|
indexTableRef.value.onDelete(row);
|
}
|
|
</script>
|