Commit 62bae1b4 authored by 邓超's avatar 邓超
parents 86f12ab6 71889bab
Pipeline #36825 passed with stages
......@@ -10,13 +10,16 @@ const MapScope = props => {
const [options, setOptions] = useState([])
//const [mouseTool,setMouseTool] = useState(null)
const { confirmModal, extent,mapId } = props
const { confirmModal, extent, mapId, title } = props
const [currentExtent, setCurrentExtent] = useState()
const [isDistrict, setIsDistrict] = useState(false)
const [currentAreaName, setCurrentAreaName] = useState(null)
const [area, setArea] = useState([])
const mapID = useRef();
const mouseToolID = useRef();
useEffect(() => {
console.log(extent)
console.log(mapId)
if (document.getElementById(mapId)) {
if (!mapID.current) {
//1.加载底图
......@@ -101,6 +104,8 @@ const MapScope = props => {
}
const onSubmit = () => {
console.log(currentExtent)
console.log(currentAreaName)
confirmModal && confirmModal(currentExtent, currentAreaName)
let mouseTool = mouseToolID.current;
mouseTool.close(true)
......@@ -134,6 +139,7 @@ const MapScope = props => {
let sw = bounds.southWest.pos
let str = (sw.concat(ne)).toString()
console.log(str)
setCurrentExtent(str)
})
}
......@@ -191,7 +197,7 @@ const MapScope = props => {
return (
<SiteModal
{...props}
title={"范围选择"}
title={`${title}的范围选择`}
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
......
import React, { useState, useEffect } from 'react';
import {
Table,
Tooltip,
Spin,
Modal,
Form,
Input,
Space,
Button,
Popconfirm,
notification,
message,
} from 'antd';
import { get, CITY_SERVICE } from '@/services';
import {
GetKeyValue,
EditKeyValue,
DeleteKeyValue,
AddKeyValue,
} from '@/services/dataCenter/api';
import { EditTwoTone, DeleteOutlined } from '@ant-design/icons';
import styles from './AppDic.less';
const AppDic = () => {
const [loading, setLoading] = useState(false);
const [addVisible, setAddVisible] = useState(false);
const [editVisible, setEditVisible] = useState(false);
const [data, setData] = useState([]); // 表数据
const [select, setSelect] = useState({}); // 当前选中条目,修改/删除时设置
const [addForm] = Form.useForm();
const [editForm] = Form.useForm();
const columns = [
{
title: '名称',
dataIndex: 'Label',
key: 'Label',
},
{
title: '键名',
dataIndex: 'Key',
key: 'Key',
},
{
title: '值',
dataIndex: 'Value',
key: 'Value',
},
{
title: '描述',
dataIndex: 'Description',
key: 'Description',
render: record => {
if (!record) {
return '-';
}
return record;
},
},
{
title: '操作',
key: 'action',
width: 100,
render: record => (
<Space>
<Tooltip title="编辑">
<EditTwoTone
onClick={() => {
setSelect(record);
setEditVisible(true);
editForm.setFieldsValue({
label: record.Label,
key: record.Key,
value: record.Value,
description: record.Description,
});
}}
style={{ fontSize: '16px' }}
/>
</Tooltip>
<Popconfirm
title="是否删除该数据?"
okText="确认"
cancelText="取消"
onConfirm={submitDelete}
>
<DeleteOutlined
onClick={() => {
setSelect(record);
}}
style={{
fontSize: '16px',
margin: '0px 10px',
color: '#e86060',
}}
/>
</Popconfirm>
</Space>
),
},
];
useEffect(() => {
getData('-1');
}, []);
const getData = () => {
setLoading(true);
// get(`${CITY_SERVICE}/OMS.svc/M_GetKeyValue`, {
// _version: 9999,
// _dc: new Date().getTime(),
// })
// .then(res => {
// if (res) {
// if (res.length > 0) {
// res.map(item => {
// item.key = item.id;
// return item;
// });
// }
// setData(res);
// } else {
// notification.error({
// message: '获取失败',
// description: res.message,
// });
// }
// setLoading(false);
// })
// .catch(err => {
// setLoading(false);
// message.error(err);
// });
GetKeyValue({}).then(resnew => {
if (resnew.code == 0) {
let res = resnew.data;
if (res.length > 0) {
res.map(item => {
item.key = item.id;
return item;
});
}
setData(res);
} else {
notification.error({
message: '获取失败',
description: res.msg,
});
}
setLoading(false);
});
};
// 提交-添加
const submitAdd = () => {
const label = addForm.getFieldValue('label');
const key = addForm.getFieldValue('key');
const value = addForm.getFieldValue('value');
const description = addForm.getFieldValue('description');
if (label && key && value) {
// get(`${CITY_SERVICE}/OMS.svc/M_AddKeyValue`, {
// _version: 9999,
// _dc: new Date().getTime(),
// label,
// key,
// value,
// desc: description,
// })
// .then(res => {
// if (res.success) {
// setAddVisible(false);
// getData();
// notification.success({
// message: '提交成功',
// });
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
AddKeyValue({
label,
key,
value,
desc: description,
}).then(res => {
if (res.code == 0) {
setAddVisible(false);
getData();
notification.success({
message: '提交成功',
});
} else {
notification.error({
message: '提交失败',
description: res.msg,
});
}
});
} else {
notification.error({
message: '提交失败',
description: '名称/键名/值不能为空',
});
}
};
// 提交-重置
const submitReset = () => {
get(`${CITY_SERVICE}/OMS.svc/M_ResetKeyValue`, {
_version: 9999,
_dc: new Date().getTime(),
})
.then(res => {
if (res.success) {
getData();
notification.success({
message: '重置成功',
});
} else {
notification.error({
message: '重置失败',
description: res.message,
});
}
})
.catch(err => {
message.error(err);
});
};
// 提交-编辑
const submitEdit = () => {
const label = editForm.getFieldValue('label');
const key = editForm.getFieldValue('key');
const value = editForm.getFieldValue('value');
const description = editForm.getFieldValue('description');
if (label && key && value) {
// get(`${CITY_SERVICE}/OMS.svc/M_EditKeyValue`, {
// _version: 9999,
// _dc: new Date().getTime(),
// id: select.id,
// label,
// key,
// value,
// desc: description,
// })
// .then(res => {
// if (res.success) {
// setEditVisible(false);
// getData();
// notification.success({
// message: '提交成功',
// });
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
EditKeyValue({
id: select.id,
label,
key,
value,
desc: description,
}).then(res => {
if (res.code == 0) {
setAddVisible(false);
getData();
notification.success({
message: '提交成功',
});
} else {
notification.error({
message: '提交失败',
description: res.msg,
});
}
});
} else {
notification.error({
message: '提交失败',
description: '名称/键名/值不能为空',
});
}
};
const submitDelete = () => {
// get(`${CITY_SERVICE}/OMS.svc/M_DeleteKeyValue`, {
// _version: 9999,
// _dc: new Date().getTime(),
// key: select.Key,
// })
// .then(res => {
// if (res.success) {
// getData(select.parentID);
// notification.success({
// message: '删除成功',
// });
// } else {
// notification.error({
// message: '删除失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
DeleteKeyValue({
key: select.Key,
}).then(res => {
if (res.code == 0) {
getData(select.parentID);
notification.success({
message: '删除成功',
});
} else {
notification.error({
message: '删除失败',
description: res.msg,
});
}
});
};
return (
<div className={styles.AppDic}>
<Spin spinning={loading} tip="loading...">
<div
style={{
marginBottom: '10px',
fontSize: '16px',
height: 'calc(100vh-200px)',
}}
>
<span style={{ padding: '0 10px' }}>数据字典</span>
<Button
style={{ marginLeft: '10px' }}
type="primary"
size="small"
onClick={() => {
setAddVisible(true);
addForm.resetFields();
}}
>
添加
</Button>
<Popconfirm
title="是否重置默认配置?"
okText="确认"
cancelText="取消"
onConfirm={submitReset}
>
<Button size="small" danger style={{ marginLeft: '10px' }}>
重置
</Button>
</Popconfirm>
</div>
<Table
size="small"
bordered
columns={columns}
dataSource={data}
scroll={{ x: 'max-content' }}
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: 20,
showQuickJumper: true,
showSizeChanger: true,
}}
/>
</Spin>
{/* 添加 */}
<Modal
title="添加数据字典"
visible={addVisible}
onOk={submitAdd}
onCancel={() => {
setAddVisible(false);
}}
okText="确认"
cancelText="取消"
>
<Form form={addForm} labelCol={{ span: 3 }}>
<Form.Item
name="label"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" />
</Form.Item>
<Form.Item
name="key"
label="键名"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入键名" />
</Form.Item>
<Form.Item
name="value"
label="值"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入值" />
</Form.Item>
<Form.Item name="description" label="描述">
<Input placeholder="请输入相关描述" />
</Form.Item>
</Form>
</Modal>
{/* 修改 */}
<Modal
title="修改数据字典"
visible={editVisible}
onOk={submitEdit}
onCancel={() => {
setEditVisible(false);
}}
okText="确认"
cancelText="取消"
>
<Form form={editForm} labelCol={{ span: 3 }}>
<Form.Item
name="label"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" />
</Form.Item>
<Form.Item name="key" label="键名">
<Input placeholder="请输入键名" />
</Form.Item>
<Form.Item
name="value"
label="值"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入值" />
</Form.Item>
<Form.Item name="description" label="描述">
<Input placeholder="请输入相关描述" />
</Form.Item>
</Form>
</Modal>
</div>
);
};
export default AppDic;
.AppDic{
overflow: auto;
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-pagination{
z-index: 999;
background: white;
margin: 2px 0px;
padding:6px 10px;
}
.ant-table-tbody{
.clickRowStyle{
background: #cfe7fd;
}
.clickRowStyle:hover>td{
background: #aed8fa;
}
}
.ant-card-body{
padding: 10px !important;
}
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-table-content{
height:calc(100vh - 258px);
border-right: white;
overflow: auto !important;
}
.ant-pagination{
z-index: 999;
border-top: 1px solid #f0eded;
}
.ant-table-pagination{
padding-right: 12px;
background: white;
margin: 1px 0;
padding:8px;
padding-right: 20px;
}
}
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import {
Table,
Tooltip,
Spin,
Modal,
Form,
Input,
Space,
Button,
Popconfirm,
notification,
message,
Row,
Col,
} from 'antd';
import { EditTwoTone, DeleteOutlined } from '@ant-design/icons';
import { get, CITY_SERVICE } from '@/services';
import {
GetDataDictionaryList,
EditDataDictionary,
AddDataDictionary,
DeleteDataDictionary,
} from '@/services/dataCenter/api';
import styles from './WebDic.less';
const { Search } = Input;
const WebDic = () => {
const [loading, setLoading] = useState(false);
const [level, setLevel] = useState(0); // 设置级别,一级1,二级2,添加条目时使用
const [addVisible, setAddVisible] = useState(false);
const [editVisible, setEditVisible] = useState(false);
const [data, setData] = useState([]); // 一级条目数据
const [subData, setSubData] = useState([]); // 二级条目数据
const [select, setSelect] = useState({}); // 当前选中条目,可以是一级/二级,修改/删除时设置
const [selectColor, setSelectColor] = useState({}); // 当前选中一级条目颜色,修改/删除时设置
const [selectID, setSelectID] = useState('-1'); // 当前选中一级条目的ID,添加二级条目时使用
const [first, setFirst] = useState(true); // 是否第一次加载
const [addForm] = Form.useForm();
const [editForm] = Form.useForm();
const columns = [
{
title: '名称',
dataIndex: 'nodeName',
key: 'nodeName',
width: 220,
},
{
title: '值',
dataIndex: 'nodeValue',
key: 'nodeValue',
render: record => {
if (!record) {
return '-';
}
return record;
},
},
{
title: '操作',
key: 'action',
width: 100,
render: record => (
<Space>
<Tooltip title="编辑">
<EditTwoTone
onClick={() => {
setSelect(record);
if (record.parentID === '-1') {
setSelectColor(record);
}
setEditVisible(true);
editForm.setFieldsValue({
nodeName1: record.nodeName,
nodeValue: record.nodeValue,
});
}}
style={{ fontSize: '16px' }}
/>
</Tooltip>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该数据?"
okText="确认"
cancelText="取消"
onConfirm={submitDelete}
>
<DeleteOutlined
onClick={() => {
setSelect(record);
if (record.parentID === '-1') {
setSelectColor(record);
}
}}
style={{
fontSize: '16px',
margin: '0px 10px',
color: '#e86060',
}}
/>
</Popconfirm>
</div>
</Space>
),
},
];
useEffect(() => {
getData('-1');
}, []);
// 根据父节点nodeID(即parentID)获取数据,一级条目parentID = -1
const getData = value => {
setLoading(true);
// get(`${CITY_SERVICE}/OMS.svc/D_GetDataDictionaryList`, {
// _version: 9999,
// _dc: new Date().getTime(),
// nodeID: value,
// key: '',
// })
// .then(res => {
// if (res) {
// if (res.length > 0) {
// res.map(item => {
// item.key = item.nodeID;
// return item;
// });
// }
// // value为 -1 时获取一级条目数据,否则获取二级条目数据
// if (value === '-1') {
// setData(res); // 设置一级条目数据
// if (first) {
// setSelect(res[0]); // 默认当前选中一级条目第一条
// setSelectColor(res[0]);
// setSelectID(res[0].nodeID); // 设置选中的一级条目ID,用于添加二级条目
// setFirst(false);
// // 获取二级条目数据,默认一级条目第一条,递归一次(条件parentID === '-1')
// if (res[0] && res[0].parentID === '-1') {
// getData(res[0].nodeID);
// }
// }
// } else if (value) {
// setSubData(res); // 设置二级条目,res为空[]时也要设置
// }
// } else {
// notification.error({
// message: '获取失败',
// description: res.message,
// });
// }
// setLoading(false);
// })
// .catch(err => {
// setLoading(false);
// message.error(err);
// });
GetDataDictionaryList({ nodeID: value }).then(resnew => {
if (resnew.code == 0) {
let res = resnew.data;
if (res.length > 0) {
res.map(item => {
item.key = item.nodeID;
return item;
});
}
// value为 -1 时获取一级条目数据,否则获取二级条目数据
if (value === '-1') {
setData(res); // 设置一级条目数据
if (first) {
setSelect(res[0]); // 默认当前选中一级条目第一条
setSelectColor(res[0]);
setSelectID(res[0].nodeID); // 设置选中的一级条目ID,用于添加二级条目
setFirst(false);
// 获取二级条目数据,默认一级条目第一条,递归一次(条件parentID === '-1')
if (res[0] && res[0].parentID === '-1') {
getData(res[0].nodeID);
}
}
} else if (value) {
setSubData(res); // 设置二级条目,res为空[]时也要设置
}
setLoading(false);
} else {
setLoading(false);
notification.error({
message: '获取失败',
description: resnew.msg,
});
}
});
};
const setRowClassName = record =>
record.nodeID === selectColor.nodeID ? styles.clickRowStyle : '';
// 提交-添加
const submitAdd = value => {
const nodeName1 = addForm.getFieldValue('nodeName1');
const nodeValue = addForm.getFieldValue('nodeValue');
// if (nodeName1) {
// get(`${CITY_SERVICE}/OMS.svc/D_AddDataDictionary`, {
// _version: 9999,
// _dc: new Date().getTime(),
// nodeID: value,
// nodeName: nodeName1,
// nodeValue,
// })
// .then(res => {
// if (res.success) {
// setAddVisible(false);
// if (level === 1) {
// getData('-1');
// getData(res.message); // res.message为添加成功返回的一级条目ID
// // 设置添加二级条目的父级ID及父级ID选中状态
// setSelect({ nodeID: res.message, parentID: '-1' });
// setSelectID(res.message);
// setSelectColor({ nodeID: res.message });
// } else {
// getData(value);
// }
// notification.success({
// message: '提交成功',
// });
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
// } else {
// notification.error({
// message: '提交失败',
// description: '名称不能为空',
// });
// }
AddDataDictionary({
nodeID: value,
nodeName: nodeName1,
nodeValue,
}).then(res => {
if (res.code == 0) {
setAddVisible(false);
if (level === 1) {
getData('-1');
getData(res.msg); // res.message为添加成功返回的一级条目ID
// 设置添加二级条目的父级ID及父级ID选中状态
setSelect({ nodeID: res.msg, parentID: '-1' });
setSelectID(res.msg);
setSelectColor({ nodeID: res.msg });
} else {
getData(value);
}
notification.success({
message: '提交成功',
});
} else {
notification.error({
message: '提交失败',
description: res.msg,
});
}
});
};
// 提交-修改
const submitEdit = () => {
const nodeName1 = editForm.getFieldValue('nodeName1');
const nodeValue = editForm.getFieldValue('nodeValue');
if (nodeName1) {
// get(`${CITY_SERVICE}/OMS.svc/D_EditDataDictionary`, {
// _version: 9999,
// _dc: new Date().getTime(),
// nodeID: select.nodeID,
// nodeName: nodeName1,
// nodeValue,
// })
// .then(res => {
// if (res.success) {
// setEditVisible(false);
// getData(select.parentID);
// notification.success({
// message: '提交成功',
// });
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
EditDataDictionary({
nodeID: select.nodeID,
nodeName: nodeName1,
nodeValue,
}).then(res => {
if (res.code == 0) {
setEditVisible(false);
getData(select.parentID);
notification.success({
message: '提交成功',
});
} else {
notification.error({
message: '提交失败',
description: res.msg,
});
}
});
} else {
notification.error({
message: '提交失败',
description: '名称不能为空',
});
}
};
// 提交-删除
const submitDelete = () => {
DeleteDataDictionary({
nodeID: select.nodeID,
})
.then(res => {
if (res.code === 0) {
getData(select.parentID);
if (select.parentID === '-1') {
setSubData([]);
}
notification.success({
message: '删除成功',
});
} else {
notification.error({
message: '删除失败',
description: res.message,
});
}
})
.catch(err => {
message.error(err);
});
};
const setItem = value => {
setLevel(value);
setAddVisible(true);
addForm.resetFields();
// addForm.setFieldsValue({ nodeName1: '', nodeValue: '' });
};
const pagenation = {
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: '20',
showQuickJumper: true,
showSizeChanger: true,
};
const onSearch = key => {};
return (
<div className={styles.WebDic}>
<Spin spinning={loading} tip="loading...">
<Row style={{ background: 'white' }}>
<Col span={12} className={styles.left}>
<div style={{ marginBottom: '10px', fontSize: '16px' }}>
<span style={{ padding: '0 10px' }}>一级条目</span>
<Button type="primary" size="small" onClick={() => setItem(1)}>
添加
</Button>
<Search
style={{ width: '300px', marginLeft: '10px' }}
onSearch={onSearch}
/>
</div>
{/* 一级条目 表格 */}
<Table
size="small"
bordered
columns={columns}
dataSource={data}
scroll={{ x: 'max-content' }}
rowClassName={setRowClassName}
onRow={record => ({
onClick: () => {
getData(record.nodeID);
setSelect(record);
setSelectColor(record);
setSelectID(record.nodeID);
},
})}
pagination={pagenation}
/>
</Col>
<Col span={12}>
<div style={{ marginBottom: '10px', fontSize: '16px' }}>
<span style={{ padding: '0 10px' }}>二级条目</span>
<Button type="primary" size="small" onClick={() => setItem(2)}>
添加
</Button>
</div>
{/* 二级条目 表格 */}
<Table
size="small"
bordered
columns={columns}
dataSource={subData}
scroll={{ x: 'max-content' }}
pagination={pagenation}
/>
</Col>
</Row>
</Spin>
{/* 添加 */}
<Modal
title={level === 1 ? '添加一级条目' : '添加二级条目'}
visible={addVisible}
onOk={() => {
if (level === 1) {
submitAdd('-1');
} else {
submitAdd(selectID);
}
}}
onCancel={() => {
setAddVisible(false);
}}
okText="确认"
cancelText="取消"
>
<Form form={addForm} labelCol={{ span: 3 }}>
<Form.Item
name="nodeName1"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" />
</Form.Item>
<Form.Item name="nodeValue" label="值">
<Input placeholder="请输入值" />
</Form.Item>
</Form>
</Modal>
{/* 修改 */}
<Modal
title={select.parentID === '-1' ? '修改一级条目' : '修改二级条目'}
visible={editVisible}
onOk={submitEdit}
onCancel={() => {
setEditVisible(false);
}}
okText="确认"
cancelText="取消"
>
<Form form={editForm} labelCol={{ span: 3 }}>
<Form.Item
name="nodeName1"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" />
</Form.Item>
<Form.Item name="nodeValue" label="值">
<Input placeholder="请输入值" />
</Form.Item>
</Form>
</Modal>
</div>
);
};
export default WebDic;
.WebDic{
overflow: auto;
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-pagination{
z-index: 999;
background: white;
margin: 2px 0px;
padding:6px 10px;
}
.ant-table-tbody{
.clickRowStyle{
background: #cfe7fd;
}
.clickRowStyle:hover>td{
background: #aed8fa;
}
}
.ant-card-body{
padding: 10px !important;
}
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-table-content{
height:calc(100vh - 268px);
border-right: white;
overflow: auto !important;
}
.ant-pagination{
z-index: 999;
border-top: 1px solid #f0eded;
}
.left{
.ant-pagination{
border-right: 1px solid #f0eded;
}
}
.ant-table-pagination{
padding-top: 16px;
background: white;
padding-right: 20px;
}
}
\ No newline at end of file
import React from 'react';
import { Tabs, Card } from 'antd';
/*
* @Description:
* @Author: leizhe
* @Date: 2021-05-27 16:31:05
* @LastEditTime: 2021-10-28 14:35:23
* @LastEditors: leizhe
*/
import React, { useState, useEffect } from 'react';
import {
Table,
Tooltip,
Spin,
Modal,
Form,
Input,
Space,
Popconfirm,
notification,
message,
Button,
Upload,
Search,
} from 'antd';
import PageContainer from '@/components/BasePageContainer';
import WebDic from './WebDic';
import AppDic from './AppDic';
// import VersionPublish from './VersionPublish';
import {
EditTwoTone,
RollbackOutlined,
DeleteOutlined,
} from '@ant-design/icons';
import {
SearchDataDictionaryList,
EditDataDictionary,
DeleteDataDictionary
} from '@/services/dataCenter/api';
import styles from './index.less';
import { useHistory } from 'react-router-dom';
const dictionary = () => {
const { TabPane } = Tabs;
const [searchData, setSearchData] = useState([]); // 搜索框表格数据
const [treeLoading, setTreeLoading] = useState(false);
const [searchWord, setSearchWord] = useState(''); // 关键字
const [editVisible, setEditVisible] = useState(false);//编辑二级条目
const [editVisible1, setEditVisible1] = useState(false);//编辑一级条目
const [select, setSelect] = useState({}); // 当前选中条目,可以是一级/二级,修改/删除时设置
const history = useHistory();
const [editForm] = Form.useForm();
const [title, setTitle] = useState('')
const { Search } = Input;
const columns2 = [
{
title: () => <span className={styles.font}>名称</span>,
dataIndex: 'nodeName',
key: 'nodeName',
width: '45%',
},
{
title: () => <span className={styles.font}></span>,
dataIndex: 'nodeValue',
key: 'nodeValue',
render: record => {
if (!record) {
return '-';
}
return record;
},
},
{
title: () => <span className={styles.font}>操作</span>,
key: 'action',
width: 100,
align: 'center',
render: record => (
<Space>
<Tooltip title="编辑">
<EditTwoTone
onClick={() => {
setSelect(record);
if (record.parentID === '-1' || record.parentID === null) {
setEditVisible1(true);
} else {
setEditVisible(true);
}
editForm.setFieldsValue({
nodeName: record.nodeName,
nodeValue: record.nodeValue,
});
}}
style={{ fontSize: '16px' }}
/>
</Tooltip>
<div onClick={e => e.stopPropagation()}>
<Tooltip title="删除">
<Popconfirm
title={title}
okText="确认"
cancelText="取消"
onConfirm={submitDelete}
placement="left"
>
<DeleteOutlined
onClick={() => {
setSelect(record);
if (record.parentID === '-1' || record.parentID === null) {
setTitle('确认删除一级目录数据,删除一级目录数据会将其二级目录子数据一起删除');
} else {
setTitle('确认删除二级条目数据');
}
}
}
style={{
fontSize: '16px',
margin: '0px 10px',
color: '#e86060',
}}
/>
</Popconfirm>
</Tooltip>
</div>
</Space>
),
},
];
//修改
const submitEdit = () => {
const nodeName = editForm.getFieldValue('nodeName');
const nodeValue = editForm.getFieldValue('nodeValue');
if (nodeName) {
EditDataDictionary({
nodeID: select.nodeID,
nodeName: nodeName,
nodeValue: nodeValue
}).then(res => {
if (res.code === 0) {
setEditVisible(false);
sumbitSearch()
// getData(select.parentID === '-1' ? null : select.parentID);
notification.success({
message: '提交成功',
});
// if (flag1 === 1) {
// sumbitSearch()
// }
} else {
notification.error({
message: '提交失败',
description: res.msg,
});
}
});
} else {
notification.error({
message: '提交失败',
description: '名称不能为空',
});
}
}
const submitEdit1 = () => {
const nodeName = editForm.getFieldValue('nodeName');
if (nodeName) {
EditDataDictionary({
nodeID: select.nodeID,
nodeName: nodeName,
nodeValue: 'null'
}).then(res => {
if (res.code === 0) {
setEditVisible1(false);
sumbitSearch()
// getData(select.parentID === '-1' ? null : select.parentID);
notification.success({
message: '提交成功',
});
// if (flag1 === 1) {
// sumbitSearch()
// }
} else {
notification.error({
message: '提交失败',
description: res.msg,
});
}
});
} else {
notification.error({
message: '提交失败',
description: '名称不能为空',
});
}
}
const sumbitSearch = () => {
SearchDataDictionaryList({ key: searchWord }).then(res => {
if (res.code === 0) {
setSearchData(res.data);
}
// else {
// notification.error({
// message: '提交失败',
// description: res.message,
// })
// }
});
};
const submitDelete = () => {
console.log(select)
DeleteDataDictionary({
nodeID: select.nodeID,
}).then(res => {
if (res.code === 0) {
// if (flag1 === 1) {
// sumbitSearch()
// }
sumbitSearch()
notification.success({
message: '删除成功',
});
} else {
notification.error({
message: '删除失败',
description: res.message,
});
}
})
.catch(err => {
message.error(err);
})
}
// 获取搜索框的值
const handleSearch = e => {
setSearchWord(e.target.value);
};
const pagenation = {
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: '20',
showQuickJumper: true,
showSizeChanger: true,
};
const back = () => {
history.push({
pathname: '/dataCenter/dictionary1'
});
};
return (
<PageContainer>
<Card>
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="通用数据字典" key="1">
<WebDic />
</TabPane>
<TabPane tab="App数据字典" key="2" type="card">
<AppDic />
</TabPane>
</Tabs>
</Card>
<PageContainer className={styles.dictionaryContainer}>
<div className={styles.containerBox}>
<div className={styles.config}>
<div className={styles.title}>
<Search
style={{ width: 500, marginBottom: 25 }}
placeholder="输入关键字"
onSearch={sumbitSearch}
onChange={e => handleSearch(e)}
enterButton
value={searchWord}
/>
</div>
<div className={styles.btn}>
<Button type="primary" icon={<RollbackOutlined />} onClick={() => back()}>
返回
</Button>
</div>
</div>
<Table
size='small'
bordered
key=""
columns={columns2}
dataSource={searchData}
scroll={{ y: 'calc(100vh - 280px)' }}
pagination={pagenation}
onRow={record => ({
onClick: () => {
setSelect(record);
},
})}
/>
</div>
{/*修改一级条目 */}
<Modal
title={'修改一级条目'}
visible={editVisible1}
onOk={submitEdit1}
onCancel={() => {
setEditVisible1(false);
}}
okText="确认"
cancelText="取消"
>
<Form form={editForm} labelCol={{ span: 3 }}>
<Form.Item
name="nodeName"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" style={{ width: '90%' }} />
</Form.Item>
</Form>
</Modal>
{/*修改二级条目 */}
<Modal
title={'修改二级条目'}
visible={editVisible}
onOk={submitEdit}
onCancel={() => {
setEditVisible(false);
}}
okText="确认"
cancelText="取消"
>
<Form form={editForm} labelCol={{ span: 3 }}>
<Form.Item
name="nodeName"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" style={{ width: '90%' }} />
</Form.Item>
<Form.Item name="nodeValue" label="值">
<Input placeholder="请输入值" style={{ width: '90%' }} />
</Form.Item>
</Form>
</Modal>
</PageContainer>
);
};
......
.dictionaryContainer{
.font {
font-weight: bold;
}
.containerBox {
width: 100vm;
height: calc(100vh - 70px) ;
background: #ffffff;
.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{
margin-left: 0;
}
.ant-table.ant-table-bordered > .ant-table-container{
border: none;
}
.clickRowStyle{
background: #cfe7fd;
}
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
}
.config{
display: flex;
padding: 1rem 0 0.5rem 0.5rem;
justify-content: space-between;
width: calc(100% - 10px);
.title{
font-size: 18px;
color: rgba(0, 114, 255, 1);
font-weight: bold;
}
.btn{
display: flex;
justify-content: flex-end;
width: 20rem;
}
.ant-btn{
display: flex;
align-items: center;
margin-left: 20px;
}
}
}
\ No newline at end of file
......@@ -91,16 +91,18 @@ const AppDic = () => {
cancelText="取消"
onConfirm={submitDelete}
>
<DeleteOutlined
onClick={() => {
setSelect(record);
}}
style={{
fontSize: '16px',
margin: '0px 10px',
color: '#e86060',
}}
/>
<Tooltip title="删除">
<DeleteOutlined
onClick={() => {
setSelect(record);
}}
style={{
fontSize: '16px',
margin: '0px 10px',
color: '#e86060',
}}
/>
</Tooltip>
</Popconfirm>
</Space>
),
......@@ -352,9 +354,12 @@ const AppDic = () => {
height: 'calc(100vh-200px)',
display: 'flex',
alignItems: 'center',
justifyContent:'space-between'
}}
>
<span>数据字典</span>
<div>
<Tooltip title="添加">
<PlusSquareOutlined
onClick={() => {
......@@ -365,7 +370,7 @@ const AppDic = () => {
color: '#1890FF',
fontSize: '20px',
marginRight: '22px',
marginLeft: '90%',
}}
/>
</Tooltip>
......@@ -381,13 +386,13 @@ const AppDic = () => {
style={{
color: '#1890FF',
fontSize: '20px',
verticalAlign: 'text-bottom',
marginRight: '30px',
float: 'right',
}}
/>
</Tooltip>
</Popconfirm>
</div>
</div>
<Table
size="small"
......
......@@ -19,6 +19,7 @@ import { EditTwoTone, DeleteOutlined, CloudSyncOutlined, SearchOutlined, PlusSqu
import { GetDataDictionaryList, EditDataDictionary, AddDataDictionary, DeleteDataDictionary, AddDataDictionaryList, SearchDataDictionaryList, ExportDataDictionary, ImportDataDictionary } from '@/services/dataCenter/api'
import styles from './WebDic.less';
import { useHistory } from 'react-router-dom';
import map from '@/pages/user/login/components/Login/map';
import { Link } from 'react-router-dom';
import { GetMetaData } from '@/services/platform/gis';
......@@ -48,6 +49,7 @@ const WebDic = () => {
const [flag, setFlag] = useState(0);
const [flag1, setFlag1] = useState(0);//搜索框数据是否刷新
const [isloading, setIsloading] = useState(false)
const history = useHistory();
const [InPutVisible, setInPutVisible] = useState(false);
......@@ -348,21 +350,27 @@ const WebDic = () => {
setIsloading(data)
}
}
// const onSearch = () => {
// setSearchVisible(true)
// setFlag1(1)
// }
const onSearch = () => {
setSearchVisible(true)
setFlag1(1)
history.push({
pathname: '/dataCenter/dictionary'
});
}
//搜索
const sumbitSearch = () => {
SearchDataDictionaryList({ key: searchWord }).then(res => {
if (res.code === 0) {
setSearchData(res.data);
} else {
notification.error({
message: '提交失败',
description: res.message,
})
}
}
// else {
// notification.error({
// message: '提交失败',
// description: res.message,
// })
// }
})
}
const resetSearch = () => {
......@@ -644,8 +652,9 @@ const WebDic = () => {
key=''
columns={columns}
dataSource={data}
scroll={{ x: 'max-content', y: 'calc(100vh - 370px)' }}
scroll={{y: 'calc(100vh - 370px)' }}
bordered
className={styles.pab}
title={() => {
return <div >
<span>一级条目</span>
......@@ -655,7 +664,7 @@ const WebDic = () => {
style={{
color: '#1890FF',
fontSize: '25px',
verticalAlign: 'middle',
marginTop:'3px',
float: 'right',
}}
/>
......@@ -702,7 +711,7 @@ const WebDic = () => {
style={{
color: '#1890FF',
fontSize: '25px',
verticalAlign: 'middle',
marginTop:'3px',
float: 'right',
}}
/>
......
......@@ -29,7 +29,8 @@
.ant-table-body{
max-height: calc(100vh - 345px) !important;
min-height:calc(100vh - 345px);
margin-right: -6px;
margin-right: -6px;
width:100%;
}
.ant-table-pagination.ant-pagination {
margin: 10px 0 !important;
......@@ -43,6 +44,9 @@
margin-right: -7px;
}
}
// .pad{
// overflow-x: hidden;
// }
.ant-table-wrapper {
max-width: 98%;
margin-left: 2%;
......
......@@ -2,7 +2,7 @@
* @Description:
* @Author: leizhe
* @Date: 2021-07-13 16:32:28
* @LastEditTime: 2021-07-13 18:02:49
* @LastEditTime: 2021-10-26 16:38:27
* @LastEditors: leizhe
*/
import React from 'react';
......
......@@ -279,23 +279,24 @@ const InitDataBase = props => {
};
// 获取数据库列表
const selectFocus = e => {
setOption([]);
//setOption([]);
let params = form.getFieldsValue();
getDataBaseList({
_version: 9999,
_dc: Date.now(),
// _version: 9999,
// _dc: Date.now(),
userName: params.userName || '',
password: params.password || '',
ip: params.ip || '',
})
.then(res => {
if (res.success) {
setOption(res.root);
if (res.code == 0) {
console.log(res.data.root)
setOption(res.data.root);
} else {
notification.error({
message: '提示',
duration: 15,
description: res.message,
description: res.msg,
});
setOption([]);
}
......@@ -756,7 +757,7 @@ const InitDataBase = props => {
<Card className={styles.mgTop20}>
<div className={styles.tableTitle}>近期保存的数据库连接</div>
<Table
style={{ marginTop: '20px' }}
style={{ marginTop: '20px', height:'25rem', overflowY:'scroll' }}
columns={columns}
dataSource={data}
bordered
......
import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification } from 'antd';
import {
addMongoDBConnString,
editMongoDBConnString,
AddConnString,
EditConnString
} from '@/services/database/api';
const { Item } = Form;
......@@ -19,14 +19,14 @@ const AddModal = props => {
setLoading(true);
let obj = form.getFieldsValue();
if (type === 'add') {
addMongoDBConnString({
_version: 9999,
_dc: Date.now(),
AddConnString({
Type:'mongodb',
MongoDbType:'mongodb',
...obj,
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code == 0) {
form.resetFields();
callBackSubmit();
notification.success({
......@@ -54,15 +54,15 @@ const AddModal = props => {
};
const handleEdit = () => {
let obj = form.getFieldsValue();
editMongoDBConnString({
_version: 9999,
_dc: Date.now(),
EditConnString({
Type:'mongodb',
MongoDbType:'mongodb',
...obj,
oldName: formObj.name,
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code == 0) {
form.resetFields();
callBackSubmit();
notification.success({
......
import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification } from 'antd';
import {
addMySQLConnString,
editMySQLConnString,
AddConnString,
EditConnString
} from '@/services/database/api';
const { Item } = Form;
......@@ -18,14 +18,13 @@ const AddModal = props => {
setLoading(true);
let obj = form.getFieldsValue();
if (type === 'add') {
addMySQLConnString({
_version: 9999,
_dc: Date.now(),
AddConnString({
type:'mysql',
...obj,
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code == 0) {
form.resetFields();
callBackSubmit();
notification.success({
......@@ -53,15 +52,14 @@ const AddModal = props => {
};
const handleEdit = () => {
let obj = form.getFieldsValue();
editMySQLConnString({
_version: 9999,
_dc: Date.now(),
EditConnString({
type:'mysql',
...obj,
oldName: formObj.name,
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code == 0) {
form.resetFields();
callBackSubmit();
notification.success({
......
import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification } from 'antd';
import {
addOracleConnString,
editOracleConnString,
AddConnString,
EditConnString
} from '@/services/database/api';
const { Item } = Form;
......@@ -18,14 +18,13 @@ const AddModal = props => {
setLoading(true);
let obj = form.getFieldsValue();
if (type === 'add') {
addOracleConnString({
_version: 9999,
_dc: Date.now(),
AddConnString({
...obj,
type:'oracle'
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code == 0) {
form.resetFields();
callBackSubmit();
notification.success({
......@@ -53,15 +52,14 @@ const AddModal = props => {
};
const handleEdit = () => {
let obj = form.getFieldsValue();
editOracleConnString({
_version: 9999,
_dc: Date.now(),
EditConnString({
type:'oracle',
...obj,
oldName: formObj.name,
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code == 0) {
form.resetFields();
callBackSubmit();
notification.success({
......
import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification } from 'antd';
import {
addSQLServerConnString,
editSQLServerConnString,
AddConnString,
EditConnString
} from '@/services/database/api';
const { Item } = Form;
......@@ -18,14 +18,13 @@ const AddModal = props => {
setLoading(true);
let obj = form.getFieldsValue();
if (type === 'add') {
addSQLServerConnString({
_version: 9999,
_dc: Date.now(),
AddConnString({
...obj,
type:'sqlserver'
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code ==0) {
form.resetFields();
callBackSubmit();
notification.success({
......@@ -53,15 +52,14 @@ const AddModal = props => {
};
const handleEdit = () => {
let obj = form.getFieldsValue();
editSQLServerConnString({
_version: 9999,
_dc: Date.now(),
EditConnString({
...obj,
oldName: formObj.name,
type:'sqlserver'
})
.then(res => {
setLoading(false);
if (res.success) {
if (res.code ==0) {
form.resetFields();
callBackSubmit();
notification.success({
......
......@@ -260,8 +260,7 @@ const AddModal = props => {
title="巡维保计划配置"
visible={visible}
destroyOnClose
width="800px"
destroyOnClose
width="600px"
{...props}
footer={
<Space>
......@@ -285,11 +284,11 @@ const AddModal = props => {
},
]}
>
<Input style={{ width: '580px' }} placeholder="业务名称不可重复" />
<Input placeholder="业务名称不可重复" />
</Item>
</Col>
<Col span={23}>
<span style={{ position: 'absolute', left: '5.5%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<span style={{ position: 'absolute', left: '1%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<Item
label="业务类型"
name="businessType"
......@@ -308,7 +307,7 @@ const AddModal = props => {
<div>
<Input
className="ue-editable-select-input"
style={{ width: '580px' }}
onChange={inputType1}
value={Type1}
placeholder="选择或手动输入业务类型"
......@@ -316,13 +315,13 @@ const AddModal = props => {
</Input>
<Dropdown
placement='bottomRight'
style={{ width: '580px' }}
style={{ width: '430px' }}
overlay={<Menu>
<Menu.Item key="巡检" onClick={() => { setType1("巡检"); form.setFieldsValue({ businessType: "巡检" }) }} style={{ width: '580px', marginLeft: '-8px' }}>巡检</Menu.Item>
<Menu.Item key="保养" onClick={() => { setType1("保养"); form.setFieldsValue({ businessType: "保养" }) }} style={{ width: '580px', marginLeft: '-8px' }}>保养</Menu.Item>
<Menu.Item key="巡检" onClick={() => { setType1("巡检"); form.setFieldsValue({ businessType: "巡检" }) }} style={{ width: '430px', marginLeft: '-8px' }}>巡检</Menu.Item>
<Menu.Item key="保养" onClick={() => { setType1("保养"); form.setFieldsValue({ businessType: "保养" }) }} style={{ width: '430px', marginLeft: '-8px' }}>保养</Menu.Item>
</Menu>} >
<div className={styles.linkDrowp} onClick={e => e.preventDefault()}>
<DownOutlined style={{ fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)' }} />
<DownOutlined style={{ fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)', marginLeft:'5px' }} />
</div>
</Dropdown>
</div>
......@@ -341,7 +340,7 @@ const AddModal = props => {
]}
>
<Select
style={{ width: '580px' }}
placeholder="选择计划执行周期"
onChange={changTable}
value={selectValue}
......@@ -356,7 +355,7 @@ const AddModal = props => {
</Item>
</Col>
<Col span={23}>
<span style={{ position: 'absolute', left: '5.5%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<span style={{ position: 'absolute', left: '1%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<Item
label="台账名称"
name="accountName"
......@@ -375,7 +374,7 @@ const AddModal = props => {
<div>
<Input
className="ue-editable-select-input"
style={{ width: '580px' }}
onChange={inputType2}
value={Type2}
placeholder="选择此计划关联的设备台账名称,如果没有请先配置台账管理台账名称为设备"
......@@ -383,19 +382,19 @@ const AddModal = props => {
</Input>
<Dropdown
placement='bottomRight'
style={{ width: '20rem' }}
style={{ width: '430px' }}
overlay={<Menu>
{treeData.length ? treeData.map((item, index) => { return <Menu.Item onClick={() => { setType2(item); form.setFieldsValue({ accountName: item }) }} style={{ width: '580px', marginLeft: '-8px' }} key={index}>{item}</Menu.Item> }) : ''}
{treeData.length ? treeData.map((item, index) => { return <Menu.Item onClick={() => { setType2(item); form.setFieldsValue({ accountName: item }) }} style={{ width: '430px', marginLeft: '-8px' }} key={index}>{item}</Menu.Item> }) : ''}
</Menu>} >
<div className={styles.linkDrowp} onClick={e => e.preventDefault()}>
<DownOutlined style={{ fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)' }} />
<DownOutlined style={{ fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)', marginLeft:'5px'}} />
</div>
</Dropdown>
</div>
</Item>
</Col>
<Col span={23}>
<span style={{ position: 'absolute', left: '5.5%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<span style={{ position: 'absolute', left: '1%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<Item
label="反馈名称"
name="feedbackName"
......@@ -412,14 +411,14 @@ const AddModal = props => {
]}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '508px' }} placeholder="请选择反馈名称" onChange={(e) => changeText(e, 'feedbackName')} value={inputValue.feedbackName} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择反馈名称" onChange={(e) => changeText(e, 'feedbackName')} value={inputValue.feedbackName} allowClear />
<Button type="dashed" onClick={() => pickFiled('feedbackName')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
<Col span={23}>
<span style={{ position: 'absolute', left: '5.5%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<span style={{ position: 'absolute', left: '1%', top: '9%', color: 'red', fontSize: '16px' }}>*</span>
<Item
label="执行角色"
name="doRole"
......@@ -436,7 +435,7 @@ const AddModal = props => {
]}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '508px' }} placeholder="请选择执行角色" onChange={(e) => changeText(e, 'doRole')} value={inputValue.doRole} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择执行角色" onChange={(e) => changeText(e, 'doRole')} value={inputValue.doRole} allowClear />
<Button type="dashed" onClick={() => pickFiled1('doRole')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
......@@ -452,13 +451,14 @@ const AddModal = props => {
},
]}
>
<Input style={{ width: '14rem' }} placeholder="请输入预生成天数" />
<Input placeholder="请输入预生成天数" />
</Item>
</Col>
<Col span={11}>
<Col span={10}>
<Item
label="在线任务量"
name="onLines"
labelCol={{ span: 10 }}
rules={[
{
required: true,
......@@ -466,7 +466,7 @@ const AddModal = props => {
},
]}
>
<Input style={{ width: '12rem' }} placeholder="请输入在线任务量" />
<Input placeholder="请输入在线任务量" />
</Item>
</Col>
<Col span={23}>
......@@ -482,7 +482,7 @@ const AddModal = props => {
]}
>
<Select
style={{ width: '580px' }}
placeholder="是否送审"
onChange={changTable1}
value={selectValue1}
......@@ -499,7 +499,7 @@ const AddModal = props => {
labelCol={{ span: 4 }}
>
<TextArea style={{ width: '580px' }} placeholder="设备对应的Scada台账名称,可多选" />
<TextArea placeholder="设备对应的Scada台账名称,可多选" />
</Item>
</Col>
</Row>
......
......@@ -303,7 +303,7 @@ const AddFlowsModal = props => {
<Drawer
title={type === 'add' ? '添加受理流程' : '编辑受理流程'}
visible={visible}
width='800px'
width='600px'
onClose={onClose}
destroyOnClose
footer={
......@@ -314,9 +314,9 @@ const AddFlowsModal = props => {
</Space>
}
>
<Form form={form} labelCol={{ span: 7 }} style={{ height: '8rem', overflowY: 'scroll' }}>
<Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}>
<Row>
<Col span={24}>
<Col span={23}>
{type === 'edit' ?
<>
<Item
......@@ -325,7 +325,7 @@ const AddFlowsModal = props => {
labelCol={{ span: 4 }}
>
<Select
style={{ width: '560px' }}
placeholder="选择受理流程"
placeholder={selectValue}
disabled
......@@ -341,7 +341,7 @@ const AddFlowsModal = props => {
labelCol={{ span: 4 }}
>
<Select
style={{ width: '560px' }}
placeholder="选择受理流程"
>
{standingTable ? standingTable.map((item, index) => { return <Option key={index} value={item}>{item}</Option> }) : ''}
......@@ -350,15 +350,15 @@ const AddFlowsModal = props => {
</>
}
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="受理权限"
name="Roles"
labelCol={{ span: 4 }}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择受理权限" onChange={(e) => changeText(e, 'Roles')} value={inputValue.Roles} allowClear />
<Button type="dashed" onClick={() => pickFiled1('Roles')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '3.2rem' }} />
<Input style={{width:'83%'}}placeholder="请选择受理权限" onChange={(e) => changeText(e, 'Roles')} value={inputValue.Roles} allowClear />
<Button type="dashed" onClick={() => pickFiled1('Roles')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
......
......@@ -586,7 +586,7 @@ const AddModal = props => {
return (
<Drawer
title={type === 'add' ? '添加事件类型' : '编辑事件类型'}
width="800px"
width="600px"
destroyOnClose
{...props}
footer={
......@@ -612,12 +612,13 @@ const AddModal = props => {
},
]}
>
<Input style={{ width: '17rem' }} onChange={prefix} placeholder="请输入事件名称" />
<Input onChange={prefix} placeholder="请输入事件名称" />
</Item>
</Col>
<Col span={11}>
<Col span={10}>
<Item
label="编码前缀"
labelCol={{ span: 14 }}
name="Code"
rules={[
{
......@@ -626,7 +627,7 @@ const AddModal = props => {
},
]}
>
<Input style={{ width: '12.5rem' }} value={prefixName} placeholder="请输入编码前缀" />
<Input value={prefixName} placeholder="请输入编码前缀" />
</Item>
</Col>
<Col span={23}>
......@@ -649,7 +650,7 @@ const AddModal = props => {
{treeData ? treeData.map((item, index) => { return <Option key={index} value={item}>{item}</Option> }) : ''}
</Select>
</Item> */}
<span style={{position: 'absolute', left: '5.5%', top: '9%', color: 'red', fontSize: '16px'}}>*</span>
<span style={{position: 'absolute', left: '1%', top: '9%', color: 'red', fontSize: '16px'}}>*</span>
<Item
label="业务类型"
name="BusinessType"
......@@ -668,16 +669,15 @@ const AddModal = props => {
<div>
<Input
className="ue-editable-select-input"
style={{ width: '580px' }}
onChange={inputType}
value={Type1}
>
</Input>
<Dropdown
placement='bottomRight'
style={{ width: '20rem' }}
style={{ width: '430px' }}
overlay={<Menu>
{treeData.length ? treeData.map((item, index) => { return <Menu.Item onClick={() => { setType1(item); form.setFieldsValue({ BusinessType: item }) }} style={{ width: '580px', marginLeft:'-8px'}} key={index}>{item}</Menu.Item> }) : ''}
{treeData.length ? treeData.map((item, index) => { return <Menu.Item onClick={() => { setType1(item); form.setFieldsValue({ BusinessType: item }) }} style={{ width: '430px', marginLeft:'-8px'}} key={index}>{item}</Menu.Item> }) : ''}
</Menu>} >
<div onClick={e => e.preventDefault()} style={{position:'absolute', left:'94%', width: '1rem',top:'0', marginTop:'6px'}}>
<DownOutlined style={{fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)' }} />
......@@ -699,7 +699,7 @@ const AddModal = props => {
]}
>
<Select
style={{ width: '580px' }}
placeholder="选择事件主表"
onChange={changTable}
// defaultValue={selectValue}
......@@ -773,12 +773,12 @@ const AddModal = props => {
<Radio.Group onChange={onChange2} value={value} defaultValue={chee}>
<Radio value={0} style={{ marginLeft: '5px' }}>仅上报</Radio>
<Radio value={1} style={{ marginLeft: '185px' }}>工单分派</Radio>
<Radio value={1} style={{ marginLeft: '100px' }}>工单分派</Radio>
</Radio.Group>
</Item>
</Col>
<Col span={24}>
<span style={{position: 'absolute', left: '6%', top: '9%', color: 'red', fontSize: '16px'}}>*</span>
<Col span={23}>
<span style={{position: 'absolute', left: '1%', top: '5%', color: 'red', fontSize: '16px'}}>*</span>
<Item
label="摘要字段"
name="SummaryFields"
......@@ -795,14 +795,14 @@ const AddModal = props => {
]}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择摘要字段" onChange={(e) => changeText(e, 'SummaryFields')} value={inputValue.SummaryFields} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择摘要字段" onChange={(e) => changeText(e, 'SummaryFields')} value={inputValue.SummaryFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('SummaryFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
<Col span={24}>
<span style={{position: 'absolute', left: '6%', top: '9%', color: 'red', fontSize: '16px'}}>*</span>
<Col span={23}>
<span style={{position: 'absolute', left: '1%', top: '5%', color: 'red', fontSize: '16px'}}>*</span>
<Item
label="上报字段"
name="ReportFields"
......@@ -819,13 +819,13 @@ const AddModal = props => {
]}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择上报字段" onChange={(e) => changeText(e, 'ReportFields')} value={inputValue.ReportFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('ReportFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
<Input style={{ width: '83%' }} placeholder="请选择上报字段" onChange={(e) => changeText(e, 'ReportFields')} value={inputValue.ReportFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('ReportFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }}/>
</div>
</Item>
</Col>
<Col span={24}>
<span style={{position: 'absolute', left: '6%', top: '9%', color: 'red', fontSize: '16px'}}>*</span>
<Col span={23}>
<span style={{position: 'absolute', left: '1%', top: '5%', color: 'red', fontSize: '16px'}}>*</span>
<Item
label="显示字段"
name="DisplayFields"
......@@ -842,13 +842,13 @@ const AddModal = props => {
]}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择显示字段" onChange={(e) => changeText(e, 'DisplayFields')} value={inputValue.DisplayFields} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择显示字段" onChange={(e) => changeText(e, 'DisplayFields')} value={inputValue.DisplayFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('DisplayFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
<Col span={24}>
<span style={{position: 'absolute', left: '6%', top: '9%', color: 'red', fontSize: '16px'}}>*</span>
<Col span={23}>
<span style={{position: 'absolute', left: '1%', top: '5%', color: 'red', fontSize: '16px'}}>*</span>
<Item
label="编辑字段"
name="EditableFields"
......@@ -865,100 +865,100 @@ const AddModal = props => {
]}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择编辑字段" onChange={(e) => changeText(e, 'EditableFields')} value={inputValue.EditableFields} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择编辑字段" onChange={(e) => changeText(e, 'EditableFields')} value={inputValue.EditableFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('EditableFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="转单字段"
name="TransitFields"
labelCol={{ span: 4 }}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择转单字段" onChange={(e) => changeText(e, 'TransitFields')} value={inputValue.TransitFields} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择转单字段" onChange={(e) => changeText(e, 'TransitFields')} value={inputValue.TransitFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('TransitFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="事件权限"
name="Roles"
labelCol={{ span: 4 }}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择事件权限" onChange={(e) => changeText(e, 'Roles')} value={inputValue.Roles} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择事件权限" onChange={(e) => changeText(e, 'Roles')} value={inputValue.Roles} allowClear />
<Button type="dashed" onClick={() => pickFiled1('Roles')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="置顶条件"
name="TopWhere"
labelCol={{ span: 4 }}
>
<Input style={{ width: '500px' }} placeholder="请输入置顶条件" allowClear />
<Input placeholder="请输入置顶条件" allowClear />
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="上报视图"
name="ReportPage"
labelCol={{ span: 4 }}
>
<Input style={{ width: '500px' }} placeholder="请输入上报视图" allowClear />
<Input placeholder="请输入上报视图" allowClear />
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="处理视图"
name="DealPage"
labelCol={{ span: 4 }}
>
<Input style={{ width: '500px' }} placeholder="请输入处理视图" allowClear />
<Input placeholder="请输入处理视图" allowClear />
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="关联事件"
name="RelatedEvents"
labelCol={{ span: 4 }}
>
<Input style={{ width: '500px' }} placeholder="请输入关联事件" allowClear />
<Input placeholder="请输入关联事件" allowClear />
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="关联字段"
name="RelatedEventFields"
labelCol={{ span: 4 }}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择关联字段" onChange={(e) => changeText(e, 'RelatedEventFields')} value={inputValue.RelatedEventFields} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择关联字段" onChange={(e) => changeText(e, 'RelatedEventFields')} value={inputValue.RelatedEventFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('RelatedEventFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="接口配置"
name="InterfaceConfig"
labelCol={{ span: 4 }}
>
<Input style={{ width: '500px' }} placeholder="请输入接口配置" />
<Input placeholder="请输入接口配置" />
</Item>
</Col>
<Col span={24}>
<Col span={23}>
<Item
label="图片表达"
name="ImageExpression"
labelCol={{ span: 4 }}
>
<div className={styles.filed_listItem} >
<Input style={{ width: '500px' }} placeholder="请选择图片表达" onChange={(e) => changeText(e, 'pictureFields')} value={inputValue.pictureFields} allowClear />
<Input style={{ width: '83%' }} placeholder="请选择图片表达" onChange={(e) => changeText(e, 'pictureFields')} value={inputValue.pictureFields} allowClear />
<Button type="dashed" onClick={() => pickFiled2('pictureFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
......
......@@ -70,7 +70,12 @@ const ChangeAddFlows = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -80,6 +85,23 @@ const ChangeAddFlows = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
console.log(checkArr)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
......@@ -128,7 +150,7 @@ const ChangeAddFlows = props => {
{visible && (
<div className={styles.listCard}>
<div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选字段列表</Divider>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选部门角色站点</Divider>
<div className={styles.cardContent}>
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
......@@ -138,7 +160,7 @@ const ChangeAddFlows = props => {
</div>
</div>
<div className={styles.cardItem}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>已选字段列表</Divider>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>已选列表</Divider>
<div className={styles.cardContent}>
<div className={styles.doctorTable}>
<table>
......
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Form, Modal, Divider, Checkbox} from 'antd';
import { Form, Modal, Divider, Checkbox } from 'antd';
import styles from './incident.less';
import Sortable from 'sortablejs';
......@@ -17,6 +17,7 @@ const AddModal = props => {
const [checkAll, setCheckAll] = useState([]);
const [selectData, setSelectData] = useState([])
let objArr = []
const onChangeList = (list, index, title) => {
const checkedListArr = [...checkedList]
checkedListArr[index] = list
......@@ -76,7 +77,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
arr.map((item, index) => {
filed[item].map((i, j) => {
b.push(i)
})
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed[item].includes(checkItem)) {
......@@ -86,10 +92,29 @@ const AddModal = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed[item].length)
checkAllArr.push(checkArr[index].length === filed[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
filed.外部字段 = a
console.log(filed)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
console.log(characterValue)
let newArr = characterValue.length ? characterValue.split(",") : []
console.log(newArr)
setSelectData(newArr)
draftSort()
} else if (isType === 'app') {
......@@ -101,7 +126,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -111,6 +141,23 @@ const AddModal = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
......@@ -180,7 +227,8 @@ const AddModal = props => {
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}><Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed[item]} checked={checkAll[index]} style={{ marginRight: '7px' }}></Checkbox>{item}</Divider>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index, item)} /></div>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index, item)} />
</div>
})}
</div>
</>
......@@ -241,7 +289,7 @@ const AddModal = props => {
{visible && (
<div className={styles.listCard}>
<div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选字段列表</Divider>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选部门角色站点</Divider>
<div className={styles.cardContent}>
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
......@@ -251,7 +299,7 @@ const AddModal = props => {
</div>
</div>
<div className={styles.cardItem}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>已选字段列表</Divider>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>已选列表</Divider>
<div className={styles.cardContent}>
<div className={styles.doctorTable}>
<table>
......
......@@ -367,9 +367,9 @@ const videoManager = () => {
icon={<PlusOutlined className={styles.icon} />}
onClick={addVideo}
style={{
marginLeft: '49%',
float: 'right',
verticalAlign: 'middle',
marginTop: '-3px',
// marginTop: '-3px',
}}
>
新增
......
......@@ -137,15 +137,15 @@ const UserModal = props => {
description: '请至少选择选择一个用户!',
});
chooseUserToStation(
qs.stringify({
{
userList: String(result.flat()),
stationID: itemObj.roleID,
}),
{
headers: {
'content-type': 'application/x-www-form-urlencggoded;charset=UTF-8',
},
},
// {
// headers: {
// 'content-type': 'application/x-www-form-urlencggoded;charset=UTF-8',
// },
// },
)
.then(res => {
......@@ -264,7 +264,7 @@ const UserModal = props => {
return (
<SiteModal
{...props}
title="新增角色"
title="关联用户"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 100 }}
width="800px"
......
......@@ -8,7 +8,7 @@ const EditModal = props => {
const [formLayout, setFormLayout] = useState('horizontal');
const [loading, setLoading] = useState(false);
const flag = useRef();
const { confirmModal, stationObj } = props;
const { confirmModal, stationObj, des } = props;
const onSubmit = () => {
form
.validateFields()
......@@ -54,7 +54,7 @@ const EditModal = props => {
useEffect(() => {
form.setFieldsValue({
stationName: stationObj.text,
description: stationObj.description,
description: stationObj.describe,
});
}, [stationObj]);
return (
......
......@@ -31,7 +31,8 @@ import {
DoubleLeftOutlined,
DoubleRightOutlined,
DownOutlined,
PlusOutlined
PlusOutlined,
ApartmentOutlined
} from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer';
......@@ -89,6 +90,11 @@ const SiteManageV2 = () => {
const [updatePageUser, setUpdatePageUser] = useState(1);//
const [updateCheck, setUpdateCheck] = useState(1);
const [name, setName] = useState('');
const [des, setDes] = useState('')
const [data, setData] = useState('')
const [ch, setCh] = useState('')
let a = []
// 渲染机构树
const mapTree = org => {
......@@ -169,6 +175,10 @@ const SiteManageV2 = () => {
updateTrees();
}, [flag]);
useEffect(()=>{
getValue()
},[])
//切换站点,点击分页按钮,提交
useEffect(() => {
if (!currentStation) return;
......@@ -283,6 +293,7 @@ const SiteManageV2 = () => {
//选中某个站点
const onSelect = (props, e) => {
console.log('props[0]', props[0]);
setCh(props[0])
if (!props[0]) {
setCurrentStation(currentStation)
......@@ -290,8 +301,37 @@ const SiteManageV2 = () => {
setCurrentStation(props[0]);
}
setPage({ pageNum: 1, pageSize: 10 });
console.log(data)
data.map((item, index) => {
if(item.id == props[0]){
console.log(item.id)
console.log(item.describe)
setDes(item.describe)
}
})
}
const getValue = () => {
getSiteTree({ selectNode: -1 }).then(
res => {
console.log(res.data)
getData1(res.data)
}
)
}
const getData1 = e => {
console.log(e)
e.map((i, j)=>{
a.push(i)
if(i.children.length>0){
getData1(i.children)
}
})
console.log(a)
setData(a)
}
// 弹出模态框
const handleShowModal = (key, value) => {
setvisibleParams({ ...visibleParams, [key]: value });
......@@ -434,7 +474,7 @@ const SiteManageV2 = () => {
.then(res => {
handleShowModal('btnLoading', false);
if (res.code===0) {
if (res.code === 0) {
setSelectList([]);
setUpdateCheck(updateCheck + 1);
notification.success({
......@@ -537,6 +577,7 @@ const SiteManageV2 = () => {
<EditModal
visible={visibleParams.editVisible}
stationObj={currentStationMsg}
des={des}
onCancel={() => handleShowModal('editVisible', false)}
confirmModal={editModal}
/>
......@@ -564,7 +605,7 @@ const SiteManageV2 = () => {
/>
</Col>
<Col span={3} />
</Row>
</Card>
<div style={{ background: '#fff' }}>
......@@ -653,7 +694,7 @@ const Panels = React.memo(props => {
<DownOutlined className={styles.siteIcon} />
)} */}
{/* <UpOutlined className={styles.siteIcon} /> */}
<UserOutlined className={styles.siteIcon} />
<ApartmentOutlined className={styles.siteIcon} />
<p style={{ color }}>{GroupName}</p>
<Checkbox
key="0"
......
......@@ -13,7 +13,7 @@ const AddUserModal = props => {
// 提交-添加下级机构
const submitAddOrg = () => {
addOrg(
orgID,
orgID.id,
addOrgForm.getFieldValue('OUName'),
addOrgForm.getFieldValue('desrciption') || '',
'',
......
......@@ -15,6 +15,7 @@ const AddUserModal = props => {
useEffect(() => {
addUserForm.resetFields();
console.log(orgID)
}, [orgID]);
// 提交-添加用户
......@@ -69,7 +70,7 @@ const AddUserModal = props => {
(phone === '' || isPhone.test(phone)) &&
(email === '' || isEmail.test(email))
) {
addUser({ OUID: orgID, loginName, userName, password, phone, email })
addUser({ OUID: orgID.id, loginName, userName, password, phone, email })
.then(res => {
if (res.msg==='') {
addUserForm.resetFields();
......
......@@ -3,11 +3,11 @@ import { Modal, notification, message } from 'antd';
import { deleteOrg } from '@/services/userCenter/userManage/api';
const DeleteOrgModal = props => {
const { title, visible, orgID, onCancel, updateTrees } = props;
const { title, visible, orgID, onCancel, updateTrees} = props;
// 提交-删除机构
const submitDeleteOrg = () =>
deleteOrg(orgID)
deleteOrg(orgID.id)
.then(res => {
if (res.msg==='') {
onCancel();
......
......@@ -25,7 +25,7 @@ const EditOrgModal = props => {
// 提交-编辑当前机构
const submitEditOrg = () =>
editOrgInfo(
orgID,
orgID.id,
editOrgForm.getFieldValue('OUName'),
editOrgForm.getFieldValue('description') || '',
'',
......
......@@ -105,6 +105,7 @@ const UserManage = () => {
const [selectColor, setSelectColor] = useState({}); // 当前选中颜色,操作时设置
const [orgFilters, setOrgFilters] = useState([]); // 用户列筛选
const [searchWord, setSearchWord] = useState(''); // 关键字
const [currentSelectOrg1, setCurrentSelectOrg1] = useState('-1');
const [currentSelectOrg, setCurrentSelectOrg] = useState('-1'); // 左侧机构树-选中组织,字符串类型默认全部机构'-1',注意用户表中的OUID是数字
const [currentSelectOldOrg, setCurrentSelectOldOrg] = useState([]); // 更改机构时的树-原先选中组织
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
......@@ -124,6 +125,7 @@ const UserManage = () => {
const [authUserVisible, setAuthUserVisible] = useState(false); // 鉴权用户
const [orgTitle, setOrgTitle] = useState('当前机构'); // 弹框标题
const [orgTitle1, setOrgTitle1] = useState('当前机构'); // 弹框标题
const [description, setDescription] = useState(''); // 机构描述信息
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选用户数,机构改变时重置
const [tableLength, setTableLength] = useState(0); // 当前机构用户总数
......@@ -145,6 +147,8 @@ const UserManage = () => {
const [currentOrgDistinct, setCurrentOrgDistinct] = useState('');
const [saveExtentFlag, setSaveExtentFlag] = useState(0);
const [filteredValue, setFilteredValue] = useState([]);
const [keep1, setKeep1] = useState([4]); // 存储树选择
const [id, setId] = useState('');
const { Search } = Input;
const setRowClassName = record =>
record.userID === selectColor.userID ? styles.clickRowStyle : '';
......@@ -401,14 +405,19 @@ const UserManage = () => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0;
return {
title: (
<div className={styles.title}>
<div className={styles.title1}>
<span className={styles.titleText}>{org.text}</span>
<span className={styles.tip}>
<Tooltip title="" className={styles.fs}>
<span className={styles.tip1}>
<Tooltip title="" className={styles.fs1}>
<Dropdown overlay={orgButtonMenu} disabled={currentOrgOperate}>
<PlusOutlined
style={{ marginLeft: 20 }}
onClick={e => e.stopPropagation()}
onMouseEnter={e => {
setOrgID(org);
setOrgTitle1(org.text);
console.log(org);
}}
/>
</Dropdown>
</Tooltip>
......@@ -417,6 +426,15 @@ const UserManage = () => {
<EllipsisOutlined
style={{ marginLeft: 10, fontSize: '20px' }}
onClick={e => e.stopPropagation()}
onMouseEnter={e => {
setOrgID(org);
setOrgTitle1(org.text);
getDescription(org.id);
getMapSetByGroupID(org.id);
setCurrentSelectOrg1(org.id);
setId(org.text);
console.log(org);
}}
/>
</Dropdown>
</span>
......@@ -428,6 +446,16 @@ const UserManage = () => {
};
};
const mapTree1 = org => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0;
return {
title: org.text,
key: org.id,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? org.children.map(i => mapTree1(i)) : [],
};
};
// 重新渲染树
const updateTrees = () => {
setTreeLoading(true);
......@@ -490,6 +518,7 @@ const UserManage = () => {
useEffect(() => {
getOrgArea().then(res => {
if (res.msg === 'Ok') {
console.log(res);
setOrgAreas(res.Results);
}
});
......@@ -499,14 +528,18 @@ const UserManage = () => {
const onSelect = (props, e) => {
console.log(e);
console.log(props);
setKeep1(props);
console.log(keep1);
setTableLoading(true);
if (e) {
setOrgTitle(e.node.title.props.children[0].props.children);
}
if (!props[0]) {
setCurrentSelectOrg(currentSelectOrg);
setCurrentSelectOrg1(currentSelectOrg);
} else {
setCurrentSelectOrg(props[0]);
setCurrentSelectOrg1(props[0]);
}
// orgAreas.map((item)=>{
......@@ -568,6 +601,25 @@ const UserManage = () => {
}
};
const getDescription = e => {
getOneOUUserListNew(e).then(res => {
if (res.code === 0) {
setDescription(res.data.Description);
}
});
};
const getMapSetByGroupID = e => {
GetMapSetByGroupID({
groupID: e,
}).then(res => {
if (res.code === 0) {
console.log(res);
setCurrentOrgArea(res.data.MapRange);
setCurrentOrgDistinct(res.data.AreeName);
}
});
};
// 返回用户表数据结构处理,扁平化
const getUsers = orgObj => {
let result = orgObj.Users;
......@@ -1150,16 +1202,22 @@ const UserManage = () => {
// 更改机构范围
const submitExtent = (extent, areaName) => {
setTreeLoading(true);
console.log(extent);
console.log(areaName);
console.log(currentSelectOrg1);
if (extent) {
setOrgArea({
OUID: currentSelectOrg,
OUID: currentSelectOrg1,
areaName,
extent,
}).then(res => {
if (res.msg === '') {
setTreeLoading(false);
setSaveExtentFlag(saveExtentFlag + 1);
message.success('机构范围设置成功!');
} else {
setTreeLoading(false);
message.warn(res.Message);
}
});
......@@ -1168,7 +1226,6 @@ const UserManage = () => {
};
const addChange = e => {
console.log(e);
e.domEvent.stopPropagation();
};
/** ***操作按钮**** */
......@@ -1215,6 +1272,11 @@ const UserManage = () => {
</Menu>
);
const kee = () => {
console.log(keep1);
setUserVisible(false);
onSelect(keep1);
};
return (
<PageContainer className={styles.userManageContainer}>
<div className={styles.contentContainer}>
......@@ -1352,30 +1414,30 @@ const UserManage = () => {
{/* Modal弹框 */}
{/* 添加用户 */}
<AddUserModal
title={`在${orgTitle}下添加用户`}
title={`在${orgTitle1}下添加用户`}
visible={userVisible}
orgID={orgID}
onCancel={() => setUserVisible(false)}
onSelect={() => onSelect([orgID])}
onCancel={kee}
// onSelect={() => onSelect([orgID])}
/>
{/* 添加下级机构 */}
<AddSubOrgModal
title={orgID === '-1' ? '添加顶级机构' : `在${orgTitle}下添加机构`}
title={orgID === '-1' ? '添加顶级机构' : `在${orgTitle1}下添加机构`}
visible={addOrgVisible}
orgID={orgID}
onCancel={() => setAddOrgVisible(false)}
onSelect={onSelect}
// onSelect={onSelect}
updateTrees={updateTrees}
/>
{/* 编辑机构 */}
<EditOrgModal
title={`编辑${orgTitle}`}
title={`编辑${orgTitle1}`}
visible={editOrgVisible}
orgID={orgID}
orgTitle={orgTitle}
orgTitle={orgTitle1}
description={description}
onCancel={() => setEditOrgVisible(false)}
onSelect={onSelect}
// onSelect={onSelect}
updateTrees={updateTrees}
/>
{/* 删除机构 */}
......@@ -1428,7 +1490,7 @@ const UserManage = () => {
// 切换后选中的节点
setCurrentSelectOldOrg(value[0]);
}}
treeData={treeDataCopy.map(t => mapTree(t))}
treeData={treeDataCopy.map(t => mapTree1(t))}
/>
)}
</Modal>
......@@ -1483,9 +1545,10 @@ const UserManage = () => {
<p>将删除多个用户, 是否确认删除?</p>
</Modal>
<MapScopeEditModal
title={id}
mapId={createGuid()}
visible={editOrgExtentVisible}
stationId={currentSelectOrg}
stationId={currentSelectOrg1}
onCancel={() => setEditOrgExtentVisible(false)}
confirmModal={submitExtent}
distinct={currentOrgDistinct}
......
......@@ -182,6 +182,32 @@
.ant-popover-message-title {
padding-left: 20px;
}
.title1{
display: flex;
align-items: center;
width: 100%;
}
.tip1{
display: none;
}
.fs1{
font-size: 18px;
margin-left: 10px;
}
.title1:hover{
.tip1{
display: flex;
align-items: center;
justify-content: flex-end;
width: 100%;
}
}
.titleText{
width: 12rem;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
.userContainer{
height: calc(100vh - 74px) !important;
z-index: 999;
......@@ -280,32 +306,7 @@
// .ant-form-horizontal .ant-form-item-control {
// margin-left: 10px;
// }
.title{
display: flex;
align-items: center;
width: 100%;
}
.tip{
display: none;
}
.fs{
font-size: 18px;
margin-left: 10px;
}
.title:hover{
.tip{
display: flex;
align-items: center;
justify-content: flex-end;
width: 100%;
}
}
.titleText{
width: 12rem;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
.ant-popover-inner {
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.788);
......
......@@ -25,6 +25,7 @@ import SiteManage from '../pages/userCenter/siteManage/SiteManage';
import SiteManageV2 from '../pages/userCenter/siteManageV2/SiteManage';
import Dictionary from '../pages/dataCenter/dictionary';
import Dictionary1 from '../pages/dataCenter/dictionary1';
// import Search from '../pages/dataCenter/search';
import ServiceLog from '../pages/log/serviceLog';
import LoginLog from '../pages/log/loginLog';
import OmsLog from '../pages/log/omsLog';
......@@ -369,17 +370,23 @@ export default {
icon: <TableOutlined style={iconStyle} />,
component: BlankLayout,
routes: [
// {
// path: '/dataCenter/dictionary',
// name: '数据字典',
// component: Dictionary,
// },
{
path: '/dataCenter/dictionary',
name: '数据字典1',
hideMenu: true,
component: Dictionary,
},
{
path: '/dataCenter/dictionary1',
name: '数据字典',
component: Dictionary1,
},
// {
// path: '/dataCenter/search',
// name: '数据字典',
// component: Search,
// },
// {
// path: '/dataCenter/video',
// name: '视频管理',
// url:
......
......@@ -35,8 +35,10 @@ export const saveConnectionNew = params =>
// 获取数据库列表
// export const getDataBaseList = params =>
// get(`${CITY_SERVICE}/OMS.svc/S_GetDataBaseList`, params);
export const getDataBaseList = params =>
get(`${CITY_SERVICE}/OMS.svc/S_GetDataBaseList`, params);
get(`${PUBLISH_SERVICE}/DBManager/getDataBaseList`, params);
// 数据库初始化
// export const initDBv4 = params =>
......
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