<template>
|
<app-layout-row>
|
<app-layout-col :span="24">
|
<app-table-search
|
v-bind="searchProps"
|
/>
|
</app-layout-col>
|
<app-layout-col :span="24" :padding-top="10">
|
<app-table-pro v-bind="tableProps"/>
|
</app-layout-col>
|
</app-layout-row>
|
<log-details v-bind="logDetailsProps"/>
|
</template>
|
|
<script setup>
|
import {useEntityStore, useAppStore} from '@/store/modules';
|
import {convertFilter} from '@/utils/filter.js';
|
|
import {meta} from "@/hooks";
|
import LogDetails from "./LogDetails";
|
|
const {useMetaData} = meta;
|
|
const props = defineProps({
|
subCurrent: {
|
type: Function,
|
default: () => {
|
}
|
},
|
subParams: {
|
type: Function,
|
default: () => {
|
}
|
},
|
});
|
|
const logDetailsRef = ref();
|
|
const logDetailsProps = {
|
ref: logDetailsRef,
|
};
|
|
const tableSearchRef = ref();
|
const tableProRef = ref();
|
const entityStore = useEntityStore();
|
const appStore = useAppStore();
|
|
const [columns, filters, fields] = useMetaData(
|
'v_log_business',
|
async () => {
|
searchProps.formFields = filters;
|
tableSearchRef.value.$forceUpdate(searchProps);
|
|
tableProps.columns = columns;
|
tableProps.requestParams.search = tableSearchRef.value.formFields.getModel();
|
tableProRef.value.$forceUpdate(tableProps);
|
|
tableProRef.value.getTableData(true);
|
|
|
}
|
);
|
|
|
const tableProps = {
|
ref: tableProRef,
|
requestParams: {search: {}},
|
complementHeight: 84,
|
subRequest: async (page) => {
|
const result = await entityStore.getEntitySet({
|
dataName: "v_log_business",
|
attachMeta: false,
|
filter: convertFilter({
|
andLikeParams: tableProps.requestParams.search
|
}),
|
orderBy: page.orderBy || "create_time asc",
|
...page
|
});
|
return result;
|
},
|
subCurrent(row) {
|
props.subCurrent({edit: row});
|
},
|
title: '日志列表',
|
columns: []
|
};
|
|
const searchProps = {
|
ref: tableSearchRef,
|
formFields: [],
|
subSubmit: (params) => {
|
tableProps.requestParams.search = params;
|
tableProRef.value.getTableData(true);
|
}
|
}
|
|
const onReload = (bool) => {
|
tableProRef.value.getTableData(bool);
|
}
|
|
const onOpenDetails = (row) => {
|
logDetailsRef.value.onOpen(row);
|
}
|
|
defineExpose({
|
onReload,
|
onOpenDetails
|
});
|
|
</script>
|