7c53e556 by renchao@pashanhoo.com

style;单选多选

1 parent 06ea11f0
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2024-01-17 08:43:05
* @LastEditTime: 2024-01-17 11:16:21
-->
<template>
<div class="from-clues">
......@@ -369,8 +369,7 @@
that.$refs[refs].toggleRowSelection(row, true);
}
})
}
else {
} else {
this.$refs[refs].toggleRowSelection(row, true);
}
},
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 14:34:40
* @LastEditTime: 2024-01-17 13:20:17
-->
<template>
<!-- 主体权利信息查询 -->
......@@ -40,7 +40,7 @@
<!-- 表格 -->
<div class="from-clues-content loadingtext">
<lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
:current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange" @select="select"
:current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange"
@p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
......@@ -68,6 +68,7 @@
},
data () {
return {
radioVal: '',
loading: false,
queryForm: defaultParameters.defaultParameters(),
tableData: {
......@@ -80,6 +81,28 @@
},
mounted () {
sendThis(this);
if (this.sqywInfo.sqywdylx == "1") {
this.tableData.columns = [{
label: '选择',
width: '50px',
render: (h, scope) => {
return (
<div class="orgColumn">
<el-radio onChange={() => { this.handleChange(scope.row) }} v-model={this.radioVal} label={scope.row.bdcdyid}>
&ensp;
</el-radio>
</div>
)
}
}].concat(datas.columns())
} else {
this.tableData.columns =
[{
type: 'selection',
label: '全选',
width: '50'
}].concat(datas.columns())
}
},
methods: {
/**
......@@ -183,21 +206,9 @@
this.bdcdysz = val;
}
},
/**
* @description: select
* @param {*} selection
* @param {*} row
* @author: renchao
*/
select (selection, row) {
if (this.sqywInfo.sqywdylx == "1") {
// 清除 所有勾选项
this.$refs.table.clearSelection()
// 当表格数据都没有被勾选的时候 就返回
// 主要用于将当前勾选的表格状态清除
if (selection.length == 0) return
this.$refs.table.toggleRowSelection(row, true);
}
handleChange () {
let arr = this.tableData.data.filter(item => item.bdcdyid == this.radioVal)
this.bdcdysz = arr
},
/**
* @description: handleRowClick
......@@ -205,27 +216,34 @@
* @author: renchao
*/
handleRowClick (row) {
// 如果状态是1,那就是单选
// // 如果状态是1,那就是单选
// if (this.sqywInfo.sqywdylx == "1") {
// const bdcdysz = this.bdcdysz
// this.$refs.table.clearSelection()
// if (bdcdysz.length == 1) {
// bdcdysz.forEach(item => {
// // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
// if (item == row) {
// this.$refs.table.toggleRowSelection(row, false);
// }
// // 不然就让当前的一行勾选
// else {
// this.$refs.table.toggleRowSelection(row, true);
// }
// })
// }
// else {
// this.$refs.table.toggleRowSelection(row, true);
// }
// } else {
// this.$refs.table.toggleRowSelection(row);
// }
let refs = 'table';
if (this.sqywInfo.sqywdylx == "1") {
const bdcdysz = this.bdcdysz
this.$refs.table.clearSelection()
if (bdcdysz.length == 1) {
bdcdysz.forEach(item => {
// 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
if (item == row) {
this.$refs.table.toggleRowSelection(row, false);
}
// 不然就让当前的一行勾选
else {
this.$refs.table.toggleRowSelection(row, true);
}
})
}
else {
this.$refs.table.toggleRowSelection(row, true);
}
this.bdcdysz = [row]
this.radioVal = row.bdcdyid
} else {
this.$refs.table.toggleRowSelection(row);
this.$refs[refs].toggleRowSelection(row)
}
},
/**
......@@ -250,8 +268,6 @@
* @author: miaofang
*/
handleLpbClick (item) {
console.log("item", item);
console.log("this.sqywInfo", this.sqywInfo);
this.$popup('楼盘表', 'lpb/index', {
width: '85%',
formData: {
......@@ -264,7 +280,7 @@
onlyShow: false
}
})
},
}
}
}
</script>
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-16 13:59:21
* @LastEditTime: 2024-01-17 13:26:03
-->
<template>
<div class="from-clues">
......@@ -38,7 +38,7 @@
<!-- 表格 -->
<div class="from-clues-content loadingtext">
<lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
:current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange" @select="select"
:current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange"
@p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
......@@ -67,6 +67,7 @@
},
data () {
return {
radioVal: '',
loading: false,
queryForm: defaultParameters.defaultParameters(),
tableData: {
......@@ -79,6 +80,28 @@
},
mounted () {
sendThis(this);
if (this.sqywInfo.sqywdylx == "1") {
this.tableData.columns = [{
label: '选择',
width: '50px',
render: (h, scope) => {
return (
<div class="orgColumn">
<el-radio onChange={() => { this.handleChange(scope.row) }} v-model={this.radioVal} label={scope.row.bdcdyid}>
&ensp;
</el-radio>
</div>
)
}
}].concat(datas.columns())
} else {
this.tableData.columns =
[{
type: 'selection',
label: '全选',
width: '50'
}].concat(datas.columns())
}
},
methods: {
/**
......@@ -155,23 +178,10 @@
this.bdcdysz = val;
}
},
/**
* @description: select
* @param {*} selection
* @param {*} row
* @author: renchao
*/
select (selection, row) {
if (this.sqywInfo.sqywdylx == "1") {
// 清除 所有勾选项
this.$refs.table.clearSelection()
// 当表格数据都没有被勾选的时候 就返回
// 主要用于将当前勾选的表格状态清除
if (selection.length == 0) return
this.$refs.table.toggleRowSelection(row, true);
}
handleChange () {
let arr = this.tableData.data.filter(item => item.bdcdyid == this.radioVal)
this.bdcdysz = arr
},
/**
* @description: handleRowClick
* @param {*} row
......@@ -179,26 +189,33 @@
*/
handleRowClick (row) {
// 如果状态是1,那就是单选
// if (this.sqywInfo.sqywdylx == "1") {
// const bdcdysz = this.bdcdysz
// this.$refs.table.clearSelection()
// if (bdcdysz.length == 1) {
// bdcdysz.forEach(item => {
// // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
// if (item == row) {
// this.$refs.table.toggleRowSelection(row, false);
// }
// // 不然就让当前的一行勾选
// else {
// this.$refs.table.toggleRowSelection(row, true);
// }
// })
// }
// else {
// this.$refs.table.toggleRowSelection(row, true);
// }
// } else {
// this.$refs.table.toggleRowSelection(row);
// }
let refs = 'table';
if (this.sqywInfo.sqywdylx == "1") {
const bdcdysz = this.bdcdysz
this.$refs.table.clearSelection()
if (bdcdysz.length == 1) {
bdcdysz.forEach(item => {
// 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
if (item == row) {
this.$refs.table.toggleRowSelection(row, false);
}
// 不然就让当前的一行勾选
else {
this.$refs.table.toggleRowSelection(row, true);
}
})
}
else {
this.$refs.table.toggleRowSelection(row, true);
}
this.bdcdysz = [row]
this.radioVal = row.bdcdyid
} else {
this.$refs.table.toggleRowSelection(row);
this.$refs[refs].toggleRowSelection(row)
}
},
/**
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2024-01-17 09:59:04
* @LastEditTime: 2024-01-17 11:07:55
*/
import filter from '@/utils/filter.js'
let vm = null
......@@ -15,10 +15,10 @@ class data extends filter {
}
columns () {
return [
{
type: 'selection',
label: '全选',
},
// {
// type: 'selection',
// label: '全选',
// },
{
label: '序号',
type: 'index',
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-14 17:00:07
* @LastEditTime: 2024-01-17 13:24:00
*/
import filter from '@/utils/filter.js'
let vm = null
......@@ -15,11 +15,11 @@ class data extends filter {
}
columns () {
return [
{
type: 'selection',
label: '全选',
selectable: this.selected
},
// {
// type: 'selection',
// label: '全选',
// selectable: this.selected
// },
{
label: '序号',
type: 'index',
......