@ -1,469 +1,548 @@
'use strict' ;
'use strict'
import React , { Component , useRef , useState } from 'react' ;
import React , { Component , useRef , useState } from 'react'
import { connect } from 'react-redux' ;
import { connect } from 'react-redux'
import { Row , Col , Button , Table , Card , Popconfirm , Tag , Notification , Form , Select , Pagination } from '@douyinfe/semi-ui'
import {
import { IconPlus } from "@douyinfe/semi-icons"
Row ,
import TrendModal from '../components/TrendModal' ;
Col ,
Button ,
Table ,
Card ,
Popconfirm ,
Tag ,
Notification ,
Form ,
Select ,
Pagination ,
} from '@douyinfe/semi-ui'
import { IconPlus } from '@douyinfe/semi-icons'
import TrendModal from '../components/TrendModal'
const Trend = props => {
const { abnParam , factorId , itName , actions , dispatch , sensorId , project , limits , query , changeQuery , limitChange } =
const Trend = ( props ) => {
props
const { abnParam , factorId , itName , actions , dispatch , sensorId , project , limits , query , changeQuery , limitChange } = props
const form = useRef ( )
const form = useRef ( )
const [ selectedRowKeys , setSelectedRowKeys ] = useState ( [ ] )
const [ selectedRowKeys , setSelectedRowKeys ] = useState ( [ ] )
const [ filterFunc , setFilterFunc ] = useState ( { } )
const [ filterFunc , setFilterFunc ] = useState ( { } )
const [ modalVisible , setModalVisible ] = useState ( false )
const [ modalVisible , setModalVisible ] = useState ( false )
const [ showBatchConfig , setShowBatchConfig ] = useState ( false )
const [ showBatchConfig , setShowBatchConfig ] = useState ( false )
const [ timeRange , setTimeRange ] = useState ( '' )
const [ timeRange , setTimeRange ] = useState ( '' )
const [ bvBatch , setBvBatch ] = useState ( '' )
const [ bvBatch , setBvBatch ] = useState ( '' )
const [ winSize , setWinSize ] = useState ( '' )
const [ winSize , setWinSize ] = useState ( '' )
const [ reCoef , setReCoef ] = useState ( '' )
const [ reCoef , setReCoef ] = useState ( '' )
const [ deValue , setDeValue ] = useState ( '' )
const [ deValue , setDeValue ] = useState ( '' )
const [ graPoint , setGraPoint ] = useState ( '' )
const [ graPoint , setGraPoint ] = useState ( '' )
const [ graValue , setGraValue ] = useState ( '' )
const [ graValue , setGraValue ] = useState ( '' )
const [ modalData , setModalData ] = useState ( null )
const [ modalData , setModalData ] = useState ( null )
const filterSet = { sensorName : null , factorName : null }
const filterSet = { sensorName : null , factorName : null }
const { install } = actions
const { install } = actions
console . log ( 'query' , query )
const onSelectChange = ( selectedRowKeys ) => {
const onSelectChange = selectedRowKeys => {
setSelectedRowKeys ( selectedRowKeys )
setSelectedRowKeys ( selectedRowKeys )
}
}
const compareAndEdit = ( e , record ) => {
const compareAndEdit = ( e , record ) => {
setModalVisible ( true )
setModalVisible ( true )
setModalData ( record )
setModalData ( record )
}
}
const modalCancel = e => {
const modalCancel = e => {
setModalVisible ( false )
setModalVisible ( false )
} ;
}
const removeItem = e => {
const removeItem = e => {
dispatch ( install . deleteAbnParams ( e ) ) . then ( res => {
dispatch ( install . deleteAbnParams ( e ) ) . then ( res => {
if ( res . success ) {
if ( res . success ) {
const id = [ factorId , - 1 ] . join ( ',' )
const id = [ factorId , - 1 ] . join ( ',' )
changeQuery ( 10 , 0 )
changeQuery ( 10 , 0 )
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
if ( rs . success ) {
if ( rs . success ) {
limitChange ( rs . payload . data . count )
limitChange ( rs . payload . data . count )
}
}
} )
}
} )
} )
}
} )
}
const handleInputChange = e => {
if ( e != null ) {
const value = e
let func = (
ep => s =>
s . sensorName . search ( ep ) > - 1
) ( value )
filterSet . sensorName = func
func = (
ep => s =>
s . factorName . search ( ep ) > - 1
) ( value )
filterSet . factorName = func
} else {
filterSet . sensorName = null
filterSet . factorName = null
}
}
const handleInputChange = e => {
setFilterFunc ( filterSet )
if ( e != null ) {
}
const value = e
/ / 批 量 启 用 o r 禁 用
let func = ( ep => ( s => ( s . sensorName ) . search ( ep ) > - 1 ) ) ( value )
const onSwitchChange = e => {
filterSet . sensorName = func
if ( selectedRowKeys . length != 0 ) {
func = ( ep => ( s => ( s . factorName ) . search ( ep ) > - 1 ) ) ( value )
let ids = selectedRowKeys . join ( ',' )
filterSet . factorName = func
let data = {
} else {
enabled : e ,
filterSet . sensorName = null
use : 'switch' ,
filterSet . factorName = null
}
/ / 启 用 和 禁 用 接 口
dispatch ( install . batchCfgAbnParams ( ids , data ) ) . then ( res => {
if ( res . success ) {
const id = [ factorId , - 1 ] . join ( ',' )
changeQuery ( 10 , 0 )
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
if ( rs . success ) {
limitChange ( rs . payload . data . count )
}
} )
}
}
setFilterFunc ( filterSet )
} )
}
}
/ / 批 量 启 用 o r 禁 用
}
const onSwitchChange = ( e ) => {
/ / 批 量 删 除
if ( selectedRowKeys . length != 0 ) {
const batchDelete = ( ) => {
let ids = selectedRowKeys . join ( ',' ) ;
if ( selectedRowKeys . length != 0 ) {
let data = {
let ids = selectedRowKeys . join ( ',' )
enabled : e ,
/ / 删 除 接 口
use : 'switch'
dispatch ( install . deleteAbnParams ( ids ) ) . then ( res => {
} ;
if ( res . success ) {
/ / 启 用 和 禁 用 接 口
const id = [ factorId , - 1 ] . join ( ',' )
dispatch ( install . batchCfgAbnParams ( ids , data ) ) . then ( res => {
changeQuery ( 10 , 0 )
if ( res . success ) {
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
const id = [ factorId , - 1 ] . join ( ',' )
if ( rs . success ) {
changeQuery ( 10 , 0 )
limitChange ( rs . payload . data . count )
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
}
if ( rs . success ) {
} )
limitChange ( rs . payload . data . count )
}
} )
}
} )
}
}
} )
} else {
Notification . warning ( {
content : '您尚未勾选任何参数配置!' ,
duration : 3 ,
} )
}
}
/ / 批 量 删 除
}
const batchDelete = ( ) => {
/ / 批 量 保 存
if ( selectedRowKeys . length != 0 ) {
const batchSave = ( ) => {
let ids = selectedRowKeys . join ( ',' ) ;
form . current . validate ( ) . then ( value => {
/ / 删 除 接 口
let dataSource = abnParam . filter ( a => a . abnType == 3 && a . factorId == factorId )
dispatch ( install . deleteAbnParams ( ids ) ) . then ( res => {
if ( selectedRowKeys . length != 0 ) {
if ( res . success ) {
let ids = selectedRowKeys . join ( ',' )
const id = [ factorId , - 1 ] . join ( ',' )
let data = {
changeQuery ( 10 , 0 )
paramJson : {
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
thr_der : deValue , / / 导 数 阈 值
if ( rs . success ) {
win_avg : reCoef , / / 滑 动 均 值
limitChange ( rs . payload . data . count )
win_med : winSize , / / 滑 动 中 值
}
thr_burr : bvBatch , / / 毛 刺 阈 值
} )
thr_grad : graValue , / / 渐 变 阈 值
}
win_grad : graPoint , / / 渐 变 点 个 数
} )
days_Last : timeRange , / / 分 析 时 长
} else {
} ,
Notification . warning ( {
use : 'notSwitch' ,
content : '您尚未勾选任何参数配置!' ,
}
duration : 3 ,
} ) }
}
/ / 批 量 保 存
const batchSave = ( ) => {
form . current . validate ( ) . then ( value => {
let dataSource = abnParam . filter ( a => a . abnType == 3 && a . factorId == factorId )
if ( selectedRowKeys . length != 0 ) {
let ids = selectedRowKeys . join ( ',' )
let data = {
paramJson : {
"thr_der" : deValue , / / 导 数 阈 值
"win_avg" : reCoef , / / 滑 动 均 值
"win_med" : winSize , / / 滑 动 中 值
"thr_burr" : bvBatch , / / 毛 刺 阈 值
"thr_grad" : graValue , / / 渐 变 阈 值
"win_grad" : graPoint , / / 渐 变 点 个 数
"days_Last" : timeRange / / 分 析 时 长
} ,
use : 'notSwitch' ,
} ;
dispatch ( install . batchCfgAbnParams ( ids , data ) ) . then ( res => {
dispatch ( install . batchCfgAbnParams ( ids , data ) ) . then ( res => {
if ( res . success ) {
if ( res . success ) {
const id = [ factorId , - 1 ] . join ( ',' )
const id = [ factorId , - 1 ] . join ( ',' )
changeQuery ( 10 , 0 )
changeQuery ( 10 , 0 )
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
dispatch ( install . getAbnParamList ( { factorId : id , limit : 10 , page : 0 , type : 3 } ) ) . then ( rs => {
if ( rs . success ) {
if ( rs . success ) {
limitChange ( rs . payload . data . count )
limitChange ( rs . payload . data . count )
}
}
} )
} )
}
}
} )
} else if ( dataSource . length != 0 ) {
Notification . warning ( {
content : '您尚未勾选任何参数配置!' ,
duration : 3 ,
} )
}
} )
} )
} else if ( dataSource . length != 0 ) {
Notification . warning ( {
content : '您尚未勾选任何参数配置!' ,
duration : 3 ,
} )
}
} )
}
const iconClick = ( ) => {
if ( ! showBatchConfig ) {
setShowBatchConfig ( true )
} else {
setShowBatchConfig ( false )
}
}
const iconClick = ( ) => {
}
if ( ! showBatchConfig ) {
const rangeChange = value => {
setShowBatchConfig ( true ) ;
setTimeRange ( value )
} else {
}
setShowBatchConfig ( false ) ;
const bvValueBatch = value => {
}
setBvBatch ( value )
}
}
const rangeChange = ( value ) => {
const winSizeBatch = value => {
setTimeRange ( value )
setWinSize ( value )
}
}
const bvValueBatch = ( value ) => {
const reCoefBatch = value => {
setBvBatch ( value )
setReCoef ( value )
}
}
const winSizeBatch = ( value ) => {
const deValueBatch = value => {
setWinSize ( value )
setDeValue ( value )
}
}
const reCoefBatch = ( value ) => {
const graPointBatch = value => {
setReCoef ( value )
setGraPoint ( value )
}
}
const deValueBatch = ( value ) => {
const graValueBatch = value => {
setDeValue ( value )
setGraValue ( value )
}
const checkInterger = ( rule , val ) => {
/ / i f ( v a l ) {
const strRegex = /^[1-9]*[1-9][0-9]*$/
if ( strRegex . test ( val ) ) {
return true
}
}
const graPointBatch = ( value ) => {
return false
setGraPoint ( value )
/ / }
}
const checkPoint = ( rule , value ) => {
const pattern = /^[1-9]*[1-9][0-9]*$/
if ( pattern . test ( value ) && value != 1 ) {
return true
}
}
const graValueBatch = ( value ) => {
return false
setGraValue ( value )
}
const checkNumber = ( rule , val ) => {
const strRegex = /^-?\d+(\.\d+)?$/
if ( strRegex . test ( val ) ) {
return true
}
}
const checkInterger = ( rule , val ) => {
return false
/ / i f ( v a l ) {
}
const strRegex = /^[1-9]*[1-9][0-9]*$/
if ( strRegex . test ( val ) ) {
return true
}
return false
/ / }
} ;
const checkPoint = ( rule , value ) => {
const pattern = /^[1-9]*[1-9][0-9]*$/ ;
if ( pattern . test ( value ) && value != 1 ) {
return true
}
return false
}
const checkNumber = ( rule , val ) => {
const strRegex = /^-?\d+(\.\d+)?$/
if ( strRegex . test ( val ) ) {
return true
}
return false
let dataSource = abnParam . filter ( a => a . abnType == 3 && a . factorId == factorId )
const rowSelection = {
selectedRowKeys : selectedRowKeys ,
onChange : onSelectChange ,
}
let filterData = dataSource
let flag = false
let keyArr = [ ]
let tmpds = [ ]
let dataPush = [ ]
Object . keys ( filterFunc ) . forEach ( key => {
const filter = filterFunc [ key ]
filterData = dataSource
if ( filter != null ) {
flag = true
filterData = filterData . filter ( filter )
if ( filterData . length > 0 ) {
filterData . map ( s => {
if ( keyArr . indexOf ( s . id ) == - 1 ) {
keyArr . push ( s . id )
dataPush . push ( s )
}
} )
}
}
}
} )
let dataSource = abnParam . filter ( a => a . abnType == 3 && a . factorId == factorId )
tmpds = flag ? dataPush . sort ( ( a , b ) => a . id - b . id ) : dataSource . sort ( ( a , b ) => a . id - b . id )
const rowSelection = {
let columns = [
selectedRowKeys : selectedRowKeys ,
{
onChange : onSelectChange ,
title : '测点位置' ,
} ;
dataIndex : 'sensorName' ,
let filterData = dataSource ;
key : 'sensorName' ,
let flag = false ;
width : '9%' ,
let keyArr = [ ] ;
} ,
let tmpds = [ ] ;
{
let dataPush = [ ] ;
title : '监测项' ,
Object . keys ( filterFunc ) . forEach ( key => {
dataIndex : 'factorName' ,
const filter = filterFunc [ key ] ;
key : 'factorName' ,
filterData = dataSource ;
width : '10%' ,
if ( filter != null ) {
render : ( text , record ) => record . factorName + '/' + itName ,
flag = true ;
} ,
filterData = filterData . filter ( filter )
{
if ( filterData . length > 0 ) {
title : '分析时段' ,
filterData . map ( s => {
dataIndex : 'params' ,
if ( keyArr . indexOf ( s . id ) == - 1 ) {
key : 'params1' ,
keyArr . push ( s . id ) ;
width : '9%' ,
dataPush . push ( s ) ;
render : text => text . days_Last + '个月' ,
}
} ,
} )
{
}
title : '毛刺阈值' ,
}
dataIndex : 'params' ,
} )
key : 'params2' ,
tmpds = flag ? dataPush . sort ( ( a , b ) => a . id - b . id ) : dataSource . sort ( ( a , b ) => a . id - b . id ) ;
width : '9%' ,
let columns = [
render : text => text . thr_burr ,
{
} ,
title : "测点位置" ,
{
dataIndex : "sensorName" ,
title : '窗口数' ,
key : "sensorName" ,
dataIndex : 'params' ,
width : '9%'
key : 'params3' ,
} ,
width : '9%' ,
{
render : text => text . win_med ,
title : "监测项" ,
} ,
dataIndex : "factorName" ,
{
key : "factorName" ,
title : '回归系数' ,
width : '10%' ,
dataIndex : 'params' ,
render : ( text , record ) => (
key : 'params4' ,
record . factorName + "/" + itName
width : '9%' ,
) ,
render : text => text . win_avg ,
} ,
} ,
{
{
title : "分析时段" ,
title : '导数阈值' ,
dataIndex : "params" ,
dataIndex : 'params' ,
key : "params1" ,
key : 'params5' ,
width : '9%' ,
width : '9%' ,
render : text => text . days_Last + "个月"
render : text => text . thr_der ,
} ,
} ,
{
{
title : "毛刺阈值" ,
title : '渐变点个数' ,
dataIndex : "params" ,
dataIndex : 'params' ,
key : "params2" ,
key : 'params6' ,
width : '9%' ,
width : '9%' ,
render : text => text . thr_burr
render : text => text . win_grad ,
} ,
} ,
{
{
title : "窗口数" ,
title : '渐变阈值' ,
dataIndex : "params" ,
dataIndex : 'params' ,
key : "params3" ,
key : 'params7' ,
width : '9%' ,
width : '9%' ,
render : text => text . win_med
render : text => text . thr_grad ,
} ,
} ,
{
{
title : "回归系数" ,
title : '启用状态' ,
dataIndex : "params" ,
dataIndex : 'enabled' ,
key : "params4" ,
key : 'enabled' ,
width : '9%' ,
width : '9%' ,
render : text => text . win_avg
render : ( text , record ) => ( record . enabled ? < Tag color = 'blue' > 已启用 < / Tag > : < Tag > 已禁用 < / Tag > ) ,
} ,
} ,
{
{
title : "导数阈值" ,
title : '操作' ,
dataIndex : "params" ,
key : 'action' ,
key : "params5" ,
width : '9%' ,
width : '9%' ,
render : ( text , record ) => (
render : text => text . thr_der
< span >
} ,
< Button theme = 'borderless' type = 'primary' onClick = { e => compareAndEdit ( e , record ) } >
{
编辑
title : "渐变点个数" ,
< / Button >
dataIndex : "params" ,
< span className = 'ant-divider' > < / span >
key : "params6" ,
< Popconfirm
width : '9%' ,
title = '确认删除该参数配置?'
render : text => text . win_grad
id = { record . id }
} ,
onConfirm = { ( ) => {
{
removeItem ( record . id )
title : "渐变阈值" ,
dataIndex : "params" ,
key : "params7" ,
width : '9%' ,
render : text => text . thr_grad
} ,
{
title : "启用状态" ,
dataIndex : "enabled" ,
key : "enabled" ,
width : '9%' ,
render : ( text , record ) => (
record . enabled ? < Tag color = "blue" > 已启用 < / Tag > : < Tag > 已禁用 < / Tag >
)
} ,
{
title : "操作" ,
key : "action" ,
width : '9%' ,
render : ( text , record ) => (
< span >
< Button theme = 'borderless' type = 'primary' onClick = { ( e ) => compareAndEdit ( e , record ) } > 编辑 < / Button >
< span className = "ant-divider" > < / span >
< Popconfirm title = "确认删除该参数配置?" id = { record . id } onConfirm = { ( ) => { removeItem ( record . id ) } } >
< Button theme = 'borderless' type = 'danger' > 删除 < / Button >
< / Popconfirm >
< / span >
) ,
}
]
return ( < Card style = { { marginTop : 15 } } >
< Form style = { { marginBottom : 15 } } labelPosition = 'left' getFormApi = { formApi => {
form . current = formApi
} } >
} } >
< Row style = { { display : 'flex' , alignItems : 'center' } } >
< Button theme = 'borderless' type = 'danger' >
< Col span = { 5 } >
删除
< Form.Input field = 'keywords' noLabel = { true } style = { { marginBottom : 0 , width : '95%' } } placeholder = "关键词:测点位置、监测因素" onChange = { handleInputChange } >
< / Button >
< / Form.Input >
< / Popconfirm >
< / Col >
< / span >
< Col span = { 2 } >
) ,
< Form.Switch label = '是否启用' field = 'switch' style = { { marginBottom : 0 } } checked onChange = { onSwitchChange } >
} ,
< / Form.Switch >
]
< / Col >
return (
< Col span = { 2 } >
< Card style = { { marginTop : 15 } } >
< Popconfirm style = { { marginBottom : 0 } } title = "确认批量删除选中的参数配置?" onConfirm = { batchDelete } >
< Form
< Button style = { { fontSize : 13 } } theme = 'solid' type = 'danger' > 批量删除 < / Button >
style = { { marginBottom : 15 } }
< / Popconfirm >
labelPosition = 'left'
< / Col >
getFormApi = { formApi => {
< Col span = { 2 } >
form . current = formApi
< IconPlus style = { { paddingTop : 9 } } onClick = { iconClick } / >
} } >
< / Col >
< Row style = { { display : 'flex' , alignItems : 'center' } } >
< / Row >
< Col span = { 5 } >
{ showBatchConfig ?
< Form.Input
< Row style = { { display : 'flex' , alignItems : 'center' , marginTop : 10 } } >
field = 'keywords'
< Col span = { 3 } >
noLabel = { true }
< Form.Select showSearch filter noLabel = { true } field = "timeRange" onChange = { rangeChange }
style = { { marginBottom : 0 , width : '95%' } }
placeholder = "请选择分析时长" style = { { width : '93%' , marginBottom : 0 } } >
placeholder = '关键词:测点位置、监测因素'
< Select.Option value = "1" > 1 个月 < / Select.Option >
onChange = { handleInputChange } > < / Form.Input >
< Select.Option value = "2" > 2 个月 < / Select.Option >
< / Col >
< Select.Option value = "3" > 3 个月 < / Select.Option >
< Col span = { 2 } >
< / Form.Select >
< Form.Switch
< / Col >
label = '是否启用'
< Col span = { 3 } >
field = 'switch'
< Form.Input style = { { marginBottom : 0 , width : '93%' } }
style = { { marginBottom : 0 } }
field = 'bv'
checked
noLabel = { true }
onChange = { onSwitchChange } > < / Form.Switch >
placeholder = "毛刺阈值:数字"
< / Col >
onChange = { e => bvValueBatch ( e ) }
< Col span = { 2 } >
rules = { [ {
< Popconfirm style = { { marginBottom : 0 } } title = '确认批量删除选中的参数配置?' onConfirm = { batchDelete } >
required : true , message : "请输入正整数" , validator : checkInterger
< Button style = { { fontSize : 13 } } theme = 'solid' type = 'danger' >
} ] } trigger = 'blur' / >
批量删除
< / Col >
< / Button >
< Col span = { 3 } >
< / Popconfirm >
< Form.Input
< / Col >
style = { { marginBottom : 0 , width : '93%' } }
< Col span = { 2 } >
field = 'ws'
< IconPlus style = { { paddingTop : 9 } } onClick = { iconClick } / >
placeholder = "滑动中值:正值"
< / Col >
noLabel = { true }
< / Row >
rules = { [ {
{ showBatchConfig ? (
required : true , message : "请输入正整数" , validator : checkInterger
< Row style = { { display : 'flex' , alignItems : 'center' , marginTop : 10 } } >
} ] }
< Col span = { 3 } >
onChange = { e => winSizeBatch ( e ) }
< Form.Select
trigger = 'blur' / >
showSearch
< / Col >
filter
< Col span = { 3 } >
noLabel = { true }
< Form.Input
field = 'timeRange'
style = { { marginBottom : 0 , width : '93%' } }
onChange = { rangeChange }
field = 'rc'
placeholder = '请选择分析时长'
placeholder = "滑动均值:正值"
style = { { width : '93%' , marginBottom : 0 } } >
noLabel = { true } rules = { [ {
< Select.Option value = '1' > 1 个月 < / Select.Option >
required : true , message : "请输入正整数" , validator : checkInterger
< Select.Option value = '2' > 2 个月 < / Select.Option >
} ] }
< Select.Option value = '3' > 3 个月 < / Select.Option >
onChange = { e => reCoefBatch ( e ) }
< / Form.Select >
trigger = 'blur' / >
< / Col >
< / Col >
< Col span = { 3 } >
< Col span = { 3 } >
< Form.Input
< Form.Input
style = { { marginBottom : 0 , width : '93%' } }
style = { { marginBottom : 0 , width : '93%' } }
field = 'bv'
field = 'dv'
noLabel = { true }
placeholder = "导数阈值:数字"
placeholder = '毛刺阈值:数字'
noLabel = { true }
onChange = { e => bvValueBatch ( e ) }
rules = { [ {
rules = { [
required : true , message : "请输入正整数" , validator : checkNumber
{
} ] }
required : true ,
onChange = { e => deValueBatch ( e ) }
message : '请输入正整数' ,
trigger = 'blur' / >
validator : checkInterger ,
< / Col >
} ,
< Col span = { 3 } >
] }
< Form.Input
trigger = 'blur'
style = { { marginBottom : 0 , width : '93%' } }
/ >
field = 'pn'
< / Col >
placeholder = "渐变点个数:正值"
< Col span = { 3 } >
noLabel = { true } rules = { [ {
< Form.Input
required : true , message : "请输入正整数" , validator : checkPoint
style = { { marginBottom : 0 , width : '93%' } }
} ] }
field = 'ws'
onChange = { e => graPointBatch ( e ) }
placeholder = '滑动中值:正值'
trigger = 'blur' / >
noLabel = { true }
< / Col >
rules = { [
< Col span = { 3 } >
{
< Form.Input
required : true ,
style = { { marginBottom : 0 , width : '93%' } }
message : '请输入正整数' ,
field = 'gv'
validator : checkInterger ,
placeholder = "渐变阈值:数字"
} ,
noLabel = { true } rules = { [ {
] }
required : true , message : "请输入正整数" , validator : checkNumber
onChange = { e => winSizeBatch ( e ) }
} ] }
trigger = 'blur'
onChange = { e => graValueBatch ( e ) }
/ >
trigger = 'blur' / >
< / Col >
< / Col >
< Col span = { 3 } >
< Col span = { 2 } >
< Form.Input
< Button onClick = { batchSave } theme = 'solid' type = 'primary' > 批量保存 < / Button >
style = { { marginBottom : 0 , width : '93%' } }
< / Col >
field = 'rc'
< / Row > : '' }
placeholder = '滑动均值:正值'
< / Form >
noLabel = { true }
< Table rowSelection = { rowSelection } columns = { columns } dataSource = { tmpds } pagination = { false } / >
rules = { [
< div
{
style = { {
required : true ,
display : "flex" ,
message : '请输入正整数' ,
justifyContent : "flex-end" ,
validator : checkInterger ,
padding : "20px 20px" ,
} ,
} }
] }
>
onChange = { e => reCoefBatch ( e ) }
< span style = { { lineHeight : "30px" , fontSize : 13 , color : 'rgba(0,90,189,0.8)' } } >
trigger = 'blur'
共 { limits } 条信息
/ >
< / span >
< / Col >
< Pagination
< Col span = { 3 } >
total = { limits }
< Form.Input
showSizeChanger
style = { { marginBottom : 0 , width : '93%' } }
currentPage = { query . page + 1 }
field = 'dv'
pageSizeOpts = { [ 10 , 20 , 30 , 40 ] }
placeholder = '导数阈值:数字'
onChange = { ( currentPage , pageSize ) => {
noLabel = { true }
changeQuery ( pageSize , currentPage - 1 )
rules = { [
page . current = currentPage - 1
{
} }
required : true ,
/ >
message : '请输入正整数' ,
< / div >
validator : checkNumber ,
{ modalVisible ? < TrendModal
} ,
/ / s t r u c t I d = { s t r u c t I d }
] }
visible = { true }
onChange = { e => deValueBatch ( e ) }
project = { project }
trigger = 'blur'
closeModal = { modalCancel }
/ >
modalData = { modalData }
< / Col >
sensorId = { sensorId }
< Col span = { 3 } >
factorId = { factorId }
< Form.Input
style = { { marginBottom : 0 , width : '93%' } }
/ > : ' ' }
field = 'pn'
placeholder = '渐变点个数:正值'
noLabel = { true }
rules = { [
{
required : true ,
message : '请输入正整数' ,
validator : checkPoint ,
} ,
] }
onChange = { e => graPointBatch ( e ) }
trigger = 'blur'
/ >
< / Col >
< Col span = { 3 } >
< Form.Input
style = { { marginBottom : 0 , width : '93%' } }
field = 'gv'
placeholder = '渐变阈值:数字'
noLabel = { true }
rules = { [
{
required : true ,
message : '请输入正整数' ,
validator : checkNumber ,
} ,
] }
onChange = { e => graValueBatch ( e ) }
trigger = 'blur'
/ >
< / Col >
< Col span = { 2 } >
< Button onClick = { batchSave } theme = 'solid' type = 'primary' >
批量保存
< / Button >
< / Col >
< / Row >
) : (
''
) }
< / Form >
< Table rowSelection = { rowSelection } columns = { columns } dataSource = { tmpds } pagination = { false } / >
< div
style = { {
display : 'flex' ,
justifyContent : 'flex-end' ,
padding : '20px 20px' ,
} } >
< span style = { { lineHeight : '30px' , fontSize : 13 , color : 'rgba(0,90,189,0.8)' } } > 共 { limits } 条信息 < / span >
< Pagination
total = { limits }
showSizeChanger
currentPage = { query . page + 1 }
pageSizeOpts = { [ 10 , 20 , 30 , 40 ] }
onChange = { ( currentPage , pageSize ) => {
changeQuery ( pageSize , currentPage - 1 )
/ / p a g e . c u r r e n t = c u r r e n t P a g e - 1
} }
/ >
< / div >
{ modalVisible ? (
< TrendModal
/ / s t r u c t I d = { s t r u c t I d }
visible = { true }
project = { project }
closeModal = { modalCancel }
modalData = { modalData }
sensorId = { sensorId }
factorId = { factorId }
/ >
) : (
''
) }
< / Card >
< / Card >
) ;
)
}
}
function mapStateToProps ( state ) {
function mapStateToProps ( state ) {
const { abnParam , global } = state
const { abnParam , global } = state
/ / l e t i s R e q u e s t i n g = a b n P a r a m S t a t e ? . i s R e q u e s t i n g ;
/ / l e t i s R e q u e s t i n g = a b n P a r a m S t a t e ? . i s R e q u e s t i n g ;
return {
return {
isRequesting : false , / / 请 求 状 态
isRequesting : false , / / 请 求 状 态
abnParam : abnParam ? . data ? . rows || [ ] ,
abnParam : abnParam ? . data ? . rows || [ ] ,
actions : global . actions
actions : global . actions ,
}
}
}
}
export default connect ( mapStateToProps ) ( Trend )
export default connect ( mapStateToProps ) ( Trend )