Commit b9cdf6ca authored by 邓超's avatar 邓超

fix: 整合文件目录跟路由匹配上

parent 4ebbd5bb
......@@ -3,7 +3,7 @@ import PageContainer from '@/components/BasePageContainer';
import { Tabs } from 'antd';
import React from 'react';
import styles from './index.less';
import SevenParams from '@/pages/mobileConfig/menuconfig/SevenParams';
import SevenParams from '@/pages/productCenter/mobileConfig/menuconfig/SevenParams';
const { TabPane } = Tabs;
/**
* 嵌套iframe的组件
......
import React, { useEffect, useState } from 'react';
import { Modal, Card, Empty } from 'antd';
import { useHistory } from 'react-router-dom';
import classnames from 'classnames';
import styles from './index.less';
import weixiu from '@/assets/images/logo/weixiu.svg';
import jumpImg from '@/assets/images/logo/jumpImg.png';
const JumpContainer = props => {
const [url, setUrl] = useState('');
const jumpTo = useHistory();
useEffect(() => {
const jumpUrl = window.location.origin;
const address = `${jumpUrl}/cityoms3/4.0.html`;
setUrl(address);
// openInNewTab(address);
}, []);
const openInNewTab = address => {
jumpTo.goBack();
window.open(address, '_blank');
console.table(jumpTo);
};
return (
<>
<div className={classnames(`${styles.box}`)}>
<img
src={jumpImg}
alt=""
className={classnames({
[styles.imgs]: true,
})}
/>
<p className={styles.desc}>
业务平台建设中,点击链接跳转
{url && (
<a
target="_blank"
href={url}
rel="noopener noreferer"
className={classnames({
[styles.link]: true,
})}
>
运维平台4.0
</a>
)}
</p>
</div>
</>
);
};
export default JumpContainer;
.box{
position: relative;
top:40%;
left: 50%;
transform: translate(-50%,-50%);
width: 400px;
height:250px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.imgs{
width: 800px;
height: 600px;
}
.desc{
margin-top: 10px;
color: gray;
font-size: 16px;
}
.link{
// display: flex;
// justify-content: center ;
// align-items: center;
// padding: 5px;
color: #1890ff;
}
\ No newline at end of file
import React from 'react';
import { HeartTwoTone, SmileTwoTone } from '@ant-design/icons';
import { Card, Typography, Alert } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
export default () => (
<PageHeaderWrapper content=" 这个页面只有 admin 权限才能查看">
<Card>
<Alert
message="umi ui 现已发布,欢迎使用 npm run ui 启动体验。"
type="success"
showIcon
banner
style={{
margin: -12,
marginBottom: 48,
}}
/>
<Typography.Title level={2} style={{ textAlign: 'center' }}>
<SmileTwoTone /> Ant Design Pro <HeartTwoTone twoToneColor="#eb2f96" />{' '}
You
</Typography.Title>
</Card>
<p style={{ textAlign: 'center', marginTop: 24 }}>
Want to add more pages? Please refer to{' '}
<a
href="https://pro.ant.design/docs/block-cn"
target="_blank"
rel="noopener noreferrer"
>
use block
</a>
</p>
</PageHeaderWrapper>
);
import React from 'react';
import { Alert, Card, Typography } from 'antd';
import PageContainer from '@/components/BasePageContainer';
import { connect } from 'react-redux';
import styles from './Welcome.less';
// eslint-disable-next-line no-unused-vars
const CodePreview = ({ children }) => (
<pre className={styles.pre}>
<code>
<Typography.Text copyable>{children}</Typography.Text>
</code>
</pre>
);
const mapState = store => store;
export default connect(mapState)(() => (
<PageContainer>
<Card>
<Alert
message="更快更强的重型组件,已经发布。"
type="success"
showIcon
banner
style={{
margin: -12,
marginBottom: 24,
}}
/>
</Card>
</PageContainer>
));
@import '~antd/lib/style/themes/default.less';
.pre {
margin: 12px 0;
padding: 12px 20px;
background: @input-bg;
box-shadow: @card-shadow;
}
\ No newline at end of file
import { Tabs } from 'antd';
import React from 'react';
import PageContainer from '@/components/BasePageContainer';
import styles from './policiesIssued.less'
import PredictionConfig from './predictionConfig/predictionConfig';
import StrategyConfig from './strategyConfig/strategyConfig';
const { TabPane } = Tabs;
const SchemeConfig = () => {
return (
<PageContainer>
<div className={styles.container}>
<Tabs type="card">
<TabPane tab="预测方案" key="1">
<PredictionConfig />
</TabPane>
<TabPane tab="策略下发" key="2">
<StrategyConfig />
</TabPane>
</Tabs>
</div>
</PageContainer>
)
}
export default SchemeConfig;
\ No newline at end of file
.container{
width: 100%;
height: calc(100vh - 100px) ;
background-color: #ffffff;
display: flex;
padding: 0.8rem;
.ant-table-thead tr th {
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
overflow-y: scroll;
.ant-input-number-input{
background-color: #ffffff;
color: #000000;
}
.ant-card-body{
padding-bottom: 0 !important;
}
}
.predict{
display: flex;
align-items: flex-end;
justify-content: space-between;
width: 100%;
}
.tileBtn{
display: flex;
justify-content: flex-end;
width: 100%;
padding: 0 0 2rem
}
.corn{
cursor: pointer;
margin-left:1rem;
text-decoration: underline;
width: 8rem;
}
.deviceList{
max-height: 20rem;
overflow-y: scroll;
}
.deleteItem{
position:relative;
right: -100%;
top: -8.6rem;
}
\ No newline at end of file
import { Space, Table, Button, Popconfirm, notification, Spin } from 'antd';
import React, { useState, useEffect } from 'react';
import styles from '../policiesIssued.less'
import {
getIotDeviceType, getPredictInfo, deletePredictOptions
} from '@/services/intelligence/api';
import AddModal from './AddModal'
const VectorData = props => {
const [treeLoading, setTreeLoading] = useState(false);// 弹窗显示
const [flag, setFlag] = useState(0); // 更新list
const [type, setType] = useState(''); // 弹窗类型
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
const [tileData, setTileData] = useState([]); // table表格数据
const [visible, setVisible] = useState(false); // 弹窗
const [deviceType, setDeviceType] = useState([]); //设备类型列表
const columns = [
{
title: '序号',
align: 'center',
render: (text, record, index) => (
<Space>
<span>{(index + 1)}</span>
</Space>
)
},
{
title: '方案名称',
dataIndex: 'PredictName',
key: 'PredictName',
align: 'center'
},
{
title: '场景名称',
dataIndex: 'SceneName',
key: 'SceneName',
align: 'center'
},
{
title: '设备类型',
dataIndex: 'DeviceType',
key: 'DeviceType',
align: 'center'
},
{
title: '预测间隔',
align: 'center',
render: (record) => (
<Space>
{record.CycleValue + record.Cycle}
</Space>
)
},
{
title: '描述',
dataIndex: 'Remarks',
key: 'Remarks',
align: 'center'
},
{
title: '编辑',
align: 'center',
render: (text, record, index) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
changeRecord(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该方案?"
okText="确认"
cancelText="取消"
onConfirm={() => {
delConfirm(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const onSubmit = prop => {
setVisible(false);
setFlag(flag + 1)
};
const delConfirm = (record) => {
deletePredictOptions(record.ID).then(res => {
if (res.errMsg === '') {
setFlag(flag + 1)
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.errMsg,
});
};
})
}
const handleAdd = () => {
setFormObj({});
setType('add');
setVisible(true);
}
useEffect(() => {
renderTile();
}, [flag]);
// 获取瓦片数据配置数据
const renderTile = () => {
setTreeLoading(true)
const getIotDevice = getIotDeviceType()
const getPredictList = getPredictInfo()
Promise.all([getIotDevice, getPredictList]).then(res => {
res[0].getMe && res[0].getMe.length && setDeviceType(res[0].getMe)
res[1].getMe && res[1].getMe.length && setTileData(res[1].getMe)
setTreeLoading(false)
}).catch(err => {
setTreeLoading(false)
})
};
const changeRecord = (record) => {
setType('edit');
setFormObj(record);
setVisible(true);
}
return (
<>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.tileBtn}>
<Button type="primary" onClick={() => {
handleAdd();
}} >
新增
</Button>
</div>
<Table
columns={columns}
dataSource={tileData}
bordered
rowKey="ID"
scroll={{ y: 700 }}
pagination={{
pageSize: '10',
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}}
>
</Table>
<AddModal
visible={visible}
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
type={type}
deviceType={deviceType}
formObj={formObj}
/>
</Spin>
</>
)
}
export default VectorData
\ No newline at end of file
import { Space, Table, Button, Popconfirm, notification ,Spin} from 'antd';
import React, { useState, useEffect } from 'react';
import styles from '../policiesIssued.less'
import {
getIotDeviceType, getStrategyInfo, deleteStrategyOptions
} from '@/services/intelligence/api';
import AddModal from './AddModal'
const VectorData = props => {
const [treeLoading, setTreeLoading] = useState(false);// 弹窗显示
const [flag, setFlag] = useState(0); // 更新list
const [type, setType] = useState(''); // 弹窗类型
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
const [tileData, setTileData] = useState([]); // table表格数据
const [visible, setVisible] = useState(false); // 弹窗
const [deviceType, setDeviceType] = useState([]); //设备类型列表
const columns = [
{
title: '序号',
align: 'center',
render: (text, record, index) => (
<Space>
<span>{(index + 1)}</span>
</Space>
)
},
{
title: '策略名称',
dataIndex: 'StrategyName',
key: 'StrategyName',
align: 'center'
},
{
title: '策略类型',
dataIndex: 'StrategyType',
key: 'StrategyType',
align: 'center'
},
{
title: '创建时间',
dataIndex: 'CreateTime',
key: 'CreateTime',
align: 'center'
},
{
title: '设备类型',
dataIndex: 'DeviceType',
key: 'DeviceType',
align: 'center'
},
{
title: '描述',
dataIndex: 'StrategyDes',
key: 'StrategyDes',
align: 'center'
},
{
title: '编辑',
align: 'center',
render: (text, record, index) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
changeRecord(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该方案?"
okText="确认"
cancelText="取消"
onConfirm={() => {
delConfirm(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const onSubmit = prop => {
setVisible(false);
setFlag(flag + 1)
};
const delConfirm = (record) => {
deleteStrategyOptions(record.ID).then(res => {
if (res.errMsg==='') {
setFlag(flag + 1)
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.errMsg,
});
};
})
}
const handleAdd = () => {
setFormObj({});
setType('add');
setVisible(true);
}
useEffect(() => {
renderTile();
}, [flag]);
// 获取瓦片数据配置数据
const renderTile = () => {
setTreeLoading(true)
const getIotDevice = getIotDeviceType()
const getStrategy = getStrategyInfo()
Promise.all([getIotDevice,getStrategy]).then(res => {
console.log('res[3].getMe',res[1].getMe);
res[0].getMe && res[0].getMe.length && setDeviceType(res[0].getMe)
res[1].getMe && res[1].getMe.length && setTileData(res[1].getMe)
setTreeLoading(false)
}).catch(err => {
setTreeLoading(false)
})
};
const changeRecord =(record)=>{
setType('edit');
setFormObj(record);
setVisible(true);
}
return (
<>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.tileBtn}>
<Button type="primary" onClick={() => {
handleAdd();
}} >
新增
</Button>
</div>
<Table
columns={columns}
dataSource={tileData}
bordered
rowKey="ID"
scroll={{ y: 700 }}
pagination={{
pageSize: '10' ,
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}}
>
</Table>
<AddModal
visible={visible}
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
type={type}
deviceType={deviceType}
formObj={formObj}
/>
</Spin>
</>
)
}
export default VectorData
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification, DatePicker, Spin } from 'antd';
import styles from './taskScheduling.less'
// import moment from 'moment';
// import locale from 'antd/es/date-picker/locale/zh_CN';
// import 'moment/locale/zh-cn';
import moment from 'moment'
import locale from 'antd/lib/date-picker/locale/zh_CN'
import 'moment/locale/zh-cn'
moment.locale('zh-cn')
import {
addTaskOptions, getPredictInfo, getStrategyInfo, updateTaskOptions
} from '@/services/intelligence/api';
const { TextArea } = Input;
const AddModal = props => {
const { callBackSubmit = () => { }, type, formObj, visible, deviceType } = props;
const [loading, setLoading] = useState(false);
const [isloading, setIsLoading] = useState(false);
const [urlType, setUrlType] = useState('');
const [scenarioList, setScenarioList] = useState([]);
const [Intervals, setIntervals] = useState('')
const [StrategyId, setStrategyId] = useState(0)
const [form] = Form.useForm();
const { Item } = Form;
// 提交
const onSubmit = () => {
form.validateFields().then(validate => {
if (validate) {
let obj = form.getFieldsValue();
let apiUrl = type === 'add' ? addTaskOptions : updateTaskOptions
setLoading(true);
apiUrl([{
...obj, StrategyId
}]).then(res => {
setLoading(false);
if (res.errMsg === '') {
form.resetFields();
callBackSubmit();
prompt('success', `${type === 'add' ? "增加成功" : "编辑成功"}`)
}
else {
prompt('fail', res.errMsg)
}
}).catch(err => {
setLoading(false);
})
}
});
};
//提示框
const prompt = (type, content) => {
if (type == 'success') {
notification.success({
message: '提示',
duration: 3,
description: content,
});
}
else {
notification.error({
message: '提示',
duration: 3,
description: content,
});
}
}
const onFinish = value => { };
useEffect(() => {
switch (type) {
case 'add':
setIntervals()
form.resetFields();
break;
case 'edit':
setUrlType(formObj.TaskType)
setStrategyId(formObj.AlgorithmId)
handleTaskType(formObj.TaskType)
setIntervals(formObj.Interval)
form.setFieldsValue({ ...formObj, AlgorithmName: formObj.Name });
break;
default:
break;
}
}, [visible]);
//选择任务类型
const handleTaskType = (value) => {
switch (value) {
case '预测':
setUrlType('predict')
getPredictInfo().then(res => {
res.getMe.length && setScenarioList(res.getMe)
})
break;
case '控制':
setUrlType('control')
getStrategyInfo().then(res => {
res.getMe.length && setScenarioList(res.getMe)
})
break;
case 'http':
setUrlType('url')
break;
default:
setUrlType('predict')
}
}
const inputInterval = (e) => {
setIntervals(e.target.value)
}
const layout = {
layout: 'horizontal',
labelCol: {
span: 5,
},
wrapperCol: {
span: 16,
},
};
const handleChange = (value, option) => {
setStrategyId(option.id)
}
return (
<Modal
title={`${type === 'add' ? '任务新增' : '编辑'}`}
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '150px' }}
width="700px"
destroyOnClose
maskClosable={false}
cancelText="取消"
okText="确认"
{...props}
onOk={() => onSubmit()}
confirmLoading={loading}
forceRender={true}
getContainer={false}
>
<Spin spinning={isloading} delay={300}>
{visible && (
<Form form={form} {...layout} onFinish={onFinish}>
<Item
label="任务名称"
name="TaskName"
rules={[{ required: true, message: '请输入任务名称' }]}
>
<Input placeholder="请输入任务名称" allowClear />
</Item>
<Item
label="任务类型"
name="TaskType"
rules={[{ required: true, message: '请选择类型' }]}
>
<Select onChange={handleTaskType}>
<Select.Option value='预测'>预测</Select.Option>
<Select.Option value='控制'>控制</Select.Option>
<Select.Option value='http'>http</Select.Option>
</Select>
</Item>
{urlType === 'predict' || urlType === 'control' || urlType === '' ? <Item
label="方案名称"
name="AlgorithmName"
>
<Select onChange={(value, option) => handleChange(value, option)}>
{scenarioList.length ? scenarioList.map((item, index) => { return <Select.Option key={index} id={item.ID} value={urlType === 'predict' ? item.PredictName : item.StrategyName}>{urlType === 'predict' ? item.PredictName : item.StrategyName}</Select.Option> }) : ''}
</Select>
</Item> : <Item
label="ApiUrl"
name="ApiUrl"
>
<Input placeholder="请输入URL" allowClear />
</Item>}
<Item
label="调度间隔(Cron)"
name="Interval"
rules={[{ required: true, message: '请输入间隔' }]}
>
<div className={styles.predict}>
<Input placeholder="请输入间隔" allowClear onChange={(value) => inputInterval(value)} value={Intervals} />
<a className={styles.corn} target="view_window" href="https://cron.qqe2.com/">cron在线生成</a>
</div>
</Item>
<Item
label="描述"
name="Describe"
>
<TextArea placeholder="可输入描述信息" rows={4} allowClear />
</Item>
</Form>
)}
</Spin>
</Modal>
);
};
export default AddModal;
import { Space, Table, Button, Popconfirm, notification ,Spin} from 'antd';
import React, { useState, useEffect } from 'react';
import styles from './taskScheduling.less'
import {
deleteTaskOptions, taskOptionsList, getIotDeviceType
} from '@/services/intelligence/api';
import AddModal from './AddModal'
const VectorData = props => {
const [treeLoading, setTreeLoading] = useState(false);// 弹窗显示
const [tileData, setTileData] = useState([]); // table表格数据
const [visible, setVisible] = useState(false); // 弹窗
const [deviceType, setDeviceType] = useState([]); //设备类型列表
const [flag, setFlag] = useState(0); // 更新list
const [type, setType] = useState(''); // 弹窗类型
const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({});
const columns = [
{
title: '序号',
align: 'center',
render: (text, record, index) => (
<Space>
<span>{(index + 1)}</span>
</Space>
)
},
{
title: '任务名称',
dataIndex: 'TaskName',
key: 'TaskName',
align: 'center'
},
{
title: '状态',
dataIndex: 'Status',
key: 'Status',
align: 'center'
},
{
title: '任务类型',
dataIndex: 'TaskType',
key: 'TaskType',
align: 'center'
},
{
title: '间隔',
dataIndex: 'Interval',
key: 'Interval',
align: 'center'
},
{
title: '描述',
dataIndex: 'Describe',
key: 'Describe',
align: 'center'
},
{
title: '编辑',
align: 'center',
render: (text, record, index) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
changeRecord(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该任务?"
okText="确认"
cancelText="取消"
onConfirm={() => {
delConfirm(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const onSubmit = prop => {
setVisible(false);
setFlag(flag + 1)
};
const delConfirm = (record) => {
deleteTaskOptions([record]).then(res => {
if (res.errMsg === '') {
setFlag(flag + 1)
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.errMsg,
});
};
})
}
//编辑任务调度
const changeRecord = (record) => {
setType('edit');
setFormObj(record);
setVisible(true);
}
const handleAdd = () => {
setType('add');
setVisible(true);
}
useEffect(() => {
renderTile();
}, [flag]);
// 获取任务列表及设备类型及编码数据
const renderTile = () => {
setTreeLoading(true)
const getIotDevice = getIotDeviceType()
const taskOption = taskOptionsList()
Promise.all([getIotDevice, taskOption]).then(res => {
res[0].getMe && res[0].getMe.length && setDeviceType(res[0].getMe)
res[1].getMe && res[1].getMe.length && setTileData(res[1].getMe)
setTreeLoading(false)
}).catch(err => {
setTreeLoading(false)
})
}
return (
<>
<Spin tip="loading..." spinning={treeLoading}>
<div className={styles.container}>
<div className={styles.tileBtn}>
<Button type="primary" onClick={() => {
handleAdd();
}} >
新增
</Button>
</div>
<Table
columns={columns}
dataSource={tileData}
bordered
rowKey="TaskName"
scroll={{ y: 600 }}
pagination={{
pageSize: '10' ,
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}}
>
</Table>
<AddModal
visible={visible}
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
type={type}
deviceType={deviceType}
formObj={formObj}
solutionNames={solutionNames}
/>
</div>
</Spin>
</>
)
}
export default VectorData
\ No newline at end of file
.container{
width: 100%;
height: 100%;
background-color: #ffffff;
}
.predict{
display: flex;
align-items: flex-end;
justify-content: space-between;
width: 100%;
}
.tileBtn{
display: flex;
justify-content: flex-end;
width: 100%;
padding: 2rem 1rem 2rem 0;
}
.corn{
cursor: pointer;
margin-left:1rem;
text-decoration: underline;
width: 8rem;
}
\ No newline at end of file
import React, { useEffect, useState } from 'react'
import PageContainer from '@/components/BasePageContainer';
import { Card, Form, Input, Button, Switch, message } from 'antd'
import { GetAuthSet, AuthSetting } from '@/services/database/api'
import styles from './index.less'
const AuthControl = () => {
const [flag,setFlag] = useState(0)
const [auChecked, setAuChecked] = useState()
const [cacheChecked, setCacheAuChecked] = useState()
useEffect(() => {
GetAuthSet().then(
res => {
if (res.code === 0) {
setAuChecked(res.data.IsOpenAuth)
setCacheAuChecked(res.data.IsUseCache)
}
}
)
}, [flag])
const loadConfig = () => {
}
const operateControl = value => {
AuthSetting({
IsOpenAuth:value
}).then(
res =>{
if(res.code === 0){
setFlag(flag + 1)
message.success("设置成功!")
}
}
)
}
return (
<>
<PageContainer>
<div style={{display:"flex",flexWrap:"wrap"}}>
<Card title="数据管理" style={{ width: 350, marginLeft: 15 }}>
<div className={styles.auth_container}>
<div className={styles.operate_item}>
<div>数据库鉴权</div>
<Switch checkedChildren='开启' unCheckedChildren='关闭' checked={auChecked} onChange={operateControl} />
</div>
</div>
</Card>
<Card title="缓存管理" style={{ width: 350, marginLeft: 15 }}>
<div className={styles.auth_container}>
<div className={styles.operate_item}>
<div>开启缓存</div>
<Switch checkedChildren='开启' unCheckedChildren='关闭' checked={cacheChecked} disabled={true} />
</div>
</div>
</Card>
</div>
</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 {
Form,
Modal,
Space,
Table,
Button,
Popconfirm,
Spin,
notification,
Tooltip,
} from 'antd';
import { Form, Modal, Space, Table, Button, Popconfirm, Spin, notification, Tooltip } from 'antd';
import {
EditOutlined,
DeleteOutlined,
......@@ -17,16 +7,12 @@ import {
PlusSquareOutlined,
RollbackOutlined,
} from '@ant-design/icons';
import {
reloadTableFields,
removeFields,
loadUnattachedTables,
} from '@/services/platform/bs';
import { reloadTableFields, removeFields, loadUnattachedTables } from '@/services/platform/bs';
import { useHistory } from 'react-router-dom';
import FieldEditor from './fieldEditor';
import styles from './index.less';
import AffiliateAdd from '../bsmanager/tablemanager/components/Field/affiliateAdd';
import LoadGroup from '../bsmanager/tablemanager/components/Field/loadGroupNew';
import AffiliateAdd from '../components/Field/affiliateAdd';
import LoadGroup from '../components/Field/loadGroupNew';
const AddModal = props => {
const history = useHistory();
const [allData, setAllData] = useState([]);
......@@ -78,9 +64,7 @@ const AddModal = props => {
width: 190,
align: 'left',
render: (text, record) => (
<div style={{ paddingLeft: '2rem', color: styleConfig(record) }}>
{text}
</div>
<div style={{ paddingLeft: '2rem', color: styleConfig(record) }}>{text}</div>
),
},
{
......@@ -89,9 +73,7 @@ const AddModal = props => {
key: 'alias',
align: 'center',
width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
},
{
title: '字段类型',
......@@ -99,9 +81,7 @@ const AddModal = props => {
key: 'storeType',
align: 'center',
width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
},
{
title: '形态',
......@@ -109,9 +89,7 @@ const AddModal = props => {
key: 'shape',
align: 'center',
width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
},
{
title: '配置',
......@@ -119,9 +97,7 @@ const AddModal = props => {
key: 'config',
align: 'center',
width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
},
{
......@@ -130,9 +106,7 @@ const AddModal = props => {
key: 'readOnly',
align: 'center',
width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
},
{
title: '同步',
......@@ -140,9 +114,7 @@ const AddModal = props => {
key: 'syncEvent',
align: 'center',
width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
render: (text, record) => <span style={{ color: styleConfig(record) }}>{text} </span>,
},
{
title: '操作',
......@@ -171,9 +143,7 @@ const AddModal = props => {
}}
>
<Tooltip title="删除">
<DeleteOutlined
style={{ fontSize: '16px', color: '#e86060' }}
>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }}>
删除
</DeleteOutlined>
</Tooltip>
......@@ -206,8 +176,7 @@ const AddModal = props => {
);
};
const setRowClassName = record =>
Object.entries(record).toString() ===
Object.entries(selectTableName).toString()
Object.entries(record).toString() === Object.entries(selectTableName).toString()
? styles.clickRowStyle
: '';
const columns = [
......@@ -398,18 +367,10 @@ const AddModal = props => {
<div className={styles.config}>
<div className={styles.title}>{formObj}(字段配置)</div>
<div className={styles.btn}>
<Button
type="primary"
icon={<PlusSquareOutlined />}
onClick={add}
>
<Button type="primary" icon={<PlusSquareOutlined />} onClick={add}>
附加
</Button>
<Button
type="primary"
icon={<SortDescendingOutlined />}
onClick={sort}
>
<Button type="primary" icon={<SortDescendingOutlined />} onClick={sort}>
分组排序
</Button>
<Button type="primary" icon={<RollbackOutlined />} onClick={back}>
......
......@@ -49,7 +49,7 @@ import styles from './incident.less';
import ChangeAdd from './changeAdd';
import ChangeEdit from './changeEdit';
import ChangeImage from './ChangeImage';
import ModalDrag from '../maintenance/ModalDrag';
import ModalDrag from '../../maintenance/ModalDrag';
import { PlusOutlined, DownOutlined, InfoCircleOutlined } from '@ant-design/icons';
import { set } from 'immutable';
import { getRoleGroup } from '@/services/userCenter/roleManage/api';
......
This diff is collapsed.
.dictionaryContainer{
.font {
font-weight: bold;
}
.containerBox {
width: 100vm;
height: calc(100vh - 70px) ;
background: #ffffff;
.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{
margin-left: 0;
}
.ant-table.ant-table-bordered > .ant-table-container{
border: none;
}
.clickRowStyle{
background: #cfe7fd;
}
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
}
.config{
display: flex;
padding: 1rem 0 0.5rem 0.5rem;
justify-content: space-between;
width: calc(100% - 10px);
.title{
font-size: 18px;
color: rgba(0, 114, 255, 1);
font-weight: bold;
}
.btn{
display: flex;
justify-content: flex-end;
width: 20rem;
}
.ant-btn{
display: flex;
align-items: center;
margin-left: 20px;
}
}
}
\ No newline at end of file
.dictionary1Container{
.ant-card-body {
padding: 0px 24px 24px 17px;
}
}
\ No newline at end of file
/*
* @Description:
* @Author: leizhe
* @Date: 2021-07-13 16:32:28
* @LastEditTime: 2021-10-26 16:38:27
* @LastEditors: leizhe
*/
import React from 'react';
import { Tabs, Card } from 'antd';
import PageContainer from '@/components/BasePageContainer';
import WebDic from './WebDic';
import AppDic from './AppDic';
import styles from './index.less';
// import VersionPublish from './VersionPublish';
const dictionary1 = () => {
const { TabPane } = Tabs;
return (
<PageContainer className={styles.dictionary1Container}>
<Card>
<Tabs defaultActiveKey="1">
<TabPane tab="通用数据字典" key="1">
<WebDic />
</TabPane>
<TabPane tab="App数据字典" key="2">
<AppDic />
</TabPane>
</Tabs>
</Card>
</PageContainer>
);
};
export default dictionary1;
.dictionary1Container{
.ant-card-body {
padding: 0px 24px 24px 17px;
}
}
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { Card, TreeSelect, Space, Button, Table, Input, Row, Col } from 'antd';
import PageContainer from '@/components/BasePageContainer';
import { connect } from 'react-redux';
import TestModal from './ModalComponent';
import ListCard from './ListCard';
import { get, post, CITY_SERVICE } from '../../services';
import { orgGet, orgTest } from '../../services/orgnazation/api';
import styles from './DefaultComponent.less';
const { Search } = Input;
const { TreeNode } = TreeSelect;
// const treeData = [
// {
// title: 'Node1',
// value: '0-0',
// children: [
// {
// title: 'Child Node1',
// value: '0-0-1',
// },
// {
// title: 'Child Node2',
// value: '0-0-2',
// },
// ],
// },
// {
// title: 'Node2',
// value: '0-1',
// },
// ];
const DefaultComponent = () => {
const [treeValue, setTreeValue] = useState(null); // 树节点选中的值
const [tableData, setTableData] = useState([]); // table的值
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // table表格checkbox配置
const [modalVisible, setModalVisible] = useState(false); // 展示Modal弹窗
const [testPeoList, setTestPeoList] = useState([]); // 测试card数组
const [treeData, setTreeData] = useState([]);
// 树节点选中的值
const treeChange = e => {
setTreeValue(e);
};
// 用户搜索
const handleSearch = () => {
console.log('handleSearch');
setModalVisible(true);
};
// 导入
const handleImport = () => {
setModalVisible(true);
};
// 搜索框时间
const inputSearch = e => {
console.log(e, 'inputSearch');
};
const columns = [
{
title: '用户ID',
dataIndex: 'userID',
key: 'userID',
},
{
title: '登录名',
dataIndex: 'loginName',
key: 'loginName',
},
{
title: '用户姓名',
dataIndex: 'userName',
key: 'userName',
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
},
{
title: '钉钉账户',
dataIndex: 'ddid',
key: 'ddid',
},
{
title: '微信账户',
dataIndex: 'wxid',
key: 'wxid',
ellipsis: true,
},
];
useEffect(() => {
orgGet().then(res => {
console.log(res, 'orgGet');
if (res) {
let arr = transTree(res);
console.log(transTree(res), 'arr');
setTreeData(arr);
}
});
}, []);
// 处理返回的树形结构
const transTree = (value, isChild = false) => {
let arr = value;
if (arr.length < 0) {
return;
}
let obj = {};
return arr.map(item => {
if (isChild) {
item.title = item.userName;
item.value = item.userID;
} else {
item.title = item.text;
item.value = item.id;
}
if (item.children && item.children.length > 0) {
transTree(item.children, false);
return (obj = item);
}
return item;
});
};
useEffect(() => {
get('${CITY_SERVICE}/OMS.svc/U_GetOneOUUserListNew', {
OUID: 24,
_version: 9999,
_dc: new Date().getTime(),
}).then(res => {
if (res.success) {
setTableData(res.root);
}
});
const testData = [];
const test2list = [];
for (let i = 1; i < 10; i++) {
testData.push({
key: i,
ID: i,
});
test2list.push({
label: `${i}测试`,
value: `${i}测试`,
});
}
console.log(test2list);
setTestPeoList(test2list);
}, []);
// table选中框的值
const selectChange = e => {
console.log(e, 'e');
setSelectedRowKeys(e);
};
const confirmModal = () => {
setModalVisible(false);
};
// table复选的配置
const rowSelection = {
selectedRowKeys,
onChange: selectChange,
};
const btnLable = [
{
label: '查找用户',
handle: handleSearch,
config: { type: 'primary', danger: true },
},
{ label: '用户导入', handle: handleImport, config: { type: 'info' } },
];
return (
<>
<PageContainer>
<Card>
<Row>
<Col span={1}>
<div style={{ height: '30px', lineHeight: '30px' }}>机构选择</div>
</Col>
<Col span={12}>
<TreeSelect
style={{ width: '50%' }}
treeData={treeData}
value={treeValue}
onChange={e => {
treeChange(e);
}}
/>
</Col>
<Col span={8} />
</Row>
<div style={{ marginTop: '20px', textAlign: 'center' }}>
<Space>
{btnLable &&
btnLable.map((item, index) => {
const { config } = item;
return (
<Button
key={index}
{...config}
onClick={() => {
item.handle &&
typeof item.handle === 'function' &&
item.handle();
}}
>
{item.label}
</Button>
);
})}
</Space>
</div>
<TestModal
title="用户选择"
visible={modalVisible}
maskClosable
onOk={() => confirmModal()}
onCancel={() => setModalVisible(false)}
bodyStyle={{ width: '100%', height: '100%' }}
style={{ top: 20 }}
width="1000px"
destroyOnClose
cancelText="取消"
okText="确认选择"
>
<ListCard optionsList={testPeoList} />
</TestModal>
</Card>
<Card className={styles.mgTop20}>
<div classNam={styles.tableTitle}>一般用户的用户列表</div>
<Table
className={styles.mgTop20}
rowSelection={rowSelection}
columns={columns}
dataSource={tableData}
bordered
rowKey="userID"
scroll={{ y: 400 }}
/>
</Card>
</PageContainer>
</>
);
};
export default connect()(DefaultComponent);
.tableTitle{
font-size: 16px;
}
.mgTop20{
margin-top: 20px !important;
}
import React, { useState, useEffect, useCallback } from 'react';
import { Spin, Button } from 'antd';
import ListCardItem from './listCardItem';
import { get, post, CITY_SERVICE } from '../../services';
import styles from './listCardItem.less';
const tip = 'loading...';
const ListCard = props => {
const {
ouid,
searchWord,
valueCallback,
onCommit = () => {},
btnLoading = false,
} = props;
const [valueList, setValueList] = useState({});
const [dataList, setdataList] = useState([]);
const [loading, setLoading] = useState(true);
const getValueCallback = useCallback((value, index) => {
valueList[index] = value;
setValueList({ ...valueList });
valueCallback({ ...valueList });
}, []);
useEffect(() => {
setLoading(true);
const defaultConfig = {
optionsList: [],
title: '默认组',
id: '',
};
// ${CITY_SERVICE}/OMS.svc/U_GetUserListForBatchOper
get(`${CITY_SERVICE}/OMS.svc/P_GetUserByStation`, {
// OUID:ouid||'',
stationID: ouid || '',
_version: 9999,
_dc: new Date().getTime(),
})
.then(res => {
setLoading(false);
const list = [];
// eslint-disable-next-line no-unused-expressions
res &&
res.forEach(item => {
list.push({ ...defaultConfig, ...item });
});
setdataList(list);
})
.catch(err => {
console.error(err);
setLoading(false);
});
}, [ouid]);
return (
<div>
{loading ? (
<Spin
size="large"
spinning={loading}
tip={tip}
style={{
position: 'absolute',
top: '30%',
left: '0',
right: '0',
bottom: '0',
}}
/>
) : (
dataList &&
dataList.length > 0 &&
dataList.map((item, index) => (
<ListCardItem
{...item}
itemid={index}
key={`item${index}key`}
getValueCallback={getValueCallback}
searchWord={searchWord}
{...props}
/>
))
)}
{true && !loading && dataList && (
<div className={styles.btnBox}>
<Button
type="primary"
onClick={() => onCommit()}
loading={btnLoading}
>
提交
</Button>
</div>
)}
</div>
);
};
export default ListCard;
import React from 'react'
import {
Modal
} from 'antd'
const CardModal = (props) =>{
console.log(props)
const defaultCofig = {
title:'测试',
visible:false,
}
const config = { ...defaultCofig, ...props}
return (
<Modal
{...config}
style={{width:"1000px"}}
>
{props.children}
</Modal>
)
}
export default CardModal
\ No newline at end of file
import React,{ useState, useEffect, } from 'react'
import {
Card,
Input,
Button
} from 'antd';
import PageContainer from '@/components/BasePageContainer';
import { connect } from 'react-redux';
import ProTable from '@ant-design/pro-table';
import { get, post } from '../../services';
const TestTable = ()=> {
const [data,setData] = useState([])
//搜索框时间
useEffect(() =>{
get(`/Cityinterface/rest/services/OMS.svc/S_GetConnRecord`, {
_version: 9999,
dc: 1603334559186,
}).then( res =>{
if(res){
setData(res)
}
console.log(res)
}).catch( err =>{
console.error(err)
})
},[])
const columns = [
{
title: '服务器名或IP地址',
dataIndex: 'ip',
key: 'ip',
},
{
title: '数据库名称',
dataIndex: 'dbName',
key: 'dbName',
},
{
title: '数据库用户名称',
dataIndex: 'userName',
key: 'userName',
},
{
title: '保存时间',
dataIndex: 'saveTime',
key: 'saveTime',
},
{
title: '描述',
dataIndex: 'desc',
key: 'desc',
},
{
title: '修改描述',
dataIndex: 'name',
key: 'name',
filters:true,
valueType: 'dateTime'
// render: () => {
// return <Button type='primary' onClick={ ()=>{changeDesc()}}>修改描述</Button>;
// },
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_, record) => (
<>
<Button
>
修改描述
</Button>
<Button href="">删除</Button>
</>
),
},
];
return (
<>
<PageContainer>
<Card></Card>
<ProTable
style={{marginTop:'20px'}}
headerTitle='表格'
rowKey="key"
search={{labelWidth:100}}
columns={columns}
bordered
dataSource={data}
/>
</PageContainer>
</>
)
}
export default connect()(TestTable)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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