Commit 70a133a4 authored by 皮倩雯's avatar 皮倩雯

web配置新增同步地图组件功能

parent c45f3976
Pipeline #59968 waiting for manual action with stages
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import { notification, Spin, Tabs } from 'antd'; import { notification, Spin, Tabs, Button } from 'antd';
import { import {
getWebModuleTree, getWebModuleTree,
getWebconfig, getWebconfig,
...@@ -13,6 +13,7 @@ import { ...@@ -13,6 +13,7 @@ import {
addWebsite, addWebsite,
editWebsite, editWebsite,
omsDeleteWebsite, omsDeleteWebsite,
SyncMapComponent,
} from '@/services/webConfig/api'; } from '@/services/webConfig/api';
import { EditTwoTone, ExclamationCircleOutlined } from '@ant-design/icons'; import { EditTwoTone, ExclamationCircleOutlined } from '@ant-design/icons';
import Modal from 'antd/lib/modal/Modal'; import Modal from 'antd/lib/modal/Modal';
...@@ -104,6 +105,7 @@ const WebConfigPage = props => { ...@@ -104,6 +105,7 @@ const WebConfigPage = props => {
), ),
].flat(2); ].flat(2);
if (!canceled.cancel) { if (!canceled.cancel) {
console.log(websArr);
setWebs(websArr); setWebs(websArr);
if (!curWeb) setCurWeb(websArr[0]); if (!curWeb) setCurWeb(websArr[0]);
setLoading(false); setLoading(false);
...@@ -294,6 +296,26 @@ const WebConfigPage = props => { ...@@ -294,6 +296,26 @@ const WebConfigPage = props => {
updateModuleTree(userMode || 'super'); updateModuleTree(userMode || 'super');
}; };
const SyncMap = e => {
console.log(e);
SyncMapComponent({ visible: e.subSystemValue }).then(res => {
if (res.code == 0) {
notification.success({
message: '提示',
duration: 3,
description: '同步成功',
});
updateModuleTree(userMode || 'super');
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
const renderTabPane = tabPaneItem => ( const renderTabPane = tabPaneItem => (
<TabPane key={tabPaneItem.id} tab={tabPaneItem.text}> <TabPane key={tabPaneItem.id} tab={tabPaneItem.text}>
<> <>
...@@ -308,6 +330,17 @@ const WebConfigPage = props => { ...@@ -308,6 +330,17 @@ const WebConfigPage = props => {
> >
<EditTwoTone /> 查看/编辑网站配置 <EditTwoTone /> 查看/编辑网站配置
</span> </span>
<div style={{ display: 'inline-block', float: 'right', marginTop: '-15px' }}>
<strong style={{ marginRight: '15px' }}>
当前网站已存在地图组件数量(
<span style={{ color: '#1890ff' }}>{tabPaneItem.existMapComponent}</span>
<span>/</span>
<span>{tabPaneItem.mapComponent})</span>
</strong>
<Button type="primary" onClick={() => SyncMap(tabPaneItem)}>
同步地图组件
</Button>
</div>
<MenuConfig <MenuConfig
menu={tabPaneItem?.children.find(w => w.menuType === 'Web4MenuRoot')} menu={tabPaneItem?.children.find(w => w.menuType === 'Web4MenuRoot')}
onUpdate={handleUpdateOnMenuChange} onUpdate={handleUpdateOnMenuChange}
......
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