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
b2a2dddc
Commit
b2a2dddc
authored
Aug 12, 2024
by
裴文涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12号晚最后一次提交
parent
9e0e22ac
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
223 additions
and
89 deletions
+223
-89
WeatherManagePage.vue
src/views/SchedulingPage/WeatherManagePage.vue
+111
-11
BindWindow.vue
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
+112
-78
No files found.
src/views/SchedulingPage/WeatherManagePage.vue
View file @
b2a2dddc
<
script
setup
>
<
script
setup
>
import
{
computed
,
isRef
,
onMounted
,
reactive
,
ref
,
shallowRef
}
from
"vue"
;
import
{
computed
,
isRef
,
on
BeforeMount
,
on
Mounted
,
reactive
,
ref
,
shallowRef
}
from
"vue"
;
import
ReviseWindow
from
"./weatherManageSub/ReviseWindow.vue"
;
import
ReviseWindow
from
"./weatherManageSub/ReviseWindow.vue"
;
import
BindWindow
from
"./weatherManageSub/BindWindow.vue"
;
import
BindWindow
from
"./weatherManageSub/BindWindow.vue"
;
import
{
getWeatherMagData
,
alterWeatherMagData
,
deleteWeatherMagData
}
from
'@/api/scheduling.js'
import
{
getWeatherMagData
,
alterWeatherMagData
,
deleteWeatherMagData
,
getOrganizationStructureInterface
}
from
'@/api/scheduling.js'
import
AddWindow
from
"./weatherManageSub/AddWindow.vue"
;
import
AddWindow
from
"./weatherManageSub/AddWindow.vue"
;
import
{
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
{
ElMessage
,
ElMessageBox
}
from
"element-plus"
;
import
store
from
"@/store/index.js"
;
import
store
from
"@/store/index.js"
;
...
@@ -10,6 +15,7 @@ import cloneDeep from 'lodash/cloneDeep'
...
@@ -10,6 +15,7 @@ import cloneDeep from 'lodash/cloneDeep'
import
{
vFloatNumber
}
from
"@/utils/directives.js"
;
import
{
vFloatNumber
}
from
"@/utils/directives.js"
;
const
data
=
ref
()
const
data
=
ref
()
const
dataBackup
=
ref
([]);
const
reviseWindowOpen
=
ref
(
false
)
// 修改按钮弹窗状态
const
reviseWindowOpen
=
ref
(
false
)
// 修改按钮弹窗状态
const
bindWindowOpen
=
ref
(
false
)
// 绑定按钮弹窗状态
const
bindWindowOpen
=
ref
(
false
)
// 绑定按钮弹窗状态
const
addWindowOpen
=
ref
(
false
)
// 新增按钮弹窗状态
const
addWindowOpen
=
ref
(
false
)
// 新增按钮弹窗状态
...
@@ -20,7 +26,33 @@ const tableHeaderClass = data => { // 表头样式
...
@@ -20,7 +26,33 @@ const tableHeaderClass = data => { // 表头样式
const
tableBodyClass
=
data
=>
{
// 表体样式
const
tableBodyClass
=
data
=>
{
// 表体样式
return
'table-body-class'
return
'table-body-class'
}
}
const
isAutoSearchKey
=
ref
()
// 手自动模式查询
const
supplySearchKey
=
ref
()
// 供热站查询
const
organizationStructure
=
ref
([])
// 组织结构数据
const
supplyData
=
ref
([])
// 供热站数据
const
transferStructData
=
ref
([])
// 换热站结构数据,每个供热站和一定数量的换热站对应
function
search
()
{
if
(
!
isAutoSearchKey
.
value
&&
!
supplySearchKey
.
value
){
getData
()
}
else
{
if
(
isAutoSearchKey
.
value
&&
supplySearchKey
.
value
){
data
.
value
=
dataBackup
.
value
.
filter
(
item
=>
{
return
item
.
isAuto
===
isAutoSearchKey
.
value
&&
item
.
supplyName
.
includes
(
supplySearchKey
.
value
)
})
}
else
{
if
(
isAutoSearchKey
.
value
){
data
.
value
=
dataBackup
.
value
.
filter
(
item
=>
{
return
item
.
isAuto
===
isAutoSearchKey
.
value
})
}
else
{
data
.
value
=
dataBackup
.
value
.
filter
(
item
=>
{
return
item
.
supplyName
.
includes
(
supplySearchKey
.
value
)
})
}
}
}
}
const
revise
=
(
row
)
=>
{
// 修改按钮单击事件
const
revise
=
(
row
)
=>
{
// 修改按钮单击事件
dependentSub
.
value
=
row
dependentSub
.
value
=
row
reviseWindowOpen
.
value
=
true
reviseWindowOpen
.
value
=
true
...
@@ -99,11 +131,16 @@ const onCancelBind = () => {
...
@@ -99,11 +131,16 @@ const onCancelBind = () => {
getData
()
getData
()
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
})
onBeforeMount
(()
=>
{
getData
()
getData
()
getOrganizationStructure
()
})
})
function
getData
()
{
function
getData
()
{
getWeatherMagData
().
then
(
res
=>
{
getWeatherMagData
().
then
(
res
=>
{
data
.
value
=
res
.
data
data
.
value
=
res
.
data
dataBackup
.
value
=
[...
data
.
value
];
})
})
}
}
function
handleAddWinOpenClose
(){
function
handleAddWinOpenClose
(){
...
@@ -143,17 +180,69 @@ function getCurrentDateTime() {
...
@@ -143,17 +180,69 @@ function getCurrentDateTime() {
return
`
${
year
}
-
${
month
}
-
${
day
}
${
hours
}
:
${
minutes
}
:
${
seconds
}
`
;
return
`
${
year
}
-
${
month
}
-
${
day
}
${
hours
}
:
${
minutes
}
:
${
seconds
}
`
;
}
// 生成时间
}
// 生成时间
function
getSupply
()
{
supplyData
.
value
=
[]
organizationStructure
.
value
[
0
].
serviceCenterList
.
forEach
(
fir_item
=>
{
fir_item
.
supplyList
.
forEach
(
sec_item
=>
{
let
temp
=
{
supplyId
:
sec_item
.
supplyId
,
supplyName
:
sec_item
.
supplyName
,
}
supplyData
.
value
.
push
({...
temp
})
})
})
}
// 根据组织结构获取供热站数据
function
getAllTransfer
()
{
organizationStructure
.
value
[
0
].
serviceCenterList
.
forEach
(
serviceCenter
=>
{
// 共有两个服务中心
let
supplyList
=
serviceCenter
.
supplyList
// 供热站列表,每个服务中心对应一定的供热站
supplyList
.
forEach
(
supply
=>
{
// 供热站
transferStructData
.
value
.
push
(
{
supplyId
:
supply
.
supplyId
,
supplyName
:
supply
.
supplyName
,
transferList
:
supply
.
transferList
}
)
})
transferStructData
.
value
.
forEach
(
item
=>
{
item
.
transferList
.
forEach
((
unit
)
=>
{
unit
.
isUsed
=
false
unit
.
customizeId
=
''
})
})
})
}
// 根据组织结构获取换热站结构数据
function
getOrganizationStructure
()
{
getOrganizationStructureInterface
().
then
(
res
=>
{
organizationStructure
.
value
=
res
.
data
getSupply
()
getAllTransfer
()
}).
catch
(
err
=>
{
ElMessage
.
error
(
'接口异常,获取数据失败.'
)
})
}
// 获取组织结构
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"weather-manage-container"
>
<div
class=
"weather-manage-container"
>
<el-row>
<el-row>
<el-col
:span=
"15"
left-col
>
<el-col
:span=
"15"
left-col
>
<el-button
type=
"primary"
@
click=
"addWindowOpen = true"
class=
"add-btn"
>
新增
</el-button>
<div
class=
"isAuto-search-area"
>
<el-button
type=
"primary"
@
click=
"getData"
>
查询
</el-button>
手自动模式:
<el-select
v-model=
"isAutoSearchKey"
style=
"width: 300px"
placeholder=
"请选择手自动模式"
clearable
>
<el-option
:label=
"手动模式"
value=
"手动模式"
/>
<el-option
:label=
"自动模式"
value=
"自动模式"
/>
</el-select>
</div>
<div
class=
"supplyName-search-area"
>
供热站名称:
<el-input
v-model=
"supplySearchKey"
placeholder=
"请输入供热站名称"
clearable
style=
"width: 300px"
/>
</div>
</el-col>
</el-col>
<el-col
:span=
"9"
right-col
>
<el-col
:span=
"9"
right-col
>
<el-button
type=
"primary"
@
click=
"addWindowOpen = true"
class=
"add-btn"
>
新增
</el-button>
<el-button
type=
"primary"
@
click=
"search"
>
查询
</el-button>
</el-col>
</el-col>
</el-row>
</el-row>
<div
class=
"table-wrapper"
>
<div
class=
"table-wrapper"
>
...
@@ -162,7 +251,7 @@ function getCurrentDateTime() {
...
@@ -162,7 +251,7 @@ function getCurrentDateTime() {
stripe
stripe
border
border
style=
"width: 100%"
style=
"width: 100%"
height=
"
90
0px"
height=
"
72
0px"
:header-cell-class-name=
"tableHeaderClass"
:header-cell-class-name=
"tableHeaderClass"
:row-class-name=
"tableBodyClass"
>
:row-class-name=
"tableBodyClass"
>
<el-table-column
prop=
"allowPagingId"
label=
"编号"
align=
"center"
width=
"60"
/>
<el-table-column
prop=
"allowPagingId"
label=
"编号"
align=
"center"
width=
"60"
/>
...
@@ -183,7 +272,6 @@ function getCurrentDateTime() {
...
@@ -183,7 +272,6 @@ function getCurrentDateTime() {
<div
class=
"table-operate-column"
>
<div
class=
"table-operate-column"
>
<el-button
link
@
click=
"revise(scope.row)"
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>
<el-button
link
@
click=
"bind(scope.row)"
type=
"primary"
>
绑定换热站
</el-button>
<el-button
link
type=
"primary"
>
详情
</el-button>
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -203,22 +291,34 @@ function getCurrentDateTime() {
...
@@ -203,22 +291,34 @@ function getCurrentDateTime() {
<BindWindow
<BindWindow
:open=
"bindWindowOpen"
:open=
"bindWindowOpen"
:data=
"dependentSub"
:data=
"dependentSub"
:supply=
"supplyData"
:transfer=
"transferStructData"
:all-weather-mag-data=
"dataBackup"
@
onCancel=
"onCancelBind"
@
onCancel=
"onCancelBind"
@
onConfirm=
"confirmBind"
></BindWindow>
@
onConfirm=
"confirmBind"
></BindWindow>
</div>
</div>
</div>
</div>
</template>
</template>
<
style
scoped
>
<
style
scoped
>
.weather-manage-container
{
.weather-manage-container
{
width
:
100%
;
width
:
100%
;
margin
:
4px
;
}
}
.el-col
[
left-col
]
{
.el-col
[
left-col
]
{
border-right
:
1px
solid
#a6c3e9
;
border-right
:
1px
solid
#a6c3e9
;
display
:
flex
;
align-items
:
center
;
justify-content
:
start
;
padding-left
:
20px
;
font-size
:
14px
;
.isAuto-search-area{
margin-right
:
20px
;
}
.supplyName-search-area
{
}
}
}
.el-row
{
.el-row
{
...
...
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
View file @
b2a2dddc
This diff is collapsed.
Click to expand it.
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