Commit d441b2a8 by zhaochengxiang

修改需求

parents 41846a1d dc2b2d6c
......@@ -6,23 +6,22 @@ import {
import Home from './view/Home';
import Manage from './view/Manage';
import { ContextPath, RedirectHome } from './util';
import { ContextPath, RedirectSignin } from './util';
import Signin from './view/Signin';
export default class App extends React.Component {
render() {
return (
return (
<React.Fragment>
<Router>
<Switch>
<Route path={`${ContextPath}/signin`} component={Signin} exact />
<Route path={`${ContextPath}/login`} component={Signin} exact />
<Route path={`${ContextPath}/manage`} exact component={() => <Redirect to={`${ContextPath}/manage/assets`} />} />
<Route path={`${ContextPath}/user`} exact component={() => <Redirect to={`${ContextPath}/user/subscrible`} />} />
<Route path={`${ContextPath}/home`} component={Home} />
<Route path={`${ContextPath}/manage`} component={Manage} />
<Route path={`${ContextPath}/user`} component={Manage} />
<Route component={RedirectHome} />
<Route component={() => <Redirect to={`${ContextPath}/login`} />}/>
</Switch>
</Router>
</React.Fragment>
......
......@@ -29,3 +29,12 @@ code {
monospace;
}
.apply-file-label .ant-form-item-label > label::after{
display: none
}
.apply-file-label > .apply-file-span::after{
content: ':';
// position: relative;
// top: -0.5px;
margin: 0 8px 0 2px;
}
......@@ -32,7 +32,7 @@ const _Logout = ({session, isHome, location}) => session ?
<Menu.Item key="SignOut"
onClick={e => dispatchLatest({type: 'user.signout', callback: e => {
message.success('退出成功!')
window.setTimeout(e => Open(`${ContextPath}/signin`, { target: '_self' }), 1000);
window.setTimeout(e => Open(`${ContextPath}/login`, { target: '_self' }), 1000);
}})}>
<Icon type="logout" />
<span>退出登录</span>
......
......@@ -37,7 +37,7 @@ export const routes = [
// }
{
name: 'file',
text: '文档下载'
text: '规范文档'
},
]
},
......
......@@ -89,7 +89,7 @@ export const SetSource = function (source) {
const callback = resp => {
if (resp.status === 401) {
message.warning("session过期,请重新登录!");
window.setTimeout(args => Open(`${ContextPath}/signin`, { target: '_self' }), 2000);
window.setTimeout(args => Open(`${ContextPath}/login`, { target: '_self' }), 2000);
return null;
}
else if (resp.status !== 200) {
......
......@@ -28,7 +28,7 @@ export const ConvertToRouteMap = function (routes, pPath, pRoute) {
export const RedirectHome = () => <Redirect to={`${ContextPath}/home`} />
export const RedirectSignin = () => <Redirect to={`${ContextPath}/signin`} />
export const RedirectSignin = () => <Redirect to={`${ContextPath}/login`} />
export const Open = function (url, args) {
const { target = '_blank' } = args || {};
......@@ -57,12 +57,12 @@ export class GetSession extends React.Component {
action({ type: set_sess_state, args: session })
} else {
action({ type: set_sess_state, args: { referer: location.pathname } })
history.push(`${ContextPath}/signin`);
history.push(`${ContextPath}/login`);
}
},
error: () => {
action({ type: set_sess_state, args: { referer: location.pathname } })
history.push(`${ContextPath}/signin`);
history.push(`${ContextPath}/login`);
}
})
}
......
......@@ -64,7 +64,7 @@ export default class ListBox extends Component {
<Col md={12}> <Text>文件名:</Text> {item.name} </Col>
<Col md={12}> <Text>文件类型:</Text> {item.file_type} </Col>
<Col md={12}> <Text>发布者:</Text> {item.create_user} </Col>
<Col md={12}> <Text>发布作者</Text> {this.getMyDate(item.create_date)} </Col>
<Col md={12}> <Text>发布日期</Text> {this.getMyDate(item.create_date)} </Col>
</Row>
</React.Fragment>
);
......
......@@ -159,12 +159,12 @@ class Assets extends Component {
}
>
<Row gutter={16} className="manage-asset">
<Col md={6} >
<Col md={5} >
<Card bordered={false} className='asset-table'>
<SyncTree bodyHeight={'100%'} gData={gData} dataList={dataList} onClick={this.selectTree} defaultKeys={defaultKeys} selectKey={selectKey} loading={treeload} build={bulidTree} />
</Card>
</Col>
<Col md={18}>
<Col md={19}>
<Card bordered={false} className='asset-table'>
<ListBox
loading={tableload}
......
......@@ -159,19 +159,19 @@ class AssetListCOM extends Component {
const ListContent = ({ item }) => (
<React.Fragment>
<Row>
<Col md={6}>
<Col md={8}>
<Text>所属部门:</Text>
{item.departMent}
{item.department}
</Col>
<Col md={6}>
<Col md={8}>
<Text>更新周期:</Text>
{item.updateCycle}
</Col>
<Col md={6}>
{/* <Col md={6}>
<Text>发布时间:</Text>
{item.createTime_str}
</Col>
<Col md={6}>
</Col> */}
<Col md={8}>
<Text>所属系统:</Text>
{item.system}
</Col>
......@@ -210,7 +210,7 @@ class AssetListCOM extends Component {
<span dangerouslySetInnerHTML={{ __html: item.remarks }} />
</Col>
<Col md={6}>
{item.expireDate && <Text>失效时间:</Text>}
{item.expireDate && <Text>数据验收确认时间:</Text>}
{item.expireDate}
</Col>
</Row>
......@@ -357,6 +357,7 @@ class AssetListCOM extends Component {
onCancel={e => {
this.setState({ showModal: false });
}}
footer={null}
>
<DataDetail
tableModel={tableModel}
......
import React, { Component, Fragment, useState } from 'react';
import { Table, Descriptions, Row, Col, Input, Checkbox, Divider, Pagination, Form, DatePicker, Button, message, Upload } from 'antd';
import { Table, Descriptions, Row, Col, Input, Checkbox, Divider, Pagination, Form, DatePicker, Button, message, Upload, Tooltip, Icon } from 'antd';
import classnames from 'classnames';
import { CheckOutlined } from '@ant-design/icons';
......@@ -103,45 +103,49 @@ export class DataDetail extends Component {
const { tableModel, showApplyButton, isAppling, onApply } = this.props;
return (
<Descriptions size="small" column={3}>
<Descriptions.Item label="资产名称">
<span dangerouslySetInnerHTML={{ __html: `${tableModel.name}` }} />
</Descriptions.Item>
<Descriptions.Item label="所属目录">{tableModel.catalog}</Descriptions.Item>
<Descriptions.Item label="所属系统">{tableModel.system}</Descriptions.Item>
<Descriptions.Item label="发布时间">{tableModel.createTime_str}</Descriptions.Item>
{/* <Descriptions.Item label="资产密级">{tableModel.assetStrictLevel_}</Descriptions.Item> */}
<Descriptions.Item label="更新周期">{tableModel.updateCycle}</Descriptions.Item>
{/* <Descriptions.Item label="表内容及业务含义">{metaData.business}</Descriptions.Item> */}
<Descriptions.Item label="数据周期">{tableModel.dataCycle}</Descriptions.Item>
{/* <Descriptions.Item label="数据更新特点">{metaData.updateFeature}</Descriptions.Item>
<Descriptions.Item label="主题域">{metaData.domain}</Descriptions.Item>
{metaData.hasOwnProperty('leaderInfo') && (
<Descriptions.Item label="负责人">{metaData.leaderInfo}</Descriptions.Item>
)} */}
<Descriptions.Item label="描述">
<span
dangerouslySetInnerHTML={{
__html: tableModel.remarks ? tableModel.remarks : '无',
}}
/>
</Descriptions.Item>
{
showApplyButton&&<Descriptions.Item>
<div>
<Descriptions size="small" column={3}>
<Descriptions.Item label="资产名称">
<span dangerouslySetInnerHTML={{ __html: `${tableModel.name}` }} />
</Descriptions.Item>
<Descriptions.Item label="所属目录">{tableModel.catalog}</Descriptions.Item>
<Descriptions.Item label="所属系统">{tableModel.system}</Descriptions.Item>
<Descriptions.Item label="发布时间">{tableModel.createTime_str}</Descriptions.Item>
{/* <Descriptions.Item label="资产密级">{tableModel.assetStrictLevel_}</Descriptions.Item> */}
<Descriptions.Item label="更新周期">{tableModel.updateCycle}</Descriptions.Item>
{/* <Descriptions.Item label="表内容及业务含义">{metaData.business}</Descriptions.Item> */}
<Descriptions.Item label="数据周期">{tableModel.dataCycle}</Descriptions.Item>
{/* <Descriptions.Item label="数据更新特点">{metaData.updateFeature}</Descriptions.Item>
<Descriptions.Item label="主题域">{metaData.domain}</Descriptions.Item>
{metaData.hasOwnProperty('leaderInfo') && (
<Descriptions.Item label="负责人">{metaData.leaderInfo}</Descriptions.Item>
)} */}
<Descriptions.Item label="描述">
<span
className={ classnames('pointer', isAppling?'text-warning':'text-primary') }
onClick={e => {
e.preventDefault();
if (onApply) {
onApply();
}
dangerouslySetInnerHTML={{
__html: tableModel.remarks ? tableModel.remarks : '无',
}}
>
字段申请
</span>
</Descriptions.Item>
}
</Descriptions>
</Descriptions>
{
showApplyButton&&<Button
type={isAppling?'':'primary'}
style={{height:30,marginBottom:8,}}
onClick={e => {
e.preventDefault();
if (onApply) {
onApply();
}
}}
>
申请授权
</Button>
}
</div>
);
}
}
......@@ -181,12 +185,22 @@ const ApplyDescFunc = ({ dataDesc, form, apply }) => {
let options = [];
options = dataSource.map((o,i) => {
return {
label: o.name,
label: o.displayName,
value: o.ordinalPosition,
};
});
const normFile = e => {
console.log(e)
const isLt20M = e.file.size / 1024 / 1024 < 20;
const isJPG = e.file.type === 'image/jpeg';
const isPNG = e.file.type === 'image/png';
if (!isLt20M) {
return
}
if(!(isJPG || isPNG)){
return
}
let data = []
if(e.fileList[0]){
data = e.fileList.slice(-1)
......@@ -197,19 +211,25 @@ const ApplyDescFunc = ({ dataDesc, form, apply }) => {
const props = {
beforeUpload: file => {
const isLt20M = file.size / 1024 / 1024 < 20;
const isJPG = file.type === 'image/jpeg';
const isPNG = file.type === 'image/png';
if (!isLt20M) {
return message.error('上传文件不能超过 20MB!')
message.error('上传文件不能超过 20MB!')
return false
}
return false;
if(!(isJPG || isPNG)){
message.error('上传格式错误')
return false
}
return false
},
};
return (
<Fragment>
<Row>
<Col md={4}><h3>字段概览</h3></Col>
<Col md={20} className='text-right pt-4'>
<Col md={4} style={{lineHeight:'32px'}}><h3>字段概览</h3></Col>
<Col md={20}>
<Search
placeholder="请输入字段过滤"
style={{ width: 200 }}
......@@ -272,12 +292,14 @@ const ApplyDescFunc = ({ dataDesc, form, apply }) => {
rules: [{ required: true, message: '请填写申请说明' }],
})(<Input.TextArea placeholder="申请说明" />)}
</Form.Item>
<Form.Item label="结束时间">
<Form.Item label={<span>数据验收确认时间 <Tooltip overlayStyle={{maxWidth:"100%"}} title={<span style={{whiteSpace:"nowrap"}}>申请该接口后,用户确认接口数据无异常时间节点</span>}><Icon type="question-circle"></Icon></Tooltip></span>}>
{getFieldDecorator('expire', {
rules: [{ required: true, message: '请选择结束时间' }],
})(<DatePicker />)}
</Form.Item>
<Form.Item label="附件" >
<Form.Item className="apply-file-label" label={<span ><span className="apply-file-span">附件</span><span style={{margin: '0 8px 0 2px'}}>:</span><span style={{fontSize:12,color:'rgba(0,0,0,.45)',width:300, wordWrap: 'break-word',wordBreak: 'break-all'}}>请上传线下数据中台接口申请表记录图片(信息中心已签字确认),申请表可在 数据管理》规范文档中下载,本附件仅支持JPG或者PNG格式</span></span>} >
{getFieldDecorator('file', {
rules: [{ required: true, message: '请上传附件'}],
valuePropName: 'fileList',
......@@ -295,7 +317,6 @@ const ApplyDescFunc = ({ dataDesc, form, apply }) => {
message.error('请选择下列字段');
return;
}
if (!err) {
if (apply) {
set_keyword({ keyword: ''});
......
......@@ -40,13 +40,13 @@ class AssetTreeCOM extends Component {
return (
<Card bordered={false} className="asset-tree">
{treeData ? (
<Tree
<Tree.DirectoryTree
defaultExpandedKeys={['0-0']}
defaultSelectedKeys={['0-0']}
onSelect={this.onSelect}
>
{getTreeNodes(treeData)}
</Tree>
</Tree.DirectoryTree>
) : (
<Spin />
)}
......
......@@ -77,10 +77,10 @@ class Assets extends Component {
}
>
<Row gutter={10} className="manage-asset">
<Col md={6}>
<Col md={5}>
<AssetTreeCOM treeData={treeData} onSelect={this.getList} />
</Col>
<Col md={18}>
<Col md={19}>
<Card bordered={false} className='asset-table'>
<AssetListCOM
loading={loading}
......
......@@ -35,10 +35,7 @@ class Manage extends Component {
content={
session && session.userId ? (
<Switch>
<Route
path={`${match.path}/search`}
component={Search}
/>
<Route path={`${match.path}/search`} component={Search} />
<Route path={`${match.path}/assets`} component={Assets} />
<Route path={`${match.path}/metadata`} component={Metadata} />
<Route path={`${match.path}/indicator`} component={Indicator} />
......
......@@ -115,6 +115,7 @@ export default class MetadataListCOM extends Component {
onCancel={e => {
this.setState({ showModal: false });
}}
footer={null}
>
<DataDetail tableModel={tableModel}/>
<Tabs
......
......@@ -151,13 +151,14 @@ class MetadataTreeCOM extends Component {
</Row>
<Row>
{treeData ? (
<Tree
<Tree.DirectoryTree
showLine
expandedKeys={expandedKeys}
selectedKeys={selectedKeys}
loadData={this.onLoadData}
treeData={treeData}
onSelect={this.onTreeSelect}
showLine={false}
/>
) : (
<Spin />
......
......@@ -67,10 +67,10 @@ export default class Indicator extends Component {
}
>
<Row gutter={10} className="indicator-container" >
<Col md={6}>
<Col md={5}>
<MetadataTreeCOM type="IndicatorCatalog" onSelect={this.onTreeSelect} />
</Col>
<Col md={18}>
<Col md={19}>
<Card bordered={false}>
<MetadataListCOM
loading={loading}
......
......@@ -66,10 +66,10 @@ export default class Standard extends Component {
}
>
<Row gutter={16}>
<Col md={6}>
<Col md={5}>
<MetadataTreeCOM type="StandardCatalog" onSelect={this.onTreeSelect} />
</Col>
<Col md={18}>
<Col md={19}>
<Card bordered={false}>
<MetadataListCOM
loading={loading}
......
......@@ -134,10 +134,10 @@ export default class ListBox extends Component {
const ListContent = ({ item }) => (
<React.Fragment>
<Row>
<Col md={6}> <Text>所属部门:</Text> {item.departMent} </Col>
<Col md={6}> <Text>更新周期:</Text> {item.updateCycle} </Col>
<Col md={6}> <Text>发布时间:</Text> {item.createTime_str} </Col>
<Col md={6}> <Text>所属系统:</Text> {item.system} </Col>
<Col md={8}> <Text>所属部门:</Text> {item.department} </Col>
<Col md={8}> <Text>更新周期:</Text> {item.updateCycle} </Col>
{/* <Col md={6}> <Text>发布时间:</Text> {item.createTime_str} </Col> */}
<Col md={8}> <Text>所属系统:</Text> {item.system} </Col>
</Row>
<Row>
<Col md={18}> <Text>资产名称:</Text> <span dangerouslySetInnerHTML={{ __html: item.name }} /> </Col>
......@@ -145,7 +145,7 @@ export default class ListBox extends Component {
<Row>
<Col md={18}> <Text>资产备注:</Text> <span dangerouslySetInnerHTML={{ __html: item.remarks }} /> </Col>
<Col md={6}>
{item.expireDate && <Text>失效时间:</Text>}
{item.expireDate && <Text>数据验收确认时间:</Text>}
{item.expireDate}
</Col>
</Row>
......@@ -199,11 +199,7 @@ export default class ListBox extends Component {
onCancel={e => {
this.setState({ showModal: false });
}}
footer={
<div>
<Button type="primary" onClick={e => { this.setState({ showModal: false, }); }}>关闭</Button>
</div>
}
footer={null}
>
<DetailBox
tableModel={tableModel}
......
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