Commit 6f47cde1 authored by 周宏民's avatar 周宏民

pref: 新源片区介绍取台账

parent ff5a5bb3
Pipeline #95054 waiting for manual action with stages
...@@ -8,7 +8,7 @@ import React, { useEffect, useMemo, useState, useRef } from 'react'; ...@@ -8,7 +8,7 @@ import React, { useEffect, useMemo, useState, useRef } from 'react';
import { message } from 'antd'; import { message } from 'antd';
import { appService } from '@/api'; import { appService } from '@/api';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import _ from 'lodash'; import _, { cloneDeep } from 'lodash';
import LoadPage from '@/components/LoadPage'; import LoadPage from '@/components/LoadPage';
import LoginAction from '@/pages/user/login/login'; import LoginAction from '@/pages/user/login/login';
import { defaultApp } from '@/micro'; import { defaultApp } from '@/micro';
...@@ -26,6 +26,8 @@ import styles from './index.less'; ...@@ -26,6 +26,8 @@ import styles from './index.less';
import VillagePage from './components/VillagePage'; import VillagePage from './components/VillagePage';
import CityPage from './components/CityPage'; import CityPage from './components/CityPage';
import { imgMap } from './components/imgImport'; import { imgMap } from './components/imgImport';
const assetPath = `${window.location.origin}/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles`;
const IntegrationXinyuan = props => { const IntegrationXinyuan = props => {
const clientRef = useRef(props.global.client); const clientRef = useRef(props.global.client);
const progressRef2 = useRef(0); const progressRef2 = useRef(0);
...@@ -41,7 +43,18 @@ const IntegrationXinyuan = props => { ...@@ -41,7 +43,18 @@ const IntegrationXinyuan = props => {
const [integrationData, setIntegrationData] = useState({}); // 所有子站 const [integrationData, setIntegrationData] = useState({}); // 所有子站
const [loginAction, setAction] = useState(() => new LoginAction(props)); const [loginAction, setAction] = useState(() => new LoginAction(props));
const [infoData, setInfoData] = useState({
城区供水: {
title: '源益水暖-城区供水',
img: imgMap['城区供水'],
content: '',
},
乡镇供水: {
title: '水利局-乡镇供水',
img: imgMap['乡镇供水'],
content: '',
},
});
const { clear } = useAliveController(); const { clear } = useAliveController();
const history = useHistory(); const history = useHistory();
const [showPage, setShowPage] = useState('homePage'); const [showPage, setShowPage] = useState('homePage');
...@@ -86,6 +99,31 @@ const IntegrationXinyuan = props => { ...@@ -86,6 +99,31 @@ const IntegrationXinyuan = props => {
timer2.current = null; timer2.current = null;
}, time * 1000); }, time * 1000);
}; };
const getInfo = () => {
appService
.getAccountPageList({
ignoreSite: true,
accountName: '供水片区',
isAll: true,
})
.then(res => {
if (res.code === 0) {
const str = res.data?.jsonData;
const data = str ? JSON.parse(str) : [];
const obj = cloneDeep(infoData);
data.forEach(item => {
if (obj[item['片区名称']]) {
obj[item['片区名称']].content = item['片区概况'] || obj[item['片区名称']].content;
obj[item['片区名称']].title = item['片区标题'] || obj[item['片区名称']].title;
if (item['风貌图']) {
obj[item['片区名称']].img = `${assetPath}?filePath=${item['风貌图']}`;
}
}
});
setInfoData(obj);
}
});
};
const getData = async () => { const getData = async () => {
// '站点_新源县农村饮水安全工程服务站','villagePage' // '站点_新源县农村饮水安全工程服务站','villagePage'
// '站点_新源县源益水暖有限责任公司', 'cityPage' // '站点_新源县源益水暖有限责任公司', 'cityPage'
...@@ -118,6 +156,7 @@ const IntegrationXinyuan = props => { ...@@ -118,6 +156,7 @@ const IntegrationXinyuan = props => {
page = 'villagePage'; page = 'villagePage';
} }
} }
auth.includes('homePage') && getInfo();
setPageAuth(auth); setPageAuth(auth);
if (!auth.length) { if (!auth.length) {
loginAction.getUserInfoAndConfig('', true); loginAction.getUserInfoAndConfig('', true);
...@@ -345,20 +384,20 @@ const IntegrationXinyuan = props => { ...@@ -345,20 +384,20 @@ const IntegrationXinyuan = props => {
<div className={classNames(styles.tip3)}> <div className={classNames(styles.tip3)}>
<img src={imgMap['东部乡镇供水工程']} alt="" /> <img src={imgMap['东部乡镇供水工程']} alt="" />
</div> </div>
{infoData['乡镇供水'] ? (
<div className={classNames(styles.tip4)}> <div className={classNames(styles.tip4)}>
<div className={classNames(styles.tip_title)}>水利局-乡镇供水</div> <div className={classNames(styles.tip_title)}>{infoData['乡镇供水'].title}</div>
<img src={imgMap['乡镇供水']} alt="" /> <img src={infoData['乡镇供水'].img} alt="" />
<div className={classNames(styles.tip_content)}> <div className={classNames(styles.tip_content)}>{infoData['乡镇供水'].content}</div>
新源县水利局成立于1964年,至今已有58年历史。合同内增加两座水厂,一座日供水3.5万立方米(第十标段建设),一座日供水5万立方米(援疆项目资金两座新水厂建设位置紧挨现有新源县老水厂,调度大楼在3.5w立方米水厂。
</div>
</div> </div>
) : null}
{infoData['城区供水'] ? (
<div className={classNames(styles.tip5)}> <div className={classNames(styles.tip5)}>
<div className={classNames(styles.tip_title)}>源益水暖-城区供水</div> <div className={classNames(styles.tip_title)}>{infoData['城区供水'].title}</div>
<img src={imgMap['城区供水']} alt="" /> <img src={infoData['城区供水'].img} alt="" />
<div className={classNames(styles.tip_content)}> <div className={classNames(styles.tip_content)}>{infoData['城区供水'].content}</div>
新源县水利局成立于1964年,至今已有58年历史。合同内增加两座水厂,一座日供水3.5万立方米(第十标段建设),一座日供水5万立方米(援疆项目资金两座新水厂建设位置紧挨现有新源县老水厂,调度大楼在3.5w立方米水厂。{' '}
</div>
</div> </div>
) : null}
</div> </div>
) : null} ) : null}
{showPage === 'villagePage' ? ( {showPage === 'villagePage' ? (
......
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