|
@@ -4,14 +4,15 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-button size="small" type="default" icon="el-icon-back" @click="goback"></el-button>
|
|
|
- <div style="display:inline-block;width:317px;">
|
|
|
+ <div style="display:inline-block;width:317px;margin-left:10px;">
|
|
|
<dictionary-device @change="changeDictionary" :Related="false"></dictionary-device>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="text-right">
|
|
|
- <el-switch @change="changeType" v-model="isSwitch"></el-switch>AI辅助
|
|
|
+ <el-switch @change="changeType" v-model="isSwitch"></el-switch>
|
|
|
+ <span style="padding:0 5px;">AI辅助</span>
|
|
|
<el-button size="medium" @click="showHistory" class="ani-his-plus">
|
|
|
- 本次对应记录{{num}}
|
|
|
+ 本次对应记录 {{num}}
|
|
|
<span v-if="showPlus" :class="{'plusOne':true,'startAni':showPlus}">+1</span>
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -24,8 +25,8 @@
|
|
|
<div class="query-box clearfix">
|
|
|
<div class="query-item">
|
|
|
<label>设备标识关键字</label>
|
|
|
- <el-input placeholder="请输入设备标识关键字" v-model="form.EquipmentMark" class="input-with-select">
|
|
|
- <el-button slot="append" icon="el-icon-search" @click="queryLeftTable"></el-button>
|
|
|
+ <el-input placeholder="请输入设备标识关键字" v-model="form.EquipmentMark" @keyup.enter.native="queryLeftTable">
|
|
|
+ <i slot="suffix" class="el-input__icon el-icon-search" @click="queryLeftTable"></i>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
<div class="query-item">
|
|
@@ -40,7 +41,7 @@
|
|
|
<!-- 左侧列表 -->
|
|
|
<div class="table-box">
|
|
|
<div class="l-custom-table custom-table" v-loading="lTableLoading">
|
|
|
- <el-table ref="lTableBody" :data="LtableData" tooltip-effect="dark" style="width: 100%" height="100%"
|
|
|
+ <el-table ref="lTableBody" :data="LtableData" tooltip-effect="dark" style="width: 100%" height="100%" @row-click="clickLeftRow"
|
|
|
@selection-change="leftSelectionChange">
|
|
|
<el-table-column label="数据源" align="right" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">{{ scope.row.Datasource }}</template>
|
|
@@ -48,7 +49,7 @@
|
|
|
<el-table-column prop="LocationFlag" label="位置标签" align="right" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="SubTypeName" label="设备类型关键字" align="right" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="EquipmentMark" label="设备标识" show-overflow-tooltip align="right" width="200" class-name="bgf5"></el-table-column>
|
|
|
- <el-table-column type="selection" width="35" class-name="bgf5"></el-table-column>
|
|
|
+ <el-table-column type="selection" width="45" class-name="bgf5"></el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<!-- 智能推荐 -->
|
|
@@ -77,8 +78,8 @@
|
|
|
<div class="query-box clearfix">
|
|
|
<div class="query-item">
|
|
|
<label>设备实例关键字</label>
|
|
|
- <el-input placeholder="请输入设备实例关键字" v-model="form.EquipLocalName" class="input-with-select">
|
|
|
- <el-button slot="append" icon="el-icon-search" @click="queryRightTable"></el-button>
|
|
|
+ <el-input placeholder="请输入设备实例关键字" v-model="form.EquipLocalName" @keyup.enter.native="queryRightTable">
|
|
|
+ <i slot="suffix" class="el-input__icon el-icon-search" @click="queryRightTable"></i>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
<div class="query-item">
|
|
@@ -89,9 +90,9 @@
|
|
|
<!-- 右侧列表 -->
|
|
|
<div class="table-box">
|
|
|
<div class="r-custom-table custom-table" v-loading="rTableLoading">
|
|
|
- <el-table ref="rTableBody" :data="RtableData" tooltip-effect="dark" style="width: 100%" height="100%"
|
|
|
+ <el-table ref="rTableBody" :data="RtableData" tooltip-effect="dark" style="width: 100%" height="100%" @row-click="clickRightRow"
|
|
|
@selection-change="rightSelectionChange">
|
|
|
- <el-table-column type="selection" width="35" class-name="bgf5"></el-table-column>
|
|
|
+ <el-table-column type="selection" width="45" class-name="bgf5"></el-table-column>
|
|
|
<el-table-column label="设备实例名称" width="200" class-name="bgf5" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">{{ scope.row.EquipLocalName }}</template>
|
|
|
</el-table-column>
|
|
@@ -209,6 +210,9 @@ export default {
|
|
|
if (scrollTop + windowHeight === scrollHeight) {
|
|
|
if (this.lPage.pageNumber * this.lPage.pageSize < this.lPage.total) {
|
|
|
this.lPage.pageNumber++;
|
|
|
+ if (this.LtableData.length < 50) {
|
|
|
+ this.lPage.pageNumber = 1
|
|
|
+ }
|
|
|
this.getLeftData();
|
|
|
}
|
|
|
}
|
|
@@ -226,6 +230,9 @@ export default {
|
|
|
// 获取到的不是全部数据 当滚动到底部 继续获取新的数据
|
|
|
if (this.rPage.pageNumber * this.rPage.pageSize < this.rPage.total) {
|
|
|
this.rPage.pageNumber++;
|
|
|
+ if (this.RtableData.length < 50) {
|
|
|
+ this.rPage.pageNumber = 1
|
|
|
+ }
|
|
|
this.getRightData();
|
|
|
}
|
|
|
}
|
|
@@ -239,8 +246,8 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
- this.getLeftData();
|
|
|
- this.getRightData();
|
|
|
+ this.queryLeftTable();
|
|
|
+ this.queryRightTable();
|
|
|
},
|
|
|
//切换AI辅助
|
|
|
changeType() { },
|
|
@@ -263,6 +270,8 @@ export default {
|
|
|
},
|
|
|
//重新获取数据
|
|
|
reGetData() {
|
|
|
+ //删除选中项
|
|
|
+ this.delSelectedRows(this.lArray, this.rArray);
|
|
|
let history = { leftList: this.lArray, rightList: this.rArray };
|
|
|
this.historyList.push(history); //保存本次操作记录
|
|
|
this.lArray = []; //清空选中list
|
|
@@ -272,9 +281,31 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
this.showPlus = false;
|
|
|
}, 800);
|
|
|
- //重新获取数据
|
|
|
- this.queryLeftTable();
|
|
|
- this.queryRightTable();
|
|
|
+ },
|
|
|
+ //少于20条请求数据-否则删除选中项
|
|
|
+ delSelectedRows(lArray, rArray) {
|
|
|
+ for (let i = this.LtableData.length - 1; i >= 0; i--) {
|
|
|
+ for (let j = 0; j < lArray.length; j++) {
|
|
|
+ if (this.LtableData[i].EquipmentMark == lArray[j].EquipmentMark && this.LtableData[i].SubTypeCode == lArray[j].SubTypeCode) {
|
|
|
+ this.LtableData.splice(i, 1)
|
|
|
+ continue; //结束当前本轮循环,开始新的一轮循环
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let i = this.RtableData.length - 1; i >= 0; i--) {
|
|
|
+ for (let j = 0; j < rArray.length; j++) {
|
|
|
+ if (this.RtableData[i].ObjectID == rArray[j].ObjectID && this.RtableData[i].SubTypeCode == rArray[j].SubTypeCode) {
|
|
|
+ this.RtableData.splice(i, 1)
|
|
|
+ continue; //结束当前本轮循环,开始新的一轮循环
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.LtableData.length < 20) {
|
|
|
+ this.queryLeftTable()
|
|
|
+ }
|
|
|
+ if (this.RtableData.length < 20) {
|
|
|
+ this.queryRightTable()
|
|
|
+ }
|
|
|
},
|
|
|
//表格中的选中事件
|
|
|
leftSelectionChange(selection) {
|
|
@@ -319,7 +350,7 @@ export default {
|
|
|
if (this.lPage.pageNumber == 1) {
|
|
|
this.LtableData = res.Content;
|
|
|
} else {
|
|
|
- this.LtableData.push(res.Content);
|
|
|
+ this.LtableData = this.LtableData.concat(res.Content);
|
|
|
}
|
|
|
this.lTableLoading = false;
|
|
|
});
|
|
@@ -356,7 +387,7 @@ export default {
|
|
|
if (this.rPage.pageNumber == 1) {
|
|
|
this.RtableData = res.Content;
|
|
|
} else {
|
|
|
- this.RtableData.push(res.Content);
|
|
|
+ this.RtableData = this.RtableData.concat(res.Content);
|
|
|
}
|
|
|
this.rTableLoading = false;
|
|
|
});
|
|
@@ -391,7 +422,15 @@ export default {
|
|
|
//返回
|
|
|
goback() {
|
|
|
this.$router.push({ path: '/point/dynamicdata', query: { typeName: this.typeName } })
|
|
|
- }
|
|
|
+ },
|
|
|
+ //点击行
|
|
|
+ clickLeftRow(row, column, event) {
|
|
|
+ this.$refs.lTableBody.toggleRowSelection(row);
|
|
|
+ },
|
|
|
+ //点击行
|
|
|
+ clickRightRow(row, column, event) {
|
|
|
+ this.$refs.rTableBody.toggleRowSelection(row);
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
projectId(n, o) {
|
|
@@ -487,9 +526,10 @@ export default {
|
|
|
.query-item {
|
|
|
float: left;
|
|
|
width: 30%;
|
|
|
- margin: 0 5px;
|
|
|
+ margin: 5px;
|
|
|
label {
|
|
|
display: block;
|
|
|
+ margin-bottom: 5px;
|
|
|
}
|
|
|
.el-select {
|
|
|
width: 100%;
|