<template>
|
<app-layout-row>
|
<app-layout-col :span="5">
|
<discount-tree v-bind="discountTreeProps"/>
|
</app-layout-col>
|
<app-layout-col :span="19" :padding-left="15">
|
<policy-table v-bind="policyTableProps"/>
|
</app-layout-col>
|
</app-layout-row>
|
</template>
|
|
<script setup>
|
|
import DiscountTree from './DiscountTree';
|
import PolicyTable from './PolicyTable';
|
|
const discountTreeRef = ref();
|
const policyTableRef = ref();
|
|
const props = defineProps({
|
subCurrent: {
|
type: Function,
|
default: () => {
|
}
|
}
|
});
|
|
const policyTableProps = {
|
ref: policyTableRef,
|
subCurrent(active) {
|
props.subCurrent(active);
|
}
|
}
|
|
|
const discountTreeProps = {
|
ref: discountTreeRef,
|
subActive(active) {
|
policyTableRef.value.onActive(active);
|
props.subCurrent({add: active});
|
}
|
}
|
|
|
const onDelete = async (row) => {
|
policyTableRef.value.onDelete(row);
|
};
|
|
|
const onDialog = async (row) => {
|
policyTableRef.value.onDialog(row);
|
}
|
|
defineExpose({
|
onDialog,
|
onDelete
|
});
|
|
|
</script>
|