Преглед изворни кода

Merge pull request #616 from jetlinks/next-wzy

Next wzy
孙超 пре 3 година
родитељ
комит
0c4f355a0f
33 измењених фајлова са 253 додато и 194 уклоњено
  1. 11 6
      src/components/FRuleEditor/Debug/index.tsx
  2. 2 2
      src/components/ProTableCard/CardItems/applyCard.tsx
  3. 1 1
      src/locales/zh-CN/menu.ts
  4. 1 1
      src/locales/zh-CN/pages.ts
  5. 2 2
      src/pages/account/Center/edit/infoEdit.tsx
  6. 1 1
      src/pages/account/Center/index.tsx
  7. 1 1
      src/pages/device/Instance/index.tsx
  8. 1 1
      src/pages/device/Product/index.tsx
  9. 8 8
      src/pages/init-home/components/data/RoleData.ts
  10. 19 9
      src/pages/link/Channel/Modbus/Export/index.tsx
  11. 1 1
      src/pages/notice/Config/SyncUser/index.tsx
  12. 1 1
      src/pages/notice/Template/Detail/doc/DingTalk.tsx
  13. 2 2
      src/pages/notice/Template/Detail/doc/WeixinCorp.tsx
  14. 4 4
      src/pages/notice/Template/Detail/index.tsx
  15. 1 1
      src/pages/rule-engine/Alarm/Config/index.tsx
  16. 2 2
      src/pages/rule-engine/Alarm/Configuration/index.tsx
  17. 2 2
      src/pages/rule-engine/Alarm/Log/TabComponent/index.tsx
  18. 1 1
      src/pages/rule-engine/Alarm/Log/index.tsx
  19. 2 2
      src/pages/rule-engine/DashBoard/index.tsx
  20. 1 1
      src/pages/rule-engine/Scene/Save/Explanation.tsx
  21. 1 1
      src/pages/rule-engine/Scene/Save/action/VariableItems/org.tsx
  22. 3 3
      src/pages/rule-engine/Scene/Save/trigger/index.tsx
  23. 13 1
      src/pages/system/Apply/Api/leftTree.tsx
  24. 8 2
      src/pages/system/Apply/Save/index.tsx
  25. 8 8
      src/pages/system/Apply/index.tsx
  26. 1 1
      src/pages/system/Apply/typings.d.ts
  27. 4 4
      src/pages/system/Department/Tree/tree.tsx
  28. 125 113
      src/pages/system/Menu/Detail/edit.tsx
  29. 9 7
      src/pages/system/Menu/Detail/index.tsx
  30. 1 1
      src/pages/system/Menu/Setting/baseMenu.ts
  31. 13 1
      src/pages/system/Platforms/Api/leftTree.tsx
  32. 2 2
      src/pages/system/User/Save/index.tsx
  33. 1 1
      src/utils/menu/router.ts

+ 11 - 6
src/components/FRuleEditor/Debug/index.tsx

@@ -166,10 +166,15 @@ const Debug = observer((props: Props) => {
         },
         properties: _properties || [],
       },
-    )?.subscribe((data: WebsocketPayload) => {
-      State.log.push({ time: new Date().getTime(), content: JSON.stringify(data.payload) });
-      setIsBeginning(true);
-    });
+    )?.subscribe(
+      (data: WebsocketPayload) => {
+        State.log.push({ time: new Date().getTime(), content: JSON.stringify(data.payload) });
+      },
+      // () => { },
+      // () => {
+      //   setIsBeginning(true);
+      // }
+    );
   };
   const runScriptAgain = async () => {
     if (wsAgain.current) {
@@ -192,7 +197,7 @@ const Debug = observer((props: Props) => {
         properties: _properties || [],
       },
     )?.subscribe(() => {
-      setIsBeginning(true);
+      // setIsBeginning(true);
     });
   };
   useEffect(() => {
@@ -221,7 +226,7 @@ const Debug = observer((props: Props) => {
                   runScriptAgain();
                 }}
               >
-                <a style={{ marginLeft: 90 }}>发送数据</a>
+                <a style={{ marginLeft: 75 }}>发送数据</a>
               </div>
             )}
           </div>

+ 2 - 2
src/components/ProTableCard/CardItems/applyCard.tsx

@@ -24,8 +24,8 @@ export default (props: DeviceCardProps) => {
       // showMask={false}
       detail={props.detail}
       actions={props.actions}
-      status={props.state}
-      statusText={props.state === 'disabled' ? '禁用' : '正常'}
+      status={props.state?.value}
+      statusText={props.state?.value === 'disabled' ? '禁用' : '正常'}
       statusNames={{
         enabled: StatusColorEnum.success,
         disabled: StatusColorEnum.error,

+ 1 - 1
src/locales/zh-CN/menu.ts

@@ -12,7 +12,7 @@ export default {
   'menu.system.permission': '权限管理',
   'menu.system.tenant': '租户管理',
   'menu.system.datasource': '数据源管理',
-  'menu.system.department': '部门管理',
+  'menu.system.department': '组织管理',
   'menu.system.menu': '菜单管理',
   'menu.system.menuDetail': '菜单详情',
   'menu.system.assets': '资产分配',

+ 1 - 1
src/locales/zh-CN/pages.ts

@@ -143,7 +143,7 @@ export default {
   'pages.system.org.option.add': '添加下级',
   // 系统设置-部门管理
   'pages.system.department.user': '用户',
-  'pages.system.department.option.add': '新增子部门',
+  'pages.system.department.option.add': '新增子组织',
   'pages.system.role.option.unBind': '是否解除绑定',
   'pages.system.role.option.unBinds': '是否批量解除绑定?',
   'pages.system.role.option.delete': '确定要删除吗?',

+ 2 - 2
src/pages/account/Center/edit/infoEdit.tsx

@@ -69,8 +69,8 @@ const InfoEdit = (props: Props) => {
             </Form.Item>
           </Col>
           <Col span={12}>
-            <Form.Item label="部门" name="org">
-              <Input placeholder="请输入部门" disabled />
+            <Form.Item label="组织" name="org">
+              <Input placeholder="请输入组织" disabled />
             </Form.Item>
           </Col>
         </Row>

+ 1 - 1
src/pages/account/Center/index.tsx

@@ -183,7 +183,7 @@ const Center = () => {
               <Descriptions.Item label="电话">{data?.telephone || '-'}</Descriptions.Item>
               <Descriptions.Item label="姓名">{data?.name}</Descriptions.Item>
               <Descriptions.Item label="角色">{data?.roleList[0]?.name || '-'}</Descriptions.Item>
-              <Descriptions.Item label="部门">{data?.orgList[0]?.name || '-'}</Descriptions.Item>
+              <Descriptions.Item label="组织">{data?.orgList[0]?.name || '-'}</Descriptions.Item>
               <Descriptions.Item label="邮箱">{data?.email || '-'}</Descriptions.Item>
             </Descriptions>
           </div>

+ 1 - 1
src/pages/device/Instance/index.tsx

@@ -367,7 +367,7 @@ const Instance = () => {
     },
     {
       dataIndex: 'id$dim-assets',
-      title: '所属部门',
+      title: '所属组织',
       valueType: 'treeSelect',
       hideInTable: true,
       fieldProps: {

+ 1 - 1
src/pages/device/Product/index.tsx

@@ -371,7 +371,7 @@ const Product = observer(() => {
     },
     {
       dataIndex: 'id$dim-assets',
-      title: '所属部门',
+      title: '所属组织',
       valueType: 'treeSelect',
       hideInTable: true,
       fieldProps: {

+ 8 - 8
src/pages/init-home/components/data/RoleData.ts

@@ -72,13 +72,13 @@ export default {
         { supportId: 'creator', name: '自己创建的', enabled: false, granted: false },
         {
           supportId: 'org',
-          name: '所在部门',
+          name: '所在组织',
           enabled: false,
           granted: false,
         },
         {
           supportId: 'org-include-children',
-          name: '所在部门及下级部门',
+          name: '所在组织及下级组织',
           enabled: false,
           granted: false,
         },
@@ -134,13 +134,13 @@ export default {
         { supportId: 'creator', name: '自己创建的', enabled: false, granted: false },
         {
           supportId: 'org',
-          name: '所在部门',
+          name: '所在组织',
           enabled: false,
           granted: false,
         },
         {
           supportId: 'org-include-children',
-          name: '所在部门及下级部门',
+          name: '所在组织及下级组织',
           enabled: false,
           granted: false,
         },
@@ -480,13 +480,13 @@ export default {
         { supportId: 'creator', name: '自己创建的', enabled: false, granted: false },
         {
           supportId: 'org',
-          name: '所在部门',
+          name: '所在组织',
           enabled: false,
           granted: false,
         },
         {
           supportId: 'org-include-children',
-          name: '所在部门及下级部门',
+          name: '所在组织及下级组织',
           enabled: false,
           granted: false,
         },
@@ -542,13 +542,13 @@ export default {
         { supportId: 'creator', name: '自己创建的', enabled: false, granted: false },
         {
           supportId: 'org',
-          name: '所在部门',
+          name: '所在组织',
           enabled: false,
           granted: false,
         },
         {
           supportId: 'org-include-children',
-          name: '所在部门及下级部门',
+          name: '所在组织及下级组织',
           enabled: false,
           granted: false,
         },

+ 19 - 9
src/pages/link/Channel/Modbus/Export/index.tsx

@@ -26,15 +26,25 @@ const Export = (props: Props) => {
   });
 
   useEffect(() => {
-    service.queryMaster({ paging: false }).then((resp) => {
-      if (resp.status === 200) {
-        const items = resp.result.map((item: { name: any; id: any }) => ({
-          label: item.name,
-          value: item.id,
-        }));
-        setList(items);
-      }
-    });
+    service
+      .queryMaster({
+        paging: false,
+        sorts: [
+          {
+            name: 'createTime',
+            order: 'desc',
+          },
+        ],
+      })
+      .then((resp) => {
+        if (resp.status === 200) {
+          const items = resp.result.map((item: { name: any; id: any }) => ({
+            label: item.name,
+            value: item.id,
+          }));
+          setList(items);
+        }
+      });
   }, []);
 
   const form = createForm();

+ 1 - 1
src/pages/notice/Config/SyncUser/index.tsx

@@ -170,7 +170,7 @@ const SyncUser = observer(() => {
               <Input.Search
                 onSearch={(value) => getDepartment(value)}
                 style={{ marginBottom: 8 }}
-                placeholder="请输入部门名称"
+                placeholder="请输入组织名称"
               />
               {treeData && treeData.length !== 0 ? (
                 <Tree

+ 1 - 1
src/pages/notice/Template/Detail/doc/DingTalk.tsx

@@ -33,7 +33,7 @@ const DingTalk = () => {
       <div className="image">
         <Image width="100%" src={agentId} />
       </div>
-      <h2> 3、收信人、收信部门</h2>
+      <h2> 3、收信人、收信组织</h2>
       <div>若不填写收信人,则在模板调试和配置告警通知时手动填写。</div>
       {/*<div> 收信人ID获取路径:“钉钉管理后台”--“通讯录”--“查看用户”</div>*/}
       {/*<div> 收信部门ID获取路径:“钉钉管理后台”--“通讯录”--“编辑部门”</div>*/}

+ 2 - 2
src/pages/notice/Template/Detail/doc/WeixinCorp.tsx

@@ -29,12 +29,12 @@ const WeixinCorp = () => {
         <div className="image">
           <Image width="100%" src={agentId} />
         </div>
-        <h2> 3、收信人ID、收信部门ID、标签推送</h2>
+        <h2> 3、收信人ID、收信组织ID、标签推送</h2>
         <div>
           接收通知的3种方式,3个字段若在此页面都没有填写,则在模板调试和配置告警通知时需要手动填写
         </div>
         <div> 收信人ID获取路径:【通讯录】-{'>'}【成员信息】查看成员账号</div>
-        <div> 收信部门ID获取路径:【通讯录】-{'>'}【部门信息】查看部门ID</div>
+        <div> 收信组织ID获取路径:【通讯录】-{'>'}【部门信息】查看部门ID</div>
         <div className="image">
           <Image width="100%" src={userId} />
           <Image width="100%" src={toDept} />

+ 4 - 4
src/pages/notice/Template/Detail/index.tsx

@@ -588,7 +588,7 @@ const Detail = observer(() => {
                         },
                       },
                       toParty: {
-                        title: '收信部门',
+                        title: '收信组织',
                         'x-component': 'Select',
                         'x-decorator': 'FormItem',
                         // 'x-decorator-props': {
@@ -596,7 +596,7 @@ const Detail = observer(() => {
                         //   gridSpan: 1,
                         // },
                         'x-component-props': {
-                          placeholder: '请选择收信部门',
+                          placeholder: '请选择收信组织',
                         },
                       },
                     },
@@ -794,7 +794,7 @@ const Detail = observer(() => {
                     },
                     properties: {
                       departmentIdList: {
-                        title: '收信部门',
+                        title: '收信组织',
                         // required: true,
                         'x-component': 'Select',
                         'x-decorator': 'FormItem',
@@ -803,7 +803,7 @@ const Detail = observer(() => {
                         //   gridSpan: 1,
                         // },
                         'x-component-props': {
-                          placeholder: '请选择收信部门',
+                          placeholder: '请选择收信组织',
                         },
                         // 'x-reactions': {
                         //   dependencies: ['configId'],

+ 1 - 1
src/pages/rule-engine/Alarm/Config/index.tsx

@@ -43,7 +43,7 @@ const Config = () => {
       key: 'targetType',
       name: '告警类型',
       type: 'string',
-      desc: '告警所属的业务类型,具体有产品、设备、部门、其他',
+      desc: '告警所属的业务类型,具体有产品、设备、组织、其他',
     },
     {
       key: 'targetId',

+ 2 - 2
src/pages/rule-engine/Alarm/Configuration/index.tsx

@@ -47,7 +47,7 @@ const Configuration = () => {
         const map = {
           product: '产品',
           device: '设备',
-          org: '部门',
+          org: '组织',
           other: '其他',
         };
         return map[text];
@@ -63,7 +63,7 @@ const Configuration = () => {
           status: 'device',
         },
         org: {
-          text: '部门',
+          text: '组织',
           status: 'org',
         },
         other: {

+ 2 - 2
src/pages/rule-engine/Alarm/Log/TabComponent/index.tsx

@@ -31,7 +31,7 @@ const titleMap = new Map();
 titleMap.set('product', '产品');
 titleMap.set('device', '设备');
 titleMap.set('other', '其他');
-titleMap.set('org', '部门');
+titleMap.set('org', '组织');
 
 const colorMap = new Map();
 colorMap.set(1, '#E50012');
@@ -107,7 +107,7 @@ const TabComponent = observer((props: Props) => {
   const orgCol: ProColumns<any>[] = [
     ...columns,
     {
-      title: '部门名称',
+      title: '组织名称',
       dataIndex: 'targetName',
       width: 200,
       ellipsis: true,

+ 1 - 1
src/pages/rule-engine/Alarm/Log/index.tsx

@@ -24,7 +24,7 @@ const Log = observer(() => {
     },
     {
       key: 'org',
-      tab: '部门',
+      tab: '组织',
     },
     {
       key: 'other',

+ 2 - 2
src/pages/rule-engine/DashBoard/index.tsx

@@ -250,7 +250,7 @@ const Dashboard = observer(() => {
     } else if (params.targetType === 'product') {
       tip = '产品';
     } else if (params.targetType === 'org') {
-      tip = '部门';
+      tip = '组织';
     }
 
     if (resp?.status === 200) {
@@ -412,7 +412,7 @@ const Dashboard = observer(() => {
                 options={[
                   { label: '设备', value: 'device' },
                   { label: '产品', value: 'product' },
-                  { label: '部门', value: 'org' },
+                  { label: '组织', value: 'org' },
                   { label: '其它', value: 'other' },
                 ]}
               />

+ 1 - 1
src/pages/rule-engine/Scene/Save/Explanation.tsx

@@ -35,7 +35,7 @@ export default ({ type }: { type: string }) => {
         <>
           <h2>1. 设备触发</h2>
           <div>
-            适用于多个不同设备间执行动作的联动。选择具体设备时支持指定产品下属的固定设备、全部设备或选择产品下归属于具体部门的设备
+            适用于多个不同设备间执行动作的联动。选择具体设备时支持指定产品下属的固定设备、全部设备或选择产品下归属于具体组织的设备
           </div>
           <div>
             <b>例如:</b>打开综合办部门房间门的时候,打开电灯、空调。

+ 1 - 1
src/pages/rule-engine/Scene/Save/action/VariableItems/org.tsx

@@ -63,7 +63,7 @@ export default (props: OrgProps) => {
           });
         }
       }}
-      placeholder={'请选择部门'}
+      placeholder={'请选择组织'}
     />
   );
 };

+ 3 - 3
src/pages/rule-engine/Scene/Save/trigger/index.tsx

@@ -185,7 +185,7 @@ export default observer((props: TriggerProps) => {
                     options={[
                       { label: '全部设备', value: 'all' },
                       { label: '固定设备', value: 'fixed' },
-                      { label: '按部门', value: 'org' },
+                      { label: '按组织', value: 'org' },
                     ]}
                     // fieldNames={{ label: 'name', value: 'id' }}
                     onSelect={(key: string) => {
@@ -211,12 +211,12 @@ export default observer((props: TriggerProps) => {
                 {selector === 'org' && (
                   <Form.Item
                     name={['trigger', 'device', 'selectorValues']}
-                    rules={[{ required: true, message: '请选择部门' }]}
+                    rules={[{ required: true, message: '请选择组织' }]}
                   >
                     <OrgTreeSelect
                       productId={productId}
                       fieldNames={{ label: 'name', value: 'id' }}
-                      placeholder={'请选择部门'}
+                      placeholder={'请选择组织'}
                       style={{ width: '100%' }}
                     />
                   </Form.Item>

+ 13 - 1
src/pages/system/Apply/Api/leftTree.tsx

@@ -62,8 +62,19 @@ export default (props: LeftTreeType) => {
     if (!data || !(data && Object.keys(data).length)) {
       return [];
     }
-    const newArr = data.tags.map((item: any) => ({ id: item.name, name: item.name, isLeaf: true }));
+    const array: any = [];
+    Object.keys(data.paths).forEach((a: any) => {
+      Object.keys(data.paths[a]).forEach((b) => {
+        const { tags } = data.paths[a][b];
+        array.push(tags[0]);
+      });
+    });
 
+    const newArr: any = [...new Set(array)].map((item: any) => ({
+      id: item,
+      name: item,
+      isLeaf: true,
+    }));
     Object.keys(data.paths).forEach((a: any) => {
       Object.keys(data.paths[a]).forEach((b) => {
         const { tags, ...extraData } = data.paths[a][b];
@@ -79,6 +90,7 @@ export default (props: LeftTreeType) => {
         }
       });
     });
+    // console.log(newArr)
     return newArr;
   };
 

+ 8 - 2
src/pages/system/Apply/Save/index.tsx

@@ -435,6 +435,7 @@ const Save = () => {
     'sso.configuration.oauth2.type': {
       type: 'string',
       title: '认证方式',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator-props': {
         gridSpan: 2,
@@ -464,6 +465,7 @@ const Save = () => {
     'sso.configuration.oauth2.clientId': {
       type: 'string',
       title: 'client_id',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator-props': {
         gridSpan: 2,
@@ -478,6 +480,7 @@ const Save = () => {
     'sso.configuration.oauth2.clientSecret': {
       type: 'string',
       title: 'client_secret',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator-props': {
         gridSpan: 2,
@@ -492,6 +495,7 @@ const Save = () => {
     'sso.configuration.oauth2.authorizationUrl': {
       type: 'string',
       title: '授权地址',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator-props': {
         gridSpan: 2,
@@ -506,6 +510,7 @@ const Save = () => {
     'sso.configuration.oauth2.tokenUrl': {
       type: 'string',
       title: 'token地址',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator-props': {
         gridSpan: 2,
@@ -520,6 +525,7 @@ const Save = () => {
     'sso.configuration.oauth2.userInfoUrl': {
       type: 'string',
       title: '用户信息地址',
+      required: true,
       'x-decorator': 'FormItem',
       'x-decorator-props': {
         gridSpan: 2,
@@ -1580,13 +1586,13 @@ const Save = () => {
                     },
                   },
                   'sso.orgIdList': {
-                    title: '部门',
+                    title: '组织',
                     'x-decorator': 'FormItem',
                     'x-component': 'TreeSelect',
                     'x-component-props': {
                       multiple: true,
                       showArrow: true,
-                      placeholder: '请选择部门',
+                      placeholder: '请选择组织',
                       showCheckedStrategy: ATreeSelect.SHOW_ALL,
                       filterOption: (input: string, option: any) =>
                         option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 8 - 8
src/pages/system/Apply/index.tsx

@@ -224,13 +224,13 @@ const Apply = () => {
         <PermissionButton
           isPermission={permission.delete}
           tooltip={{
-            title: record.state !== 'disabled' ? '删除' : '请先禁用该应用,再删除',
+            title: record.state.value !== 'disabled' ? '删除' : '请先禁用该应用,再删除',
           }}
           style={{ padding: 0 }}
-          disabled={record.state !== 'disabled'}
+          disabled={record.state.value !== 'disabled'}
           popConfirm={{
             title: '确认删除',
-            disabled: record.state !== 'disabled',
+            disabled: record.state.value !== 'disabled',
             onConfirm: async () => {
               const resp: any = await service.remove(record.id);
               if (resp.status === 200) {
@@ -357,12 +357,12 @@ const Apply = () => {
                 type={'link'}
                 style={{ padding: 0 }}
                 tooltip={{
-                  title: record.state !== 'disabled' ? '禁用' : '启用',
+                  title: record.state.value !== 'disabled' ? '禁用' : '启用',
                 }}
                 popConfirm={{
-                  title: `确认${record.state !== 'disabled' ? '禁用' : '启用'}`,
+                  title: `确认${record.state.value !== 'disabled' ? '禁用' : '启用'}`,
                   onConfirm: () => {
-                    if (record.state === 'disabled') {
+                    if (record.state.value === 'disabled') {
                       _action(record.id, {
                         state: 'enabled',
                       });
@@ -374,8 +374,8 @@ const Apply = () => {
                   },
                 }}
               >
-                {record.state !== 'disabled' ? <StopOutlined /> : <PlayCircleOutlined />}
-                {record.state !== 'disabled' ? '禁用' : '启用'}
+                {record.state.value !== 'disabled' ? <StopOutlined /> : <PlayCircleOutlined />}
+                {record.state.value !== 'disabled' ? '禁用' : '启用'}
               </PermissionButton>,
               (isPage(record.integrationModes) || isApiService(record.integrationModes)) && (
                 <Dropdown

+ 1 - 1
src/pages/system/Apply/typings.d.ts

@@ -7,7 +7,7 @@ type ApplyItem = {
   page?: Record<string, unknown>;
   apiServer?: Record<string, unknown>;
   sso?: Record<string, unknown>;
-  state: string;
+  state: any;
   creatorId: string;
   createTime: number;
 };

+ 4 - 4
src/pages/system/Department/Tree/tree.tsx

@@ -102,7 +102,7 @@ export default (props: TreeProps) => {
     properties: {
       parentId: {
         type: 'string',
-        title: '上级部门',
+        title: '上级组织',
         'x-decorator': 'FormItem',
         'x-component': 'TreeSelect',
         'x-component-props': {
@@ -110,7 +110,7 @@ export default (props: TreeProps) => {
             label: 'name',
             value: 'id',
           },
-          placeholder: '请选择上级部门',
+          placeholder: '请选择上级组织',
         },
         enum: treeData,
       },
@@ -188,7 +188,7 @@ export default (props: TreeProps) => {
         </div>
       )}
       <Input
-        placeholder={'请输入部门名称'}
+        placeholder={'请输入组织名称'}
         className={'left-tree-search'}
         suffix={<SearchOutlined />}
         onChange={debounce(onSearchChange, 500)}
@@ -280,7 +280,7 @@ export default (props: TreeProps) => {
                       tooltip={{
                         title: intl.formatMessage({
                           id: 'pages.system.department.option.add',
-                          defaultMessage: '新增子部门',
+                          defaultMessage: '新增子组织',
                         }),
                       }}
                       type="link"

+ 125 - 113
src/pages/system/Menu/Detail/edit.tsx

@@ -203,6 +203,15 @@ export default (props: EditProps) => {
                   </Form.Item>
                 </Col>
               </Row>
+              {props.data.appId && (
+                <Row gutter={[24, 0]}>
+                  <Col span={12}>
+                    <Form.Item name="appId" label="appId">
+                      <Input disabled />
+                    </Form.Item>
+                  </Col>
+                </Row>
+              )}
             </Col>
             <Col span={24}>
               <Form.Item name={'describe'} label={'说明'}>
@@ -211,127 +220,130 @@ export default (props: EditProps) => {
             </Col>
           </Row>
         </Card>
-        <Card style={{ marginTop: 24 }}>
-          <Title
-            title={'权限配置'}
-            // toolbarRender={
-            //   <Switch
-            //     disabled={disabled}
-            //     checkedChildren="开启"
-            //     unCheckedChildren="关闭"
-            //     checked={show}
-            //     onChange={(checked) => {
-            //       setShow(checked);
-            //     }}
-            //   />
-            // }
-          />
-          {show && (
-            <Row gutter={[0, 10]}>
-              <Col span={24}>
-                <Form.Item
-                  label={'数据权限控制'}
-                  tooltip={'此菜单页面数据所对应的资产类型'}
-                  name={'accessSupport'}
-                  required
-                >
-                  <Radio.Group
-                    onChange={(e) => {
-                      setAccessSupport(e.target.value);
-                    }}
-                    // disabled={disabled}
-                  >
-                    <Radio value={'unsupported'}>不支持</Radio>
-                    <Radio value={'support'}>支持</Radio>
-                    <Radio value={'indirect'}>
-                      间接控制
-                      <Tooltip
-                        placement="topLeft"
-                        title={'此菜单内的数据基于其他菜单的数据权限控制'}
-                      >
-                        <QuestionCircleFilled style={{ marginLeft: 8 }} />
-                      </Tooltip>
-                    </Radio>
-                  </Radio.Group>
-                </Form.Item>
-                {accessSupport === 'support' && (
+        {!props.data.appId && (
+          <Card style={{ marginTop: 24 }}>
+            <Title
+              title={'权限配置'}
+              // toolbarRender={
+              //   <Switch
+              //     disabled={disabled}
+              //     checkedChildren="开启"
+              //     unCheckedChildren="关闭"
+              //     checked={show}
+              //     onChange={(checked) => {
+              //       setShow(checked);
+              //     }}
+              //   />
+              // }
+            />
+            {show && (
+              <Row gutter={[0, 10]}>
+                <Col span={24}>
                   <Form.Item
-                    name={'assetType'}
-                    rules={[{ required: true, message: '请选择资产类型' }]}
+                    label={'数据权限控制'}
+                    tooltip={'此菜单页面数据所对应的资产类型'}
+                    name={'accessSupport'}
+                    required
                   >
-                    <Select
-                      style={{ width: 500 }}
+                    <Radio.Group
+                      onChange={(e) => {
+                        setAccessSupport(e.target.value);
+                      }}
                       // disabled={disabled}
-                      placeholder={'请选择资产类型'}
-                      options={
-                        assetsType
-                          ? assetsType.map((item: any) => ({ label: item.name, value: item.id }))
-                          : []
-                      }
-                    />
+                    >
+                      <Radio value={'unsupported'}>不支持</Radio>
+                      <Radio value={'support'}>支持</Radio>
+                      <Radio value={'indirect'}>
+                        间接控制
+                        <Tooltip
+                          placement="topLeft"
+                          title={'此菜单内的数据基于其他菜单的数据权限控制'}
+                        >
+                          <QuestionCircleFilled style={{ marginLeft: 8 }} />
+                        </Tooltip>
+                      </Radio>
+                    </Radio.Group>
                   </Form.Item>
-                )}
-                {accessSupport === 'indirect' && (
+                  {accessSupport === 'support' && (
+                    <Form.Item
+                      name={'assetType'}
+                      rules={[{ required: true, message: '请选择资产类型' }]}
+                    >
+                      <Select
+                        style={{ width: 500 }}
+                        // disabled={disabled}
+                        placeholder={'请选择资产类型'}
+                        options={
+                          assetsType
+                            ? assetsType.map((item: any) => ({ label: item.name, value: item.id }))
+                            : []
+                        }
+                      />
+                    </Form.Item>
+                  )}
+                  {accessSupport === 'indirect' && (
+                    <Form.Item
+                      name={'indirectMenus'}
+                      rules={[{ required: true, message: '请选择关联菜单' }]}
+                    >
+                      <TreeSelect
+                        style={{ width: 400 }}
+                        // disabled={disabled}
+                        multiple
+                        placeholder={'请选择关联菜单'}
+                        fieldNames={{ label: 'name', value: 'id' }}
+                        treeData={menuThree}
+                      />
+                    </Form.Item>
+                  )}
                   <Form.Item
-                    name={'indirectMenus'}
-                    rules={[{ required: true, message: '请选择关联菜单' }]}
+                    label={intl.formatMessage({
+                      id: 'page.system.menu.permissions',
+                      defaultMessage: '权限',
+                    })}
                   >
-                    <TreeSelect
-                      style={{ width: 400 }}
-                      // disabled={disabled}
-                      multiple
-                      placeholder={'请选择关联菜单'}
-                      fieldNames={{ label: 'name', value: 'id' }}
-                      treeData={menuThree}
-                    />
-                  </Form.Item>
-                )}
-                <Form.Item
-                  label={intl.formatMessage({
-                    id: 'page.system.menu.permissions',
-                    defaultMessage: '权限',
-                  })}
-                >
-                  <Input
-                    allowClear
-                    onChange={debounce(filterThree, 500)}
-                    style={{ width: 300, marginBottom: 12 }}
-                    placeholder={'请输入权限名称'}
-                  />
-                  <Form.Item name="permissions" noStyle>
-                    <Permission
-                      title={intl.formatMessage({
-                        id: 'page.system.menu.permissions.operate',
-                        defaultMessage: '权限操作',
-                      })}
-                      // disabled={disabled}
-                      data={permissions}
+                    <Input
+                      allowClear
+                      onChange={debounce(filterThree, 500)}
+                      style={{ width: 300, marginBottom: 12 }}
+                      placeholder={'请输入权限名称'}
                     />
+                    <Form.Item name="permissions" noStyle>
+                      <Permission
+                        title={intl.formatMessage({
+                          id: 'page.system.menu.permissions.operate',
+                          defaultMessage: '权限操作',
+                        })}
+                        // disabled={disabled}
+                        data={permissions}
+                      />
+                    </Form.Item>
                   </Form.Item>
-                </Form.Item>
-              </Col>
-            </Row>
-          )}
-          <PermissionButton
-            type="primary"
-            onClick={() => {
-              // if (disabled) {
-              //   setDisabled(false);
-              // } else {
-              //   saveData();
-              // }
-              saveData();
-            }}
-            loading={loading}
-            isPermission={getOtherPermission(['add', 'update'])}
-          >
-            {intl.formatMessage({
-              // id: `pages.data.option.${disabled ? 'edit' : 'save'}`,
-              id: `pages.data.option.save`,
-              defaultMessage: '编辑',
-            })}
-          </PermissionButton>
-        </Card>
+                </Col>
+              </Row>
+            )}
+            <PermissionButton
+              type="primary"
+              onClick={() => {
+                // if (disabled) {
+                //   setDisabled(false);
+                // } else {
+                //   saveData();
+                // }
+                saveData();
+              }}
+              loading={loading}
+              isPermission={getOtherPermission(['add', 'update'])}
+            >
+              {intl.formatMessage({
+                // id: `pages.data.option.${disabled ? 'edit' : 'save'}`,
+                id: `pages.data.option.save`,
+                defaultMessage: '编辑',
+              })}
+            </PermissionButton>
+          </Card>
+        )}
+
         <Form.Item hidden name={'id'}>
           <Input />
         </Form.Item>

+ 9 - 7
src/pages/system/Menu/Detail/index.tsx

@@ -55,13 +55,15 @@ export default () => {
           }),
           key: 'detail',
         },
-        {
-          tab: intl.formatMessage({
-            id: 'pages.system.menu.buttons',
-            defaultMessage: '按钮管理',
-          }),
-          key: 'buttons',
-        },
+        data?.appId
+          ? {}
+          : {
+              tab: intl.formatMessage({
+                id: 'pages.system.menu.buttons',
+                defaultMessage: '按钮管理',
+              }),
+              key: 'buttons',
+            },
       ]}
       onTabChange={(key) => {
         setTabKey(key);

+ 1 - 1
src/pages/system/Menu/Setting/baseMenu.ts

@@ -1325,7 +1325,7 @@ export default [
       },
       {
         code: 'system/Department',
-        name: '部门管理',
+        name: '组织管理',
         owner: 'iot',
         parentId: '3',
         id: '3-3',

+ 13 - 1
src/pages/system/Platforms/Api/leftTree.tsx

@@ -62,8 +62,19 @@ export default (props: LeftTreeType) => {
     if (!data || !(data && Object.keys(data).length)) {
       return [];
     }
-    const newArr = data.tags.map((item: any) => ({ id: item.name, name: item.name, isLeaf: true }));
+    const array: any = [];
+    Object.keys(data.paths).forEach((a: any) => {
+      Object.keys(data.paths[a]).forEach((b) => {
+        const { tags } = data.paths[a][b];
+        array.push(tags[0]);
+      });
+    });
 
+    const newArr: any = [...new Set(array)].map((item: any) => ({
+      id: item,
+      name: item,
+      isLeaf: true,
+    }));
     Object.keys(data.paths).forEach((a: any) => {
       Object.keys(data.paths[a]).forEach((b) => {
         const { tags, ...extraData } = data.paths[a][b];
@@ -79,6 +90,7 @@ export default (props: LeftTreeType) => {
         }
       });
     });
+    // console.log(newArr)
     return newArr;
   };
 

+ 2 - 2
src/pages/system/User/Save/index.tsx

@@ -343,13 +343,13 @@ const Save = (props: Props) => {
             },
           },
           orgIdList: {
-            title: '部门',
+            title: '组织',
             'x-decorator': 'FormItem',
             'x-component': 'TreeSelect',
             'x-component-props': {
               multiple: true,
               showArrow: true,
-              placeholder: '请选择部门',
+              placeholder: '请选择组织',
               showCheckedStrategy: ATreeSelect.SHOW_ALL,
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 1 - 1
src/utils/menu/router.ts

@@ -173,7 +173,7 @@ export const getDetailNameByCode = {
   'device/Product/Detail': '产品详情',
   'device/Instance/Detail': '设备详情',
   'device/Firmware/Task/Detail': '详情',
-  'system/Department/Detail': '部门详情',
+  'system/Department/Detail': '组织详情',
   'system/Role/Detail': '权限配置',
   'link/Type/Detail': '网络组件详情',
   'link/AccessConfig/Detail': '配置详情',