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
489feba1
Commit
489feba1
authored
Aug 07, 2024
by
xuke
Browse files
Options
Browse Files
Download
Plain Diff
能源消耗接口-第二次提交
parents
ce5c1425
4ac876ed
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
408 additions
and
293 deletions
+408
-293
scheduling.js
src/api/scheduling.js
+81
-2
AnnualParamPage.vue
src/views/SchedulingPage/AnnualParamPage.vue
+1
-0
PhenomenonPage.vue
src/views/SchedulingPage/PhenomenonPage.vue
+79
-2
WindManagePage.vue
src/views/SchedulingPage/WindManagePage.vue
+247
-289
No files found.
src/api/scheduling.js
View file @
489feba1
import
http
from
'./http'
import
http
from
'./http'
//能源消耗-获取
//能源消耗-获取
export
const
postEnergyManage
=
params
=>
{
export
const
postEnergyManage
=
params
=>
{
<<<<<<<
HEAD
return
http
.
post
(
`/api/energy/getData`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
return
http
.
post
(
`/api/energy/getData`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
})
})
=======
return
http
.
post
(
`/api/energy/getData`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
}
// 能源消耗-删除
// 能源消耗-删除
// export const postEnergyDel = EnergyId => {
// export const postEnergyDel = EnergyId => {
...
@@ -27,27 +33,46 @@ export const postEnergyUpdate = params => {
...
@@ -27,27 +33,46 @@ export const postEnergyUpdate = params => {
// 瞬时热量-获取列表
// 瞬时热量-获取列表
export
const
postInstantHeat
=
params
=>
{
export
const
postInstantHeat
=
params
=>
{
<<<<<<<
HEAD
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Get`
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
=======
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Get`
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Get`
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
})
})
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
}
// 瞬时热量-新增修改
// 瞬时热量-新增修改
export
const
postInstantHeatUpdate
=
params
=>
{
export
const
postInstantHeatUpdate
=
params
=>
{
<<<<<<<
HEAD
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Update`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Update`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
})
})
=======
return
http
.
post
(
`api/Scheduling/BizInstantaneousHeat/Update`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
}
// 参数设置
// 参数设置
export
const
postConfigBoilerUpdate
=
params
=>
{
export
const
postConfigBoilerUpdate
=
params
=>
{
<<<<<<<
HEAD
return
http
.
post
(
`api/configboiler/Save`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
=======
return
http
.
post
(
`api/configboiler/Save`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
return
http
.
post
(
`api/configboiler/Save`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
})
})
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
}
export
const
postSecAbsTUc
=
params
=>
{
export
const
postSecAbsTUc
=
params
=>
{
<<<<<<<
HEAD
return
http
.
post
(
`/api/analysis/external/SecAbsTUc`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
return
http
.
post
(
`/api/analysis/external/SecAbsTUc`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
})
})
...
@@ -57,8 +82,18 @@ export const postEnergyManageSave = params => {
...
@@ -57,8 +82,18 @@ export const postEnergyManageSave = params => {
return
http
.
post
(
`/api/energy/Save`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
return
http
.
post
(
`/api/energy/Save`
,
params
).
then
(
res
=>
res
).
catch
(
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
})
})
=======
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
);
})
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
export
const
getWeatherMagData
=
()
=>
{
// 获取气象干预数据
export
const
getWeatherMagData
=
()
=>
{
// 获取气象干预数据
...
@@ -70,11 +105,19 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数
...
@@ -70,11 +105,19 @@ export const alterWeatherMagData = params => { // 添加或修改气象干预数
}
}
export
const
getTransfer
=
param
=>
{
// 获取换热站列表
export
const
getTransfer
=
param
=>
{
// 获取换热站列表
<<<<<<<
HEAD
return
http
.
post
(
`/api/cusweather/getTransferIds?id=
${
param
}
`
,
param
)
return
http
.
post
(
`/api/cusweather/getTransferIds?id=
${
param
}
`
,
param
)
}
}
export
const
getAnnualParam
=
()
=>
{
// 获取年度参数列表
export
const
getAnnualParam
=
()
=>
{
// 获取年度参数列表
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Get'
)
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Get'
)
=======
return
http
.
post
(
`/api/cusweather/getTransferIds?id=
${
param
}
`
,
param
)
}
export
const
getAnnualParam
=
()
=>
{
// 获取年度参数列表
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Get'
)
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
}
export
const
alterAnnualParam
=
params
=>
{
// 修改年度参数
export
const
alterAnnualParam
=
params
=>
{
// 修改年度参数
...
@@ -82,6 +125,18 @@ export const alterAnnualParam = params => { // 修改年度参数
...
@@ -82,6 +125,18 @@ export const alterAnnualParam = params => { // 修改年度参数
}
}
export
const
addAnnualParam
=
params
=>
{
// 新增年度参数
export
const
addAnnualParam
=
params
=>
{
// 新增年度参数
<<<<<<<
HEAD
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Add'
,
params
)
}
export
const
deleteAnnualParam
=
params
=>
{
// 删除年度参数
// console.log("地址:",`/api/Scheduling/BizHeatSet/Delete?Id=${params}`)
return
http
.
post
(
`/api/Scheduling/BizHeatSet/Delete?Id=
${
params
}
`
)
}
export
const
getPhenomenon
=
()
=>
{
// 获取数据列表————天气工况
return
http
.
post
(
'/api/Scheduling/WeatherCondition/Get'
)
=======
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Add'
,
params
)
return
http
.
post
(
'/api/Scheduling/BizHeatSet/Add'
,
params
)
}
}
...
@@ -92,12 +147,36 @@ export const deleteAnnualParam = params => { // 删除年度参数
...
@@ -92,12 +147,36 @@ export const deleteAnnualParam = params => { // 删除年度参数
export
const
getPhenomenon
=
()
=>
{
// 获取数据列表————天气工况
export
const
getPhenomenon
=
()
=>
{
// 获取数据列表————天气工况
return
http
.
post
(
'/api/Scheduling/WeatherCondition/Get'
)
return
http
.
post
(
'/api/Scheduling/WeatherCondition/Get'
)
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
}
export
const
addPhenomenon
=
params
=>
{
// 新增数据————天气工况
return
http
.
post
(
'/api/Scheduling/WeatherCondition/Add'
,
params
)
}
export
const
alterPhenomenon
=
params
=>
{
// 修改数据————天气工况
export
const
alterPhenomenon
=
params
=>
{
// 修改数据————天气工况
return
http
.
post
(
'/api/Scheduling/WeatherCondition/Update'
,
params
)
return
http
.
post
(
'/api/Scheduling/WeatherCondition/Update'
,
params
)
}
}
export
const
deletePhenomenon
=
params
=>
{
// 删除数据————天气工况
export
const
deletePhenomenon
=
params
=>
{
// 删除数据————天气工况
<<<<<<<
HEAD
return
http
.
post
(
`/api/Scheduling/WeatherCondition/Delete?Id=
${
params
}
`
)
=======
return
http
.
post
(
`/api/Scheduling/WeatherCondition/Delete?Id=
${
params
}
`
)
return
http
.
post
(
`/api/Scheduling/WeatherCondition/Delete?Id=
${
params
}
`
)
>>>>>>>
4
ac876ed216e6184e11a156638cd9a19a43ddb02
}
export
const
getWind
=
()
=>
{
// 获取数据列表————风力配置
return
http
.
post
(
'/api/Scheduling/WindConfiguration/Get'
)
}
export
const
addWind
=
params
=>
{
// 新增数据————风力配置
return
http
.
post
(
'/api/Scheduling/WindConfiguration/Add'
,
params
)
}
export
const
alterWind
=
params
=>
{
// 修改数据————风力配置
return
http
.
post
(
'/api/Scheduling/WindConfiguration/Update'
,
params
)
}
export
const
deleteWind
=
params
=>
{
// 删除数据————风力配置
return
http
.
post
(
`/api/Scheduling/WindConfiguration/Delete?Id=
${
params
}
`
)
}
}
src/views/SchedulingPage/AnnualParamPage.vue
View file @
489feba1
...
@@ -16,6 +16,7 @@ const reviseWindowOpen = ref(false)
...
@@ -16,6 +16,7 @@ const reviseWindowOpen = ref(false)
const
addWindowOpen
=
ref
(
false
)
const
addWindowOpen
=
ref
(
false
)
const
reviseForm
=
ref
({})
const
reviseForm
=
ref
({})
const
addForm
=
ref
({
const
addForm
=
ref
({
supplyId
:
"00000000-0000-0000-0000-000000000000"
,
energyType
:
''
,
energyType
:
''
,
year
:
''
,
year
:
''
,
standard
:
''
,
standard
:
''
,
...
...
src/views/SchedulingPage/PhenomenonPage.vue
View file @
489feba1
<
script
setup
>
<
script
setup
>
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
ElMessageBox
}
from
"element-plus"
;
import
{
ElMessageBox
}
from
"element-plus"
;
import
{
getPhenomenon
,
alterPhenomenon
,
deletePhenomenon
}
from
"@/api/scheduling.js"
import
{
getPhenomenon
,
a
ddPhenomenon
,
a
lterPhenomenon
,
deletePhenomenon
}
from
"@/api/scheduling.js"
const
data
=
ref
()
const
data
=
ref
()
const
searchKey
=
ref
(
''
)
// 查询参数
const
searchKey
=
ref
(
''
)
// 查询参数
const
reviseWindowOpen
=
ref
(
false
)
const
reviseWindowOpen
=
ref
(
false
)
const
addWindowOpen
=
ref
(
false
)
const
reviseForm
=
ref
({})
// 修改表单
const
reviseForm
=
ref
({})
// 修改表单
const
addForm
=
ref
({})
// 新增表单
const
tableHeaderClass
=
data
=>
{
// 表头样式
const
tableHeaderClass
=
data
=>
{
// 表头样式
return
'table-header-class'
return
'table-header-class'
}
}
...
@@ -14,6 +16,9 @@ const tableBodyClass = data => { // 表体样式
...
@@ -14,6 +16,9 @@ const tableBodyClass = data => { // 表体样式
return
'table-body-class'
return
'table-body-class'
}
}
function
add
(){
addWindowOpen
.
value
=
true
}
// 新增按钮单击事件
function
revise
(
val
){
function
revise
(
val
){
reviseForm
.
value
=
{...
val
}
reviseForm
.
value
=
{...
val
}
reviseWindowOpen
.
value
=
true
reviseWindowOpen
.
value
=
true
...
@@ -36,6 +41,8 @@ function omit(val){
...
@@ -36,6 +41,8 @@ function omit(val){
}
// 删除按钮单击事件
}
// 删除按钮单击事件
function
handleClose
(){
function
handleClose
(){
reviseWindowOpen
.
value
=
false
reviseWindowOpen
.
value
=
false
addWindowOpen
.
value
=
false
resetInput
()
}
// 关闭弹窗
}
// 关闭弹窗
function
onReviseSubmit
(){
function
onReviseSubmit
(){
alterPhenomenon
(
reviseForm
.
value
).
then
(
res
=>
{
alterPhenomenon
(
reviseForm
.
value
).
then
(
res
=>
{
...
@@ -43,7 +50,20 @@ function onReviseSubmit(){
...
@@ -43,7 +50,20 @@ function onReviseSubmit(){
reviseWindowOpen
.
value
=
false
reviseWindowOpen
.
value
=
false
})
})
}
// 修改表单提交
}
// 修改表单提交
function
onAddSubmit
(){
addPhenomenon
(
addForm
.
value
).
then
(
res
=>
{
handleClose
()
getData
()
})
}
// 新增表单提交
function
resetInput
(){
addForm
.
value
=
{
phenomenonName
:
''
,
phenomenonType
:
''
,
phenomenonTemp
:
''
,
phenomenonDesc
:
''
}
}
// 清空新增表单输入框
onMounted
(()
=>
{
onMounted
(()
=>
{
getData
()
getData
()
...
@@ -65,6 +85,7 @@ function getData(){
...
@@ -65,6 +85,7 @@ function getData(){
</el-col>
</el-col>
</el-row>
</el-row>
<el-button
type=
"primary"
class=
"add-search-btn"
>
查询
</el-button>
<el-button
type=
"primary"
class=
"add-search-btn"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"add"
class=
"add-search-btn"
>
新增
</el-button>
</div>
</div>
<div
class=
"table-wrapper"
>
<div
class=
"table-wrapper"
>
<el-table
<el-table
...
@@ -105,6 +126,16 @@ function getData(){
...
@@ -105,6 +126,16 @@ function getData(){
</el-select>
</el-select>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
class=
"energy-type-class"
>
类型:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-select
placeholder=
""
size=
"small"
v-model=
"reviseForm.phenomenonType"
style=
"width: 370px"
>
<el-option
value=
"1"
label=
"1"
/>
<el-option
value=
"2"
label=
"2"
/>
<el-option
value=
"3"
label=
"3"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"8"
col-label
>
对应温度:
</el-col>
<el-col
:span=
"8"
col-label
>
对应温度:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-col
:span=
"16"
col-value
>
...
@@ -125,6 +156,52 @@ function getData(){
...
@@ -125,6 +156,52 @@ function getData(){
</div>
</div>
</
template
>
</
template
>
</el-dialog>
<!-- 修改弹窗 -->
</el-dialog>
<!-- 修改弹窗 -->
<el-dialog
title=
"天气工况设置新增"
v-model=
"addWindowOpen"
width=
"700px"
:before-close=
"handleClose"
>
<
template
#
default
>
<el-row
first
>
<el-col
:span=
"8"
col-label
class=
"energy-type-class"
>
名称:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-select
placeholder=
""
size=
"small"
v-model=
"addForm.phenomenonName"
style=
"width: 370px"
>
<el-option
value=
"晴天"
label=
"晴天"
/>
<el-option
value=
"多云"
label=
"多云"
/>
<el-option
value=
"阴天"
label=
"阴天"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
class=
"energy-type-class"
>
类型:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-select
placeholder=
""
size=
"small"
v-model=
"addForm.phenomenonType"
style=
"width: 370px"
>
<el-option
value=
"1"
label=
"1"
/>
<el-option
value=
"2"
label=
"2"
/>
<el-option
value=
"3"
label=
"3"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
>
对应温度:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-input
v-model=
"addForm.phenomenonTemp"
placeholder=
""
style=
"width: 370px"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
>
描述:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-input
v-model=
"addForm.phenomenonDesc"
placeholder=
""
style=
"width: 370px"
/>
</el-col>
</el-row>
</
template
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"onAddSubmit"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"handleClose"
>
关闭
</el-button>
</div>
</
template
>
</el-dialog>
<!-- 新增弹窗 -->
</div>
</div>
</div>
</div>
</template>
</template>
...
...
src/views/SchedulingPage/WindManagePage.vue
View file @
489feba1
<
template
>
<
script
setup
>
<!-- 条件筛选卡片 -->
import
{
onMounted
,
ref
,
watch
,
watchEffect
}
from
"vue"
;
<el-card
class=
"card-contianer"
>
import
{
ElMessageBox
}
from
"element-plus"
;
<div
class=
"div-header"
>
import
{
getWind
,
deleteWind
,
alterWind
,
addWind
}
from
"@/api/scheduling.js"
<el-form-item>
<div>
级数
</div>
</el-form-item>
<el-form-item
>
<el-select
v-model=
"form.region"
placeholder=
"请选择"
style=
"width: 200px"
>
<el-option
label=
"一级风"
value=
"shanghai"
/>
<el-option
label=
"二级风"
value=
"beijing"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"getdata"
style=
"min-width: 70px;"
>
查询
</el-button>
</el-form-item>
</div>
</el-card>
<el-card
class=
"moduleCard"
:height=
"tableHeight"
style=
"padding: 4px;"
>
<el-table
:data=
"tableData"
:height=
"tableHeight"
:cell-style=
"setCellStyle"
id=
"out-table"
border
highlight-current-row
:header-cell-style=
"setHeaderCellStyle"
:header-cell-class-name=
"handleHeadAddClass"
>
<el-table-column
prop=
"index"
label=
"序号"
fixed
/>
<el-table-column
prop=
"magnitude"
label=
"级数"
fixed
/>
<el-table-column
prop=
"temperature"
label=
"对应温度"
fixed
/>
<el-table-column
prop=
"desc"
label=
"描述"
fixed
/>
<el-table-column
prop=
"alarmMessage"
label=
"操作"
fixed
>
<el-button
link
type=
"primary"
size=
"small"
@
click=
"dialogFormVisible = true"
>
修改
</el-button>
<el-button
link
type=
"primary"
size=
"small"
@
click=
"del"
>
删除
</el-button>
</el-table-column>
</el-table>
</el-card>
<el-footer
style=
"height: 8px;"
>
<el-config-provider
:locale=
"zhCn"
>
<el-pagination
v-model:current-page=
"currentPage"
v-model:page-size=
"pageSize"
:page-sizes=
"[30, 40, 50, 100, 200, 300]"
:small=
"true"
:disabled=
"disabled"
:background=
"background"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
@
size-change=
"getdata"
@
current-change=
"getdata"
class=
"pagination"
/>
</el-config-provider>
</el-footer>
<div
class=
"ams-dialog"
>
<el-dialog
v-model=
"dialogFormVisible"
title=
"天气工况设置修改"
width=
"500"
>
<el-card>
<table
cellpadding=
"0"
cellspacing=
"1"
style=
"background-color: #99bbe8"
>
<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-select
v-model=
"form.region"
placeholder=
"选择天气名称"
>
<el-option
label=
"阴天"
value=
"阴天"
/>
<el-option
label=
"晴天"
value=
"晴天"
/>
<el-option
label=
"多云"
value=
"多云"
/>
</el-select>
</td>
</tr>
</table>
</td>
</tr>
<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></el-input>
</td>
</tr>
</table>
</td>
</tr>
<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></el-input>
</td>
</tr>
</table>
</td>
</tr>
</table>
<template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"dialogFormVisible = false"
>
保存
</el-button>
<el-button
@
click=
"dialogFormVisible = false"
>
关闭
</el-button>
</div>
</
template
>
</el-card>
</el-dialog>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
}
from
'vue'
;
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
zhCn
from
'element-plus/dist/locale/zh-cn.mjs'
import
{
useFloating
}
from
"element-plus"
;
//分页设置
const
currentPage
=
ref
(
1
)
var
pageSize
=
ref
(
30
)
const
disabled
=
ref
(
false
)
const
background
=
ref
(
false
)
const
total
=
ref
(
1
)
const
tableData
=
ref
([
{
index
:
1
,
magnitude
:
3
,
temperature
:
1.00
.
toFixed
(
2
),
desc
:
'三级风'
},
{
index
:
2
,
magnitude
:
8
,
temperature
:
-
3.00
.
toFixed
(
2
),
desc
:
'八级风'
},
{
index
:
3
,
magnitude
:
6
,
temperature
:
-
1.00
.
toFixed
(
2
),
desc
:
'六级风'
}
]);
const
tableHeight
=
ref
(
500
);
const
sortField
=
reactive
({});
function
setCellStyle
({
row
,
column
,
rowIndex
,
columnIndex
})
{
let
css_color
=
{};
css_color
[
'padding-left'
]
=
'0px'
;
css_color
[
'padding-right'
]
=
'0px'
;
css_color
[
'borderColor'
]
=
'#97d5fd'
;
css_color
[
'padding'
]
=
'0px'
;
return
css_color
;
}
function
setHeaderCellStyle
({
row
,
column
,
rowIndex
,
columnIndex
})
{
let
css_color
;
var
backcolor
=
'd9f1ff'
;
css_color
=
{
'background-color'
:
'#'
+
backcolor
,
'padding-left'
:
'0px'
,
'padding-right'
:
'0px'
,
'borderColor'
:
'#97d5fd'
,
'color'
:
'#000'
,
'text-align'
:
'center'
,
'vertical-align'
:
'top'
};
var
backcolor
=
'd9f1ff'
;
const
data
=
ref
()
css_color
=
{
'background-color'
:
'#'
+
backcolor
,
'padding-left'
:
'0px'
,
'padding-right'
:
'0px'
,
'borderColor'
:
'#97d5fd'
,
'color'
:
'#000'
,
'text-align'
:
'center'
,
'vertical-align'
:
'top'
};
const
dataBackup
=
ref
([])
const
searchKey
=
ref
(
''
)
// 查询参数
return
css_color
;
const
reviseWindowOpen
=
ref
(
false
)
}
const
addWindowOpen
=
ref
(
false
)
function
handleHeadAddClass
({
column
})
{
const
reviseForm
=
ref
({})
// 修改表单
if
(
sortField
[
column
.
property
])
{
const
addForm
=
ref
({})
// 新增表单
column
.
order
=
sortField
[
column
.
property
]
const
tableHeaderClass
=
data
=>
{
// 表头样式
}
return
'table-header-class'
}
}
const
tableBodyClass
=
data
=>
{
// 表体样式
return
'table-body-class'
function
setContentHeight
()
{
tableHeight
.
value
=
window
.
innerHeight
-
240
;
}
}
onMounted
(()
=>
{
window
.
addEventListener
(
'resize'
,
setContentHeight
);
})
onUnmounted
(()
=>
{
window
.
removeEventListener
(
'resize'
,
setContentHeight
);
})
const
dialogFormVisible
=
ref
(
false
)
const
form
=
reactive
({
name
:
''
,
region
:
''
,
date1
:
''
,
date2
:
''
,
delivery
:
false
,
type
:
[],
resource
:
''
,
desc
:
''
,
})
const
del
=
()
=>
{
function
add
()
{
addWindowOpen
.
value
=
true
}
// 新增按钮单击事件
function
revise
(
val
)
{
reviseForm
.
value
=
{...
val
}
reviseWindowOpen
.
value
=
true
}
// 修改按钮单击事件
function
omit
(
val
)
{
let
id
=
val
.
windId
ElMessageBox
.
confirm
(
ElMessageBox
.
confirm
(
'
您确定要删除此条数据吗
?'
,
'
点击确定后,该条数据将删除,是否继续
?'
,
'
警告
'
,
'
Warning
'
,
{
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
type
:
'warning'
}
}
)
).
then
(()
=>
{
.
then
(()
=>
{
deleteWind
(
id
).
then
(
res
=>
{
ElMessage
({
getData
()
type
:
'success'
,
message
:
'删除成功'
,
})
})
}).
catch
(
err
=>
{
})
})
.
catch
(()
=>
{
}
// 删除按钮单击事件
ElMessage
({
function
search
()
{
type
:
'info'
,
if
(
!
searchKey
.
value
){
message
:
'删除取消'
,
getData
()
}
else
{
data
.
value
=
dataBackup
.
value
.
filter
(
item
=>
searchKey
.
value
==
item
.
windLevel
)
}
}
// 处理查询
function
handleClose
()
{
reviseWindowOpen
.
value
=
false
addWindowOpen
.
value
=
false
resetInput
()
}
// 关闭弹窗
function
onReviseSubmit
()
{
alterWind
(
reviseForm
.
value
).
then
(
res
=>
{
getData
()
handleClose
()
})
})
}
// 修改表单提交
function
onAddSubmit
()
{
addWind
(
addForm
.
value
).
then
(
res
=>
{
getData
()
handleClose
()
})
})
}
}
// 新增表单提交
</
script
>
onMounted
(()
=>
{
<
style
lang=
"less"
scoped
>
getData
()
.moduleCard {
})
width: auto;
overflow: auto;
//max-height: 540px;
padding: 0px;
::v-deep .el-card__body {
function
getData
()
{
padding: 0px;
getWind
().
then
(
res
=>
{
}
data
.
value
=
res
.
data
dataBackup
.
value
=
[...
data
.
value
]
})
}
}
.pagination
{
function
resetInput
()
{
padding: 4px;
addForm
.
value
=
{
margin-left: 20px;
windLevel
:
''
,
height: 30px;
windTemp
:
''
,
//background-color: #8939cf;
windDesc
:
''
vertical-align: middle;
}
}
}
</
script
>
//鼠标所在行的颜色
<
template
>
::v-deep .el-table__body tr:hover>td {
<div
class=
"windManage-container"
>
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
<div
class=
"search-wrapper"
>
<el-row>
<el-col
:span=
"8"
label
>
级数:
</el-col>
<el-col
:span=
"16"
>
<el-select
placeholder=
""
clearable
style=
"width: 200px"
v-model=
"searchKey"
>
<el-option
v-for=
"item in 14"
:key=
"item"
:value=
"item"
:label=
"item"
/>
</el-select>
</el-col>
</el-row>
<el-button
type=
"primary"
@
click=
"search"
class=
"add-search-btn"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"add"
class=
"add-search-btn"
>
新增
</el-button>
</div>
<div
class=
"table-wrapper"
>
<el-table
:data=
"data"
stripe
border
style=
"width: 100%"
:header-cell-class-name=
"tableHeaderClass"
:row-class-name=
"tableBodyClass"
>
<el-table-column
type=
"index"
label=
"序号"
align=
"center"
width=
"100"
/>
<el-table-column
prop=
"windLevel"
label=
"级数"
/>
<el-table-column
prop=
"windTemp"
label=
"对应温度"
/>
<el-table-column
prop=
"windDesc"
label=
"描述"
/>
<el-table-column
label=
"操作"
width=
"190"
>
<template
#
default=
"scope"
>
<div
class=
"table-operate-column"
>
<el-button
link
@
click=
"revise(scope.row)"
type=
"primary"
>
修改
</el-button>
<el-button
link
@
click=
"omit(scope.row)"
type=
"primary"
>
删除
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
</div>
<div
class=
"dialog-window"
>
<el-dialog
title=
"风力配置修改"
v-model=
"reviseWindowOpen"
width=
"700px"
:before-close=
"handleClose"
>
<
template
#
default
>
<el-row
first
>
<el-col
:span=
"8"
col-label
class=
"energy-type-class"
>
级数:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-select
placeholder=
""
size=
"small"
v-model=
"reviseForm.windLevel"
style=
"width: 370px"
>
<el-option
v-for=
"(item,index) in 14"
:key=
"index"
:value=
"item"
:label=
"item"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
>
对应温度:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-input
v-model=
"reviseForm.windTemp"
placeholder=
""
style=
"width: 370px"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
>
描述:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-input
v-model=
"reviseForm.windDesc"
placeholder=
""
style=
"width: 370px"
/>
</el-col>
</el-row>
</
template
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"onReviseSubmit"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"handleClose"
>
关闭
</el-button>
</div>
</
template
>
</el-dialog>
<!-- 修改弹窗 -->
<el-dialog
title=
"风力配置新增"
v-model=
"addWindowOpen"
width=
"700px"
:before-close=
"handleClose"
>
<
template
#
default
>
<el-row
first
>
<el-col
:span=
"8"
col-label
class=
"energy-type-class"
>
级数:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-select
placeholder=
""
size=
"small"
v-model=
"addForm.windLevel"
style=
"width: 370px"
>
<el-option
v-for=
"(item,index) in 14"
:key=
"index"
:value=
"item"
:label=
"item"
/>
</el-select>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
>
对应温度:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-input
v-model=
"addForm.windTemp"
placeholder=
""
style=
"width: 370px"
/>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"8"
col-label
>
描述:
</el-col>
<el-col
:span=
"16"
col-value
>
<el-input
v-model=
"addForm.windDesc"
placeholder=
""
style=
"width: 370px"
/>
</el-col>
</el-row>
</
template
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"onAddSubmit"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"handleClose"
>
关闭
</el-button>
</div>
</
template
>
</el-dialog>
<!-- 新增弹窗 -->
</div>
</div>
</template>
<
style
lang=
"less"
scoped
>
.windManage-container {
width: 100%;
margin: 4px;
}
}
::v-deep .el-table__body tr.current-row>td {
.search-wrapper {
background-color: #92cbf1 !important;
width: 100%;
display: flex;
justify-content: start;
}
}
.card-contianer {
.search-wrapper .el-row {
width: auto;
width: 50%;
height: 70px;
border: none;
display: flex;
align-items: center;
margin: 5px 10px 5px 5px;
}
.div-header {
.el-col[label] {
width: 100%;
display: flex;
display: flex;
margin: 20px
;
justify-content: end
;
}
align-items: center;
}
}
.el-form-item {
.add-search-btn {
margin-top: -20px;
margin: 5px 10px 5px 0;
margin-right: 30px;
}
}
.el-tag--mini {
height: 21px !important
:deep(.table-header-class) {
text-align: center;
font-size: 12px;
background-color: #c4d8f1 !important;
color: #124c6a;
}
}
.el-cascader .el-input .el-input__inner:focus, .el-cascader .el-input.is-focus .el-input__inner{
height: 33px; //这里高度根据需求自己设定
:deep(.table-body-class) {
font-size: 12px;
color: black;
}
}
.el-cascader__tags {
display: inline-flex;
.table-operate-column {
margin-right: 10px;
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
}
.contentBlock {
position: absolute;
.table-operate-column .el-button {
top: 0;
font-size: 12px;
left: 0;
right: 0;
bottom: 0;
background-color: #ffffff;
overflow: auto;
}
}
table {
width: 100%;
::v-deep .el-table__body tr:hover > td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
}
table,
tr,
.el-row[first] {
th,
border-top: 1px solid #a6c3e9;
td {
font-size: 14px;
margin: 0;
padding: 0;
}
}
table {
.el-row {
border-left: 1px solid #a6c3e9;
border-right: 1px solid #a6c3e9;
border-bottom: 1px solid #a6c3e9;
width: 100%;
width: 100%;
height: 35px;
color: #124362;
}
}
table th {
.el-col[col-label] {
display: flex;
justify-content: end;
align-items: center;
border-right: 1px solid #a6c3e9;
background-color: #dfe8f6;
background-color: #dfe8f6;
text-align: center;
padding-right: 5px;
padding: 5px 10px;
}
table td {
text-align: center;
background-color: #ffffff;
padding: 5px 10px;
}
.btngrounp {
width: 300px;
}
.gc td {
background-color: #a6ffa6;
}
}
.gc td:first-child {
background-color: #ffffff;
}
table.botList td {
width: 33%;
text-align: left;
font-weight: bolder;
}
.el-col[col-value] {
display: flex;
justify-content: start;
align-items: center;
padding-left: 5px;
}
.el-input {
color: black;
height: 24px;
}
</
style
>
</
style
>
\ No newline at end of file
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