Pārlūkot izejas kodu

feat: 部门管理Card添加编辑按钮

xieyonghong 3 gadi atpakaļ
vecāks
revīzija
b12127ba11

+ 5 - 25
src/components/ProTableCard/CardItems/device.tsx

@@ -4,9 +4,8 @@ import { StatusColorEnum } from '@/components/BadgeStatus';
 import { TableCard } from '@/components';
 import '@/style/common.less';
 import '../index.less';
-import { CheckOutlined, DisconnectOutlined } from '@ant-design/icons';
-import { Popconfirm, Tooltip } from 'antd';
-import { useIntl } from '@@/plugin-locale/localeExports';
+import { CheckOutlined } from '@ant-design/icons';
+import { Tooltip } from 'antd';
 
 export interface DeviceCardProps extends Partial<DeviceInstance> {
   detail?: React.ReactNode;
@@ -19,6 +18,7 @@ export interface DeviceCardProps extends Partial<DeviceInstance> {
   onUnBind?: (e: any) => void;
   showBindBtn?: boolean;
   cardType?: 'bind' | 'unbind';
+  showTool?: boolean;
 }
 
 const defaultImage = require('/public/images/device-type-3-big.png');
@@ -36,14 +36,14 @@ export const handlePermissionsMap = (permissions?: string[]) => {
 };
 
 export const ExtraDeviceCard = (props: DeviceCardProps) => {
-  const intl = useIntl();
   const [imgUrl, setImgUrl] = useState<string>(props.photoUrl || defaultImage);
 
   return (
     <TableCard
-      showTool={false}
+      showTool={props.showTool}
       showMask={false}
       status={props.state?.value}
+      actions={props.actions}
       statusText={props.state?.text}
       statusNames={{
         online: StatusColorEnum.processing,
@@ -97,26 +97,6 @@ export const ExtraDeviceCard = (props: DeviceCardProps) => {
                 </div>
               </div>
             )}
-
-            {props.showBindBtn !== false && (
-              <Popconfirm
-                title={intl.formatMessage({
-                  id: 'pages.system.role.option.unBindUser',
-                  defaultMessage: '是否解除绑定',
-                })}
-                key="unBind"
-                onConfirm={(e) => {
-                  e?.stopPropagation();
-                  if (props.onUnBind) {
-                    props.onUnBind(e);
-                  }
-                }}
-              >
-                <div className={'flex-button'}>
-                  <DisconnectOutlined />
-                </div>
-              </Popconfirm>
-            )}
           </div>
         </div>
       </div>

+ 5 - 22
src/components/ProTableCard/CardItems/product.tsx

@@ -5,8 +5,8 @@ import { useIntl } from 'umi';
 import { TableCard } from '@/components';
 import '@/style/common.less';
 import '../index.less';
-import { Popconfirm, Tooltip } from 'antd';
-import { CheckOutlined, DisconnectOutlined } from '@ant-design/icons';
+import { Tooltip } from 'antd';
+import { CheckOutlined } from '@ant-design/icons';
 
 export interface ProductCardProps extends Partial<ProductItem> {
   detail?: React.ReactNode;
@@ -19,6 +19,7 @@ export interface ProductCardProps extends Partial<ProductItem> {
   onUnBind?: (e: any) => void;
   showBindBtn?: boolean;
   cardType?: 'bind' | 'unbind';
+  showTool?: boolean;
 }
 
 const defaultImage = require('/public/images/device-product.png');
@@ -41,9 +42,10 @@ export const ExtraProductCard = (props: ProductCardProps) => {
 
   return (
     <TableCard
-      showTool={false}
       showMask={false}
       status={props.state}
+      showTool={props.showTool}
+      actions={props.actions}
       statusText={intl.formatMessage({
         id: `pages.system.tenant.assetInformation.${props.state ? 'published' : 'unpublished'}`,
         defaultMessage: '已发布',
@@ -102,25 +104,6 @@ export const ExtraProductCard = (props: ProductCardProps) => {
                 </div>
               </div>
             )}
-            {props.showBindBtn !== false && (
-              <Popconfirm
-                title={intl.formatMessage({
-                  id: 'pages.system.role.option.unBindUser',
-                  defaultMessage: '是否解除绑定',
-                })}
-                key="unBind"
-                onConfirm={(e) => {
-                  e?.stopPropagation();
-                  if (props.onUnBind) {
-                    props.onUnBind(e);
-                  }
-                }}
-              >
-                <div className={'flex-button'}>
-                  <DisconnectOutlined />
-                </div>
-              </Popconfirm>
-            )}
           </div>
         </div>
       </div>

+ 3 - 3
src/components/ProTableCard/index.less

@@ -145,8 +145,8 @@
 
   &.item-active {
     position: relative;
-    color: @primary-color-active;
-    border: 1px solid @primary-color-active;
+    color: #2f54eb;
+    border: 1px solid #2f54eb;
 
     .checked-icon {
       display: block;
@@ -163,7 +163,7 @@
     height: 44px;
     color: #fff;
     background-color: red;
-    background-color: @primary-color-active;
+    background-color: #2f54eb;
     transform: rotate(-45deg);
 
     > div {

+ 7 - 2
src/components/ProTableCard/index.tsx

@@ -22,6 +22,7 @@ type ModelType = keyof typeof ModelEnum;
 interface ProTableCardProps<T> {
   cardRender?: (data: T) => JSX.Element | React.ReactNode;
   gridColumn?: number;
+  height?: 'none';
 }
 
 const ProTableCard = <
@@ -108,7 +109,7 @@ const ProTableCard = <
                 display: 'flex',
                 justifyContent: 'center',
                 alignItems: 'center',
-                minHeight: minHeight - 150,
+                minHeight: props.height === 'none' ? 'auto' : minHeight - 150,
               }}
             >
               <Empty />
@@ -146,7 +147,11 @@ const ProTableCard = <
   }, [props.params]);
 
   return (
-    <div className={'pro-table-card'} style={{ minHeight: minHeight }} ref={domRef}>
+    <div
+      className={'pro-table-card'}
+      style={{ minHeight: props.height === 'none' ? 'auto' : minHeight }}
+      ref={domRef}
+    >
       <ProTable<T, U, ValueType>
         {...extraProps}
         params={

+ 1 - 1
src/components/SearchComponent/index.tsx

@@ -559,7 +559,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
 
   useEffect(() => {
     // 防止页面下多个TabsTabPane中的查询组件共享路由中的参数
-    if (url.q) {
+    if (url.q && props.model !== 'simple') {
       if (url.target) {
         if (props.target && url.target === props.target) {
           form.setValues(JSON.parse(url.q));

+ 14 - 14
src/pages/rule-engine/Scene/Save/components/TriggerWay/index.tsx

@@ -40,6 +40,20 @@ export default (props: TriggerWayProps) => {
     <div className={classNames('trigger-way-warp', props.className, { disabled: props.disabled })}>
       <div
         className={classNames('trigger-way-item', {
+          active: type === TriggerWayType.device,
+        })}
+        onClick={() => {
+          onSelect(TriggerWayType.device);
+        }}
+      >
+        <div className={'way-item-title'}>
+          <p>设备触发</p>
+          <span>DEVICE TRIGGER</span>
+        </div>
+        <img className={'way-item-image'} src={'/images/device-trigger.png'} />
+      </div>
+      <div
+        className={classNames('trigger-way-item', {
           active: type === TriggerWayType.manual,
         })}
         onClick={() => {
@@ -66,20 +80,6 @@ export default (props: TriggerWayProps) => {
         </div>
         <img className={'way-item-image'} src={'/images/timing-trigger.png'} />
       </div>
-      <div
-        className={classNames('trigger-way-item', {
-          active: type === TriggerWayType.device,
-        })}
-        onClick={() => {
-          onSelect(TriggerWayType.device);
-        }}
-      >
-        <div className={'way-item-title'}>
-          <p>设备触发</p>
-          <span>DEVICE TRIGGER</span>
-        </div>
-        <img className={'way-item-image'} src={'/images/device-trigger.png'} />
-      </div>
     </div>
   );
 };

+ 57 - 36
src/pages/system/Department/Assets/deivce/bind.tsx

@@ -11,6 +11,7 @@ import PermissionModal from '@/pages/system/Department/Assets/permissionModal';
 import SearchComponent from '@/components/SearchComponent';
 import { ExtraDeviceCard } from '@/components/ProTableCard/CardItems/device';
 import { ProTableCard } from '@/components';
+import { AssetsModel } from '@/pages/system/Department/Assets';
 
 interface Props {
   reload: () => void;
@@ -101,6 +102,7 @@ const Bind = observer((props: Props) => {
   ];
 
   const handleBind = () => {
+    AssetsModel.params = {};
     if (Models.bindKeys.length) {
       saveRef.current?.saveData();
     } else {
@@ -115,16 +117,41 @@ const Bind = observer((props: Props) => {
     }
   }, [props.visible]);
 
+  console.log(AssetsModel);
+
+  const getParams = (params: any) => {
+    console.log(params);
+    const _params: any = [
+      {
+        column: 'id',
+        termType: 'dim-assets$not',
+        value: {
+          assetType: 'device',
+          targets: [
+            {
+              type: 'org',
+              id: props.parentId,
+            },
+          ],
+        },
+      },
+    ];
+    if (Object.keys(params).length) {
+      _params.push({
+        column: 'parentId$product-info',
+        termType: 'eq',
+        value: 'accessId is ' + params.productId[0],
+      });
+    }
+    return _params;
+  };
+
   return (
     <Modal
       visible={props.visible}
       onOk={handleBind}
       onCancel={props.onCancel}
       width={'75vw'}
-      bodyStyle={{
-        height: 'calc(100vh - 240px);',
-        overflowY: 'auto',
-      }}
       title="绑定"
     >
       <PermissionModal
@@ -143,21 +170,7 @@ const Bind = observer((props: Props) => {
         field={columns}
         enableSave={false}
         model={'simple'}
-        defaultParam={[
-          {
-            column: 'id',
-            termType: 'dim-assets$not',
-            value: {
-              assetType: 'device',
-              targets: [
-                {
-                  type: 'org',
-                  id: props.parentId,
-                },
-              ],
-            },
-          },
-        ]}
+        defaultParam={getParams(AssetsModel.bindModal ? AssetsModel.params : {})}
         onSearch={async (data) => {
           actionRef.current?.reset?.();
           setSearchParam(data);
@@ -169,24 +182,32 @@ const Bind = observer((props: Props) => {
         // }}
         target="department-assets-device"
       />
-      <ProTableCard<DeviceItem>
-        actionRef={actionRef}
-        columns={columns}
-        rowKey="id"
-        search={false}
-        gridColumn={2}
-        cardRender={(record) => (
-          <ExtraDeviceCard showBindBtn={false} {...record} cardType={'bind'} />
-        )}
-        rowSelection={{
-          selectedRowKeys: Models.bindKeys,
-          onChange: (selectedRowKeys, selectedRows) => {
-            Models.bindKeys = selectedRows.map((item) => item.id);
-          },
+      <div
+        style={{
+          height: 'calc(100vh - 440px)',
+          overflowY: 'auto',
         }}
-        request={(params) => service.queryDeviceList(params)}
-        params={searchParam}
-      />
+      >
+        <ProTableCard<DeviceItem>
+          actionRef={actionRef}
+          columns={columns}
+          rowKey="id"
+          search={false}
+          gridColumn={2}
+          cardRender={(record) => (
+            <ExtraDeviceCard showBindBtn={false} showTool={false} {...record} cardType={'bind'} />
+          )}
+          rowSelection={{
+            selectedRowKeys: Models.bindKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+              Models.bindKeys = selectedRows.map((item) => item.id);
+            },
+          }}
+          request={(params) => service.queryDeviceList(params)}
+          params={searchParam}
+          height={'none'}
+        />
+      </div>
     </Modal>
   );
 });

+ 76 - 6
src/pages/system/Department/Assets/deivce/index.tsx

@@ -5,15 +5,16 @@ import { Badge, Button, Popconfirm, Tooltip } from 'antd';
 import { useEffect, useRef, useState } from 'react';
 import { observer } from '@formily/react';
 import type { DeviceItem } from '@/pages/system/Department/typings';
-import { DisconnectOutlined, PlusOutlined } from '@ant-design/icons';
+import { DisconnectOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons';
 import Models from './model';
 import Service from '@/pages/system/Department/Assets/service';
 import Bind from './bind';
 import SearchComponent from '@/components/SearchComponent';
 import { ExtraDeviceCard, handlePermissionsMap } from '@/components/ProTableCard/CardItems/device';
-import { ProTableCard } from '@/components';
+import { PermissionButton, ProTableCard } from '@/components';
 import { onlyMessage } from '@/utils/util';
 import { ASSETS_TABS_ENUM, AssetsModel } from '@/pages/system/Department/Assets';
+import UpdateModal from '@/pages/system/Department/Assets/updateModal';
 
 export const service = new Service<DeviceItem>('assets');
 
@@ -36,6 +37,10 @@ export default observer((props: { parentId: string }) => {
 
   const [searchParam, setSearchParam] = useState({});
 
+  const [updateVisible, setUpdateVisible] = useState(false);
+  const [updateId, setUpdateId] = useState('');
+  const [permissions, setPermissions] = useState<string[]>([]);
+
   useEffect(() => {
     if (AssetsModel.tabsIndex === ASSETS_TABS_ENUM.Device && actionRef.current) {
       actionRef.current.reload();
@@ -170,6 +175,23 @@ export default observer((props: { parentId: string }) => {
       width: 60,
       fixed: 'right',
       render: (text, record) => [
+        <PermissionButton
+          key="update"
+          type={'link'}
+          style={{ padding: 0 }}
+          tooltip={{
+            title: '编辑',
+          }}
+          onClick={(e) => {
+            e?.stopPropagation();
+            setUpdateId(record.id);
+            setPermissions(record.grantedPermissions!);
+            setUpdateVisible(true);
+          }}
+          isPermission={true}
+        >
+          <EditOutlined />
+        </PermissionButton>,
         <Popconfirm
           title={intl.formatMessage({
             id: 'pages.system.role.option.unBindUser',
@@ -199,6 +221,7 @@ export default observer((props: { parentId: string }) => {
     Models.bind = false;
     Models.bindKeys = [];
     if (AssetsModel.bindModal) {
+      AssetsModel.params = {};
       AssetsModel.bindModal = false;
     }
   };
@@ -245,6 +268,21 @@ export default observer((props: { parentId: string }) => {
           parentId={props.parentId}
         />
       )}
+      {updateVisible && (
+        <UpdateModal
+          permissions={permissions}
+          visible={updateVisible}
+          id={updateId}
+          type="device"
+          targetId={props.parentId}
+          onCancel={() => {
+            setUpdateVisible(false);
+          }}
+          onReload={() => {
+            actionRef.current?.reload();
+          }}
+        />
+      )}
       <SearchComponent<DeviceItem>
         field={columns}
         defaultParam={[
@@ -310,10 +348,42 @@ export default observer((props: { parentId: string }) => {
         cardRender={(record) => (
           <ExtraDeviceCard
             {...record}
-            onUnBind={(e) => {
-              e.stopPropagation();
-              singleUnBind(record.id);
-            }}
+            actions={[
+              <PermissionButton
+                key="update"
+                onClick={(e) => {
+                  e?.stopPropagation();
+                  setUpdateId(record.id);
+                  setPermissions(record.grantedPermissions!);
+                  setUpdateVisible(true);
+                }}
+                isPermission={true}
+              >
+                <EditOutlined />
+              </PermissionButton>,
+              <PermissionButton
+                key="unbind"
+                popConfirm={{
+                  title: intl.formatMessage({
+                    id: 'pages.system.role.option.unBindUser',
+                    defaultMessage: '是否解除绑定',
+                  }),
+                  onConfirm: (e) => {
+                    e?.stopPropagation();
+                    singleUnBind(record.id);
+                  },
+                  onCancel: (e) => {
+                    e?.stopPropagation();
+                  },
+                }}
+                onClick={(e) => {
+                  e?.stopPropagation();
+                }}
+                isPermission={true}
+              >
+                <DisconnectOutlined />
+              </PermissionButton>,
+            ]}
           />
         )}
         toolBarRender={() => [

+ 2 - 0
src/pages/system/Department/Assets/index.tsx

@@ -24,10 +24,12 @@ export const AssetsModel = model<{
   tabsIndex: string;
   bindModal: boolean;
   parentId: string;
+  params: any;
 }>({
   tabsIndex: ASSETS_TABS_ENUM.Product,
   bindModal: false,
   parentId: '',
+  params: {},
 });
 
 const Assets = observer((props: AssetsProps) => {

+ 34 - 21
src/pages/system/Department/Assets/product/bind.tsx

@@ -11,6 +11,7 @@ import type { ProductItem } from '@/pages/system/Department/typings';
 import SearchComponent from '@/components/SearchComponent';
 import { ExtraProductCard } from '@/components/ProTableCard/CardItems/product';
 import { ProTableCard } from '@/components';
+import { AssetsModel } from '@/pages/system/Department/Assets';
 
 interface Props {
   reload: () => void;
@@ -73,10 +74,6 @@ const Bind = observer((props: Props) => {
         onOk={handleBind}
         onCancel={props.onCancel}
         width={'75vw'}
-        bodyStyle={{
-          height: 'calc(100vh - 240px);',
-          overflowY: 'auto',
-        }}
         title="绑定"
       >
         <PermissionModal
@@ -121,24 +118,40 @@ const Bind = observer((props: Props) => {
           // }}
           target="department-assets-product"
         />
-        <ProTableCard<ProductItem>
-          actionRef={actionRef}
-          columns={columns}
-          rowKey="id"
-          search={false}
-          gridColumn={2}
-          rowSelection={{
-            selectedRowKeys: Models.bindKeys,
-            onChange: (selectedRowKeys, selectedRows) => {
-              Models.bindKeys = selectedRows.map((item) => item.id);
-            },
+        <div
+          style={{
+            height: 'calc(100vh - 440px)',
+            overflowY: 'auto',
           }}
-          request={(params) => service.queryProductList(params)}
-          params={searchParam}
-          cardRender={(record) => (
-            <ExtraProductCard showBindBtn={false} {...record} cardType={'bind'} />
-          )}
-        />
+        >
+          <ProTableCard<ProductItem>
+            actionRef={actionRef}
+            columns={columns}
+            rowKey="id"
+            search={false}
+            gridColumn={2}
+            rowSelection={{
+              selectedRowKeys: Models.bindKeys,
+              onChange: (selectedRowKeys, selectedRows) => {
+                Models.bindKeys = selectedRows.map((item) => item.id);
+                AssetsModel.params = {
+                  productId: selectedRows.map((item) => item.id),
+                };
+              },
+            }}
+            request={(params) => service.queryProductList(params)}
+            params={searchParam}
+            cardRender={(record) => (
+              <ExtraProductCard
+                showBindBtn={false}
+                showTool={false}
+                {...record}
+                cardType={'bind'}
+              />
+            )}
+            height={'none'}
+          />
+        </div>
       </Modal>
     </>
   );

+ 74 - 5
src/pages/system/Department/Assets/product/index.tsx

@@ -5,7 +5,7 @@ import { Button, Modal, Popconfirm, Tooltip } from 'antd';
 import { useEffect, useRef, useState } from 'react';
 import { observer } from '@formily/react';
 import type { ProductItem } from '@/pages/system/Department/typings';
-import { DisconnectOutlined, PlusOutlined } from '@ant-design/icons';
+import { DisconnectOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons';
 import Service from '@/pages/system/Department/Assets/service';
 import Models from './model';
 import Bind from './bind';
@@ -14,9 +14,10 @@ import {
   ExtraProductCard,
   handlePermissionsMap,
 } from '@/components/ProTableCard/CardItems/product';
-import { ProTableCard } from '@/components';
+import { ProTableCard, PermissionButton } from '@/components';
 import { onlyMessage } from '@/utils/util';
 import { ASSETS_TABS_ENUM, AssetsModel } from '@/pages/system/Department/Assets';
+import UpdateModal from '../updateModal';
 
 export const service = new Service<ProductItem>('assets');
 
@@ -26,6 +27,9 @@ export default observer((props: { parentId: string }) => {
 
   const [searchParam, setSearchParam] = useState({});
   const [deviceVisible, setDeviceVisible] = useState(false);
+  const [updateVisible, setUpdateVisible] = useState(false);
+  const [updateId, setUpdateId] = useState('');
+  const [permissions, setPermissions] = useState<string[]>([]);
 
   useEffect(() => {
     if (AssetsModel.tabsIndex === ASSETS_TABS_ENUM.Product && actionRef.current) {
@@ -114,6 +118,23 @@ export default observer((props: { parentId: string }) => {
       width: 60,
       fixed: 'right',
       render: (text, record) => [
+        <PermissionButton
+          key="update"
+          type={'link'}
+          style={{ padding: 0 }}
+          tooltip={{
+            title: '编辑',
+          }}
+          onClick={(e) => {
+            e?.stopPropagation();
+            setUpdateId(record.id);
+            setPermissions(record.grantedPermissions!);
+            setUpdateVisible(true);
+          }}
+          isPermission={true}
+        >
+          <EditOutlined />
+        </PermissionButton>,
         <Popconfirm
           title={intl.formatMessage({
             id: 'pages.system.role.option.unBindUser',
@@ -206,6 +227,21 @@ export default observer((props: { parentId: string }) => {
           是否继续分配产品下的具体设备
         </Modal>
       )}
+      {updateVisible && (
+        <UpdateModal
+          permissions={permissions}
+          visible={updateVisible}
+          id={updateId}
+          type="product"
+          targetId={props.parentId}
+          onCancel={() => {
+            setUpdateVisible(false);
+          }}
+          onReload={() => {
+            actionRef.current?.reload();
+          }}
+        />
+      )}
       <SearchComponent<ProductItem>
         field={columns}
         defaultParam={[
@@ -272,9 +308,42 @@ export default observer((props: { parentId: string }) => {
         cardRender={(record) => (
           <ExtraProductCard
             {...record}
-            onUnBind={() => {
-              singleUnBind(record.id);
-            }}
+            actions={[
+              <PermissionButton
+                key="update"
+                onClick={(e) => {
+                  e?.stopPropagation();
+                  setUpdateId(record.id);
+                  setPermissions(record.grantedPermissions!);
+                  setUpdateVisible(true);
+                }}
+                isPermission={true}
+              >
+                <EditOutlined />
+              </PermissionButton>,
+              <PermissionButton
+                key="unbind"
+                popConfirm={{
+                  title: intl.formatMessage({
+                    id: 'pages.system.role.option.unBindUser',
+                    defaultMessage: '是否解除绑定',
+                  }),
+                  onConfirm: (e) => {
+                    e?.stopPropagation();
+                    singleUnBind(record.id);
+                  },
+                  onCancel: (e) => {
+                    e?.stopPropagation();
+                  },
+                }}
+                onClick={(e) => {
+                  e?.stopPropagation();
+                }}
+                isPermission={true}
+              >
+                <DisconnectOutlined />
+              </PermissionButton>,
+            ]}
           />
         )}
         toolBarRender={() => [

+ 6 - 0
src/pages/system/Department/Assets/service.ts

@@ -106,6 +106,12 @@ class Service<T> extends BaseService<T> {
         );
       }),
     );
+
+  updatePermission = (type: string, id: string, targetId: string, permission: string[]) =>
+    request(`${SystemConst.API_BASE}/assets/permission/${type}/${id}/org/${targetId}`, {
+      method: 'PUT',
+      data: permission,
+    });
 }
 
 export default Service;

+ 63 - 0
src/pages/system/Department/Assets/updateModal.tsx

@@ -0,0 +1,63 @@
+import { Modal, Form, Checkbox } from 'antd';
+import { useCallback, useEffect } from 'react';
+import Server from './service';
+
+interface UpdateModalProps {
+  id: string;
+  type: string;
+  targetId: string;
+  visible: boolean;
+  permissions: string[];
+  onCancel: () => void;
+  onReload: () => void;
+}
+const server = new Server();
+export default (props: UpdateModalProps) => {
+  const [form] = Form.useForm();
+
+  const saveData = useCallback(async () => {
+    const data = form.getFieldsValue();
+    if (data) {
+      const res = await server.updatePermission(
+        props.type,
+        props.id,
+        props.targetId,
+        data.permissions,
+      );
+      if (res.status === 200 && props.onReload) {
+        props.onCancel();
+        props.onReload();
+      }
+    }
+  }, [props.id]);
+
+  useEffect(() => {
+    if (form) {
+      form.setFieldsValue({
+        permissions: props.permissions,
+      });
+    }
+  }, [props.permissions, form]);
+
+  return (
+    <Modal
+      title={'编辑'}
+      visible={props.visible}
+      width={500}
+      onCancel={props.onCancel}
+      onOk={saveData}
+    >
+      <Form form={form}>
+        <Form.Item name="permissions" label="资产权限" required>
+          <Checkbox.Group
+            options={[
+              { label: '查看', value: 'read', disabled: true },
+              { label: '编辑', value: 'save' },
+              { label: '删除', value: 'delete' },
+            ]}
+          />
+        </Form.Item>
+      </Form>
+    </Modal>
+  );
+};

+ 1 - 1
src/pages/system/Department/Member/bind.tsx

@@ -73,7 +73,7 @@ const Bind = observer((props: Props) => {
       visible={props.visible}
       onOk={handleBind}
       onCancel={props.onCancel}
-      width={'75vw'}
+      width={'800'}
       bodyStyle={{
         height: 'calc(100vh - 240px);',
         overflowY: 'auto',

+ 5 - 0
yarn.lock

@@ -8639,6 +8639,11 @@ draftjs-utils@^0.9.4:
   resolved "https://registry.yarnpkg.com/draftjs-utils/-/draftjs-utils-0.9.4.tgz#976c61aa133dbbbfedd65ae1dd6627d7b98c6f08"
   integrity sha512-KYjABSbGpJrwrwmxVj5UhfV37MF/p0QRxKIyL+/+QOaJ8J9z1FBKxkblThbpR0nJi9lxPQWGg+gh+v0dAsSCCg==
 
+driver.js@^0.9.8:
+  version "0.9.8"
+  resolved "https://registry.yarnpkg.com/driver.js/-/driver.js-0.9.8.tgz#4b327f4537b1c9b9fb19419de86174be821ae32a"
+  integrity sha512-bczjyKdX6XmFyCDkwtRmlaORDwfBk1xXmRO0CAe5VwNQTM98aWaG2LAIiIdTe53iV/B7W5lXlIy2xYtf0JRb7Q==
+
 dumi-assets-types@1.0.0, dumi-assets-types@^1.0.0-beta.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/dumi-assets-types/-/dumi-assets-types-1.0.0.tgz#d5368cb11045b203bf1ef1080e553b2287a2ec81"