Commit f64ac3d1 authored by wang-xuan-chuan's avatar wang-xuan-chuan

三阶段任务-前端

parent 6238ddc3
const proxy = {
'/baseURI': {
target: 'http://172.16.10.72:10005/',
pathRewrite: { '^/baseURI': '' }
// '/baseURI': {
// target: 'http://172.16.10.72:10005/',
// pathRewrite: { '^/baseURI': '' }
// },
// '/bizURI/openapi': {
// target: 'http://172.16.3.3:11001/',
// pathRewrite: { '^/bizURI': '' }
// },
// '/bizURI': {
// // target: 'http://172.16.3.20:11100/', // 苏
// // target: 'http://172.16.3.89:11100/', // 田
// target: 'http://172.16.10.72:10005/',
// // target: 'http://172.16.3.20:8807/', // 田
// // target: 'http://172.16.3.89:11000/', // 田
// // target: 'http://113.134.211.174:10005/', // 李
// // target: 'http://172.16.3.41:11100/', // 唐
// // target: 'http://172.16.3.4:11100/', // 陈
// pathRewrite: { '^/bizURI': '' }
// },
'/baseURI':{
target:'http://localhost:30201',
changeOrigin:true,
pathRewrite:{'^/baseURI':''}
},
'/bizURI/openapi': {
target: 'http://172.16.3.3:11001/',
pathRewrite: { '^/bizURI': '' }
'/bizURI/jcs':{
target:'http://localhost:30201',
pathRewrite:{'^/bizURI':''}
},
'/bizURI': {
// target: 'http://172.16.3.20:11100/', // 苏
// target: 'http://172.16.3.89:11100/', // 田
target: 'http://172.16.10.72:10005/',
// target: 'http://172.16.3.20:8807/', // 田
// target: 'http://172.16.3.89:11000/', // 田
// target: 'http://113.134.211.174:10005/', // 李
// target: 'http://172.16.3.41:11100/', // 唐
// target: 'http://172.16.3.4:11100/', // 陈
pathRewrite: { '^/bizURI': '' }
'/bizURI':{
target:'http://localhost:30201',
changeOrigin:true,
pathRewrite:{'^/bizURI':''}
},
// '/baseURI':{
// target:'http://172.24.139.74:30201',
// changeOrigin:true,
// pathRewrite:{'^/baseURI':''}
// },
// '/bizURI/jcs':{
// target:'http://172.24.139.74:30201',
// pathRewrite:{'^/bizURI':''}
// },
// '/bizURI':{
// target:'http://172.24.139.74:30201',
// changeOrigin:true,
// pathRewrite:{'^/bizURI':''}
// },
'/bizURI/video': {
target: 'http://172.16.3.39:7900/',
pathRewrite: { '^/bizURI': '' }
......
......@@ -2,9 +2,10 @@ import { chainModResult } from 'amos-viz/lib/widgets/modLoader';
import './index.scss';
import './cssvar.scss';
import Shifting from './siftingSort';
const IMods = [
...Shifting
];
export default chainModResult(IMods).mods;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Tabs, TagSelect, StdFormRow, CardPane} from 'amos-framework';
import { Row, Col } from 'amos-framework';
import { getSortSences } from './api';
const { TabList, Tab, TabPanel } = Tabs;
const sences = ['全部', '新能源', '水利环境', '医疗健康', '智慧城市', '智慧园区', '企业运营', '物流仓库', '生产制造', '其他']
const miniSences = ['综合排序', '热门推荐', '最新发布']
function ListCards({cardItems}) {
const rows = [];
// console.log("传入ListCards中的carditems:")
// console.log(cardItems)
for (let i = 0; i < cardItems.length; i += 4) {
const rowItems = cardItems.slice(i, i + 4);
const cols = rowItems.map((cardItems, index) => (
<Col span={6} key={index}>
<div style={{margin: 30}}>
<CardPane style={{ width: 300 }} bodyStyle={{ padding: 0 }}>
<div>
<img alt="example" width="100%" src="https://tinypng.com/images/apng/panda-waving.png" />
</div>
<div style={{ padding: '10px 16px' }}>
<h2 style={{ margin: 0 }}>{cardItems.name}</h2>
<p style={{ textAlign: 'left', marginTop: '5px' }}>{cardItems.url}</p>
<p style={{ textAlign: 'left', marginTop: '5px' }}>热度指数:{cardItems.times}</p>
<p style={{ textAlign: 'left', marginTop: '5px' }}>{cardItems.agency}</p>
</div>
</CardPane>
</div>
</Col>
));
rows.push(
<Row gutter={16} key={(i + 1) / 4 | 0}>
{cols}
</Row>
);
}
return <div>{rows}</div>
}
class Shifting extends Component {
static propTypes = {
routeState: PropTypes.object,
onBack: PropTypes.func
};
static contextTypes = {
browserHistory: PropTypes.object
};
static defaultProps = {
routeState: {}
};
componentDidMount() {
this.getSenceLists();
}
constructor(props) {
super(props);
this.state = {
mode: 'divider',
cardItems: [],
selectSence: sences[0],
selectMiniSence: miniSences[0]
// mode2: 'line',
// mode3: 'bullet'
};
}
handleBack = () => {
if (this.props.onBack) {
this.props.onBack();
} else {
this.context.browserHistory.goBack();
}
};
handleChange = (value) => {
this.setState({
mode: value
});
}
getSenceLists = () => {
getSortSences(this.state.selectSence, this.state.selectMiniSence).then(response => {
this.setState({
cardItems: response
});
// console.log(this.state.cardItems);
})
}
handleSenecesSubmit = (value) => {
if (value !== '') {
this.setState({
selectSence : value
})
this.getSenceLists();
}
}
handleMiniSenecesSubmit = (value) => {
if (value !== '') {
this.setState({
selectMiniSence : value
})
this.getSenceLists();
}
}
render() {
const {mode} = this.state;
const Option = TagSelect.Option;
// this.getSenceLists();
return (
<div>
<Tabs mode={mode}>
<TabList>
<span>&nbsp;&nbsp;</span>
<Tab>&nbsp;&nbsp;应用模板&nbsp;&nbsp;</Tab>
<Tab>&nbsp;&nbsp;三维模型&nbsp;&nbsp;</Tab>
</TabList>
<TabPanel>
<StdFormRow label="场景" block style={{ paddingBottom: 11 }}>
<TagSelect defaultValue = {sences[0]} data={sences} onChange={this.handleSenecesSubmit} expandable single />
</StdFormRow>
<StdFormRow block style={{ paddingBottom: 11 }}>
<TagSelect defaultValue = {miniSences[0]} data={miniSences} onChange={this.handleMiniSenecesSubmit} expandable single />
</StdFormRow>
<ListCards cardItems={this.state.cardItems}/>
</TabPanel>
<TabPanel>一级选项卡 - 面板2</TabPanel>
</Tabs>
</div>
);
}
}
export default Shifting;
import { request, gateWay } from '@gm/graphmod-utils';
const {
commonGet,
commonPost,
commonPut,
formatUrl,
completePrefix,
commonDelete,
formatObjUrl,
fileDownload,
buildPageable,
} = request;
export const UrlConsts =
{
getSortSencesUrl: () => completePrefix()(gateWay.tool, 'v1/iot/View/select/all'),
};
export const getSortSences = (sences, miniSences) => {
const formData = new window.FormData();
formData.append('sences', sences)
formData.append('miniSences', miniSences)
return commonPost(UrlConsts.getSortSencesUrl(), formData );
};
import Shifting from './Sort';
export default [
{
key: 'tzs-sort', // 筛选缩略图显示页面
component: Shifting
}
];
// @import '../../../../common/theme/index.scss';
@import '~@gm/graphmod-common/src/index.scss';
@import './../index.scss';
.ts-detailscom-basic {
width: 100%;
height: 100%;
overflow: auto;
.ts-detailscom-basic-left {
display: inline-block;
width: 50%;
height: 100%;
padding: 15px 40px 0 32px;
overflow: auto;
vertical-align: top;
border-right: 1px solid $border-color-eaeaea;
}
.ts-detailscom-basic-right {
display: inline-block;
width: 50%;
height: 100%;
overflow: auto;
vertical-align: top;
}
.ts-detailscom-basic-single {
display: inline-block;
width: 50%;
padding: 15px 40px 0 32px;
vertical-align: top;
}
}
......@@ -21,5 +21,7 @@ export default {
ccs: 'ccs', // 消防管控中心
idx: 'idx', // 指标系统
risk: 'risk', // 风险模型
report: 'report' // 数据填报
report: 'report', // 数据填报
tool: 'tool'
};
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