Commit a444fa6a authored by 邓晓峰's avatar 邓晓峰

fix: micro app toggle bug

parent b9347ed4
......@@ -7,6 +7,7 @@ function resolve (dir) {
}
const { REACT_APP_ENV } = process.env;
module.exports = {
base: '/civbase',
title: '熊猫智慧城市监控管理解决方案',
hash: true,
layout: {
......
......@@ -5,21 +5,21 @@ export default {
dev: [
{
name: 'civ_monitor',
entry: `//${window.location.hostname}:8082/civ_monitor`,
entry: `//${window.location.hostname}:8080/civ_monitor`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civ_monitor'),
activeRule: '/civbase/civ_monitor',
},
{
name: 'civ_water',
entry: `//${window.location.hostname}:8081/civ_water`,
entry: `//${window.location.hostname}:8082/civ_water`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civ_water'),
activeRule: '/civbase/civ_water',
},
{
name: 'civweb4',
entry: `//${window.location.hostname}:3020/civweb4`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb4'),
activeRule: '/civbase/civweb4',
},
],
prod: [
......
......@@ -102,47 +102,60 @@
}
},
"@ant-design/pro-layout": {
"version": "6.14.0",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-layout/-/pro-layout-6.14.0.tgz",
"integrity": "sha1-VrRcQ/aNxWuNyuU/YYCAkk6yNMM=",
"version": "6.19.0",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-layout/-/pro-layout-6.19.0.tgz",
"integrity": "sha1-w/Roy+8cgD4Vkzms7MwWiMfHG2k=",
"requires": {
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-provider": "1.4.4",
"@ant-design/pro-utils": "1.11.3",
"@umijs/route-utils": "^1.0.33",
"@ant-design/pro-provider": "1.4.12",
"@ant-design/pro-utils": "1.17.0",
"@umijs/route-utils": "^1.0.35",
"@umijs/use-params": "^1.0.2",
"classnames": "^2.2.6",
"omit.js": "^2.0.2",
"path-to-regexp": "2.4.0",
"rc-resize-observer": "^0.2.1",
"rc-util": "^5.0.6",
"react-copy-to-clipboard": "^5.0.1",
"swr": "^0.5.4",
"unstated-next": "^1.1.0",
"use-json-comparison": "^1.0.3",
"use-media-antd-query": "^1.0.3",
"use-url-search-params": "^2.3.13",
"use-media-antd-query": "^1.0.6",
"warning": "^4.0.3"
},
"dependencies": {
"@ant-design/pro-provider": {
"version": "1.4.4",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-provider/-/pro-provider-1.4.4.tgz",
"integrity": "sha1-Do0ngQx2fxfSPz7df/RGj429Nkk=",
"version": "1.4.12",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-provider/-/pro-provider-1.4.12.tgz",
"integrity": "sha1-OSqrklPugFozybPrPQeLxbyr+30=",
"requires": {
"rc-util": "^5.0.1"
}
},
"@ant-design/pro-utils": {
"version": "1.11.3",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-utils/-/pro-utils-1.11.3.tgz",
"integrity": "sha1-bi3dO32Y6znj3fxPiYIipPETg0k=",
"version": "1.17.0",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-utils/-/pro-utils-1.17.0.tgz",
"integrity": "sha1-qm8rbctcvuQpD2cu4c3JKAyrVdk=",
"requires": {
"@ant-design/icons": "^4.3.0",
"@ant-design/pro-provider": "1.4.4",
"@ant-design/pro-provider": "1.4.12",
"classnames": "^2.2.6",
"fast-deep-equal": "^3.1.3",
"moment": "^2.27.0",
"rc-util": "^5.0.6"
}
},
"swr": {
"version": "0.5.6",
"resolved": "https://g.civnet.cn:4873/swr/-/swr-0.5.6.tgz",
"integrity": "sha1-cL/pvJ16xJoGS+Sg9Kz1eYLlWjE=",
"requires": {
"dequal": "2.0.2"
}
},
"use-media-antd-query": {
"version": "1.0.7",
"resolved": "https://g.civnet.cn:4873/use-media-antd-query/-/use-media-antd-query-1.0.7.tgz",
"integrity": "sha1-TjC2UPUtmST8swzzVg7nOE9b0ls="
}
}
},
......@@ -9642,12 +9655,12 @@
}
},
"@umijs/route-utils": {
"version": "1.0.34",
"resolved": "https://g.civnet.cn:4873/@umijs%2froute-utils/-/route-utils-1.0.34.tgz",
"integrity": "sha512-5TUZCm5uuS3NbzdaoRDAfAIy6LDu+OCNL8xd+Dhth3YVFvbYkIeIG9/xl/5x1F+sWU8X/Oujlo6rfR8kgdB0Wg==",
"version": "1.0.37",
"resolved": "https://g.civnet.cn:4873/@umijs%2froute-utils/-/route-utils-1.0.37.tgz",
"integrity": "sha1-HOtRaYDUdUzi1ZWYeP5yJZCRqZA=",
"requires": {
"@qixian.cs/path-to-regexp": "^6.1.0",
"hash.js": "^1.1.7",
"fast-deep-equal": "^3.1.3",
"lodash.isequal": "^4.5.0",
"memoize-one": "^5.1.1"
}
......@@ -10721,6 +10734,11 @@
}
}
},
"@umijs/use-params": {
"version": "1.0.3",
"resolved": "https://g.civnet.cn:4873/@umijs%2fuse-params/-/use-params-1.0.3.tgz",
"integrity": "sha1-2R1r5oRtyHZd/YHFPO45U7M/HrI="
},
"@umijs/utils": {
"version": "3.3.7",
"resolved": "https://g.civnet.cn:4873/@umijs%2futils/-/utils-3.3.7.tgz",
......@@ -19751,6 +19769,7 @@
"version": "1.1.7",
"resolved": "https://g.civnet.cn:4873/hash.js/-/hash.js-1.1.7.tgz",
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
"dev": true,
"requires": {
"inherits": "^2.0.3",
"minimalistic-assert": "^1.0.1"
......@@ -20786,7 +20805,8 @@
"inherits": {
"version": "2.0.3",
"resolved": "https://g.civnet.cn:4873/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"ini": {
"version": "1.3.8",
......@@ -24838,7 +24858,8 @@
"minimalistic-assert": {
"version": "1.0.1",
"resolved": "https://g.civnet.cn:4873/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
"dev": true
},
"minimalistic-crypto-utils": {
"version": "1.0.1",
......@@ -29859,6 +29880,7 @@
"version": "5.0.3",
"resolved": "https://g.civnet.cn:4873/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.3.tgz",
"integrity": "sha1-KgYjsRFaHYyEFE6UNNM0K1r0GrQ=",
"dev": true,
"requires": {
"copy-to-clipboard": "^3",
"prop-types": "^15.5.8"
......@@ -37326,11 +37348,6 @@
"object-assign": "^4.1.1"
}
},
"use-url-search-params": {
"version": "2.3.13",
"resolved": "https://g.civnet.cn:4873/use-url-search-params/-/use-url-search-params-2.3.13.tgz",
"integrity": "sha1-AWAJyIefx/YxpYzepXLF3tghvzU="
},
"user-home": {
"version": "2.0.0",
"resolved": "https://g.civnet.cn:4873/user-home/-/user-home-2.0.0.tgz",
......@@ -92,7 +92,7 @@
"dependencies": {
"@ant-design/colors": "^5.0.1",
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-layout": "^6.14.0",
"@ant-design/pro-layout": "^6.18.1",
"@ant-design/pro-skeleton": "^1.0.0-beta.2",
"@ant-design/pro-table": "^2.5.3",
"@ant-design/pro-utils": "^1.10.4",
......@@ -122,7 +122,7 @@
"pinyin-match": "^1.1.1",
"promise.prototype.finally": "^3.1.2",
"prop-types": "15.7.2",
"qiankun": "^2.4.8",
"qiankun": "^2.4.1",
"qrcode.react": "^1.0.0",
"react": "16.12.0",
"react-dom": "16.12.0",
......
......@@ -2,7 +2,7 @@ import '!file-loader?name=[name].[ext]!./images/favicon.ico';
import './global.less';
// import '@babel/polyfill';
import 'animate.css/animate.css';
// import 'antd/dist/antd.less';
import 'antd/dist/antd.less';
import 'file-loader?name=.htaccess!./.htaccess'; // eslint-disable-line import/extensions
import 'kit_utils/lib/format';
import 'sanitize.css/sanitize.css';
......@@ -13,11 +13,17 @@ import 'sanitize.css/sanitize.css';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button, message, notification } from 'antd';
import {
Button,
message,
notification,
} from 'antd';
import { ConnectedRouter } from 'connected-react-router/immutable';
import Immutable from 'immutable';
import Cookies from 'js-cookie';
import { params, Storeage } from 'kit_utils';
import {
params,
Storeage,
} from 'kit_utils';
import { Provider } from 'react-redux';
import { useIntl } from '@/locales/localeExports';
......@@ -35,7 +41,10 @@ import { actionCreators } from './containers/App/store';
import { LocaleContainer } from './locales/locale';
import { initMicroApps } from './micro';
import Login from './pages/user/login/login';
import { getToken, isString } from './utils/utils';
import {
getToken,
isString,
} from './utils/utils';
const isHttps = document.location.protocol === 'https:';
const { pwa } = defaultSettings;
......
......@@ -38,7 +38,6 @@ const checkPermissions = (
validate: true,
};
}
debugger
const findIndex = data.findIndex(item => item.path === authority.path);
if (findIndex > -1) {
return {
......
import React from 'react';
import { List, Spin } from 'antd';
import {
List,
Spin,
} from 'antd';
import classNames from 'classnames';
import styles from './NoticeList.less';
import Alarm from './Templates/Alarm';
import Case from './Templates/Case';
......@@ -99,7 +103,6 @@ class NoticeList extends React.Component {
}
render() {
debugger
if (!this.props.data || this.props.data.length === 0) {
return <Empty emptyText={this.emptyText} />;
}
......
......@@ -2,9 +2,9 @@ import React from 'react';
import classNames from 'classnames';
import { isJSON } from '../../../../utils/utils';
import commonStyles from '../common.less';
import styles from './index.less';
import { isJSON } from '../../../../utils/utils';
export class NoticeContent {
// eslint-disable-next-line no-undef
......@@ -24,7 +24,6 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
: message.infoContent;
const goPath = item => {
// eslint-disable-next-line no-debugger
debugger;
// eslint-disable-next-line no-debugger
confirmRead(false, [message.id]);
handlerSysDetail && handlerSysDetail(message);
......
......@@ -3,6 +3,8 @@ import 'kit_logger';
import _ from 'lodash';
import MqttClient from 'mqtt-client';
import { noticeService } from '../../api';
import { isJSON } from '../../utils/utils';
import {
DEFAULT_KEEPLIVE,
DEFAULT_MQTT_PATH,
......@@ -22,8 +24,7 @@ import {
VIDEO_LEVEL,
} from './constants';
import createMessage from './message';
import { noticeService } from '../../api';
import { isJSON } from '../../utils/utils';
/* eslint-disable */
// eslint-disable-next-line no-undef
const Logger = logger('mqtt');
......@@ -508,7 +509,6 @@ class Notifier {
'request.preventCache': Date.now(),
}).then(res => {
if (res) {
debugger
const result = {
totalCount: res.totalRcdNum,
messages: (Array.isArray(res.getMe) ? res.getMe: []) .map(this.parseHisToMessage.bind(this)),
......
......@@ -15,6 +15,7 @@ const pkg = require('../../../package.json');
const config = require('../../../config/config');
const defaultSetting = config.layout;
function App(props) {
console.log(dyRoutes(props.menu || []).routes)
return (
<>
<Helmet
......
......@@ -6,7 +6,14 @@ import React, {
useState,
} from 'react';
import { Anchor, Button, Popover, Radio, Result, Spin } from 'antd';
import {
Anchor,
Button,
Popover,
Radio,
Result,
Spin,
} from 'antd';
import classNames from 'classnames';
import Cookies from 'js-cookie';
import { dom } from 'kit_utils';
......@@ -17,7 +24,10 @@ import RightContent from '@/components/GlobalHeader/RightContent';
import { Panel } from '@/components/SliderPanel';
import { actionCreators } from '@/containers/App/store';
import Authorized from '@/utils/Authorized';
import { findPathByLeafId, getBaseName } from '@/utils/utils';
import {
findPathByLeafId,
getBaseName,
} from '@/utils/utils';
import {
LeftOutlined,
LoadingOutlined,
......@@ -723,7 +733,6 @@ const BasicLayout = props => {
};
const handleUpdateCurrentIndex = index => {
debugger
props.updateCurrentIndex(index);
window.share && window.share.event.emit('trigger:updateMenuIndex', index);
}
......@@ -942,10 +951,9 @@ const BasicLayout = props => {
)}
openKeys={[...openKeys]}
menuProps={{
forceSubMenuRender: false,
forceSubMenuRender: true,
onClick: ({ item, key, keyPath, domEvent }) => {
debugger
console.log(item)
// console.log(item)
domEvent.persist();
const keyField = key.indexOf('/') > -1 ? 'path' : 'key';
const config = findPathByLeafId(
......@@ -954,7 +962,7 @@ const BasicLayout = props => {
'',
keyField,
);
console.log(config)
// console.log(key, keyPath)
props.updateComplexConfig({});
props.updateComplexPathName(null);
if (config && config.routes && config.routes.length > 0) {
......@@ -963,9 +971,10 @@ const BasicLayout = props => {
history.push(config.routes[0].path);
}
props.updateSelectedKeys(config.key);
props.updatePathname(config.key);
props.updateSelectedKeys(item.props.eventKey);
props.updatePathname(item.props.eventKey);
forceRender();
// window.history.pushState(null, '', '/civbase' + config.path);
},
onOpenChange: openKeys => {
props.updateOpenKeys(openKeys.length > 0 ? openKeys : []);
......
import 'kit_logger';
import {
addGlobalUncaughtErrorHandler,
initGlobalState,
registerMicroApps,
runAfterFirstMounted,
setDefaultMountApp,
start,
addGlobalUncaughtErrorHandler,
initGlobalState,
registerMicroApps,
runAfterFirstMounted,
setDefaultMountApp,
start,
} from 'qiankun';
import micorConfig, { genActiveRule } from '../config/micor';
......@@ -41,18 +41,11 @@ export const initMicroApps = (loader, store) => {
products.push({
name: item.PackageName,
entry: "//" + window.location.host + (`/${item.PackageName}`),
// item.RouteUrl.replace(
// // eslint-disable-next-line no-template-curly-in-string
// 'localhost:${port}',
// window.location.host,
// ) + (item.PackageName.indexOf('civweb4') > -1 ? `/${item.PackageName}` : `/${item.PackageName}`),
container: '#micro-container',
activeRule: genActiveRule(`/civbase/${item.PackageName}`),
props: item.DefaultSetting
})
});
console.log("products", products);
const entrys =
process.env.NODE_ENV !== 'production' ?
micorConfig.dev :
......@@ -114,7 +107,7 @@ export const initMicroApps = (loader, store) => {
},
singular: true,
scopedCSS: true,
prefetch: false,
prefetch: 'all',
// eslint-disable-next-line no-underscore-dangle
// getPublicPath: window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__,
excludeAssetFilter: url =>
......@@ -131,6 +124,7 @@ export const initMicroApps = (loader, store) => {
url.indexOf('restapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com/count') !== -1 ||
url.indexOf('restapi.amap.com/v3') !== -1 ||
url.indexOf('api.map.baidu.com') !== -1 ||
url.indexOf('map.baidu.com') !== -1 ||
url.indexOf('pv.sohu.com') !== -1 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment