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
5a10b476
Commit
5a10b476
authored
Aug 06, 2024
by
每天都要敲代码
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
瞬时热量接口调用完成
parent
21138bfa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
62 deletions
+110
-62
energy.js
src/api/mockData/energy.js
+24
-24
scheduling.js
src/api/scheduling.js
+28
-1
main.js
src/main.js
+3
-3
TapPage.vue
src/views/HeatUserPage/TapPage.vue
+1
-1
InstantHeatPage.vue
src/views/SchedulingPage/InstantHeatPage.vue
+54
-33
No files found.
src/api/mockData/energy.js
View file @
5a10b476
...
...
@@ -23,12 +23,12 @@ const count = 100
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
List
.
push
(
Mock
.
mock
({
i
d
:
"@increment()"
,
'
n
ame|1'
:
Mock
.
mock
([
'东部供热站'
,
'行政区供热站'
,
'福宛里供热站'
]),
'
t
ype|1-4'
:
1
,
'
t
ype|1'
:
Mock
.
mock
([
'热'
,
'光'
,
'电'
,
'机械'
]),
'
use
d|100-3000'
:
1
,
d
ate
:
Mock
.
mock
(
'@date("yyyy/MM/dd")'
)
+
' 0:00:00'
allowPagingI
d
:
"@increment()"
,
'
supplyN
ame|1'
:
Mock
.
mock
([
'东部供热站'
,
'行政区供热站'
,
'福宛里供热站'
]),
'
energyT
ype|1-4'
:
1
,
'
energyT
ype|1'
:
Mock
.
mock
([
'热'
,
'光'
,
'电'
,
'机械'
]),
'
recor
d|100-3000'
:
1
,
recordD
ate
:
Mock
.
mock
(
'@date("yyyy/MM/dd")'
)
+
' 0:00:00'
})
)
}
...
...
@@ -43,11 +43,11 @@ export default {
*/
getEnergyList
:
config
=>
{
//limit默认是10,因为分页器默认也是一页10个
const
{
n
ame
,
page
=
1
,
limit
=
10
}
=
param2Obj
(
config
.
url
)
const
{
supplyN
ame
,
page
=
1
,
limit
=
10
}
=
param2Obj
(
config
.
url
)
const
mockList
=
List
.
filter
(
energy
=>
{
//如果name存在会,根据name筛选数据
if
(
name
&&
energy
.
name
.
indexOf
(
n
ame
)
===
-
1
)
return
false
if
(
supplyName
&&
energy
.
supplyName
.
indexOf
(
supplyN
ame
)
===
-
1
)
return
false
return
true
})
//分页
...
...
@@ -66,17 +66,17 @@ export default {
* @return {*}
*/
deleteEnergy
:
config
=>
{
const
{
id
}
=
param2Obj
(
config
.
url
)
const
{
allowPagingId
}
=
param2Obj
(
config
.
url
)
// console.log("前端传来的id:"+id);
if
(
!
i
d
)
{
if
(
!
allowPagingI
d
)
{
return
{
code
:
-
999
,
message
:
'参数不正确'
}
}
else
{
List
=
List
.
filter
(
item
=>
item
.
id
!=
i
d
)
List
=
List
.
filter
(
item
=>
item
.
allowPagingId
!=
allowPagingI
d
)
console
.
log
(
List
);
return
{
code
:
200
,
...
...
@@ -91,14 +91,14 @@ export default {
* @return {{code: number, data: {message: string}}}
*/
createEnery
:
config
=>
{
const
{
name
,
type
,
used
,
d
ate
}
=
JSON
.
parse
(
config
.
body
)
const
{
supplyName
,
energyType
,
record
,
recordD
ate
}
=
JSON
.
parse
(
config
.
body
)
List
.
unshift
({
i
d
:
Mock
.
mock
(
'@increment()'
),
name
:
n
ame
,
type
:
t
ype
,
used
:
use
d
,
date
:
d
ate
allowPagingI
d
:
Mock
.
mock
(
'@increment()'
),
supplyName
:
supplyN
ame
,
energyType
:
energyT
ype
,
record
:
recor
d
,
recordDate
:
recordD
ate
})
return
{
code
:
200
,
...
...
@@ -109,14 +109,14 @@ export default {
},
updateEnergy
:
config
=>
{
const
{
id
,
name
,
type
,
used
,
d
ate
}
=
JSON
.
parse
(
config
.
body
)
const
type_num
=
parseInt
(
t
ype
)
const
{
allowPagingId
,
supplyName
,
energyType
,
record
,
recordD
ate
}
=
JSON
.
parse
(
config
.
body
)
const
energyType_num
=
parseInt
(
energyT
ype
)
List
.
some
(
e
=>
{
if
(
e
.
id
===
i
d
)
{
e
.
name
=
n
ame
e
.
type
=
t
ype
e
.
used
=
use
d
e
.
date
=
d
ate
if
(
e
.
allowPagingId
===
allowPagingI
d
)
{
e
.
supplyName
=
supplyN
ame
e
.
energyType
=
energyT
ype
e
.
record
=
recor
d
e
.
recordDate
=
recordD
ate
return
true
}
})
...
...
src/api/scheduling.js
View file @
5a10b476
import
http
from
'./http'
//能源消耗
export
const
postEnergyManage
=
params
=>
{
return
http
.
post
(
`/api/
manage/sheduling/EnergyManage
`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
return
http
.
post
(
`/api/
energy/getData
`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
}
// 瞬时热量-获取列表
export
const
postInstantHeat
=
params
=>
{
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Get`
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
}
// 瞬时热量-新增修改
export
const
postInstantHeatUpdate
=
params
=>
{
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Update`
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
}
export
const
postSecAbsTUc
=
params
=>
{
return
http
.
post
(
`/api/analysis/external/SecAbsTUc`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
}
export
const
postEnergyManageSave
=
params
=>
{
return
http
.
post
(
`/api/energy/Save`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
}
src/main.js
View file @
5a10b476
...
...
@@ -23,8 +23,8 @@ import http from './api/http'
import
store
from
'./store'
import
$
from
'jquery'
// import {WebControl} from '@/assets/script/video/web-control.esm.min.js'
import
"@/api/mock.js"
import
api
from
'@/api/api'
//
import "@/api/mock.js"
//
import api from '@/api/api'
const
app
=
createApp
(
App
)
...
...
@@ -36,7 +36,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app
.
component
(
'Notification'
,
Notification
)
app
.
config
.
globalProperties
.
http
=
http
;
app
.
config
.
globalProperties
.
$api
=
api
;
//
app.config.globalProperties.$api = api;
//将element-plus注册成全局可用组件库
app
.
use
(
store
)
.
use
(
ElementPlus
)
...
...
src/views/HeatUserPage/TapPage.vue
View file @
5a10b476
...
...
@@ -218,7 +218,7 @@
justify-content: center;
}
.span-text {}
//
.span-text {}
</
style
>
<
script
setup
>
...
...
src/views/SchedulingPage/InstantHeatPage.vue
View file @
5a10b476
...
...
@@ -2,23 +2,21 @@
<div
class=
"contentBlock"
>
<div
class=
"contentBlockInn"
>
<el-card
class=
"card-contianer"
>
<div
class=
"card-header"
>
<span>
瞬时热量对比配置
</span>
</div>
<div
class=
"card-header"
>
<span>
瞬时热量对比配置
</span>
</div>
<el-form
ref=
"formRef"
:data=
"formData"
:model=
"formModel"
label-width=
"auto"
>
<table
cellpadding=
"0"
cellspacing=
"1"
>
<table
cellpadding=
"0"
cellspacing=
"1"
>
<tr>
<th
style=
"width: 25%"
>
计划名称:
</th>
<td
style=
"width: 60%; margin:0; padding: 0"
>
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
v-model=
"formModel
.planName"
></el-input>
<el-input
style=
"width: 80%"
v-model=
"List
.planName"
></el-input>
</td>
</tr>
</table>
</td>
</tr>
...
...
@@ -28,12 +26,11 @@
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
v-model=
"formModel
.diffPercentage"
></el-input>
<el-input
style=
"width: 80%"
v-model=
"List
.diffPercentage"
></el-input>
</td>
</tr>
</table>
</td>
</tr>
...
...
@@ -43,16 +40,11 @@
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-form>
<el-input
style=
"width: 80%"
v-model=
"formModel.timeoutMin"
></el-input>
</el-form>
<el-input
style=
"width: 80%"
v-model=
"List.timeoutMin"
></el-input>
</td>
</tr>
</table>
</td>
</tr>
...
...
@@ -62,12 +54,11 @@
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
v-model=
"formModel
.tempRegulation"
></el-input>
<el-input
style=
"width: 80%"
v-model=
"List
.tempRegulation"
></el-input>
</td>
</tr>
</table>
</td>
</tr>
...
...
@@ -77,9 +68,9 @@
<table
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
style=
"text-align: left"
>
<el-input
style=
"width: 80%"
type=
"textarea"
rows=
"6"
v-model=
"formModel.description"
></el-input>
<el-input
style=
"width: 80%"
type=
"textarea"
rows=
"6"
v-model=
"List.description"
></el-input>
</td>
</tr>
</table>
</td>
...
...
@@ -88,10 +79,9 @@
</table>
<div
class=
"btngrounp"
>
<el-button
type=
"primary"
>
保存
</el-button>
<el-button
type=
"primary"
style=
"margin: 0 0 0 5px"
>
关闭
</el-button>
<el-button
type=
"primary"
@
click=
"onSave"
>
保存
</el-button>
<el-button
type=
"primary"
style=
"margin: 0 0 0 5px"
@
click=
"onCancel"
>
关闭
</el-button>
</div>
</el-form>
</el-card>
</div>
...
...
@@ -100,28 +90,59 @@
</
template
>
<
script
setup
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
}
from
"vue"
;
const
formModel
=
reactive
({
planId
:
''
,
planName
:
'瞬时热量偏差'
,
diffPercentage
:
'10'
,
timeoutMin
:
'10'
,
tempRegulation
:
'1'
,
description
:
'"预测瞬时热量"与集团"瞬时热量"进行对比,偏差10%(可变),超过10分钟(可变),对下发温度进行+-温度调节(温度可调)'
})
import
{
postInstantHeat
,
postInstantHeatUpdate
}
from
"@/api/scheduling"
import
{
toRaw
}
from
"@vue/reactivity"
;
import
{
ElMessage
}
from
"element-plus"
;
import
http
from
"../../api/http"
;
const
loading
=
ref
(
false
)
const
List
=
ref
([
{
"planId"
:
""
,
"planName"
:
""
,
"diffPercentage"
:
""
,
"timeoutMin"
:
""
,
"tempRegulation"
:
""
,
"description"
:
""
,
"isActive"
:
''
}
])
const
getInstanceHeat
=
async
()
=>
{
loading
.
value
=
true
const
data
=
await
postInstantHeat
();
console
.
log
(
data
);
List
.
value
=
data
.
data
[
0
]
loading
.
value
=
false
}
const
onSave
=
async
()
=>
{
// await postInstantHeatUpdate(List.value)
// ElMessage.success('修改成功')
http
.
post
(
"/api/Scheduling/BizInstantaneousHeat/Update"
,{...
List
.
value
},
false
).
then
((
result
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
error
)
})
getInstanceHeat
()
}
onMounted
(()
=>
{
getInstanceHeat
()
})
</
script
>
<
style
lang=
"less"
scoped
>
.card-contianer {
background-color:
#DFE8F6;
background-color: #DFE8F6;
}
.card-header {
text-align: center;
font-weight: 700;
font-size: 28px;
margin-bottom:10px;
margin-bottom:
10px;
}
.btngrounp {
margin-top: 10px;
text-align: center;
...
...
@@ -140,7 +161,7 @@ td {
font-size: 14px;
margin: 0;
padding: 0;
}
...
...
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