|
@@ -56,7 +56,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {getInfoListFn} from "@/api/mine/case.js"
|
|
|
- import zbTable from "@/work/components/zb-table/zb-tables.vue"
|
|
|
+ import zbTable from "@/work/components/zb-table/zb-tablesearch.vue"
|
|
|
export default {
|
|
|
components:{zbTable},
|
|
|
data() {
|
|
@@ -90,7 +90,9 @@
|
|
|
methods: {
|
|
|
getLxFn(ite){
|
|
|
var indexNum = (this.tableData || []).findIndex((item) => item.userId === ite.userId);
|
|
|
- this.tableData[indexNum].type=ite.type
|
|
|
+ if(indexNum!=-1){
|
|
|
+ this.tableData[indexNum].type=ite.type
|
|
|
+ }
|
|
|
},
|
|
|
getDelFn(ite,idx){
|
|
|
this.checkList.splice(idx,1);
|
|
@@ -98,7 +100,7 @@
|
|
|
// console.log(indexNum)
|
|
|
// this.tableData[indexNum].checked=false;
|
|
|
},
|
|
|
- toggleRowSelection(e,data){
|
|
|
+ toggleRowSelection(e,data,item){
|
|
|
this.checkList=JSON.parse(JSON.stringify(data))
|
|
|
},
|
|
|
getConfirm(){
|
|
@@ -107,21 +109,25 @@
|
|
|
toggleAllSelection(e){
|
|
|
},
|
|
|
init(){
|
|
|
+ this.tableData=[]
|
|
|
var params={
|
|
|
name:this.title
|
|
|
}
|
|
|
getInfoListFn(params).then(res=>{
|
|
|
if(res.code==200){
|
|
|
- this.tableData=res.rows;
|
|
|
+ var tableData=res.rows;
|
|
|
+
|
|
|
var newArr=this.checkList;
|
|
|
if(newArr&&newArr.length){
|
|
|
newArr.forEach(ite=>{
|
|
|
- var indexNum = (this.tableData || []).findIndex((item) => item.userId === ite.userId);
|
|
|
- this.tableData[indexNum].checked=true
|
|
|
- this.tableData[indexNum].type=ite.type
|
|
|
+ var indexNum = (tableData || []).findIndex((item) => item.userId === ite.userId);
|
|
|
+ if(indexNum!=-1){
|
|
|
+ tableData[indexNum].checked=true
|
|
|
+ tableData[indexNum].type=ite.type
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+ this.tableData=tableData;
|
|
|
}
|
|
|
})
|
|
|
},
|