Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
8e1277e0
提交
8e1277e0
authored
11月 10, 2025
作者:
刘守彩
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(巡检): 其他增加水箱检查
上级
89406c09
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
142 行增加
和
90 行删除
+142
-90
manifest.json
manifest.json
+2
-2
detail.vue
pages/inspectionContent/components/detail.vue
+0
-0
qt.vue
pages/inspectionContent/components/qt.vue
+92
-39
wlhj.vue
pages/inspectionContent/components/wlhj.vue
+48
-49
没有找到文件。
manifest.json
浏览文件 @
8e1277e0
...
...
@@ -2,8 +2,8 @@
"name"
:
"杭州内网机房巡检"
,
"appid"
:
"__UNI__A11BFD5"
,
"description"
:
""
,
"versionName"
:
"1.0.
2
"
,
"versionCode"
:
10
2
,
"versionName"
:
"1.0.
3
"
,
"versionCode"
:
10
3
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
"app-plus"
:
{
...
...
pages/inspectionContent/components/detail.vue
浏览文件 @
8e1277e0
差异被折叠。
点击展开。
pages/inspectionContent/components/qt.vue
浏览文件 @
8e1277e0
...
...
@@ -2,44 +2,59 @@
<!-- 机房巡检操作 -->
<view>
<view
v-for=
"(item, index) in itemData.detail"
:key=
"index"
>
<view
v-if=
"index==0"
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
v-if=
"item.required"
>
*
</text>
{{
item
.
label
}}
</text>
<view
class=
"switch-container"
>
<view
:class=
"['status-btn',
{ active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0, item.lableArr[0])">
{{
item
.
lableArr
[
0
]
}}
</view>
<view
:class=
"['status-btn',
{ active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1, item.lableArr[1])">
{{
item
.
lableArr
[
1
]
}}
</view>
</view>
</view>
<template
v-if=
"item.inspectionResult === 1 && index==0"
>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
情况摘要
</text>
<text
:class=
"['conclusion',
{ 'no-text': !item.conclusion }]" @click="showPopup(item, index)">
{{
item
.
conclusion
||
"请输入情况摘要"
}}
</text>
</view>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
现场照片
</text>
<CommonUpload
v-model=
"item.photos"
:max-count=
"5"
>
</CommonUpload>
</view>
</
template
>
<
template
v-if=
"index==1"
>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
></text>
{{
item
.
label
}}
</text
>
<text
:class=
"['conclusion',
{ 'no-text': !item.conclusion }]"
@click="showPopup(item, index)"
>
{{
item
.
conclusion
||
"请输入情况摘要"
}}
</text
>
<text
class=
"form-label"
><text
class=
"required"
v-if=
"item.required"
></text>
{{
item
.
label
}}
</text>
<text
:class=
"['conclusion',
{ 'no-text': !item.conclusion }]" @click="showPopup(item, index)">
{{
item
.
conclusion
||
"请输入情况摘要"
}}
</text>
</view>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
></text>
现场照片
</text>
<CommonUpload
v-model=
"item.photos"
:max-count=
"9999"
@
input=
"onPhotoChange"
>
<template
#
tip
><div></div></
template
>
<CommonUpload
v-model=
"item.photos"
:max-count=
"9999"
@
input=
"onPhotoChange"
>
<template
#
tip
>
<div></div>
</
template
>
</CommonUpload>
</view>
</template>
</view>
<custom-popup
ref=
"customPopup"
:inspectionItem=
"inspectionItem"
@
confirm=
"handlePopupConfirm"
>
<custom-popup
ref=
"customPopup"
:inspectionItem=
"inspectionItem"
@
confirm=
"handlePopupConfirm"
>
</custom-popup>
</view>
</template>
<
script
>
import
CommonUpload
from
"@/components/CommonUpload/index.vue"
;
import
customPopup
from
"./customPopup.vue"
;
import
_
from
"lodash"
;
import
CommonUpload
from
"@/components/CommonUpload/index.vue"
;
import
customPopup
from
"./customPopup.vue"
;
import
_
from
"lodash"
;
import
mixin
from
"./mixin"
;
export
default
{
import
mixin
from
"./mixin"
;
export
default
{
mixins
:
[
mixin
],
components
:
{
CommonUpload
,
...
...
@@ -69,12 +84,21 @@ export default {
photos
:
[],
// 父组件传递的数据
itemData
:
{
isValid
:
true
,
// true是不校验
isValid
:
false
,
// true是不校验
status
:
0
,
//0是未巡检 1是已巡检 2巡检异常
statusLabel
:
"未巡检"
,
inspectionItem
:
""
,
//巡检事项
detail
:
[
detail
:
[{
required
:
true
,
label
:
"水箱"
,
inspectionResult
:
""
,
inspectionResultLable
:
"正常"
,
lableArr
:
[
"正常"
,
"异常"
],
conclusion
:
""
,
photos
:
[],
},
{
required
:
false
,
label
:
"其他问题"
,
inspectionResult
:
0
,
inspectionResultLable
:
"正常"
,
...
...
@@ -101,10 +125,6 @@ export default {
},
mounted
()
{},
methods
:
{
// 设置巡检结论
setInspectionResult
(
index
,
value
)
{
this
.
itemData
.
detail
[
index
].
inspectionResult
=
value
;
// 0正常 1异常
},
// 处理弹窗确认
handlePopupConfirm
(
summary
)
{
this
.
itemData
.
detail
[
this
.
currentIndex
].
conclusion
=
summary
;
// 回显到文字显示区域
...
...
@@ -112,12 +132,41 @@ export default {
// 处理】数据
getFromData
()
{
this
.
itemData
.
inspectionItem
=
this
.
inspectionItem
;
console
.
log
(
222
,
this
.
itemData
);
// 全都是正常
this
.
itemData
.
status
=
1
;
//1表示已经巡检过没有异常
this
.
itemData
.
statusLabel
=
"已巡检"
;
const
{
isValid
,
status
,
statusLabel
}
=
this
.
validForm
(
this
.
itemData
.
detail
);
this
.
itemData
.
isValid
=
isValid
;
this
.
itemData
.
status
=
status
this
.
itemData
.
statusLabel
=
statusLabel
return
this
.
itemData
;
},
validForm
(
list
)
{
let
isValid
=
list
.
every
(
item
=>
this
.
validFormItem
(
item
))
let
status
=
list
.
some
(
item
=>
item
.
inspectionResult
===
1
&&
item
.
required
)
?
2
:
1
;
let
statusLabel
=
isValid
?
'已巡检'
:
'未巡检'
const
ret
=
{
isValid
,
// 必填 false 不通过 true 通过
status
,
// 1 正常 2 异常
statusLabel
// 已巡检 | 未巡检
}
console
.
log
(
'validForm'
,
ret
)
return
ret
;
},
validFormItem
(
item
)
{
if
(
item
.
required
)
{
if
(
item
.
inspectionResult
===
1
)
{
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if
(
!
item
.
conclusion
||
item
.
photos
.
length
===
0
)
{
return
false
;
}
else
{
return
true
}
}
else
{
return
true
}
}
else
{
return
true
}
},
// 数据校验方法 true说明有未填项
areAllObjectsValid
(
arr
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
...
...
@@ -154,13 +203,13 @@ export default {
return
arr
.
every
((
obj
)
=>
obj
.
inspectionResult
===
0
);
},
onPhotoChange
(
val
)
{
this
.
itemData
.
detail
[
this
.
currentIndex
].
photos
=
val
;
this
.
itemData
.
detail
[
1
].
photos
=
val
;
},
},
};
};
</
script
>
<
style
scoped
lang=
"less"
>
.form-item {
.form-item {
display: flex;
align-items: center;
padding: 9.6px 0;
...
...
@@ -179,14 +228,17 @@ export default {
margin-right: 3.2px;
}
}
.conclusion {
&.no-text {
color: #c7c7c7;
}
.have {
color: #000;
}
}
.label {
font-size: 11.2px;
}
...
...
@@ -272,5 +324,5 @@ export default {
text-align: center;
line-height: 51.2px;
}
}
}
</
style
>
\ No newline at end of file
pages/inspectionContent/components/wlhj.vue
浏览文件 @
8e1277e0
...
...
@@ -3,58 +3,42 @@
<view>
<view
v-for=
"(item, index) in itemData.detail"
:key=
"index"
>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
{{
item
.
label
}}
</text
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
{{
item
.
label
}}
</text>
<view
class=
"switch-container"
>
<view
:class=
"['status-btn',
{ active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0, item.lableArr[0])"
>
<view
:class=
"['status-btn',
{ active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0, item.lableArr[0])">
{{
item
.
lableArr
[
0
]
}}
</view>
<view
:class=
"['status-btn',
{ active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
<view
:class=
"['status-btn',
{ active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1, item.lableArr[1])">
{{
item
.
lableArr
[
1
]
}}
</view>
</view>
</view>
<template
v-if=
"item.inspectionResult === 1"
>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
情况摘要
</text
>
<text
:class=
"['conclusion',
{ 'no-text': !item.conclusion }]"
@click="showPopup(item, index)"
>
{{
item
.
conclusion
||
"请输入情况摘要"
}}
</text
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
情况摘要
</text>
<text
:class=
"['conclusion',
{ 'no-text': !item.conclusion }]" @click="showPopup(item, index)">
{{
item
.
conclusion
||
"请输入情况摘要"
}}
</text>
</view>
<view
class=
"form-item"
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
现场照片
</text
>
<text
class=
"form-label"
><text
class=
"required"
>
*
</text>
现场照片
</text>
<CommonUpload
v-model=
"item.photos"
:max-count=
"5"
>
</CommonUpload>
</view
></
template
>
</view
><custom-popup
ref=
"customPopup"
:inspectionItem=
"inspectionItem"
@
confirm=
"handlePopupConfirm"
></custom-popup>
</CommonUpload>
</view>
</
template
>
</view><custom-popup
ref=
"customPopup"
:inspectionItem=
"inspectionItem"
@
confirm=
"handlePopupConfirm"
></custom-popup>
</view>
</template>
<
script
>
import
CommonUpload
from
"@/components/CommonUpload/index.vue"
;
import
customPopup
from
"./customPopup.vue"
;
import
_
from
"lodash"
;
import
mixin
from
"./mixin"
;
import
CommonUpload
from
"@/components/CommonUpload/index.vue"
;
import
customPopup
from
"./customPopup.vue"
;
import
_
from
"lodash"
;
import
mixin
from
"./mixin"
;
export
default
{
export
default
{
components
:
{
CommonUpload
,
customPopup
,
...
...
@@ -86,8 +70,7 @@ export default {
status
:
0
,
//0是未巡检 1是已巡检 2巡检异常
statusLabel
:
"未巡检"
,
inspectionItem
:
""
,
//巡检事项
detail
:
[
{
detail
:
[{
label
:
"地板、墙壁破损"
,
inspectionResult
:
""
,
inspectionResultLable
:
"正常"
,
...
...
@@ -174,22 +157,22 @@ export default {
return
new
Promise
((
resolve
,
reject
)
=>
{
plus
.
io
.
resolveLocalFileSystemURL
(
filePath
,
function
(
entry
)
{
function
(
entry
)
{
entry
.
file
(
function
(
file
)
{
function
(
file
)
{
const
reader
=
new
plus
.
io
.
FileReader
();
reader
.
onloadend
=
function
(
evt
)
{
reader
.
onloadend
=
function
(
evt
)
{
const
base64
=
evt
.
target
.
result
;
// 获取 Base64 数据
resolve
(
base64
);
// 返回 Base64 数据
};
reader
.
readAsDataURL
(
file
);
// 读取文件并转换为 Base64
},
function
(
error
)
{
function
(
error
)
{
reject
(
"获取文件对象失败:"
+
error
.
message
);
}
);
},
function
(
error
)
{
function
(
error
)
{
reject
(
"解析文件路径失败:"
+
error
.
message
);
}
);
...
...
@@ -265,14 +248,26 @@ export default {
}
if
(
hasEmpty
)
{
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
}
else
if
(
allZero
)
{
return
{
statusLabel
:
"已巡检"
,
status
:
1
};
return
{
statusLabel
:
"已巡检"
,
status
:
1
};
}
else
if
(
hasOne
)
{
return
{
statusLabel
:
"巡检异常"
,
status
:
2
};
return
{
statusLabel
:
"巡检异常"
,
status
:
2
};
}
else
{
// 默认情况,可以根据需求调整
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
}
},
setNormal
()
{
...
...
@@ -281,10 +276,10 @@ export default {
});
},
},
};
};
</
script
>
<
style
scoped
lang=
"less"
>
.form-item {
.form-item {
display: flex;
align-items: center;
padding: 9.6px 0;
...
...
@@ -303,14 +298,17 @@ export default {
margin-right: 3.2px;
}
}
.conclusion {
&.no-text {
color: #c7c7c7;
}
.have {
color: #000;
}
}
.label {
font-size: 11.2px;
}
...
...
@@ -396,5 +394,5 @@ export default {
text-align: center;
line-height: 51.2px;
}
}
}
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论