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

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

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