Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
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
海康威视
web-project
Commits
7d73c86f
Commit
7d73c86f
authored
Aug 26, 2024
by
裴文涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定换热站功能调整
parent
ca388f4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
BindWindow.vue
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
+27
-5
No files found.
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
View file @
7d73c86f
...
...
@@ -36,7 +36,9 @@ const bindData = ref({}) // 要绑定的数据
const
supplyData
=
ref
([])
// 供热站数据
const
transferData
=
ref
([])
// 换热站数据
const
selectedTransfer
=
ref
([])
// 被本气象干预方案选中的换热站
const
isSaveOper
=
ref
(
false
)
let
optional
=
''
// 可以选换热站的供热站
let
originSupply
=
''
// 原先绑定的供热站
let
loadingInstance
=
null
const
inputStyle
=
{
color
:
'black'
,
...
...
@@ -68,6 +70,7 @@ function onSubmit() {
updateNullFields
:
''
})
})
bindData
.
value
.
isAuto
=
bindData
.
value
.
isAuto
===
'自动模式'
?
true
:
false
;
bindData
.
value
.
isFixed
=
bindData
.
value
.
isFixed
===
'固定模式'
?
true
:
false
;
bindData
.
value
.
updateNullFields
=
""
...
...
@@ -93,25 +96,32 @@ async function getTransfer(supplyId, isAvailable = true) {
*/
const
result
=
await
getTransferInterface
(
param
)
transferData
.
value
=
result
.
data
if
(
isAvailable
){
// 每次需要为换热站推入数据时,清空已有的数据
selectedTransfer
.
value
.
length
=
0
}
//
if(isAvailable){
//
// 每次需要为换热站推入数据时,清空已有的数据
//
selectedTransfer.value.length = 0
//
}
for
(
const
item
of
transferData
.
value
)
{
if
(
!
isAvailable
)
{
item
.
selected
=
item
.
selected
.
toLowerCase
()
===
'true'
?
true
:
false
item
.
enabled
=
false
if
(
item
.
selected
)
{
if
(
optional
!==
originSupply
&&
bindData
.
value
.
supplyId
===
originSupply
){
continue
}
selectedTransfer
.
value
.
push
(
item
.
transferId
)
}
}
else
{
item
.
selected
=
item
.
selected
.
toLowerCase
()
===
'true'
?
true
:
false
item
.
enabled
=
item
.
enabled
.
toLowerCase
()
===
'true'
?
true
:
false
if
(
item
.
selected
)
{
if
(
optional
!==
originSupply
&&
bindData
.
value
.
supplyId
===
originSupply
){
continue
}
selectedTransfer
.
value
.
push
(
item
.
transferId
)
}
}
}
selectedTransfer
.
value
=
[...
unique
(
selectedTransfer
.
value
)]
loadingInstance
.
close
()
}
...
...
@@ -124,6 +134,7 @@ function onOpen() {
if
(
bindData
.
value
.
hasOwnProperty
(
'supplyId'
))
{
if
(
bindData
.
value
.
supplyId
)
{
optional
=
bindData
.
value
.
supplyId
originSupply
=
bindData
.
value
.
supplyId
getTransfer
(
bindData
.
value
.
supplyId
)
}
}
...
...
@@ -139,10 +150,13 @@ function selectChange(val) {
loadingInstance
=
ElLoading
.
service
({
target
:
'#bind-dialog'
})
if
(
selectedTransfer
.
value
.
length
===
0
)
{
getTransfer
(
val
)
isSaveOper
.
value
=
false
}
else
if
(
bindData
.
value
.
supplyId
===
optional
)
{
getTransfer
(
val
)
isSaveOper
.
value
=
false
}
else
{
getTransfer
(
val
,
false
)
isSaveOper
.
value
=
true
}
loadingInstance
.
close
()
}
...
...
@@ -152,8 +166,16 @@ function selectChange(val) {
* @param val
*/
function
checkboxChange
(
val
)
{
optional
=
bindData
.
value
.
supplyId
// console.log('checkboxChange====>>>===>>>', val)
}
/**
* 过滤器,用于过滤掉重复的换热站ID
*/
function
unique
(
arr
){
return
new
Set
(
arr
)
}
</
script
>
<
template
>
<el-dialog
...
...
@@ -207,7 +229,7 @@ function checkboxChange(val) {
</
template
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
保存
</el-button>
<el-button
type=
"primary"
:disabled=
"isSaveOper"
@
click=
"onSubmit"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"emit('onCancel')"
>
关闭
</el-button>
</div>
</
template
>
...
...
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