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) => {
return http.get(BASEURL + `/xmgl/systemUser/getToDoItems`, params);
return http.post(BASEURL + `/xmgl/systemUser/getToDoItems`, params);
};

View File

@ -67,7 +67,7 @@
<!-- other 循环递归 -->
<TableColumn v-if="!item.type && item.prop && item.isShow" :column="item">
<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>
</TableColumn>
</template>

View File

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