add 设备全参数测试数据

This commit is contained in:
lb 2023-09-07 11:24:07 +08:00
parent e2527f2e30
commit c7b32ab34e
2 changed files with 150 additions and 79 deletions

View File

@ -13,21 +13,23 @@
@headBtnClick="handleSearchBarBtnClick" /> @headBtnClick="handleSearchBarBtnClick" />
<div class="tables"> <div class="tables">
<base-table <div class="custom-table">
:key="1 + '__basetable'" <!-- <base-table
:table-props="table1.tableProps" :key="1 + '__basetable'"
:page="table1.pageNo" :table-props="table1.tableProps"
:limit="table1.pageSize" :page="table1.pageNo"
:table-data="table1.data" :limit="table1.pageSize"
@emitFun="(val) => handleEmitFun(table1, val)"></base-table> :table-data="table1.data"
<pagination @emitFun="(val) => handleEmitFun(table1, val)"></base-table>
v-show="table1.total > 0" <pagination
:total="table1.total" v-show="table1.total > 0"
:page.sync="table1.pageNo" :total="table1.total"
:limit.sync="table1.pageSize" :page.sync="table1.pageNo"
:page-size="table1.pageSize" :limit.sync="table1.pageSize"
:page-sizes="[1, 3, 5, 10, 20]" :page-size="table1.pageSize"
@pagination="(val) => getListFor(table1, val)" /> :page-sizes="[1, 3, 5, 10, 20]"
@pagination="(val) => getListFor(table1, val)" /> -->
</div>
<base-table <base-table
:key="2 + '__basetable'" :key="2 + '__basetable'"
:table-props="table2.tableProps" :table-props="table2.tableProps"
@ -95,70 +97,8 @@
<script> <script>
import LocalDataManager from './utils/local-data-manager'; import LocalDataManager from './utils/local-data-manager';
import response from './response';
const fakeTable1Data = [
{
time: 1111111111111111,
plcCode: 2,
val1: 3,
bol1: 4,
val2: 5,
bol2: 6,
},
{
time: 1,
plcCode: 22222222222222,
val1: 3,
bol1: 4,
val2: 5,
bol2: 6,
},
{
time: 1,
plcCode: 2,
val1: 33333333333333,
bol1: 4,
val2: 5,
bol2: 6,
},
{
time: 1,
plcCode: 2,
val1: 3,
bol1: 44444444444444,
val2: 5,
bol2: 6,
},
{
time: 1,
plcCode: 2,
val1: 3,
bol1: 4,
val2: 5555555555555,
bol2: 6,
},
{
time: 1,
plcCode: 2,
val1: 3,
bol1: 4,
val2: 5,
bol2: 6666666666666666666,
},
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
{ time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 },
];
const table1LDM = new LocalDataManager(fakeTable1Data, 1, 3);
export default { export default {
name: 'EquipmentFullParams', name: 'EquipmentFullParams',
@ -456,6 +396,12 @@ export default {
this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name); this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name);
}, },
methods: { methods: {
getList(dataManager, pageNo, pageSize) {
dataManager.setPageNo(pageNo);
dataManager.setPageSize(pageSize);
return { data: dataManager.dataList, total: dataManager.total };
},
/** 查询 */ /** 查询 */
async handleQuery() { async handleQuery() {
const { data } = this.$axios({ const { data } = this.$axios({

View File

@ -0,0 +1,125 @@
export default {
"code": 0,
"data": [
// 一个表格
{
"data": [
// 一行参数
{
"time": "1694056192800",
"plcCode": "PLC_CODE_1",
"data": [
// 一个参数值
{ "id": 'param-1', "parentId": 0, "dynamicName": "P1V1", "dynamicValue": 15 },
{ "id": 'param-2', "parentId": 0, "dynamicName": "P1V2", "dynamicValue": 15 },
{ "id": 'param-3', "parentId": 0, "dynamicName": "P1V3", "dynamicValue": 15 },
{ "id": 'param-4', "parentId": 0, "dynamicName": "P1V4", "dynamicValue": 15 },
{ "id": 'param-5', "parentId": 0, "dynamicName": "P1V5", "dynamicValue": 15 },
{ "id": 'param-6', "parentId": 0, "dynamicName": "P1V6", "dynamicValue": 15 },
]
}
],
"otherList": [
// 一个参数的属性
{
"id": "attr-1",
"plcParamName": "P1V1",
"name": "P1V1", // 和 dynamicName 对应
"minValue": 1,
"maxValue": 100
},
{
"id": "attr-2",
"plcParamName": "P1V2",
"name": "P1V2",
"minValue": 10,
"maxValue": 90
},
{
"id": "attr-3",
"plcParamName": "P1V3",
"name": "P1V3",
"minValue": 10,
"maxValue": 98
},
{
"id": "attr-4",
"plcParamName": "P1V4",
"name": "P1V4",
"minValue": 10,
"maxValue": 90
},
{
"id": "attr-5",
"plcParamName": "P1V5",
"name": "P1V5",
"minValue": 10,
"maxValue": 99
},
{
"id": "attr-6",
"plcParamName": "P1V6",
"name": "P1V6",
"minValue": 10,
"maxValue": 90
},
],
"nameData": [],
"otherMap": []
},
// 一个表格
{
"data": [
// 一行参数
{
"time": "1694056100800",
"plcCode": "PLC_CODE_2",
"data": [
// 一个参数值
{ "id": 'param-1', "parentId": 0, "dynamicName": "P1V1", "dynamicValue": 15 },
{ "id": 'param-2', "parentId": 0, "dynamicName": "P1V2", "dynamicValue": 15 },
{ "id": 'param-3', "parentId": 0, "dynamicName": "P1V3", "dynamicValue": 15 },
]
},
{
"time": "1694056102800",
"plcCode": "PLC_CODE_2",
"data": [
// 一个参数值
{ "id": 'param-1', "parentId": 0, "dynamicName": "P1V1", "dynamicValue": 15 },
{ "id": 'param-2', "parentId": 0, "dynamicName": "P1V2", "dynamicValue": 15 },
{ "id": 'param-3', "parentId": 0, "dynamicName": "P1V3", "dynamicValue": 15 },
]
}
],
"otherList": [
// 一个参数的属性
{
"id": "attr-1",
"plcParamName": "P1V1",
"name": "P1V1", // 和 dynamicName 对应
"minValue": 1,
"maxValue": 100
},
{
"id": "attr-2",
"plcParamName": "P1V2",
"name": "P1V2",
"minValue": 10,
"maxValue": 90
},
{
"id": "attr-3",
"plcParamName": "P1V3",
"name": "P1V3",
"minValue": 10,
"maxValue": 98
},
],
"nameData": [],
"otherMap": []
}
]
}