Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAMOSIotView
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
iot
YeeAMOSIotView
Commits
8e308ba4
Commit
8e308ba4
authored
Feb 08, 2022
by
田功镭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)modify umd supported
parent
173bd265
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
36 deletions
+31
-36
index.js
server/index.js
+11
-16
viewConsts.js
src/consts/viewConsts.js
+1
-1
HistoryChartView.js
src/view/historicalData/historyPanel/HistoryChartView.js
+1
-1
Alarm.js
src/view/zonglan/home/statistics/Alarm.js
+7
-7
EquipInterface.js
src/view/zonglan/home/statistics/EquipInterface.js
+1
-1
EquipProtocol.js
src/view/zonglan/home/statistics/EquipProtocol.js
+2
-2
PrototypeEquip.js
src/view/zonglan/home/statistics/PrototypeEquip.js
+3
-3
Task.js
src/view/zonglan/home/statistics/Task.js
+3
-3
TubeEquipNum.js
src/view/zonglan/home/statistics/TubeEquipNum.js
+2
-2
No files found.
server/index.js
View file @
8e308ba4
...
@@ -2,19 +2,15 @@
...
@@ -2,19 +2,15 @@
const
express
=
require
(
'express'
);
const
express
=
require
(
'express'
);
const
{
const
{
testData
}
=
require
(
'./_mock/testMock'
);
testData
}
=
require
(
'./_mock/testMock'
);
const
{
const
{
ruleLibListData
}
=
require
(
'./_mock/rule'
);
ruleLibListData
}
=
require
(
'./_mock/rule'
);
const
app
=
express
();
const
app
=
express
();
const
port
=
8087
;
const
port
=
8087
;
const
successCode
=
200
;
const
successCode
=
200
;
const
transCommonResponse
=
(
data
)
=>
{
const
transCommonResponse
=
data
=>
{
const
result
=
{
const
result
=
{
result
:
'SUCCESS'
,
result
:
'SUCCESS'
,
dataList
:
data
dataList
:
data
...
@@ -22,14 +18,13 @@ const transCommonResponse = (data) => {
...
@@ -22,14 +18,13 @@ const transCommonResponse = (data) => {
return
JSON
.
stringify
(
result
);
return
JSON
.
stringify
(
result
);
};
};
app
.
all
(
'*'
,
(
req
,
res
,
next
)
=>
{
app
.
all
(
'*'
,
(
req
,
res
,
next
)
=>
{
console
.
log
(
req
.
headers
.
origin
);
console
.
log
(
req
.
headers
.
origin
);
res
.
header
(
'Access-Control-Allow-Origin'
,
req
.
headers
.
origin
);
res
.
header
(
'Access-Control-Allow-Origin'
,
req
.
headers
.
origin
);
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type,Content-Length, X-Access-Token, X-Api-Key, Authorization, Accept,X-Requested-With'
);
res
.
header
(
'Access-Control-Allow-Headers'
,
'Content-Type,Content-Length, X-Access-Token, X-Api-Key, Authorization, Accept,X-Requested-With'
);
res
.
header
(
'Access-Control-Allow-Methods'
,
'PUT,POST,GET,DELETE,OPTIONS'
);
res
.
header
(
'Access-Control-Allow-Methods'
,
'PUT,POST,GET,DELETE,OPTIONS'
);
res
.
header
(
'Access-Control-Allow-Credentials'
,
'true'
);
res
.
header
(
'Access-Control-Allow-Credentials'
,
'true'
);
res
.
header
(
'X-Powered-By'
,
' 3.2.1'
);
res
.
header
(
'X-Powered-By'
,
' 3.2.1'
);
if
(
req
.
method
===
'OPTIONS'
)
{
if
(
req
.
method
===
'OPTIONS'
)
{
// 让options请求快速返回
// 让options请求快速返回
res
.
send
(
successCode
);
res
.
send
(
successCode
);
...
@@ -41,7 +36,7 @@ app.all('*', (req, res, next) => {
...
@@ -41,7 +36,7 @@ app.all('*', (req, res, next) => {
app
.
get
(
'/'
,
(
req
,
res
)
=>
{
app
.
get
(
'/'
,
(
req
,
res
)
=>
{
res
.
writeHead
(
successCode
,
{
'Content-Type'
:
'text/html;charset=utf-8'
});
res
.
writeHead
(
successCode
,
{
'Content-Type'
:
'text/html;charset=utf-8'
});
res
.
write
(
res
.
write
(
`
`
<!doctype html>
<!doctype html>
<html>
<html>
<head>
<head>
...
@@ -67,7 +62,8 @@ app.get('/', (req, res) => {
...
@@ -67,7 +62,8 @@ app.get('/', (req, res) => {
<a href='/ruledesign/ruleLibList'>ruleLibList</a>
<a href='/ruledesign/ruleLibList'>ruleLibList</a>
</body>
</body>
</html>
</html>
`
);
`
);
});
});
app
.
get
(
'/test'
,
(
req
,
res
)
=>
{
app
.
get
(
'/test'
,
(
req
,
res
)
=>
{
...
@@ -79,9 +75,8 @@ app.get('/ruledesign/ruleLibList', (req, res) => {
...
@@ -79,9 +75,8 @@ app.get('/ruledesign/ruleLibList', (req, res) => {
res
.
send
(
transCommonResponse
(
ruleLibListData
().
dataList
));
res
.
send
(
transCommonResponse
(
ruleLibListData
().
dataList
));
});
});
const
server
=
app
.
listen
(
port
,
()
=>
{
const
server
=
app
.
listen
(
port
,
()
=>
{
const
host
=
server
.
address
().
address
;
const
host
=
server
.
address
().
address
;
const
port
=
server
.
address
().
port
;
const
$
port
=
server
.
address
().
port
;
console
.
log
(
'应用实例,访问地址为 http://%s:%s'
,
host
,
port
);
console
.
log
(
'应用实例,访问地址为 http://%s:%s'
,
host
,
$
port
);
});
});
src/consts/viewConsts.js
View file @
8e308ba4
//主题模版文件地址
//
主题模版文件地址
export
const
THEMES_TEMPLATE
=
'/static/css/app.css'
;
export
const
THEMES_TEMPLATE
=
'/static/css/app.css'
;
/**
/**
...
...
src/view/historicalData/historyPanel/HistoryChartView.js
View file @
8e308ba4
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
LineChart
}
from
'amos-viz'
;
import
{
LineChart
}
from
'amos-viz
/lib/echarts/umd
'
;
import
{
isNum
}
from
'ray-validate'
;
import
{
isNum
}
from
'ray-validate'
;
import
{
dateToNoYS
}
from
'./../common/date/DateUtil'
;
import
{
dateToNoYS
}
from
'./../common/date/DateUtil'
;
...
...
src/view/zonglan/home/statistics/Alarm.js
View file @
8e308ba4
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts
/umd
'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
OltSerUrl
from
'../../../../consts/urlConsts'
;
import
{
OltSerUrl
}
from
'../../../../consts/urlConsts'
;
import
{
option
}
from
'./chartData/AlarmData'
;
import
{
option
}
from
'./chartData/AlarmData'
;
/**
/**
* 告警统计
* 告警统计
...
@@ -24,7 +24,7 @@ class Alarm extends Component {
...
@@ -24,7 +24,7 @@ class Alarm extends Component {
componentWillMount
()
{
componentWillMount
()
{
let
url
=
`
${
OltSerUrl
.
getAlarmCount
}
`
;
let
url
=
`
${
OltSerUrl
.
getAlarmCount
}
`
;
//获取接口通讯方式
//
获取接口通讯方式
AmosFetch
.
get
(
url
)
AmosFetch
.
get
(
url
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
ok
)
{
if
(
res
.
ok
)
{
...
@@ -45,10 +45,10 @@ class Alarm extends Component {
...
@@ -45,10 +45,10 @@ class Alarm extends Component {
}
}
eConsole
=
param
=>
{
eConsole
=
param
=>
{
//alert(option.series[0].data.length);
//
alert(option.series[0].data.length);
//alert(option.series[0].data[i]);
//
alert(option.series[0].data[i]);
//param.dataIndex 获取当前点击索引,
//
param.dataIndex 获取当前点击索引,
//alert(param.dataIndex);
//
alert(param.dataIndex);
let
dataIndex
=
param
.
dataIndex
;
let
dataIndex
=
param
.
dataIndex
;
console
.
log
(
dataIndex
);
console
.
log
(
dataIndex
);
if
(
dataIndex
===
0
)
{
if
(
dataIndex
===
0
)
{
...
...
src/view/zonglan/home/statistics/EquipInterface.js
View file @
8e308ba4
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts
/umd
'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
option
}
from
'./chartData/EquipInterfaceData'
;
import
{
option
}
from
'./chartData/EquipInterfaceData'
;
...
...
src/view/zonglan/home/statistics/EquipProtocol.js
View file @
8e308ba4
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts
/umd
'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
option
}
from
'./chartData/EquipProtocolData'
;
import
{
option
}
from
'./chartData/EquipProtocolData'
;
import
{
countProtocolInfoAction
}
from
'./../../../../services/protocoService'
;
import
{
countProtocolInfoAction
}
from
'./../../../../services/protocoService'
;
import
{
STATICTICS_JUMP_TOPIC
}
from
'./modelConf/nodeConf'
;
import
{
STATICTICS_JUMP_TOPIC
}
from
'./modelConf/nodeConf'
;
const
num
=
2
*
10
;
//平均值乘以10
const
num
=
2
*
10
;
//
平均值乘以10
/**
/**
* 设备协议统计
* 设备协议统计
*
*
...
...
src/view/zonglan/home/statistics/PrototypeEquip.js
View file @
8e308ba4
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts/umd'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
OltSerUrl
from
'../../../../consts/urlConsts'
;
import
{
OltSerUrl
}
from
'../../../../consts/urlConsts'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
STATICTICS_JUMP_TOPIC
}
from
'./modelConf/nodeConf'
;
import
{
STATICTICS_JUMP_TOPIC
}
from
'./modelConf/nodeConf'
;
import
{
option
}
from
'./chartData/PrototypeEquipData'
;
import
{
option
}
from
'./chartData/PrototypeEquipData'
;
...
...
src/view/zonglan/home/statistics/Task.js
View file @
8e308ba4
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
OltSerUrl
from
'../../../../consts/urlConsts'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts/umd'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
{
OltSerUrl
}
from
'../../../../consts/urlConsts'
;
import
{
option
,
option1
,
option2
,
option3
}
from
'./chartData/TaskData'
;
import
{
option
,
option1
,
option2
,
option3
}
from
'./chartData/TaskData'
;
/**
/**
* 账户信息
* 账户信息
...
...
src/view/zonglan/home/statistics/TubeEquipNum.js
View file @
8e308ba4
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts'
;
import
{
PieChart
}
from
'amos-viz/lib/echarts
/umd
'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
{
AmosFetch
}
from
'../../../../utils/processor'
;
import
OltSerUrl
from
'../../../../consts/urlConsts'
;
import
{
OltSerUrl
}
from
'../../../../consts/urlConsts'
;
import
{
option
,
option2
}
from
'./chartData/TubeEquipNumData'
;
import
{
option
,
option2
}
from
'./chartData/TubeEquipNumData'
;
/**
/**
* 纳管设备数量统计
* 纳管设备数量统计
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment