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
ed9df492
Commit
ed9df492
authored
Aug 19, 2024
by
裴文涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决修改窗口数据覆盖Bug
parent
a69eeefe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
92 deletions
+49
-92
WeatherManagePage.vue
src/views/SchedulingPage/WeatherManagePage.vue
+4
-27
AddWindow.vue
src/views/SchedulingPage/weatherManageSub/AddWindow.vue
+2
-2
BindWindow.vue
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
+4
-0
ReviseWindow.vue
src/views/SchedulingPage/weatherManageSub/ReviseWindow.vue
+39
-63
No files found.
src/views/SchedulingPage/WeatherManagePage.vue
View file @
ed9df492
...
...
@@ -51,9 +51,7 @@ function search() {
}
}
const
revise
=
(
row
)
=>
{
// 修改按钮单击事件
console
.
log
(
'row的值:'
,
row
)
dependentSub
.
value
=
data
.
value
[
row
]
// console.log('dependentSub的值:', dependentSub.value)
dependentSub
.
value
=
row
reviseWindowOpen
.
value
=
true
}
const
bind
=
(
row
)
=>
{
// 绑定按钮单击事件
...
...
@@ -62,7 +60,6 @@ const bind = (row) => { // 绑定按钮单击事件
}
const
cancelRevise
=
()
=>
{
reviseWindowOpen
.
value
=
false
reset
()
getData
()
}
const
confirmRevise
=
val
=>
{
// 修改弹窗确认按钮事件
...
...
@@ -138,7 +135,6 @@ function getData() {
getWeatherMagData
().
then
(
res
=>
{
data
.
value
=
res
.
data
dataBackup
.
value
=
[...
data
.
value
];
console
.
log
(
'获取到的所有数据'
,
data
.
value
)
})
}
function
handleAddWinOpenClose
(){
...
...
@@ -198,26 +194,7 @@ function getOrganizationStructure() {
ElMessage
.
error
(
'接口异常,获取数据失败.'
)
})
}
// 获取组织结构
function
reset
(){
dependentSub
.
value
=
{
allowPagingId
:
""
,
temperature
:
""
,
wind
:
""
,
illumination
:
""
,
diffPercentage
:
""
,
timeoutMin
:
""
,
tempRegulation
:
""
,
sort
:
""
,
customizeName
:
""
,
supplyName
:
""
,
customizeId
:
""
,
isFixed
:
""
,
isAuto
:
""
,
supplyId
:
""
,
operateTime
:
""
,
updateNullFields
:
''
}
}
function
resetSearch
(){
isAutoSearchKey
.
value
=
''
supplySearchKey
.
value
=
''
...
...
@@ -254,7 +231,7 @@ function resetSearch(){
border
style=
"width: 100%"
height=
"720px"
:default-sort=
"
{ prop: 'operateTime', order: 'descending' }"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass">
<el-table-column
prop=
"allowPagingId"
label=
"编号"
align=
"center"
width=
"60"
/>
...
...
@@ -273,7 +250,7 @@ function resetSearch(){
<el-table-column
label=
"操作"
fixed=
"right"
width=
"200"
>
<template
#
default=
"scope"
>
<div
class=
"table-operate-column"
>
<el-button
link
@
click=
"revise(scope.
$index
)"
type=
"primary"
>
修改
</el-button>
<el-button
link
@
click=
"revise(scope.
row
)"
type=
"primary"
>
修改
</el-button>
<el-button
link
@
click=
"bind(scope.row)"
type=
"primary"
>
绑定换热站
</el-button>
</div>
</
template
>
...
...
src/views/SchedulingPage/weatherManageSub/AddWindow.vue
View file @
ed9df492
...
...
@@ -94,7 +94,7 @@ const rules = reactive({
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"风速必须是1-11位实数"
,
trigger
:
"blur"
}
],
illumination
:
[
{
pattern
:
/^
(\d{1,
11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"光照必须是1-11
位实数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,
2})?
$/
,
"message"
:
"光照必须是1-2
位实数"
,
trigger
:
"blur"
}
],
sort
:
[
{
pattern
:
/^
(\d{1,11})
$/
,
"message"
:
"排序必须是1-11位正整数"
,
trigger
:
"blur"
}
...
...
@@ -155,7 +155,7 @@ const rules = reactive({
<el-col
:span=
"8"
class=
"content-col-label"
>
光照:
</el-col>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-form-item
prop=
"illumination"
style=
"padding: 0;margin: 0;"
>
<el-input
:input-style=
"inputStyle"
maxlength=
"
11
"
v-model=
"addData.illumination"
<el-input
:input-style=
"inputStyle"
maxlength=
"
2
"
v-model=
"addData.illumination"
style=
"width: 510px"
/>
</el-form-item>
</el-col>
...
...
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
View file @
ed9df492
...
...
@@ -68,6 +68,9 @@ function onSubmit() {
updateNullFields
:
''
})
})
bindData
.
value
.
isAuto
=
bindData
.
value
.
isAuto
===
'自动模式'
?
true
:
false
;
bindData
.
value
.
isFixed
=
bindData
.
value
.
isFixed
===
'固定模式'
?
true
:
false
;
bindData
.
value
.
updateNullFields
=
""
emit
(
'onConfirm'
,
bindData
.
value
)
}
else
{
ElMessage
.
error
(
'请选择供热站'
)
...
...
@@ -110,6 +113,7 @@ async function getTransfer(supplyId, isAvailable = true) {
function
onOpen
()
{
bindData
.
value
.
transfers
=
[]
loadingInstance
=
ElLoading
.
service
({
target
:
'#bind-dialog'
})
selectedTransfer
.
value
.
length
=
0
// 清空已选择的换热站
transferData
.
value
.
length
=
0
// 清空显示的换热站
...
...
src/views/SchedulingPage/weatherManageSub/ReviseWindow.vue
View file @
ed9df492
...
...
@@ -24,22 +24,22 @@ const emit = defineEmits({
}
})
const
reviseData
=
ref
({
allowPagingId
:
""
,
temperature
:
""
,
wind
:
""
,
illumination
:
""
,
diffPercentage
:
""
,
timeoutMin
:
""
,
tempRegulation
:
""
,
sort
:
""
,
customizeName
:
""
,
supplyName
:
""
,
customizeId
:
""
,
isFixed
:
""
,
isAuto
:
""
,
supplyId
:
""
,
operateTime
:
""
,
updateNullFields
:
''
allowPagingId
:
""
,
temperature
:
""
,
wind
:
""
,
illumination
:
""
,
diffPercentage
:
""
,
timeoutMin
:
""
,
tempRegulation
:
""
,
sort
:
""
,
customizeName
:
""
,
supplyName
:
""
,
customizeId
:
""
,
isFixed
:
""
,
isAuto
:
""
,
supplyId
:
""
,
operateTime
:
""
,
updateNullFields
:
''
})
const
formRef
=
ref
()
...
...
@@ -53,7 +53,7 @@ const rules = reactive({
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"风速必须是1-11位实数"
,
trigger
:
"blur"
}
],
illumination
:
[
{
pattern
:
/^
(\d{1,
11})(\.[
0-9
]{1,4
})?
$/
,
"message"
:
"光照必须是1-11位实数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,
2
})?
$/
,
"message"
:
"光照必须是1-11位实数"
,
trigger
:
"blur"
}
],
sort
:
[
{
pattern
:
/^
(\d{1,11})
$/
,
"message"
:
"排序必须是1-11位正整数"
,
trigger
:
"blur"
}
...
...
@@ -67,10 +67,7 @@ const rules = reactive({
]
});
watchEffect
(()
=>
{
// reviseData.value = {...props.data}
// props.data.transfers = []
reviseData
.
value
=
props
.
data
// 深拷贝数据
// console.log('>>>>>>>>>>>',props.data)
})
const
inputStyle
=
{
color
:
'black'
,
...
...
@@ -89,20 +86,20 @@ const switchingisAuto = computed({
}
})
// 可写计算属性,手动、自动模式切换
function
onOpen
()
{
// console.log('点击弹窗:',reviseData.value)
// console.log('props的值:', props.data)
formRef
.
value
.
resetFields
()
reviseData
.
value
.
updateNullFields
=
""
}
async
function
handleConfirm
()
{
if
(
reviseData
.
value
.
hasOwnProperty
(
'supplyId'
))
{
if
(
reviseData
.
value
.
supplyId
)
{
getTransferInterface
({
customizeId
:
reviseData
.
value
.
customizeId
,
supplyId
:
reviseData
.
value
.
supplyId
}).
then
(
result
=>
{
function
handleConfirm
()
{
reviseData
.
value
.
transfers
=
[]
formRef
.
value
.
validate
(
async
valid
=>
{
if
(
valid
)
{
if
(
reviseData
.
value
.
supplyId
!==
undefined
&&
reviseData
.
value
.
supplyId
!==
''
)
{
const
result
=
await
getTransferInterface
({
customizeId
:
reviseData
.
value
.
customizeId
,
supplyId
:
reviseData
.
value
.
supplyId
})
for
(
let
item
of
result
.
data
)
{
if
(
item
.
selected
.
toLowerCase
()
===
'true'
)
{
if
(
item
.
selected
.
toLowerCase
()
===
'true'
)
{
reviseData
.
value
.
transfers
.
push
(
{
customizeId
:
reviseData
.
value
.
customizeId
,
...
...
@@ -112,42 +109,21 @@ async function handleConfirm() {
)
}
}
formRef
.
value
.
validate
(
valid
=>
{
if
(
valid
)
{
emit
(
'onConfirm'
,
reviseData
.
value
)
reset
()
}
}
)
}
)
}
else
{
delete
reviseData
.
value
.
supplyId
}
reviseData
.
value
.
isAuto
=
reviseData
.
value
.
isAuto
===
'自动模式'
?
true
:
false
;
reviseData
.
value
.
isFixed
=
reviseData
.
value
.
isFixed
===
'固定模式'
?
true
:
false
;
console
.
log
(
'修改数据'
,
reviseData
.
value
)
emit
(
'onConfirm'
,
reviseData
.
value
)
}
}
})
}
function
onClose
(){
function
onClose
()
{
emit
(
'onCancel'
)
reset
()
}
function
reset
(){
reviseData
.
value
=
{
allowPagingId
:
""
,
temperature
:
""
,
wind
:
""
,
illumination
:
""
,
diffPercentage
:
""
,
timeoutMin
:
""
,
tempRegulation
:
""
,
sort
:
""
,
customizeName
:
""
,
supplyName
:
""
,
customizeId
:
""
,
isFixed
:
""
,
isAuto
:
""
,
supplyId
:
""
,
operateTime
:
""
,
updateNullFields
:
''
}
}
</
script
>
<
template
>
...
...
@@ -192,7 +168,7 @@ function reset(){
<el-col
:span=
"8"
class=
"content-col-label"
>
光照:
</el-col>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-form-item
prop=
"illumination"
style=
"padding: 0;margin: 0;"
>
<el-input
:input-style=
"inputStyle"
maxlength=
"
11
"
v-model=
"reviseData.illumination"
<el-input
:input-style=
"inputStyle"
maxlength=
"
2
"
v-model=
"reviseData.illumination"
style=
"width: 510px"
/>
</el-form-item>
</el-col>
...
...
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