ops table getVxetableRef

This commit is contained in:
wang-liang0615 2023-07-19 14:39:57 +08:00
parent a22324ca49
commit 23ae320223
1 changed files with 19 additions and 21 deletions

View File

@ -36,7 +36,7 @@
$refs.resourceBatchPerm.open(currentType.id) $refs.resourceBatchPerm.open(currentType.id)
} }
" "
>便捷授权</a-button >便捷授权</a-button
> >
<a-switch <a-switch
v-model="isGroup" v-model="isGroup"
@ -46,8 +46,8 @@
tablePage.currentPage = 1 tablePage.currentPage = 1
searchData() searchData()
selectedRows = [] selectedRows = []
$refs.xTable && $refs.xTable.clearCheckboxRow() $refs.xTable && $refs.xTable.getVxetableRef().clearCheckboxRow()
$refs.xTable && $refs.xTable.clearCheckboxReserve() $refs.xTable && $refs.xTable.getVxetableRef().clearCheckboxReserve()
} }
" "
un-checked-children="组" un-checked-children="组"
@ -75,7 +75,7 @@
<!-- 2 --> <!-- 2 -->
<vxe-table-column field="name" title="资源名" :min-widh="150" fixed="left" show-overflow> <vxe-table-column field="name" title="资源名" :min-widh="150" fixed="left" show-overflow>
<template #title="{row}"> <template #title="{ row }">
{{ row.isGroup ? '资源组名' : '资源名' }} {{ row.isGroup ? '资源组名' : '资源名' }}
</template> </template>
</vxe-table-column> </vxe-table-column>
@ -91,14 +91,8 @@
<!-- 6 --> <!-- 6 -->
<vxe-table-column <vxe-table-column field="action" title="操作" :min-widh="200" fixed="right" align="center" show-overflow>
field="action" <template #default="{ row }">
title="操作"
:min-widh="200"
fixed="right"
align="center"
show-overflow>
<template #default="{row}">
<span v-show="row.isGroup"> <span v-show="row.isGroup">
<a @click="handleDisplayMember(row)">成员</a> <a @click="handleDisplayMember(row)">成员</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -106,7 +100,7 @@
<a-divider type="vertical" /> <a-divider type="vertical" />
</span> </span>
<a-tooltip title="查看授权"> <a-tooltip title="查看授权">
<a @click="handlePerm(row)"><a-icon type="eye"/></a> <a @click="handlePerm(row)"><a-icon type="eye" /></a>
</a-tooltip> </a-tooltip>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-tooltip title="授权"> <a-tooltip title="授权">
@ -116,7 +110,7 @@
</a-tooltip> </a-tooltip>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm title="确认删除?" @confirm="handleDelete(row)" @cancel="cancel" okText="是" cancelText="否"> <a-popconfirm title="确认删除?" @confirm="handleDelete(row)" @cancel="cancel" okText="是" cancelText="否">
<a style="color: red"><a-icon type="delete"/></a> <a style="color: red"><a-icon type="delete" /></a>
</a-popconfirm> </a-popconfirm>
</template> </template>
</vxe-table-column> </vxe-table-column>
@ -134,8 +128,8 @@
</vxe-pager> </vxe-pager>
</a-spin> </a-spin>
</div> </div>
<div v-else style="text-align: center;margin-top:20%"> <div v-else style="text-align: center; margin-top: 20%">
<a-icon style="font-size:50px; margin-bottom: 20px; color: orange" type="info-circle" /> <a-icon style="font-size: 50px; margin-bottom: 20px; color: orange" type="info-circle" />
<h3>暂无类型信息请先添加资源类型</h3> <h3>暂无类型信息请先添加资源类型</h3>
</div> </div>
<resourceForm ref="resourceForm" @fresh="handleOk"> </resourceForm> <resourceForm ref="resourceForm" @fresh="handleOk"> </resourceForm>
@ -300,11 +294,12 @@ export default {
this.searchName = '' this.searchName = ''
this.selectedRows = [] this.selectedRows = []
this.tablePage.currentPage = 1 this.tablePage.currentPage = 1
this.$refs.xTable && this.$refs.xTable.clearCheckboxRow() this.$refs.xTable && this.$refs.xTable.getVxetableRef().clearCheckboxRow()
this.$refs.xTable && this.$refs.xTable.clearCheckboxReserve() this.$refs.xTable && this.$refs.xTable.getVxetableRef().clearCheckboxReserve()
if (rtypeId) { if (rtypeId) {
this.currentType = this.allResourceTypes.find((item) => item.id === rtypeId) this.currentType = this.allResourceTypes.find((item) => item.id === rtypeId)
} }
p
this.searchData() this.searchData()
}, },
handlePerm(record) { handlePerm(record) {
@ -347,7 +342,10 @@ export default {
}, },
changeCheckbox({ records }) { changeCheckbox({ records }) {
// console.log(records) // console.log(records)
this.selectedRows = this.$refs.xTable.getCheckboxRecords().concat(this.$refs.xTable.getCheckboxReserveRecords()) this.selectedRows = this.$refs.xTable
.getVxetableRef()
.getCheckboxRecords()
.concat(this.$refs.xTable.getVxetableRef().getCheckboxReserveRecords())
}, },
handleBatchPerm() { handleBatchPerm() {
this.$refs['resourcePermManageForm'].editPerm(this.selectedRows, this.isGroup) this.$refs['resourcePermManageForm'].editPerm(this.selectedRows, this.isGroup)
@ -356,12 +354,12 @@ export default {
this.$refs['resourcePermManageForm'].editPerm(this.selectedRows, this.isGroup, 'revoke') this.$refs['resourcePermManageForm'].editPerm(this.selectedRows, this.isGroup, 'revoke')
}, },
closePerm() { closePerm() {
this.$refs.xTable.clearCheckboxRow() this.$refs.xTable.getVxetableRef().clearCheckboxRow()
this.selectedRows = [] this.selectedRows = []
}, },
}, },
watch: { watch: {
'$route.name': function(newName, oldName) { '$route.name': function (newName, oldName) {
this.isGroup = false this.isGroup = false
this.tablePage = { this.tablePage = {
total: 0, total: 0,