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" ref="tableRef"
:request="table.requestFun" :request="table.requestFun"
:gridColumn="2" :gridColumn="2"
model="CARD"
:params="query.params.value" :params="query.params.value"
:rowSelection="{ :rowSelection="{
selectedRowKeys: table._selectedRowKeys.value, selectedRowKeys: table._selectedRowKeys.value,
onChange: pageChange onChange: selectRow,
}" }"
@cancelSelect="table.cancelSelect" @cancelSelect="table.cancelSelect"
:columns="columns"
> >
<template #card="slotProps"> <template #card="slotProps">
<CardBox <CardBox
@ -100,6 +100,30 @@
</template> </template>
</CardBox> </CardBox>
</template> </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> </j-pro-table>
</a-modal> </a-modal>
</template> </template>
@ -162,6 +186,9 @@ const options = computed(() =>
})), })),
); );
const columns = props.queryColumns.filter(
(item) => item.dataIndex !== 'action',
);
const query = { const query = {
columns: [ columns: [
{ {
@ -369,8 +396,6 @@ const table: any = {
}), }),
// //
requestFun: async (oParams: any) => { requestFun: async (oParams: any) => {
table._selectedRowKeys.value = [];
table.selectedRows = [];
if (props.parentId) { if (props.parentId) {
const terms = [ const terms = [
{ {
@ -421,9 +446,11 @@ const table: any = {
}, },
}; };
table.init(); table.init();
const pageChange = ()=>{ const selectRow = (keys:string[], rows:any[]) => {
console.log(1111,table._selectedRowKeys.value); 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> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

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

View File

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