fix: 部门管理

This commit is contained in:
easy 2023-03-13 14:11:31 +08:00
parent 2315a05224
commit 2340964514
3 changed files with 37 additions and 10 deletions

View File

@ -32,13 +32,13 @@
ref="tableRef"
:request="table.requestFun"
:gridColumn="2"
model="CARD"
:params="query.params.value"
:rowSelection="{
selectedRowKeys: table._selectedRowKeys.value,
onChange: pageChange
onChange: selectRow,
}"
@cancelSelect="table.cancelSelect"
:columns="columns"
>
<template #card="slotProps">
<CardBox
@ -100,6 +100,30 @@
</template>
</CardBox>
</template>
<template #permission="slotProps">
<div
style="cursor: pointer"
class="card-item-content-value"
@click="(e) => e.stopPropagation()"
>
<a-checkbox-group
v-model:value="slotProps.selectPermissions"
:options="slotProps.permissionList"
/>
</div>
</template>
<template #state="slotProps">
<BadgeStatus
:status="slotProps.state.value"
:text="slotProps.state.text"
:statusNames="{
online: 'success',
offline: 'error',
notActive: 'warning',
}"
></BadgeStatus>
</template>
</j-pro-table>
</a-modal>
</template>
@ -162,6 +186,9 @@ const options = computed(() =>
})),
);
const columns = props.queryColumns.filter(
(item) => item.dataIndex !== 'action',
);
const query = {
columns: [
{
@ -369,8 +396,6 @@ const table: any = {
}),
//
requestFun: async (oParams: any) => {
table._selectedRowKeys.value = [];
table.selectedRows = [];
if (props.parentId) {
const terms = [
{
@ -421,9 +446,11 @@ const table: any = {
},
};
table.init();
const pageChange = ()=>{
console.log(1111,table._selectedRowKeys.value);
}
const selectRow = (keys:string[], rows:any[]) => {
const okRows = rows.filter(item=>!!item.permissionList.find((permiss:any)=>permiss.value === 'share'));
table.selectedRows = okRows;
table._selectedRowKeys.value = okRows.map(item=>item.id)
};
</script>
<style lang="less" scoped>

View File

@ -11,8 +11,9 @@
:params="queryParams"
:rowSelection="{
selectedRowKeys: table._selectedRowKeys.value,
onChange:(keys:string[])=>table._selectedRowKeys.value = [...keys],
onSelectNone: table.cancelSelect
}"
@cancelSelect="table.cancelSelect"
:columns="columns"
>
<template #headerTitle>
@ -425,8 +426,6 @@ const table = {
}),
//
requestFun: async (oParams: any) => {
table._selectedRowKeys.value = [];
table.selectedRows = [];
if (props.parentId) {
const params = {
...oParams,

View File

@ -286,6 +286,7 @@ const columns = [
dataIndex: 'state',
key: 'state',
ellipsis: true,
width: '80px',
search: {
type: 'select',
options: [