Commit b2f2e106 authored by 李纪文's avatar 李纪文

Merge branch 'dev-cloud' into 'master'

Dev cloud See merge request !5
parents 67412605 79238d23
Pipeline #45037 passed with stages
in 8 minutes 1 second
......@@ -7497,6 +7497,14 @@
"turf": "^3.0.14"
}
},
"@wisdom-components/basictable": {
"version": "1.5.16",
"resolved": "https://g.civnet.cn:4873/@wisdom-components%2fbasictable/-/basictable-1.5.16.tgz",
"integrity": "sha512-JQpAldDk31bvXia5WnKirC+6s0gKGWXVVLncCdxS4dsKA2u+6imC9vnnwA4igIIS318D9jw0X9MGN+6h0JGJjQ==",
"requires": {
"classnames": "^2.2.6"
}
},
"@wisdom-components/empty": {
"version": "1.4.3",
"resolved": "https://g.civnet.cn:4873/@wisdom-components%2fempty/-/empty-1.4.3.tgz",
......@@ -12072,6 +12080,31 @@
"safer-buffer": "^2.1.0"
}
},
"echarts": {
"version": "5.3.0",
"resolved": "https://g.civnet.cn:4873/echarts/-/echarts-5.3.0.tgz",
"integrity": "sha512-zENufmwFE6WjM+24tW3xQq4ICqQtI0CGj4bDVDNd3BK3LtaA/5wBp+64ykIyKy3QElz0cieKqSYP4FX9Lv9MwQ==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://g.civnet.cn:4873/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha1-gDuM2rPhK6WBpMpByIObuw2ssJ4="
}
}
},
"echarts-for-react": {
"version": "3.0.2",
"resolved": "https://g.civnet.cn:4873/echarts-for-react/-/echarts-for-react-3.0.2.tgz",
"integrity": "sha1-rFhZFXBIoQZtRVPjSzKKuyTyt8E=",
"requires": {
"fast-deep-equal": "^3.1.3",
"size-sensor": "^1.0.1"
}
},
"editor": {
"version": "1.0.0",
"resolved": "https://g.civnet.cn:4873/editor/-/editor-1.0.0.tgz",
......@@ -27099,6 +27132,11 @@
"integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
"dev": true
},
"size-sensor": {
"version": "1.0.1",
"resolved": "https://g.civnet.cn:4873/size-sensor/-/size-sensor-1.0.1.tgz",
"integrity": "sha1-+E5GIG0+JZ+v8dVI5LO+ypMhnbs="
},
"skmeans": {
"version": "0.9.7",
"resolved": "https://g.civnet.cn:4873/skmeans/-/skmeans-0.9.7.tgz",
......@@ -32003,6 +32041,21 @@
"integrity": "sha1-6NV3TRwHOKR7z6hynzcS4t7d6yU=",
"dev": true
},
"zrender": {
"version": "5.3.0",
"resolved": "https://g.civnet.cn:4873/zrender/-/zrender-5.3.0.tgz",
"integrity": "sha512-Ln2QB5uqI1ftNYMtCRxd+XDq6MOttLgam2tmhKAVA+j0ko47UT+VNlDvKTkqe4K2sJhBvB0EhYNLebqlCTjatQ==",
"requires": {
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://g.civnet.cn:4873/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha1-gDuM2rPhK6WBpMpByIObuw2ssJ4="
}
}
},
"zwitch": {
"version": "1.0.5",
"resolved": "https://g.civnet.cn:4873/zwitch/-/zwitch-1.0.5.tgz",
......@@ -100,6 +100,7 @@
"@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.10.5",
"@wisdom-cesium/cesium": "^1.0.64",
"@wisdom-components/basictable": "^1.5.16",
"@wisdom-components/empty": "^1.4.1",
"@wisdom-map/arcgismap": "^1.0.60-0",
"@wisdom-map/util": "^1.0.27-0",
......@@ -110,6 +111,8 @@
"antd": "^4.17.4",
"compression": "1.7.4",
"connected-react-router": "6.4.0",
"echarts": "^5.3.0",
"echarts-for-react": "^3.0.2",
"fontfaceobserver": "2.1.0",
"history": "4.9.0",
"hoist-non-react-statics": "3.3.0",
......
......@@ -6,6 +6,8 @@ export const API = {
GET_DATA_DICTIONARY_LIST:
'/CityInterface/Services/CityServer_WorkFlow/REST/WorkFlowREST.svc/GetDataDictionaryList',
GET_ACCOUNT_PAGELIST: `/CityInterface/Services/CityServer_CaseManage/REST/CaseManageREST.svc/GetAccountPageList`,
// 云平台使用分析
LOGIN_STATISTIC: `${portalURL}/OMManage/LoginStatisticServer`,
FUNCTIONS_STATISTIC: `${portalURL}/OMManage/FunctionStatisticServer`,
......@@ -20,6 +22,12 @@ const services = {
type: constants.REQUEST_HTTP,
},
getAccountPageList: {
url: API.GET_ACCOUNT_PAGELIST,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
getLoginStatistic: {
url: API.LOGIN_STATISTIC,
method: constants.REQUEST_METHOD_GET,
......
This diff was suppressed by a .gitattributes entry.
......@@ -126,13 +126,13 @@ const GlobalHeaderRight = props => {
? props.global.get('homepage')
: props.global.get('homepage.url');
if(!props.global.get('home')) {
url = `civweb4/${url}`
url = `civweb4/${url.replace(/^\//, '').replace(/^civweb4\//, '')}`
}
window.share.event.emit('goHome', `/${url}`);
url ? (
window.share.event.emit('listenerMointer', {
label: '首页',
url: url,
url: url.replace(/^civweb4\//, ''),
})
) : null;
};
......@@ -224,10 +224,17 @@ const GlobalHeaderRight = props => {
<HomeIcon title={intl.formatMessage({id: 'component.header.icon.home'})} />
<span>首页</span>
</div>
{
// 云平台去掉常用菜单
props.global && props.global.userInfo && props.global.userInfo.Groups && props.global.userInfo.Groups.length
? null
: (
<div className={classNames(styles.item)} onClick={handlerFavitor} ref={favitorRef}>
<FavitorIcon></FavitorIcon>
<span>常用</span>
</div>
)
}
{/*<div className={classNames(styles.item)} onClick={handlerTheme}>*/}
{/* <ThemeIcon/>*/}
{/* <span>主题</span>*/}
......
......@@ -36,6 +36,10 @@ class NoticeIconView extends Component {
videoMessage: {},
};
// this.renderPlatform
try {
window.share && window.share.event && window.share.event.removeAllListeners('reloadNotice');
} catch (error) {
}
this.notifier = new Notifier(
this.props.global.userInfo,
this.renderVideo,
......@@ -48,6 +52,24 @@ class NoticeIconView extends Component {
async componentDidMount() {
this.notifier.subscribe(NEW_MESSAGE, this.onNewMessage.bind(this));
this.notifier.start();
window.share && window.share.event && window.share.event.on('reloadNotice', () => {
try {
// eslint-disable-next-line no-unused-expressions
this.notifier && this.notifier.stop();
} catch (error) {
// eslint-disable-next-line no-empty
} finally {
this.notifier = new Notifier(
this.props.global.userInfo,
this.renderVideo,
this.renderPlatform,
this.renderSysPlatform,
this.props,
);
this.notifier.subscribe(NEW_MESSAGE, this.onNewMessage.bind(this));
this.notifier.start();
}
});
}
componentWillUnmount() {
......@@ -57,6 +79,7 @@ class NoticeIconView extends Component {
} catch (error) {
// eslint-disable-next-line no-empty
} finally {
window.share.event.removeAllListeners('reloadNotice');
}
}
......
......@@ -299,10 +299,16 @@ const BasicLayout = props => {
currentChildrenRoute && currentChildrenRoute.routes ? setChildrenRoutes(currentChildrenRoute.routes): setChildrenRoutes([currentChildrenRoute]);
} else {
let url = _.isString(props.global.get('homepage'))
? props.global.get('homepage')
: props.global.get('homepage.url');
if(!props.global.get('home')) {
url = `civweb4/${url.replace(/^\//, '').replace(/^civweb4\//, '')}`
}
setChildrenRoutes([
{
icon: <HomeIcon/>,
path: props.location && props.location.pathname,
path: `/${url}`,
name: '首页'
}
])
......@@ -312,6 +318,8 @@ const BasicLayout = props => {
useEffect(() => {
console.log(props.route.routes);
}, [props.currentMenuIndex]);
useEffect(() => {
window.share && window.share.event && window.share.event.on('event:updateCurrentChildrenRoutes', ({currentPath, currentRoute, selectedIndex}) => {
currentRoute && currentRoute.parent && currentRoute.parent.routes ? setChildrenRoutes(currentRoute.parent.routes): !currentRoute.parent ? setChildrenRoutes(currentRoute.routes): setChildrenRoutes([currentRoute]);
setSelectIndex(selectedIndex);
......@@ -326,7 +334,27 @@ const BasicLayout = props => {
name: name
}
])
})
});
window.share && window.share.event && window.share.event.on('goHome', url => {
setChildrenRoutes([
{
icon: <HomeIcon/>,
path: url,
name: '首页'
}
]);
setTabActiveKey(url);
window.history.pushState(null, '', `/civbase${url}`);
});
return () => {
window.share && window.share.event && window.share.event.removeAllListeners('event:updateCurrentChildrenRoutes');
window.share && window.share.event && window.share.event.removeAllListeners('event:favitor');
window.share && window.share.event && window.share.event.removeAllListeners('goHome');
};
}, []);
useEffect(() => {
siteAction.setGlobalConfig(props.global);
if (!Cookies.get('token')) {
......@@ -352,21 +380,6 @@ const BasicLayout = props => {
}, [props.global]);
// setChildrenRoutes(currentChildrenRoute)
window.share.event.on('goHome', url => {
setChildrenRoutes([
{
icon: <HomeIcon/>,
path: url,
name: '首页'
}
]);
setTabActiveKey(url);
window.history.pushState(null, '', `/civbase${url}`);
});
/**
* web4全屏退出,切换三级菜单高亮
*/
......@@ -516,7 +529,7 @@ const BasicLayout = props => {
setCollapse(!collapse);
}
const logo = props.global && props.global.get('bannerLogo')? (props.global && _.isFunction(props.global.transformDevAssetsBaseURL) && props.global.transformDevAssetsBaseURL(props.global.get('bannerLogo'))): defaultSetting.logo;
const logo = props.global && _.isFunction(props.global.get) && props.global.get('bannerLogo')? (props.global && _.isFunction(props.global.transformDevAssetsBaseURL) && props.global.transformDevAssetsBaseURL(props.global.get('bannerLogo'))): defaultSetting.logo;
return (
<SecurityLayout loading>
......
......@@ -169,7 +169,7 @@ class Site {
self.globalConfig.userInfo.groupType = allStation[0].groupType;
}
}
if (allStation.length > 1) {
if (allStation.length > 0) {
self.currentStationName = arr[arr.length - 1];
self.citySelector = self.AvailableofRegionName(projectStation);
self.siteCityList = self.buildCitySelectTemple(projectStation);
......@@ -342,6 +342,25 @@ class Site {
self.setLoading(false);
// eslint-disable-next-line no-unused-expressions
self.props.updateCurrentIndex && self.props.updateCurrentIndex(0);
// 切换站点后,重置掉三级菜单
const homeType = self.globalConfig.homeType || 'civweb4';
const homePath =
self.globalConfig.homepage
? self.globalConfig.homepage.startsWith(homeType)
? self.globalConfig.homepage
: `/${homeType}/${self.globalConfig.homepage}`
: `/${homeType}`;
window.share && window.share.event && window.share.event.emit('event:favitor', {
name: "首页",
path: homePath,
icon: null,
});
// 重新加载订阅消息铃铛
window.share && window.share.event && window.share.event.emit('reloadNotice');
// window.history.replaceState(
// '',
// '',
......
......@@ -126,7 +126,7 @@ export const initMicroApps = () => {
global: globalStore.global
});
const globalConfig = window.globalConfig;
globalConfig.homepage = globalConfig.homepage && /civweb4/.test(globalConfig.homepage) ? config.homepage.replace(/civweb4\//, ''): globalConfig.homepage;
// globalConfig.homepage = globalConfig.homepage && /civweb4/.test(globalConfig.homepage) ? config.homepage.replace(/civweb4\//, ''): globalConfig.homepage;
console.log(globalConfig);
setGlobalState({
// eslint-disable-next-line no-undef
......@@ -228,7 +228,7 @@ export const defaultApp = () => {
// createStoreage.set('init_web4', true)
// }
// let homepage = config.homepage.replace('civweb4/', '');
const url = !config.home ? `/civbase/civweb4/${config.homepage.replace(/^\//, '')}`: `/civbase/${config.homepage.replace(/^\//, '')}`;
const url = !config.home ? `/civbase/civweb4/${config.homepage.replace(/^\//, '').replace(/^civweb4\//, '')}`: `/civbase/${config.homepage.replace(/^\//, '')}`;
setDefaultMountApp(url);
// if(config.homepage.indexOf('civweb4') > -1) createStoreage.set('init_web4', true);
}
......
......@@ -14,6 +14,8 @@ import LoginAction from '../user/login/login';
import styles from './index.less';
import { useHistory } from '@wisdom-utils/runtime';
import { initMicroApps } from '@/micro';
import usingIcon from '@/assets/bootPage/using-icon.png';
import { appService } from '@/api';
const industries = [
{ name: '供水', type: '供水', subTitle: 'WATER SUPPLY' },
......@@ -56,9 +58,10 @@ const renderIndustries = (config, callback) =>
}
});
let loginAction = null;
const BootPage = props => {
const [loadding, setLoadding] = useState(false);
const [hasRole, setHasRole] = useState(false);
const [scale, setScale] = useState(1);
const history = useHistory();
useDocumentTitle(
......@@ -70,24 +73,25 @@ const BootPage = props => {
event.preventDefault();
setLoadding(true);
const config = props.global;
const loginAction = new LoginAction(props);
// const loginAction = new LoginAction(props);
config.uiwidgets = [];
config.widgets = [];
config.allWidgets = [];
props.instance && props.instance.updateConfig(config);
// props.instance && props.instance.getUserInfoAndConfig('', true, type);
loginAction.getUserInfoAndConfig('', true, type);
loginAction && loginAction.getUserInfoAndConfig('', true, type);
// eslint-disable-next-line no-shadow
loginAction.events.on('toggleIndustry', event => {
setLoadding(false);
// props.history.push(`/?client=${props.global.client}`);
initMicroApps();
// 加载首页
history.push(props.global.homepage ?? `/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global);
props.updateCurrentIndex(0);
// window.location.reload();
});
// loginAction.events.on('toggleIndustry', event => {
// setLoadding(false);
// // props.history.push(`/?client=${props.global.client}`);
// debugger
// initMicroApps();
// // 加载首页
// history.push(props.global.homepage ?? `/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global);
// props.updateCurrentIndex(0);
// // window.location.reload();
// });
}, []);
useEffect(() => {
// eslint-disable-next-line no-use-before-define
......@@ -102,8 +106,20 @@ const BootPage = props => {
};
useEffect(() => {
window.addEventListener('resize', handleResize);
loginAction = new LoginAction(props);
loginAction.events.on('toggleIndustry', event => {
setLoadding(false);
props.history.push(`/?client=${props.global.client}`);
initMicroApps();
// 加载首页
// history.push(props.global.homepage ?? `/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global);
props.updateCurrentIndex(0);
// window.location.reload();
});
return () => {
window.removeEventListener('resize', handleResize);
loginAction.events.removeAllListeners('toggleIndustry');
};
});
const renderIndustr = useMemo(
......@@ -112,10 +128,26 @@ const BootPage = props => {
);
const intl = useIntl();
// const toOMSUsingAnalysis = e => {
// e && e.stopPropagation();
// props.history.push(`/omsUsingAnalysis`);
// }
const toOMSUsingAnalysis = e => {
e && e.stopPropagation();
props.history.push(`/usingAnalysis`);
};
useEffect(() => {
appService.getUserInfo({
token: props.global.token,
subOID: 'subOID',
site: 'cloud',
ignoreSite: true,
})
.then(res => {
const roles = res && !res.errMsg ? res.roles : null;
const _hasRole = roles && Array.isArray(roles) && roles.filter(r => {
return r.name == '客户运维管理员';
}).length;
setHasRole(!!_hasRole);
});
}, []);
return (
<SecurityLayout>
......@@ -157,11 +189,14 @@ const BootPage = props => {
<Spin spinning={loadding} size="large" />
</Space>
</div>
{/* <div class={styles['cloud-using-anaylysis-btn']}>
<div class="" onClick={toOMSUsingAnalysis}>
{hasRole ? (
<div className={styles.cloudMonitorBtns}>
<div class="cloud-using-anaylysis-btn" onClick={toOMSUsingAnalysis}>
<img src={usingIcon} alt="" title="点击查看平台使用监控" />
<span>平台使用分析</span>
</div>
</div> */}
</div>
) : null}
</div>
</SecurityLayout>
);
......
......@@ -127,7 +127,7 @@
transform: translate(-50%, -50%);
}
.cloud-using-anaylysis-btn {
.cloudMonitorBtns {
position: fixed;
height: 120px;
width: 100%;
......@@ -135,11 +135,27 @@
padding: 0 20px;
display: flex;
justify-content: end;
:global {
.cloud-using-anaylysis-btn {
cursor: pointer;
width: 100px;
display: flex;
flex-direction: column;
justify-content: center;
& > img {
width: 50px;
margin: 0 25px;
}
& > span {
color: #fff;
font-size: 20px;
font-size: 14px;
width: 100%;
text-align: center;
}
}
}
}
}
@media screen and (max-width: 1440px) {
......
This diff is collapsed.
@import '~antd/es/style/themes/default.less';
@background-color-container: #f5f5f5;
@border-radius: 2px;
.usingAnalysis {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
background-color: @background-color-container;
:global {
.@{ant-prefix}-spin-nested-loading,
.@{ant-prefix}-spin-container {
height: 100%;
}
.anticon {
vertical-align: 0.125em;
}
.back-btn {
font-size: 16px;
opacity: 0.75;
cursor: pointer;
line-height: 32px;
user-select: none;
.anticon {
transform: translateX(0px);
transition: transform 0.3s;
}
&:hover {
.anticon {
transform: translateX(-4px);
}
}
}
.cua-content {
width: 100%;
height: 100%;
min-width: 1150px;
// padding: 5px 8px;
// 顶部筛选条件
.cua-header {
background-color: #FFF;
border-radius: @border-radius;
padding: 8px;
display: flex;
align-items: center;
gap: 20px;
.filter-item {
min-width: 220px;
.@{ant-prefix}-select {
width: 140px;
}
}
.sub-title {
margin-left: auto;
font-size: 12px;
color: #aaa;
}
}
.counter-list {
margin-top: 4px;
display: flex;
gap: 4px;
.@{ant-prefix}-card {
flex: 1 1;
.@{ant-prefix}-card-body {
padding: 8px;
}
}
}
.cua-main {
height: calc(100% - 136px);
margin-top: 4px;
display: flex;
flex-direction: column;
.cua-main-middle {
flex: 1;
overflow: hidden;
width: 100%;
min-height: 200px;
margin-bottom: 5px;
display: flex;
justify-content: space-between;
gap: 4px;
}
.cua-main-bottom {
flex: none;
height: 50%;
width: 100%;
min-height: 320px;
display: flex;
justify-content: space-between;
gap: 4px;
.cua-customer-view {
padding: 10px;
.table-cell-bold {
font-weight: bold;
}
.@{ant-prefix}-table-thead th {
text-align: center;
}
}
}
.cua-chart-box {
flex: 1;
background-color: #FFF;
padding: 4px 8px 8px 8px;
display: flex;
flex-direction: column;
.cua-chart-header {
flex: none;
display: flex;
align-items: center;
.cua-chart-title {
font-weight: bold;
line-height: 32px;
&::before {
content: "";
display: inline-block;
width: 3px;
height: 14px;
background-color: #1890ff;
vertical-align: -0.125em;
margin-right: 8px;
}
}
.cua-chart-subtitle {
margin-left: auto;
}
}
.cua-chart-content {
flex: 1;
overflow: hidden;
}
&.enviromentusing-chart-box {
.cua-chart-content {
overflow: visible;
}
}
}
}
}
}
}
.login-log-modal {
:global {
.login-log-modal-header {
display: flex;
margin-bottom: 16px;
.@{ant-prefix}-form-item {
margin-bottom: 0;
margin-right: 8px;
}
}
.login-log-modal-content {
height: 500px;
}
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import Iframe from '../pages/iframe';
import Login from '../pages/user/login';
import CommonMenu from '../pages/commonMenu';
import NoSecret from '../pages/user/login/noSecret';
import UsingAnalysis from '../pages/cloudOMS/usingAnalysis';
export const dyRoutes = (routes, layout) => {
// eslint-disable-next-line no-shadow
......@@ -34,6 +35,10 @@ export const dyRoutes = (routes, layout) => {
path: '/industry',
component: BootPage,
},
{
path: '/usingAnalysis',
component: UsingAnalysis,
},
{
path: '/',
component: BasicLayout,
......
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