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
b92f544c
Commit
b92f544c
authored
Aug 17, 2024
by
xuke
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://gitlab.91isoft.com:10022/hikvision/web-project
parents
0dd9d015
e39f0f7f
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
600 additions
and
428 deletions
+600
-428
FormBuilder.vue
src/components/FormBuilder.vue
+54
-0
PageData.vue
src/components/PageData.vue
+5
-1
AnnualParamPage.vue
src/views/SchedulingPage/AnnualParamPage.vue
+284
-214
PhenomenonPage.vue
src/views/SchedulingPage/PhenomenonPage.vue
+97
-89
WeatherManagePage.vue
src/views/SchedulingPage/WeatherManagePage.vue
+2
-29
WindManagePage.vue
src/views/SchedulingPage/WindManagePage.vue
+60
-45
AddWindow.vue
src/views/SchedulingPage/weatherManageSub/AddWindow.vue
+11
-5
BindWindow.vue
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
+35
-24
ReviseWindow.vue
src/views/SchedulingPage/weatherManageSub/ReviseWindow.vue
+52
-21
No files found.
src/components/FormBuilder.vue
0 → 100644
View file @
b92f544c
<
template
>
<div
class=
"annual-param-container"
>
<el-form
ref=
"searchForm"
label-suffix=
":"
>
<el-row
:gutter=
"20"
justify=
"space-evenly"
>
<el-col
v-for=
"(item, index) in props.schemas"
:key=
"index"
v-bind=
"item.colProps"
>
<el-form-item
:label=
"item.label"
:prop=
"item.prop"
>
<component
:is=
"components[item.type]"
:prop=
"item.prop"
:items=
"item.componentProps"
></component>
<!--
<el-input
v-model=
"queryPrarms"
placeholder=
"请选择"
/>
-->
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</
template
>
<
script
setup
>
import
{
defineProps
,
reactive
,
watch
,
ref
}
from
"vue"
;
import
mitter
from
"@/utils/mitter"
;
import
components
from
"@/components/FormComponents/index"
;
// 将所有组件引入
const
emit
=
defineEmits
([
"DataChange"
]);
const
props
=
defineProps
({
schemas
:
{
type
:
Array
,
default
:
[],
},
formData
:
{
type
:
Object
,
default
:
()
=>
{},
},
});
// 监听chageVal
mitter
.
on
(
"changeVal"
,
(
data
)
=>
{
const
{
name
,
value
}
=
data
;
if
(
name
)
{
props
.
formData
[
name
]
=
value
;
}
});
watch
(
()
=>
props
.
formData
,
(
newVal
)
=>
{
emit
(
"DataChange"
,
newVal
);
},
{
deep
:
true
}
);
defineExpose
({
formData
:
props
.
formData
});
</
script
>
src/components/PageData.vue
View file @
b92f544c
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
<el-table
<el-table
:data=
"data"
:data=
"data"
stripe
stripe
v-loading=
"loading"
border
border
style=
"width: 100%"
style=
"width: 100%"
:header-cell-class-name=
"tableHeaderClass"
:header-cell-class-name=
"tableHeaderClass"
...
@@ -55,7 +56,7 @@
...
@@ -55,7 +56,7 @@
:align=
"column.align"
:align=
"column.align"
>
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
width=
"300"
>
<el-table-column
label=
"操作"
fixed=
"right"
width=
"300"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<template
<template
v-for=
"(action, index) in actions"
v-for=
"(action, index) in actions"
...
@@ -149,6 +150,7 @@ let data = ref([]);
...
@@ -149,6 +150,7 @@ let data = ref([]);
const
total
=
ref
(
0
);
const
total
=
ref
(
0
);
const
searchForm
=
reactive
({});
const
searchForm
=
reactive
({});
const
getData
=
()
=>
{
const
getData
=
()
=>
{
loading
.
value
=
true
let
params
=
{
let
params
=
{
...
PagePrarms
,
...
PagePrarms
,
...
props
.
formData
,
...
props
.
formData
,
...
@@ -156,8 +158,10 @@ const getData = () => {
...
@@ -156,8 +158,10 @@ const getData = () => {
http
http
.
post
(
props
.
api
,
params
)
.
post
(
props
.
api
,
params
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
loading
.
value
=
false
if
(
res
.
success
)
{
if
(
res
.
success
)
{
data
.
value
=
res
.
data
;
data
.
value
=
res
.
data
;
total
.
value
=
res
.
data
.
length
}
}
})
})
.
catch
(
function
(
error
)
{
.
catch
(
function
(
error
)
{
...
...
src/views/SchedulingPage/AnnualParamPage.vue
View file @
b92f544c
This diff is collapsed.
Click to expand it.
src/views/SchedulingPage/PhenomenonPage.vue
View file @
b92f544c
This diff is collapsed.
Click to expand it.
src/views/SchedulingPage/WeatherManagePage.vue
View file @
b92f544c
...
@@ -10,9 +10,7 @@ import {
...
@@ -10,9 +10,7 @@ import {
}
from
'@/api/scheduling.js'
}
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
cloneDeep
from
'lodash/cloneDeep'
import
cloneDeep
from
'lodash/cloneDeep'
import
{
vFloatNumber
}
from
"@/utils/directives.js"
;
const
data
=
ref
()
const
data
=
ref
()
const
dataBackup
=
ref
([]);
const
dataBackup
=
ref
([]);
...
@@ -30,7 +28,6 @@ const isAutoSearchKey = ref() // 手自动模式查询
...
@@ -30,7 +28,6 @@ const isAutoSearchKey = ref() // 手自动模式查询
const
supplySearchKey
=
ref
()
// 供热站查询
const
supplySearchKey
=
ref
()
// 供热站查询
const
organizationStructure
=
ref
([])
// 组织结构数据
const
organizationStructure
=
ref
([])
// 组织结构数据
const
supplyData
=
ref
([])
// 供热站数据
const
supplyData
=
ref
([])
// 供热站数据
const
transferStructData
=
ref
([])
// 换热站结构数据,每个供热站和一定数量的换热站对应
function
search
()
{
function
search
()
{
if
(
!
isAutoSearchKey
.
value
&&
!
supplySearchKey
.
value
){
if
(
!
isAutoSearchKey
.
value
&&
!
supplySearchKey
.
value
){
...
@@ -76,8 +73,8 @@ const confirmRevise = val => { // 修改弹窗确认按钮事件
...
@@ -76,8 +73,8 @@ const confirmRevise = val => { // 修改弹窗确认按钮事件
}
}
alterWeatherMagData
(
params
).
then
(
res
=>
{
alterWeatherMagData
(
params
).
then
(
res
=>
{
if
(
res
.
success
){
if
(
res
.
success
){
getData
()
reviseWindowOpen
.
value
=
false
reviseWindowOpen
.
value
=
false
getData
()
ElMessage
({
ElMessage
({
message
:
'修改成功.'
,
message
:
'修改成功.'
,
type
:
'success'
,
type
:
'success'
,
...
@@ -144,15 +141,14 @@ function handleAddWinOpenClose(){
...
@@ -144,15 +141,14 @@ function handleAddWinOpenClose(){
addWindowOpen
.
value
=
false
addWindowOpen
.
value
=
false
}
}
function
handleAdd
(
val
){
function
handleAdd
(
val
){
console
.
log
(
"新增数据"
,
val
)
alterWeatherMagData
(
val
).
then
(
res
=>
{
alterWeatherMagData
(
val
).
then
(
res
=>
{
if
(
res
.
success
){
if
(
res
.
success
){
ElMessage
({
ElMessage
({
message
:
res
.
message
,
message
:
res
.
message
,
type
:
'success'
,
type
:
'success'
,
})
})
getData
()
addWindowOpen
.
value
=
false
addWindowOpen
.
value
=
false
getData
()
}
else
{
}
else
{
ElMessage
({
ElMessage
({
message
:
res
.
message
,
message
:
res
.
message
,
...
@@ -190,31 +186,10 @@ function getSupply() {
...
@@ -190,31 +186,10 @@ function getSupply() {
})
})
})
})
}
// 根据组织结构获取供热站数据
}
// 根据组织结构获取供热站数据
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
()
{
function
getOrganizationStructure
()
{
getOrganizationStructureInterface
().
then
(
res
=>
{
getOrganizationStructureInterface
().
then
(
res
=>
{
organizationStructure
.
value
=
res
.
data
organizationStructure
.
value
=
res
.
data
getSupply
()
getSupply
()
getAllTransfer
()
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
ElMessage
.
error
(
'接口异常,获取数据失败.'
)
ElMessage
.
error
(
'接口异常,获取数据失败.'
)
})
})
...
@@ -296,8 +271,6 @@ function resetSearch(){
...
@@ -296,8 +271,6 @@ function resetSearch(){
:open=
"bindWindowOpen"
:open=
"bindWindowOpen"
:data=
"dependentSub"
:data=
"dependentSub"
:supply=
"supplyData"
:supply=
"supplyData"
:transfer=
"transferStructData"
:all-weather-mag-data=
"dataBackup"
@
onCancel=
"onCancelBind"
@
onCancel=
"onCancelBind"
@
onConfirm=
"confirmBind"
></BindWindow>
@
onConfirm=
"confirmBind"
></BindWindow>
</div>
</div>
...
...
src/views/SchedulingPage/WindManagePage.vue
View file @
b92f544c
...
@@ -36,6 +36,11 @@ const formRef = ref()
...
@@ -36,6 +36,11 @@ const formRef = ref()
//校验规则
//校验规则
const
rules
=
reactive
({
const
rules
=
reactive
({
windTemp
:
[
windTemp
:
[
{
required
:
true
,
message
:
'请输入正确的对应温度'
,
trigger
:
"blur"
},
{
{
pattern
:
/^
(
-
?\d{1,11})(\.[
0-9
]{1,4})?
$/
,
pattern
:
/^
(
-
?\d{1,11})(\.[
0-9
]{1,4})?
$/
,
message
:
"请输入正确的对应温度"
,
message
:
"请输入正确的对应温度"
,
...
@@ -46,11 +51,13 @@ const rules = reactive({
...
@@ -46,11 +51,13 @@ const rules = reactive({
function
add
()
{
function
add
()
{
addWindowOpen
.
value
=
true
;
addWindowOpen
.
value
=
true
;
formRef
.
value
.
resetFields
()
}
// 新增按钮单击事件
}
// 新增按钮单击事件
function
revise
(
val
)
{
function
revise
(
val
)
{
reviseForm
.
value
=
{
...
val
};
reviseForm
.
value
=
{
...
val
};
reviseForm
.
value
.
windLevel
=
Number
(
reviseForm
.
value
.
windLevel
);
reviseForm
.
value
.
windLevel
=
Number
(
reviseForm
.
value
.
windLevel
);
reviseWindowOpen
.
value
=
true
;
reviseWindowOpen
.
value
=
true
;
formRef
.
value
.
resetFields
()
}
// 修改按钮单击事件
}
// 修改按钮单击事件
function
omit
(
val
)
{
function
omit
(
val
)
{
let
param
=
{
let
param
=
{
...
@@ -99,54 +106,62 @@ function handleClose() {
...
@@ -99,54 +106,62 @@ function handleClose() {
resetInput
();
resetInput
();
}
// 关闭弹窗
}
// 关闭弹窗
function
onReviseSubmit
()
{
function
onReviseSubmit
()
{
alterWind
(
reviseForm
.
value
)
formRef
.
value
.
validate
(
valid
=>
{
.
then
((
res
)
=>
{
if
(
valid
){
if
(
res
.
success
)
{
alterWind
(
reviseForm
.
value
)
getData
();
.
then
((
res
)
=>
{
handleClose
();
if
(
res
.
success
)
{
ElMessage
({
getData
();
message
:
"修改成功."
,
handleClose
();
type
:
"success"
,
ElMessage
({
});
message
:
"修改成功."
,
}
else
{
type
:
"success"
,
ElMessage
({
});
message
:
"修改失败."
,
}
else
{
type
:
"error"
,
ElMessage
({
});
message
:
res
.
message
,
}
type
:
"error"
,
});
})
}
.
catch
((
err
)
=>
{
})
ElMessage
({
.
catch
((
err
)
=>
{
message
:
"修改失败."
,
ElMessage
({
type
:
"error"
,
message
:
"修改失败."
,
});
type
:
"error"
,
});
});
});
}
})
}
// 修改表单提交
}
// 修改表单提交
function
onAddSubmit
()
{
function
onAddSubmit
()
{
addWind
(
addForm
.
value
)
formRef
.
value
.
validate
(
valid
=>
{
.
then
((
res
)
=>
{
if
(
valid
){
if
(
res
.
success
)
{
addWind
(
addForm
.
value
)
getData
();
.
then
((
res
)
=>
{
handleClose
();
if
(
res
.
success
)
{
ElMessage
({
getData
();
message
:
"新增成功."
,
handleClose
();
type
:
"success"
,
ElMessage
({
});
message
:
"新增成功."
,
}
else
{
type
:
"success"
,
ElMessage
({
});
message
:
"新增失败."
,
}
else
{
type
:
"error"
,
ElMessage
({
});
message
:
res
.
message
,
}
type
:
"error"
,
});
}
})
.
catch
((
err
)
=>
[
ElMessage
({
message
:
"新增失败."
,
type
:
"error"
,
}),
]);
}
})
})
.
catch
((
err
)
=>
[
ElMessage
({
message
:
"新增失败."
,
type
:
"error"
,
}),
]);
}
// 新增表单提交
}
// 新增表单提交
onMounted
(()
=>
{
onMounted
(()
=>
{
...
...
src/views/SchedulingPage/weatherManageSub/AddWindow.vue
View file @
b92f544c
...
@@ -36,9 +36,13 @@ function handleClose() {
...
@@ -36,9 +36,13 @@ function handleClose() {
emit
(
'onCancel'
)
emit
(
'onCancel'
)
}
}
function
handleConfirm
()
{
function
handleConfirm
()
{
addData
.
value
.
operateTime
=
getCurrentDateTime
()
formRef
.
value
.
validate
(
valid
=>
{
emit
(
'onConfirm'
,
addData
.
value
)
if
(
valid
){
resetInput
()
addData
.
value
.
operateTime
=
getCurrentDateTime
()
emit
(
'onConfirm'
,
addData
.
value
)
resetInput
()
}
})
}
}
function
getCurrentDateTime
()
{
function
getCurrentDateTime
()
{
const
now
=
new
Date
();
const
now
=
new
Date
();
...
@@ -53,6 +57,7 @@ function getCurrentDateTime() {
...
@@ -53,6 +57,7 @@ function getCurrentDateTime() {
}
// 生成时间
}
// 生成时间
function
onOpen
()
{
function
onOpen
()
{
resetInput
()
resetInput
()
formRef
.
value
.
resetFields
()
}
}
function
resetInput
()
{
function
resetInput
()
{
addData
.
value
=
{
addData
.
value
=
{
...
@@ -90,10 +95,11 @@ const rules = reactive({
...
@@ -90,10 +95,11 @@ const rules = reactive({
{
pattern
:
/^
(\d{1,11})
$/
,
"message"
:
"排序必须是1-11位正整数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,11})
$/
,
"message"
:
"排序必须是1-11位正整数"
,
trigger
:
"blur"
}
],
],
timeoutMin
:
[
timeoutMin
:
[
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"判断时间必须是1-1
0
位实数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"判断时间必须是1-1
1
位实数"
,
trigger
:
"blur"
}
],
],
temperature
:
[
temperature
:
[
{
pattern
:
/^
(
-
?\d{1,11})(\.[
0-9
]{1,4})?
$/
,
message
:
"请输入正确的调节温度"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
'请输入正确的温度'
},
{
pattern
:
/^
(
-
?\d{1,11})(\.[
0-9
]{1,4})?
$/
,
message
:
"请输入正确的温度"
,
trigger
:
"blur"
}
]
]
});
});
</
script
>
</
script
>
...
...
src/views/SchedulingPage/weatherManageSub/BindWindow.vue
View file @
b92f544c
...
@@ -3,10 +3,10 @@ import {
...
@@ -3,10 +3,10 @@ import {
ref
,
ref
,
defineProps
,
defineProps
,
defineEmits
,
defineEmits
,
watchEffect
watchEffect
,
reactive
}
from
"vue"
;
}
from
"vue"
;
import
{
getTransferInterface
,
getWeatherMagData
}
from
"@/api/scheduling.js"
import
{
getTransferInterface
,
getWeatherMagData
}
from
"@/api/scheduling.js"
import
{
ElLoading
}
from
'element-plus'
import
{
ElLoading
,
ElMessage
}
from
'element-plus'
import
cloneDeep
from
'lodash/cloneDeep'
import
cloneDeep
from
'lodash/cloneDeep'
const
props
=
defineProps
({
const
props
=
defineProps
({
...
@@ -24,7 +24,8 @@ const props = defineProps({
...
@@ -24,7 +24,8 @@ const props = defineProps({
type
:
Array
,
type
:
Array
,
default
:
[],
default
:
[],
required
:
true
required
:
true
}})
}
})
const
emit
=
defineEmits
({
const
emit
=
defineEmits
({
onCancel
:
null
,
onCancel
:
null
,
onConfirm
:
({})
=>
{
onConfirm
:
({})
=>
{
...
@@ -53,19 +54,25 @@ watchEffect(() => {
...
@@ -53,19 +54,25 @@ watchEffect(() => {
function
onSubmit
()
{
function
onSubmit
()
{
supplyData
.
value
.
forEach
(
item
=>
{
if
(
bindData
.
value
.
hasOwnProperty
(
'supplyId'
))
{
if
(
item
.
supplyId
===
bindData
.
value
.
supplyId
)
{
if
(
bindData
.
value
.
supplyId
)
{
bindData
.
value
.
supplyName
=
item
.
supplyName
supplyData
.
value
.
forEach
(
item
=>
{
if
(
item
.
supplyId
===
bindData
.
value
.
supplyId
)
{
bindData
.
value
.
supplyName
=
item
.
supplyName
}
})
selectedTransfer
.
value
.
forEach
(
item
=>
{
bindData
.
value
.
transfers
.
push
({
customizeId
:
bindData
.
value
.
customizeId
,
unitId
:
item
,
updateNullFields
:
''
})
})
emit
(
'onConfirm'
,
bindData
.
value
)
}
else
{
ElMessage
.
error
(
'请选择供热站'
)
}
}
})
}
selectedTransfer
.
value
.
forEach
(
item
=>
{
bindData
.
value
.
transfers
.
push
({
customizeId
:
bindData
.
value
.
customizeId
,
unitId
:
item
,
updateNullFields
:
''
})
})
emit
(
'onConfirm'
,
bindData
.
value
)
}
// 点击保存按钮
}
// 点击保存按钮
/**
/**
* 获取换热站数据
* 获取换热站数据
...
@@ -103,9 +110,9 @@ async function getTransfer(supplyId, isAvailable = true) {
...
@@ -103,9 +110,9 @@ async function getTransfer(supplyId, isAvailable = true) {
function
onOpen
()
{
function
onOpen
()
{
loadingInstance
=
ElLoading
.
service
({
target
:
'#bind-dialog'
})
selectedTransfer
.
value
.
length
=
0
// 清空已选择的换热站
selectedTransfer
.
value
.
length
=
0
// 清空已选择的换热站
transferData
.
value
.
length
=
0
// 清空显示的换热站
transferData
.
value
.
length
=
0
// 清空显示的换热站
loadingInstance
=
ElLoading
.
service
({
target
:
'.el-dialog'
})
if
(
bindData
.
value
.
hasOwnProperty
(
'supplyId'
))
{
if
(
bindData
.
value
.
hasOwnProperty
(
'supplyId'
))
{
if
(
bindData
.
value
.
supplyId
)
{
if
(
bindData
.
value
.
supplyId
)
{
optional
=
bindData
.
value
.
supplyId
optional
=
bindData
.
value
.
supplyId
...
@@ -121,14 +128,14 @@ function onOpen() {
...
@@ -121,14 +128,14 @@ function onOpen() {
* @param val supplyId
* @param val supplyId
*/
*/
function
selectChange
(
val
)
{
function
selectChange
(
val
)
{
loadingInstance
=
ElLoading
.
service
({
target
:
'
.el
-dialog'
})
loadingInstance
=
ElLoading
.
service
({
target
:
'
#bind
-dialog'
})
if
(
selectedTransfer
.
value
.
length
===
0
)
{
if
(
selectedTransfer
.
value
.
length
===
0
)
{
getTransfer
(
val
)
getTransfer
(
val
)
}
else
if
(
bindData
.
value
.
supplyId
===
optional
)
{
}
else
if
(
bindData
.
value
.
supplyId
===
optional
)
{
getTransfer
(
val
)
getTransfer
(
val
)
}
else
{
}
else
{
getTransfer
(
val
,
false
)
getTransfer
(
val
,
false
)
}
}
loadingInstance
.
close
()
loadingInstance
.
close
()
}
}
...
@@ -142,6 +149,7 @@ function checkboxChange(val) {
...
@@ -142,6 +149,7 @@ function checkboxChange(val) {
</
script
>
</
script
>
<
template
>
<
template
>
<el-dialog
<el-dialog
id=
"bind-dialog"
v-model=
"props.open"
v-model=
"props.open"
width=
"1000px"
width=
"1000px"
title=
"换热站绑定"
title=
"换热站绑定"
...
@@ -158,6 +166,7 @@ function checkboxChange(val) {
...
@@ -158,6 +166,7 @@ function checkboxChange(val) {
<el-row
class=
"not-select-row"
>
<el-row
class=
"not-select-row"
>
<el-col
:span=
"8"
class=
"content-col-label"
>
供热站:
</el-col>
<el-col
:span=
"8"
class=
"content-col-label"
>
供热站:
</el-col>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-select
<el-select
v-model=
"bindData.supplyId"
v-model=
"bindData.supplyId"
@
change=
"selectChange"
@
change=
"selectChange"
...
@@ -168,6 +177,7 @@ function checkboxChange(val) {
...
@@ -168,6 +177,7 @@ function checkboxChange(val) {
<el-option
v-for=
"item in supplyData"
:key=
"item.supplyId"
:label=
"item.supplyName"
<el-option
v-for=
"item in supplyData"
:key=
"item.supplyId"
:label=
"item.supplyName"
:value=
"item.supplyId"
/>
:value=
"item.supplyId"
/>
</el-select>
</el-select>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row
class=
"select-row"
>
<el-row
class=
"select-row"
>
...
@@ -185,6 +195,7 @@ function checkboxChange(val) {
...
@@ -185,6 +195,7 @@ function checkboxChange(val) {
</el-col>
</el-col>
</el-row>
</el-row>
</div>
</div>
</
template
>
</
template
>
<
template
#
footer
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
...
...
src/views/SchedulingPage/weatherManageSub/ReviseWindow.vue
View file @
b92f544c
<
script
setup
>
<
script
setup
>
import
{
ref
,
defineProps
,
defineEmits
,
computed
,
isRef
,
onMounted
,
watchEffect
,
reactive
}
from
"vue"
;
import
{
ref
,
defineProps
,
defineEmits
,
computed
,
isRef
,
onMounted
,
watchEffect
,
reactive
}
from
"vue"
;
import
cloneDeep
from
'lodash/cloneDeep'
import
cloneDeep
from
'lodash/cloneDeep'
import
{
vFloatNumber
}
from
"@/utils/directives.js"
;
import
{
vFloatNumber
}
from
"@/utils/directives.js"
;
import
{
getTransferInterface
}
from
"@/api/scheduling.js"
;
const
props
=
defineProps
({
const
props
=
defineProps
({
...
@@ -30,22 +30,23 @@ const formRef = ref()
...
@@ -30,22 +30,23 @@ const formRef = ref()
//校验规则
//校验规则
const
rules
=
reactive
({
const
rules
=
reactive
({
diffPercentage
:
[
diffPercentage
:
[
{
pattern
:
/^
([
0-9
]\d{0,1}
|100$
)(\.\d{1,4})?
$/
,
"message"
:
"请输入正确的百分比格式"
,
trigger
:
"blur"
}
{
pattern
:
/^
([
0-9
]\d{0,1}
|100$
)(\.\d{1,4})?
$/
,
"message"
:
"请输入正确的百分比格式"
,
trigger
:
"blur"
}
],
],
wind
:
[
wind
:
[
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"风速必须是1-11位实数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"风速必须是1-11位实数"
,
trigger
:
"blur"
}
],
],
illumination
:
[
illumination
:
[
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"光照必须是1-11位实数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"光照必须是1-11位实数"
,
trigger
:
"blur"
}
],
],
sort
:
[
sort
:
[
{
pattern
:
/^
(\d{1,11})
$/
,
"message"
:
"排序必须是1-11位正整数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,11})
$/
,
"message"
:
"排序必须是1-11位正整数"
,
trigger
:
"blur"
}
],
],
timeoutMin
:
[
timeoutMin
:
[
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"判断时间必须是1-10位实数"
,
trigger
:
"blur"
}
{
pattern
:
/^
(\d{1,11})(\.[
0-9
]{1,4})?
$/
,
"message"
:
"判断时间必须是1-10位实数"
,
trigger
:
"blur"
}
],
],
temperature
:
[
temperature
:
[
{
pattern
:
/^
(
-
?\d{1,11})(\.[
0-9
]{1,4})?
$/
,
message
:
"请输入正确的调节温度"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
'请输入正确的温度'
,
trigger
:
'blur'
},
{
pattern
:
/^
(
-
?\d{1,11})(\.[
0-9
]{1,4})?
$/
,
message
:
"请输入正确的温度"
,
trigger
:
"blur"
}
]
]
});
});
watchEffect
(()
=>
{
watchEffect
(()
=>
{
...
@@ -71,8 +72,38 @@ const switchingisAuto = computed({
...
@@ -71,8 +72,38 @@ const switchingisAuto = computed({
}
}
})
// 可写计算属性,手动、自动模式切换
})
// 可写计算属性,手动、自动模式切换
function
onOpen
()
{
function
onOpen
()
{
// console.log('props.data数据',props.data)
formRef
.
value
.
resetFields
()
// console.log('修改弹窗接收到的数据',reviseData.value)
}
async
function
handleConfirm
()
{
if
(
reviseData
.
value
.
hasOwnProperty
(
'supplyId'
))
{
if
(
reviseData
.
value
.
supplyId
)
{
getTransferInterface
({
customizeId
:
reviseData
.
value
.
customizeId
,
supplyId
:
reviseData
.
value
.
supplyId
}).
then
(
result
=>
{
for
(
let
item
of
result
.
data
)
{
if
(
item
.
selected
.
toLowerCase
()
===
'true'
){
reviseData
.
value
.
transfers
.
push
(
{
customizeId
:
reviseData
.
value
.
customizeId
,
unitId
:
item
.
transferId
,
updateNullFields
:
''
}
)
}
}
formRef
.
value
.
validate
(
valid
=>
{
if
(
valid
)
{
emit
(
'onConfirm'
,
reviseData
.
value
)
}
})
})
}
}
}
}
</
script
>
</
script
>
...
@@ -85,7 +116,7 @@ function onOpen() {
...
@@ -85,7 +116,7 @@ function onOpen() {
<el-col
:span=
"8"
class=
"content-col-label"
>
自定义名称:
</el-col>
<el-col
:span=
"8"
class=
"content-col-label"
>
自定义名称:
</el-col>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-input
maxlength=
"11"
:input-style=
"inputStyle"
v-model=
"reviseData.customizeName"
<el-input
maxlength=
"11"
:input-style=
"inputStyle"
v-model=
"reviseData.customizeName"
style=
"width: 510px"
/>
style=
"width: 510px"
/>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row>
<el-row>
...
@@ -102,7 +133,7 @@ function onOpen() {
...
@@ -102,7 +133,7 @@ function onOpen() {
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-form-item
prop=
"temperature"
style=
"padding: 0;margin: 0;"
>
<el-form-item
prop=
"temperature"
style=
"padding: 0;margin: 0;"
>
<el-input
maxlength=
"11"
:input-style=
"inputStyle"
v-model=
"reviseData.temperature"
<el-input
maxlength=
"11"
:input-style=
"inputStyle"
v-model=
"reviseData.temperature"
style=
"width: 510px"
/>
style=
"width: 510px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -110,7 +141,7 @@ function onOpen() {
...
@@ -110,7 +141,7 @@ function onOpen() {
<el-col
:span=
"8"
class=
"content-col-label"
>
风速:
</el-col>
<el-col
:span=
"8"
class=
"content-col-label"
>
风速:
</el-col>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-form-item
prop=
"wind"
style=
"padding: 0;margin: 0;"
>
<el-form-item
prop=
"wind"
style=
"padding: 0;margin: 0;"
>
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.wind"
style=
"width: 510px"
/>
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.wind"
style=
"width: 510px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -119,7 +150,7 @@ function onOpen() {
...
@@ -119,7 +150,7 @@ function onOpen() {
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-form-item
prop=
"illumination"
style=
"padding: 0;margin: 0;"
>
<el-form-item
prop=
"illumination"
style=
"padding: 0;margin: 0;"
>
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.illumination"
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.illumination"
style=
"width: 510px"
/>
style=
"width: 510px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -127,20 +158,20 @@ function onOpen() {
...
@@ -127,20 +158,20 @@ function onOpen() {
<el-col
:span=
"8"
class=
"content-col-label"
>
排序:
</el-col>
<el-col
:span=
"8"
class=
"content-col-label"
>
排序:
</el-col>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-col
:span=
"16"
class=
"content-col-value"
>
<el-form-item
prop=
"sort"
style=
"padding: 0;margin: 0;"
>
<el-form-item
prop=
"sort"
style=
"padding: 0;margin: 0;"
>
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.sort"
style=
"width: 510px"
/>
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.sort"
style=
"width: 510px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"5"
class=
"content-col-label"
>
切换自动模式:
</el-col>
<el-col
:span=
"5"
class=
"content-col-label"
>
切换自动模式:
</el-col>
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-checkbox
:style=
"
{ marginLeft: '10px' }" v-model="switchingisAuto" label="自动模式"
/>
<el-checkbox
:style=
"
{ marginLeft: '10px' }" v-model="switchingisAuto" label="自动模式"/>
</el-col>
</el-col>
<el-col
:span=
"5"
class=
"content-col-label"
>
自动偏差百分比(%d):
</el-col>
<el-col
:span=
"5"
class=
"content-col-label"
>
自动偏差百分比(%d):
</el-col>
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-form-item
prop=
"diffPercentage"
style=
"padding: 0;margin: 0;"
>
<el-form-item
prop=
"diffPercentage"
style=
"padding: 0;margin: 0;"
>
<el-input
v-float-number
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.diffPercentage"
<el-input
v-float-number
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.diffPercentage"
style=
"width: 240px"
/>
style=
"width: 240px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -149,14 +180,14 @@ function onOpen() {
...
@@ -149,14 +180,14 @@ function onOpen() {
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-form-item
prop=
"timeoutMin"
style=
"padding: 0;margin: 0;"
>
<el-form-item
prop=
"timeoutMin"
style=
"padding: 0;margin: 0;"
>
<el-input
v-float-number
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.timeoutMin"
<el-input
v-float-number
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.timeoutMin"
style=
"width: 240px"
/>
style=
"width: 240px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"5"
class=
"content-col-label"
>
自动调节温度(℃):
</el-col>
<el-col
:span=
"5"
class=
"content-col-label"
>
自动调节温度(℃):
</el-col>
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-col
:span=
"7"
class=
"content-col-value"
>
<el-form-item
prop=
"tempRegulation"
style=
"padding: 0;margin: 0;"
>
<el-form-item
prop=
"tempRegulation"
style=
"padding: 0;margin: 0;"
>
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.tempRegulation"
<el-input
:input-style=
"inputStyle"
maxlength=
"11"
v-model=
"reviseData.tempRegulation"
style=
"width: 240px"
/>
style=
"width: 240px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -166,7 +197,7 @@ function onOpen() {
...
@@ -166,7 +197,7 @@ function onOpen() {
</
template
>
</
template
>
<
template
#
footer
>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"
emit('onConfirm', reviseData)
"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"
handleConfirm
"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"emit('onCancel')"
>
关闭
</el-button>
<el-button
type=
"primary"
@
click=
"emit('onCancel')"
>
关闭
</el-button>
</div>
</div>
</
template
>
</
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