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>
......
/*
* @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}
......
......@@ -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