From 16dc3116794c57231768552f999040df4ca3c0f8 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 23 二月 2024 11:27:38 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/system/role/index.jsx | 53 +++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/zy-asrs-flow/src/pages/system/role/index.jsx b/zy-asrs-flow/src/pages/system/role/index.jsx
index c1485b1..77c7957 100644
--- a/zy-asrs-flow/src/pages/system/role/index.jsx
+++ b/zy-asrs-flow/src/pages/system/role/index.jsx
@@ -91,7 +91,7 @@
const handleScope = async (val) => {
const hide = message.loading('姝e湪鍒嗛厤');
try {
- const resp = await Http.doPost('api/role/scope', val);
+ const resp = await Http.doPost('api/role/scope/update', val);
if (resp.code === 200) {
message.success('鍒嗛厤鎴愬姛');
return true;
@@ -116,6 +116,7 @@
const [searchParam, setSearchParam] = useState({});
const [scopeModalVisible, setScopeModalVisible] = useState(false);
+ const [menuIds, setMenuIds] = useState([]);
useEffect(() => {
@@ -138,6 +139,23 @@
actionRef={actionRef}
setSearchParam={setSearchParam}
/>,
+ render: (_, record) => {
+ return (
+ <a
+ onClick={() => {
+ Http.doGetPromise('/api/role/scope/list', { roleId: record.id }, (res) => {
+ if (res.data) {
+ setMenuIds(res.data);
+ }
+ setScopeModalVisible(true);
+ setCurrentRow(record);
+ });
+ }}
+ >
+ {_}
+ </a>
+ );
+ },
},
{
title: '鏍囪瘑',
@@ -155,7 +173,6 @@
title: '淇敼鏃堕棿',
dataIndex: 'updateTime$',
valueType: 'text',
- width: 300,
filterDropdown: (props) => <DatetimeRangeFilter
name='updateTime'
{...props}
@@ -167,7 +184,6 @@
title: '鐘舵��',
dataIndex: 'status$',
valueType: 'text',
- width: 160,
filterDropdown: (props) => <SelectFilter
name='status'
{...props}
@@ -198,19 +214,9 @@
{
title: '鎿嶄綔',
dataIndex: 'option',
- width: 140,
+ width: 260,
valueType: 'option',
render: (_, record) => [
- <Button
- type="link"
- key="scope"
- onClick={() => {
- setScopeModalVisible(true);
- setCurrentRow(record);
- }}
- >
- 鍒嗛厤鏉冮檺
- </Button>,
<Button
type="link"
key="edit"
@@ -220,6 +226,21 @@
}}
>
缂栬緫
+ </Button>,
+ <Button
+ type="link"
+ key="scope"
+ onClick={() => {
+ Http.doGetPromise('/api/role/scope/list', { roleId: record.id }, (res) => {
+ if (res.data) {
+ setMenuIds(res.data);
+ }
+ setScopeModalVisible(true);
+ setCurrentRow(record);
+ });
+ }}
+ >
+ 鍒嗛厤鏉冮檺
</Button>,
<Button
type="link"
@@ -260,6 +281,7 @@
formRef={formTableRef}
columns={columns}
cardBordered
+ scroll={{ x: 1300 }}
dateFormatter="string"
pagination={{ pageSize: 20 }}
search={false}
@@ -391,10 +413,12 @@
<Scope
open={scopeModalVisible}
values={currentRow || {}}
+ originMenuIds={menuIds}
onCancel={
() => {
setScopeModalVisible(false);
setCurrentRow(undefined);
+ setMenuIds([]);
}
}
onSubmit={async (values) => {
@@ -405,6 +429,7 @@
if (ok) {
setScopeModalVisible(false);
setCurrentRow(undefined);
+ setMenuIds([]);
if (actionRef.current) {
actionRef.current.reload();
}
--
Gitblit v1.9.1