Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
80c07d6ac6
|
@ -9,7 +9,7 @@
|
|||
|
||||
<template>
|
||||
<div class="sc-form-table" ref="scFormTable">
|
||||
<el-table :data="data" ref="table" border :height="tableHeight" @select="select" @select-all="selectAll">
|
||||
<el-table :data="data" row-key="id" highlight-current-row ref="table" border :height="tableHeight" @select="select" @select-all="selectAll">
|
||||
<el-table-column v-if="canMultiple" type="selection" width="45"></el-table-column>
|
||||
<el-table-column type="index" width="50" fixed="left">
|
||||
<template #header>
|
||||
|
@ -124,7 +124,7 @@
|
|||
},
|
||||
//表格勾选事件
|
||||
select(rows, row){
|
||||
var isSelect = rows.length && rows.indexOf(row) !== -1
|
||||
var isSelect = rows.length && rows.indexOf(row) !== -1&& this.defaultValue.indexOf(row) !== -1
|
||||
if(isSelect){
|
||||
this.defaultValue.push(row)
|
||||
}else{
|
||||
|
@ -147,7 +147,16 @@
|
|||
}
|
||||
this.$emit('selectAllChange', this.defaultValue);
|
||||
},
|
||||
}
|
||||
setCurrentRows(row){
|
||||
let that = this;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.table.toggleRowSelection(row, true);
|
||||
that.defaultValue.push(row)
|
||||
this.$emit('selectChange', this.defaultValue);
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: relative;left: 308px;"></el-input>
|
||||
<sc-form-table
|
||||
hideDelete
|
||||
ref="mlogbwTable"
|
||||
id="mlogbwlist"
|
||||
v-model="mlogbwlist"
|
||||
placeholder="暂无数据"
|
||||
|
@ -29,6 +30,7 @@
|
|||
:addTemplate="addTemplate"
|
||||
:tableHeight="tableHeight"
|
||||
:canMultiple = "canMultiple"
|
||||
row-key="id"
|
||||
@selectChange="selectChange"
|
||||
@selectAllChange="selectAllChange"
|
||||
@add="rowAdd"
|
||||
|
@ -487,6 +489,7 @@ export default {
|
|||
selectChange(rows){
|
||||
let that = this;
|
||||
that.selectWprList = rows;
|
||||
console.log('selectChangerows',rows);
|
||||
},
|
||||
selectAllChange(datas){
|
||||
let that = this;
|
||||
|
@ -899,6 +902,10 @@ export default {
|
|||
that.mlogbwlist.splice(index,1);
|
||||
that.wprInputText = "";
|
||||
that.mlogbwlist.unshift(obj);
|
||||
that.$nextTick(() => {
|
||||
that.$refs.mlogbwTable.setCurrentRows(obj); // 选中第一行
|
||||
})
|
||||
|
||||
if(that.setForm.cd_req_addr!==null&&that.setForm.cd_req_addr!==""&&that.setForm.cd_req_addr!==undefined){
|
||||
//执行cd_req_addr,获取检测设备的数据
|
||||
that.getEqData(0);
|
||||
|
|
Loading…
Reference in New Issue