<template>
|
<app-list-wrapper v-bind="listWrapperProps">
|
<template #header-button="scope">
|
<el-button
|
icon="Plus"
|
size="small"
|
type="primary"
|
@click="onDialog({parent_id: scope.selected.id})">
|
</el-button>
|
<el-button
|
size="small"
|
type="primary"
|
icon="Edit"
|
:disabled="!scope.selected.id"
|
@click="onDialog(scope.selected)">
|
</el-button>
|
<el-button
|
size="small"
|
type="danger"
|
icon="Delete"
|
:disabled="!scope.selected.id"
|
@click="onDelete(scope.selected)"
|
>
|
</el-button>
|
</template>
|
<app-list-page v-bind="listPageProps">
|
<template #default="scope">
|
<div>
|
{{ scope.name }} {{ scope.code }}
|
</div>
|
</template>
|
</app-list-page>
|
</app-list-wrapper>
|
<group-dialog v-bind="groupDialogProps"/>
|
</template>
|
|
<script setup>
|
|
import GroupDialog from './GroupDialog';
|
import {useI18n} from 'vue-i18n';
|
|
const {t} = useI18n();
|
import {useAppStore, useEntityStore} from '@/store/modules/index.js';
|
import {modal} from "@/plugins";
|
|
const props = defineProps({
|
subActive: {
|
type: Function,
|
default: () => {
|
}
|
}
|
});
|
|
const entityStore = useEntityStore();
|
const appStore = useAppStore();
|
|
const listPageRef = ref();
|
|
const listWrapperRef = ref();
|
|
const groupDialogRef = ref();
|
|
const listWrapperProps = {
|
ref: listWrapperRef,
|
title: t('views.fee.feeModelBand.IndexPage.GroupList.title'),
|
complementHeight: 95,
|
};
|
|
const groupDialogProps = {
|
ref: groupDialogRef,
|
subReload() {
|
listPageRef.value.getTableData();
|
}
|
};
|
|
const onDialog = (row) => {
|
groupDialogRef.value.onOpen(row);
|
};
|
|
const onDelete = async (row) => {
|
await modal.confirm("是否确认删除?");
|
|
await entityStore.deleteEntity({
|
dataName: 'fee_model_band_group',
|
id: row.id
|
});
|
listPageRef.value.getTableData();
|
};
|
|
const listPageProps = {
|
subRequest: (params) => entityStore.getEntitySet({
|
dataName: 'fee_model_band_group',
|
filter: '1=1',
|
...params,
|
}),
|
subActive(active) {
|
listWrapperRef.value.setSelected(active)
|
props.subActive(active);
|
},
|
ref: listPageRef
|
};
|
|
onMounted(() => {
|
listPageRef.value.getTableData();
|
});
|
|
</script>
|