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

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

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