Commit 416a34d8 authored by 皮倩雯's avatar 皮倩雯

fix: '解决表字段全选复选框,切换表格未清空问题'

parent 711926d7
Pipeline #47077 passed with stages
in 7 minutes 30 seconds
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
right: 0px; right: 0px;
background-color: #fff; background-color: #fff;
width: 100%; width: 100%;
height: 80px; height: 40px;
padding: 0 20px; padding: 0 20px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
......
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
white-space: nowrap; white-space: nowrap;
} }
.ant-table-body { .ant-table-body {
height: calc(100vh - 210px); height: calc(100vh - 160px);
border-right: white; border-right: white;
overflow: auto !important; overflow: auto !important;
} }
......
...@@ -54,9 +54,9 @@ const AddModal = props => { ...@@ -54,9 +54,9 @@ const AddModal = props => {
setTableID(res.data.root[0].tableID); setTableID(res.data.root[0].tableID);
} }
// eslint-disable-next-line no-lone-blocks // eslint-disable-next-line no-lone-blocks
{ // {
form.setFieldsValue({ tableStyle: '大' }); // form.setFieldsValue({ tableStyle: '大' });
} // }
}); });
} }
}, [visible]); }, [visible]);
......
...@@ -3,11 +3,7 @@ import { Modal, Spin, Table, Button, notification, Form, Input } from 'antd'; ...@@ -3,11 +3,7 @@ import { Modal, Spin, Table, Button, notification, Form, Input } from 'antd';
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons'; import { PlusOutlined, DeleteOutlined } from '@ant-design/icons';
import { HTML5Backend } from 'react-dnd-html5-backend'; import { HTML5Backend } from 'react-dnd-html5-backend';
import { DndProvider } from 'react-dnd'; import { DndProvider } from 'react-dnd';
import { import { LoadFieldsByGroup, LoadGroup, ChangeOrder } from '@/services/tablemanager/tablemanager';
LoadFieldsByGroup,
LoadGroup,
ChangeOrder,
} from '@/services/tablemanager/tablemanager';
import DraggableBodyRow from './DraggableBodyRow'; import DraggableBodyRow from './DraggableBodyRow';
import styles from './index.less'; import styles from './index.less';
const LoadGroupNew = props => { const LoadGroupNew = props => {
...@@ -84,6 +80,9 @@ const LoadGroupNew = props => { ...@@ -84,6 +80,9 @@ const LoadGroupNew = props => {
body: { body: {
row: DraggableBodyRow, row: DraggableBodyRow,
}, },
style: {
backgroundColor: 'red',
},
}; };
// 提交 // 提交
const onSubumit = () => { const onSubumit = () => {
...@@ -148,17 +147,14 @@ const LoadGroupNew = props => { ...@@ -148,17 +147,14 @@ const LoadGroupNew = props => {
} }
setGroupData(val => { setGroupData(val => {
let newData = JSON.parse(JSON.stringify(val)); let newData = JSON.parse(JSON.stringify(val));
newData[hoverIndex].fieldData.push( newData[hoverIndex].fieldData.push(newData[pickIndex].fieldData[dragIndex]);
newData[pickIndex].fieldData[dragIndex],
);
newData[pickIndex].fieldData.splice(dragIndex, 1); newData[pickIndex].fieldData.splice(dragIndex, 1);
return newData; return newData;
}); });
} }
}; };
// 点击行添加样式 // 点击行添加样式
const setRowClassName = (record, index) => const setRowClassName = (record, index) => (index === pickIndex ? styles.clickRowStyle : '');
index === pickIndex ? styles.clickRowStyle : '';
// 新增分组 // 新增分组
const addGroup = () => { const addGroup = () => {
form.resetFields(); form.resetFields();
...@@ -177,9 +173,7 @@ const LoadGroupNew = props => { ...@@ -177,9 +173,7 @@ const LoadGroupNew = props => {
} }
setGroupData(val => { setGroupData(val => {
let newData = JSON.parse(JSON.stringify(val)); let newData = JSON.parse(JSON.stringify(val));
let defaultGroupIndex = newData.findIndex( let defaultGroupIndex = newData.findIndex(item => item.text === '(未分组)');
item => item.text === '(未分组)',
);
newData[defaultGroupIndex].fieldData = [ newData[defaultGroupIndex].fieldData = [
...newData[defaultGroupIndex].fieldData, ...newData[defaultGroupIndex].fieldData,
...newData[pickIndex].fieldData, ...newData[pickIndex].fieldData,
...@@ -205,9 +199,7 @@ const LoadGroupNew = props => { ...@@ -205,9 +199,7 @@ const LoadGroupNew = props => {
return; return;
} }
// 判断是否有重复的组名 // 判断是否有重复的组名
let isRepeat = groupData.some( let isRepeat = groupData.some(item => item.text === form.getFieldsValue().groupName);
item => item.text === form.getFieldsValue().groupName,
);
if (isRepeat) { if (isRepeat) {
notification.error({ notification.error({
message: '提示', message: '提示',
...@@ -256,11 +248,7 @@ const LoadGroupNew = props => { ...@@ -256,11 +248,7 @@ const LoadGroupNew = props => {
添加分组 添加分组
<PlusOutlined /> <PlusOutlined />
</Button> </Button>
<Button <Button danger onClick={delGroup} style={{ display: 'flex', alignItems: 'center' }}>
danger
onClick={delGroup}
style={{ display: 'flex', alignItems: 'center' }}
>
删除分组 删除分组
<DeleteOutlined /> <DeleteOutlined />
</Button>{' '} </Button>{' '}
...@@ -288,9 +276,7 @@ const LoadGroupNew = props => { ...@@ -288,9 +276,7 @@ const LoadGroupNew = props => {
size="small" size="small"
scroll={{ y: 510 }} scroll={{ y: 510 }}
pagination={false} pagination={false}
rowClassName={(record, index) => rowClassName={(record, index) => setRowClassName(record, index)}
setRowClassName(record, index)
}
onRow={(record, index) => ({ onRow={(record, index) => ({
tableType: 'group', tableType: 'group',
index, index,
......
...@@ -50,7 +50,7 @@ const AddModal = props => { ...@@ -50,7 +50,7 @@ const AddModal = props => {
const [filed, setFiled] = useState({}); // 事件 const [filed, setFiled] = useState({}); // 事件
const [treeValue, setTreeValue] = useState([]); const [treeValue, setTreeValue] = useState([]);
const [verification, setVerification] = useState([]); const [verification, setVerification] = useState([]);
const [Shape, setShape] = useState('文本'); const [Shape, setShape] = useState('');
const [characteristics, setCharacteristics] = useState([ const [characteristics, setCharacteristics] = useState([
'文本', '文本',
'数值', '数值',
...@@ -104,15 +104,15 @@ const AddModal = props => { ...@@ -104,15 +104,15 @@ const AddModal = props => {
Unit: '', Unit: '',
ExceptionEvent: '', ExceptionEvent: '',
Group: '', Group: '',
RowSpan: 0, RowSpan: '',
ColSpan: 0, ColSpan: '',
ReadOnly: false, ReadOnly: '',
EditableLater: false, EditableLater: '',
ExceptionValue: '', ExceptionValue: '',
Preset: '', Preset: '',
picture: false, picture: '',
must: false, must: '',
coordinates: false, coordinates: '',
}); });
const [currentSelectOrg, setCurrentSelectOrg] = useState([]); const [currentSelectOrg, setCurrentSelectOrg] = useState([]);
const [checkedList, setCheckedList] = useState([]); // 选中的复选框内容 const [checkedList, setCheckedList] = useState([]); // 选中的复选框内容
...@@ -195,9 +195,13 @@ const AddModal = props => { ...@@ -195,9 +195,13 @@ const AddModal = props => {
}; };
useEffect(() => { useEffect(() => {
if (keepTreeFirst.indexOf(itemData.name) != -1) {
setShow('none');
} else {
setShow('block');
}
setTreeValue(treeData); setTreeValue(treeData);
setValueData([]); setValueData([]);
setShow('block');
setExpendKey(itemData.ID); setExpendKey(itemData.ID);
setCurrentSelectOrg(itemData.ID); setCurrentSelectOrg(itemData.ID);
console.log(treeData); console.log(treeData);
......
/* eslint-disable no-shadow */
/* eslint-disable react/jsx-boolean-value */ /* eslint-disable react/jsx-boolean-value */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import {
...@@ -12,6 +13,8 @@ import { ...@@ -12,6 +13,8 @@ import {
Tooltip, Tooltip,
TreeSelect, TreeSelect,
Empty, Empty,
Checkbox,
Switch,
} from 'antd'; } from 'antd';
import { import {
EditOutlined, EditOutlined,
...@@ -55,8 +58,10 @@ const AddModal = props => { ...@@ -55,8 +58,10 @@ const AddModal = props => {
const [selectDataFirst, setSelectDataFirst] = useState([]); const [selectDataFirst, setSelectDataFirst] = useState([]);
const [multiOperate, setMultiOperate] = useState(true); // 是否禁用用户批量操作 const [multiOperate, setMultiOperate] = useState(true); // 是否禁用用户批量操作
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选字段配置数,机构改变时重置 const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选字段配置数,机构改变时重置
const [keepValue, setKeepValue] = useState([]);
const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除 const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除
const [checkStrictly, setCheckStrictly] = useState(false);
const [selectGroup, setSelectGroup] = useState([]);
const editor = record => { const editor = record => {
setIsType('edit'); setIsType('edit');
setIsVisible(true); setIsVisible(true);
...@@ -83,16 +88,39 @@ const AddModal = props => { ...@@ -83,16 +88,39 @@ const AddModal = props => {
} }
return '000000D9'; return '000000D9';
}; };
const expandedRowRender = item => {
const setRowClassName = record =>
Object.entries(record).toString() === Object.entries(selectTableName).toString()
? styles.clickRowStyle
: '';
const columns = [ const columns = [
{ {
title: '字段名', title: '字段名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: 190,
align: 'left', align: 'left',
width: 300,
onCell: (_, index) => ({
colSpan: index < 1 ? 8 : 1,
// if (index === 0) {
// // console.log(record);
// console.log(index);
// return { colSpan: 3 };
// }
}),
render: (text, record) => ( render: (text, record) => (
<div style={{ paddingLeft: '2rem', color: styleConfig(record) }}>{text}</div> <Space>
{record.children ? (
<div style={{ fontWeight: 'bold' }}>
<span style={{ color: 'rgb(63 163 255)' }}>
{text}(共{allData[text] ? allData[text].length : ''}条)
</span>
</div>
) : (
<div style={{ color: styleConfig(record) }}>{text}</div>
)}
</Space>
), ),
}, },
{ {
...@@ -100,7 +128,7 @@ const AddModal = props => { ...@@ -100,7 +128,7 @@ const AddModal = props => {
dataIndex: 'alias', dataIndex: 'alias',
key: 'alias', key: 'alias',
align: 'center', align: 'center',
width: 200, width: 300,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>, render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
}, },
{ {
...@@ -108,7 +136,7 @@ const AddModal = props => { ...@@ -108,7 +136,7 @@ const AddModal = props => {
dataIndex: 'storeType', dataIndex: 'storeType',
key: 'storeType', key: 'storeType',
align: 'center', align: 'center',
width: 200, width: 150,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>, render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
}, },
{ {
...@@ -116,7 +144,7 @@ const AddModal = props => { ...@@ -116,7 +144,7 @@ const AddModal = props => {
dataIndex: 'shape', dataIndex: 'shape',
key: 'shape', key: 'shape',
align: 'center', align: 'center',
width: 200, width: 150,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>, render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
}, },
{ {
...@@ -124,7 +152,7 @@ const AddModal = props => { ...@@ -124,7 +152,7 @@ const AddModal = props => {
dataIndex: 'config', dataIndex: 'config',
key: 'config', key: 'config',
align: 'center', align: 'center',
width: 200, width: 250,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>, render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
}, },
...@@ -133,7 +161,7 @@ const AddModal = props => { ...@@ -133,7 +161,7 @@ const AddModal = props => {
dataIndex: 'readOnly', dataIndex: 'readOnly',
key: 'readOnly', key: 'readOnly',
align: 'center', align: 'center',
width: 200, width: 100,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>, render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
}, },
{ {
...@@ -141,16 +169,19 @@ const AddModal = props => { ...@@ -141,16 +169,19 @@ const AddModal = props => {
dataIndex: 'syncEvent', dataIndex: 'syncEvent',
key: 'syncEvent', key: 'syncEvent',
align: 'center', align: 'center',
width: 200, width: 100,
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>, render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
}, },
{ {
title: '操作', title: '操作',
width: 250,
ellipsis: true, ellipsis: true,
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<Space> <Space>
{record.children ? (
<span />
) : (
<>
<Tooltip title="修改"> <Tooltip title="修改">
<EditOutlined <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
...@@ -177,105 +208,13 @@ const AddModal = props => { ...@@ -177,105 +208,13 @@ const AddModal = props => {
</Tooltip> </Tooltip>
</Popconfirm> </Popconfirm>
</div> </div>
</>
)}
</Space> </Space>
), ),
}, },
]; ];
return (
<Table
rowSelection={{
type: 'checkbox',
...rowSelection,
}}
columns={columns}
rowKey={record => record.ID}
onRow={record => ({
onDoubleClick: event => {
event.stopPropagation();
editor(record);
},
onClick: event => {
event.stopPropagation();
setSelectTableName(record);
}, // 点击行
})}
bordered
rowClassName={setRowClassName}
showHeader={false}
dataSource={allData[item.type]}
pagination={false}
/>
);
};
const setRowClassName = record =>
Object.entries(record).toString() === Object.entries(selectTableName).toString()
? styles.clickRowStyle
: '';
const columns = [
{
title: '字段名',
dataIndex: 'type',
key: 'type',
align: 'left',
width: 150,
render: text => (
<a>
{text}(共{allData[text] ? allData[text].length : ''}条)
</a>
),
},
{
title: '别名',
dataIndex: 'alias',
key: 'alias',
align: 'center',
width: 200,
},
{
title: '字段类型',
dataIndex: 'storeType',
key: 'storeType',
align: 'center',
width: 200,
},
{
title: '形态',
dataIndex: 'shape',
key: 'shape',
align: 'center',
width: 200,
},
{
title: '配置',
dataIndex: 'config',
key: 'config',
align: 'center',
width: 200,
},
{
title: '只读',
dataIndex: 'readOnly',
key: 'readOnly',
align: 'center',
width: 200,
},
{
title: '同步',
dataIndex: 'syncEvent',
key: 'syncEvent',
align: 'center',
width: 200,
},
{
title: '操作',
width: 250,
ellipsis: true,
key: 'title',
align: 'center',
},
];
useEffect(() => { useEffect(() => {
console.log(props); console.log(props);
console.log(treeSelectValue); console.log(treeSelectValue);
...@@ -302,8 +241,12 @@ const AddModal = props => { ...@@ -302,8 +241,12 @@ const AddModal = props => {
aa.push({ name: item, key: index, ID: index, children: arr[item] }); aa.push({ name: item, key: index, ID: index, children: arr[item] });
bb.push(item); bb.push(item);
}); });
console.log(aa);
console.log(arr);
console.log(newArr);
setKeepTreeFirst(bb); setKeepTreeFirst(bb);
setTreeData(aa); setTreeData(aa);
setSelectGroup(newArr);
setTableData(newArr); setTableData(newArr);
setSelect(newArr); setSelect(newArr);
} }
...@@ -327,6 +270,10 @@ const AddModal = props => { ...@@ -327,6 +270,10 @@ const AddModal = props => {
aa.push({ name: item, key: index, ID: index, children: arr[item] }); aa.push({ name: item, key: index, ID: index, children: arr[item] });
bb.push(item); bb.push(item);
}); });
console.log(aa);
console.log(arr);
console.log(newArr);
setSelectGroup(newArr);
setKeepTreeFirst(bb); setKeepTreeFirst(bb);
setTreeData(aa); setTreeData(aa);
setTableData(newArr); setTableData(newArr);
...@@ -378,7 +325,6 @@ const AddModal = props => { ...@@ -378,7 +325,6 @@ const AddModal = props => {
}; };
// 删除字段配置 // 删除字段配置
const deleteChart = record => { const deleteChart = record => {
console.log(selectedRowKeys);
removeFields({ fieldIDs: record.ID }).then(res => { removeFields({ fieldIDs: record.ID }).then(res => {
if (res.msg === 'Ok' || res.msg === '') { if (res.msg === 'Ok' || res.msg === '') {
notification.success({ notification.success({
...@@ -408,6 +354,7 @@ const AddModal = props => { ...@@ -408,6 +354,7 @@ const AddModal = props => {
duration: 3, duration: 3,
description: '删除成功', description: '删除成功',
}); });
setSelectedRowKeys([]);
setFlag(flag + 1); setFlag(flag + 1);
} else { } else {
notification.error({ notification.error({
...@@ -433,31 +380,45 @@ const AddModal = props => { ...@@ -433,31 +380,45 @@ const AddModal = props => {
}); });
}; };
const onUnfold = (expanded, record) => { const onUnfold = (expanded, record) => {
const data = [...select]; const data = [...selectGroup];
let index = data.indexOf(record); let index = data.findIndex(i => i.type == record.name);
// let index = data.indexOf(record);
if (expanded) { if (expanded) {
data.push(record); data.push(record);
} else { } else {
data.splice(index, 1); data.splice(index, 1);
} }
setSelect(data); setSelectGroup(data);
let arr = [];
arr.push(record.key);
if (expanded === true) {
setChooseLine(arr);
} else {
setChooseLine([]);
}
}; };
// 附加 // 附加
const add = record => { const add = record => {
if (treeSelectValue) {
selectTreeData.map(i => {
i.children.map(j => {
if (j.tableName == treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@'))) {
setPramFormObj(j);
}
});
});
} else {
setPramFormObj(props.location.state.template); setPramFormObj(props.location.state.template);
}
setType('affiliateAdd'); setType('affiliateAdd');
setVisible(true); setVisible(true);
}; };
// 分组与排序 // 分组与排序
const sort = record => { const sort = record => {
if (treeSelectValue) {
selectTreeData.map(i => {
i.children.map(j => {
if (j.tableName == treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@'))) {
setPramFormObj(j);
}
});
});
} else {
setPramFormObj(props.location.state.template); setPramFormObj(props.location.state.template);
}
setType('sort'); setType('sort');
setVisible(true); setVisible(true);
}; };
...@@ -465,7 +426,9 @@ const AddModal = props => { ...@@ -465,7 +426,9 @@ const AddModal = props => {
setVisible(false); setVisible(false);
setFlag(flag + 1); setFlag(flag + 1);
}; };
const treeSelectOnchange = e => { const treeSelectOnchange = e => {
console.log('切换');
setSelectedRowKeys([]); setSelectedRowKeys([]);
setMultiOperate(true); setMultiOperate(true);
setTreeSelectValue(e); setTreeSelectValue(e);
...@@ -482,6 +445,7 @@ const AddModal = props => { ...@@ -482,6 +445,7 @@ const AddModal = props => {
newArr.push({ type: item, key: index, id: index }); newArr.push({ type: item, key: index, id: index });
}); });
setAllData(arr); setAllData(arr);
setSelectGroup(newArr);
setTableData(newArr); setTableData(newArr);
let aa = []; let aa = [];
let bb = []; let bb = [];
...@@ -502,22 +466,24 @@ const AddModal = props => { ...@@ -502,22 +466,24 @@ const AddModal = props => {
{org.children.map(item => mapTree(item))} {org.children.map(item => mapTree(item))}
</TreeNode> </TreeNode>
) : ( ) : (
<TreeNode value={`${org.tableName}@${org.groupName}`} title={org.tableName} /> <TreeNode
value={`${org.tableName}@${org.groupName}`}
title={org.tableName}
key={`${org.tableName}@${org.groupName}`}
/>
); );
}; };
// 复选框 // 复选框
const rowSelection = { const rowSelection = {
selectedRowKeys, selectedRowKeys,
onSelect: (record, selected, selectedRows, nativeEvent) => { onChange: (selectedRowKeys, selectedRows) => {
if (selected) { let aa = [];
let aa = [...selectedRowKeys]; selectedRowKeys.map(i => {
aa.push(record.ID); if (typeof i != 'number') {
setSelectedRowKeys(aa); aa.push(i);
} else {
let aa = [...selectedRowKeys];
aa.splice(aa.findIndex(item => item === record.ID), 1);
setSelectedRowKeys(aa);
} }
});
setSelectedRowKeys(aa);
if (selectedRows.length > 0) { if (selectedRows.length > 0) {
setMultiOperate(false); setMultiOperate(false);
} else { } else {
...@@ -525,9 +491,11 @@ const AddModal = props => { ...@@ -525,9 +491,11 @@ const AddModal = props => {
} }
}, },
}; };
const multiDelete = () => { const multiDelete = () => {
setDeleteUserVisible(true); setDeleteUserVisible(true);
}; };
return ( return (
<> <>
<Spin tip="loading..." spinning={treeLoading}> <Spin tip="loading..." spinning={treeLoading}>
...@@ -556,7 +524,7 @@ const AddModal = props => { ...@@ -556,7 +524,7 @@ const AddModal = props => {
</TreeSelect> </TreeSelect>
</div> </div>
<div style={{ marginRight: '10px' }}> <div style={{ marginRight: '10px' }}>
<Button disabled={multiOperate} onClick={multiDelete}> <Button type="primary" disabled={multiOperate} onClick={multiDelete}>
<DeleteOutlined /> <DeleteOutlined />
批量删除 批量删除
</Button> </Button>
...@@ -575,20 +543,46 @@ const AddModal = props => { ...@@ -575,20 +543,46 @@ const AddModal = props => {
</div> </div>
</div> </div>
<Table {/* <Table
rowSelection={{ ...rowSelection }}
columns={columns} columns={columns}
dataSource={tableData} dataSource={treeData}
expandable={{ expandedRowRender }} // // expandable={{ expandedRowRender }}
size="small" size="small"
rowKey="id" rowKey={record => record.ID}
defaultExpandAllRows={true} // defaultExpandAllRows={true}
// expandedRowKeys={chooseLine} // 展开的行 // expandedRowKeys={chooseLine} // 展开的行
// defaultExpandedRowKeys={[0]} // 展开的行 // defaultExpandedRowKeys={select.map(item => item.key)} // 展开的行
expandedRowKeys={select.map(item => item.key)} // 展开的行 // expandedRowKeys={select.map(item => item.key)} // 展开的行
// defaultExpandedRowKeys={0} // // defaultExpandedRowKeys={0}
expandRowByClick expandRowByClick
pagination={false} pagination={false}
scroll={{ y: 'calc(100vh - 186px)' }} scroll={{ y: 'calc(100vh - 186px)' }}
// onExpand={onUnfold}
/> */}
<Table
columns={columns}
size="small"
rowKey={record => record.ID}
rowSelection={{ ...rowSelection, checkStrictly, selectedRowKeys }}
dataSource={treeData}
pagination={false}
bordered
expandedRowKeys={selectGroup.map(item => item.key)}
expandRowByClick
scroll={{ y: 'calc(100vh - 170px)' }}
onRow={record => ({
onDoubleClick: event => {
event.stopPropagation();
editor(record);
},
onClick: event => {
event.stopPropagation();
setSelectTableName(record);
}, // 点击行
})}
rowClassName={setRowClassName}
onExpand={onUnfold} onExpand={onUnfold}
/> />
</div> </div>
......
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-03-31 17:37:04
* @LastEditors: leizhe
*/
/* eslint-disable array-callback-return */ /* eslint-disable array-callback-return */
/* eslint-disable no-plusplus */ /* eslint-disable no-plusplus */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -7,13 +14,7 @@ import Sortable from 'sortablejs'; ...@@ -7,13 +14,7 @@ import Sortable from 'sortablejs';
import styles from './incident.less'; import styles from './incident.less';
import DragTable from '@/components/DragTable/DragTable'; import DragTable from '@/components/DragTable/DragTable';
const SortModal = props => { const SortModal = props => {
const { const { callBackSubmit = () => {}, title, visible, onCancel, sortData1 } = props;
callBackSubmit = () => {},
title,
visible,
onCancel,
sortData1,
} = props;
const [orderTable, setOrderTable] = useState([]); const [orderTable, setOrderTable] = useState([]);
const [flowIDs, setFlowIDs] = useState([]); const [flowIDs, setFlowIDs] = useState([]);
...@@ -65,7 +66,7 @@ const SortModal = props => { ...@@ -65,7 +66,7 @@ const SortModal = props => {
> >
<div <div
className={styles.cardContent} className={styles.cardContent}
style={{ width: '26rem', marginLeft: '24px' }} style={{ width: '26rem', marginLeft: '24px', maxHeight: '400px', overflow: 'auto' }}
> >
<div className={styles.doctorTable}> <div className={styles.doctorTable}>
{/* <table style={{ width: '104%', marginLeft: '-5px' }}> {/* <table style={{ width: '104%', marginLeft: '-5px' }}>
......
...@@ -105,17 +105,17 @@ const incident = () => { ...@@ -105,17 +105,17 @@ const incident = () => {
</Tooltip> </Tooltip>
), ),
}, },
{ // {
title: '摘要字段', // title: '摘要字段',
dataIndex: 'summaryFields', // dataIndex: 'summaryFields',
key: 'summaryFields', // key: 'summaryFields',
width: 100, // width: 100,
render: record => ( // render: record => (
<Tooltip placement="topLeft" title={record}> // <Tooltip placement="topLeft" title={record}>
{record} // {record}
</Tooltip> // </Tooltip>
), // ),
}, // },
{ {
title: '权限', title: '权限',
dataIndex: 'roles', dataIndex: 'roles',
...@@ -127,35 +127,35 @@ const incident = () => { ...@@ -127,35 +127,35 @@ const incident = () => {
</Tooltip> </Tooltip>
), ),
}, },
{ // {
title: '流程', // title: '流程',
dataIndex: 'flowCount', // dataIndex: 'flowCount',
key: 'flowCount', // key: 'flowCount',
width: 80, // width: 80,
render: record => ( // render: record => (
<Tooltip placement="topLeft" title={record}> // <Tooltip placement="topLeft" title={record}>
{record} // {record}
</Tooltip> // </Tooltip>
), // ),
}, // },
{ {
title: '上报', title: '上报',
dataIndex: 'reportable', dataIndex: 'reportable',
key: 'reportable', key: 'reportable',
width: 50, width: 50,
}, },
{ // {
title: '上报字段', // title: '上报字段',
dataIndex: 'reportFields', // dataIndex: 'reportFields',
key: 'reportFields', // key: 'reportFields',
width: 80, // width: 80,
}, // },
{ // {
title: '显示字段', // title: '显示字段',
dataIndex: 'displayFields', // dataIndex: 'displayFields',
key: 'displayFields', // key: 'displayFields',
width: 80, // width: 80,
}, // },
{ {
title: '编辑', title: '编辑',
......
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:13
* @LastEditTime: 2022-03-31 17:37:35
* @LastEditors: leizhe
*/
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { flowReOrder } from '@/services/flow/flow'; import { flowReOrder } from '@/services/flow/flow';
import { Modal, notification } from 'antd'; import { Modal, notification } from 'antd';
...@@ -70,6 +77,7 @@ const Order = props => { ...@@ -70,6 +77,7 @@ const Order = props => {
maskClosable={false} maskClosable={false}
destroyOnClose destroyOnClose
> >
<div style={{ maxHeight: '400px', overflow: 'auto' }}>
<DragTable <DragTable
bordered bordered
style={{ marginBottom: '10px' }} style={{ marginBottom: '10px' }}
...@@ -82,6 +90,7 @@ const Order = props => { ...@@ -82,6 +90,7 @@ const Order = props => {
dragCallBack={dragCallBack} dragCallBack={dragCallBack}
ItemTypes="flowOrder" ItemTypes="flowOrder"
/> />
</div>
</Modal> </Modal>
); );
}; };
......
...@@ -169,42 +169,36 @@ const MongDBTable = props => { ...@@ -169,42 +169,36 @@ const MongDBTable = props => {
title: '标签', title: '标签',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '200px',
ellipsis: true, ellipsis: true,
}, },
{ {
title: 'ip', title: 'ip',
dataIndex: 'ip', dataIndex: 'ip',
key: 'ip', key: 'ip',
width: 150,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '端口', title: '端口',
dataIndex: 'port', dataIndex: 'port',
key: 'port', key: 'port',
// width: 200,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '数据库名', title: '数据库名',
dataIndex: 'dbName', dataIndex: 'dbName',
key: 'dbName', key: 'dbName',
width: 200,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '类型', title: '类型',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
// width: 200,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '复制集', title: '复制集',
dataIndex: 'replicaSet', dataIndex: 'replicaSet',
key: 'replicaSet', key: 'replicaSet',
// width: 200,
ellipsis: true, ellipsis: true,
}, },
// { // {
...@@ -221,7 +215,6 @@ const MongDBTable = props => { ...@@ -221,7 +215,6 @@ const MongDBTable = props => {
title: '操作', title: '操作',
dataIndex: 'options', dataIndex: 'options',
key: 'options', key: 'options',
width: 300,
render: (val, item) => [ render: (val, item) => [
<Button size="small" type="primary" onClick={() => handleCon(val, item)}> <Button size="small" type="primary" onClick={() => handleCon(val, item)}>
测试连接 测试连接
...@@ -275,7 +268,7 @@ const MongDBTable = props => { ...@@ -275,7 +268,7 @@ const MongDBTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
scroll={{ y: 400 }} scroll={{ x: 'max-content', y: '400px' }}
// <Popconfirm // <Popconfirm
// title={ // title={
// <div> // <div>
......
...@@ -165,28 +165,24 @@ const MySQLTable = props => { ...@@ -165,28 +165,24 @@ const MySQLTable = props => {
title: '标签', title: '标签',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: 200,
ellipsis: true, ellipsis: true,
}, },
{ {
title: 'IP', title: 'IP',
dataIndex: 'ip', dataIndex: 'ip',
key: 'ip', key: 'ip',
width: 300,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '数据库名', title: '数据库名',
dataIndex: 'dbName', dataIndex: 'dbName',
key: 'dbName', key: 'dbName',
width: 300,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '用户名', title: '用户名',
dataIndex: 'userName', dataIndex: 'userName',
key: 'userName', key: 'userName',
width: 300,
ellipsis: true, ellipsis: true,
}, },
// { // {
...@@ -199,7 +195,6 @@ const MySQLTable = props => { ...@@ -199,7 +195,6 @@ const MySQLTable = props => {
title: '操作', title: '操作',
dataIndex: 'options', dataIndex: 'options',
key: 'options', key: 'options',
width: 300,
render: (val, item) => [ render: (val, item) => [
<Button size="small" type="primary" onClick={() => handleCon(val, item)}> <Button size="small" type="primary" onClick={() => handleCon(val, item)}>
测试连接 测试连接
...@@ -254,7 +249,7 @@ const MySQLTable = props => { ...@@ -254,7 +249,7 @@ const MySQLTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
scroll={{ y: 400 }} scroll={{ x: 'max-content', y: '400px' }}
/> />
<AddModal <AddModal
visible={visible} visible={visible}
......
...@@ -165,14 +165,12 @@ const OracleTable = props => { ...@@ -165,14 +165,12 @@ const OracleTable = props => {
title: '标签', title: '标签',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: 200,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '网络服务名/(ip:port/实例名)', title: '网络服务名/(ip:port/实例名)',
dataIndex: 'dbName', dataIndex: 'dbName',
key: 'dbName', key: 'dbName',
width: 400,
ellipsis: true, ellipsis: true,
}, },
{ {
...@@ -191,7 +189,6 @@ const OracleTable = props => { ...@@ -191,7 +189,6 @@ const OracleTable = props => {
title: '操作', title: '操作',
dataIndex: 'options', dataIndex: 'options',
key: 'options', key: 'options',
width: 300,
render: (val, item) => [ render: (val, item) => [
<Button size="small" type="primary" onClick={() => handleCon(val, item)}> <Button size="small" type="primary" onClick={() => handleCon(val, item)}>
测试连接 测试连接
...@@ -245,7 +242,7 @@ const OracleTable = props => { ...@@ -245,7 +242,7 @@ const OracleTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
scroll={{ y: 400 }} scroll={{ x: 'max-content', y: '400px' }}
/> />
<AddModal <AddModal
visible={visible} visible={visible}
......
...@@ -157,28 +157,24 @@ const SQLServerTable = props => { ...@@ -157,28 +157,24 @@ const SQLServerTable = props => {
title: '标签', title: '标签',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: 200,
ellipsis: true, ellipsis: true,
}, },
{ {
title: 'ip', title: 'ip',
dataIndex: 'ip', dataIndex: 'ip',
key: 'ip', key: 'ip',
width: 300,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '数据库名', title: '数据库名',
dataIndex: 'dbName', dataIndex: 'dbName',
key: 'dbName', key: 'dbName',
width: 400,
ellipsis: true, ellipsis: true,
}, },
{ {
title: '用户名', title: '用户名',
dataIndex: 'userName', dataIndex: 'userName',
key: 'userName', key: 'userName',
width: 200,
ellipsis: true, ellipsis: true,
}, },
// { // {
...@@ -192,7 +188,6 @@ const SQLServerTable = props => { ...@@ -192,7 +188,6 @@ const SQLServerTable = props => {
title: '操作', title: '操作',
dataIndex: 'options', dataIndex: 'options',
key: 'options', key: 'options',
width: 300,
render: (val, item) => [ render: (val, item) => [
<Button size="small" type="primary" onClick={() => handleCon(val, item)} key="testLink"> <Button size="small" type="primary" onClick={() => handleCon(val, item)} key="testLink">
测试连接 测试连接
...@@ -249,7 +244,7 @@ const SQLServerTable = props => { ...@@ -249,7 +244,7 @@ const SQLServerTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
scroll={{ y: 400 }} scroll={{ x: 'max-content', y: '400px' }}
/> />
<AddModal <AddModal
visible={visible} visible={visible}
......
...@@ -93,7 +93,7 @@ const SiteConfig = props => { ...@@ -93,7 +93,7 @@ const SiteConfig = props => {
> >
<Input placeholder="请输入应用名称" allowClear /> <Input placeholder="请输入应用名称" allowClear />
</Item> </Item>
<Item label="应用类别:"> <Item label="虚拟目录:">
<Input value={clientName} disabled /> <Input value={clientName} disabled />
</Item> </Item>
<Item <Item
......
...@@ -72,7 +72,7 @@ const AddConfig = props => { ...@@ -72,7 +72,7 @@ const AddConfig = props => {
}; };
return ( return (
<Spin spinning={loading} tip="loading..."> <Spin spinning={loading} tip="loading...">
<div style={{ minHeight: 'calc(100vh - 252px)', marginTop: '20px' }}> <div style={{ marginTop: '20px' }}>
<Form form={form} name={`form-${miniTitle}`} {...layout}> <Form form={form} name={`form-${miniTitle}`} {...layout}>
<Item <Item
label="应用名称:" label="应用名称:"
...@@ -87,16 +87,16 @@ const AddConfig = props => { ...@@ -87,16 +87,16 @@ const AddConfig = props => {
<Input placeholder="请输入应用名称" allowClear /> <Input placeholder="请输入应用名称" allowClear />
</Item> </Item>
<Item <Item
label="应用类别:" label="虚拟目录:"
name="client" name="client"
rules={[ rules={[
{ {
required: true, required: true,
message: '请输入应用类别', message: '请输入虚拟目录',
}, },
]} ]}
> >
<Input placeholder="请输入应用类别" allowClear /> <Input placeholder="请输入虚拟目录" allowClear />
{/* <Select placeholder="请选择应用类别"> {/* <Select placeholder="请选择应用类别">
{clientList && {clientList &&
clientList.map((item, index) => ( clientList.map((item, index) => (
...@@ -182,12 +182,12 @@ const AddConfig = props => { ...@@ -182,12 +182,12 @@ const AddConfig = props => {
<Radio value={false}></Radio> <Radio value={false}></Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
<Item wrapperCol={{ span: 6, offset: 7 }}> </Form>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button type="primary" onClick={submit}> <Button type="primary" onClick={submit}>
提交 提交
</Button> </Button>
</Item>
</Form>
</div> </div>
</Spin> </Spin>
); );
......
...@@ -180,11 +180,11 @@ const MobileConfigPage = props => { ...@@ -180,11 +180,11 @@ const MobileConfigPage = props => {
{activeKey === tabArr[2].key && tabArr[2].component} {activeKey === tabArr[2].key && tabArr[2].component}
</TabPane> </TabPane>
)} */} )} */}
{showConfig && subType !== 'add' && ( {/* {showConfig && subType !== 'add' && (
<TabPane tab={tabArr[3].title} key={tabArr[3].key}> <TabPane tab={tabArr[3].title} key={tabArr[3].key}>
{activeKey === tabArr[3].key && tabArr[3].component} {activeKey === tabArr[3].key && tabArr[3].component}
</TabPane> </TabPane>
)} )} */}
</Tabs> </Tabs>
{/* </Spin> */} {/* </Spin> */}
</ProCard> </ProCard>
...@@ -219,11 +219,11 @@ const MobileConfigPage = props => { ...@@ -219,11 +219,11 @@ const MobileConfigPage = props => {
key: '2', key: '2',
component: <SevenParams />, component: <SevenParams />,
}, },
{ // {
title: '版本包配置', // title: '版本包配置',
key: '3', // key: '3',
component: <VersionPublish clientName={clientName} />, // component: <VersionPublish clientName={clientName} />,
}, // },
]; ];
return ( return (
<PageContainer> <PageContainer>
...@@ -240,7 +240,7 @@ const MobileConfigPage = props => { ...@@ -240,7 +240,7 @@ const MobileConfigPage = props => {
<Drawer <Drawer
title="新增应用" title="新增应用"
destroyOnClose destroyOnClose
width={500} width={450}
onClose={() => { onClose={() => {
setAddVisible(false); setAddVisible(false);
}} }}
......
...@@ -71,7 +71,7 @@ const EditForm = props => { ...@@ -71,7 +71,7 @@ const EditForm = props => {
return ( return (
<div className={classnames({ [styles.divbox]: true })}> <div className={classnames({ [styles.divbox]: true })}>
{(nodeType === 1 || nodeType === 2) && ( {(nodeType === 1 || nodeType === 2) && (
<Form form={form} name="editGroup" {...layout} onFinish={onFinish}> <Form form={form} name="editGroup" onFinish={onFinish}>
<Item <Item
label="菜单组名称" label="菜单组名称"
name="menuName" name="menuName"
...@@ -82,13 +82,14 @@ const EditForm = props => { ...@@ -82,13 +82,14 @@ const EditForm = props => {
}, },
]} ]}
> >
<Input placeholder="请输入菜单组名称" /> <Input placeholder="请输入菜单组名称" style={{ width: '100%' }} />
</Item> </Item>
<Item label="菜单组别名" name="shortName"> <Item label="菜单组别名" name="shortName" style={{ marginLeft: '11px' }}>
<Input placeholder="请输入菜单组别名" /> <Input placeholder="请输入菜单组别名" style={{ width: '100%' }} />
</Item> </Item>
{nodeType === 1 && ( {nodeType === 1 && (
<Item <Item
style={{ marginLeft: '14px' }}
label="在线图标" label="在线图标"
name="imageUrl" name="imageUrl"
rules={[ rules={[
...@@ -98,11 +99,12 @@ const EditForm = props => { ...@@ -98,11 +99,12 @@ const EditForm = props => {
}, },
]} ]}
> >
<PicturesWall picType="androidMenu" /> <PicturesWall picType="androidMenu" style={{ width: '100%' }} />
</Item> </Item>
)} )}
{nodeType === 1 && ( {nodeType === 1 && (
<Item <Item
style={{ marginLeft: '14px' }}
label="离线图标" label="离线图标"
name="offlineImgUrl" name="offlineImgUrl"
rules={[ rules={[
...@@ -112,7 +114,7 @@ const EditForm = props => { ...@@ -112,7 +114,7 @@ const EditForm = props => {
}, },
]} ]}
> >
<PicturesWall picType="androidMenu" /> <PicturesWall picType="androidMenu" style={{ width: '100%' }} />
</Item> </Item>
)} )}
...@@ -127,11 +129,11 @@ const EditForm = props => { ...@@ -127,11 +129,11 @@ const EditForm = props => {
}, },
]} ]}
> >
<PicturesWall picType="androidMenu" /> <PicturesWall picType="androidMenu" style={{ width: '100%' }} />
</Item> </Item>
)} )}
<Item label="功能参数" name="funParam"> <Item label="功能参数" name="funParam" style={{ marginLeft: '26px' }}>
<Input /> <Input style={{ width: '100%' }} />
</Item> </Item>
<Item wrapperCol={{ offset: 10 }} style={{ marginTop: '40px' }}> <Item wrapperCol={{ offset: 10 }} style={{ marginTop: '40px' }}>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
...@@ -142,7 +144,7 @@ const EditForm = props => { ...@@ -142,7 +144,7 @@ const EditForm = props => {
)} )}
{(nodeType === 3 || nodeType === 4) && ( {(nodeType === 3 || nodeType === 4) && (
<Form form={otherForm} name="editMenu" {...layout} onFinish={onFinish}> <Form form={otherForm} name="editMenu" onFinish={onFinish}>
<Item <Item
label="菜单名称" label="菜单名称"
name="menuName" name="menuName"
...@@ -153,10 +155,10 @@ const EditForm = props => { ...@@ -153,10 +155,10 @@ const EditForm = props => {
}, },
]} ]}
> >
<Input /> <Input style={{ width: '100%' }} />
</Item> </Item>
<Item label="菜单别名" name="shortName"> <Item label="菜单别名" name="shortName" style={{ marginLeft: '11px' }}>
<Input /> <Input style={{ width: '100%' }} />
</Item> </Item>
{nodeType === 3 && ( {nodeType === 3 && (
<Item <Item
...@@ -169,7 +171,7 @@ const EditForm = props => { ...@@ -169,7 +171,7 @@ const EditForm = props => {
}, },
]} ]}
> >
<PicturesWall picType="androidMenu" /> <PicturesWall picType="androidMenu" style={{ width: '100%' }} />
</Item> </Item>
)} )}
{nodeType === 3 && ( {nodeType === 3 && (
...@@ -183,7 +185,7 @@ const EditForm = props => { ...@@ -183,7 +185,7 @@ const EditForm = props => {
}, },
]} ]}
> >
<PicturesWall picType="androidMenu" /> <PicturesWall picType="androidMenu" style={{ width: '100%' }} />
</Item> </Item>
)} )}
{nodeType === 4 && ( {nodeType === 4 && (
...@@ -197,7 +199,7 @@ const EditForm = props => { ...@@ -197,7 +199,7 @@ const EditForm = props => {
}, },
]} ]}
> >
<PicturesWall picType="androidMenu" /> <PicturesWall picType="androidMenu" style={{ width: '100%' }} />
</Item> </Item>
)} )}
<Item <Item
...@@ -212,18 +214,19 @@ const EditForm = props => { ...@@ -212,18 +214,19 @@ const EditForm = props => {
> >
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Item name="pageUrl" style={{ marginBottom: 0, width: '100%' }}> <Item name="pageUrl" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请输入功能路径" /> <Input placeholder="请输入功能路径" style={{ width: '100%' }} />
</Item> </Item>
<Button onClick={addParama}>添加参数</Button> <Button onClick={addParama}>添加参数</Button>
</div> </div>
</Item> </Item>
<Item label="功能参数" name="funParam"> <Item label="功能参数" name="funParam" style={{ marginLeft: '11px' }}>
<Input /> <Input style={{ width: '100%' }} />
</Item> </Item>
<CheckList <CheckList
info={info.data ? info.data : {}} info={info.data ? info.data : {}}
nodeType={nodeType} nodeType={nodeType}
valueCallback={valueCallback} valueCallback={valueCallback}
style={{ width: '100%' }}
/> />
<Item wrapperCol={{ offset: 10 }}> <Item wrapperCol={{ offset: 10 }}>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
......
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-03-31 18:43:46
* @LastEditors: leizhe
*/
import React from 'react'; import React from 'react';
import { Drawer, notification } from 'antd'; import { Drawer, notification, Button, Space } from 'antd';
import WebConfigForm from './webConfigForm'; import WebConfigForm from './webConfigForm';
import { postEditWebConfig } from '@/services/webConfig/api'; import { postEditWebConfig } from '@/services/webConfig/api';
...@@ -15,6 +22,11 @@ export default props => { ...@@ -15,6 +22,11 @@ export default props => {
visible={visible} visible={visible}
maskClosable maskClosable
destroyOnClose destroyOnClose
// footer={
// <Space>
// <Button type="primary">确定</Button>
// </Space>
// }
> >
<WebConfigForm <WebConfigForm
hasIntegerate={hasIntegerate} hasIntegerate={hasIntegerate}
......
...@@ -26,6 +26,7 @@ const WebConfigForm = props => { ...@@ -26,6 +26,7 @@ const WebConfigForm = props => {
}; };
useEffect(() => { useEffect(() => {
console.log(submitting);
if (form) { if (form) {
form.setFieldsValue(config); form.setFieldsValue(config);
} }
......
...@@ -7,14 +7,7 @@ import EditeConfigWrapper from './editConfigFileWrapper'; ...@@ -7,14 +7,7 @@ import EditeConfigWrapper from './editConfigFileWrapper';
const { Item } = Form; const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const AddForm = props => { const AddForm = props => {
const { const { submitCallback, nodeObj, addType, submitLoading, configFiles, productList } = props;
submitCallback,
nodeObj,
addType,
submitLoading,
configFiles,
productList,
} = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [otherForm] = Form.useForm(); const [otherForm] = Form.useForm();
const layout = { const layout = {
...@@ -86,8 +79,8 @@ const AddForm = props => { ...@@ -86,8 +79,8 @@ const AddForm = props => {
</Item> </Item>
<Item label="菜单隐藏" name="hideInMenu" initialValue={false}> <Item label="菜单隐藏" name="hideInMenu" initialValue={false}>
<Radio.Group> <Radio.Group>
<Radio value></Radio>
<Radio value={false}></Radio> <Radio value={false}></Radio>
<Radio value></Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
<Item <Item
...@@ -109,8 +102,7 @@ const AddForm = props => { ...@@ -109,8 +102,7 @@ const AddForm = props => {
allowClear allowClear
showSearch showSearch
filterOption={(input, option) => filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
0
} }
> >
{configFiles.map(c => ( {configFiles.map(c => (
......
...@@ -46,6 +46,5 @@ ...@@ -46,6 +46,5 @@
} }
.boe { .boe {
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
width: 93%; width: 100%;
margin-left: 3%;
} }
...@@ -273,7 +273,7 @@ const EditForm = props => { ...@@ -273,7 +273,7 @@ const EditForm = props => {
return ( return (
<div style={{ marginTop: '10px' }}> <div style={{ marginTop: '10px' }}>
{nodeType === 1 && ( {nodeType === 1 && (
<Form form={form} name="editGroup" {...layout} onFinish={onFinish}> <Form form={form} name="editGroup" onFinish={onFinish}>
<Item <Item
label="菜单名称" label="菜单名称"
name="menuName" name="menuName"
...@@ -284,13 +284,13 @@ const EditForm = props => { ...@@ -284,13 +284,13 @@ const EditForm = props => {
}, },
]} ]}
> >
<Input placeholder="请输入菜单名称" /> <Input placeholder="请输入菜单名称" style={{ width: '100%' }} />
</Item> </Item>
<Item label="菜单别名" name="shortName"> <Item label="菜单别名" name="shortName" style={{ marginLeft: '11px' }}>
<Input placeholder="请输入菜单别名" /> <Input placeholder="请输入菜单别名" style={{ width: '100%' }} />
</Item> </Item>
<Item label="产品类型" name="product"> <Item label="产品类型" name="product" style={{ marginLeft: '11px' }}>
<Select placeholder="请选择产品类型" allowClear> <Select placeholder="请选择产品类型" allowClear style={{ width: '100%' }}>
{productList && {productList &&
productList.length > 0 && productList.length > 0 &&
productList.map(item => ( productList.map(item => (
...@@ -312,10 +312,15 @@ const EditForm = props => { ...@@ -312,10 +312,15 @@ const EditForm = props => {
> >
<PicturesWall picType="menuNew" /> <PicturesWall picType="menuNew" />
</Item> </Item>
<Item label="菜单隐藏" name="hideInMenu" initialValue={false}> <Item
label="菜单隐藏"
name="hideInMenu"
initialValue={false}
style={{ marginLeft: '11px' }}
>
<Radio.Group onChange={radioChange}> <Radio.Group onChange={radioChange}>
<Radio value></Radio>
<Radio value={false}></Radio> <Radio value={false}></Radio>
<Radio value></Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
<Item <Item
...@@ -330,12 +335,12 @@ const EditForm = props => { ...@@ -330,12 +335,12 @@ const EditForm = props => {
> >
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Item name="pageUrl" style={{ marginBottom: 0, width: '100%' }}> <Item name="pageUrl" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请输入功能路径" /> <Input placeholder="请输入功能路径" style={{ width: '100%' }} />
</Item> </Item>
<Button onClick={addParama}>添加参数</Button> <Button onClick={addParama}>添加参数</Button>
</div> </div>
</Item> </Item>
<Item label="配置文件" name="config"> <Item label="配置文件" name="config" style={{ marginLeft: '11px' }}>
<EditeConfigWrapper> <EditeConfigWrapper>
<Select <Select
allowClear allowClear
...@@ -345,7 +350,7 @@ const EditForm = props => { ...@@ -345,7 +350,7 @@ const EditForm = props => {
} }
> >
{configFiles.map(c => ( {configFiles.map(c => (
<Select.Option key={c.text} value={c.value}> <Select.Option key={c.text} value={c.value} style={{ width: '100%' }}>
{c.text} {c.text}
</Select.Option> </Select.Option>
))} ))}
...@@ -449,7 +454,7 @@ const EditForm = props => { ...@@ -449,7 +454,7 @@ const EditForm = props => {
)} )}
{nodeType === 2 && ( {nodeType === 2 && (
<Form form={otherForm} name="editMenu" {...layout} onFinish={onFinish}> <Form form={otherForm} name="editMenu" onFinish={onFinish}>
<Item <Item
label="菜单组名称" label="菜单组名称"
name="menuName" name="menuName"
...@@ -460,10 +465,10 @@ const EditForm = props => { ...@@ -460,10 +465,10 @@ const EditForm = props => {
}, },
]} ]}
> >
<Input /> <Input style={{ width: '100%' }} />
</Item> </Item>
<Item label="菜单组别名" name="shortName"> <Item label="菜单组别名" name="shortName" style={{ marginLeft: '11px' }}>
<Input placeholder="请输入菜单组别名" /> <Input placeholder="请输入菜单组别名" style={{ width: '100%' }} />
</Item> </Item>
<Item <Item
label="菜单组图标" label="菜单组图标"
...@@ -477,7 +482,7 @@ const EditForm = props => { ...@@ -477,7 +482,7 @@ const EditForm = props => {
> >
<PicturesWall picType="menuNew" /> <PicturesWall picType="menuNew" />
</Item> </Item>
<Item wrapperCol={{ offset: 10 }} style={{ marginTop: '40px' }}> <Item style={{ marginTop: '40px', marginLeft: '45%' }}>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
提交 提交
</Button> </Button>
......
...@@ -159,19 +159,6 @@ const SiteManage = () => { ...@@ -159,19 +159,6 @@ const SiteManage = () => {
} }
}); });
}; };
const buildMap = list => {
const mapObj = {
type: 'widgetGroup',
searchWord,
children: list.filter(l => l.type === 'widgetUIPage'),
text: '地图组件',
itemid: '9999',
};
return list.some(l => l.type === 'widgetUIPage')
? [mapObj, ...list.filter(l => l.type !== 'widgetUIPage')]
: list;
};
useEffect(() => { useEffect(() => {
console.log('进入'); console.log('进入');
...@@ -195,19 +182,10 @@ const SiteManage = () => { ...@@ -195,19 +182,10 @@ const SiteManage = () => {
res.data.root.forEach(item => { res.data.root.forEach(item => {
list.push({ ...defaultConfig, ...item }); list.push({ ...defaultConfig, ...item });
}); });
const finalList = buildMap(list); console.log(list);
if (finalList[0].text == '地图组件') { setdataList(list);
if (finalList[0].children.find(i => i.isChecked == false)) {
finalList[0].isChecked = false;
} else {
finalList[0].isChecked = true;
}
finalList[0].id = 1;
}
console.log(finalList);
setdataList(finalList);
setValueList( setValueList(
finalList list
.map(l => .map(l =>
checkChildrenByCondition( checkChildrenByCondition(
l, l,
...@@ -758,9 +736,17 @@ const SiteManage = () => { ...@@ -758,9 +736,17 @@ const SiteManage = () => {
spinning={spinLoading} spinning={spinLoading}
style={{ margin: '20px auto ', display: 'block' }} style={{ margin: '20px auto ', display: 'block' }}
> >
<div className={userStyles.siteTitle}> <div style={{ marginLeft: '20px' }}>
<span>选择角色:</span> <span
style={{
fontSize: '15px ',
fontWeight: 'bold',
}}
>
选择角色
</span>
</div> </div>
<hr style={{ width: '95%', color: '#eeecec', marginLeft: '15px' }} />
{treeData && treeData.length > 0 && ( {treeData && treeData.length > 0 && (
<div style={{ height: 'calc(100vh - 130px)', overflowY: 'scroll' }}> <div style={{ height: 'calc(100vh - 130px)', overflowY: 'scroll' }}>
<Tree <Tree
...@@ -815,10 +801,10 @@ const SiteManage = () => { ...@@ -815,10 +801,10 @@ const SiteManage = () => {
onCancel={() => setUserVisible(false)} onCancel={() => setUserVisible(false)}
confirmModal={userModal} confirmModal={userModal}
/> />
<div> <div className={styles.switcher}>
{mulu && ( {mulu && (
<Tooltip title="隐藏角色栏" className={styles.hide}> <Tooltip title="隐藏角色栏" className={styles.hide}>
<DoubleLeftOutlined onClick={() => handleHide()} /> <DoubleLeftOutlined onClick={() => handleHide()} style={{ marginLeft: '-5px' }} />
</Tooltip> </Tooltip>
)} )}
{!mulu && ( {!mulu && (
......
...@@ -22,11 +22,21 @@ ...@@ -22,11 +22,21 @@
width: 18px; width: 18px;
} }
} }
.switcher {
display: block;
position: absolute;
font-size: 18px;
color: #1890ff !important;
top: 50%;
right: 5px;
transform: translate(0%, -50%);
z-index: 1;
}
} }
.hideBox { .hideBox {
left: 0px; left: 0px;
top: 0; top: 0;
width: 20px; width: 26px;
} }
.hideH { .hideH {
width: 100%; width: 100%;
......
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