Commit 8fa4e3c8 authored by 皮倩雯's avatar 皮倩雯

fix: '优化平台中心功能模块'

parent e41f5166
Pipeline #46416 skipped with stages
...@@ -30,7 +30,8 @@ const ListCardItem = props => { ...@@ -30,7 +30,8 @@ const ListCardItem = props => {
.flat(Infinity); .flat(Infinity);
setChildrenKeys(keys); setChildrenKeys(keys);
} }
if (checkIsGroup(changedItem.item)) { // 父复选框
if (localStorage.getItem('aa') == 1) {
// 菜单组当前项,完整一次循环当前项不变 // 菜单组当前项,完整一次循环当前项不变
if (isGroup) { if (isGroup) {
if (childrenKeys.every(c => valueList.includes(c))) { if (childrenKeys.every(c => valueList.includes(c))) {
...@@ -47,7 +48,7 @@ const ListCardItem = props => { ...@@ -47,7 +48,7 @@ const ListCardItem = props => {
setIndeterminate(false); setIndeterminate(false);
} }
} }
} else { } else if (localStorage.getItem('aa') == 0) {
// eslint-disable-next-line no-lonely-if // eslint-disable-next-line no-lonely-if
if ( if (
isGroup && isGroup &&
...@@ -95,17 +96,26 @@ const ListCardItem = props => { ...@@ -95,17 +96,26 @@ const ListCardItem = props => {
setIndeterminate(false); setIndeterminate(false);
} }
} }
}, [flag, flag1]); // 全选刷新,首次进入刷新标识 }, [flag, flag1]); // 最外层全选刷新,首次进入刷新标识,点击父复选框
// 勾选事件处理 // 勾选事件处理
const handleChecked = e => { const handleChecked = e => {
const { checked: v } = e.target; const { checked: v } = e.target;
console.log(e);
console.log(v);
if (isGroup) { if (isGroup) {
let aa = item.children.find(i => i.type == 'widgetGroup');
if (aa) {
localStorage.setItem('aa', 1);
} else {
localStorage.setItem('aa', 0);
}
const result = [...childrenKeys, id]; const result = [...childrenKeys, id];
updateValueList(v ? result : [], result, { item, value: v }); updateValueList(v ? result : [], result, { item, value: v });
setIndeterminate(false); setIndeterminate(false);
} else { } else {
updateValueList(v ? [id] : [], [id], { item, value: v }); updateValueList(v ? [id] : [], [id], { item, value: v });
localStorage.setItem('aa', 0);
} }
}; };
......
...@@ -64,7 +64,7 @@ const ListCard = props => { ...@@ -64,7 +64,7 @@ const ListCard = props => {
}, [dataList, loading, checkList]); }, [dataList, loading, checkList]);
// 处理选中的值 // 处理选中的值
const updateValueList = (checkedKeys, childrenKeys, sourceItem, aa) => { const updateValueList = (checkedKeys, childrenKeys, sourceItem) => {
const removekeys = _.difference(childrenKeys, checkedKeys); const removekeys = _.difference(childrenKeys, checkedKeys);
let result = _.uniq(_.union(checkedKeys, valueList)); let result = _.uniq(_.union(checkedKeys, valueList));
_.remove(result, v => removekeys.includes(v)); _.remove(result, v => removekeys.includes(v));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-03-04 18:33:24 * @Date: 2022-03-04 18:33:24
* @LastEditTime: 2022-03-14 15:06:43 * @LastEditTime: 2022-03-22 10:11:21
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import { Tree } from 'antd'; import { Tree } from 'antd';
...@@ -23,6 +23,10 @@ export default props => { ...@@ -23,6 +23,10 @@ export default props => {
}, [expandedKeys]); }, [expandedKeys]);
const handleExpand = (keys, { expanded, node }) => { const handleExpand = (keys, { expanded, node }) => {
console.log(keys);
console.log(expanded);
console.log(node);
console.log(keepTree);
if (keepTree && keepTree.indexOf(node.key) != -1 && epKeys.indexOf(node.key) == -1) { if (keepTree && keepTree.indexOf(node.key) != -1 && epKeys.indexOf(node.key) == -1) {
setEpKeys([node.key]); setEpKeys([node.key]);
} else { } else {
...@@ -38,6 +42,7 @@ export default props => { ...@@ -38,6 +42,7 @@ export default props => {
console.log(keys); console.log(keys);
console.log(e); console.log(e);
console.log(epKeys); console.log(epKeys);
console.log(keepTree);
if (keepTree && keepTree.indexOf(keys[0]) != -1 && epKeys.indexOf(keys[0]) == -1) { if (keepTree && keepTree.indexOf(keys[0]) != -1 && epKeys.indexOf(keys[0]) == -1) {
setEpKeys(keys); setEpKeys(keys);
} else { } else {
......
...@@ -464,7 +464,12 @@ const AddModal = props => { ...@@ -464,7 +464,12 @@ const AddModal = props => {
<Item label="形态"> <Item label="形态">
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Select style={{ width: '42%' }} value={Shape} onChange={handleCharacteristics}> <Select
style={{ width: '42%' }}
value={Shape}
onChange={handleCharacteristics}
showSearch
>
{characteristics.length {characteristics.length
? characteristics.map((item, index) => { ? characteristics.map((item, index) => {
return ( return (
......
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-03-22 17:04:23
* @LastEditors: leizhe
*/
import { Tabs, Button } from 'antd'; import { Tabs, Button } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
...@@ -18,7 +25,7 @@ const SchemeConfig = () => { ...@@ -18,7 +25,7 @@ const SchemeConfig = () => {
return ( return (
<PageContainer> <PageContainer>
<div className={styles.container3d} activekey={activekey}> <div className={styles.container3d} activekey={activekey}>
<Tabs onChange={callback} type="card"> <Tabs onChange={callback} type="card" style={{ width: '100%' }}>
<TabPane tab="瓦片数据配置" key="1"> <TabPane tab="瓦片数据配置" key="1">
{activekey === '1' ? <TileConfig /> : ''} {activekey === '1' ? <TileConfig /> : ''}
</TabPane> </TabPane>
......
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-03-22 17:02:14
* @LastEditors: leizhe
*/
import { Tabs, Button } from 'antd'; import { Tabs, Button } from 'antd';
import React from 'react'; import React from 'react';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
...@@ -15,7 +22,7 @@ const SchemeConfig = () => { ...@@ -15,7 +22,7 @@ const SchemeConfig = () => {
return ( return (
<PageContainer> <PageContainer>
<div className={styles.container}> <div className={styles.container}>
<Tabs onChange={callback} type="card"> <Tabs onChange={callback} type="card" style={{ width: '100%' }}>
<TabPane tab="瓦片数据配置" key="1"> <TabPane tab="瓦片数据配置" key="1">
<TileConfig /> <TileConfig />
</TabPane> </TabPane>
......
/* eslint-disable indent */
/* eslint-disable object-shorthand */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import classnames from 'classnames' import classnames from 'classnames';
import styles from '../../SchemeConfig.less' import styles from '../../SchemeConfig.less';
import { Popconfirm, notification, Card, Button, message } from 'antd'; import { Popconfirm, notification, Card, Button, message } from 'antd';
import { import {
unbindSchemeBaseMap, GettMaplayer, SetServiceConfig, deleteConfig unbindSchemeBaseMap,
GettMaplayer,
SetServiceConfig,
deleteConfig,
} from '@/services/webConfig/api'; } from '@/services/webConfig/api';
import { import { CloseOutlined, PlusOutlined } from '@ant-design/icons';
CloseOutlined, PlusOutlined import AddModal from '../AddModal';
} from '@ant-design/icons'; import MapScope from '@/components/MapScope';
import AddModal from '../AddModal' import { createGuid } from '@/utils/transformUtil';
import MapScope from '@/components/MapScope'
import { createGuid } from '@/utils/transformUtil'
const CardData = props => { const CardData = props => {
const { deletebaseMaps = () => { }, item } = props; const { deletebaseMaps = () => {}, item } = props;
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [flag, setFlag] = useState(0); // 状态更新 const [flag, setFlag] = useState(0); // 状态更新
const [type, setType] = useState(''); // 弹窗类型 const [type, setType] = useState(''); // 弹窗类型
const [formObj, setFormObj] = useState({}); const [formObj, setFormObj] = useState({});
const [serviceList, setServiceList] = useState([]); const [serviceList, setServiceList] = useState([]);
const [mapScopeVisible, setMapScopeVisible] = useState(false) const [mapScopeVisible, setMapScopeVisible] = useState(false);
//删除瓦片 // 删除瓦片
const deletebaseMap = (item, baseMapItem) => {
unbindSchemeBaseMap({ schemename: item.schemename, basemapName: baseMapItem }).then(res => {
if (res.code === 0) {
notification.success({
message: '提示',
duration: 3,
description: '底图删除成功',
});
deletebaseMaps()
}
else {
notification.error({
message: '提示',
duration: 3,
description: '底图删除失败',
});
}
}) useEffect(() => {
} console.log(props.item);
//删除方案 }, []);
const deleteTile = (item) => { const deletebaseMap = (item, baseMapItem) => {
deleteConfig({ unbindSchemeBaseMap({ schemename: item.schemename, basemapName: baseMapItem }).then(res => {
schemename: item.schemename, if (res.code === 0) {
terminalType: 'scheme', notification.success({
isBaseMap: false message: '提示',
}).then(res => { duration: 3,
if (res.msg === "Ok") { description: '底图删除成功',
notification.success({ });
message: '提示', deletebaseMaps();
duration: 3, } else {
description: '方案删除成功', notification.error({
}); message: '提示',
deletebaseMaps() duration: 3,
} description: '底图删除失败',
else { });
notification.error({ }
message: '提示', });
duration: 3, };
description: '方案删除失败', // 删除方案
}); const deleteTile = item => {
deleteConfig({
schemename: item.schemename,
terminalType: 'scheme',
isBaseMap: false,
}).then(res => {
if (res.msg === 'Ok') {
notification.success({
message: '提示',
duration: 3,
description: '方案删除成功',
});
deletebaseMaps();
} else {
notification.error({
message: '提示',
duration: 3,
description: '方案删除失败',
});
}
});
};
const onSubmit = prop => {
setVisible(false);
deletebaseMaps();
};
// 增加瓦片
const addTile = value => {
let serverList = [];
setFormObj(value);
if (JSON.stringify(value) != '{}') {
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.msg === 'Ok') {
res.data.general.baseMap.layers.map(item => {
if (value.baseMap.indexOf(item.servicename) == -1) {
serverList.push(item.servicename);
} }
}) });
}
const onSubmit = prop => {
setVisible(false);
deletebaseMaps()
};
//增加瓦片
const addTile = (value) => {
let serverList = []
setFormObj(value);
if (JSON.stringify(value) != "{}") {
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.msg === 'Ok') {
res.data.general.baseMap.layers.map(item => {
if (value.baseMap.indexOf(item.servicename) == -1) {
serverList.push(item.servicename)
}
})
}
if (serverList.length) {
setServiceList(serverList)
setType('add');
setVisible(true);
}
else {
notification.warning({
message: '提示',
duration: 3,
description: '请先在基础配置-配置底图',
});
}
})
}
}
const submitExtent = (extent, areaName, flag ) => {
if(flag === 0) {
notification.warn({
message: '提交失败',
description: '请框选范围',
});
return;
} }
const jsConfig = { if (serverList.length) {
extent: extent, setServiceList(serverList);
areaName: areaName, setType('add');
boundColor: "#86c8f8", setVisible(true);
boundWidth: "10px", } else {
backgroundColor: "#000000", notification.warning({
backgroundOpacity: "0.6" message: '提示',
duration: 3,
description: '请先在基础配置-配置底图',
});
} }
SetServiceConfig( });
{
schemename: item.schemename,
terminalType: "web",
isBaseMap: false,
jsonCfg: JSON.stringify(jsConfig)
}
).then(
res => {
if (res.msg === "Ok") {
setMapScopeVisible(false)
message.info("范围设置成功")
}
}
)
} }
const pick = (schemename, index) => { };
SetServiceConfig( const submitExtent = (extent, areaName, flag) => {
{ if (flag === 0) {
schemename: schemename, notification.warn({
terminalType: 'scheme', message: '提交失败',
isBaseMap: false, description: '请框选范围',
jsonCfg: JSON.stringify({ });
defaultBaseMap: index, return;
})
}
).then(
res => {
if (res.msg === "Ok") {
deletebaseMaps()
message.info('设置成功')
}
else{
message.warning(res.msg)
}
}
)
} }
return ( const jsConfig = {
<> extent: extent,
<Card title={<div><span className={styles.schemeName}>方案名</span>{props.item.schemename}</div>} extra={<a href="#"> areaName: areaName,
<Popconfirm boundColor: '#86c8f8',
title="是否删除该方案?" boundWidth: '10px',
okText="确认" backgroundColor: '#000000',
cancelText="取消" backgroundOpacity: '0.6',
onConfirm={() => { };
deleteTile(props.item); SetServiceConfig({
}} schemename: item.schemename,
> terminalType: 'web',
<CloseOutlined /> isBaseMap: false,
</Popconfirm> </a>} style={{ width: 300 }}> jsonCfg: JSON.stringify(jsConfig),
<p><span className={styles.schemeName}>矢量</span> {props.item.servicename}</p> }).then(res => {
<div> if (res.msg === 'Ok') {
<span className={styles.schemeName}>范围</span> setMapScopeVisible(false);
<Button style={{ width: '12rem', marginBottom: '0.5rem' }} onClick={() => setMapScopeVisible(true)}>选择范围</Button> message.info('范围设置成功');
</div> }
<div className={styles.schemeItem}><span className={styles.schemeName}>瓦片</span> });
<Button className={styles.schemeBtn} onClick={() => addTile(props.item)}> <PlusOutlined />添加瓦片</Button> };
</div> const pick = (schemename, index) => {
<div style={{ overflowY: 'scroll', maxHeight: '11.4rem' }}> SetServiceConfig({
{props.item.baseMap && props.item.baseMap.length ? props.item.baseMap.map((baseMapItem, baseindex) => { schemename: schemename,
return <div className={styles.mapItem} key={baseindex} > terminalType: 'scheme',
<div onClick={() => pick(props.item.schemename, baseindex)} className={classnames({ isBaseMap: false,
[styles.defaultTile]: true, jsonCfg: JSON.stringify({
[styles.activeTile]: baseindex == props.item.defaultBaseMap, defaultBaseMap: index,
})}>默认</div> }),
<div className={styles.mapText}>{baseMapItem}</div> }).then(res => {
<div className={styles.mapIcon}> if (res.msg === 'Ok') {
<Popconfirm deletebaseMaps();
title="是否删除该底图?" message.info('设置成功');
okText="确认" } else {
cancelText="取消" message.warning(res.msg);
onConfirm={() => { }
deletebaseMap(props.item, baseMapItem); });
}} };
> return (
<CloseOutlined /> <>
</Popconfirm> </div> <Card
</div> title={
}) : ''} <div>
</div> <span className={styles.schemeName}>方案名</span>
{props.item.schemename}
</Card> </div>
<AddModal }
visible={visible} extra={
onCancel={() => setVisible(false)} <a href="#">
callBackSubmit={onSubmit} <Popconfirm
type={type} title="是否删除该方案?"
serviceList={serviceList} okText="确认"
formObj={formObj} cancelText="取消"
/> onConfirm={() => {
<MapScope deleteTile(props.item);
mapId={createGuid()} }}
visible={mapScopeVisible} >
onCancel={() => setMapScopeVisible(false)} <CloseOutlined />
confirmModal={submitExtent} </Popconfirm>{' '}
schemename={props.item.schemename} </a>
/> }
</> style={{ width: 300 }}
) >
} <p>
export default CardData <span className={styles.schemeName}>矢量</span> {props.item.servicename}
</p>
<div>
<span className={styles.schemeName}>范围</span>
<Button
style={{ width: '12rem', marginBottom: '0.5rem' }}
onClick={() => setMapScopeVisible(true)}
>
选择范围
</Button>
</div>
<div className={styles.schemeItem}>
<span className={styles.schemeName}>瓦片</span>
<Button className={styles.schemeBtn} onClick={() => addTile(props.item)}>
{' '}
<PlusOutlined />
添加瓦片
</Button>
</div>
<div style={{ overflowY: 'scroll', maxHeight: '11.4rem' }}>
{props.item.baseMap && props.item.baseMap.length
? props.item.baseMap.map((baseMapItem, baseindex) => {
return (
<div className={styles.mapItem} key={baseindex}>
<div
onClick={() => pick(props.item.schemename, baseindex)}
className={classnames({
[styles.defaultTile]: true,
[styles.activeTile]: baseindex == props.item.defaultBaseMap,
})}
>
默认
</div>
<div className={styles.mapText}>{baseMapItem}</div>
<div className={styles.mapIcon}>
<Popconfirm
title="是否删除该底图?"
okText="确认"
cancelText="取消"
onConfirm={() => {
deletebaseMap(props.item, baseMapItem);
}}
>
<CloseOutlined />
</Popconfirm>{' '}
</div>
</div>
);
})
: ''}
</div>
</Card>
<AddModal
visible={visible}
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
type={type}
serviceList={serviceList}
formObj={formObj}
/>
<MapScope
mapId={createGuid()}
visible={mapScopeVisible}
onCancel={() => setMapScopeVisible(false)}
confirmModal={submitExtent}
schemename={props.item.schemename}
title={props.item.schemename}
/>
</>
);
};
export default CardData;
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-03-22 16:59:26
* @LastEditors: leizhe
*/
/* eslint-disable indent */ /* eslint-disable indent */
import { Button, Spin } from 'antd'; import { Button, Spin } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -45,18 +52,18 @@ const VectorData = props => { ...@@ -45,18 +52,18 @@ const VectorData = props => {
}; };
return ( return (
<> <>
<div className={styles.tileBtn}>
<Button
type="primary"
onClick={() => {
handleAdd();
}}
>
新增
</Button>
</div>
<Spin tip="loading..." spinning={treeLoading}> <Spin tip="loading..." spinning={treeLoading}>
<div style={{ height: '780px', overflow: 'scroll' }}> <div style={{ height: '780px', overflow: 'scroll', width: '100%' }}>
<div className={styles.tileBtn}>
<Button
type="primary"
onClick={() => {
handleAdd();
}}
>
新增
</Button>
</div>
<div className={styles.cardsList}> <div className={styles.cardsList}>
{tileData && tileData.length {tileData && tileData.length
? tileData.map((item, index) => { ? tileData.map((item, index) => {
......
...@@ -170,7 +170,13 @@ const ProjectManage = props => { ...@@ -170,7 +170,13 @@ const ProjectManage = props => {
const placeholder = '请输入方案名称'; const placeholder = '请输入方案名称';
const handleSearch = value => { const handleSearch = value => {
GetMessageList({ pageSize: 10, pageIndex: 0, search: value }); GetMessageList({
pageSize: 10,
pageIndex: 0,
search: value,
infoType: currentType == '全部' ? '' : currentType,
msgType: currentName == '全部' ? '' : currentName,
});
setShowSearchStyle(true); setShowSearchStyle(true);
}; };
const changeDesc = record => { const changeDesc = record => {
...@@ -251,7 +257,12 @@ const ProjectManage = props => { ...@@ -251,7 +257,12 @@ const ProjectManage = props => {
const onTypeChange = value => { const onTypeChange = value => {
if (value == '全部') { if (value == '全部') {
setCurrentType('全部'); setCurrentType('全部');
GetMessageList({ pageIndex, pageSize: 10 }); GetMessageList({
pageIndex,
pageSize: 10,
infoType: '',
msgType: currentName == '全部' ? '' : currentName,
});
} else { } else {
GetMessageList({ GetMessageList({
pageIndex, pageIndex,
...@@ -265,7 +276,12 @@ const ProjectManage = props => { ...@@ -265,7 +276,12 @@ const ProjectManage = props => {
const onNameChange = value => { const onNameChange = value => {
if (value == '全部') { if (value == '全部') {
setCurrentName('全部'); setCurrentName('全部');
GetMessageList({ pageIndex, pageSize: 10 }); GetMessageList({
pageIndex,
pageSize: 10,
msgType: '',
infoType: currentType == '全部' ? '' : currentType,
});
} else { } else {
GetMessageList({ GetMessageList({
pageIndex, pageIndex,
...@@ -305,8 +321,8 @@ const ProjectManage = props => { ...@@ -305,8 +321,8 @@ const ProjectManage = props => {
mesList.push({ mesList.push({
name: item.MessageConfig.MsgType, name: item.MessageConfig.MsgType,
type: item.MessageConfig.ThemeName, type: item.MessageConfig.ThemeName,
send_pattern: item.MessageConfig.PushMode, send_pattern: item.MessageConfig.PushMode || '-',
receive_person: item.MessageConfig.PushGroup, receive_person: item.MessageConfig.PushGroup || '-',
is_use: item.MessageConfig.IsStarted, is_use: item.MessageConfig.IsStarted,
...item.MessageConfig, ...item.MessageConfig,
item, item,
...@@ -359,6 +375,7 @@ const ProjectManage = props => { ...@@ -359,6 +375,7 @@ const ProjectManage = props => {
value={currentName} value={currentName}
style={{ width: '150px' }} style={{ width: '150px' }}
onChange={onNameChange} onChange={onNameChange}
showSearch
> >
<Option value="全部">全部</Option> <Option value="全部">全部</Option>
{messageTypes.map((item, idx) => ( {messageTypes.map((item, idx) => (
...@@ -371,6 +388,7 @@ const ProjectManage = props => { ...@@ -371,6 +388,7 @@ const ProjectManage = props => {
<div className={styles.fast_search}> <div className={styles.fast_search}>
<div className={styles.title}>快速检索</div> <div className={styles.title}>快速检索</div>
<Search <Search
showSearch
allowClear allowClear
placeholder={placeholder} placeholder={placeholder}
onSearch={handleSearch} onSearch={handleSearch}
......
import React, { useState, useEffect, useRef } from 'react' import React, { useState, useEffect, useRef } from 'react';
import SiteModal from '@/components/Modal/SiteModa'; import SiteModal from '@/components/Modal/SiteModa';
import { Form, Input, notification, Select, Checkbox, message, Button } from 'antd' import { Form, Input, notification, Select, Checkbox, message, Button } from 'antd';
import BaseForm from '@/components/BaseForm/index'; import BaseForm from '@/components/BaseForm/index';
import { Switch } from 'react-router'; import { Switch } from 'react-router';
import { iteratee } from 'lodash'; import { iteratee } from 'lodash';
import styles from './EditModal.less'; import styles from './EditModal.less';
import v from 'voca'; import v from 'voca';
import VisibleRoleModal from './RolseSelect/VisibleRoleModal' import VisibleRoleModal from './RolseSelect/VisibleRoleModal';
import VisibleIISAgentConfig from './IISAgentConfig/VisibleIISAgentConfig' import VisibleIISAgentConfig from './IISAgentConfig/VisibleIISAgentConfig';
import { GetMessageTemplate } from '@/services/messagemanage/messagemanage' import { GetMessageTemplate } from '@/services/messagemanage/messagemanage';
import moment from 'moment' import moment from 'moment';
import { UpdateMessageConfig, InsertMessageConfig, AddIISAgentConfig } from '@/services/messagemanage/messagemanage' import {
UpdateMessageConfig,
InsertMessageConfig,
AddIISAgentConfig,
} from '@/services/messagemanage/messagemanage';
const { Item } = Form; const { Item } = Form;
const EditModal = props => { const EditModal = props => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [isStart, setIsStart] = useState(false);
const [IISConfig, setIISConfig] = useState(null);
const { template, confirmModal } = props;
const [currentTrench, setCurrentTrench] = useState({
isMessageShow: false,
isAPPShow: false,
isWEBShow: false,
isWXShow: false,
});
const plainOptions = ['平台弹框', '短信推送', '公众号推送'];
const [APP_ITEMS, setAPP_ITEMS] = useState([]);
const [WEB_ITEMS, setWEB_ITEMS] = useState([]);
const [WX_ITEMS, setWX_ITEMS] = useState([]);
const [MES_ITEMS, setMES_ITEMS] = useState([]);
const [form] = Form.useForm(); useEffect(() => {
const [loading, setLoading] = useState(false); GetMessageTemplate().then(res => {
const [isStart, setIsStart] = useState(false); if (res.code === 0) {
const [IISConfig, setIISConfig] = useState(null) let arr1 = [];
let arr2 = [];
let arr3 = [];
let arr4 = [];
res.data.map((item, index) => {
if (item.Type === '公众号') {
arr1.push(item);
}
if (item.Type === '短信') {
arr2.push(item);
}
if (item.Type === 'APP') {
arr3.push(item);
}
if (item.Type === 'WEB') {
arr4.push(item);
}
});
setAPP_ITEMS(arr3);
setMES_ITEMS(arr2);
setWX_ITEMS(arr1);
setWEB_ITEMS(arr4);
}
});
}, []);
useEffect(() => {
if (template.ThemeName) {
console.log(template);
form.setFieldsValue({
name: template.MsgType,
isStart: template.IsStarted === '0' ? '关闭' : '开启',
to_person: template.PushGroup,
push_plan: template.MsgType,
push_mode: template.PushMode === null ? '' : template.PushMode.split(','),
const { template, confirmModal } = props app_template: template.AppTemplateID,
const [currentTrench, setCurrentTrench] = useState({ app_path: template.AppFunctionPath,
isMessageShow: false, wx_template: parseInt(template.PublicTemplateID),
isAPPShow: false, h5_path: template.PublicPath,
isWEBShow: false, miniprogram_path: template.MiniAppRoute,
isWXShow: false web_template: template.WebTemplateID,
}) web_path: template.WebFunctionPath,
const plainOptions = ['平台弹框', '短信推送', '公众号推送']; message_template: template.MsgTemplateID,
const [APP_ITEMS, setAPP_ITEMS] = useState([]) });
const [WEB_ITEMS, setWEB_ITEMS] = useState([]) setCurrentTrench({
const [WX_ITEMS, setWX_ITEMS] = useState([]) isAPPShow:
const [MES_ITEMS, setMES_ITEMS] = useState([]) template.PushMode && template.PushMode.split(',').indexOf('平台弹框') > -1 ? true : false,
isWXShow:
template.PushMode && template.PushMode.split(',').indexOf('公众号推送') > -1
useEffect(() => { ? true
GetMessageTemplate().then( : false,
res => { isWEBShow:
if (res.code === 0) { template.PushMode && template.PushMode.split(',').indexOf('平台弹框') > -1 ? true : false,
let arr1 = [] isMessageShow:
let arr2 = [] template.PushMode && template.PushMode.split(',').indexOf('短信推送') > -1 ? true : false,
let arr3 = [] });
let arr4 = []
res.data.map((item, index) => {
if (item.Type === "公众号") {
arr1.push(item)
}
if (item.Type === "短信") {
arr2.push(item)
}
if (item.Type === "APP") {
arr3.push(item)
}
if (item.Type === "WEB") {
arr4.push(item)
}
})
setAPP_ITEMS(arr3)
setMES_ITEMS(arr2)
setWX_ITEMS(arr1)
setWEB_ITEMS(arr4)
}
}
)
}, [])
useEffect(() => {
if (template.ThemeName) {
console.log(template);
form.setFieldsValue({
name: template.MsgType,
isStart: template.IsStarted === "0" ? "关闭" : "开启",
to_person: template.PushGroup,
push_plan: template.MsgType,
push_mode: template.PushMode === null ? '' : template.PushMode.split(","),
app_template: template.AppTemplateID,
app_path: template.AppFunctionPath,
wx_template: parseInt(template.PublicTemplateID),
h5_path: template.PublicPath,
miniprogram_path: template.MiniAppRoute,
web_template: template.WebTemplateID,
web_path: template.WebFunctionPath,
message_template: template.MsgTemplateID,
})
setCurrentTrench({
isAPPShow: template.PushMode && template.PushMode.split(",").indexOf("平台弹框") > -1 ? true : false,
isWXShow: template.PushMode && template.PushMode.split(",").indexOf("公众号推送") > -1 ? true : false,
isWEBShow: template.PushMode &&template.PushMode.split(",").indexOf("平台弹框") > -1 ? true : false,
isMessageShow: template.PushMode &&template.PushMode.split(",").indexOf("短信推送") > -1 ? true : false,
})
}
}, [props])
const onNameChange = (e) => {
form.setFieldsValue({
push_plan: e.target.value
})
} }
}, [props]);
const onNameChange = e => {
form.setFieldsValue({
push_plan: e.target.value,
});
};
const onSubmit = () => { const onSubmit = () => {
console.log(form.getFieldValue()) console.log(form.getFieldValue());
let fv = form.getFieldValue() let fv = form.getFieldValue();
if (template.ThemeName) { if (template.ThemeName) {
console.log('fv.wx_template',fv.wx_template); console.log('fv.wx_template', fv.wx_template);
console.log('fv.push_mode.toString()',fv.push_mode.toString()); console.log('fv.push_mode.toString()', fv.push_mode.toString());
let a = { let a = {
ID: template.ID, ID: template.ID,
ThemeName: template.ThemeName, ThemeName: template.ThemeName,
MsgType: fv.name, MsgType: fv.name,
PublicTemplateID: fv.wx_template.toString(), PublicTemplateID: fv.wx_template.toString(),
PublicConfig: template.PublicConfig, PublicConfig: template.PublicConfig,
PublicPath: fv.h5_path, PublicPath: fv.h5_path,
MsgTemplateName: template.MsgTemplateName, MsgTemplateName: template.MsgTemplateName,
MsgTemplateCode: template.MsgTemplateCode, MsgTemplateCode: template.MsgTemplateCode,
MsgConfig: template.MsgConfig, MsgConfig: template.MsgConfig,
MiniAppRoute: fv.miniprogram_path, MiniAppRoute: fv.miniprogram_path,
AppFunctionPath: fv.app_path, AppFunctionPath: fv.app_path,
AppConfig: template.AppConfig, AppConfig: template.AppConfig,
WebFunctionPath: fv.web_path, WebFunctionPath: fv.web_path,
WebConfig: template.WebConfig, WebConfig: template.WebConfig,
IsDelete: template.IsDelete, IsDelete: template.IsDelete,
InputTime: moment().format("YYYY-MM-DD HH:mm:ss"), InputTime: moment().format('YYYY-MM-DD HH:mm:ss'),
Pusher: template.Pusher, Pusher: template.Pusher,
PushMode: fv.push_mode.toString(), PushMode: fv.push_mode.toString(),
PushPath: template.PushPath, PushPath: template.PushPath,
IsStarted: fv.isStart, IsStarted: fv.isStart,
MsgTemplateID: fv.message_template, MsgTemplateID: fv.message_template,
AppTemplateID: fv.app_template, AppTemplateID: fv.app_template,
WebTemplateID: fv.web_template, WebTemplateID: fv.web_template,
PushGroup: fv.to_person.toString() PushGroup: fv.to_person.toString(),
} };
console.log(a) console.log(a);
UpdateMessageConfig(a).then( UpdateMessageConfig(a).then(res => {
res => { if (res.code === 0) {
if (res.code === 0) { if (IISConfig) {
if (IISConfig) { AddIISAgentConfig(IISConfig).then(res => {
AddIISAgentConfig(IISConfig).then( if (res.code === 0) {
res => { message.success('保存成功');
if (res.code === 0) { confirmModal();
message.success("保存成功") }
confirmModal() });
} } else {
} message.success('保存成功');
) confirmModal();
} else { }
message.success("保存成功")
confirmModal()
}
}
}
)
} else {
console.log('fv.push_mode.toString()',fv.push_mode.toString());
let b = {
ThemeName: "定时推送",
MsgType: fv.name,
PublicTemplateID: fv.wx_template,
PublicConfig: template.PublicConfig,
PublicPath: fv.h5_path,
MsgTemplateName: template.MsgTemplateName,
MsgTemplateCode: template.MsgTemplateCode,
MsgConfig: template.MsgConfig,
MiniAppRoute: fv.miniprogram_path,
AppFunctionPath: fv.app_path,
AppConfig: template.AppConfig,
WebFunctionPath: fv.web_path,
WebConfig: template.WebConfig,
IsDelete: template.IsDelete,
InputTime: moment().format("YYYY-MM-DD HH:mm:ss"),
Pusher: template.Pusher,
PushMode: fv.push_mode.toString(),
PushPath: template.PushPath,
IsStarted: fv.isStart,
MsgTemplateID: fv.message_template,
AppTemplateID: fv.app_template,
WebTemplateID: fv.web_template,
PushGroup: fv.to_person.toString()
}
InsertMessageConfig(b).then(
res => {
if (res.code === 0) {
if (IISConfig) {
AddIISAgentConfig(IISConfig).then(
res => {
if (res.code === 0) {
message.success("保存成功")
confirmModal()
}
}
)
} else {
message.success("保存成功")
confirmModal()
}
}
}
)
} }
});
} } else {
const operateProject = () => { console.log('fv.push_mode.toString()', fv.push_mode.toString());
let b = {
} ThemeName: '定时推送',
const onTypeChange = (value) => { MsgType: fv.name,
setCurrentTrench({ PublicTemplateID: fv.wx_template,
isAPPShow: value.indexOf("平台弹框") > -1 ? true : false, PublicConfig: template.PublicConfig,
isWXShow: value.indexOf("公众号推送") > -1 ? true : false, PublicPath: fv.h5_path,
isWEBShow: value.indexOf("平台弹框") > -1 ? true : false, MsgTemplateName: template.MsgTemplateName,
isMessageShow: value.indexOf("短信推送") > -1 ? true : false, MsgTemplateCode: template.MsgTemplateCode,
}) MsgConfig: template.MsgConfig,
} MiniAppRoute: fv.miniprogram_path,
const onIISAgentSubmit = (value) => { AppFunctionPath: fv.app_path,
console.log(value, "IIS配置") AppConfig: template.AppConfig,
setIISConfig(value) WebFunctionPath: fv.web_path,
WebConfig: template.WebConfig,
} IsDelete: template.IsDelete,
InputTime: moment().format('YYYY-MM-DD HH:mm:ss'),
const onPushSubmit = (value) => { Pusher: template.Pusher,
console.log(value, "onPushSubmit") PushMode: fv.push_mode.toString(),
PushPath: template.PushPath,
IsStarted: fv.isStart,
MsgTemplateID: fv.message_template,
AppTemplateID: fv.app_template,
WebTemplateID: fv.web_template,
PushGroup: fv.to_person.toString(),
};
InsertMessageConfig(b).then(res => {
if (res.code === 0) {
if (IISConfig) {
AddIISAgentConfig(IISConfig).then(res => {
if (res.code === 0) {
message.success('保存成功');
confirmModal();
}
});
} else {
message.success('保存成功');
confirmModal();
}
}
});
} }
};
const operateProject = () => {};
const onTypeChange = value => {
setCurrentTrench({
isAPPShow: value.indexOf('平台弹框') > -1 ? true : false,
isWXShow: value.indexOf('公众号推送') > -1 ? true : false,
isWEBShow: value.indexOf('平台弹框') > -1 ? true : false,
isMessageShow: value.indexOf('短信推送') > -1 ? true : false,
});
};
const onIISAgentSubmit = value => {
console.log(value, 'IIS配置');
setIISConfig(value);
};
return ( const onPushSubmit = value => {
<SiteModal console.log(value, 'onPushSubmit');
{...props} };
title={template.ThemeName ? "编辑推送方案" : "新增推送方案"}
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="1200px"
destroyOnClose
cancelText="取消"
okText="确认"
onOk={() => onSubmit()}
confirmLoading={loading}
>
<div className={styles.editModal_container}>
<Form form={form} labelCol={{ span: 4 }}>
<Item
label="方案名称"
name="name"
rules={[
{
required: true,
message: '请输入方案名称',
},
]}
>
<Input placeholder="请输入方案名称" disabled={template.ThemeName ? true : false} onChange={onNameChange} />
</Item>
<Item
label="是否开启"
name="isStart"
>
<Select >
<Option value="1">开启</Option>
<Option value="0">关闭</Option>
</Select>
</Item>
<Item
label="推送人"
name="to_person"
>
<VisibleRoleModal
onSubmit={onPushSubmit}
title={"推送人员"}
/>
</Item>
<Item
label="定时计划"
name="push_plan"
>
<VisibleIISAgentConfig agentConfig={template.item && template.item.AgentConfig} onIISAgentSubmit={onIISAgentSubmit} />
</Item>
<Item
label="推送方式"
name="push_mode"
>
<Checkbox.Group
options={plainOptions}
onChange={onTypeChange}
/>
</Item>
<div className={styles.push_trench}>
{
currentTrench.isAPPShow && (
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>APP</div>
</div>
<div className={styles.card_body}>
<Item
label="模板"
name="app_template"
>
<Select >
{
APP_ITEMS.map((item, idx) => {
return (
<Option value={item.Id} key={idx}>{item.LikeName}</Option>
)
})
}
</Select>
</Item>
<Item
label="功能路径"
name="app_path"
>
<Input placeholder="请输入功能路径" />
</Item>
</div>
</div>
)
}
{
currentTrench.isWXShow && (
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>微信</div>
</div>
<div className={styles.card_body}>
<Item
label="模板"
name="wx_template"
>
<Select >
{
WX_ITEMS.map((item, idx) => {
return (
<Option value={item.Id} key={idx}>{item.LikeName}</Option>
)
})
}
</Select>
</Item>
<Item
label="H5路由"
name="h5_path"
>
<Input placeholder="请输入功能路径" />
</Item>
<Item
label="小程序路由"
name="miniprogram_path"
>
<Input placeholder="请输入功能路径" />
</Item>
</div>
</div>
)
}
{
currentTrench.isWEBShow && (
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>WEB</div>
</div>
<div className={styles.card_body}>
<Item
label="模板"
name="web_template"
>
<Select >
{
WEB_ITEMS.map((item, idx) => {
return (
<Option value={item.Id} key={idx}>{item.LikeName}</Option>
)
})
}
</Select>
</Item>
<Item
label="功能路径"
name="web_path"
>
<Input placeholder="请输入功能路径" />
</Item>
</div>
</div>
)
}
{ return (
currentTrench.isMessageShow && ( <SiteModal
<div className={styles.trench_card}> {...props}
<div className={styles.card_title}> title={template.ThemeName ? '编辑推送方案' : '新增推送方案'}
<div className={styles.lable}>短信</div> bodyStyle={{ width: '100%', minHeight: '100px' }}
</div> style={{ top: 200, borderRadius: '20px' }}
<div className={styles.card_body}> width="1200px"
<Item destroyOnClose
label="模板" cancelText="取消"
name="message_template" okText="确认"
> onOk={() => onSubmit()}
<Select > confirmLoading={loading}
{ >
MES_ITEMS.map((item, idx) => { <div className={styles.editModal_container}>
return ( <Form form={form} labelCol={{ span: 4 }}>
<Option value={item.Id} key={idx}>{item.LikeName}</Option> <Item
) label="方案名称"
}) name="name"
} rules={[
</Select> {
</Item> required: true,
</div> message: '请输入方案名称',
</div> },
) ]}
} >
</div> <Input
</Form> placeholder="请输入方案名称"
</div> disabled={template.ThemeName ? true : false}
onChange={onNameChange}
/>
</Item>
<Item label="是否开启" name="isStart">
<Select>
<Option value="1">开启</Option>
<Option value="0">关闭</Option>
</Select>
</Item>
<Item label="推送人" name="to_person">
<VisibleRoleModal onSubmit={onPushSubmit} title={'推送人员'} />
</Item>
<Item label="定时计划" name="push_plan">
<VisibleIISAgentConfig
agentConfig={template.item && template.item.AgentConfig}
onIISAgentSubmit={onIISAgentSubmit}
/>
</Item>
<Item label="推送方式" name="push_mode">
<Checkbox.Group options={plainOptions} onChange={onTypeChange} />
</Item>
<div className={styles.push_trench}>
{currentTrench.isAPPShow && (
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>APP</div>
</div>
<div className={styles.card_body}>
<Item label="模板" name="app_template">
<Select>
{APP_ITEMS.map((item, idx) => {
return (
<Option value={item.Id} key={idx}>
{item.LikeName}
</Option>
);
})}
</Select>
</Item>
<Item label="功能路径" name="app_path">
<Input placeholder="请输入功能路径" />
</Item>
</div>
</div>
)}
{currentTrench.isWXShow && (
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>微信</div>
</div>
<div className={styles.card_body}>
<Item label="模板" name="wx_template">
<Select>
{WX_ITEMS.map((item, idx) => {
return (
<Option value={item.Id} key={idx}>
{item.LikeName}
</Option>
);
})}
</Select>
</Item>
<Item label="H5路由" name="h5_path">
<Input placeholder="请输入功能路径" />
</Item>
<Item label="小程序路由" name="miniprogram_path">
<Input placeholder="请输入功能路径" />
</Item>
</div>
</div>
)}
{currentTrench.isWEBShow && (
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>WEB</div>
</div>
<div className={styles.card_body}>
<Item label="模板" name="web_template">
<Select>
{WEB_ITEMS.map((item, idx) => {
return (
<Option value={item.Id} key={idx}>
{item.LikeName}
</Option>
);
})}
</Select>
</Item>
<Item label="功能路径" name="web_path">
<Input placeholder="请输入功能路径" />
</Item>
</div>
</div>
)}
</SiteModal> {currentTrench.isMessageShow && (
) <div className={styles.trench_card}>
} <div className={styles.card_title}>
export default EditModal; <div className={styles.lable}>短信</div>
\ No newline at end of file </div>
<div className={styles.card_body}>
<Item label="模板" name="message_template">
<Select>
{MES_ITEMS.map((item, idx) => {
return (
<Option value={item.Id} key={idx}>
{item.LikeName}
</Option>
);
})}
</Select>
</Item>
</div>
</div>
)}
</div>
</Form>
</div>
</SiteModal>
);
};
export default EditModal;
...@@ -69,13 +69,13 @@ const TemplateManage = () => { ...@@ -69,13 +69,13 @@ const TemplateManage = () => {
Id: item.Id, Id: item.Id,
name: item.LikeName, name: item.LikeName,
type: item.Type, type: item.Type,
third_name: item.Name, third_name: item.Name || '-',
third_id: item.No, third_id: item.No || '-',
template_params2: item.ParsingParams, //模板参数2.0 template_params2: item.ParsingParams || '-', //模板参数2.0
template_params1: item.TParameters, //模板参数1.0 template_params1: item.TParameters || '-', //模板参数1.0
analysis_params: item.ParsingRules, //模板解析 analysis_params: item.ParsingRules || '-', //模板解析
desc: item.ParsingDescription, //模板参数说明 desc: item.ParsingDescription || '-', //模板参数说明
weixin: item.WorkWeiXinId, //企业微信ID weixin: item.WorkWeiXinId || '-', //企业微信ID
}); });
}); });
setData(list); setData(list);
......
...@@ -156,7 +156,7 @@ const AddModal = props => { ...@@ -156,7 +156,7 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input disabled placeholder="请输入第三方模板编号" style={{ width: '85%' }} /> <Input placeholder="请输入第三方模板编号" style={{ width: '85%' }} />
</Item> </Item>
</Col> </Col>
</Row> </Row>
...@@ -209,10 +209,10 @@ const AddModal = props => { ...@@ -209,10 +209,10 @@ const AddModal = props => {
</> </>
)} )}
<Item label="模板参数(仅限2.0)" labelCol={{ span: 6 }} name="params"> <Item label="模板参数(仅针对2.0规则)" labelCol={{ span: 6 }} name="params">
<TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" /> <TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" />
</Item> </Item>
<Item label="模板参数(仅限2.0)" labelCol={{ span: 6 }} name="param1"> <Item label="模板参数(仅针对2.0规则)" labelCol={{ span: 6 }} name="param1">
<TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" /> <TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" />
</Item> </Item>
<Item label="参数说明" name="desc" labelCol={{ span: 6 }}> <Item label="参数说明" name="desc" labelCol={{ span: 6 }}>
......
...@@ -23,13 +23,13 @@ const EditModal = props => { ...@@ -23,13 +23,13 @@ const EditModal = props => {
form.setFieldsValue({ form.setFieldsValue({
name: props.template.name, name: props.template.name,
type: props.template.type, type: props.template.type,
third_name: props.template.third_name, third_name: props.template.third_name == '-' ? '' : props.template.third_name,
third_id: props.template.third_id, third_id: props.template.third_id == '-' ? '' : props.template.third_id,
weixin: props.template.weixin, weixin: props.template.weixin == '-' ? '' : props.template.weixin,
params: props.template.template_params1, params: props.template.template_params1 == '-' ? '' : props.template.template_params1,
param1: props.template.template_params2, param1: props.template.template_params2 == '-' ? '' : props.template.template_params2,
desc: props.template.desc, desc: props.template.desc == '-' ? '' : props.template.desc,
analysis_params: props.template.analysis_params, analysis_params: props.template.analysis_params == '-' ? '' : props.template.analysis_params,
}); });
setTimeout(() => { setTimeout(() => {
console.log(form.getFieldsValue().type); console.log(form.getFieldsValue().type);
...@@ -81,13 +81,16 @@ const EditModal = props => { ...@@ -81,13 +81,16 @@ const EditModal = props => {
onOk={() => onSubmit()} onOk={() => onSubmit()}
confirmLoading={loading} confirmLoading={loading}
> >
<div style={{ width: '750px', height: '500px', overflowY: 'scroll', overflowX: 'hidden' }}> <div style={{ height: '500px', overflowY: 'scroll', overflowX: 'hidden' }}>
<Form form={form} {...layout} onFinish={onSubmitSuccess}> <Form form={form} {...layout} onFinish={onSubmitSuccess}>
<Row gutter={24}> <Row>
<Col span={11}> <Col span={3} />
<Col span={12}>
<Item <Item
label="模板名称" label="模板名称"
name="name" name="name"
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -95,13 +98,15 @@ const EditModal = props => { ...@@ -95,13 +98,15 @@ const EditModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入模板名称" /> <Input style={{ width: '80%' }} placeholder="请输入模板名称" />
</Item> </Item>
</Col> </Col>
<Col span={11}> <Col span={9}>
<Item <Item
label="模板类型" label="模板类型"
name="type" name="type"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -109,7 +114,7 @@ const EditModal = props => { ...@@ -109,7 +114,7 @@ const EditModal = props => {
}, },
]} ]}
> >
<Select onChange={value => onChangeType(value)}> <Select style={{ width: '85%' }} onChange={value => onChangeType(value)}>
<Select.Option value="公众号">公众号</Select.Option> <Select.Option value="公众号">公众号</Select.Option>
<Select.Option value="短信">短信</Select.Option> <Select.Option value="短信">短信</Select.Option>
<Select.Option value="企业微信">企业微信</Select.Option> <Select.Option value="企业微信">企业微信</Select.Option>
...@@ -119,11 +124,13 @@ const EditModal = props => { ...@@ -119,11 +124,13 @@ const EditModal = props => {
</Row> </Row>
{form.getFieldsValue().type === '企业微信' ? ( {form.getFieldsValue().type === '企业微信' ? (
<> <>
<Row gutter={24}> <Row>
<Col span={11}> <Col span={12}>
<Item <Item
label="第三方模板名称" label="第三方模板名称"
name="third_name" name="third_name"
wrapperCol={{ span: 12 }}
labelCol={{ span: 12 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -132,7 +139,7 @@ const EditModal = props => { ...@@ -132,7 +139,7 @@ const EditModal = props => {
]} ]}
> >
<Select <Select
style={{ width: '11.5rem' }} style={{ width: '120%' }}
onChange={value => onChangeType1(value)} onChange={value => onChangeType1(value)}
placeholder="请选择模板名称" placeholder="请选择模板名称"
> >
...@@ -143,10 +150,11 @@ const EditModal = props => { ...@@ -143,10 +150,11 @@ const EditModal = props => {
</Select> </Select>
</Item> </Item>
</Col> </Col>
<Col span={11}> <Col span={12}>
<Item <Item
label="企业微信应用id" label="企业微信应用id"
// labelCol={{ span: 11 }} wrapperCol={{ span: 12 }}
labelCol={{ span: 12 }}
name="weixin" name="weixin"
rules={[ rules={[
{ {
...@@ -155,7 +163,7 @@ const EditModal = props => { ...@@ -155,7 +163,7 @@ const EditModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入企业微信号" /> <Input placeholder="请输入企业微信号" style={{ width: '160px' }} />
</Item> </Item>
</Col> </Col>
</Row> </Row>
...@@ -167,11 +175,13 @@ const EditModal = props => { ...@@ -167,11 +175,13 @@ const EditModal = props => {
form.getFieldsValue().type !== 'APP' && form.getFieldsValue().type !== 'APP' &&
form.getFieldsValue().type !== 'WEB' ? ( form.getFieldsValue().type !== 'WEB' ? (
<> <>
<Row gutter={24}> <Row>
<Col span={11}> <Col span={12}>
<Item <Item
label="第三方模板名称" label="第三方模板名称"
name="third_name" name="third_name"
wrapperCol={{ span: 12 }}
labelCol={{ span: 12 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -181,6 +191,7 @@ const EditModal = props => { ...@@ -181,6 +191,7 @@ const EditModal = props => {
> >
<Select <Select
placeholder="请选择模板名称" placeholder="请选择模板名称"
style={{ width: '120%' }}
onChange={(value, option) => onChange(value, option)} onChange={(value, option) => onChange(value, option)}
> >
{templateName && {templateName &&
...@@ -193,9 +204,11 @@ const EditModal = props => { ...@@ -193,9 +204,11 @@ const EditModal = props => {
</Select> </Select>
</Item> </Item>
</Col> </Col>
<Col span={11}> <Col span={12}>
<Item <Item
label="第三方模板编号" label="第三方模板编号"
wrapperCol={{ span: 12 }}
labelCol={{ span: 12 }}
name="third_id" name="third_id"
rules={[ rules={[
{ {
...@@ -204,7 +217,7 @@ const EditModal = props => { ...@@ -204,7 +217,7 @@ const EditModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入模板名称" /> <Input placeholder="请输入模板名称" style={{ width: '85%' }} />
</Item> </Item>
</Col> </Col>
</Row> </Row>
...@@ -212,62 +225,22 @@ const EditModal = props => { ...@@ -212,62 +225,22 @@ const EditModal = props => {
) : ( ) : (
'' ''
)} )}
<Row gutter={24}> <Item label="模板参数(仅针对2.0规则)" labelCol={{ span: 6 }} name="params">
<Col span={1}> <TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" />
<Item /> </Item>
</Col> <Item label="模板参数(仅针对2.0规则)" labelCol={{ span: 6 }} name="param1">
<Col span={23}> <TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" />
<Item </Item>
label="模板参数1.0" <Item label="参数说明" labelCol={{ span: 6 }} name="desc">
labelCol={{ span: 3 }} <TextArea
style={{ marginLeft: '1.4rem' }} style={{ width: '95%' }}
name="params" rows={4}
> placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息"
<TextArea rows={2} placeholder="first|Second|Third|Four" /> />
</Item> </Item>
<Item <Item label="解析规则" labelCol={{ span: 6 }} name="analysis_params">
label="模板参数2.0" <TextArea style={{ width: '95%' }} rows={2} placeholder="param1|param2|param3|param4" />
labelCol={{ span: 3 }} </Item>
style={{ marginLeft: '1.4rem' }}
name="param1"
>
<TextArea rows={2} placeholder="first|Second|Third|Four" />
</Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={1}>
<Item />
</Col>
<Col span={23}>
<Item
label="参数说明"
labelCol={{ span: 3 }}
style={{ marginLeft: '1.4rem' }}
name="desc"
>
<TextArea
rows={4}
placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息"
/>
</Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={1}>
<Item />
</Col>
<Col span={23}>
<Item
label="解析规则"
labelCol={{ span: 3 }}
style={{ marginLeft: '1.4rem' }}
name="analysis_params"
>
<TextArea rows={2} placeholder="param1|param2|param3|param4" />
</Item>
</Col>
</Row>
</Form> </Form>
</div> </div>
</SiteModal> </SiteModal>
......
...@@ -200,7 +200,7 @@ const AddModal = props => { ...@@ -200,7 +200,7 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入角色名称" /> <Input placeholder="请输入角色名称" maxLength="20" />
</Item> </Item>
<Item <Item
label="角色类别" label="角色类别"
...@@ -265,7 +265,7 @@ const AddModal = props => { ...@@ -265,7 +265,7 @@ const AddModal = props => {
</Select> </Select>
</Item> </Item>
<Item label="角色描述" name="description"> <Item label="角色描述" name="description">
<Input placeholder="请输入角色描述" /> <Input placeholder="请输入角色描述" maxLength="100" />
</Item> </Item>
</Form> </Form>
</SiteModal> </SiteModal>
......
...@@ -146,7 +146,7 @@ const AddModal = props => { ...@@ -146,7 +146,7 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入角色名称" /> <Input placeholder="请输入角色名称" maxLength="20" />
</Item> </Item>
<Item label="虚拟目录" name="subSystemValue"> <Item label="虚拟目录" name="subSystemValue">
{itemObj.subSystemValue || itemObj.visibleValue} {itemObj.subSystemValue || itemObj.visibleValue}
...@@ -187,7 +187,7 @@ const AddModal = props => { ...@@ -187,7 +187,7 @@ const AddModal = props => {
</Select> </Select>
</Item> </Item>
<Item label="角色描述" name="description"> <Item label="角色描述" name="description">
<Input placeholder="请输入角色描述" /> <Input placeholder="请输入角色描述" maxLength="100" />
</Item> </Item>
</Form> </Form>
</SiteModal> </SiteModal>
......
...@@ -80,7 +80,7 @@ const SiteManage = () => { ...@@ -80,7 +80,7 @@ const SiteManage = () => {
const [disFlag, setDisFlag] = useState(false); const [disFlag, setDisFlag] = useState(false);
const [chileID, setChildID] = useState([]); const [chileID, setChildID] = useState([]);
const [descrip, setDescrip] = useState('当前未选中角色'); const [descrip, setDescrip] = useState('当前未选中角色');
const [expendKey, setExpendKey] = useState(''); // 保存默认展开项 const [keepTree, setKeepTree] = useState([]);
// const [childData, setChildData] = useState({visibleValue:''}) // const [childData, setChildData] = useState({visibleValue:''})
// 点击树的回调 // 点击树的回调
...@@ -147,7 +147,15 @@ const SiteManage = () => { ...@@ -147,7 +147,15 @@ const SiteManage = () => {
const { roleList } = res.data; const { roleList } = res.data;
console.log(res.data); console.log(res.data);
let arr = transTree(roleList); let arr = transTree(roleList);
console.log(arr);
setTreeData(arr); setTreeData(arr);
let aa = [];
arr.forEach(i => {
console.log(i.visibleValue);
aa.push(i.visibleValue);
});
console.log(aa);
setKeepTree(aa);
} }
}); });
}; };
...@@ -445,6 +453,7 @@ const SiteManage = () => { ...@@ -445,6 +453,7 @@ const SiteManage = () => {
}; };
// 编辑角色 // 编辑角色
const editorUser = (e, record) => { const editorUser = (e, record) => {
console.log(e);
e.stopPropagation(); e.stopPropagation();
setItemObj(record); setItemObj(record);
setEditVisible(true); setEditVisible(true);
...@@ -753,6 +762,7 @@ const SiteManage = () => { ...@@ -753,6 +762,7 @@ const SiteManage = () => {
blockNode blockNode
draggable draggable
onDrop={handleDrop} onDrop={handleDrop}
keepTree={keepTree}
// setExpendKey={expendKey} // setExpendKey={expendKey}
/> />
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 17:26:14 * @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-18 10:18:57 * @LastEditTime: 2022-03-22 16:21:57
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -87,11 +87,11 @@ const AddChildModal = props => { ...@@ -87,11 +87,11 @@ const AddChildModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入站点名称" style={{ width: '95%' }} maxLength="32" /> <Input placeholder="请输入站点名称" style={{ width: '95%' }} maxLength="20" />
</Item> </Item>
{/* <Item label="站点类别">all</Item> */} {/* <Item label="站点类别">all</Item> */}
<Item label="站点描述" name="description"> <Item label="站点描述" name="description">
<Input placeholder="请输入站点描述" style={{ width: '95%' }} maxLength="64" /> <Input placeholder="请输入站点描述" style={{ width: '95%' }} maxLength="100" />
</Item> </Item>
</Form> </Form>
</SiteModal> </SiteModal>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 17:26:14 * @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-18 10:19:08 * @LastEditTime: 2022-03-22 16:22:07
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -86,11 +86,11 @@ const AddModal = props => { ...@@ -86,11 +86,11 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入站点名称" style={{ width: '95%' }} maxLength="32" /> <Input placeholder="请输入站点名称" style={{ width: '95%' }} maxLength="20" />
</Item> </Item>
{/* <Item label="站点类别">all</Item> */} {/* <Item label="站点类别">all</Item> */}
<Item label="站点描述" name="description"> <Item label="站点描述" name="description">
<Input placeholder="请输入站点描述" style={{ width: '95%' }} maxLength="64" /> <Input placeholder="请输入站点描述" style={{ width: '95%' }} maxLength="100" />
</Item> </Item>
</Form> </Form>
</SiteModal> </SiteModal>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 17:26:14 * @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-14 17:26:26 * @LastEditTime: 2022-03-22 16:22:17
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
...@@ -89,10 +89,10 @@ const EditModal = props => { ...@@ -89,10 +89,10 @@ const EditModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入站点名称" style={{ width: '95%' }} maxLength="32" /> <Input placeholder="请输入站点名称" style={{ width: '95%' }} maxLength="20" />
</Item> </Item>
<Item label="站点描述" name="description"> <Item label="站点描述" name="description">
<Input placeholder="请输入站点描述" style={{ width: '95%' }} maxLength="64" /> <Input placeholder="请输入站点描述" style={{ width: '95%' }} maxLength="100" />
</Item> </Item>
</Form> </Form>
</SiteModal> </SiteModal>
......
...@@ -54,7 +54,7 @@ import DelModal from './DelModal'; ...@@ -54,7 +54,7 @@ import DelModal from './DelModal';
import EditModal from './EditModal'; import EditModal from './EditModal';
import AddChildModal from './AddChildModal'; import AddChildModal from './AddChildModal';
const { Search } = Input; const { Search } = Input;
const placeholder = '请输入机构名称'; const placeholder = '请输入查询条件';
const SiteManageV2 = () => { const SiteManageV2 = () => {
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式 const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [treeVisible, setTreeVisible] = useState(true); // 树是否可见 const [treeVisible, setTreeVisible] = useState(true); // 树是否可见
...@@ -84,6 +84,7 @@ const SiteManageV2 = () => { ...@@ -84,6 +84,7 @@ const SiteManageV2 = () => {
const [des, setDes] = useState(''); const [des, setDes] = useState('');
const [data, setData] = useState(''); const [data, setData] = useState('');
const [ch, setCh] = useState(''); const [ch, setCh] = useState('');
const [keepTree, setKeepTree] = useState([]); // 保存所有一级id用于控制只展开一项一级菜单
let a = []; let a = [];
...@@ -124,20 +125,22 @@ const SiteManageV2 = () => { ...@@ -124,20 +125,22 @@ const SiteManageV2 = () => {
}; };
// 添加下级站点 // 添加下级站点
const addSite = (e, recode) => { const addSite = (e, recode) => {
console.log(e);
e.stopPropagation(); e.stopPropagation();
e.nativeEvent.stopImmediatePropagation();
setCurrentStation(recode.id); setCurrentStation(recode.id);
handleShowModal('addChildVisible', true); handleShowModal('addChildVisible', true);
}; };
// 删除当前站点 // 删除当前站点
const delSite = (e, recode) => { const delSite = (e, recode) => {
e.stopPropagation(); e.stopPropagation();
e.nativeEvent.stopImmediatePropagation();
setCurrentStation(recode.id); setCurrentStation(recode.id);
handleShowModal('delVisible', true); handleShowModal('delVisible', true);
}; };
// 编辑当前站点 // 编辑当前站点
const editorSite = (e, recode) => { const editorSite = (e, recode) => {
e.stopPropagation(); e.stopPropagation();
e.nativeEvent.stopImmediatePropagation();
// 保存编辑回显信息 // 保存编辑回显信息
setCurrentStationMsg(recode); setCurrentStationMsg(recode);
// setCurrentStation(recode.id); // setCurrentStation(recode.id);
...@@ -150,6 +153,11 @@ const SiteManageV2 = () => { ...@@ -150,6 +153,11 @@ const SiteManageV2 = () => {
if (res.data.length > 0) { if (res.data.length > 0) {
setTreeLoading(false); setTreeLoading(false);
setTreeData(res.data); setTreeData(res.data);
let aa = [];
res.data.forEach(i => {
aa.push(i.id);
});
setKeepTree(aa);
setTreeDataCopy(res.data); setTreeDataCopy(res.data);
// 第一次加载,默认选择第一个组织 // 第一次加载,默认选择第一个组织
if (treeState) { if (treeState) {
...@@ -686,6 +694,7 @@ const SiteManageV2 = () => { ...@@ -686,6 +694,7 @@ const SiteManageV2 = () => {
expandedKeys={treeData[0].id} expandedKeys={treeData[0].id}
draggable draggable
onDrop={handleDrop} onDrop={handleDrop}
keepTree={keepTree}
/> />
</div> </div>
)} )}
...@@ -815,6 +824,15 @@ const SiteManageV2 = () => { ...@@ -815,6 +824,15 @@ const SiteManageV2 = () => {
/> />
</Tooltip> </Tooltip>
</div> </div>
<div className={styles.siteBtn}>
<Button
type="primary"
className={styles.siteCommit}
onClick={handleCommitBtn}
>
提交
</Button>
</div>
</> </>
) : ( ) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
...@@ -841,7 +859,7 @@ const SiteManageV2 = () => { ...@@ -841,7 +859,7 @@ const SiteManageV2 = () => {
</div> </div>
</Card> </Card>
{dataList.length > 0 && !visibleParams.loading ? ( {dataList.length > 0 && !visibleParams.loading ? (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right', marginTop: '25px' }}>
<Pagination <Pagination
size="small" size="small"
total={total} total={total}
...@@ -854,11 +872,6 @@ const SiteManageV2 = () => { ...@@ -854,11 +872,6 @@ const SiteManageV2 = () => {
) : ( ) : (
'' ''
)} )}
<div className={styles.siteBtn}>
<Button type="primary" className={styles.siteCommit} onClick={handleCommitBtn}>
提交
</Button>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
.ant-pagination { .ant-pagination {
z-index: 999; z-index: 999;
border-top: 1px solid #f0eded; border: none;
} }
} }
} }
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-top: 10px; margin-bottom: 10px;
justify-content: flex-end; justify-content: flex-end;
} }
......
...@@ -91,10 +91,10 @@ const AddUserModal = props => { ...@@ -91,10 +91,10 @@ const AddUserModal = props => {
> >
<Form form={addOrgForm} labelCol={{ span: 4 }}> <Form form={addOrgForm} labelCol={{ span: 4 }}>
<Form.Item name="OUName" label="机构名称" rules={[{ required: true, message: '不能为空' }]}> <Form.Item name="OUName" label="机构名称" rules={[{ required: true, message: '不能为空' }]}>
<Input placeholder="请输入机构名称" maxLength="32" /> <Input placeholder="请输入机构名称" maxLength="20" />
</Form.Item> </Form.Item>
<Form.Item name="description" label="描述"> <Form.Item name="description" label="描述">
<Input placeholder="请输入相关描述" maxLength="32" /> <Input placeholder="请输入相关描述" maxLength="100" />
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>
......
...@@ -127,7 +127,7 @@ const AddUserModal = props => { ...@@ -127,7 +127,7 @@ const AddUserModal = props => {
{ required: true }, { required: true },
]} ]}
> >
<Input placeholder="登录名称不支持中文与特殊字符" maxLength="64" /> <Input placeholder="登录名称不支持中文与特殊字符" maxLength="20" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
...@@ -152,7 +152,7 @@ const AddUserModal = props => { ...@@ -152,7 +152,7 @@ const AddUserModal = props => {
{ pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' }, { pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' },
]} ]}
> >
<Input placeholder="用户姓名不支持特殊字符" maxLength="40" /> <Input placeholder="用户姓名不支持特殊字符" maxLength="20" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 17:26:14 * @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-18 10:06:38 * @LastEditTime: 2022-03-22 16:17:58
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
...@@ -71,10 +71,10 @@ const EditOrgModal = props => { ...@@ -71,10 +71,10 @@ const EditOrgModal = props => {
> >
<Form form={editOrgForm} labelCol={{ span: 4 }}> <Form form={editOrgForm} labelCol={{ span: 4 }}>
<Form.Item name="OUName" label="机构名称" rules={[{ required: true, message: '不能为空' }]}> <Form.Item name="OUName" label="机构名称" rules={[{ required: true, message: '不能为空' }]}>
<Input placeholder="请输入机构名称" maxLength="32" /> <Input placeholder="请输入机构名称" maxLength="20" />
</Form.Item> </Form.Item>
<Form.Item name="description" label="描述"> <Form.Item name="description" label="描述">
<Input placeholder="请输入相关描述" maxLength="32" /> <Input placeholder="请输入相关描述" maxLength="100" />
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>
......
...@@ -137,7 +137,7 @@ const EditUserModal = props => { ...@@ -137,7 +137,7 @@ const EditUserModal = props => {
{ required: true }, { required: true },
]} ]}
> >
<Input placeholder="登录名称不支持中文与特殊字符" maxLength="64" /> <Input placeholder="登录名称不支持中文与特殊字符" maxLength="20" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
...@@ -148,7 +148,7 @@ const EditUserModal = props => { ...@@ -148,7 +148,7 @@ const EditUserModal = props => {
{ pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' }, { pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' },
]} ]}
> >
<Input placeholder="用户姓名不支持特殊字符" maxLength="40" /> <Input placeholder="用户姓名不支持特殊字符" maxLength="20" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
......
...@@ -153,8 +153,7 @@ const UserManage = () => { ...@@ -153,8 +153,7 @@ const UserManage = () => {
const [id, setId] = useState(''); const [id, setId] = useState('');
const { Search } = Input; const { Search } = Input;
const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引 const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引
const [expandedKeys, setExpandedKeys] = useState(''); // 展开的树 const [keepTree, setKeepTree] = useState([]); // 保存所有一级id用于控制只展开一项一级菜单
const [keepTree, setKeepTree] = useState([]);
const setRowClassName = record => const setRowClassName = record =>
record.userID === selectColor.userID ? styles.clickRowStyle : ''; record.userID === selectColor.userID ? styles.clickRowStyle : '';
// 用户表列名 // 用户表列名
...@@ -489,19 +488,16 @@ const UserManage = () => { ...@@ -489,19 +488,16 @@ const UserManage = () => {
.then(newres => { .then(newres => {
if (newres.code === 0) { if (newres.code === 0) {
let res = newres.data; let res = newres.data;
console.log(res);
setTreeLoading(false); setTreeLoading(false);
setTreeData(res); setTreeData(res);
setTreeDataCopy(res); setTreeDataCopy(res);
let aa = []; let aa = [];
res.forEach(i => { res.forEach(i => {
console.log(i.id);
aa.push(i.id); aa.push(i.id);
}); });
setKeepTree(aa); setKeepTree(aa);
// 第一次加载,默认选择第一个组织 // 第一次加载,默认选择第一个组织
if (treeState) { if (treeState) {
console.log(111223);
onSelect([res[0].id]); onSelect([res[0].id]);
setTreeState(false); setTreeState(false);
} }
......
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