Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yindong-tongbai-automation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lichunliang
yindong-tongbai-automation
Commits
089eca97
Commit
089eca97
authored
Apr 07, 2025
by
forevertyler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:系统管理
parent
15a7bda6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
102 deletions
+122
-102
sys.js
src/api/tyler/sys.js
+16
-0
index.vue
src/views/drainage/drainageDev/index.vue
+6
-26
index.vue
src/views/system/alarmMsgSet/index.vue
+29
-15
index.vue
src/views/system/waterSysSet/index.vue
+71
-61
No files found.
src/api/tyler/sys.js
View file @
089eca97
...
...
@@ -23,4 +23,20 @@ export function peakEditDra(query) {
method
:
'
post
'
,
data
:
query
})
}
//报警短信设置
export
function
messageGetList
(
query
)
{
return
request
({
url
:
'
/business/message/list
'
,
method
:
'
get
'
,
data
:
query
})
}
export
function
messageEdit
(
query
)
{
return
request
({
url
:
'
/business/message/add
'
,
method
:
'
post
'
,
data
:
query
})
}
\ No newline at end of file
src/views/drainage/drainageDev/index.vue
View file @
089eca97
...
...
@@ -27,26 +27,7 @@
@
click=
"handleAdd"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
>
删除
</el-button>
</el-col>
<!--
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
...
...
@@ -60,10 +41,10 @@
</el-row>
<el-table
v-loading=
"loading"
:data=
"infoList"
@
selection-change=
"handleSelectionChange"
>
<
el-table-column
type=
"selection"
width=
"55"
align=
"center"
/
>
<
!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
--
>
<el-table-column
label=
"设备编号"
align=
"center"
prop=
"deviceId"
/>
<el-table-column
label=
"设备名称"
align=
"center"
prop=
"deviceName"
/>
<el-table-column
label=
"
设备安装位置
"
align=
"center"
prop=
"installationLocation"
/>
<el-table-column
label=
"
安装描述
"
align=
"center"
prop=
"installationLocation"
/>
<el-table-column
label=
"设备类型"
align=
"center"
prop=
"deviceType"
>
<template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.drainage_dev_type"
:value=
"scope.row.deviceType"
/>
...
...
@@ -84,7 +65,6 @@
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-if=
"!scope.row.status"
>
修改
</el-button>
<el-button
size=
"mini"
...
...
@@ -115,8 +95,8 @@
<el-input
:disabled=
"disabledType"
v-model=
"form.deviceId"
placeholder=
"请输入设备编号"
/>
</el-form-item>
<el-form-item
label=
"
设备安装位置
"
prop=
"installationLocation"
>
<el-input
v-model=
"form.installationLocation"
placeholder=
"请输入
设备安装位置
"
/>
<el-form-item
label=
"
安装描述
"
prop=
"installationLocation"
>
<el-input
v-model=
"form.installationLocation"
placeholder=
"请输入
安装描述
"
/>
</el-form-item>
<el-form-item
label=
"设备类型"
prop=
"deviceType"
>
<el-select
@
change=
"deviceTypeChange"
v-model=
"form.deviceType"
placeholder=
"请选择设备类型"
:disabled=
"disabledType"
>
...
...
@@ -215,7 +195,7 @@
{
required
:
true
,
message
:
"
设备编号不能为空
"
,
trigger
:
"
blur
"
}
],
installationLocation
:
[
{
required
:
true
,
message
:
"
设备安装位置
不能为空
"
,
trigger
:
"
blur
"
}
{
required
:
true
,
message
:
"
安装描述
不能为空
"
,
trigger
:
"
blur
"
}
],
deviceType
:
[
{
required
:
true
,
message
:
"
设备类型不能为空
"
,
trigger
:
"
change
"
}
...
...
src/views/system/alarmMsgSet/index.vue
View file @
089eca97
...
...
@@ -21,19 +21,19 @@
>
<div
class=
"form-cell"
>
<el-form-item
:prop=
"'items.' + index + '.
n
ame'"
:rules=
"rules.
n
ame"
:prop=
"'items.' + index + '.
perN
ame'"
:rules=
"rules.
perN
ame"
>
<el-input
v-model=
"item.
n
ame"
placeholder=
"请输入姓名"
></el-input>
<el-input
v-model=
"item.
perN
ame"
placeholder=
"请输入姓名"
></el-input>
</el-form-item>
</div>
<div
class=
"form-cell"
>
<el-form-item
:prop=
"'items.' + index + '.p
hon
e'"
:rules=
"rules.p
hon
e"
:prop=
"'items.' + index + '.p
erPhom
e'"
:rules=
"rules.p
erPhom
e"
>
<el-input
v-model=
"item.p
hon
e"
v-model=
"item.p
erPhom
e"
placeholder=
"请输入手机号"
></el-input>
</el-form-item>
...
...
@@ -59,6 +59,7 @@
</
template
>
<
script
>
import
{
messageGetList
,
messageEdit
}
from
"
@/api/tyler/sys
"
;
export
default
{
name
:
'
DynamicForm
'
,
data
()
{
...
...
@@ -70,7 +71,7 @@ export default {
return
callback
(
new
Error
(
'
手机号格式不正确
'
));
}
// 检查手机号是否重复
const
count
=
this
.
form
.
items
.
filter
(
item
=>
item
.
p
hon
e
===
value
).
length
;
const
count
=
this
.
form
.
items
.
filter
(
item
=>
item
.
p
erPhom
e
===
value
).
length
;
if
(
count
>
1
)
{
return
callback
(
new
Error
(
'
手机号不能重复
'
));
}
...
...
@@ -81,26 +82,35 @@ export default {
form
:
{
items
:
[
{
n
ame
:
''
,
p
hon
e
:
''
perN
ame
:
''
,
p
erPhom
e
:
''
}
]
},
rules
:
{
n
ame
:
[
perN
ame
:
[
{
required
:
true
,
message
:
'
请输入姓名
'
,
trigger
:
'
blur
'
}
],
p
hon
e
:
[
p
erPhom
e
:
[
{
required
:
true
,
validator
:
validatePhone
,
trigger
:
'
blur
'
}
]
}
};
},
created
(){
this
.
getList
()
},
methods
:
{
getList
(){
messageGetList
().
then
(
res
=>
{
console
.
log
(
res
,
'
res
'
)
this
.
form
.
items
=
res
.
rows
;
})
},
addItem
()
{
this
.
form
.
items
.
push
({
n
ame
:
''
,
p
hon
e
:
''
perN
ame
:
''
,
p
erPhom
e
:
''
});
},
removeItem
(
index
)
{
...
...
@@ -111,7 +121,11 @@ export default {
if
(
valid
)
{
// 提交表单数据
console
.
log
(
'
提交的数据:
'
,
this
.
form
.
items
);
this
.
$message
.
success
(
'
提交成功
'
);
messageEdit
(
this
.
form
.
items
).
then
(
res
=>
{
this
.
$message
.
success
(
'
提交成功
'
);
this
.
getList
()
})
}
else
{
this
.
$message
.
error
(
'
请修正表单中的错误
'
);
return
false
;
...
...
@@ -119,7 +133,7 @@ export default {
});
},
resetForm
()
{
this
.
$refs
.
formRef
.
resetFields
();
this
.
getList
()
}
}
};
...
...
src/views/system/waterSysSet/index.vue
View file @
089eca97
...
...
@@ -7,6 +7,8 @@
v-model=
"formData.status"
active-text=
"已开启"
inactive-text=
"已关闭"
active-value=
"1"
inactive-value=
"0"
@
change=
"handleStatusChange"
></el-switch>
</div>
...
...
@@ -58,16 +60,18 @@
<div
class=
"pump-selection"
>
<span>
对应控制水泵:
</span>
<
el-checkbox-group
v-model=
"sump.selectedPump
s"
>
<
div
class=
"pump-checkboxe
s"
>
<el-checkbox
v-for=
"pump in sump.draPeakPumpVos"
:key=
"pump.pumpId"
:label=
"pump.pumpName"
v-model=
"pump.pumpStatus"
:true-label=
"1"
:false-label=
"0"
size=
"small"
>
{{
pump
.
pumpName
}}
</el-checkbox>
</
el-checkbox-group
>
</
div
>
</div>
</div>
...
...
@@ -84,95 +88,101 @@
</
template
>
<
script
>
import
{
peakGetDra
,
peakEditDra
}
from
"
@/api/tyler/sys
"
;
import
{
peakGetDra
,
peakEditDra
}
from
"
@/api/tyler/sys
"
;
export
default
{
name
:
'
AutomationControl
'
,
data
()
{
return
{
formData
:
{
status
:
true
,
// 默认开启
peakBeginTime
:
'
12:00:00
'
,
peakEndTime
:
'
14:00:00
'
,
draPeakSumpVos
:
[
{
sumpId
:
'
2
'
,
sumpName
:
'
二中水仓
'
,
heghtThresholdA
:
'
10
'
,
heghtThresholdB
:
'
20
'
,
heghtThresholdC
:
'
40
'
,
heghtThresholdD
:
'
80
'
,
draPeakPumpVos
:
[
{
pumpId
:
'
8
'
,
pumpName
:
'
水泵5
'
},
{
pumpId
:
'
9
'
,
pumpName
:
'
水泵6
'
},
{
pumpId
:
'
10
'
,
pumpName
:
'
水泵7
'
}
],
selectedPumps
:
[
'
水泵5
'
]
// 默认选中第一个
},
{
sumpId
:
'
2
'
,
sumpName
:
'
二中水仓
'
,
heghtThresholdA
:
'
10
'
,
heghtThresholdB
:
'
20
'
,
heghtThresholdC
:
'
40
'
,
heghtThresholdD
:
'
80
'
,
draPeakPumpVos
:
[
{
pumpId
:
'
3
'
,
pumpName
:
'
水泵3
'
},
],
selectedPumps
:
[
'
水泵3
'
]
// 默认选中第一个
},
]
status
:
"
1
"
,
// 默认开启
peakBeginTime
:
''
,
peakEndTime
:
''
,
draPeakSumpVos
:
[]
},
timeRange
:
[]
};
},
created
()
{
// 初始化时间范围
// this.getList()
this
.
getList
();
},
methods
:
{
getList
(){
getList
()
{
peakGetDra
().
then
(
res
=>
{
console
.
log
(
res
,
'
res
'
)
this
.
formData
=
res
.
data
this
.
timeRange
=
[
this
.
formData
.
peakBeginTime
,
this
.
formData
.
peakEndTime
];
})
const
data
=
res
.
data
;
// 保存原始水泵顺序
this
.
originalPumpOrder
=
new
Map
();
data
.
draPeakSumpVos
.
forEach
((
sump
,
sumpIndex
)
=>
{
this
.
originalPumpOrder
.
set
(
sumpIndex
,
sump
.
draPeakPumpVos
.
map
(
p
=>
p
.
pumpId
));
});
// 处理数据时保持原始顺序
data
.
draPeakSumpVos
=
data
.
draPeakSumpVos
.
map
((
sump
,
sumpIndex
)
=>
{
const
orderedPumps
=
[];
const
originalOrder
=
this
.
originalPumpOrder
.
get
(
sumpIndex
);
// 按照原始顺序重新排列水泵
originalOrder
.
forEach
(
pumpId
=>
{
const
found
=
sump
.
draPeakPumpVos
.
find
(
p
=>
p
.
pumpId
===
pumpId
);
if
(
found
)
{
orderedPumps
.
push
({
...
found
,
pumpStatus
:
parseInt
(
found
.
pumpStatus
,
10
)
});
}
});
return
{
...
sump
,
draPeakPumpVos
:
orderedPumps
};
});
this
.
formData
=
data
;
this
.
timeRange
=
[
data
.
peakBeginTime
,
data
.
peakEndTime
];
});
},
handleStatusChange
(
value
)
{
console
.
log
(
'
自动化控制状态已切换为:
'
,
value
?
'
开启
'
:
'
关闭
'
);
console
.
log
(
value
)
this
.
formData
.
status
=
value
;
console
.
log
(
'
自动化控制状态已切换为:
'
,
value
);
},
handleTimeRangeChange
(
value
)
{
if
(
value
&&
value
.
length
===
2
)
{
this
.
formData
.
peakBeginTime
=
value
[
0
];
this
.
formData
.
peakEndTime
=
value
[
1
];
console
.
log
(
'
峰谷值时间段已设置为:
'
,
this
.
formData
.
peakBeginTime
,
'
至
'
,
this
.
formData
.
peakEndTime
);
}
},
handleCancel
()
{
console
.
log
(
'
取消设置
'
);
// 这里可以添加重置表单的逻辑
this
.
getList
();
// 重新获取数据重置表单
},
handleSave
()
{
peakEditDra
(
this
.
formData
).
then
(
res
=>
{
this
.
$message
.
success
(
'
设置已保存
'
);
this
.
getList
()
})
console
.
log
(
'
保存设置:
'
,
this
.
formData
);
// 这里可以添加保存设置的逻辑
// 深拷贝时保持数组顺序
const
postData
=
{
...
this
.
formData
,
draPeakSumpVos
:
this
.
formData
.
draPeakSumpVos
.
map
(
sump
=>
({
...
sump
,
draPeakPumpVos
:
sump
.
draPeakPumpVos
.
map
(
pump
=>
({
...
pump
,
pumpStatus
:
pump
.
pumpStatus
.
toString
()
}))
}))
};
peakEditDra
(
postData
).
then
(
res
=>
{
this
.
$message
.
success
(
'
设置保存成功
'
);
this
.
getList
();
});
}
}
};
</
script
>
<
style
scoped
>
.pump-checkboxes
{
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
15px
;
}
.automation-control
{
padding
:
20px
;
background-color
:
#fff
;
...
...
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