Commit 0fde29fe authored by taabe's avatar taabe Committed by suhuiguang

1.文本预案提交,修改路由

parent 5d9c615c
......@@ -207,9 +207,10 @@ export const FasSerUrl = {
contingencyWaterUrl: completePrefix(baseURI, '/api/risksource/contingency/water'),
configPointEquipmentUrl: completePrefix(baseURI, 'api/firequment/point/batch/bindToEquipment?deviceId={deviceId}&pointIds={pointIds}'),
getPlanTreeUrl: completePrefix(baseURI, 'api/visual/plan/tree'),//获取预案树url
importExcelFireEquipmentUrl: completePrefix(baseURI, 'api/excel/import/fireEquipment'),//导入消防设备
importExcelDataUrl: completePrefix(baseURI, 'api/excel/import/data/excel/{type}'),//导入excel数据type=['fireResource','water']
importExcelFireEquipmentPointUrl: completePrefix(baseURI, 'api/excel/import/fireEquipmentPoint'),
exportExcelFireEquipmentPointUrl: completePrefix(baseURI, 'api/excel/export?exportType=model&modelName=point'),
exportExcelFireEquipmentPointUrl2: completePrefix(baseURI, 'api/excel/export2?exportType={exportType}&modelName={modelName}'),
exportExcelFireEquipmentPointUrl: completePrefix(baseURI, 'api/excel/export?exportType={exportType}&modelName={modelName}'),
queryPointFMEAUrl: completePrefix(baseURI, 'api/risksource/queryFmea/point/{pointId}'),
fileDownloadDocs: completePrefix(baseURI, 'file/download'),//查看文档
lookHtmlTextNavData: completePrefix(baseURI, 'file/lookHtmlTextNav'), //文档转换为html,带导航
......
......@@ -24,16 +24,12 @@ export const customRoutes = [
{ path: 'checkdetail', parent: 'patrolpoint', component: CheckDetail },
{ path: 'differentiateDetail', parent: 'biz', component: DifferentiateDetail },
{ path: 'leaderStruct', parent: 'biz', component: LeaderStruct },
{ path: 'pubview', parent: 'planDrill', component: PlanDrill },
{ path: 'textview', parent: 'planDrill', component: TextPlan },
...parseCusotmRoutes()
];
export const customRoutesPubView = [
{ path: 'pubview', component: PlanDrill },
{ path: 'textview', component: TextPlan }
];
/**
* path mapping
*
......
......@@ -30,11 +30,6 @@ const injectRoutes = menus => {
const consoleChilds = addCustomRoutes(consoleRoutes);
const routes = [
{
path: 'viz3dpub',
component: PublishView,
childRoutes: [...customRoutesPubView]
},
{
path: 'viz3d/:subjectId',
component: Iot3DGraphBiz
},
......
......@@ -53,6 +53,7 @@ import AlarmVideoMonitor from './../view/bizview/alarmVideoMonitor';
import alarmTestView from './../view/bizview/alarm';
import CusVizLib from './../view/planMgmt/cusVizLib';
import RealTimeMonitor from './../view/morphic';
import PublishView from './../view/planMgmt/view';
const Routes = {
// 添加 rules 路由
......@@ -105,7 +106,8 @@ const Routes = {
differentiate: DifferentiateView,
alarmVideoMonitor: AlarmVideoMonitor,
alarmTest: alarmTestView,
vizlib: CusVizLib
vizlib: CusVizLib,
planDrill: PublishView
};
const pageCompontent = key => {
......
.amos-side-pane-wrapper {
.amos-sidepane {
z-index: 10;
z-index: 1;
.record-view-parent {
width: 260px;
......
import React, { Component } from 'react';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import PropTypes from 'prop-types';
import { Select, Button, Input } from 'amos-framework';
import { Store } from 'amos-tool';
import SysConsts from 'amos-processor/lib/config/consts';
import { Select, Button, Input, Upload, message } from 'amos-framework';
import BizIcon from './../../../../common/icon/BizIcon';
import { FasSerUrl } from './../../../../../consts/urlConsts';
const Option = Select.Option;
const lsTool = Store.lsTool;
/**
* 工具栏
......@@ -53,6 +58,34 @@ class FireEquipmentToolBar extends Component {
render() {
let { name } = this.state;
let { enableEdit } = this.props;
let url = formatUrl(FasSerUrl.importExcelDataUrl, { type: 'fireResource' });
const uploadProps = {
name: 'file',
accept: '.xls,.xlsx',
action: url,
showUploadList: false ,
headers: {
'Accept': 'application/json;charset=UTF-8',
'X-Access-Token': lsTool.read(SysConsts.token)
},
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
if (info.file.response.result === 'FAILURE') {
message.danger(info.file.response.message);
} else {
message.success(`${info.file.name} 上传成功`);
}
// this.props.reload();
} else if (info.file.status === 'error') {
message.danger(`${info.file.name} 失败.`);
}
}
};
return (
<div className="fire-truck-toolbar">
<div className="fire-truck-input">
......@@ -77,7 +110,9 @@ class FireEquipmentToolBar extends Component {
enableEdit &&
(
<div className="fire-truck-buttons">
<Button icon={<BizIcon icon="file-upload-2" />} transparent onClick={this.props.import} />
<Upload {...uploadProps}>
<Button icon={<BizIcon icon="daoru" />} transparent />
</Upload>
<Button icon={<BizIcon icon="tianjia" />} transparent onClick={this.props.add} />
<Button icon={<BizIcon icon="xiugai" />} transparent onClick={this.props.edit} />
<Button icon={<BizIcon icon="shanchu" />} transparent onClick={this.props.delete} />
......@@ -90,10 +125,10 @@ class FireEquipmentToolBar extends Component {
}
FireEquipmentToolBar.propTypes = {
import: PropTypes.func,
add: PropTypes.func,
edit: PropTypes.func,
delete: PropTypes.func,
reload: PropTypes.func,
getTableListData: PropTypes.func,
pageConfig: PropTypes.object,
enableEdit: PropTypes.bool
......
......@@ -425,11 +425,10 @@ class MonitorPointConfig extends Component {
form.remove();
}
downLoadExeclFile = () => {
downLoadExeclFile = (exportType) => {
const { searchParam } = this.state;
let exportType = 'data';
let modelName = 'point';
let url = formatUrl(FasSerUrl.exportExcelFireEquipmentPointUrl2, { exportType, modelName });
let url = formatUrl(FasSerUrl.exportExcelFireEquipmentPointUrl, { exportType, modelName });
let queryParamMap = {};
Object.assign(queryParamMap, searchParam);
queryParamMap.pageSize = -1;
......
......@@ -60,6 +60,7 @@ class PointToolBar extends Component {
const uploadProps = {
name: 'file',
accept: '.xls,.xlsx',
action: FasSerUrl.importExcelFireEquipmentPointUrl,
showUploadList: false ,
headers: {
......@@ -102,9 +103,10 @@ class PointToolBar extends Component {
enableEdit &&
(
<div className="fire-truck-buttons">
<Button icon={<Icon icon="ccgl-chukucaozuo-13" prefix="amosicon" color="rgb(52, 95, 166)" />} transparent onClick={this.props.downloadTemp} />
<Button title="导出模板" icon={<Icon icon="ccgl-chukucaozuo-13" prefix="amosicon" color="rgb(52, 95, 166)" />} transparent onClick={() => this.props.downloadTemp('model')} />
<Button title="导出数据" icon={<BizIcon icon="daochu" />} transparent onClick={() => this.props.downloadTemp('data')} />
<Upload {...uploadProps}>
<Button title="导入" icon={<Icon icon="file-upload" prefix="amosicon" color="rgb(52, 95, 166)" />} transparent />
<Button title="导入数据" icon={<BizIcon icon="daoru" />} transparent />
</Upload>
<Button icon={<Icon icon="tools-2" prefix="amosicon" color="rgb(52, 95, 166)" />} transparent onClick={this.props.config} />
<Button icon={<BizIcon icon="tianjia" />} transparent onClick={this.props.add} />
......
......@@ -427,7 +427,6 @@ class FireEquipmentView extends Component {
outterClosable={!_true_}
/>
<FireEquipmentToolBar
import={() => this.import()}
add={() => this.add()}
delete={() => this.delete()}
edit={() => this.edit()}
......
import React, { Component } from 'react';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import PropTypes from 'prop-types';
import { Button, Input } from 'amos-framework';
import { Store } from 'amos-tool';
import SysConsts from 'amos-processor/lib/config/consts';
import { Button, Input, Upload, message } from 'amos-framework';
import BizIcon from './../../../../common/icon/BizIcon';
import { FasSerUrl } from './../../../../../consts/urlConsts';
const lsTool = Store.lsTool;
/**
* 工具栏
......@@ -34,6 +40,30 @@ class FireWaterToolBar extends Component {
render() {
let { name } = this.state;
let { enableEdit } = this.props;
let url = formatUrl(FasSerUrl.importExcelDataUrl, { type: 'water' });
const uploadProps = {
name: 'file',
accept: '.xls,.xlsx',
action: url,
showUploadList: false ,
headers: {
'Accept': 'application/json;charset=UTF-8',
'X-Access-Token': lsTool.read(SysConsts.token)
},
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
message.success(`${info.file.name} 上传成功`);
this.props.reload();
} else if (info.file.status === 'error') {
message.danger(`${info.file.name} 失败.`);
}
}
};
return (
<div className="fire-truck-toolbar">
<div className="fire-truck-input">
......@@ -44,6 +74,9 @@ class FireWaterToolBar extends Component {
enableEdit &&
(
<div className="fire-truck-buttons">
<Upload {...uploadProps}>
<Button icon={<BizIcon icon="daoru" />} transparent />
</Upload>
<Button icon={<BizIcon icon="tianjia" />} transparent onClick={this.props.add} />
<Button icon={<BizIcon icon="xiugai" />} transparent onClick={this.props.edit} />
<Button icon={<BizIcon icon="shanchu" />} transparent onClick={this.props.delete} />
......@@ -61,7 +94,8 @@ FireWaterToolBar.propTypes = {
delete: PropTypes.func,
getTableListData: PropTypes.func,
pageConfig: PropTypes.object,
enableEdit: PropTypes.bool
enableEdit: PropTypes.bool,
reload: PropTypes.func
};
export default FireWaterToolBar;
......@@ -59,7 +59,7 @@ const fireWaterTableColumns = self => {
title: '配套设备',
dataIndex: '',
key: '',
width: '20%',
width: '10%',
render: (text, record, index) => {
return (
<span>
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Input, AmosAlert, Modal, Button } from 'amos-framework';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import { Store } from 'amos-tool';
import SysConsts from 'amos-processor/lib/config/consts';
import { Input, AmosAlert, Modal, Button, Upload, message } from 'amos-framework';
import AmosGridTable from './../../common/tableComponent/table/AmosGridTable';
import { getFireEquipmentListAction, deleteFireEquipmentAction, addFireEquipmentAction } from './../../../../services/ledgerService';
import MonitorModel from './MonitorModel';
import BizIcon from './../../../common/icon/BizIcon';
import { FasSerUrl } from './../../../../consts/urlConsts';
const lsTool = Store.lsTool;
const monitorTableColumns = self => {
return [
......@@ -269,6 +274,30 @@ class Monitor extends Component {
render() {
let { name, code, dataList, totalCount, selectedRowKeys, enableEditOp } = this.state;
let _true_ = true;
let url = formatUrl(FasSerUrl.importExcelDataUrl, { type: 'fireResource' });
const uploadProps = {
name: 'file',
accept: '.xls,.xlsx',
action: url,
showUploadList: false ,
headers: {
'Accept': 'application/json;charset=UTF-8',
'X-Access-Token': lsTool.read(SysConsts.token)
},
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
message.success(`${info.file.name} 上传成功`);
this.reload();
} else if (info.file.status === 'error') {
message.danger(`${info.file.name} 失败.`);
}
}
};
return (
<div className="monitor-video" style={{ background: '#33333', height: '100%' }}>
<div className="important-equipment-toolbar">
......@@ -280,6 +309,9 @@ class Monitor extends Component {
<Input value={code} onChange={e => this.onChange('code', e.target.value)} /> */}
<span>搜索:</span>
<Input value={name} onChange={e => this.onChange('name', e.target.value)} placeholder="按编号,名称搜索"/>
<Upload {...uploadProps}>
<Button icon={<BizIcon icon="daoru" />} transparent />
</Upload>
<Button icon={<BizIcon icon="tianjia" />} transparent onClick={() => this.add()} />
<Button icon={<BizIcon icon="xiugai" />} transparent onClick={() => this.edit()} />
<Button icon={<BizIcon icon="shanchu" />} transparent onClick={() => this.delete()} />
......
export const headerButton = [
{ key: 'back', text: '返回', icon: 'fanhui' },
// { key: 'back', text: '返回', icon: 'fanhui' },
{ key: 'onOff', text: '显示窗', icon: 'yuan1' },
{ key: 'planDrill', text: '预案演练', icon: 'yuan1' },
{ key: 'textPlan', text: '文字预案', icon: 'yuan-shuxing' }
];
export const pageUrl = {
planDrill: '/viz3dpub/pubview',
textPlan: '/viz3dpub/textview',
planDrill: '/biz/planDrill/pubview',
textPlan: '/biz/planDrill/textview',
back: '/biz/vizlib',
leaderStruct: '/biz/leaderStruct',
upload: '/biz/upload'
......
......@@ -97,7 +97,7 @@ class CusVizLib extends Component {
const { visible } = this.state;
return (
<div>
<VizlibView {...this.props} readOnly extraEventHandle={this.onItemClick} extraMenus={extraMenus} />
<VizlibView {...this.props} extraEventHandle={this.onItemClick} extraMenus={extraMenus} />
<Modal
header="预案上传"
visible={visible}
......
......@@ -58,10 +58,34 @@ class PlanTreeView extends Component {
getPlanTree() {
getPlanTreeAction().then(data => {
this.setState({ treeData: data });
this.setState({ treeData: data },()=>{
this.defaultOpen();
});
});
}
defaultOpen =()=>{
let { treeData } = this.state;
let { onTreeSelect } = this.props;
let defaultOpenPlan = this.loopTreeNodes(treeData[0]);
if (defaultOpenPlan) {
onTreeSelect && onTreeSelect(defaultOpenPlan);
this.setState({
expandedKeys: `treeNode-${defaultOpenPlan.parentId}`.split(','),
selectedKeys: `${defaultOpenPlan.type}-${defaultOpenPlan.id}`.split(',')
})
}
}
loopTreeNodes = (data) => {
if (data) {
if (data.children && data.children.length > 0) {
return this.loopTreeNodes(data.children[0]);
}
}
return data;
}
getTreeIcon = (props) => {
let { type } = props;
if (type === 'treeNode') {
......@@ -104,7 +128,7 @@ class PlanTreeView extends Component {
}
render() {
let { expandedKeys, selectedKeys, treeData } = this.state;
let { expandedKeys, selectedKeys, treeData,autoExpandParent } = this.state;
let { activeKey } = this.props;
return (
<div >
......@@ -113,6 +137,7 @@ class PlanTreeView extends Component {
expandedKeys={expandedKeys}
onExpand={this.onExpand}
selectedKeys={selectedKeys}
autoExpandParent={autoExpandParent}
onSelect={this.onTreeItemSelect}
className={classnames('plan-drill-tree', activeKey)}
>
......
......@@ -9,7 +9,7 @@ import TextButton from './../common/TextButton';
const sidePaneStyle = {
planDrill: {
left: 0,
top: 40,
top: 82,
bottom: 72,
style: {
backgroundColor: 'rgba(50,50,50,0.5)',
......@@ -19,7 +19,7 @@ const sidePaneStyle = {
},
textPlan: {
left: 0,
top: 40,
top: 82,
bottom: 0,
style: {
backgroundColor: 'rgba(255, 255, 255, 1)',
......@@ -49,11 +49,11 @@ class PublishView extends Component {
}
componentWillMount(){
this.setState({ params: this.props.location.state });
// this.setState({ params: this.props.location.state });
}
onTreeSelect = (param) => {
let { params, activeKey } = this.state;
let { params = {}, activeKey } = this.state;
params.appId = param.id;
params.isPublish = !!param.publishState;
this.setState({ params }, () => this.handleChange(activeKey));
......
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