update TableHeight

This commit is contained in:
lb 2023-04-28 10:35:05 +08:00
parent 1333ac989e
commit 9ea9a632c9
2 changed files with 70 additions and 5 deletions

View File

@ -1,3 +1,26 @@
export default [ import { timeFilter } from '@/utils/filters'
] export default [
// { type: 'index', label: '序号' },
// { prop: "createTime", label: "添加时间", filter: timeFilter },
// { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent
// { prop: "stateDictValue", label: "温度", subcomponent: StateSelect },
{ prop: "code", label: "位置" },
{ prop: "temp1", label: "温度" },
{ prop: "press1", label: "窑内压力" },
{ prop: "press2", label: "车下压力" },
{ prop: "createTime", label: "时间", filter: timeFilter },
// { prop: "endTime", label: "结束时间", filter: timeFilter },
// {
// prop: "operations",
// name: "操作",
// fixed: "right",
// width: 150,
// subcomponent: TableOperaionComponent,
// options: [
// { name: "temperature", label: "烧制温度", },
// { name: "to-car-payload", label: "装载详情", icon: 'document' },
// { name: "delete", label: "删除", icon: 'delete', emitFull: true, promptField: 'code' }
// ],
// },
];

View File

@ -9,12 +9,24 @@
<div class="data-list"> <div class="data-list">
<BaseListTable <BaseListTable
v-loading="tableLoading" v-loading="tableLoading"
style="height: 85%"
:table-config="{ height: '100%' }"
:column-config="tableConfig" :column-config="tableConfig"
:table-data="dataList" :table-data="dataList"
@operate-event="handleOperate" @operate-event="handleOperate"
:current-page="page" :current-page="page"
:current-size="size" :current-size="size"
:refresh-layout-key="refreshLayoutKey" /> :refresh-layout-key="refreshLayoutKey" />
<el-pagination
class=""
style="position: absolute; bottom: 0; left: 50%; transform: translateX(-50%)"
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="page"
:page-sizes="[20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div> </div>
<div class="temp-chart"> <div class="temp-chart">
<div id="temp-chart" class="temp-chart__inner" /> <div id="temp-chart" class="temp-chart__inner" />
@ -43,6 +55,7 @@ export default {
size: 100, size: 100,
tableLoading: false, tableLoading: false,
refreshLayoutKey: 0, refreshLayoutKey: 0,
totalPage: 0,
}; };
}, },
activated() { activated() {
@ -59,7 +72,6 @@ export default {
}, },
getList() { getList() {
this.tableLoading = true; this.tableLoading = true;
this.$http this.$http
.post("/pms/kilnPosHistory/pageView", { .post("/pms/kilnPosHistory/pageView", {
page: this.page, page: this.page,
@ -68,11 +80,35 @@ export default {
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("temp dialog res", res); console.log("temp dialog res", res);
this.tableLoading = false;
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) {
this.dataList = res.data.list;
} else if (Array.isArray(res.data)) {
this.dataList = res.data;
} // else ...
} else { } else {
this.dataList.splice(0);
} }
this.dataList = [
{ id: 1, code: 1, press1: 1, press2: 1, createTime: "2023-4-21 01:00:00", temp1: 1000 },
{ id: 2, code: 2, press1: 2, press2: 2, createTime: "2023-4-21 02:00:00", temp1: 2000 },
{ id: 3, code: 3, press1: 3, press2: 3, createTime: "2023-4-21 03:00:00", temp1: 3000 },
{ id: 4, code: 4, press1: 4, press2: 4, createTime: "2023-4-21 04:00:00", temp1: 4000 },
{ id: 5, code: 5, press1: 5, press2: 5, createTime: "2023-4-21 05:00:00", temp1: 5000 },
{ id: 6, code: 6, press1: 6, press2: 6, createTime: "2023-4-21 06:00:00", temp1: 6000 },
{ id: 7, code: 7, press1: 7, press2: 7, createTime: "2023-4-21 07:00:00", temp1: 7000 },
{ id: 8, code: 8, press1: 8, press2: 8, createTime: "2023-4-21 08:00:00", temp1: 8000 },
{ id: 9, code: 9, press1: 9, press2: 9, createTime: "2023-4-21 09:00:00", temp1: 9000 },
{ id: 10, code: 10, press1: 10, press2: 10, createTime: "2023-4-21 10:00:00", temp1: 10000 },
{ id: 11, code: 11, press1: 11, press2: 11, createTime: "2023-4-21 11:00:00", temp1: 11000 },
{ id: 12, code: 12, press1: 12, press2: 12, createTime: "2023-4-21 12:00:00", temp1: 12000 },
];
}); });
}, },
drawChart() {
// dataList 线
},
handleOperate() {}, handleOperate() {},
handlePageChange(page) { handlePageChange(page) {
this.page = page; this.page = page;
@ -100,12 +136,18 @@ export default {
.data-list, .data-list,
.temp-chart { .temp-chart {
border: 1px solid #ccc; /* border: 1px solid #ccc; */
width: 45%; width: 45%;
overflow-y: auto;
position: relative;
} }
.temp-chart { .temp-chart {
flex: 1; flex: 1;
margin-left: 18px; /* margin-left: 18px; */
padding-left: 10px;
margin-left: 10px;
border-left: 1px solid #ccc;
background-color: lightblue;
} }
</style> </style>