Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DC-TOM
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
刘照晖
DC-TOM
Commits
6a39dabf
Commit
6a39dabf
authored
May 25, 2025
by
蔡伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/layout-style' into 'dev'
Feat/layout style See merge request
!13
parents
5d435893
0c3e67ce
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
146 additions
and
126 deletions
+146
-126
index.vue
src/layout/index.vue
+2
-2
user.js
src/pinia/user.js
+0
-1
dustOverview.js
src/request/api/dustOverview.js
+2
-1
addDustCollectorDialog.vue
src/views/dustOverview/components/addDustCollectorDialog.vue
+34
-8
roomSettingDialog.vue
src/views/dustOverview/components/roomSettingDialog.vue
+32
-23
valveSettingDialog.vue
src/views/dustOverview/components/valveSettingDialog.vue
+15
-16
index.vue
src/views/dustOverview/index.vue
+60
-75
index.vue
src/views/login/index.vue
+1
-0
No files found.
src/layout/index.vue
View file @
6a39dabf
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<template
#
dropdown
>
<template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-menu>
<el-dropdown-item
:icon=
"Plus"
@
click=
"logout"
>
退出登录
</el-dropdown-item>
<el-dropdown-item
@
click=
"logout"
>
退出登录
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</
template
>
</
template
>
</el-dropdown>
</el-dropdown>
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
</template>
</template>
<
script
>
<
script
>
import
menuCom
from
"./menuCom.vue"
;
import
menuCom
from
"./menuCom.vue"
;
import
{
CaretBottom
,
Plus
}
from
"@element-plus/icons-vue"
;
import
{
CaretBottom
}
from
"@element-plus/icons-vue"
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
watch
,
ref
,
onMounted
}
from
'vue'
;
import
{
watch
,
ref
,
onMounted
}
from
'vue'
;
import
{
getToken
}
from
'@/utils/auth'
;
import
{
getToken
}
from
'@/utils/auth'
;
...
...
src/pinia/user.js
View file @
6a39dabf
...
@@ -26,7 +26,6 @@ export const useUsersStore = defineStore('user', {
...
@@ -26,7 +26,6 @@ export const useUsersStore = defineStore('user', {
},
},
actions
:
{
actions
:
{
login
(
userInfo
)
{
login
(
userInfo
)
{
debugger
const
{
account
,
password
,
rememberMe
}
=
userInfo
const
{
account
,
password
,
rememberMe
}
=
userInfo
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
login
(
JSON
.
stringify
(
userInfo
)).
then
(
response
=>
{
login
(
JSON
.
stringify
(
userInfo
)).
then
(
response
=>
{
...
...
src/request/api/dustOverview.js
View file @
6a39dabf
...
@@ -21,10 +21,11 @@ export function getCloseLoopNum() {
...
@@ -21,10 +21,11 @@ export function getCloseLoopNum() {
}
}
export
function
getProductionLine
()
{
export
function
getProductionLine
(
params
)
{
return
request
({
return
request
({
url
:
"/transaction/getProductionLine"
,
url
:
"/transaction/getProductionLine"
,
method
:
"get"
,
method
:
"get"
,
params
,
});
});
}
}
...
...
src/views/dustOverview/components/addDustCollectorDialog.vue
View file @
6a39dabf
<
template
>
<
template
>
<el-dialog
:model-value=
"modelValue"
title=
"新增除尘器
"
width=
"460px"
:close-on-click-modal=
"false"
<el-dialog
:model-value=
"modelValue"
:title=
"editData ? '编辑除尘器' : '新增除尘器'
"
width=
"460px"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
@
update:model-value=
"$emit('update:modelValue', $event)"
>
:close-on-press-escape=
"false"
@
update:model-value=
"$emit('update:modelValue', $event)"
>
<div
class=
"add-dust-form"
>
<div
class=
"add-dust-form"
>
<div
class=
"form-item"
>
<div
class=
"form-item"
>
...
@@ -81,15 +81,18 @@
...
@@ -81,15 +81,18 @@
</template>
</template>
<
script
setup
>
<
script
setup
>
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
;
import
{
ref
,
reactive
,
onMounted
,
watch
}
from
'vue'
;
import
{
getVisDusterList
,
getProductionLine
}
from
"@/request/api/dustOverview"
;
import
{
getVisDusterList
,
getProductionLine
}
from
"@/request/api/dustOverview"
;
import
{
getToken
}
from
"@/utils/auth"
;
const
props
=
defineProps
({
const
props
=
defineProps
({
modelValue
:
{
modelValue
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
},
editData
:
{
type
:
Object
,
default
:
null
}
});
});
const
emit
=
defineEmits
([
'update:modelValue'
,
'save'
]);
const
emit
=
defineEmits
([
'update:modelValue'
,
'save'
]);
...
@@ -116,6 +119,22 @@ const formData = reactive({
...
@@ -116,6 +119,22 @@ const formData = reactive({
coordinateY
:
null
coordinateY
:
null
});
});
// 监听editData变化,初始化表单数据
watch
(()
=>
props
.
editData
,
(
newVal
)
=>
{
if
(
newVal
)
{
formData
.
name
=
newVal
.
deviceName
;
formData
.
code
=
newVal
.
deviceNo
;
formData
.
process
=
newVal
.
productionLineId
;
formData
.
chamberCount
=
Number
(
newVal
.
compartNum
);
formData
.
valveCount
=
Number
(
newVal
.
valveNum
);
formData
.
pressureMin
=
Number
(
newVal
.
pressureDiffLow
);
formData
.
pressureMax
=
Number
(
newVal
.
pressureDiffHigh
);
formData
.
serverIp
=
newVal
.
serviceIp
;
formData
.
coordinateX
=
Number
(
newVal
.
x
);
formData
.
coordinateY
=
Number
(
newVal
.
y
);
}
},
{
immediate
:
true
});
const
rules
=
{
const
rules
=
{
name
:
[{
required
:
true
,
message
:
'请输入除尘器名称'
,
trigger
:
'blur'
}],
name
:
[{
required
:
true
,
message
:
'请输入除尘器名称'
,
trigger
:
'blur'
}],
code
:
[{
required
:
true
,
message
:
'请输入除尘器编号'
,
trigger
:
'blur'
}],
code
:
[{
required
:
true
,
message
:
'请输入除尘器编号'
,
trigger
:
'blur'
}],
...
@@ -207,7 +226,9 @@ const handleSearch = (query) => {
...
@@ -207,7 +226,9 @@ const handleSearch = (query) => {
};
};
const
productionLine
=
()
=>
{
const
productionLine
=
()
=>
{
getProductionLine
().
then
(
res
=>
{
getProductionLine
({
branchFactoryId
:
getToken
(
"dataBranchFactoryId"
)
}).
then
(
res
=>
{
processOptions
.
value
=
res
.
data
;
processOptions
.
value
=
res
.
data
;
})
})
}
}
...
@@ -231,9 +252,6 @@ const submitForm = () => {
...
@@ -231,9 +252,6 @@ const submitForm = () => {
if
(
!
formRef
.
value
)
return
;
if
(
!
formRef
.
value
)
return
;
formRef
.
value
.
validate
((
valid
)
=>
{
formRef
.
value
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
// 组装压差范围
const
pressureRange
=
`
${
formData
.
pressureMin
}
~
${
formData
.
pressureMax
}
`
;
// 准备提交的数据
// 准备提交的数据
const
submitData
=
{
const
submitData
=
{
deviceNo
:
formData
.
code
,
deviceNo
:
formData
.
code
,
...
@@ -248,6 +266,11 @@ const submitForm = () => {
...
@@ -248,6 +266,11 @@ const submitForm = () => {
y
:
formData
.
coordinateY
,
y
:
formData
.
coordinateY
,
};
};
// 如果是编辑模式,添加id
if
(
props
.
editData
)
{
submitData
.
id
=
props
.
editData
.
id
;
}
// 发送数据到父组件处理保存逻辑
// 发送数据到父组件处理保存逻辑
emit
(
'save'
,
submitData
);
emit
(
'save'
,
submitData
);
emit
(
'update:modelValue'
,
false
);
emit
(
'update:modelValue'
,
false
);
...
@@ -267,6 +290,9 @@ const cancel = () => {
...
@@ -267,6 +290,9 @@ const cancel = () => {
formData
.
process
=
''
;
formData
.
process
=
''
;
formData
.
chamberCount
=
null
;
formData
.
chamberCount
=
null
;
formData
.
valveCount
=
null
;
formData
.
valveCount
=
null
;
formData
.
pressureMin
=
null
;
formData
.
pressureMax
=
null
;
formData
.
serverIp
=
''
;
formData
.
coordinateX
=
null
;
formData
.
coordinateX
=
null
;
formData
.
coordinateY
=
null
;
formData
.
coordinateY
=
null
;
emit
(
'update:modelValue'
,
false
);
emit
(
'update:modelValue'
,
false
);
...
...
src/views/dustOverview/components/roomSettingDialog.vue
View file @
6a39dabf
...
@@ -49,11 +49,15 @@
...
@@ -49,11 +49,15 @@
size=
"small"
size=
"small"
border
border
>
>
<el-table-column
prop=
"row"
label=
"排"
width=
"180"
/>
<el-table-column
prop=
"compartPositionRow"
label=
"排"
width=
"180"
>
<el-table-column
prop=
"count"
label=
"仓数量"
>
<template
#
default=
"
{ row }">
<span>
第
{{
row
.
compartPositionRow
}}
排
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"compartPositionColumnNum"
label=
"仓数量"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<el-input-number
<el-input-number
v-model=
"row.co
unt
"
v-model=
"row.co
mpartPositionColumnNum
"
:min=
"1"
:min=
"1"
:max=
"50"
:max=
"50"
controls-position=
"right"
controls-position=
"right"
...
@@ -81,13 +85,9 @@ import { ref, computed, watch } from "vue";
...
@@ -81,13 +85,9 @@ import { ref, computed, watch } from "vue";
const
props
=
defineProps
({
const
props
=
defineProps
({
modelValue
:
Boolean
,
modelValue
:
Boolean
,
totalRooms
:
{
data
:
{
type
:
Number
,
type
:
Object
,
required
:
true
default
:
()
=>
{}
},
initialDistribution
:
{
type
:
Array
,
default
:
()
=>
[]
}
}
});
});
...
@@ -101,14 +101,17 @@ const roomForm = ref({
...
@@ -101,14 +101,17 @@ const roomForm = ref({
const
distributionData
=
ref
([]);
const
distributionData
=
ref
([]);
const
initializeState
=
()
=>
{
const
initializeState
=
()
=>
{
if
(
props
.
modelValue
)
{
console
.
log
(
props
.
data
.
deviceNo
)
roomForm
.
value
.
totalRooms
=
props
.
totalRooms
;
if
(
props
.
data
.
deviceNo
)
{
const
{
compartNum
,
compartRowNum
,
compartHealthList
}
=
props
.
data
;
roomForm
.
value
.
totalRooms
=
compartNum
||
0
;
roomForm
.
value
.
rows
=
compartRowNum
||
0
if
(
props
.
initialDistribution
&&
props
.
initialDistribution
.
length
>
0
)
{
if
(
compartHealthList
&&
compartHealthList
.
length
>
0
)
{
roomForm
.
value
.
rows
=
props
.
initialDistribution
.
length
;
roomForm
.
value
.
rows
=
compartHealthList
.
length
;
distributionData
.
value
=
props
.
initialDistribution
.
map
((
row
,
index
)
=>
({
distributionData
.
value
=
compartHealthList
.
map
((
row
,
index
)
=>
({
row
:
`第
${
index
+
1
}
排`
,
compartPositionRow
:
index
+
1
,
co
unt
:
row
.
length
co
mpartPositionColumnNum
:
row
.
length
}));
}));
}
else
{
}
else
{
roomForm
.
value
.
rows
=
0
;
roomForm
.
value
.
rows
=
0
;
...
@@ -117,7 +120,7 @@ const initializeState = () => {
...
@@ -117,7 +120,7 @@ const initializeState = () => {
}
}
};
};
watch
(()
=>
props
.
modelValue
,
(
newVal
)
=>
{
watch
(()
=>
props
.
data
,
(
newVal
)
=>
{
if
(
newVal
)
{
if
(
newVal
)
{
initializeState
();
initializeState
();
}
}
...
@@ -125,7 +128,7 @@ watch(() => props.modelValue, (newVal) => {
...
@@ -125,7 +128,7 @@ watch(() => props.modelValue, (newVal) => {
const
distributionDiff
=
computed
(()
=>
{
const
distributionDiff
=
computed
(()
=>
{
const
total
=
distributionData
.
value
.
reduce
(
const
total
=
distributionData
.
value
.
reduce
(
(
sum
,
item
)
=>
sum
+
item
.
co
unt
,
(
sum
,
item
)
=>
sum
+
item
.
co
mpartPositionColumnNum
,
0
0
);
);
return
total
-
roomForm
.
value
.
totalRooms
;
return
total
-
roomForm
.
value
.
totalRooms
;
...
@@ -142,8 +145,8 @@ const handleRowsChange = (value) => {
...
@@ -142,8 +145,8 @@ const handleRowsChange = (value) => {
// 生成分布数据
// 生成分布数据
distributionData
.
value
=
Array
.
from
({
length
:
value
},
(
_
,
index
)
=>
{
distributionData
.
value
=
Array
.
from
({
length
:
value
},
(
_
,
index
)
=>
{
return
{
return
{
row
:
`第
${
index
+
1
}
排`
,
compartPositionRow
:
index
+
1
,
co
unt
:
index
<
remainder
?
baseValue
+
1
:
baseValue
co
mpartPositionColumnNum
:
index
<
remainder
?
baseValue
+
1
:
baseValue
};
};
});
});
};
};
...
@@ -154,8 +157,14 @@ const handleDistributionChange = () => {
...
@@ -154,8 +157,14 @@ const handleDistributionChange = () => {
const
handleConfirm
=
()
=>
{
const
handleConfirm
=
()
=>
{
if
(
distributionDiff
.
value
===
0
)
{
if
(
distributionDiff
.
value
===
0
)
{
emit
(
"confirm"
,
distributionData
.
value
);
const
{
deviceNo
,
compartNum
}
=
props
.
data
;
emit
(
"update:modelValue"
,
false
);
emit
(
"confirm"
,
{
compartNum
,
dusterNo
:
deviceNo
,
compartRowNum
:
roomForm
.
value
.
rows
,
detailList
:
distributionData
.
value
});
// emit("update:modelValue", false);
}
}
};
};
</
script
>
</
script
>
...
...
src/views/dustOverview/components/valveSettingDialog.vue
View file @
6a39dabf
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
/>
/>
</div>
</div>
<div
class=
"input-group"
>
<div
class=
"input-group"
>
<span>
布
阀
数量:
</span>
<span>
布
袋
数量:
</span>
<el-input-number
<el-input-number
v-model=
"valveForm.distribution"
v-model=
"valveForm.distribution"
:min=
"1"
:min=
"1"
...
@@ -108,12 +108,8 @@ import { ref, watch, computed } from "vue";
...
@@ -108,12 +108,8 @@ import { ref, watch, computed } from "vue";
const
props
=
defineProps
({
const
props
=
defineProps
({
modelValue
:
Boolean
,
modelValue
:
Boolean
,
totalValves
:
{
data
:
{
type
:
Number
,
type
:
Object
,
required
:
true
},
statusData
:
{
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
}
}
});
});
...
@@ -160,19 +156,22 @@ const validateValveCount = computed(() => {
...
@@ -160,19 +156,22 @@ const validateValveCount = computed(() => {
const
initializeState
=
()
=>
{
const
initializeState
=
()
=>
{
if
(
props
.
modelValue
)
{
if
(
props
.
modelValue
)
{
valveForm
.
value
.
total
=
props
.
totalValves
;
console
.
log
(
props
.
data
)
statusData
.
value
=
[...
props
.
statusData
];
// 深拷贝状态数据
// valveForm.value.total = props.totalValves;
errorMessage
.
value
=
""
;
// statusData.value = [...props.statusData]; // 深拷贝状态数据
// errorMessage.value = "";
// 如果有数据,默认选中第一个仓室
//
//
如果有数据,默认选中第一个仓室
if
(
statusData
.
value
.
length
>
0
)
{
//
if (statusData.value.length > 0) {
valveForm
.
value
.
roomNo
=
statusData
.
value
[
0
].
index
;
//
valveForm.value.roomNo = statusData.value[0].index;
valveForm
.
value
.
valveCount
=
statusData
.
value
[
0
].
count
;
//
valveForm.value.valveCount = statusData.value[0].count;
valveForm
.
value
.
distribution
=
statusData
.
value
[
0
].
count
;
// 默认布阀数量等于电磁阀数量
//
valveForm.value.distribution = statusData.value[0].count; // 默认布阀数量等于电磁阀数量
}
//
}
}
}
};
};
// getToken("customerId"),
// 当选中的仓室改变时,更新电磁阀分布数量
// 当选中的仓室改变时,更新电磁阀分布数量
const
handleRoomChange
=
(
roomIndex
)
=>
{
const
handleRoomChange
=
(
roomIndex
)
=>
{
const
selectedRoom
=
statusData
.
value
.
find
(
cell
=>
cell
.
index
===
roomIndex
);
const
selectedRoom
=
statusData
.
value
.
find
(
cell
=>
cell
.
index
===
roomIndex
);
...
...
src/views/dustOverview/index.vue
View file @
6a39dabf
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
}}
</span>
}}
</span>
</
template
>
</
template
>
<
template
#
valveNum=
"{ row }"
>
<
template
#
valveNum=
"{ row }"
>
<span
class=
"health-score"
@
click=
"handle
v
alveNumClick(row)"
>
{{
<span
class=
"health-score"
@
click=
"handle
V
alveNumClick(row)"
>
{{
row
.
valveNum
row
.
valveNum
}}
</span>
}}
</span>
</
template
>
</
template
>
...
@@ -144,22 +144,21 @@
...
@@ -144,22 +144,21 @@
<!-- 使用新的仓室数量设置弹窗组件 -->
<!-- 使用新的仓室数量设置弹窗组件 -->
<RoomSettingDialog
<RoomSettingDialog
v-model=
"roomSettingVisible"
v-model=
"roomSettingVisible"
:total-rooms=
"currentEditingRow?.healthScore || 0"
:data=
"currentEditingRow"
:initial-distribution=
"currentEditingRow?.status || []"
@
confirm=
"handleRoomSettingConfirm"
@
confirm=
"handleRoomSettingConfirm"
/>
/>
<!-- 使用新的电磁阀数量设置弹窗组件 -->
<!-- 使用新的电磁阀数量设置弹窗组件 -->
<ValveSettingDialog
<ValveSettingDialog
v-model=
"valveSettingVisible"
v-model=
"valveSettingVisible"
:total-valves=
"valveForm.total"
:data=
"currentEditingRow"
:status-data=
"currentEditingRow?.status || []"
@
confirm=
"handleValveSettingConfirm"
@
confirm=
"handleValveSettingConfirm"
/>
/>
<!-- 使用新增除尘器弹窗组件 -->
<!-- 使用新增除尘器弹窗组件 -->
<AddDustCollectorDialog
<AddDustCollectorDialog
v-model=
"isAddDustCollectorVisible"
v-model=
"isAddDustCollectorVisible"
:edit-data=
"currentEditingDustCollector"
@
save=
"handleSaveDustCollector"
@
save=
"handleSaveDustCollector"
/>
/>
</div>
</div>
...
@@ -167,8 +166,10 @@
...
@@ -167,8 +166,10 @@
<
script
setup
>
<
script
setup
>
import
{
ref
,
onMounted
,
onBeforeUnmount
,
computed
,
watch
}
from
"vue"
;
import
{
ref
,
onMounted
,
onBeforeUnmount
,
computed
,
watch
}
from
"vue"
;
import
{
getDusterLeakNum
,
getHealthPercent
,
getCloseLoopNum
,
getProductionLine
,
getDusterList
,
postAddDuster
,
postUpdateDuster
}
from
"@/request/api/dustOverview"
;
import
{
getDusterLeakNum
,
getHealthPercent
,
getCloseLoopNum
,
getProductionLine
,
getDusterList
,
postAddDuster
,
postUpdateDuster
,
postAddCompartAllocation
}
from
"@/request/api/dustOverview"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
CommonTable
from
"@/components/commonTable/index.vue"
;
import
CommonTable
from
"@/components/commonTable/index.vue"
;
import
{
ElMessageBox
,
ElMessage
}
from
"element-plus"
;
import
RoomSettingDialog
from
"./components/roomSettingDialog.vue"
;
import
RoomSettingDialog
from
"./components/roomSettingDialog.vue"
;
import
ValveSettingDialog
from
"./components/valveSettingDialog.vue"
;
import
ValveSettingDialog
from
"./components/valveSettingDialog.vue"
;
import
AddDustCollectorDialog
from
"./components/addDustCollectorDialog.vue"
;
import
AddDustCollectorDialog
from
"./components/addDustCollectorDialog.vue"
;
...
@@ -242,6 +243,21 @@ const tableColumns = ref([
...
@@ -242,6 +243,21 @@ const tableColumns = ref([
const
tableData
=
ref
([]);
const
tableData
=
ref
([]);
// 仓室设置相关
const
roomSettingVisible
=
ref
(
false
);
const
currentEditingRow
=
ref
(
null
);
// 电磁阀设置相关
const
valveSettingVisible
=
ref
(
false
);
const
valveForm
=
ref
({
total
:
120
,
});
// 新增除尘器相关
const
isAddDustCollectorVisible
=
ref
(
false
);
const
currentEditingDustCollector
=
ref
(
null
);
watch
(
productionLine
,
(
newVal
)
=>
{
watch
(
productionLine
,
(
newVal
)
=>
{
productionLineFiltered
.
value
=
newVal
;
productionLineFiltered
.
value
=
newVal
;
});
});
...
@@ -282,7 +298,8 @@ const handleView = (row) => {
...
@@ -282,7 +298,8 @@ const handleView = (row) => {
};
};
const
handleEdit
=
(
row
)
=>
{
const
handleEdit
=
(
row
)
=>
{
console
.
log
(
"编辑"
,
row
);
currentEditingDustCollector
.
value
=
row
;
isAddDustCollectorVisible
.
value
=
true
;
};
};
const
handlePaginationChange
=
(
pagination
)
=>
{
const
handlePaginationChange
=
(
pagination
)
=>
{
...
@@ -297,73 +314,41 @@ const onSubmit = () => {
...
@@ -297,73 +314,41 @@ const onSubmit = () => {
getData
();
getData
();
};
};
// 仓室设置相关
const
roomSettingVisible
=
ref
(
false
);
const
currentEditingRow
=
ref
(
null
);
// 电磁阀设置相关
const
valveSettingVisible
=
ref
(
false
);
const
valveForm
=
ref
({
total
:
120
,
});
// 新增除尘器相关
const
isAddDustCollectorVisible
=
ref
(
false
);
// 修改打开弹窗的处理函数
// 修改打开弹窗的处理函数
const
handleHealthScoreClick
=
(
row
)
=>
{
const
handleHealthScoreClick
=
(
row
)
=>
{
if
(
row
.
compartNum
<
1
)
{
ElMessageBox
.
alert
(
'当前仓室数量为0,无法进行设置'
,
'提示'
);
return
;
}
currentEditingRow
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
row
));
currentEditingRow
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
row
));
roomSettingVisible
.
value
=
true
;
roomSettingVisible
.
value
=
true
;
};
};
// 确认设置
// 确认设置
const
handleRoomSettingConfirm
=
(
distributionData
)
=>
{
const
handleRoomSettingConfirm
=
(
data
)
=>
{
if
(
currentEditingRow
.
value
)
{
console
.
log
(
'data'
,
data
)
// 创建新的状态矩阵
const
params
=
data
;
const
newStatus
=
[];
postAddCompartAllocation
(
params
).
then
(
res
=>
{
let
chamberIndex
=
1
;
console
.
log
(
res
);
if
(
res
.
code
==
1
)
{
// 根据分布数据重新生成状态矩阵
ElMessage
.
success
(
'更新仓室数量成功'
);
distributionData
.
forEach
((
rowData
,
rowIndex
)
=>
{
roomSettingVisible
.
value
=
false
;
const
rowArray
=
[];
getData
();
}
else
{
// 获取当前行中应该有多少个仓室
ElMessage
.
error
(
res
.
message
);
const
rowCount
=
rowData
.
count
;
}
})
for
(
let
i
=
0
;
i
<
rowCount
;
i
++
)
{
// 尝试获取原始数据或创建新数据
let
existingRoom
=
null
;
if
(
currentEditingRow
.
value
.
status
[
rowIndex
]
&&
currentEditingRow
.
value
.
status
[
rowIndex
][
i
])
{
existingRoom
=
{...
currentEditingRow
.
value
.
status
[
rowIndex
][
i
]};
}
rowArray
.
push
(
existingRoom
||
{
index
:
chamberIndex
,
status
:
1
,
// 默认状态正常
count
:
1
// 默认阀门数量
});
chamberIndex
++
;
}
newStatus
.
push
(
rowArray
);
});
// 更新行的状态矩阵和总数
currentEditingRow
.
value
.
status
=
newStatus
;
currentEditingRow
.
value
.
healthScore
=
chamberIndex
-
1
;
// 总仓室数
}
};
};
// 点击电磁阀数量时打开弹窗
// 点击电磁阀数量时打开弹窗
const
handleValveNumClick
=
(
row
)
=>
{
const
handleValveNumClick
=
(
row
)
=>
{
// 创建一个扁平化的状态数组用于电磁阀设置
// 创建一个扁平化的状态数组用于电磁阀设置
currentEditingRow
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
row
));
currentEditingRow
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
row
));
const
flattenedStatus
=
row
.
status
.
flat
().
map
(
item
=>
({...
item
}));
//
const flattenedStatus = row.status.flat().map(item => ({...item}));
currentEditingRow
.
value
.
status
=
flattenedStatus
;
//
currentEditingRow.value.status = flattenedStatus;
valveForm
.
value
.
total
=
row
.
valveNum
;
//
valveForm.value.total = row.valveNum;
valveSettingVisible
.
value
=
true
;
valveSettingVisible
.
value
=
true
;
};
};
...
@@ -396,24 +381,28 @@ const handleValveSettingConfirm = (updatedStatusData) => {
...
@@ -396,24 +381,28 @@ const handleValveSettingConfirm = (updatedStatusData) => {
// 打开新增除尘器弹窗
// 打开新增除尘器弹窗
const
handleAddDustCollector
=
()
=>
{
const
handleAddDustCollector
=
()
=>
{
currentEditingDustCollector
.
value
=
null
;
isAddDustCollectorVisible
.
value
=
true
;
isAddDustCollectorVisible
.
value
=
true
;
};
};
// 保存新增除尘器
// 保存新增
或编辑
除尘器
const
handleSaveDustCollector
=
(
data
)
=>
{
const
handleSaveDustCollector
=
(
data
)
=>
{
if
(
data
.
id
)
{
if
(
data
.
id
)
{
// 编辑模式
postUpdateDuster
(
data
).
then
(
res
=>
{
postUpdateDuster
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
ElMessage
.
success
(
'更新除尘器成功'
);
ElMessage
.
success
(
'更新除尘器成功'
);
isAddDustCollectorVisible
.
value
=
false
;
isAddDustCollectorVisible
.
value
=
false
;
refreshData
();
currentEditingDustCollector
.
value
=
null
;
getData
();
}
else
{
}
else
{
ElMessage
.
error
(
res
.
message
);
ElMessage
.
error
(
res
.
message
);
}
}
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
ElMessage
.
error
(
err
.
message
);
ElMessage
.
error
(
err
.
message
);
})
})
;
}
else
{
}
else
{
// 新增模式
postAddDuster
(
data
).
then
(
res
=>
{
postAddDuster
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
ElMessage
.
success
(
'新增除尘器成功'
);
ElMessage
.
success
(
'新增除尘器成功'
);
...
@@ -424,19 +413,10 @@ const handleSaveDustCollector = (data) => {
...
@@ -424,19 +413,10 @@ const handleSaveDustCollector = (data) => {
}
}
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
ElMessage
.
error
(
err
.
message
);
ElMessage
.
error
(
err
.
message
);
})
})
;
}
}
console
.
log
(
"保存新增除尘器数据:"
,
data
);
// 这里可以调用API进行保存
// await api.addDustCollector(data);
};
};
const
IdusterLeakNum
=
()
=>
{
const
IdusterLeakNum
=
()
=>
{
getDusterLeakNum
().
then
(
res
=>
{
getDusterLeakNum
().
then
(
res
=>
{
dusterLeakNum
.
value
=
res
.
data
||
0
;
dusterLeakNum
.
value
=
res
.
data
||
0
;
...
@@ -456,7 +436,9 @@ const IcloseLoopNum = () => {
...
@@ -456,7 +436,9 @@ const IcloseLoopNum = () => {
}
}
const
IproductionLine
=
()
=>
{
const
IproductionLine
=
()
=>
{
getProductionLine
().
then
(
res
=>
{
getProductionLine
({
branchFactoryId
:
getToken
(
"dataBranchFactoryId"
)
}).
then
(
res
=>
{
productionLine
.
value
=
res
.
data
||
[];
productionLine
.
value
=
res
.
data
||
[];
// 默认显示全部
// 默认显示全部
productionLineFiltered
.
value
=
res
.
data
||
[];
productionLineFiltered
.
value
=
res
.
data
||
[];
...
@@ -491,8 +473,6 @@ const refreshData = () => {
...
@@ -491,8 +473,6 @@ const refreshData = () => {
getData
();
getData
();
}
}
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
IdusterLeakNum
();
IdusterLeakNum
();
IhealthPercent
();
IhealthPercent
();
...
@@ -585,6 +565,7 @@ onBeforeUnmount(() => {});
...
@@ -585,6 +565,7 @@ onBeforeUnmount(() => {});
cursor
:
pointer
;
cursor
:
pointer
;
display
:
block
;
display
:
block
;
width
:
100%
;
width
:
100%
;
text-decoration
:
underline
;
}
}
.status-matrix
{
.status-matrix
{
...
@@ -631,6 +612,10 @@ onBeforeUnmount(() => {});
...
@@ -631,6 +612,10 @@ onBeforeUnmount(() => {});
.view-btn
{
.view-btn
{
margin-right
:
8px
;
margin-right
:
8px
;
cursor
:
pointer
;
}
.edit-btn
{
cursor
:
pointer
;
}
}
.dialog-footer
{
.dialog-footer
{
...
...
src/views/login/index.vue
View file @
6a39dabf
...
@@ -1169,6 +1169,7 @@ $cursor: #ccc;
...
@@ -1169,6 +1169,7 @@ $cursor: #ccc;
border-bottom
:
1px
solid
#fff
;
border-bottom
:
1px
solid
#fff
;
background
:
#fff
;
background
:
#fff
;
}
}
}
}
</
style
>
</
style
>
...
...
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