Commit 79311bc5 authored by 邓超's avatar 邓超

fix: 对运维平台进行优化,修改测试到的问题

parent 6f3ea24c
Pipeline #35929 skipped with stages
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
notification, notification,
Spin, Spin,
} from 'antd'; } from 'antd';
import copy from 'copy-to-clipboard';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import styles from './ManagementDataBase.less'; import styles from './ManagementDataBase.less';
import { import {
...@@ -177,6 +178,22 @@ const ManagementDataBase = () => { ...@@ -177,6 +178,22 @@ const ManagementDataBase = () => {
// setContent(text); // setContent(text);
setContent(arr); setContent(arr);
}; };
// 复制SQL
const copySql = text => {
if (copy(text)) {
notification.success({
message: '提示',
duration: 3,
description: '复制成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: '复制失败',
});
}
};
const autoCheckColumns = [ const autoCheckColumns = [
{ {
title: '表名称', title: '表名称',
...@@ -212,6 +229,16 @@ const ManagementDataBase = () => { ...@@ -212,6 +229,16 @@ const ManagementDataBase = () => {
key: 'Message', key: 'Message',
ellipsis: true, ellipsis: true,
}, },
{
title: 'SQL语句',
dataIndex: 'DiffSql',
key: 'DiffSql',
render: text => (
<Button size="small" type="primary" onClick={() => copySql(text)}>
复制SQL
</Button>
),
},
]; ];
const logColumns = [ const logColumns = [
{ {
......
...@@ -431,7 +431,7 @@ const MiniMenu = props => { ...@@ -431,7 +431,7 @@ const MiniMenu = props => {
dragMenu({ dragMenu({
menuID: obj.id, menuID: obj.id,
newParentID: obj.parentId || -1, newParentID: obj.parentId.toString() || '-1',
menuList: String(arrList) || '', menuList: String(arrList) || '',
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
max-height: 20rem; max-height: 20rem;
overflow-y: scroll; overflow-y: scroll;
.ant-card{ .ant-card{
width: 80%; width: 83%;
margin-left: 4rem; margin-left: 4rem;
} }
.ant-card-head-title{ .ant-card-head-title{
......
...@@ -136,8 +136,9 @@ const Flow = () => { ...@@ -136,8 +136,9 @@ const Flow = () => {
dataIndex: 'extendWebPage', dataIndex: 'extendWebPage',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(默认)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -145,8 +146,9 @@ const Flow = () => { ...@@ -145,8 +146,9 @@ const Flow = () => {
dataIndex: 'extendMobilePage', dataIndex: 'extendMobilePage',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(默认)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -155,8 +157,9 @@ const Flow = () => { ...@@ -155,8 +157,9 @@ const Flow = () => {
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(无)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -164,8 +167,9 @@ const Flow = () => { ...@@ -164,8 +167,9 @@ const Flow = () => {
dataIndex: 'flowEndBehavior', dataIndex: 'flowEndBehavior',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(不做处理)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -179,8 +183,7 @@ const Flow = () => { ...@@ -179,8 +183,7 @@ const Flow = () => {
dataIndex: 'errorNodes', dataIndex: 'errorNodes',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(无)' ? 'grey' : 'red' }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
), ),
}, },
{ {
...@@ -188,8 +191,9 @@ const Flow = () => { ...@@ -188,8 +191,9 @@ const Flow = () => {
dataIndex: 'interfaceConfig', dataIndex: 'interfaceConfig',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(无)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
......
...@@ -82,45 +82,30 @@ const Timelimit = props => { ...@@ -82,45 +82,30 @@ const Timelimit = props => {
title: '规则名称', title: '规则名称',
dataIndex: 'Name', dataIndex: 'Name',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '开始节点', title: '开始节点',
dataIndex: 'StartNode', dataIndex: 'StartNode',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '结束节点', title: '结束节点',
dataIndex: 'EndNode', dataIndex: 'EndNode',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '默认时限', title: '默认时限',
dataIndex: 'TimeLimit', dataIndex: 'TimeLimit',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '时限指派字段', title: '时限指派字段',
dataIndex: 'TimeLimitFieldHtml', dataIndex: 'TimeLimitField',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(未配置)' ? 'grey' : '#0000009D' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -128,8 +113,9 @@ const Timelimit = props => { ...@@ -128,8 +113,9 @@ const Timelimit = props => {
dataIndex: 'TimeoutField', dataIndex: 'TimeoutField',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(未配置)' ? 'grey' : '#0000009D' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
......
...@@ -230,8 +230,7 @@ const AddModal = props => { ...@@ -230,8 +230,7 @@ const AddModal = props => {
<Select> <Select>
{timeLimitFlowNodes.map(item => ( {timeLimitFlowNodes.map(item => (
<Option value={item.Name} key={item.ID}> <Option value={item.Name} key={item.ID}>
{/* eslint-disable-next-line react/no-danger */} <span>{item.Name}</span>
<span dangerouslySetInnerHTML={{ __html: item.Name }} />
</Option> </Option>
))} ))}
</Select> </Select>
...@@ -244,8 +243,7 @@ const AddModal = props => { ...@@ -244,8 +243,7 @@ const AddModal = props => {
<Select> <Select>
{timeLimitFlowNodes.map(item => ( {timeLimitFlowNodes.map(item => (
<Option value={item.Name} key={item.ID}> <Option value={item.Name} key={item.ID}>
{/* eslint-disable-next-line react/no-danger */} <span>{item.Name}</span>
<span dangerouslySetInnerHTML={{ __html: item.Name }} />
</Option> </Option>
))} ))}
</Select> </Select>
......
...@@ -93,6 +93,17 @@ const FlowNode = () => { ...@@ -93,6 +93,17 @@ const FlowNode = () => {
} }
setExpandedRowKeys(data); setExpandedRowKeys(data);
}; };
// 表格内文案样式
const textStyleOne = (text, record) => {
if (record.colorType === 2) {
return 'red';
}
if (text === '(未配置)') {
return 'grey';
}
return '000000D9';
};
// 定义展开的表格 // 定义展开的表格
const createUnfoldTable = itemTable => { const createUnfoldTable = itemTable => {
const columns = [ const columns = [
...@@ -101,12 +112,15 @@ const FlowNode = () => { ...@@ -101,12 +112,15 @@ const FlowNode = () => {
dataIndex: 'name', dataIndex: 'name',
width: 149, width: 149,
align: 'left', align: 'left',
render: text => ( render: (text, record) => (
<div <div
style={{ paddingLeft: 60 }} style={{
// eslint-disable-next-line react/no-danger paddingLeft: 60,
dangerouslySetInnerHTML={{ __html: text }} color: record.colorType === 2 ? 'red' : '#000000D9',
/> }}
>
{text}
</div>
), ),
}, },
{ {
...@@ -114,19 +128,15 @@ const FlowNode = () => { ...@@ -114,19 +128,15 @@ const FlowNode = () => {
dataIndex: 'aliasName', dataIndex: 'aliasName',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: text => <span>{text}</span>,
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '移交方式', title: '移交方式',
dataIndex: 'extendHandover', dataIndex: 'extendHandover',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: textStyleOne(text, record) }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
), ),
}, },
{ {
...@@ -134,9 +144,8 @@ const FlowNode = () => { ...@@ -134,9 +144,8 @@ const FlowNode = () => {
dataIndex: 'extendNodeType', dataIndex: 'extendNodeType',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: textStyleOne(text, record) }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
), ),
}, },
{ {
...@@ -147,10 +156,9 @@ const FlowNode = () => { ...@@ -147,10 +156,9 @@ const FlowNode = () => {
ellipsis: { ellipsis: {
showTitle: true, showTitle: true,
}, },
render: text => ( render: (text, record) => (
<Tooltip placement="topLeft" title={text}> <Tooltip placement="topLeft" title={text}>
{/* eslint-disable-next-line react/no-danger */} <span style={{ color: textStyleOne(text, record) }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
</Tooltip> </Tooltip>
), ),
}, },
...@@ -159,15 +167,21 @@ const FlowNode = () => { ...@@ -159,15 +167,21 @@ const FlowNode = () => {
dataIndex: 'extendSeeFields', dataIndex: 'extendSeeFields',
align: 'center', align: 'center',
width: 80, width: 80,
render: (text, record) => (
<span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
{text}
</span>
),
}, },
{ {
title: '字段', title: '字段',
dataIndex: 'extendFields', dataIndex: 'extendFields',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
...@@ -176,9 +190,10 @@ const FlowNode = () => { ...@@ -176,9 +190,10 @@ const FlowNode = () => {
dataIndex: 'extendEditableLater', dataIndex: 'extendEditableLater',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -186,9 +201,10 @@ const FlowNode = () => { ...@@ -186,9 +201,10 @@ const FlowNode = () => {
dataIndex: 'extendRollbackable', dataIndex: 'extendRollbackable',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -196,9 +212,10 @@ const FlowNode = () => { ...@@ -196,9 +212,10 @@ const FlowNode = () => {
dataIndex: 'extendRollbackNode', dataIndex: 'extendRollbackNode',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -206,9 +223,10 @@ const FlowNode = () => { ...@@ -206,9 +223,10 @@ const FlowNode = () => {
dataIndex: 'tranferable', dataIndex: 'tranferable',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -216,9 +234,10 @@ const FlowNode = () => { ...@@ -216,9 +234,10 @@ const FlowNode = () => {
dataIndex: 'eventInformation', dataIndex: 'eventInformation',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
......
...@@ -28,8 +28,11 @@ ...@@ -28,8 +28,11 @@
// 编辑节点表单 // 编辑节点表单
.formData { .formData {
height: 32rem; height: calc(100vh - 162px);
overflow-y: scroll; overflow-y: scroll;
.ant-radio-wrapper {
min-width: 130px;
}
.filedListItem { .filedListItem {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
......
...@@ -85,55 +85,67 @@ const AuxiliaryView = props => { ...@@ -85,55 +85,67 @@ const AuxiliaryView = props => {
title: '前端便签', title: '前端便签',
dataIndex: 'WebLabel', dataIndex: 'WebLabel',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '前端视图', title: '前端视图',
dataIndex: 'WebPage', dataIndex: 'WebPage',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '前端参数', title: '前端参数',
dataIndex: 'WebParam', dataIndex: 'WebParam',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '手持标签', title: '手持标签',
dataIndex: 'MobileLabel', dataIndex: 'MobileLabel',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '手持视图', title: '手持视图',
dataIndex: 'MobilePage', dataIndex: 'MobilePage',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '手持参数', title: '手持参数',
dataIndex: 'MobileParam', dataIndex: 'MobileParam',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '操作', title: '操作',
......
...@@ -10,7 +10,6 @@ import { ...@@ -10,7 +10,6 @@ import {
import { import {
Form, Form,
Modal,
Input, Input,
Radio, Radio,
Select, Select,
...@@ -18,6 +17,8 @@ import { ...@@ -18,6 +17,8 @@ import {
Checkbox, Checkbox,
Button, Button,
message, message,
Drawer,
Space,
} from 'antd'; } from 'antd';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import Fieldselection from './nodeEditComponents/Fieldselection'; import Fieldselection from './nodeEditComponents/Fieldselection';
...@@ -99,58 +100,47 @@ const NodeEdit = props => { ...@@ -99,58 +100,47 @@ const NodeEdit = props => {
loadEventFields({ eventTableName: value.TableName }).then(res => { loadEventFields({ eventTableName: value.TableName }).then(res => {
if (res.code === 0) { if (res.code === 0) {
let defaultCheckedList = value[val] ? value[val].split(',') : []; let defaultCheckedList = value[val] ? value[val].split(',') : [];
// 处理数据为树形结构 // 处理树形结构
let keylist = new Set(); let checkList = res.data.map(item => {
let list = new Map(); let plainOptions = [];
res.data.forEach(item => { item.root.forEach(ele => {
keylist.add(item.group); plainOptions = [...plainOptions, ele.fieldName];
if (keylist.has(item.group)) { });
let listItem = list.get(item.group); return {
// 存入check得选项,是否全选,选中的选项' groupName: item.groupName,
if (listItem) { plainOptions,
list.set(item.group, { defaultCheckedList: [],
plainOptions: [...listItem.plainOptions, item.fieldName], };
defaultCheckedList: [],
});
} else {
list.set(item.group, {
plainOptions: [item.fieldName],
defaultCheckedList: [],
});
}
}
}); });
let checkList = [...list];
defaultCheckedList.forEach(item => { defaultCheckedList.forEach(item => {
checkList.forEach(element => { checkList.forEach(element => {
// 当前得模块是否有当前字段 // 当前得模块是否有当前字段
let indeterminate = element[1].plainOptions.some( let indeterminate = element.plainOptions.some(
checkName => checkName === item, checkName => checkName === item,
); );
// 处理已选中的字段 // 处理已选中的字段
if (indeterminate) { if (indeterminate) {
element[1].defaultCheckedList.push(item); element.defaultCheckedList.push(item);
} }
if ( if (
element[1].defaultCheckedList.length > 0 && element.defaultCheckedList.length > 0 &&
element[1].defaultCheckedList.length < element.defaultCheckedList.length < element.plainOptions.length
element[1].plainOptions.length
) { ) {
element[1].indeterminate = true; element.indeterminate = true;
} else { } else {
element[1].indeterminate = false; element.indeterminate = false;
} }
// 处理是否全选字段 // 处理是否全选字段
if ( if (
element[1].defaultCheckedList.length === element.defaultCheckedList.length === element.plainOptions.length
element[1].plainOptions.length
) { ) {
element[1].checkAll = true; element.checkAll = true;
} else { } else {
element[1].checkAll = false; element.checkAll = false;
} }
}); });
}); });
console.log(checkList, 'checkList');
setFieldList(checkList); setFieldList(checkList);
setTimeout(() => { setTimeout(() => {
setShowField(true); setShowField(true);
...@@ -215,14 +205,19 @@ const NodeEdit = props => { ...@@ -215,14 +205,19 @@ const NodeEdit = props => {
} }
}; };
return ( return (
<Modal <Drawer
title="流程节点配置" title="流程节点配置"
width="500px"
onClose={handleCancel}
visible={visible} visible={visible}
onOk={onFinish} footer={
width="800px" <Space>
onCancel={handleCancel} <Button onClick={handleCancel}>取消</Button>
maskClosable={false} <Button onClick={onFinish} type="primary">
centered 确定
</Button>
</Space>
}
> >
<Form <Form
form={form} form={form}
...@@ -329,13 +324,13 @@ const NodeEdit = props => { ...@@ -329,13 +324,13 @@ const NodeEdit = props => {
/> />
</div> </div>
</Form.Item> </Form.Item>
<Form.Item label="查看字段(工程模型)"> <Form.Item label="查看字段">
<div className={styles.filedListItem}> <div className={styles.filedListItem}>
<Form.Item <Form.Item
name="SeeFields" name="SeeFields"
style={{ marginBottom: 0, width: '100%' }} style={{ marginBottom: 0, width: '100%' }}
> >
<Input placeholder="请选择查看字段" allowClear /> <Input placeholder="请选择查看字段(工程模型)" allowClear />
</Form.Item> </Form.Item>
<Button <Button
type="dashed" type="dashed"
...@@ -379,7 +374,7 @@ const NodeEdit = props => { ...@@ -379,7 +374,7 @@ const NodeEdit = props => {
fieldList={fieldList} fieldList={fieldList}
onSubumit={val => setFiled(val)} onSubumit={val => setFiled(val)}
/> />
</Modal> </Drawer>
); );
}; };
export default NodeEdit; export default NodeEdit;
...@@ -19,7 +19,7 @@ const Fieldselection = props => { ...@@ -19,7 +19,7 @@ const Fieldselection = props => {
return; return;
} }
checkList.forEach(element => { checkList.forEach(element => {
arr = [...arr, ...element[1].defaultCheckedList]; arr = [...arr, ...element.defaultCheckedList];
}); });
setSelectList(arr); setSelectList(arr);
// 初始化拖拽 // 初始化拖拽
...@@ -35,11 +35,11 @@ const Fieldselection = props => { ...@@ -35,11 +35,11 @@ const Fieldselection = props => {
const onChange = (list, index) => { const onChange = (list, index) => {
setCheckList(value => { setCheckList(value => {
const chooseList = JSON.parse(JSON.stringify(value)); const chooseList = JSON.parse(JSON.stringify(value));
chooseList[index][1].defaultCheckedList = list; chooseList[index].defaultCheckedList = list;
chooseList[index][1].indeterminate = chooseList[index].indeterminate =
!!list.length && list.length < chooseList[index][1].plainOptions.length; !!list.length && list.length < chooseList[index].plainOptions.length;
chooseList[index][1].checkAll = chooseList[index].checkAll =
list.length === chooseList[index][1].plainOptions.length; list.length === chooseList[index].plainOptions.length;
return chooseList; return chooseList;
}); });
}; };
...@@ -47,11 +47,11 @@ const Fieldselection = props => { ...@@ -47,11 +47,11 @@ const Fieldselection = props => {
const onCheckAllChange = (e, index) => { const onCheckAllChange = (e, index) => {
setCheckList(value => { setCheckList(value => {
const chooseList = JSON.parse(JSON.stringify(value)); const chooseList = JSON.parse(JSON.stringify(value));
chooseList[index][1].defaultCheckedList = e.target.checked chooseList[index].defaultCheckedList = e.target.checked
? chooseList[index][1].plainOptions ? chooseList[index].plainOptions
: []; : [];
chooseList[index][1].indeterminate = false; chooseList[index].indeterminate = false;
chooseList[index][1].checkAll = e.target.checked; chooseList[index].checkAll = e.target.checked;
return chooseList; return chooseList;
}); });
}; };
...@@ -98,19 +98,21 @@ const Fieldselection = props => { ...@@ -98,19 +98,21 @@ const Fieldselection = props => {
<div className={styles.cardBox} key={index}> <div className={styles.cardBox} key={index}>
<div className={styles.title}> <div className={styles.title}>
<Divider orientation="left" className={styles.cardDivider}> <Divider orientation="left" className={styles.cardDivider}>
<span style={{ marginRight: '10px' }}>{item[0]}</span> <span style={{ marginRight: '10px' }}>
{item.groupName}
</span>
<Checkbox <Checkbox
indeterminate={item[1].indeterminate} indeterminate={item.indeterminate}
onChange={e => onCheckAllChange(e, index)} onChange={e => onCheckAllChange(e, index)}
checked={item[1].checkAll} checked={item.checkAll}
/> />
</Divider> </Divider>
</div> </div>
<div className={styles.filedList}> <div className={styles.filedList}>
<CheckboxGroup <CheckboxGroup
key={index} key={index}
options={item[1].plainOptions} options={item.plainOptions}
value={item[1].defaultCheckedList} value={item.defaultCheckedList}
onChange={list => onChange(list, index)} onChange={list => onChange(list, index)}
/> />
</div> </div>
......
...@@ -107,6 +107,7 @@ const UserManage = () => { ...@@ -107,6 +107,7 @@ const UserManage = () => {
const [searchWord, setSearchWord] = useState(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
const [currentSelectOrg, setCurrentSelectOrg] = useState('-1'); // 左侧机构树-选中组织,字符串类型默认全部机构'-1',注意用户表中的OUID是数字 const [currentSelectOrg, setCurrentSelectOrg] = useState('-1'); // 左侧机构树-选中组织,字符串类型默认全部机构'-1',注意用户表中的OUID是数字
const [currentSelectOldOrg, setCurrentSelectOldOrg] = useState([]); // 更改机构时的树-原先选中组织 const [currentSelectOldOrg, setCurrentSelectOldOrg] = useState([]); // 更改机构时的树-原先选中组织
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
/** ***Modal弹框,是否可视**** */ /** ***Modal弹框,是否可视**** */
const [userVisible, setUserVisible] = useState(false); // 添加用户 const [userVisible, setUserVisible] = useState(false); // 添加用户
...@@ -143,7 +144,7 @@ const UserManage = () => { ...@@ -143,7 +144,7 @@ const UserManage = () => {
const [currentOrgArea, setCurrentOrgArea] = useState(''); const [currentOrgArea, setCurrentOrgArea] = useState('');
const [currentOrgDistinct, setCurrentOrgDistinct] = useState(''); const [currentOrgDistinct, setCurrentOrgDistinct] = useState('');
const [saveExtentFlag, setSaveExtentFlag] = useState(0); const [saveExtentFlag, setSaveExtentFlag] = useState(0);
const [filteredValue,setFilteredValue] =useState([]); const [filteredValue, setFilteredValue] = useState([]);
const { Search } = Input; const { Search } = Input;
const setRowClassName = record => const setRowClassName = record =>
record.userID === selectColor.userID ? styles.clickRowStyle : ''; record.userID === selectColor.userID ? styles.clickRowStyle : '';
...@@ -155,30 +156,14 @@ const UserManage = () => { ...@@ -155,30 +156,14 @@ const UserManage = () => {
key: 'loginName', key: 'loginName',
width: 150, width: 150,
// fixed: 'left', // fixed: 'left',
render: item => ( render: item => searchStyle(item),
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
),
}, },
{ {
title: '用户姓名', title: '用户姓名',
dataIndex: 'userName', dataIndex: 'userName',
key: 'userName', key: 'userName',
width: 150, width: 150,
render: item => ( render: item => searchStyle(item),
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
),
}, },
{ {
title: '所在机构', title: '所在机构',
...@@ -196,17 +181,9 @@ const UserManage = () => { ...@@ -196,17 +181,9 @@ const UserManage = () => {
key: 'phone', key: 'phone',
width: 150, width: 150,
ellipsis: true, ellipsis: true,
render: record => { render: text => {
if (record) { if (text) {
return ( return searchStyle(text);
<div
ref={r => {
if (r) {
r.innerHTML = record;
}
}}
/>
);
} }
return <span>未绑定</span>; return <span>未绑定</span>;
}, },
...@@ -338,10 +315,7 @@ const UserManage = () => { ...@@ -338,10 +315,7 @@ const UserManage = () => {
<div style={{ width: '130px' }}> <div style={{ width: '130px' }}>
<Form form={form}> <Form form={form}>
<Item> <Item>
<Radio.Group <Radio.Group value={selectValue} onChange={onTypeChange}>
value={selectValue}
onChange={onTypeChange}
>
<Space direction="vertical"> <Space direction="vertical">
<Radio value={0}>访客</Radio> <Radio value={0}>访客</Radio>
<Radio value={1}>普通用户</Radio> <Radio value={1}>普通用户</Radio>
...@@ -387,7 +361,19 @@ const UserManage = () => { ...@@ -387,7 +361,19 @@ const UserManage = () => {
), ),
}, },
]; ];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(searchWord, 'g'),
`<span style='color:red'>${searchWord}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
// 获取搜索框的值 // 获取搜索框的值
const handleSearch = e => { const handleSearch = e => {
setSearchWord(e.target.value); setSearchWord(e.target.value);
...@@ -419,7 +405,7 @@ const UserManage = () => { ...@@ -419,7 +405,7 @@ const UserManage = () => {
<span className={styles.titleText}>{org.text}</span> <span className={styles.titleText}>{org.text}</span>
<span className={styles.tip}> <span className={styles.tip}>
<Tooltip title="" className={styles.fs}> <Tooltip title="" className={styles.fs}>
<Dropdown overlay={orgButtonMenu} disabled={currentOrgOperate} > <Dropdown overlay={orgButtonMenu} disabled={currentOrgOperate}>
<PlusOutlined <PlusOutlined
style={{ marginLeft: 20 }} style={{ marginLeft: 20 }}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
...@@ -472,7 +458,7 @@ const UserManage = () => { ...@@ -472,7 +458,7 @@ 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) console.log(res);
setTreeLoading(false); setTreeLoading(false);
setTreeData(res); setTreeData(res);
setTreeDataCopy(res); setTreeDataCopy(res);
...@@ -511,8 +497,8 @@ const UserManage = () => { ...@@ -511,8 +497,8 @@ const UserManage = () => {
// 点击树节点,获取当前机构下所有用户 // 点击树节点,获取当前机构下所有用户
const onSelect = (props, e) => { const onSelect = (props, e) => {
console.log(e) console.log(e);
console.log(props) console.log(props);
setTableLoading(true); setTableLoading(true);
if (e) { if (e) {
setOrgTitle(e.node.title.props.children[0].props.children); setOrgTitle(e.node.title.props.children[0].props.children);
...@@ -533,6 +519,7 @@ const UserManage = () => { ...@@ -533,6 +519,7 @@ const UserManage = () => {
groupID: props[0], groupID: props[0],
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
console.log(res);
setCurrentOrgArea(res.data.MapRange); setCurrentOrgArea(res.data.MapRange);
setCurrentOrgDistinct(res.data.AreeName); setCurrentOrgDistinct(res.data.AreeName);
} }
...@@ -562,6 +549,7 @@ const UserManage = () => { ...@@ -562,6 +549,7 @@ const UserManage = () => {
item.key = index; item.key = index;
return item; return item;
}); });
setShowSearchStyle(false);
setTableData(table); setTableData(table);
} else { } else {
setTableLoading(false); setTableLoading(false);
...@@ -773,12 +761,12 @@ const UserManage = () => { ...@@ -773,12 +761,12 @@ const UserManage = () => {
const onTypeChange = value => { const onTypeChange = value => {
setSelctValue(value.target.value); setSelctValue(value.target.value);
}; };
const authUser = (record) => { const authUser = record => {
setCurrentUser(record); setCurrentUser(record);
console.log(selectValue) console.log(selectValue);
AddUserAuthSetting({ AddUserAuthSetting({
userId: record.userID, userId: record.userID,
userLevel: selectValue userLevel: selectValue,
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
message.info('提交成功'); message.info('提交成功');
...@@ -817,12 +805,14 @@ const UserManage = () => { ...@@ -817,12 +805,14 @@ const UserManage = () => {
setOrgTitle('全部机构搜索结果'); // 设置表头 setOrgTitle('全部机构搜索结果'); // 设置表头
setCurrentSelectOrg('-1'); // 清空选中机构 setCurrentSelectOrg('-1'); // 清空选中机构
console.log(res.data); console.log(res.data);
setShowSearchStyle(true);
setTableData(res.data); setTableData(res.data);
setTableLength(res.data.length); setTableLength(res.data.length);
} else { } else {
notification.error({ notification.error({
message: '提交失败', message: '提示',
description: res.message, duration: 3,
description: res.msg,
}); });
} }
}) })
...@@ -1137,7 +1127,7 @@ const UserManage = () => { ...@@ -1137,7 +1127,7 @@ const UserManage = () => {
let res = newres.data; let res = newres.data;
setTreeLoading(false); setTreeLoading(false);
setSearchWord(''); setSearchWord('');
setFilteredValue([]) setFilteredValue([]);
// 第一次加载,默认选择第一个组织 // 第一次加载,默认选择第一个组织
onSelect([res[0].id], false); onSelect([res[0].id], false);
} else { } else {
...@@ -1154,9 +1144,9 @@ const UserManage = () => { ...@@ -1154,9 +1144,9 @@ const UserManage = () => {
message.error(err); message.error(err);
}); });
}; };
const onChangeInput = (filters) =>{ const onChangeInput = filters => {
setFilteredValue(filters.OUName); setFilteredValue(filters.OUName);
} };
// 更改机构范围 // 更改机构范围
const submitExtent = (extent, areaName) => { const submitExtent = (extent, areaName) => {
...@@ -1177,14 +1167,14 @@ const UserManage = () => { ...@@ -1177,14 +1167,14 @@ const UserManage = () => {
setEditOrgExtentVisible(false); setEditOrgExtentVisible(false);
}; };
const addChange =e=>{ const addChange = e => {
console.log(e) console.log(e);
e.domEvent.stopPropagation() e.domEvent.stopPropagation();
} };
/** ***操作按钮**** */ /** ***操作按钮**** */
// 机构操作 // 机构操作
const orgButtonMenu = ( const orgButtonMenu = (
<Menu onClick={e =>addChange(e)}> <Menu onClick={e => addChange(e)}>
<Menu.Item key="1" onClick={addUser} icon={<UserAddOutlined />}> <Menu.Item key="1" onClick={addUser} icon={<UserAddOutlined />}>
添加用户 添加用户
</Menu.Item> </Menu.Item>
...@@ -1194,7 +1184,7 @@ const UserManage = () => { ...@@ -1194,7 +1184,7 @@ const UserManage = () => {
</Menu> </Menu>
); );
const orgButtonMenu1 = ( const orgButtonMenu1 = (
<Menu onClick={e =>addChange(e)}> <Menu onClick={e => addChange(e)}>
<Menu.Item key="3" onClick={editOrg} icon={<EditOutlined />}> <Menu.Item key="3" onClick={editOrg} icon={<EditOutlined />}>
编辑当前机构 编辑当前机构
</Menu.Item> </Menu.Item>
...@@ -1231,7 +1221,7 @@ const UserManage = () => { ...@@ -1231,7 +1221,7 @@ const UserManage = () => {
{/* 左侧机构树 */} {/* 左侧机构树 */}
<Spin spinning={treeLoading} tip="loading..."> <Spin spinning={treeLoading} tip="loading...">
<Card <Card
style={{overflowY:'hidden'}} style={{ overflowY: 'hidden' }}
className={classnames({ className={classnames({
[styles.orgContainer]: true, [styles.orgContainer]: true,
[styles.orgContainerHide]: !treeVisible, [styles.orgContainerHide]: !treeVisible,
...@@ -1242,7 +1232,7 @@ const UserManage = () => { ...@@ -1242,7 +1232,7 @@ const UserManage = () => {
style={{ style={{
fontSize: '15px ', fontSize: '15px ',
fontWeight: 'bold', fontWeight: 'bold',
marginLeft: '15px' marginLeft: '15px',
}} }}
> >
机构列表 机构列表
...@@ -1254,11 +1244,13 @@ const UserManage = () => { ...@@ -1254,11 +1244,13 @@ const UserManage = () => {
color: '#1890FF', color: '#1890FF',
fontSize: '25px', fontSize: '25px',
verticalAlign: 'middle', verticalAlign: 'middle',
marginLeft: '67%' marginLeft: '67%',
}} }}
/> />
</Tooltip> </Tooltip>
<hr style={{ width: '95%', color: '#eeecec' ,marginLeft: '15px'}} /> <hr
style={{ width: '95%', color: '#eeecec', marginLeft: '15px' }}
/>
{treeData.length > 0 && ( {treeData.length > 0 && (
<Tree <Tree
showIcon="true" showIcon="true"
...@@ -1271,7 +1263,7 @@ const UserManage = () => { ...@@ -1271,7 +1263,7 @@ const UserManage = () => {
onSelect={onSelect} onSelect={onSelect}
height={ height={
treeData.length && treeData.length > 30 treeData.length && treeData.length > 30
? treeData.length * 18+50 ? treeData.length * 18 + 50
: 1000 : 1000
} }
treeData={treeData.map(t => mapTree(t))} treeData={treeData.map(t => mapTree(t))}
......
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