Forráskód Böngészése

fix: 页面集成

wzyyy 3 éve
szülő
commit
b31e3c2a74

+ 1 - 1
src/app.tsx

@@ -356,7 +356,7 @@ export function patchRoutes(routes: any) {
       ],
       ],
     };
     };
     basePath.routes = [...basePath.routes, baseRedirect];
     basePath.routes = [...basePath.routes, baseRedirect];
-    console.log(basePath.routes);
+    // console.log(basePath.routes);
   }
   }
 }
 }
 
 

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

@@ -23,10 +23,13 @@ const Bind = () => {
   const Vector = require('/public/images/bind/Vector.png');
   const Vector = require('/public/images/bind/Vector.png');
   const Rectangle = require('/public/images/bind/Rectangle.png');
   const Rectangle = require('/public/images/bind/Rectangle.png');
   const logo = require('/public/images/bind/jetlinksLogo.png');
   const logo = require('/public/images/bind/jetlinksLogo.png');
+  // const defaultImg = require('/public/images/apply/provider1.png');
 
 
   const iconMap = new Map();
   const iconMap = new Map();
   iconMap.set('dingtalk-ent-app', require('/public/images/notice/dingtalk.png'));
   iconMap.set('dingtalk-ent-app', require('/public/images/notice/dingtalk.png'));
   iconMap.set('wechat-webapp', require('/public/images/notice/wechat.png'));
   iconMap.set('wechat-webapp', require('/public/images/notice/wechat.png'));
+  iconMap.set('internal-standalone', require('/public/images/apply/provider1.png'));
+  iconMap.set('third-party', require('/public/images/apply/provider5.png')); //三方
 
 
   const bindUserInfo = (params: any) => {
   const bindUserInfo = (params: any) => {
     service.bindUserInfo(params).then((res) => {
     service.bindUserInfo(params).then((res) => {
@@ -220,7 +223,7 @@ const Bind = () => {
                     <div style={{ height: 100, marginTop: 10, marginBottom: 10 }}>
                     <div style={{ height: 100, marginTop: 10, marginBottom: 10 }}>
                       <img
                       <img
                         style={{ height: 70 }}
                         style={{ height: 70 }}
-                        src={iconMap.get(bindUser?.applicationProvider)}
+                        src={iconMap.get(bindUser?.applicationProvider) || defaultImg}
                       />
                       />
                     </div>
                     </div>
                     <p className={styles.fonts}>用户名:{bindUser?.result?.username || '-'}</p>
                     <p className={styles.fonts}>用户名:{bindUser?.result?.username || '-'}</p>

+ 12 - 5
src/pages/account/Center/index.tsx

@@ -41,10 +41,12 @@ const Center = () => {
   const iconMap = new Map();
   const iconMap = new Map();
   iconMap.set('dingtalk-ent-app', require('/public/images/notice/dingtalk.png'));
   iconMap.set('dingtalk-ent-app', require('/public/images/notice/dingtalk.png'));
   iconMap.set('wechat-webapp', require('/public/images/notice/wechat.png'));
   iconMap.set('wechat-webapp', require('/public/images/notice/wechat.png'));
+  iconMap.set('internal-standalone', require('/public/images/apply/provider1.png'));
+  iconMap.set('third-party', require('/public/images/apply/provider5.png'));
 
 
-  const nameMap = new Map();
-  nameMap.set('dingtalk-ent-app', '钉钉');
-  nameMap.set('wechat-webapp', '微信');
+  // const nameMap = new Map();
+  // nameMap.set('dingtalk-ent-app', '钉钉');
+  // nameMap.set('wechat-webapp', '微信');
 
 
   const bGroundMap = new Map();
   const bGroundMap = new Map();
   bGroundMap.set('dingtalk-ent-app', require('/public/images/notice/dingtalk-background.png'));
   bGroundMap.set('dingtalk-ent-app', require('/public/images/notice/dingtalk-background.png'));
@@ -250,7 +252,10 @@ const Center = () => {
             <Col key={item.id}>
             <Col key={item.id}>
               <Card
               <Card
                 style={{
                 style={{
-                  background: `url(${bGroundMap.get(item.provider)}) no-repeat`,
+                  background: `url(${
+                    bGroundMap.get(item.provider) ||
+                    require('/public/images/notice/dingtalk-background.png')
+                  }) no-repeat`,
                   backgroundSize: '100% 100%',
                   backgroundSize: '100% 100%',
                   width: 415,
                   width: 415,
                 }}
                 }}
@@ -275,7 +280,9 @@ const Center = () => {
                         </div>
                         </div>
                       </div>
                       </div>
                     ) : (
                     ) : (
-                      <div style={{ fontSize: '22px' }}>{nameMap.get(item.provider)}未绑定</div>
+                      <div style={{ fontSize: '22px', width: 150 }}>
+                        <Ellipsis title={`${item.name}未绑定`} />
+                      </div>
                     )}
                     )}
                   </div>
                   </div>
                   <div>
                   <div>

+ 5 - 0
src/pages/iframe/index.tsx

@@ -1,6 +1,11 @@
 import { PageContainer } from '@ant-design/pro-layout';
 import { PageContainer } from '@ant-design/pro-layout';
+import { useEffect } from 'react';
+import { useLocation } from 'umi';
 
 
 const Iframe = () => {
 const Iframe = () => {
+  const location = useLocation();
+  console.log(location, 22222);
+  useEffect(() => {}, []);
   return (
   return (
     <PageContainer>
     <PageContainer>
       <iframe
       <iframe

+ 0 - 30
src/pages/system/Apply/Save/index.tsx

@@ -120,7 +120,6 @@ const Save = () => {
   };
   };
   const getRole = () => service.queryRoleList();
   const getRole = () => service.queryRoleList();
   const getOrg = () => service.queryOrgList();
   const getOrg = () => service.queryOrgList();
-  const getOwner = (data: any) => service.queryOwner(data);
 
 
   const useAsyncData = (api: any) => (fields: Field) => {
   const useAsyncData = (api: any) => (fields: Field) => {
     fields.loading = true;
     fields.loading = true;
@@ -158,12 +157,6 @@ const Save = () => {
               form1.setFieldState('integrationModes', (f1) => {
               form1.setFieldState('integrationModes', (f1) => {
                 f1.hidden = false;
                 f1.hidden = false;
                 f1.value = [];
                 f1.value = [];
-                // console.log(f1.value)
-                // debugger;
-                // f1.value = [''];
-                // console.log(f1.value)
-                // debugger;
-                // console.log(f1.value)
               });
               });
               break;
               break;
             case 'internal-integrated':
             case 'internal-integrated':
@@ -1204,28 +1197,6 @@ const Save = () => {
               header: '页面集成',
               header: '页面集成',
             },
             },
             properties: {
             properties: {
-              'page.owner': {
-                type: 'string',
-                title: '所属系统',
-                'x-decorator': 'FormItem',
-                'x-decorator-props': {
-                  gridSpan: 2,
-                  layout: 'vertical',
-                  labelAlign: 'left',
-                },
-                required: true,
-                'x-component': 'Select',
-                'x-component-props': {
-                  placeholder: '请输入接入地址',
-                },
-                // 'x-reactions': '{{useAsyncDataSource(getOwner(["iot"]))}}',
-                // 'x-reactions': {
-                //   dependencies: ['configId'],
-                //   fulfill: {
-                //     run: '{{useAsyncDataSource(getAliyunSigns($deps[0]))}}',
-                //   },
-                // },
-              },
               'page.baseUrl': {
               'page.baseUrl': {
                 type: 'string',
                 type: 'string',
                 title: '接入地址',
                 title: '接入地址',
@@ -1572,7 +1543,6 @@ const Save = () => {
                   getProvidersAll,
                   getProvidersAll,
                   getRole,
                   getRole,
                   getOrg,
                   getOrg,
-                  getOwner,
                 }}
                 }}
               />
               />
               <FormButtonGroup.Sticky>
               <FormButtonGroup.Sticky>

+ 30 - 1
src/pages/system/Menu/Setting/index.tsx

@@ -151,7 +151,36 @@ export default observer(() => {
   };
   };
 
 
   const getSystemMenu = () => {
   const getSystemMenu = () => {
-    service.queryMenuThree({ paging: false }).then((res) => {
+    const item = {
+      terms: [
+        {
+          terms: [
+            {
+              column: 'owner',
+              termType: 'eq',
+              value: 'iot',
+            },
+          ],
+        },
+        {
+          terms: [
+            {
+              column: 'owner',
+              termType: 'notnull',
+              value: '1',
+            },
+            {
+              column: 'appId',
+              termType: 'notnull',
+              value: '1',
+              type: 'and',
+            },
+          ],
+          type: 'or',
+        },
+      ],
+    };
+    service.queryMenuThree({ paging: false, terms: [item] }).then((res) => {
       if (res.status === 200) {
       if (res.status === 200) {
         MenuSettingModel.menuData = [...res.result];
         MenuSettingModel.menuData = [...res.result];
         MenuSettingModel.notDragKeys = getKeys(res.result);
         MenuSettingModel.notDragKeys = getKeys(res.result);

+ 2 - 0
src/utils/menu/index.ts

@@ -225,6 +225,7 @@ export const handleRoutes = (routes?: MenuItem[], level = 1): MenuItem[] => {
  * @param level 路由层级
  * @param level 路由层级
  */
  */
 const getRoutes = (extraRoutes: MenuItem[], level = 1): IRouteProps[] => {
 const getRoutes = (extraRoutes: MenuItem[], level = 1): IRouteProps[] => {
+  console.log(extraRoutes, 1111111111);
   const allComponents = findComponents(require.context('@/pages', true, /index(\.tsx)$/));
   const allComponents = findComponents(require.context('@/pages', true, /index(\.tsx)$/));
   return extraRoutes.map((route) => {
   return extraRoutes.map((route) => {
     const component = allComponents[route.code] || null;
     const component = allComponents[route.code] || null;
@@ -249,6 +250,7 @@ const getRoutes = (extraRoutes: MenuItem[], level = 1): IRouteProps[] => {
         : flatRoutes;
         : flatRoutes;
     } else if (component) {
     } else if (component) {
       _route.component = component;
       _route.component = component;
+      // console.log(component)
     }
     }
 
 
     if (level !== 1) {
     if (level !== 1) {