Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bi
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
张苑
bi
Commits
b7b5ca5b
Commit
b7b5ca5b
authored
Oct 13, 2021
by
莫坚培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复历史数据不显示的bug&铲掉一些屎
parent
b24159bb
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
63 deletions
+102
-63
config.json
config/config.json
+2
-2
dashboard.js
js/dashboard.js
+56
-38
rightData.js
js/rightData.js
+14
-14
tokenSetting.js
js/tokenSetting.js
+3
-3
topNav.js
js/topNav.js
+20
-0
treeConfig.js
js/treeConfig.js
+1
-1
varEcharts.js
js/varEcharts.js
+3
-2
request_browserify.js
utils/request_browserify.js
+1
-1
webpack.config.js
webpack.config.js
+2
-2
No files found.
config/config.json
View file @
b7b5ca5b
{
"apiUrl"
:
"https://slmapi.shengyc.com"
,
"baseUrl"
:
"https://slm.shengyc.com"
,
"domain"
:
"shengyc.com"
,
"name"
:
"正式环境"
}
{
"apiUrl"
:
"https://api.sycdev.com"
,
"baseUrl"
:
"https://slm.sycdev.com"
,
"domain"
:
"sycdev.com"
,
"name"
:
"测试环境"
}
\ No newline at end of file
\ No newline at end of file
js/dashboard.js
View file @
b7b5ca5b
...
@@ -24,6 +24,16 @@ var Controls = {}
...
@@ -24,6 +24,16 @@ var Controls = {}
var
Common
=
{}
var
Common
=
{}
var
time
=
5000
var
time
=
5000
let
replaceConfigDetailsMap
=
{
customerid
:
'customerId'
,
cusvariabletype
:
'cusVariableType'
,
customername
:
'customerName'
,
equipmentcode
:
'equipmentCode'
,
equipmentname
:
'equipmentName'
,
equipmentid
:
'equipmentId'
,
vartype
:
'varType'
}
let
requestLoopTimer
=
null
// 轮询定时器
let
requestLoopTimer
=
null
// 轮询定时器
let
requestLoopDataPool
=
[]
// 各个组件实时刷新的请求数据,放到一个集合里,原来的多个组件请求合并成一个请求发送
let
requestLoopDataPool
=
[]
// 各个组件实时刷新的请求数据,放到一个集合里,原来的多个组件请求合并成一个请求发送
let
requestLoopStopFlag
=
false
// requestLoopDataPool请求中标志,正在请求时不进行下一波轮询,前一波请求完成才执行下一波
let
requestLoopStopFlag
=
false
// requestLoopDataPool请求中标志,正在请求时不进行下一波轮询,前一波请求完成才执行下一波
...
@@ -146,7 +156,7 @@ function searchvarible() {
...
@@ -146,7 +156,7 @@ function searchvarible() {
endTime
:
new
Date
(
varendtime
).
getTime
(),
endTime
:
new
Date
(
varendtime
).
getTime
(),
startTime
:
new
Date
(
varstarttime
).
getTime
(),
startTime
:
new
Date
(
varstarttime
).
getTime
(),
variableSearchList
:
[{
variableSearchList
:
[{
deviceId
:
searchdata
.
CheckData
.
equipmentId
?
searchdata
.
CheckData
.
equipmentId
:
searchdata
.
CheckData
.
equipmentid
,
deviceId
:
searchdata
.
CheckData
.
equipmentId
,
variableId
:
searchdata
.
CheckData
.
id
,
variableId
:
searchdata
.
CheckData
.
id
,
variableName
:
searchdata
.
CheckData
.
name
variableName
:
searchdata
.
CheckData
.
name
}]
}]
...
@@ -198,12 +208,12 @@ function searchvarible() {
...
@@ -198,12 +208,12 @@ function searchvarible() {
if
(
res
.
data
.
data
.
length
!==
0
)
{
if
(
res
.
data
.
data
.
length
!==
0
)
{
option
.
xAxis
.
data
=
res
.
data
.
data
.
x
;
option
.
xAxis
.
data
=
res
.
data
.
data
.
x
;
option
.
series
[
0
].
data
=
res
.
data
.
data
[
searchdata
.
CheckData
.
equipmentId
?
searchdata
.
CheckData
.
equipmentId
:
searchdata
.
CheckData
.
equipmentid
+
','
+
searchdata
.
CheckData
.
name
]
option
.
series
[
0
].
data
=
res
.
data
.
data
[
searchdata
.
CheckData
.
equipmentId
+
','
+
searchdata
.
CheckData
.
name
]
for
(
let
i
=
0
;
i
<
res
.
data
.
data
.
x
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
data
.
x
.
length
;
i
++
)
{
html
+=
` <tr>
html
+=
` <tr>
<td style="padding-left:10px" class="table-checkbox">
${
i
+
1
}
</td>
<td style="padding-left:10px" class="table-checkbox">
${
i
+
1
}
</td>
<td style="text-align:center">
${
res
.
data
.
data
.
x
[
i
]}
</td>
<td style="text-align:center">
${
res
.
data
.
data
.
x
[
i
]}
</td>
<td style="text-align:center">
${
res
.
data
.
data
[
searchdata
.
CheckData
.
equipmentId
?
searchdata
.
CheckData
.
equipmentId
:
searchdata
.
CheckData
.
equipmentid
+
','
+
searchdata
.
CheckData
.
name
][
i
]}
</td>
<td style="text-align:center">
${
res
.
data
.
data
[
searchdata
.
CheckData
.
equipmentId
+
','
+
searchdata
.
CheckData
.
name
][
i
]}
</td>
</tr>`
</tr>`
}
}
...
@@ -328,15 +338,17 @@ function nodeCLick(e, treeId, treeNode, type) {
...
@@ -328,15 +338,17 @@ function nodeCLick(e, treeId, treeNode, type) {
return
return
}
}
if
(
res
.
data
.
data
.
configDetails
)
{
if
(
res
.
data
.
data
.
configDetails
)
{
Controls
=
JSON
.
parse
(
res
.
data
.
data
.
configDetails
)
let
configDetails
=
res
.
data
.
data
.
configDetails
configDetails
=
configDetails
.
replace
(
/customerid|cusvariabletype|customername|equipmentcode|equipmentname|equipmentid|vartype/g
,
str
=>
{
return
replaceConfigDetailsMap
[
str
]
})
Controls
=
JSON
.
parse
(
configDetails
)
}
else
{
}
else
{
$
(
"#right-wrap"
).
empty
()
$
(
"#right-wrap"
).
empty
()
appTips
.
tipsMsg
(
'无数据'
)
appTips
.
tipsMsg
(
'无数据'
)
return
return
}
}
Controls
=
JSON
.
parse
(
res
.
data
.
data
.
configDetails
)
if
(
Controls
.
ControlList
.
lenght
!==
0
)
{
if
(
Controls
.
ControlList
.
lenght
!==
0
)
{
Controls
.
ControlList
.
forEach
(
item
=>
{
Controls
.
ControlList
.
forEach
(
item
=>
{
item
.
PropertyList
.
TrueWidth
=
item
.
PropertyList
.
Width
item
.
PropertyList
.
TrueWidth
=
item
.
PropertyList
.
Width
...
@@ -945,7 +957,7 @@ function startRequestLoop() {
...
@@ -945,7 +957,7 @@ function startRequestLoop() {
return
return
}
}
// 每一轮都把标记清除
// 每一轮都把标记清除
,缓存清除
requestLoopVaribleCache
=
{}
requestLoopVaribleCache
=
{}
Object
.
values
(
Controls
.
dataPoolMap
).
forEach
(
item
=>
{
Object
.
values
(
Controls
.
dataPoolMap
).
forEach
(
item
=>
{
item
.
isSameGroupCount
=
0
item
.
isSameGroupCount
=
0
...
@@ -1074,7 +1086,7 @@ function loopRenderBarchart(poolData, resData, resCode) {
...
@@ -1074,7 +1086,7 @@ function loopRenderBarchart(poolData, resData, resCode) {
let
left
=
poolData
.
option
.
DrawContent
.
LeftMargin
let
left
=
poolData
.
option
.
DrawContent
.
LeftMargin
variablesList
.
forEach
((
k
,
ki
)
=>
{
variablesList
.
forEach
((
k
,
ki
)
=>
{
let
dataList
=
resValue
[
`
${
k
.
CheckData
.
equipmentId
||
k
.
CheckData
.
equipmentid
}
,
${
k
.
CheckData
.
name
}
`
]
let
dataList
=
resValue
[
`
${
k
.
CheckData
.
equipmentId
}
,
${
k
.
CheckData
.
name
}
`
]
dataList
=
dataList
.
map
(
i
=>
{
dataList
=
dataList
.
map
(
i
=>
{
if
(
i
)
{
if
(
i
)
{
...
@@ -1167,7 +1179,7 @@ function loopRenderLinechart(poolData, resData, resCode) {
...
@@ -1167,7 +1179,7 @@ function loopRenderLinechart(poolData, resData, resCode) {
let
variablesList
=
poolData
.
option
.
Variables
let
variablesList
=
poolData
.
option
.
Variables
let
left
=
poolData
.
option
.
DrawContent
.
LeftMargin
let
left
=
poolData
.
option
.
DrawContent
.
LeftMargin
variablesList
.
forEach
((
k
,
ki
)
=>
{
variablesList
.
forEach
((
k
,
ki
)
=>
{
let
dataList
=
resValue
[
`
${
k
.
CheckData
.
equipmentId
||
k
.
CheckData
.
equipmentid
}
,
${
k
.
CheckData
.
name
}
`
]
let
dataList
=
resValue
[
`
${
k
.
CheckData
.
equipmentId
}
,
${
k
.
CheckData
.
name
}
`
]
dataList
=
dataList
.
map
(
item1
=>
{
dataList
=
dataList
.
map
(
item1
=>
{
if
(
item1
)
{
if
(
item1
)
{
if
(
left
<=
getTextWidth
(
String
(
item1
*
100
),
16
))
{
if
(
left
<=
getTextWidth
(
String
(
item1
*
100
),
16
))
{
...
@@ -1223,7 +1235,7 @@ function handleRequestDataLineAndBar(label, item, index) {
...
@@ -1223,7 +1235,7 @@ function handleRequestDataLineAndBar(label, item, index) {
limit
:
lineAndBarItem
.
DataCount
,
limit
:
lineAndBarItem
.
DataCount
,
variableSearchList
:
list
.
map
(
lItem
=>
{
variableSearchList
:
list
.
map
(
lItem
=>
{
return
{
return
{
deviceId
:
lItem
.
CheckData
.
equipmentId
||
lItem
.
CheckData
.
equipmentid
,
deviceId
:
lItem
.
CheckData
.
equipmentId
,
variableId
:
lItem
.
CheckData
.
id
,
variableId
:
lItem
.
CheckData
.
id
,
variableName
:
lItem
.
CheckData
.
name
variableName
:
lItem
.
CheckData
.
name
}
}
...
@@ -1259,9 +1271,9 @@ function loopRenderDashboardchart(poolData, resData, resCode) {
...
@@ -1259,9 +1271,9 @@ function loopRenderDashboardchart(poolData, resData, resCode) {
let
variableInfo
=
poolData
.
option
.
Variable
let
variableInfo
=
poolData
.
option
.
Variable
if
(
resValue
)
{
if
(
resValue
)
{
let
value
=
resValue
[
variableInfo
.
CheckData
.
equipmentId
||
variableInfo
.
CheckData
.
equipmenid
][
variableInfo
.
CheckData
.
name
]
let
value
=
resValue
[
variableInfo
.
CheckData
.
equipmentId
][
variableInfo
.
CheckData
.
name
]
// 取对应变量缓存过的值
// 取对应变量缓存过的值
let
cacheKey
=
`
${
variableInfo
.
CheckData
.
equipmentId
||
variableInfo
.
CheckData
.
equipmentid
}
-
${
variableInfo
.
CheckData
.
id
}
`
let
cacheKey
=
`
${
variableInfo
.
CheckData
.
equipmentId
}
-
${
variableInfo
.
CheckData
.
id
}
`
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
requestLoopVaribleCache
[
cacheKey
]
=
value
requestLoopVaribleCache
[
cacheKey
]
=
value
}
else
{
}
else
{
...
@@ -1290,7 +1302,7 @@ function handleRequestDataDashboard(item, index) {
...
@@ -1290,7 +1302,7 @@ function handleRequestDataDashboard(item, index) {
urlType
:
'pieChartOrPanel'
,
urlType
:
'pieChartOrPanel'
,
assemblyKey
:
`
${
index
}
-
${
item
.
Name
}
`
,
assemblyKey
:
`
${
index
}
-
${
item
.
Name
}
`
,
pieChartOrPanel
:
[{
pieChartOrPanel
:
[{
deviceId
:
VariableCheckDataObj
.
equipmentId
||
VariableCheckDataObj
.
equipmentid
,
deviceId
:
VariableCheckDataObj
.
equipmentId
,
variableId
:
VariableCheckDataObj
.
id
,
variableId
:
VariableCheckDataObj
.
id
,
variableCode
:
VariableCheckDataObj
.
name
variableCode
:
VariableCheckDataObj
.
name
}]
}]
...
@@ -1325,10 +1337,10 @@ function loopRenderPiechart(poolData, resData, resCode) {
...
@@ -1325,10 +1337,10 @@ function loopRenderPiechart(poolData, resData, resCode) {
if
(
resValue
)
{
if
(
resValue
)
{
let
variablesList
=
poolData
.
option
.
Variables
let
variablesList
=
poolData
.
option
.
Variables
variablesList
.
forEach
((
vItem
,
vIndex
)
=>
{
variablesList
.
forEach
((
vItem
,
vIndex
)
=>
{
let
value
=
resValue
[
vItem
.
CheckData
.
equipmentId
||
vItem
.
CheckData
.
equipmentid
][
vItem
.
CheckData
.
name
]
let
value
=
resValue
[
vItem
.
CheckData
.
equipmentId
][
vItem
.
CheckData
.
name
]
value
&&
(
value
=
value
.
toFixed
(
vItem
.
d
||
0
))
value
&&
(
value
=
value
.
toFixed
(
vItem
.
d
||
0
))
// 取对应变量缓存过的值
// 取对应变量缓存过的值
let
cacheKey
=
`
${
vItem
.
CheckData
.
equipmentId
||
vItem
.
CheckData
.
equipmentid
}
-
${
vItem
.
CheckData
.
id
}
`
let
cacheKey
=
`
${
vItem
.
CheckData
.
equipmentId
}
-
${
vItem
.
CheckData
.
id
}
`
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
requestLoopVaribleCache
[
cacheKey
]
=
value
requestLoopVaribleCache
[
cacheKey
]
=
value
}
else
{
}
else
{
...
@@ -1363,7 +1375,7 @@ function handleRequestDataPie(item, index) {
...
@@ -1363,7 +1375,7 @@ function handleRequestDataPie(item, index) {
let
pieChartOrPanel
=
list
.
map
(
variableItem
=>
{
let
pieChartOrPanel
=
list
.
map
(
variableItem
=>
{
let
vc
=
variableItem
.
CheckData
let
vc
=
variableItem
.
CheckData
return
{
return
{
deviceId
:
vc
.
equipmentId
||
vc
.
equipmentid
,
deviceId
:
vc
.
equipmentId
,
variableId
:
vc
.
id
,
variableId
:
vc
.
id
,
variableCode
:
vc
.
name
variableCode
:
vc
.
name
}
}
...
@@ -1408,7 +1420,7 @@ function loopRenderImage(poolData, resData, label) {
...
@@ -1408,7 +1420,7 @@ function loopRenderImage(poolData, resData, label) {
}
}
// 取对应变量缓存过的值
// 取对应变量缓存过的值
let
cacheKey
=
`
${
dlItem
.
CheckData
.
equipmentId
||
dlItem
.
CheckData
.
equipmentid
}
-
${
dlItem
.
CheckData
.
id
}
`
let
cacheKey
=
`
${
dlItem
.
CheckData
.
equipmentId
}
-
${
dlItem
.
CheckData
.
id
}
`
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
requestLoopVaribleCache
[
cacheKey
]
=
itemValue
requestLoopVaribleCache
[
cacheKey
]
=
itemValue
}
else
{
}
else
{
...
@@ -1477,7 +1489,7 @@ function loopRenderLamp(poolData, resData, label) {
...
@@ -1477,7 +1489,7 @@ function loopRenderLamp(poolData, resData, label) {
}
}
// 取对应变量缓存过的值
// 取对应变量缓存过的值
let
cacheKey
=
`
${
dlItem
.
CheckData
.
equipmentId
||
dlItem
.
CheckData
.
equipmentid
}
-
${
dlItem
.
CheckData
.
id
}
`
let
cacheKey
=
`
${
dlItem
.
CheckData
.
equipmentId
}
-
${
dlItem
.
CheckData
.
id
}
`
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
requestLoopVaribleCache
[
cacheKey
]
=
itemValue
requestLoopVaribleCache
[
cacheKey
]
=
itemValue
}
else
{
}
else
{
...
@@ -1532,7 +1544,7 @@ function handleRequestDataDataList(item, index) {
...
@@ -1532,7 +1544,7 @@ function handleRequestDataDataList(item, index) {
urlType
:
'status'
,
urlType
:
'status'
,
assemblyKey
:
`
${
index
}
-
${
dlIndex
}
-
${
dlItem
.
CheckData
.
name
}
`
,
assemblyKey
:
`
${
index
}
-
${
dlIndex
}
-
${
dlItem
.
CheckData
.
name
}
`
,
statusDataDTO
:
{
statusDataDTO
:
{
deviceId
:
dlItem
.
CheckData
.
equipmentId
||
dlItem
.
CheckData
.
equipmentid
,
deviceId
:
dlItem
.
CheckData
.
equipmentId
,
variableId
:
dlItem
.
CheckData
.
id
,
variableId
:
dlItem
.
CheckData
.
id
,
variableCode
:
dlItem
.
CheckData
.
name
variableCode
:
dlItem
.
CheckData
.
name
}
}
...
@@ -1552,7 +1564,7 @@ function loopRenderDatatextblock(poolData, resData, label) {
...
@@ -1552,7 +1564,7 @@ function loopRenderDatatextblock(poolData, resData, label) {
}
}
// 取对应变量缓存过的值
// 取对应变量缓存过的值
let
cacheKey
=
`
${
poolData
.
CheckData
.
equipmentId
||
poolData
.
CheckData
.
equipmentid
}
-
${
poolData
.
CheckData
.
id
}
`
let
cacheKey
=
`
${
poolData
.
CheckData
.
equipmentId
}
-
${
poolData
.
CheckData
.
id
}
`
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
if
(
requestLoopVaribleCache
[
cacheKey
]
===
undefined
)
{
requestLoopVaribleCache
[
cacheKey
]
=
resDataValue
requestLoopVaribleCache
[
cacheKey
]
=
resDataValue
}
else
{
}
else
{
...
@@ -1601,7 +1613,7 @@ function handleRequestDataText(item, index) {
...
@@ -1601,7 +1613,7 @@ function handleRequestDataText(item, index) {
urlType
:
'status'
,
urlType
:
'status'
,
assemblyKey
:
`
${
index
}
-
${
item
.
CheckData
.
name
}
`
,
assemblyKey
:
`
${
index
}
-
${
item
.
CheckData
.
name
}
`
,
statusDataDTO
:
{
statusDataDTO
:
{
deviceId
:
item
.
CheckData
.
equipmentId
||
item
.
CheckData
.
equipmentid
,
deviceId
:
item
.
CheckData
.
equipmentId
,
variableId
:
item
.
CheckData
.
id
,
variableId
:
item
.
CheckData
.
id
,
variableCode
:
item
.
CheckData
.
name
variableCode
:
item
.
CheckData
.
name
}
}
...
@@ -1810,14 +1822,17 @@ function jumpLinkFun(index) {
...
@@ -1810,14 +1822,17 @@ function jumpLinkFun(index) {
}
}
if
(
res
.
data
.
data
.
configDetails
)
{
if
(
res
.
data
.
data
.
configDetails
)
{
Controls
=
JSON
.
parse
(
res
.
data
.
data
.
configDetails
)
let
configDetails
=
res
.
data
.
data
.
configDetails
configDetails
=
configDetails
.
replace
(
/customerid|cusvariabletype|customername|equipmentcode|equipmentname|equipmentid|vartype/g
,
str
=>
{
return
replaceConfigDetailsMap
[
str
]
})
Controls
=
JSON
.
parse
(
configDetails
)
}
else
{
}
else
{
$
(
"#right-wrap"
).
empty
()
$
(
"#right-wrap"
).
empty
()
appTips
.
tipsMsg
(
'无数据'
)
appTips
.
tipsMsg
(
'无数据'
)
return
return
}
}
Controls
=
JSON
.
parse
(
res
.
data
.
data
.
configDetails
)
Common
=
{
Common
=
{
Name
:
Controls
.
Name
,
Name
:
Controls
.
Name
,
Position
:
Controls
.
Position
,
Position
:
Controls
.
Position
,
...
@@ -2021,7 +2036,7 @@ async function renderCommonlamp(index) {
...
@@ -2021,7 +2036,7 @@ async function renderCommonlamp(index) {
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
?
item
.
DataList
[
i
].
CheckData
.
equipmentId
:
tem
.
DataList
[
i
].
CheckData
.
equipmentid
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
// res.data.data[item.DataList[i].CheckData.id]= 0
// res.data.data[item.DataList[i].CheckData.id]= 0
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
if
(
JSON
.
stringify
(
res
.
data
.
data
)
!==
"{}"
)
{
if
(
JSON
.
stringify
(
res
.
data
.
data
)
!==
"{}"
)
{
...
@@ -2105,7 +2120,7 @@ async function renderEllipselamp(index) {
...
@@ -2105,7 +2120,7 @@ async function renderEllipselamp(index) {
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
?
item
.
DataList
[
i
].
CheckData
.
equipmentId
:
item
.
DataList
[
i
].
CheckData
.
equipmentid
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
// res.data.data[item.DataList[i].CheckData.name] = 2
// res.data.data[item.DataList[i].CheckData.name] = 2
if
(
res
.
data
.
data
)
{
if
(
res
.
data
.
data
)
{
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
...
@@ -2191,7 +2206,7 @@ async function renderDynamicText(index) {
...
@@ -2191,7 +2206,7 @@ async function renderDynamicText(index) {
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
?
item
.
DataList
[
i
].
CheckData
.
equipmentId
:
item
.
DataList
[
i
].
CheckData
.
equipmentid
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
// res.data.data[item.DataList[i].CheckData.id]= 0
// res.data.data[item.DataList[i].CheckData.id]= 0
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
if
(
JSON
.
stringify
(
res
.
data
.
data
)
!==
"{}"
)
{
if
(
JSON
.
stringify
(
res
.
data
.
data
)
!==
"{}"
)
{
...
@@ -2272,7 +2287,7 @@ async function renderImage(index) {
...
@@ -2272,7 +2287,7 @@ async function renderImage(index) {
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
item
.
DataList
.
length
;
i
++
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
variable
!==
'选择'
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
if
(
item
.
DataList
[
i
].
CheckData
)
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
?
item
.
DataList
[
i
].
CheckData
.
equipmentId
:
item
.
DataList
[
i
].
CheckData
.
equipmentid
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
await
request
.
get
(
`/bi/
${
appId
}
/variables/
${
item
.
DataList
[
i
].
CheckData
.
equipmentId
}
/
${
item
.
DataList
[
i
].
CheckData
.
id
}
/
${
item
.
DataList
[
i
].
CheckData
.
name
}
/status`
).
then
(
res
=>
{
if
(
res
.
data
.
data
)
{
if
(
res
.
data
.
data
)
{
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
let
Data
=
res
.
data
.
data
[
item
.
DataList
[
i
].
CheckData
.
name
]
if
(
JSON
.
stringify
(
res
.
data
.
data
)
!==
"{}"
)
{
if
(
JSON
.
stringify
(
res
.
data
.
data
)
!==
"{}"
)
{
...
@@ -2550,7 +2565,7 @@ function renderLineChart(item) {
...
@@ -2550,7 +2565,7 @@ function renderLineChart(item) {
let
seriesName
=
[]
let
seriesName
=
[]
c
.
option
.
Variables
.
forEach
(
d
=>
{
c
.
option
.
Variables
.
forEach
(
d
=>
{
variableSearchList
.
push
({
variableSearchList
.
push
({
deviceId
:
d
.
CheckData
.
equipmentId
?
d
.
CheckData
.
equipmentId
:
d
.
CheckData
.
equipmentid
,
deviceId
:
d
.
CheckData
.
equipmentId
,
variableId
:
d
.
CheckData
.
id
,
variableId
:
d
.
CheckData
.
id
,
variableName
:
d
.
CheckData
.
name
variableName
:
d
.
CheckData
.
name
})
})
...
@@ -2648,7 +2663,7 @@ function renderLineChart(item) {
...
@@ -2648,7 +2663,7 @@ function renderLineChart(item) {
let
y
=
res
.
data
.
data
.
y
let
y
=
res
.
data
.
data
.
y
res
.
data
.
data
.
x
.
forEach
((
kk
,
i
)
=>
{
res
.
data
.
data
.
x
.
forEach
((
kk
,
i
)
=>
{
c
.
option
.
Variables
.
forEach
(
d
=>
{
c
.
option
.
Variables
.
forEach
(
d
=>
{
let
name
=
d
.
CheckData
.
equipmentId
?
d
.
CheckData
.
equipmentId
:
d
.
CheckData
.
equipmentid
+
','
+
d
.
CheckData
.
name
let
name
=
d
.
CheckData
.
equipmentId
+
','
+
d
.
CheckData
.
name
if
(
name
==
kk
)
{
if
(
name
==
kk
)
{
keys
.
push
(
d
.
DimensionName
)
keys
.
push
(
d
.
DimensionName
)
if
(
y
[
i
])
{
if
(
y
[
i
])
{
...
@@ -3009,7 +3024,7 @@ function renderBarChart(item) {
...
@@ -3009,7 +3024,7 @@ function renderBarChart(item) {
let
seriesName
=
[]
let
seriesName
=
[]
c
.
option
.
Variables
.
forEach
(
d
=>
{
c
.
option
.
Variables
.
forEach
(
d
=>
{
variableSearchList
.
push
({
variableSearchList
.
push
({
deviceId
:
d
.
CheckData
.
equipmentId
?
d
.
CheckData
.
equipmentId
:
d
.
CheckData
.
equipmentid
,
deviceId
:
d
.
CheckData
.
equipmentId
,
variableId
:
d
.
CheckData
.
id
,
variableId
:
d
.
CheckData
.
id
,
variableName
:
d
.
CheckData
.
name
,
variableName
:
d
.
CheckData
.
name
,
})
})
...
@@ -3108,7 +3123,7 @@ function renderBarChart(item) {
...
@@ -3108,7 +3123,7 @@ function renderBarChart(item) {
res
.
data
.
data
.
x
.
forEach
((
rx
,
i
)
=>
{
res
.
data
.
data
.
x
.
forEach
((
rx
,
i
)
=>
{
// keys.push(rx.split(',')[1])
// keys.push(rx.split(',')[1])
c
.
option
.
Variables
.
forEach
(
d
=>
{
c
.
option
.
Variables
.
forEach
(
d
=>
{
let
name
=
d
.
CheckData
.
equipmentId
?
d
.
CheckData
.
equipmentId
:
d
.
CheckData
.
equipmentid
+
','
+
d
.
CheckData
.
name
let
name
=
d
.
CheckData
.
equipmentId
+
','
+
d
.
CheckData
.
name
if
(
name
==
rx
)
{
if
(
name
==
rx
)
{
keys
.
push
(
d
.
DimensionName
)
keys
.
push
(
d
.
DimensionName
)
if
(
y
[
i
])
{
if
(
y
[
i
])
{
...
@@ -3312,7 +3327,7 @@ function renderDashChart(item) {
...
@@ -3312,7 +3327,7 @@ function renderDashChart(item) {
let
variableSearchList
=
[]
let
variableSearchList
=
[]
if
(
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
)
{
if
(
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
)
{
variableSearchList
=
[{
variableSearchList
=
[{
deviceId
:
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
equipmentId
?
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
equipmentId
:
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
equipmentid
,
deviceId
:
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
equipmentId
,
variableId
:
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
id
,
variableId
:
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
id
,
variableName
:
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
name
variableName
:
Controls
.
Data
.
DashBoardChartItemList
[
cIndex
].
option
.
Variable
.
CheckData
.
name
}]
}]
...
@@ -3428,7 +3443,7 @@ function renderDashChart(item) {
...
@@ -3428,7 +3443,7 @@ function renderDashChart(item) {
let
dashData
=
res
.
data
.
data
let
dashData
=
res
.
data
.
data
dashData
.
x
.
forEach
((
item
,
index
)
=>
{
dashData
.
x
.
forEach
((
item
,
index
)
=>
{
// variableSearchList.forEach((k, ki) => {
// variableSearchList.forEach((k, ki) => {
let
name
=
d
.
CheckData
.
equipmentId
?
d
.
CheckData
.
equipmentId
:
d
.
CheckData
.
equipmentid
+
','
+
d
.
CheckData
.
name
let
name
=
d
.
CheckData
.
equipmentId
+
','
+
d
.
CheckData
.
name
if
(
item
==
name
)
if
(
item
==
name
)
serireData
.
push
({
serireData
.
push
({
value
:
dashData
.
y
[
index
]
?
Number
(
dashData
.
y
[
index
]).
toFixed
(
d
.
d
?
d
.
d
:
0
)
:
0
,
value
:
dashData
.
y
[
index
]
?
Number
(
dashData
.
y
[
index
]).
toFixed
(
d
.
d
?
d
.
d
:
0
)
:
0
,
...
@@ -3611,7 +3626,7 @@ function renderPieChart(item) {
...
@@ -3611,7 +3626,7 @@ function renderPieChart(item) {
let
d
=
list
[
i
]
let
d
=
list
[
i
]
if
(
d
.
CheckData
)
{
if
(
d
.
CheckData
)
{
variableSearchList
.
push
({
variableSearchList
.
push
({
deviceId
:
d
.
CheckData
.
equipmentId
?
d
.
CheckData
.
equipmentId
:
d
.
CheckData
.
equipmentid
,
deviceId
:
d
.
CheckData
.
equipmentId
,
variableId
:
d
.
CheckData
.
id
,
variableId
:
d
.
CheckData
.
id
,
variableName
:
d
.
CheckData
.
name
variableName
:
d
.
CheckData
.
name
})
})
...
@@ -3736,9 +3751,11 @@ function renderPieChart(item) {
...
@@ -3736,9 +3751,11 @@ function renderPieChart(item) {
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
x
)
{
if
(
res
.
data
.
data
&&
res
.
data
.
data
.
x
)
{
res
.
data
.
data
.
x
.
forEach
((
xf
,
xfi
)
=>
{
res
.
data
.
data
.
x
.
forEach
((
xf
,
xfi
)
=>
{
Controls
.
Data
.
PieChartItemList
[
cIndex
].
option
.
Variables
.
forEach
((
d
,
dIndex
)
=>
{
Controls
.
Data
.
PieChartItemList
[
cIndex
].
option
.
Variables
.
forEach
((
d
,
dIndex
)
=>
{
let
name
=
d
.
CheckData
.
equipmentId
?
d
.
CheckData
.
equipmentId
:
d
.
CheckData
.
equipmentid
+
','
+
d
.
CheckData
.
name
let
name
=
`
${
d
.
CheckData
.
equipmentId
}
,
${
d
.
CheckData
.
name
}
`
if
(
name
==
xf
)
{
if
(
name
==
xf
)
{
serireData
.
push
({
serireData
.
push
({
// value: xfi % 2 > 0 ? xfi : -xfi,
value
:
res
.
data
.
data
.
y
[
xfi
]
===
null
?
0
:
Number
(
res
.
data
.
data
.
y
[
xfi
]).
toFixed
(
d
.
d
?
d
.
d
:
0
),
value
:
res
.
data
.
data
.
y
[
xfi
]
===
null
?
0
:
Number
(
res
.
data
.
data
.
y
[
xfi
]).
toFixed
(
d
.
d
?
d
.
d
:
0
),
name
:
d
.
DimensionName
,
name
:
d
.
DimensionName
,
label
:
a
.
series
[
0
].
data
[
0
].
label
,
label
:
a
.
series
[
0
].
data
[
0
].
label
,
...
@@ -3751,6 +3768,7 @@ function renderPieChart(item) {
...
@@ -3751,6 +3768,7 @@ function renderPieChart(item) {
})
})
})
})
console
.
log
(
titleData
,
serireData
);
a
.
legend
[
0
].
data
=
titleData
a
.
legend
[
0
].
data
=
titleData
a
.
series
[
0
].
data
=
serireData
a
.
series
[
0
].
data
=
serireData
}
}
...
@@ -4060,7 +4078,7 @@ function dblOpen(index, i, prop) {
...
@@ -4060,7 +4078,7 @@ function dblOpen(index, i, prop) {
endTime
:
new
Date
(
varendtime
).
getTime
(),
endTime
:
new
Date
(
varendtime
).
getTime
(),
startTime
:
new
Date
(
varstarttime
).
getTime
(),
startTime
:
new
Date
(
varstarttime
).
getTime
(),
variableSearchList
:
[{
variableSearchList
:
[{
deviceId
:
index
.
CheckData
.
equipmentId
?
index
.
CheckData
.
equipmentId
:
index
.
CheckData
.
equipmentid
,
deviceId
:
index
.
CheckData
.
equipmentId
,
variableId
:
index
.
CheckData
.
id
,
variableId
:
index
.
CheckData
.
id
,
variableName
:
index
.
CheckData
.
name
variableName
:
index
.
CheckData
.
name
}]
}]
...
@@ -4110,14 +4128,14 @@ function dblOpen(index, i, prop) {
...
@@ -4110,14 +4128,14 @@ function dblOpen(index, i, prop) {
let
html
=
''
let
html
=
''
if
(
res
.
data
.
data
.
length
!==
0
)
{
if
(
res
.
data
.
data
.
length
!==
0
)
{
option
.
xAxis
.
data
=
res
.
data
.
data
.
x
;
option
.
xAxis
.
data
=
res
.
data
.
data
.
x
;
option
.
series
[
0
].
data
=
res
.
data
.
data
[
searchdata
.
CheckData
.
equipmentId
?
searchdata
.
CheckData
.
equipmentId
:
searchdata
.
CheckData
.
equipmentid
+
','
+
searchdata
.
CheckData
.
name
]
option
.
series
[
0
].
data
=
res
.
data
.
data
[
searchdata
.
CheckData
.
equipmentId
+
','
+
searchdata
.
CheckData
.
name
]
for
(
let
i
=
0
;
i
<
res
.
data
.
data
.
x
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
data
.
x
.
length
;
i
++
)
{
html
+=
` <tr>
html
+=
` <tr>
<td style="padding-left:10px" class="table-checkbox">
${
i
+
1
}
</td>
<td style="padding-left:10px" class="table-checkbox">
${
i
+
1
}
</td>
<td style="text-align:center">
${
res
.
data
.
data
.
x
[
i
]}
</td>
<td style="text-align:center">
${
res
.
data
.
data
.
x
[
i
]}
</td>
<td style="text-align:center">
${
res
.
data
.
data
[
index
.
CheckData
.
equipmentId
?
index
.
CheckData
.
equipmentId
:
index
.
CheckData
.
equipmentid
+
','
+
index
.
CheckData
.
name
][
i
]}
</td>
<td style="text-align:center">
${
res
.
data
.
data
[
index
.
CheckData
.
equipmentId
+
','
+
index
.
CheckData
.
name
][
i
]}
</td>
</tr>`
</tr>`
}
}
...
...
js/rightData.js
View file @
b7b5ca5b
...
@@ -620,35 +620,35 @@ function addIframeField(newField, elem) {
...
@@ -620,35 +620,35 @@ function addIframeField(newField, elem) {
function
addIframeAttr
(
newCheck
,
elem
)
{
function
addIframeAttr
(
newCheck
,
elem
)
{
newCheck
.
forEach
(
item
=>
{
newCheck
.
forEach
(
item
=>
{
// $("#data-line").contents().find(".newAdd").on('click','', {data: item}, $("#data-line").contents().find(".newAdd").click())
// $("#data-line").contents().find(".newAdd").on('click','', {data: item}, $("#data-line").contents().find(".newAdd").click())
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-cus
VariableT
ype"
,
item
.
cusVariableType
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-cus
-variable-t
ype"
,
item
.
cusVariableType
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-customer
I
d"
,
item
.
customerId
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-customer
-i
d"
,
item
.
customerId
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-customer
N
ame"
,
item
.
customerName
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-customer
-n
ame"
,
item
.
customerName
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-desc"
,
item
.
desc
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-desc"
,
item
.
desc
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-equipment
C
ode"
,
item
.
equipmentCode
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-equipment
-c
ode"
,
item
.
equipmentCode
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-equipment
I
d"
,
item
.
equipmentId
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-equipment
-i
d"
,
item
.
equipmentId
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-equipment
N
ame"
,
item
.
equipmentName
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-equipment
-n
ame"
,
item
.
equipmentName
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-from"
,
item
.
from
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-from"
,
item
.
from
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-id"
,
item
.
id
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-id"
,
item
.
id
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-name"
,
item
.
name
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-name"
,
item
.
name
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-type"
,
item
.
type
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-type"
,
item
.
type
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-unit"
,
item
.
unit
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-unit"
,
item
.
unit
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-var
T
ype"
,
item
.
varType
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
attr
(
"data-var
-t
ype"
,
item
.
varType
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
click
()
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
click
()
})
})
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-cus
VariableT
ype"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-cus
-variable-t
ype"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-customer
I
d"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-customer
-i
d"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-customer
N
ame"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-customer
-n
ame"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-desc"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-desc"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-equipment
C
ode"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-equipment
-c
ode"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-equipment
I
d"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-equipment
-i
d"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-equipment
N
ame"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-equipment
-n
ame"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-from"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-from"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-id"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-id"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-name"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-name"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-type"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-type"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-unit"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-unit"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-var
T
ype"
)
$
(
`#
${
elem
}
`
).
contents
().
find
(
".newAdd"
).
removeAttr
(
"data-var
-t
ype"
)
}
}
// 打开添加条件弹窗
// 打开添加条件弹窗
...
...
js/tokenSetting.js
View file @
b7b5ca5b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @description: 文件描述
* @description: 文件描述
* @Date: 2021-09-16 18:33:55
* @Date: 2021-09-16 18:33:55
* @LastEditors: 莫靓仔
* @LastEditors: 莫靓仔
* @LastEditTime: 2021-
09-30 17:26:44
* @LastEditTime: 2021-
10-13 09:31:58
*/
*/
let
setObj
=
{
let
setObj
=
{
// 厂家大佬
// 厂家大佬
...
@@ -14,7 +14,7 @@ let setObj = {
...
@@ -14,7 +14,7 @@ let setObj = {
},
},
// test-123
// test-123
set2
:
{
set2
:
{
devToken
:
'
5b0784dd-ad5b-43ec-a851-053763233c91
'
,
devToken
:
'
2eddd39b-695e-4b8f-9abe-a65ca4bbaab3
'
,
devAppId
:
'TEST123_o582'
,
devAppId
:
'TEST123_o582'
,
devTenantId
:
'TEST123_o582'
devTenantId
:
'TEST123_o582'
},
},
...
@@ -38,7 +38,7 @@ let setObj = {
...
@@ -38,7 +38,7 @@ let setObj = {
}
}
}
}
let
defaultObj
=
'set
5
'
let
defaultObj
=
'set
2
'
window
.
devToken
=
setObj
[
defaultObj
].
devToken
window
.
devToken
=
setObj
[
defaultObj
].
devToken
window
.
devAppId
=
setObj
[
defaultObj
].
devAppId
window
.
devAppId
=
setObj
[
defaultObj
].
devAppId
window
.
devTenantId
=
setObj
[
defaultObj
].
devTenantId
window
.
devTenantId
=
setObj
[
defaultObj
].
devTenantId
js/topNav.js
View file @
b7b5ca5b
let
replaceConfigDetailsMap
=
{
customerid
:
'customerId'
,
cusvariabletype
:
'cusVariableType'
,
customername
:
'customerName'
,
equipmentcode
:
'equipmentCode'
,
equipmentname
:
'equipmentName'
,
equipmentid
:
'equipmentId'
,
vartype
:
'varType'
}
/* 顶部导航栏事件 */
/* 顶部导航栏事件 */
// 预览功能
// 预览功能
function
preview
()
{
function
preview
()
{
...
@@ -303,6 +313,9 @@ function save() {
...
@@ -303,6 +313,9 @@ function save() {
})
})
}
}
configDetails
=
JSON
.
stringify
(
Controls
)
configDetails
=
JSON
.
stringify
(
Controls
)
configDetails
=
configDetails
.
replace
(
/customerid|cusvariabletype|customername|equipmentcode|equipmentname|equipmentid|vartype/g
,
str
=>
{
return
replaceConfigDetailsMap
[
str
]
})
let
postData
=
{
let
postData
=
{
assemblys
,
assemblys
,
configDetails
,
configDetails
,
...
@@ -402,6 +415,9 @@ function saveAs() {
...
@@ -402,6 +415,9 @@ function saveAs() {
})
})
})
})
configDetails
=
JSON
.
stringify
(
Controls
)
configDetails
=
JSON
.
stringify
(
Controls
)
configDetails
=
configDetails
.
replace
(
/customerid|cusvariabletype|customername|equipmentcode|equipmentname|equipmentid|vartype/g
,
str
=>
{
return
replaceConfigDetailsMap
[
str
]
})
let
postData
=
{
let
postData
=
{
assemblys
,
assemblys
,
configDetails
,
configDetails
,
...
@@ -497,6 +513,10 @@ function savePublish() {
...
@@ -497,6 +513,10 @@ function savePublish() {
})
})
})
})
configDetails
=
JSON
.
stringify
(
Controls
)
configDetails
=
JSON
.
stringify
(
Controls
)
configDetails
=
configDetails
.
replace
(
/customerid|cusvariabletype|customername|equipmentcode|equipmentname|equipmentid|vartype/g
,
str
=>
{
return
replaceConfigDetailsMap
[
str
]
})
console
.
log
(
'Controls'
,
Controls
);
let
postData
=
{
let
postData
=
{
assemblys
,
assemblys
,
configDetails
,
configDetails
,
...
...
js/treeConfig.js
View file @
b7b5ca5b
...
@@ -15,7 +15,7 @@ var panelId = "" // panelId写死,后面需修改为动态获取
...
@@ -15,7 +15,7 @@ var panelId = "" // panelId写死,后面需修改为动态获取
panelId
=
getParams
(
'panelId'
,
window
.
location
.
href
)
panelId
=
getParams
(
'panelId'
,
window
.
location
.
href
)
// 21302abdb343edf09f84b6f9d900537c
// 21302abdb343edf09f84b6f9d900537c
// panelId = panelId ? panelId : '1cff8876dc96a8adac114ecbe1bd9652'
// panelId = panelId ? panelId : '1cff8876dc96a8adac114ecbe1bd9652'
panelId
=
panelId
?
panelId
:
'1
c792524337704365227fa09db2ac5e1
'
panelId
=
panelId
?
panelId
:
'1
1667dfb200c3e0209953a2497328fad
'
// 复用树
// 复用树
var
reuseData
=
[
var
reuseData
=
[
// { id:1, pId:0, name:"文件 1", open:true},
// { id:1, pId:0, name:"文件 1", open:true},
...
...
js/varEcharts.js
View file @
b7b5ca5b
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
* @Description: 这是图表 表格选择(组件)
* @Description: 这是图表 表格选择(组件)
* @Date: 2021-03-10 14:52:54
* @Date: 2021-03-10 14:52:54
* @Author: Tao
* @Author: Tao
* @LastEditors:
Tao
* @LastEditors:
莫靓仔
* @LastEditTime: 2021-
04-02 14:25:57
* @LastEditTime: 2021-
10-13 14:41:45
*/
*/
//折线图改变
//折线图改变
function
LineEchartsFun2
(
BarChartData
)
{
function
LineEchartsFun2
(
BarChartData
)
{
...
@@ -1495,6 +1495,7 @@ function varEchartsFun(data, type, refresh) {
...
@@ -1495,6 +1495,7 @@ function varEchartsFun(data, type, refresh) {
$
(
'.newAdd'
).
unbind
()
$
(
'.newAdd'
).
unbind
()
$
(
'.newAdd'
).
on
(
'click'
,
function
()
{
$
(
'.newAdd'
).
on
(
'click'
,
function
()
{
let
dataObj
=
JSON
.
parse
(
JSON
.
stringify
(
$
(
'.newAdd'
)[
0
].
dataset
))
let
dataObj
=
JSON
.
parse
(
JSON
.
stringify
(
$
(
'.newAdd'
)[
0
].
dataset
))
console
.
log
(
'dataObj'
,
dataObj
);
if
(
defaultVar
.
length
==
10
)
{
if
(
defaultVar
.
length
==
10
)
{
return
return
}
}
...
...
utils/request_browserify.js
View file @
b7b5ca5b
(
function
(){
function
r
(
e
,
n
,
t
){
function
o
(
i
,
f
){
if
(
!
n
[
i
]){
if
(
!
e
[
i
]){
var
c
=
"function"
==
typeof
require
&&
require
;
if
(
!
f
&&
c
)
return
c
(
i
,
!
0
);
if
(
u
)
return
u
(
i
,
!
0
);
var
a
=
new
Error
(
"Cannot find module '"
+
i
+
"'"
);
throw
a
.
code
=
"MODULE_NOT_FOUND"
,
a
}
var
p
=
n
[
i
]
=
{
exports
:{}};
e
[
i
][
0
].
call
(
p
.
exports
,
function
(
r
){
var
n
=
e
[
i
][
1
][
r
];
return
o
(
n
||
r
)},
p
,
p
.
exports
,
r
,
e
,
n
,
t
)}
return
n
[
i
].
exports
}
for
(
var
u
=
"function"
==
typeof
require
&&
require
,
i
=
0
;
i
<
t
.
length
;
i
++
)
o
(
t
[
i
]);
return
o
}
return
r
})()({
1
:[
function
(
require
,
module
,
exports
){
(
function
(){
function
r
(
e
,
n
,
t
){
function
o
(
i
,
f
){
if
(
!
n
[
i
]){
if
(
!
e
[
i
]){
var
c
=
"function"
==
typeof
require
&&
require
;
if
(
!
f
&&
c
)
return
c
(
i
,
!
0
);
if
(
u
)
return
u
(
i
,
!
0
);
var
a
=
new
Error
(
"Cannot find module '"
+
i
+
"'"
);
throw
a
.
code
=
"MODULE_NOT_FOUND"
,
a
}
var
p
=
n
[
i
]
=
{
exports
:{}};
e
[
i
][
0
].
call
(
p
.
exports
,
function
(
r
){
var
n
=
e
[
i
][
1
][
r
];
return
o
(
n
||
r
)},
p
,
p
.
exports
,
r
,
e
,
n
,
t
)}
return
n
[
i
].
exports
}
for
(
var
u
=
"function"
==
typeof
require
&&
require
,
i
=
0
;
i
<
t
.
length
;
i
++
)
o
(
t
[
i
]);
return
o
}
return
r
})()({
1
:[
function
(
require
,
module
,
exports
){
module
.
exports
=
{
"apiUrl"
:
"https://
slmapi.shengyc.com"
,
"baseUrl"
:
"https://slm.shengyc.com"
,
"domain"
:
"shengyc.com"
,
"name"
:
"正式
环境"
}
module
.
exports
=
{
"apiUrl"
:
"https://
api.sycdev.com"
,
"baseUrl"
:
"https://slm.sycdev.com"
,
"domain"
:
"sycdev.com"
,
"name"
:
"测试
环境"
}
},{}],
2
:[
function
(
require
,
module
,
exports
){
},{}],
2
:[
function
(
require
,
module
,
exports
){
// // 配置axios
// // 配置axios
let
configInfo
=
require
(
'../config/config.json'
)
let
configInfo
=
require
(
'../config/config.json'
)
...
...
webpack.config.js
View file @
b7b5ca5b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @description: 本地run的webpack配置
* @description: 本地run的webpack配置
* @Date: 2021-08-19 17:10:54
* @Date: 2021-08-19 17:10:54
* @LastEditors: 莫靓仔
* @LastEditors: 莫靓仔
* @LastEditTime: 2021-
09-28 13:44:20
* @LastEditTime: 2021-
10-13 09:30:21
*/
*/
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
// const webpack = require('webpack')
// const webpack = require('webpack')
...
@@ -31,7 +31,7 @@ module.exports = {
...
@@ -31,7 +31,7 @@ module.exports = {
// hot: true,
// hot: true,
// 端口号
// 端口号
port
:
8002
,
port
:
8002
,
host
:
'192.168.1.11
9
'
,
// 本机ip
host
:
'192.168.1.11
3
'
,
// 本机ip
// 是否压缩
// 是否压缩
compress
:
true
,
compress
:
true
,
// 当前目录
// 当前目录
...
...
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