Commit e21500d6 authored by huangjie's avatar huangjie

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 2255d2b3 ee348886
<template>
<div class="table-list-com-ins" :class="{'is-empty-table' : !tableDataTotal}">
<div class="table-list-com-ins" :class="{'is-empty-table' : !tableDataTotal,'no-pagination' : !hasQueryParams}">
<div class="table-item">
<el-table v-if="tableDataTotal>0" class="fixed-table" :class="headerFixed ? 'headerFixed':''" v-loading="tableLoading" :data="tableData"
element-loading-text="Loading" ref="tableRef" border fit highlight-current-row :default-sort="defaultSort?defaultSort:{}"
......@@ -9,7 +9,7 @@
:fixed="needSelection.fixed" :align="needSelection.align" :show-overflow-tooltip="needSelection.showOverflowTooltip">
</el-table-column>
<el-table-column type="index" v-if="isIndex" label="序号" :width="flexWidth(tableData)" align="left" :fixed="indexFixed" :resizable="false">
<template slot-scope="scope">{{ queryParams.pageNum * queryParams.pageSize - queryParams.pageSize + scope.$index + 1 }}</template>
<template slot-scope="scope">{{pagingHandler(hasQueryParams,queryParams,scope)}}</template>
</el-table-column>
<template v-for="(item,index) in formColum">
<template v-if="item.use !== false">
......@@ -20,8 +20,9 @@
</el-table-column>
<!-- 序号列 -->
<el-table-column v-else-if="item.type == 'index'" type="index" :key="item.uid ? item.uid : index" :label="item.label ? item.label : '序号'"
:width="flexWidth(tableData)" :align="item.align?item.align:'left'" :fixed="item.fixed" :resizable="false">
<template slot-scope="scope">{{ queryParams.pageNum * queryParams.pageSize - queryParams.pageSize + scope.$index + 1 }}</template>
:width="flexWidth(tableData,item.width)" :min-width="item.minWidth" :align="item.align?item.align:'left'" :fixed="item.fixed"
:resizable="false">
<template slot-scope="scope">{{pagingHandler(hasQueryParams,queryParams,scope)}}</template>
</el-table-column>
<!-- 普通列 -->
<el-table-column v-else :key="item.uid ? item.uid : index" :label="item.label" :prop="item.prop" :width="item.width"
......@@ -63,7 +64,7 @@
</div>
</div>
<div class="pagination-box" v-if="show_page && tableDataTotal>queryParams.pageSize">
<div class="pagination-box" v-if="show_page && hasQueryParams && tableDataTotal>queryParams.pageSize">
<el-pagination background :current-page="current_page" :page-size="queryParams.pageSize" :total="tableDataTotal"
layout="prev, pager, next, jumper" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
</div>
......@@ -169,12 +170,26 @@ export default {
return {
current_page: this.queryParams.pageNum,
show_page: this.paging,
comMaxHeight: null
comMaxHeight: null,
hasQueryParams: false
};
},
watch: {
'queryParams.pageNum'(newVal, oldVal) {
this.current_page = newVal;
},
queryParams: {
handler(newValue) {
const _temp = newValue ? newValue : {};
const keys = Object.keys(_temp);
if (keys.length) {
this.hasQueryParams = true;
} else {
this.hasQueryParams = false;
}
},
immediate: true,
deep: true
}
},
created() {
......@@ -196,6 +211,14 @@ export default {
}
},
pagingHandler(hasQueryParams, queryParams, scope) {
// 有分页参数
if (hasQueryParams) {
return queryParams.pageNum * queryParams.pageSize - queryParams.pageSize + scope.$index + 1;
}
// 不分页
return scope.$index + 1;
},
handleCurrentChange(e) {
if (this.MaxPage < e) {
this.show_page = false;
......@@ -217,12 +240,12 @@ export default {
selectionChange(selectionArray) {
this.$emit("selectionChange", selectionArray);
},
flexWidth(tableData) {
let currentMax = this.queryParams.pageNum * this.queryParams.pageSize - this.queryParams.pageSize + tableData.length, wdth = 50;
flexWidth(tableData, width = 50) {
let currentMax = this.queryParams.pageNum * this.queryParams.pageSize - this.queryParams.pageSize + tableData.length;
if (currentMax.toString().length > 3) {
wdth = wdth + (currentMax.toString().length - 3) * 10;
width = width + (currentMax.toString().length - 3) * 10;
}
return wdth + 'px';
return width + 'px';
}
}
}
......@@ -236,6 +259,12 @@ export default {
height: 100%;
}
}
&.no-pagination {
::v-deep .table-item {
max-height: 100%;
}
}
::v-deep .table-item {
width: 100%;
max-height: calc(100% - 40px);
......
......@@ -36,7 +36,8 @@
<!-- 数据列表部分 -->
<div class="project-feedsummary-list-container">
<dsk-skeleton v-if="tableLoading"></dsk-skeleton>
<table-list-com :tableData="tableDataList" v-else-if="!tableLoading" :tableDataTotal="total" :paging="false"></table-list-com>
<table-list-com :tableData="tableDataList" :formColum="formColum" v-else-if="!tableLoading" :maxHeight="true" :tableDataTotal="total"
:paging="false"></table-list-com>
</div>
</div>
</div>
......@@ -100,7 +101,15 @@ export default {
total: 0,
// 列表表头
formColum: [
{ label: '序号', prop: "staticSerialNumber", type: "index", lock: true, fixed: false, uid: v4() },
{ label: '序号', prop: "staticSerialNumber", type: "index", lock: true, width: "52", fixed: false, uid: v4() },
{ label: '成本科目', prop: "cbSubjectName", width: "137", uid: v4() },
{ label: '公司编码', prop: "companyNo", width: "137", uid: v4() },
{ label: '集团编码', prop: "orgNo", width: "137", uid: v4() },
{ label: '名称', prop: "cbName", width: "232", uid: v4() },
{ label: '工作内容', prop: "jobContent", width: "341", uid: v4() },
{ label: '计算规则', prop: "calculationRule", width: "137", uid: v4() },
{ label: '单位', prop: "unit", width: "57", uid: v4() },
{ label: '甲供材料说明', prop: "materialDescription", width: "137", uid: v4() },
],
// 已记录月份集合
monthList: [],
......@@ -386,6 +395,11 @@ export default {
.project-feedsummary-list-container {
width: 100%;
height: calc(100% - 48px);
/* overflow: auto; */
.table-list-com-ins {
height: 100%;
}
}
}
}
......
......@@ -164,7 +164,11 @@ export default {
try {
this.tabsDisabled = true;
const { query } = this.$route;
// if (!query.projectId) return this.$message.error("缺少项目id");
// if (!query.projectId) {
// this.$message.error("缺少项目id");
// this.tabsDisabled = true;
// return;
// };
this.projectId = query.projectId;
// 获取详情 保证详情获取完毕 再执行tab命中 进行生命周期
await this.getProjectDetail(query.projectId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment