Commit 555f365f authored by mayongxin's avatar mayongxin

表管理

parent fbe4558f
......@@ -111,6 +111,7 @@
"react-ace": "^9.2.0",
"react-dom": "16.8.6",
"react-helmet": "6.0.0-beta",
"react-html-parser": "^2.0.2",
"react-intl": "2.8.0",
"react-json-view": "^1.21.3",
"react-redux": "7.0.2",
......
import React, { useEffect, useState } from 'react'
import PageContainer from '@/components/BasePageContainer';
import { Card, Form, Input, Button, Switch, message } from 'antd'
import styles from './index.less'
const AuthControl = () => {
const [checked,setChecked] = useState()
useEffect(() => {
}, [])
const loadConfig = () => {
}
const operateControl = ()=>{
}
return (
<>
<PageContainer>
<Card title="数据管理" style={{ width: 350, marginLeft: 15 }}>
<div className={styles.auth_container}>
<div className={styles.operate_item}>
<div>数据库鉴权</div>
<Switch checkedChildren='开启' unCheckedChildren='关闭' checked={checked} onChange={operateControl} />
</div>
</div>
</Card>
</PageContainer>
</>
)
}
export default AuthControl;
\ No newline at end of file
.auth_container {
display: flex;
flex-direction: column;
justify-content: space-around;
width: 100%;
height: 100%;
.operate_item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 50px;
border-width: 1px;
border-color: #EEEEEE;
border-bottom-style: solid;
}
}
\ No newline at end of file
import React, { useState, useEffect } from 'react'
import {CM_Table_ReloadFields} from '@/services/platform/bs'
const FieldEdit = () => {
return (
<div>
</div>
)
}
export default FieldEdit
\ No newline at end of file
import React, { useEffect, useState } from 'react'
import ReactHtmlParser from 'react-html-parser'
import {
// Tree,
Table,
Space,
Input,
Button,
Select,
Popconfirm,
message
} from 'antd';
import { PlusCircleOutlined } from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer';
import { CM_Table_LoadTable } from '@/services/platform/bs'
import styles from './index.less'
const { Search } = Input;
const { Option } = Select;
const placeholder = "请输入表名"
const TableManager = () => {
const columns = [
{
title: '名称',
dataIndex: 'tableName',
key: 'tableName',
render: text => <a>{text}</a>,
},
{
title: '别名',
dataIndex: 'tableAlias',
key: 'tableAlias',
},
{
title: '表格样式',
dataIndex: 'tableStyle',
key: 'tableStyle',
},
{
title: '模板',
dataIndex: 'officeTmpl',
key: 'officeTmpl',
render: text => {
let dom = ReactHtmlParser(text)
return(<div>{dom}</div>)
}
},
{
title: '字段数量',
dataIndex: 'fieldCount',
key: 'fieldCount',
},
{
title: '缺少字段',
dataIndex: 'missingFieldCount',
key: 'missingFieldCount',
render: text => {
let dom = ReactHtmlParser(text)
return(<div>{dom}</div>)
}
},
{
title: '重复配置',
dataIndex: 'repeatFieldCount',
key: 'repeatFieldCount',
render: text => {
let dom = ReactHtmlParser(text)
return(<div>{dom}</div>)
}
},
{
title: '未附加',
dataIndex: 'extraFieldCount',
key: 'extraFieldCount',
},
{
title: '分组数量',
dataIndex: 'groupCount',
key: 'groupCount',
},
{
title: '触发字段',
dataIndex: 'exceptionFields',
key: 'exceptionFields',
},
{
title: '触发事件',
dataIndex: 'exceptionEvents',
key: 'exceptionEvents',
},
{
title: '接口',
dataIndex: 'interfaceText',
key: 'interfaceText',
},
{
title: '操作',
dataIndex: 'action',
key: 'action',
width: 250,
ellipsis: true,
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
changeDesc(record);
}}
>
修改
</Button>
<Button
type="primary"
size="small"
onClick={() => {
changeDesc(record);
}}
>
编辑字段
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该表?"
okText="确认"
cancelText="取消"
onConfirm={() => {
changeDesc(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const [tableData, setTableData] = useState([])
useEffect(() => {
loadTable()
}, [])
const changeDesc = () => {
}
const AddTable = () => {
}
const handleSearch = (text) => {
loadTable(text)
}
const loadTable = (keyword)=>{
CM_Table_LoadTable({
_version: 9999,
filter:keyword
}).then(
res => {
if (res.success == true) {
setTableData(res.root)
}
}
)
}
return (
<PageContainer>
<div className={styles.tablemanager_container}>
<div className={styles.operate_bar}>
<div className={styles.fast_search}>
<div className={styles.title}>快速检索</div>
<Search
allowClear
placeholder={placeholder}
onSearch={handleSearch}
// onChange={handleChange}
enterButton
style={{ width: "300px" }}
/>
</div>
<Button type="primary" style={{ marginLeft: "10px" }} onClick={AddTable}>建表</Button>
<Button type="primary" style={{ marginLeft: "10px" }} onClick={AddTable}>附加</Button>
</div>
<div className={styles.table_container}>
<Table
columns={columns}
dataSource={tableData}
pagination={{pageSize:20}}
scroll={{ y: 700 }}
size="small"
/>
</div>
</div>
</PageContainer>
)
}
export default TableManager;
\ No newline at end of file
.tablemanager_container {
display: flex;
flex-direction: column;
.operate_bar {
width: 100%;
height: 60px;
background-color: white;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.fast_search {
height: 60px;
margin-right: 10px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.title {
margin-left: 20px;
margin-right: 5px;
}
}
}
.table_container{
}
}
\ No newline at end of file
import React, { useState } from 'react'
import { Modal, Form, Input, notification, message, Radio,Checkbox } from 'antd';
const AuthModal = props => {
const plainOptions = ['新增', '编辑', '删除'];
const [form] = Form.useForm();
const { Item } = Form;
const { title, visible, onCancel, onSelect } = props;
const onTypeChange = () => {
}
const onSubmit = () => {
}
return (
<Modal
title={title}
visible={visible}
onCancel={onCancel}
onOk={onSubmit}
okText="确认"
cancelText="取消"
>
<Form form={form} labelCol={{ span: 4 }}>
<Item
label="允许操作"
name="operate_type"
>
<Checkbox.Group
options={plainOptions}
onChange={onTypeChange}
/>
</Item>
</Form>
</Modal>
)
}
export default AuthModal
\ No newline at end of file
......@@ -28,7 +28,8 @@ import {
DoubleLeftOutlined,
DoubleRightOutlined,
DownOutlined,
BorderlessTableOutlined
BorderlessTableOutlined,
LockOutlined
} from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer';
import voca from 'voca';
......@@ -56,6 +57,7 @@ import RelateRoleModal from './RelateRoleModal';
import EditUserModal from './EditUserModal';
import ChangePasswordModal from './ChangePasswordModal';
import MapScopeEditModal from '@/components/MapScope'
import AuthModal from './AuthModal'
import styles from './UserManage.less';
import {createGuid} from '@/utils/transformUtil'
......@@ -90,6 +92,7 @@ const UserManage = () => {
const [editUserVisible, setEditUserVisible] = useState(false); // 编辑用户
const [freezeUserVisible, setFreezeUserVisible] = useState(false); // 冻结用户
const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 删除用户
const [authUserVisible, setAuthUserVisible] = useState(false); // 鉴权用户
const [orgTitle, setOrgTitle] = useState('当前机构'); // 弹框标题
const [description, setDescription] = useState(''); // 机构描述信息
......@@ -264,12 +267,19 @@ const UserManage = () => {
</Tooltip>
</>
)}
<Tooltip title="用户鉴权">
<LockOutlined
onClick={() => authUser(record)}
style={{ fontSize: '16px', color: '#535353' }}
/>
</Tooltip>
<Tooltip title="删除用户">
<DeleteOutlined
onClick={() => deleteUser(record)}
style={{ fontSize: '16px', color: '#e86060' }}
/>
</Tooltip>
</Space>
),
},
......@@ -521,7 +531,10 @@ const UserManage = () => {
setCurrentUser(record);
setSelectColor(record);
};
//用户鉴权
const authUser = record =>{
setAuthUserVisible(true)
}
// 查找用户
const submitSearchUser = () => {
getUserByKey(searchWord)
......@@ -1051,6 +1064,11 @@ const UserManage = () => {
distinct={currentOrgDistinct}
extent={currentOrgArea}
/>
<AuthModal
visible={authUserVisible}
currentUser={currentUser}
onCancel={() => setAuthUserVisible(false)}
/>
</div>
</PageContainer>
);
......
import React, { useState, useEffect } from 'react';
import { Form, Input, Button, Row, Col, Select, Radio } from 'antd';
import { Form, Input, Button, Row, Col, Select, Radio, Checkbox } from 'antd';
import styles from './addForm.less';
import PicturesWall from '@/components/Upload/index';
import EditeConfigWrapper from './editConfigFileWrapper';
......@@ -13,7 +13,7 @@ const EditForm = props => {
nodeType,
info,
configFiles,
valueCallback = () => {},
valueCallback = () => { },
productList,
} = props;
const [form] = Form.useForm();
......@@ -47,7 +47,7 @@ const EditForm = props => {
const onFinish = val => {
submit();
};
const radioChange = e => {};
const radioChange = e => { };
return (
<div style={{ marginTop: '10px' }}>
{nodeType === 1 && (
......@@ -137,6 +137,12 @@ const EditForm = props => {
nodeType={nodeType}
valueCallback={valueCallback}
/>
<div style={{marginLeft:"20px",marginTop:"20px" , display:"flex",flexDirection:"row"}}>
<div style={{marginRight:"10px"}}>数据鉴权</div>
<Checkbox.Group options={["新增", "编辑", "删除"]} onChange={() => { }} />
</div>
<Item wrapperCol={{ offset: 10 }} style={{ marginTop: '20px' }}>
<Button type="primary" htmlType="submit">
提交
......
......@@ -41,6 +41,8 @@ import MessageManager from '@/pages/platformCenter/messageManage'
import SchemeConfig from '@/pages/platformCenter/schemeConfig/schemeConfig';
import TaskScheduling from '@/pages/artificial/taskScheduling/taskScheduling';
import PoliciesIssued from '@/pages/artificial/policiesIssued/policiesIssued';
import TableManager from '@/pages/platformCenter/bsmanager/tablemanager'
import AuthControl from '@/pages/authcontrol'
// import ColConen from '@/components/Colophon/colContent';
const iconStyle = { verticalAlign: '0.125em' };
......@@ -79,6 +81,13 @@ export default {
authority: superAuthority,
component: CurrentSolution,
},
{
path: '/authcontrol',
name: '数据鉴权',
icon: <SolutionOutlined style={iconStyle} />,
authority: superAuthority,
component: AuthControl,
},
{
path: '/dbm',
name: '数据库管理',
......@@ -226,6 +235,24 @@ export default {
}
],
},
{
path: '/platformCenter/bsmanger',
component: BlankLayout,
name: '业务平台',
icon: <CopyOutlined style={iconStyle} />,
routes: [
{
path: '/platformCenter/bsmanger/tablemanger',
name: '表/字段',
component: TableManager,
},
{
path: '/platformCenter/bsmanger/standbookmanager',
name: '台账配置',
component: TableManager,
}
],
},
],
},
{
......
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
//1.获取所有已附加的表
export const CM_Table_LoadTable = param =>
get(`${CITY_SERVICE}/OMS.svc/CM_Table_LoadTable`, param);
//2.获取单张表的字段 CM_Table_ReloadFields
export const CM_Table_ReloadFields = param =>
get(`${CITY_SERVICE}/OMS.svc/CM_Table_ReloadFields`, 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