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
9e641212
Commit
9e641212
authored
Sep 03, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
年度参数查询接口替换
parent
ade3a35f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
37 deletions
+43
-37
scheduling.js
src/api/scheduling.js
+2
-2
AnnualParamPage.vue
src/views/SchedulingPage/AnnualParamPage.vue
+41
-35
No files found.
src/api/scheduling.js
View file @
9e641212
...
...
@@ -85,8 +85,8 @@ export const deleteWeatherMagData = params => { // 删除气象干预数据
return
http
.
post
(
"/api/cusweather/Delete"
,
params
)
}
export
const
getAnnualParam
=
()
=>
{
// 获取年度参数列表
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Get
'
)
export
const
getAnnualParam
=
params
=>
{
// 获取年度参数列表
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Get
ListByYear'
,
params
)
}
...
...
src/views/SchedulingPage/AnnualParamPage.vue
View file @
9e641212
<
script
setup
>
<
script
lang=
"ts"
setup
>
import
{
computed
,
onBeforeMount
,
onMounted
,
reactive
,
ref
,
watchEffect
}
from
"vue"
;
import
{
getAnnualParam
,
...
...
@@ -10,7 +10,7 @@ import {
import
{
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
{
vFloatNumber
}
from
"@/utils/directives.js"
;
const
data
=
ref
()
const
data
=
ref
(
[]
)
const
dataBackup
=
ref
([])
const
elTableRef
=
ref
()
const
tableHeaderClass
=
data
=>
{
// 表头样式
...
...
@@ -19,7 +19,7 @@ const tableHeaderClass = data => { // 表头样式
const
tableBodyClass
=
data
=>
{
// 表体样式
return
'table-body-class'
}
const
searchKey
=
ref
(
''
)
// 查询参数
const
searchKey
=
ref
(
'
2024
'
)
// 查询参数
const
reviseWindowOpen
=
ref
(
false
)
const
addWindowOpen
=
ref
(
false
)
const
reviseForm
=
ref
({})
...
...
@@ -124,6 +124,31 @@ const selectYearValue = computed(() => {
const
organizationStructure
=
ref
([])
// 组织结构数据
const
supplyData
=
ref
([])
// 供热站数据
function
getOrganizationStructure
()
{
getOrganizationStructureInterface
().
then
(
res
=>
{
organizationStructure
.
value
=
res
.
data
getSupply
()
}).
catch
(
err
=>
{
ElMessage
.
error
(
'接口异常,获取数据失败.'
)
})
}
// 获取组织结构
function
getData
()
{
const
params
=
{
year
:
searchKey
.
value
}
getAnnualParam
(
params
).
then
(
res
=>
{
data
.
value
=
res
.
data
console
.
log
(
'111111111111111'
,
data
.
value
)
for
(
let
item
of
data
.
value
)
{
if
(
item
.
supplyId
.
includes
(
'00000000-0000-0000-0000-000000000000'
)){
delete
item
.
supplyId
}
}
dataBackup
.
value
=
[...
data
.
value
]
})
}
function
handleEdit
(
val
)
{
currentYear
.
value
=
new
Date
().
getFullYear
()
currentMonth
.
value
=
new
Date
().
getMonth
()
+
1
...
...
@@ -174,16 +199,17 @@ function handleAdd() {
addSaveBtnLoading
.
value
=
false
}
// 处理新增
function
handleSearch
()
{
if
(
!
searchKey
.
value
)
{
getData
()
}
else
{
data
.
value
=
dataBackup
.
value
.
filter
(
item
=>
{
if
(
typeof
item
.
year
===
'object'
)
{
item
.
year
=
''
}
return
item
.
year
.
includes
(
searchKey
.
value
)
})
}
getData
()
// if (!searchKey.value) {
// getData()
// } else {
// data.value = dataBackup.value.filter(item => {
// if (typeof item.year === 'object') {
// item.year = ''
// }
// return item.year.includes(searchKey.value)
// })
// }
}
// 处理查询
function
onReviseSubmit
()
{
formRef
.
value
.
validate
(
valid
=>
{
...
...
@@ -344,10 +370,10 @@ function handleClose() {
addWindowOpen
.
value
=
false
resetInput
()
}
// 关闭弹窗
onMounted
(()
=>
{
//
onMounted(() => {
getOrganizationStructure
()
getData
()
})
//
})
watchEffect
(()
=>
{
for
(
let
supply
of
supplyData
.
value
){
for
(
let
item
of
data
.
value
){
...
...
@@ -357,18 +383,6 @@ watchEffect(()=>{
}
}
})
function
getData
()
{
getAnnualParam
().
then
(
res
=>
{
data
.
value
=
res
.
data
console
.
log
(
data
.
value
)
for
(
let
item
of
data
.
value
)
{
if
(
item
.
supplyId
.
includes
(
'00000000-0000-0000-0000-000000000000'
)){
delete
item
.
supplyId
}
}
dataBackup
.
value
=
[...
data
.
value
]
})
}
function
resetInput
()
{
addForm
.
value
=
{
...
...
@@ -410,14 +424,6 @@ function getSupply() {
})
})
}
// 根据组织结构获取供热站数据
function
getOrganizationStructure
()
{
getOrganizationStructureInterface
().
then
(
res
=>
{
organizationStructure
.
value
=
res
.
data
getSupply
()
}).
catch
(
err
=>
{
ElMessage
.
error
(
'接口异常,获取数据失败.'
)
})
}
// 获取组织结构
</
script
>
<
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