Commit 6544fc44 authored by 吴俊凯's avatar 吴俊凯

依赖修改提交

parent 9b1b1f01
......@@ -3,4 +3,5 @@ lib
libs
*.js
*.md
*.scss
src/styles/**/*.scss
src/view/**/*.scss
......@@ -29,25 +29,25 @@
]
},
"dependencies": {
"amos-3d": "^2.1.5",
"amos-3d": "^2.x",
"amos-amap": "~1.0.9",
"amos-antd": "^2.1.4",
"amos-antd": "^2.x",
"amos-devgrid": "^1.0.10",
"amos-dll": "^2.0.2",
"amos-dll": "^3.x",
"amos-gojs": "^2.0.15",
"amos-icon": "^1.0.3",
"amos-mqtt": "^1.0.1",
"amos-pluggable": "^1.0.6",
"amos-icon": "^1.x",
"amos-mqtt": "^1.x",
"amos-pluggable": "^1.x",
"amos-processor": "^2.x",
"amos-richtext": "^1.0.1",
"amos-rules-config": "^1.0.6",
"amos-security": "^2.1.1",
"amos-security": "^3.x",
"amos-tool": "^1.x",
"amos-viz": "^1.x",
"amos-websocket": "^1.0.3",
"amos-websocket": "^1.x",
"classnames": "^2.2.5",
"dt2react": "^1.x",
"ray-code-split": "^1.0.1",
"ray-code-split": "^2.x",
"ray-eventpool": "^1.0.0",
"ray-mediaquery": "^1.0.0",
"ray-progress": "^1.0.0",
......@@ -55,11 +55,11 @@
"react-dom": "~16.3.3"
},
"devDependencies": {
"amos-build": "3.1.4",
"amos-designer": "^1.0.2",
"amos-framework": "^1.2.2",
"amos-iot-3dgraph": "^1.0.0",
"amos-iot-webstudio": "1.0.4",
"amos-build": "5.x",
"amos-designer": "^1.x",
"amos-framework": "^1.x",
"amos-iot-3dgraph": "^1.0.8",
"amos-iot-webstudio": "1.x",
"eslint-config-ray": "^1.0.26",
"mockjs": "^1.0.1-beta3",
"ray-build": "^2.0.2",
......
.tsts {
overflow: auto;
}
import * as utils from 'amos-processor/lib/utils';
import * as bitUtils from './../view/bizview/common/tableComponent/tool';
const { renderSimpleTime } = utils.tool;
......@@ -23,6 +24,7 @@ const trimFormData = function(form) {
};
export default {
tool: { ...bitUtils },
...utils,
renderTimeValue,
trimFormData
......
......@@ -8,7 +8,7 @@ import { fetchCheckDetailById, fetchCheckInputByIdNew, fetchShortByCheckIdAndChe
import CheckDetailTable from './CheckDetailTable';
import CheckInputTable from './CheckInputTable';
import { XJBaseURI } from './../../../../consts/urlConsts';
import { tool } from './../../../../utils/processor';
import { renderLongTime } from './../../../bizview/common/tableComponent/tool';
import Picture from './Picture';
import { pathMapping } from './../../../../routes/customRoutes';
import { Table } from 'amos-antd/lib';
......@@ -16,7 +16,6 @@ import './cdn.scss';
const CheckListPath = () => pathMapping.checkDetail;
const { renderLongTime } = tool;
const checkDetailHeaderResult = checkDetail => {
let checkTime = '巡检时间';
......
......@@ -9,14 +9,14 @@ import CheckDetailTable from './CheckDetailTable';
import CheckInputTable from './CheckInputTable';
import './../../../../styles/view/biz/checkDetail/checkDetail.scss';
import { XJBaseURI } from './../../../../consts/urlConsts';
import { tool } from './../../../../utils/processor';
import { renderLongTime } from './../../../bizview/common/tableComponent/tool';
import Picture from '../../../3dview/points/maxcontent/Picture';
import { pathMapping } from './../../../../routes/customRoutes';
import BizIcon from './../../../common/icon/BizIcon';
const CheckListPath = () => pathMapping.pointCheckList;
const { renderLongTime } = tool;
const checkDetailHeaderResult = checkDetail => {
let checkTime;
......
......@@ -17,15 +17,15 @@ class AmosGridTable extends Component {
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [],//表格选择的行key值集合
selectedRows: [],//表格选择的行数据集合
loading: false,//页面是否加载中,默认false
dataList: [],//表格数据集合
size: 'middle',//表格大小
current: props.defaultPageConfig ? props.defaultPageConfig.current : 1,//当前页初始索引0
pageSize: props.defaultPageConfig ? props.defaultPageConfig.pageSize : 10,//当前页数据量
filter: {},//表格过滤条件
totals: 1,//所有数据总和
selectedRowKeys: [], //表格选择的行key值集合
selectedRows: [], //表格选择的行数据集合
loading: false, //页面是否加载中,默认false
dataList: [], //表格数据集合
size: 'middle', //表格大小
current: props.defaultPageConfig ? props.defaultPageConfig.current : 1, //当前页初始索引0
pageSize: props.defaultPageConfig ? props.defaultPageConfig.pageSize : 10, //当前页数据量
filter: {}, //表格过滤条件
totals: 1, //所有数据总和
showFilter: true,
otherFilter: props.otherFilter,
maxHeight: 450
......@@ -42,17 +42,17 @@ class AmosGridTable extends Component {
}
componentWillReceiveProps(nextProps) {
if (nextProps.url !== this.props.url){
if (nextProps.url !== this.props.url) {
this.reload();
}
if (nextProps.otherFilter && nextProps.otherFilter !== this.props.otherFilter){
if (nextProps.otherFilter && nextProps.otherFilter !== this.props.otherFilter) {
this.setState({ otherFilter: nextProps.otherFilter }, this.reload);
}
let { current, pageSize } = this.state;
if (nextProps.totals > 0 && Math.ceil(nextProps.totals / pageSize) < current ) {
if (nextProps.totals > 0 && Math.ceil(nextProps.totals / pageSize) < current) {
this.setState({ current: Math.ceil(nextProps.totals / pageSize) });
}
if (nextProps.current === 0 && this.state.current !== 1 && (nextProps.current !== this.state.current)){
if (nextProps.current === 0 && this.state.current !== 1 && nextProps.current !== this.state.current) {
this.onPaginationChange(nextProps.current + 1);
}
}
......@@ -61,104 +61,111 @@ class AmosGridTable extends Component {
window.removeEventListener('resize', this.onWindowResize);
}
onWindowResize = (e) => {
onWindowResize = e => {
this.getHeightOffset();
}
};
/**
* 获取复选框选择的数据,并进行回调
*/
onSelectChange = (selectedRowKeys,selectedRows) => {
this.setState({
selectedRowKeys,
selectedRows
},this.props.getSelectedRows(selectedRows,selectedRowKeys));
}
onSelectChange = (selectedRowKeys, selectedRows) => {
this.setState(
{
selectedRowKeys,
selectedRows
},
this.props.getSelectedRows(selectedRows, selectedRowKeys)
);
};
/**
* 设置页面数据大小事件
*/
onSizeChange = (current, pageSize) => {
let { setPageConfig } = this.props;
setPageConfig && setPageConfig({ current, pageSize });
this.setState({ current, pageSize },this.reload);
}
this.setState({ current, pageSize }, this.reload);
};
/**
* 设置当前页事件
*/
onPaginationChange = (current) => {
onPaginationChange = current => {
let { setPageConfig } = this.props;
setPageConfig && setPageConfig({ current });
this.setState({ current },this.reload);
}
this.setState({ current }, this.reload);
};
/**
* 获取表格所有的外部按钮封装成数组
*/
getbtns = () => {
let btns = [];
return <div key={`btntool`} className='amos-grid-oper-btn'>{this.props.operBtns}</div>;
}
return (
<div key={`btntool`} className="amos-grid-oper-btn">
{this.props.operBtns}
</div>
);
};
/**
* 获取表格数据的筛选条件,通过回调获得的,并通过该条件进行表格刷新获取
*/
changeFilters = (obj) => {
changeFilters = obj => {
let newobj = obj;
let res = {};
let list = Object.keys(newobj);
list.map(e=>{
list.map(e => {
let varName = newobj[e];
if (varName && varName !== ''){
if (varName && varName !== '') {
res[e] = varName;
if (e === 'enabled'){
if (e === 'enabled') {
res[e] = varName === '启用';
}
}
});
this.setState({ filter: res },this.reload);
}
this.setState({ filter: res }, this.reload);
};
openFilter = () => {
let showFilter = this.state.showFilter;
this.setState({ showFilter: !showFilter });
}
};
/**
* 获取表格数据(刷新)
*/
reload = () => {
let { current,pageSize,filter,otherFilter } = this.state;
this.props.getTableDataAction({ current: current - 1, pageSize },JSON.stringify(filter),otherFilter);
let { current, pageSize, filter, otherFilter } = this.state;
this.props.getTableDataAction({ current: current - 1, pageSize }, JSON.stringify(filter), otherFilter);
this.getHeightOffset();
}
};
/**
* 获取表格内部按钮
*/
addOperateCol =(text,record) =>{
addOperateCol = (text, record) => {
const { operateCol } = this.props;
let operBtns = operateCol(text,record);
return (<div className='operation-buttons'>{operBtns}</div>);
}
let operBtns = operateCol(text, record);
return <div className="operation-buttons">{operBtns}</div>;
};
showTotal = (total) => {
showTotal = total => {
return `共 ${total} 条`;
}
};
generateRowkey = (record, index) => {
// return record.id ? record.id : UUID.uuidFast();
return record.id ? record.id : index + (this.state.current - 1) * this.state.pageSize;
// return index + (this.state.current - 1) * this.state.pageSize;
}
};
getHeightOffset = () => {
let { getPanelHeight } = this.props;
let height = getPanelHeight ? getPanelHeight() : 450;
height && this.setState({ maxHeight: height });
}
};
isVisableSearch(columns){
isVisableSearch(columns) {
let list = columns;
let res = false;
list.map((e)=>{
if (e.query){
list.map(e => {
if (e.query) {
res = true;
return true;
}
......@@ -167,8 +174,8 @@ class AmosGridTable extends Component {
}
render() {
const { loading, selectedRowKeys,size,maxHeight } = this.state;
let { columns, isChecked, operateCol, isTreeTable, isPageable, pagination, dataList, totals,rowClassName, onRowClick, onRowDoubleClick } = this.props;
const { loading, selectedRowKeys, size, maxHeight } = this.state;
let { columns, isChecked, operateCol, isTreeTable, isPageable, pagination, dataList, totals, rowClassName, onRowClick, onRowDoubleClick } = this.props;
console.log(maxHeight);
//设置复选框参数
let rowSelection = {
......@@ -178,43 +185,44 @@ class AmosGridTable extends Component {
//设置是否添加复选框
rowSelection = isChecked ? rowSelection : undefined;
//如果表格各行存在内部按钮,将各个按钮添加到表格列模型中
if (operateCol){
columns[columns.length - 1].render = (text,record) => this.addOperateCol(text,record);
if (operateCol) {
columns[columns.length - 1].render = (text, record) => this.addOperateCol(text, record);
}
let tepmPage = Object.assign({
size: 'small',
total: totals,
current: this.state.current,
pageSize: this.state.pageSize,
onShowSizeChange: this.onSizeChange,
onChange: this.onPaginationChange,
maxSeries: 4,
showSizeChanger: true
// style: { position: 'fixed', bottom: 0, right: 0 }
// showTotal: this.showTotal
}, pagination);
let tepmPage = Object.assign(
{
size: 'small',
total: totals,
current: this.state.current,
pageSize: this.state.pageSize,
onShowSizeChange: this.onSizeChange,
onChange: this.onPaginationChange,
maxSeries: 4,
showSizeChanger: true
// style: { position: 'fixed', bottom: 0, right: 0 }
// showTotal: this.showTotal
},
pagination
);
let _tempPagination = isPageable === false ? false : tepmPage;
let bordered = true;
// 当为true 或 undefined时则分页
let _pagination = isPageable === false ? false : _tempPagination;
let _pagination = isPageable === false ? false : _tempPagination;
let divStyle = this.state.showFilter ? 'other-table-bar' : 'table-bar';
let display = this.state.showFilter ? 'block' : 'none';
let searchStyle = { display };
console.log(_pagination);
return (
<div className='grid-content' style={{ height: '100%' }}>
<div className='oper-bar'>
<div className='amos-grid-oper-btns'>
{
this.getbtns()
}
<div className="grid-content" style={{ height: '100%' }}>
<div className="oper-bar">
<div className="amos-grid-oper-btns">
{this.getbtns()}
{
// flag ? <SearchBtn className='search-upordown-btn' onclick={this.openFilter} /> : ''
}
</div>
</div>
<div className={divStyle} style={{ height: 'calc(100% - 50px)' }}>
{ onRowClick ?
{onRowClick ? (
<Table
title={() => (
<div style={searchStyle}>
......@@ -232,7 +240,8 @@ class AmosGridTable extends Component {
scroll={{ y: maxHeight }}
rowClassName={rowClassName}
onRowClick={onRowClick}
/> :
/>
) : (
<Table
title={() => (
<div style={searchStyle}>
......@@ -244,14 +253,14 @@ class AmosGridTable extends Component {
rowSelection={rowSelection}
columns={columns}
dataSource={dataList}
pagination={{ ..._pagination, style: { position: 'absolute', bottom: '-55px', right: '430px' } }}
pagination={{ ..._pagination, style: {bottom: 0, right: 0 } }}
size={size}
bordered={bordered}
scroll={{ y: maxHeight }}
rowClassName={rowClassName}
onRowDoubleClick={onRowDoubleClick}
/>
}
)}
</div>
</div>
);
......@@ -259,14 +268,14 @@ class AmosGridTable extends Component {
}
AmosGridTable.propTypes = {
url: PropTypes.string,//请求表格数据的url不带参数的
columns: PropTypes.array,//表格列模型
getSelectedRows: PropTypes.func,//获取选择的行数据,用于各个具体的表格回调获取数据。
operBtns: PropTypes.array,//表格外部操作按钮,如'新增','编辑'等
isChecked: PropTypes.bool,//表格是否包含复选框
operateCol: PropTypes.func,//表格内部操作按钮,如'查看详情'等
callBack: PropTypes.func,//获取表格刷新方法,用于各个具体的表格回调获取,方便各种操作后进行表格刷新。
otherFilter: PropTypes.string,//其他查询条件
url: PropTypes.string, //请求表格数据的url不带参数的
columns: PropTypes.array, //表格列模型
getSelectedRows: PropTypes.func, //获取选择的行数据,用于各个具体的表格回调获取数据。
operBtns: PropTypes.array, //表格外部操作按钮,如'新增','编辑'等
isChecked: PropTypes.bool, //表格是否包含复选框
operateCol: PropTypes.func, //表格内部操作按钮,如'查看详情'等
callBack: PropTypes.func, //获取表格刷新方法,用于各个具体的表格回调获取,方便各种操作后进行表格刷新。
otherFilter: PropTypes.string, //其他查询条件
dataList: PropTypes.array,
getTableDataAction: PropTypes.func,
selectedRowKeys: PropTypes.array,
......
......@@ -4,7 +4,7 @@ import dt2react from 'dt2react';
import { fetchTaskListAction } from './../../../services/checkInfoService';
import AmosGridTable from './../common/tableComponent/table/AmosGridTable';
import { pathMapping } from './../../../routes/customRoutes';
import {renderLongTime} from './../../bizview/common/tableComponent/tool';
import { renderLongTime } from './../../bizview/common/tableComponent/tool';
import TaskSearch from './taskSearch'
// const CheckListPath = pathMapping.pointCheckList;
......
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