提交 1353103f authored 作者: quanlili's avatar quanlili

修改复选框

上级 ea51578c
......@@ -190,7 +190,9 @@
</template>
</el-autocomplete>
<!-- @select="selectItem" -->
<el-table :data="gridData" @filter-method="filterChange" :row-key="getRowKeys" @selection-change="handleSelectionChange" ref="multipleTable">
<el-table :data="gridData" @filter-method="filterChange" :row-key="getRowKeys" @selection-change="handleSelectionChange"
@select="selectHandler"
ref="multipleTable">
<el-table-column
type="selection"
:reserve-selection="true"
......@@ -627,27 +629,6 @@ export default {
_this.$set(item, 'value', item.labelId);
_this.resourceLabel.push(item)
})
// console.log(this.gridData, '123OP')
// _this.$nextTick(function() {
// res.data.data.label.map((item, index) => {
// _this.$set(item, 'value', item.labelId);
// _this.resourceLabel.push(item)
// })
// console.log(_this.resourceLabel, 'KLlll')
// _this.resourceLabel.map(itemX => {
// console.log(itemX, "123")
// _this.gridData.map((itemY, index) => {
// console.log(itemY, 'HJHJHj')
// if (itemX.labelId == itemY.id) {
// _this.$nextTick(function () {
// // DOM 更新了
// console.log(_this.$refs.multipleTable, '123456789')
// _this.$refs.multipleTable.toggleRowSelection(_this.gridData[index], true);
// })
// }
// })
// })
// })
res.data.data.diyType.map((item, index) => {
this.$set(item, 'value', item.dtId);
this.$set(item, 'label', item.typeName);
......@@ -786,9 +767,10 @@ export default {
})
},
showLableDia () {
this.searchPageLableForm.pageNum = 1;
//this.searchPageLableForm.pageNum = 1;
console.log(this.multipleSelection,"点击选择选择资源标签")
this.getSearchPageLable();
//this.getSearchPageLable();
this.setDelData();
let _this = this;
this.dialogTableVisible = true;
if (this.$route.query.flag === 'look') {
......@@ -807,9 +789,7 @@ export default {
}
//this.setDelData();
},
handleSelectionChange (val) {
// multipleSelection
selectHandler(val,row){
val.map(item => {
this.$set(item, 'labelId', item.id)
})
......@@ -817,44 +797,21 @@ export default {
console.log(this.multipleSelection, '呵呵呵呵呵呵呵呵')
if (this.$route.query.flag === 'look') {
console.log(this.resourceLabel, "&*&*&*")
//val.length = 0;
//this.multipleSelection = this.resourceLabel;
// this.multipleSelection = [...this.multipleSelection, ...val];//需要去重
// //数组对象去重
// let obj = {};
// let peon = this.multipleSelection.reduce((cur,next) => {
// obj[next.labelId] ? "" : obj[next.labelId] = true && cur.push(next);
// return cur;
// },[]) //设置cur默认类型为数组,并且初始值为空的数组
// this.multipleSelection = peon;
// console.log(val, '123123ttttttttttt')
}
// let arr = [...this.multipleSelection, ...val];
// console.log(arr,123)
// //数组对象去重
// let obj = {};
// let peon = arr.reduce((cur,next) => {
// obj[next.id] ? "" : obj[next.id] = true && cur.push(next);
// return cur;
// },[]) //设置cur默认类型为数组,并且初始值为空的数组
// this.multipleSelection = peon;
// let optIdArr = [];
// this.multipleSelection.map((item, index) => {
// var obj = {
// labelId: item.id
// }
// optIdArr.push(obj)
// })
// this.formData.label = optIdArr;
}
//console.log(selection, row,'selectHandlerselectHandler')
},
handleSelectionChange (val) {
// multipleSelection
// selectAll(selection) {
// if (selection.length != 0) {
// this.multipleSelection = [...this.multipleSelection, ...selection];
// val.map(item => {
// this.$set(item, 'labelId', item.id)
// })
// this.multipleSelection = val;
// console.log(this.multipleSelection, '呵呵呵呵呵呵呵呵')
// if (this.$route.query.flag === 'look') {
// console.log(this.resourceLabel, "&*&*&*")
// }
// },
},
selectItem(selection, row) {
let ids = [];
this.resourceLabel.map(item => {
......@@ -939,7 +896,7 @@ export default {
let _this = this;
this.searchPageLableForm.pageNum = val
this.getSearchPageLable();
this.setDelData()
//this.setDelData()
console.log(_this.resourceLabel,'_this.resourceLabel_this.resourceLabel6666666');
setTimeout(() => {
......@@ -986,10 +943,10 @@ export default {
},
setDelData(){
let Vue=this;
//this.$refs.multipleTable.clearSelection();
this.resourceLabel.forEach((list,index)=>{
let ID=list.id;
let INDEX=index;
//this.$refs.multipleTable.clearSelection();
this.gridData.forEach((item2, index) => {
if (ID == item2.id) {
Vue.$nextTick(function () {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论