fix: BUG修改

This commit is contained in:
kun 2024-03-18 17:17:49 +08:00
parent 7d6da6cafc
commit ee44870604
3 changed files with 40 additions and 19 deletions

View File

@ -450,5 +450,5 @@ export const annexFileSave = (params: any) => {
// 待办清单 // 待办清单
// 查询是否有待办事项 // 查询是否有待办事项
export const noFinishApi = (params: any) => { export const noFinishApi = (params: any) => {
return http.get(BASEURL + `/xmgl/systemUser/getToDoItems`, params); return http.post(BASEURL + `/xmgl/systemUser/getToDoItems`, params);
}; };

View File

@ -67,7 +67,7 @@
<!-- other 循环递归 --> <!-- other 循环递归 -->
<TableColumn v-if="!item.type && item.prop && item.isShow" :column="item"> <TableColumn v-if="!item.type && item.prop && item.isShow" :column="item">
<template v-for="slot in Object.keys($slots)" #[slot]="scope"> <template v-for="slot in Object.keys($slots)" #[slot]="scope">
<slot :name="slot" :row="scope.row"></slot> <slot :name="slot" :row="scope.row" :index="scope.$index"></slot>
</template> </template>
</TableColumn> </TableColumn>
</template> </template>

View File

@ -10,8 +10,11 @@
:tool-button="false" :tool-button="false"
:pagination="true" :pagination="true"
background background
:isShowSearch="false" :isShowSearch="true"
> >
<template #numIndex="{ row, index }">
{{ index + 1 + (responseData.pageNo - 1) * responseData.pageSize }}
</template>
<template #state="{ row }"> <template #state="{ row }">
{{ row.state === 3 ? "已逾期" : "待处理" }} {{ row.state === 3 ? "已逾期" : "待处理" }}
</template> </template>
@ -37,6 +40,7 @@ import { sendIframeMessage } from "@/utils/util";
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const responseData = ref();
// ProTable 便 // ProTable 便
const proTable = ref(); const proTable = ref();
@ -60,10 +64,31 @@ const handleDealItem = (obj: any) => {
// //
const columns: ColumnProps[] = [ const columns: ColumnProps[] = [
{ type: "index", label: "序号", width: 100 }, { prop: "numIndex", label: "序号", width: 100 },
{ prop: "type", label: "待办事项", width: 220 }, { prop: "type", label: "待办事项", width: 220 },
{ prop: "projectName", label: "项目名称" }, { prop: "projectName", label: "项目名称", search: { el: "input" } },
{ prop: "state", label: "状态", width: 120 }, {
prop: "state",
label: "状态",
search: { el: "select" },
enum: [
{ label: "已逾期", value: 3 },
{ label: "待处理", value: 1 }
],
width: 120
},
{
prop: "flag",
label: "类型",
isShow: false,
search: { el: "select" },
enum: [
{ label: "质量管理", value: 1 },
{ label: "安全管理", value: 2 },
{ label: "进度管理", value: 3 }
],
width: 120
},
{ prop: "operation", label: "操作", width: 120 } { prop: "operation", label: "操作", width: 120 }
]; ];
@ -76,24 +101,26 @@ const initParam = reactive({
// hooks/useTable.ts // hooks/useTable.ts
const dataCallback = (data: any) => { const dataCallback = (data: any) => {
// console.log(data); // console.log(data);
return { responseData.value = {
list: data.records, list: data.records,
total: Number(data.total), total: Number(data.total),
pageNo: Number(data.current), pageNo: Number(data.current),
pageSize: Number(data.size) pageSize: Number(data.size)
}; };
return responseData.value;
}; };
// params // params
// ProTable :requestApi="getUserList" // ProTable :requestApi="getUserList"
const getTableList = async (params: any) => { const getTableList = async (params: any) => {
let newParams = JSON.parse(JSON.stringify(params)); let newParams = JSON.parse(JSON.stringify(params));
const res: any = await noFinishApi({}); // const res: any = await noFinishApi({});
if (res && res.data && res.data.length > 0) { // if (res && res.data && res.data.length > 0) {
return { result: { records: res.data, current: "1", pages: "1", size: "100", total: res.data.length + "" } }; // return { result: { records: res.data, current: "1", pages: "1", size: "100", total: res.data.length + "" } };
} else { // } else {
return { result: { records: [], current: "1", pages: "1", size: "100", total: "0" } }; // return { result: { records: [], current: "1", pages: "1", size: "100", total: "0" } };
} // }
return noFinishApi(newParams);
}; };
onMounted(async () => { onMounted(async () => {
await sendIframeMessage({ obj: { path: route.path } }, 2, undefined); await sendIframeMessage({ obj: { path: route.path } }, 2, undefined);
@ -110,10 +137,4 @@ onMounted(async () => {
height: 700px; height: 700px;
overflow: auto; overflow: auto;
} }
:deep() {
.theme-transform,
.el-pagination {
display: none;
}
}
</style> </style>