<template>
|
<app-dialog-form
|
v-bind="dialogFormProps"
|
>
|
<app-table-list v-bind="tableListProps" v-loading="appStore.getLoading('getEntitySet')">
|
<template #table-base="scope">
|
{{ fields.base.find(e => scope.row.field_base === e.code)?.name || scope.row.field_base }}
|
</template>
|
|
<template #table-join="scope">
|
{{ dictMapCode?.filter_type[scope.row.join_type] }}
|
</template>
|
|
<template #table-target="scope">
|
{{ fields.target.find(e => scope.row.field_target === e.code)?.name || scope.row.field_target }}
|
</template>
|
|
<template #table-active="scope">
|
<app-column-tag
|
:value="scope.row?.active"
|
:valueEnum="{T:'生效',F:'失效'}"
|
:typeEnum="{T:'success',F:'danger'}"
|
/>
|
</template>
|
</app-table-list>
|
</app-dialog-form>
|
</template>
|
|
<script setup>
|
|
import {dict} from '@/hooks';
|
|
const {useDictMap} = dict;
|
|
import {useAppStore, useEntityStore} from "@/store/modules";
|
|
const entityStore = useEntityStore();
|
|
const appStore = useAppStore();
|
|
const dialogFormRef = ref();
|
|
const [_, dictMapCode] = useDictMap(['filter_type']);
|
|
const fields = reactive({
|
target: [],
|
base: []
|
})
|
|
|
const tableListRef = ref();
|
|
const tableListProps = {
|
class: 'table-class',
|
ref: tableListRef,
|
title: '匹配列表',
|
complementHeight: -1,
|
columns: [
|
{
|
type: 'slot',
|
prop: 'base',
|
label: "基础表",
|
table: {
|
width: 190
|
}
|
},
|
{
|
type: 'slot',
|
prop: 'join',
|
label: "公式",
|
table: {
|
width: 130
|
}
|
},
|
{
|
type: 'slot',
|
prop: 'target',
|
label: "匹配表",
|
table: {
|
width: 190
|
}
|
},
|
{
|
type: 'slot',
|
prop: 'remark',
|
label: "描述"
|
},
|
{
|
type: 'slot',
|
prop: 'active',
|
label: "生效",
|
table: {
|
width: 80
|
}
|
}
|
]
|
};
|
|
const init = async (row) => {
|
tableListRef.value.setTableData([]);
|
const [detail, target, base] = await Promise.all([
|
entityStore.getEntitySet({
|
dataName: "fee_joint_detail",
|
filter: `parent_id = '${row.id}'`,
|
}),
|
entityStore.getEntitySet({
|
dataName: "fee_model_band_column",
|
filter: `bandid = '${row.target_band_id}'`,
|
}),
|
entityStore.getEntitySet({
|
dataName: "fee_model_band_column",
|
filter: `bandid = '${row.base_band_id}'`,
|
}),
|
]);
|
tableListRef.value.setTableData(detail.data.entityset);
|
fields.target = target.data.entityset;
|
fields.base = base.data.entityset;
|
}
|
|
const dialogFormProps = {
|
width: 1000,
|
title: '匹配数据',
|
ref: dialogFormRef,
|
footerDom: false
|
};
|
|
const onOpen = async (row) => {
|
dialogFormRef.value.onOpen();
|
await nextTick();
|
await init(row);
|
}
|
|
defineExpose({
|
onOpen
|
});
|
|
</script>
|