提交 5df3ec52 authored 作者: Ras's avatar Ras

日志筛选修改

上级 08ea8979
...@@ -4,23 +4,13 @@ import { request } from "../config"; ...@@ -4,23 +4,13 @@ import { request } from "../config";
export function getQueryxyunLog( export function getQueryxyunLog(
pageNo?: number, pageNo?: number,
pageSize?: number, pageSize?: number,
flag?: number,
name?: string,
dateFrom?: string,
dateTo?: string,
content?: string
) { ) {
return request({ return request({
url: "/api/log/list", url: "/api/log/list",
method: "get", method: "get",
params: { params: {
pageNo: pageNo, pageNo,
pageSize: pageSize, pageSize,
name: name,
dateTo: dateTo,
dateFrom: dateFrom,
flag: flag,
content: content,
}, },
}); });
} }
...@@ -31,18 +21,12 @@ export function getQueryxyunLog1( ...@@ -31,18 +21,12 @@ export function getQueryxyunLog1(
dateFrom?: string, dateFrom?: string,
dateTo?: string, dateTo?: string,
name?: string, name?: string,
content?: string content?: string,
flag?: any
) { ) {
return request({ return request({
url: "/api/log/list", url: "/api/log/list",
method: "get", method: "get",
params: { pageNo, pageSize, dateFrom, dateTo, name, content }, params: { pageNo, pageSize, dateFrom, dateTo, name, content, flag },
});
}
export function getQueryxyunLog2(pageNo?: any, pageSize?: any, flag?: any) {
return request({
url: "/api/log/list",
method: "get",
params: { pageNo, pageSize, flag },
}); });
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
style="width: 100%; margin-bottom: 20px" style="width: 100%; margin-bottom: 20px"
row-key="id" row-key="id"
border border
v-loading="loading"
setScrollLeft="left" setScrollLeft="left"
> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
...@@ -138,6 +139,7 @@ import { ...@@ -138,6 +139,7 @@ import {
const tableRelationRef = ref<FormInstance>(); const tableRelationRef = ref<FormInstance>();
const tableRelationList = ref([]); const tableRelationList = ref([]);
const loading = ref(true)
const currentPage = ref(1); const currentPage = ref(1);
const pageSizes = ref(10); const pageSizes = ref(10);
const total = ref(0); const total = ref(0);
...@@ -158,7 +160,7 @@ const init = (val?: number, pageSize?: number) => { ...@@ -158,7 +160,7 @@ const init = (val?: number, pageSize?: number) => {
getTableRelation(currentPage.value, pageSizes.value).then((res: any) => { getTableRelation(currentPage.value, pageSizes.value).then((res: any) => {
tableRelationList.value = res.data.records; tableRelationList.value = res.data.records;
total.value = res.data.total; total.value = res.data.total;
console.log(res); loading.value = false
console.log("表关系数据", tableRelationList.value); console.log("表关系数据", tableRelationList.value);
}); });
}; };
......
<template>
<div class="router">
<Form></Form>
</div>
</template>
<script setup lang="ts">
import Form from '@/components/form/MyForm.vue'
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -236,19 +236,36 @@ const visible = ref(false); ...@@ -236,19 +236,36 @@ const visible = ref(false);
const multipleSelection = ref<List[]>([]); const multipleSelection = ref<List[]>([]);
// 分页 // 分页
const disabled = ref(false); const disabled = ref(false);
const filters = ref();
const { tableList, total, loading, pageSize, currentPage } = const { tableList, total, loading, pageSize, currentPage } =
useXyunLogTableList(); useXyunLogTableList();
// 同步筛选 // 同步筛选
const filterChange = (filters: any) => { const filterChange = (value: any) => {
nextTick(() => { nextTick(() => {
const flag = filters["el-table_1_column_2"][0]; const flag = value["el-table_1_column_2"][0];
getQueryxyunLog2(currentPage.value, pageSize.value, flag).then( filters.value = flag;
(res: any) => { // getQueryxyunLog2(currentPage.value, pageSize.value, flag).then(
// (res: any) => {
// tableList.value = res.data.records;
// total.value = res.data.total;
// }
// );
getQueryxyunLog1(
currentPage.value,
pageSize.value,
filterForm.value.dateFrom,
filterForm.value.dateTo,
filterForm.value.name,
filterForm.value.content,
filters.value
).then((res: any) => {
if (res.code === 200) {
tableList.value = res.data.records; tableList.value = res.data.records;
total.value = res.data.total; total.value = res.data.total;
filterForm.value.dateFrom = "";
filterForm.value.dateTo = "";
} }
); });
}); });
}; };
const dateChange = (value: any) => { const dateChange = (value: any) => {
...@@ -280,7 +297,8 @@ const handleScreen = () => { ...@@ -280,7 +297,8 @@ const handleScreen = () => {
filterForm.value.dateFrom, filterForm.value.dateFrom,
filterForm.value.dateTo, filterForm.value.dateTo,
filterForm.value.name, filterForm.value.name,
filterForm.value.content filterForm.value.content,
filters.value
).then((res: any) => { ).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
tableList.value = res.data.records; tableList.value = res.data.records;
...@@ -292,20 +310,19 @@ const handleScreen = () => { ...@@ -292,20 +310,19 @@ const handleScreen = () => {
}; };
// 筛选 // 筛选
const page = ( const page = (
val: any, pageNo: any,
currentPage?: any, pageSize?: any,
name?: any,
dateTo?: any,
dateFrom?: any,
content?: any,
flag?: any
) => { ) => {
getQueryxyunLog(val, currentPage, name, dateTo, dateFrom, content, flag).then( filterForm.value.content,
(res) => { getQueryxyunLog(
tableList.value = res.data.records; pageNo,
total.value = res.data.total; pageSize,
} ).then((res: any) => {
); if (res.code === 200) {
tableList.value = res.data.records;
total.value = res.data.total;
}
});
}; };
// 每页新条数 // 每页新条数
const handleSizeChange = (val: number) => { const handleSizeChange = (val: number) => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论