Commit 1123424f authored by 邓超's avatar 邓超

fix: 添加建表、表编辑功能

parent 049dfc13
This diff is collapsed.
.content {
height: 620px;
:global {
.ant-table-row {
height: 49px;
}
.editable-cell {
position: relative;
}
.editable-cell-value-wrap {
padding: 5px 12px;
cursor: pointer;
}
.editable-row:hover .editable-cell-value-wrap {
padding: 4px 11px;
border: 1px solid #fff;
border-radius: 2px;
}
[data-theme='dark'] .editable-row:hover .editable-cell-value-wrap {
border: 1px solid #434343;
}
.ant-table-cell-ellipsis {
overflow: visible;
}
.ant-form-item-explain {
position: absolute;
height: 35px;
width: 140px;
background-color: #ff4d4f;
top: -50px;
left: 50%;
transform: translateX(-50%);
border-radius: 5px;
}
.ant-form-item-explain-error {
color: #fff;
line-height: 35px;
}
.ant-select-arrow .anticon {
margin-top: 8px;
}
}
}
\ No newline at end of file
export const defaultFields = [
{
value: '事件表',
list: [
{
Name: 'ID',
FieldType: 7,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: false,
ReadOnly: true,
},
{
Name: '事件编号',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '事件状态',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '事件名称',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '上报站点',
FieldType: 0,
FieldLength: 500,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '处理站点',
FieldType: 0,
FieldLength: 500,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '上报人名称',
FieldType: 0,
FieldLength: 20,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '上报人部门',
FieldType: 0,
FieldLength: 20,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '上报时间',
FieldType: 9,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '现场图片',
FieldType: 0,
FieldLength: 500,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '现场录音',
FieldType: 0,
FieldLength: 500,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '坐标位置',
FieldType: 0,
FieldLength: 100,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '更新时间',
FieldType: 9,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '更新状态',
FieldType: 0,
FieldLength: 200,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '是否置顶',
FieldType: 5,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '是否删除',
FieldType: 5,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
],
},
{
value: '工单表',
list: [
{
Name: 'ID',
FieldType: 7,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: false,
ReadOnly: true,
},
{
Name: '工单编号',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
],
},
{
value: '台账表',
list: [
{
Name: 'ID',
FieldType: 7,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: false,
ReadOnly: true,
},
{
Name: '所属站点',
FieldType: 0,
FieldLength: 200,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '录入时间',
FieldType: 9,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '是否删除',
FieldType: 5,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
],
},
{
value: '设备表',
list: [
{
Name: 'ID',
FieldType: 7,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: false,
ReadOnly: true,
},
{
Name: '设备名称',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '所属站点',
FieldType: 0,
FieldLength: 100,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '编码',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: 'GIS编号',
FieldType: 0,
FieldLength: 100,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '父设备编码',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '坐标位置',
FieldType: 0,
FieldLength: 200,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '风貌图',
FieldType: 0,
FieldLength: 500,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '视频缩略图',
FieldType: 0,
FieldLength: 200,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '第三方编码',
FieldType: 0,
FieldLength: 200,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '录入时间',
FieldType: 9,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '是否删除',
FieldType: 5,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
],
},
{
value: '反馈表',
list: [
{
Name: 'ID',
FieldType: 7,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: false,
ReadOnly: true,
},
{
Name: '编码',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '设备编码',
FieldType: 0,
FieldLength: 50,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '录入时间',
FieldType: 9,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
{
Name: '是否删除',
FieldType: 5,
FieldLength: 0,
DecimalPlace: 0,
IsNullable: true,
ReadOnly: true,
},
],
},
];
......@@ -616,7 +616,7 @@ const AddModal = props => {
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.containerBox}>
<div className={styles.config}>
<div className={styles.title}>{formObj}</div>
<div className={styles.title}> 页面属性 【{formObj}</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<div style={{ lineHeight: '32px', marginRight: '5px' }}>快速切换表:</div>
<div style={{ width: '350px', marginRight: '10px' }}>
......
......@@ -15,6 +15,8 @@ import {
Badge,
Spac,
Card,
Dropdown,
Menu,
} from 'antd';
import {
EditOutlined,
......@@ -26,6 +28,7 @@ import {
BorderInnerOutlined,
DoubleLeftOutlined,
DoubleRightOutlined,
TableOutlined,
} from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer';
import {
......@@ -36,10 +39,12 @@ import {
import { useHistory } from 'react-router-dom';
import styles from './index.less';
import Editor from './components/Field/editor';
import AddTablelList from './components/Field/addTable';
// import AddTablelList from './components/Field/addTable';
import AddTablelList from './components/TableView';
import AffiliateAdd from './components/Field/affiliateAdd';
import LoadGroup from './components/Field/loadGroup';
import LoadGroupNew from './components/Field/loadGroupNew';
import { defaultFields } from './components/defaultFields';
const { Search } = Input;
const { Option } = Select;
const placeholder = '请输入表名';
......@@ -67,6 +72,7 @@ const TableManager = props => {
const [treeVisible, setTreeVisible] = useState(true); // 是否显示左侧树
const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引
const [pickIndex, setPickIndex] = useState(0);
const [tableType, setTableType] = useState(defaultFields[0].value);
const initNum = useRef(0);
useEffect(
......@@ -210,7 +216,7 @@ const TableManager = props => {
const getField = () => {
loadUnattachedTables().then(res => {
if (res.data.root && res.data.root.length) {
setTableList(res.data.root);
setTableList(res.data.root.reverse());
}
});
};
......@@ -244,7 +250,6 @@ const TableManager = props => {
}
}
setKeepTreeFirst(bb);
console.log(aa);
setKeepTreeSelect(aa);
initNum.current += 1;
}
......@@ -384,6 +389,16 @@ const TableManager = props => {
style={{ fontSize: '20px', color: '#1890FF' }}
/>
</Tooltip>
<Tooltip title="表配置">
<TableOutlined
onClick={() => {
setType('tableEdit');
setVisible(true);
setFormObj(record);
}}
style={{ fontSize: '20px', color: '#1890FF' }}
/>
</Tooltip>
{/* <Tooltip title="字段配置">
<FontColorsOutlined
onClick={e => fieldsConfig(record, e)}
......@@ -426,7 +441,18 @@ const TableManager = props => {
list[pickIndex].pageSize = pageSize;
setGroupArr(list);
};
const onMenuClick = e => {
console.log('click', e);
setTableType(e.key);
AddTable();
};
const menu = (
<Menu
onClick={onMenuClick}
items={defaultFields.map(item => ({ key: item.value, label: item.value }))}
/>
);
return (
<Spin tip="loading..." spinning={treeLoading}>
<PageContainer>
......@@ -504,15 +530,15 @@ const TableManager = props => {
style={{ width: '300px' }}
/>
</div>
<Button
type="primary"
style={{ marginLeft: '10px' }}
icon={<BorderInnerOutlined />}
onClick={AddTable}
>
建表
</Button>
<Dropdown overlay={menu} arrow>
<Button
type="primary"
icon={<BorderInnerOutlined />}
style={{ marginLeft: '10px' }}
>
建表
</Button>
</Dropdown>
<Button
type="primary"
style={{ marginLeft: '10px' }}
......@@ -579,9 +605,17 @@ const TableManager = props => {
formObj={formObj}
/>
)}
{visible && type === 'add' && (
{/* {visible && type === 'add' && (
<AddTablelList type={type} onCancel={() => setVisible(false)} callBackSubmit={onSubmit} />
)}
)} */}
<AddTablelList
visible={visible && (type === 'add' || type === 'tableEdit')}
type={type}
onCancel={() => setVisible(false)}
formObj={formObj}
callBackSubmit={onSubmit}
tableType={tableType}
/>
{visible && type === 'affiliateAdd' && (
<AffiliateAdd
visible={visible}
......
......@@ -244,14 +244,14 @@ const NodeModal = props => {
</Form.Item>
<Form.Item label="检查前面在办" name="aheadHandle">
<Select>
<Option value={0}>前面有在办也能移交</Option>
<Option value={1}>前面有在办不能移交</Option>
<Option value={0}>前面有在办也能移交</Option>
</Select>
</Form.Item>
<Form.Item label="节点办理情况" name="NodeHandling">
<Form.Item label="节点办理方式" name="NodeHandling">
<Select>
<Option value={0}>多人接收,多人办理</Option>
<Option value={1}>多人接收,一人办理</Option>
<Option value={0}>多人接收,多人办理</Option>
<Option value={2}>一人接收,一人办理</Option>
</Select>
</Form.Item>
......
......@@ -57,3 +57,7 @@ export const LoadFieldsByGroup = param =>
// 18.根据分组名加载字段集
export const ChangeOrder = data => post(`${PUBLISH_SERVICE}/CaseManage/ChangeOrder`, data);
// 创建表
export const CreateTablePost = data => post(`${PUBLISH_SERVICE}/CaseManage/CreateTable`, data);
// 修改表
export const updateTablePost = param => post(`${PUBLISH_SERVICE}/CaseManage/UpdateTable`, param);
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