Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
713c576b
提交
713c576b
authored
3月 23, 2026
作者:
何宗全
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
机房日常巡检-临时修改
上级
57b5d1b8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
966 行增加
和
183 行删除
+966
-183
manifest.json
manifest.json
+2
-2
pages.json
pages.json
+167
-131
home.vue
pages/home/home.vue
+26
-14
csj.vue
pages/inspectionContent/components/csj.vue
+368
-0
ktxt.vue
pages/inspectionContent/components/ktxt.vue
+0
-0
ledp.vue
pages/inspectionContent/components/ledp.vue
+0
-0
ltdxt.vue
pages/inspectionContent/components/ltdxt.vue
+0
-0
nwjgzx.vue
pages/inspectionContent/components/nwjgzx.vue
+0
-0
pbxt.vue
pages/inspectionContent/components/pbxt.vue
+0
-0
upsxt.vue
pages/inspectionContent/components/upsxt.vue
+0
-0
zwjgzx.vue
pages/inspectionContent/components/zwjgzx.vue
+368
-0
inspectionContentList.vue
pages/inspectionContent/inspectionContentList.vue
+35
-36
inspectionContentMonthlyList.vue
pages/inspectionContent/inspectionContentMonthlyList.vue
+0
-0
inspectionContentMonthlyNew.vue
pages/inspectionContent/inspectionContentMonthlyNew.vue
+0
-0
inspectionContentNew.vue
pages/inspectionContent/inspectionContentNew.vue
+0
-0
inspectionContentYearList.vue
pages/inspectionContent/inspectionContentYearList.vue
+0
-0
inspectionContentYearNew.vue
pages/inspectionContent/inspectionContentYearNew.vue
+0
-0
dict.js
utils/dict.js
+0
-0
没有找到文件。
manifest.json
浏览文件 @
713c576b
...
...
@@ -2,8 +2,8 @@
"name"
:
"杭州内网机房巡检"
,
"appid"
:
"__UNI__A11BFD5"
,
"description"
:
""
,
"versionName"
:
"1.0.
4
"
,
"versionCode"
:
10
5
,
"versionName"
:
"1.0.
6
"
,
"versionCode"
:
10
6
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
"app-plus"
:
{
...
...
pages.json
浏览文件 @
713c576b
{
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/login/login"
},
{
"path"
:
"pages/home/home"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
//操作日志
"path"
:
"pages/index/operLog"
},
//杭州内网机房巡检
{
"path"
:
"pages/inspection/inspFirst"
},
{
"path"
:
"pages/report/sampleTable"
},
{
//修改密码
"path"
:
"pages/index/editPd"
},
{
"path"
:
"pages/home/home"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
机房巡检
{
"path"
:
"pages/inspectionContent/inspectionContent"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
井道巡检
{
"path"
:
"pages/shaftInspection/shaftInspection"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
新增配置---------
//
巡检管理
{
"path"
:
"pages/inspectionManagement/index"
},
//
设备上架管理
{
"path"
:
"pages/listingManagement/index"
},
//机房巡检列表
{
"path"
:
"pages/inspectionContent/inspectionContentList"
,
"style"
:
{
{
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/login/login"
},
{
"path"
:
"pages/home/home"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
//操作日志
"path"
:
"pages/index/operLog"
},
//杭州内网机房巡检
{
"path"
:
"pages/inspection/inspFirst"
},
{
"path"
:
"pages/report/sampleTable"
},
{
//修改密码
"path"
:
"pages/index/editPd"
},
{
"path"
:
"pages/home/home"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
机房巡检
{
"path"
:
"pages/inspectionContent/inspectionContent"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
井道巡检
{
"path"
:
"pages/shaftInspection/shaftInspection"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
新增配置---------
//
巡检管理
{
"path"
:
"pages/inspectionManagement/index"
},
//
设备上架管理
{
"path"
:
"pages/listingManagement/index"
},
//机房巡检列表
{
"path"
:
"pages/inspectionContent/inspectionContentList"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"app-plus"
:{
//
将回弹属性关掉
"bounce"
:
"none"
}
}
},
//
机房巡检新页面
{
"path"
:
"pages/inspectionContent/inspectionContentNew"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
井道巡检列表
{
"path"
:
"pages/shaftInspection/shaftInspectionList"
,
"style"
:
{
}
}
},
//
机房巡检新页面
{
"path"
:
"pages/inspectionContent/inspectionContentNew"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
机房月度巡检列表
{
"path"
:
"pages/inspectionContent/inspectionContentMonthlyList"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"app-plus"
:
{
//
将回弹属性关掉
"bounce"
:
"none"
}
}
},
//
机房月度巡检新页面
{
"path"
:
"pages/inspectionContent/inspectionContentMonthlyNew"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
机房年度巡检列表
{
"path"
:
"pages/inspectionContent/inspectionContentYearList"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"app-plus"
:
{
//
将回弹属性关掉
"bounce"
:
"none"
}
}
},
//
机房年度巡检新页面
{
"path"
:
"pages/inspectionContent/inspectionContentYearNew"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
//
井道巡检列表
{
"path"
:
"pages/shaftInspection/shaftInspectionList"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"app-plus"
:{
//
将回弹属性关掉
"bounce"
:
"none"
}
}
},
//
井道巡检新页面
{
"path"
:
"pages/shaftInspection/shaftInspectionNew"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/test/index"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
}
//
{
//
"path"
:
"api/api"
,
//
"style"
:
//
{
//
"navigationBarTitleText"
:
""
//
}
//
},
//
{
//
"path"
:
"api/db/db"
,
//
"style"
:
//
{
//
"navigationBarTitleText"
:
""
//
}
//
}
],
"globalStyle"
:
{
"pageOrientation"
:
"landscape"
,
"navigationStyle"
:
"custom"
,
"rpxCalcBaseDeviceWidth"
:
1280
,
//
设计稿基准宽度
"rpxCalcMaxDeviceWidth"
:
2560
,
//
设备最大宽度
"rpxCalcIncludeWidth"
:
1024
//
包含宽度
},
"uniIdRouter"
:
{},
"condition"
:
{
//模式配置,仅开发期间生效
"current"
:
0
,
//当前激活的模式(list
的索引项)
"list"
:
[
{
"name"
:
""
,
//模式名称
"path"
:
""
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}
]
}
}
}
}
},
//
井道巡检新页面
{
"path"
:
"pages/shaftInspection/shaftInspectionNew"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"pages/test/index"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
}
//
{
//
"path"
:
"api/api"
,
//
"style"
:
//
{
//
"navigationBarTitleText"
:
""
//
}
//
},
//
{
//
"path"
:
"api/db/db"
,
//
"style"
:
//
{
//
"navigationBarTitleText"
:
""
//
}
//
}
],
"globalStyle"
:
{
"pageOrientation"
:
"landscape"
,
"navigationStyle"
:
"custom"
,
"rpxCalcBaseDeviceWidth"
:
1280
,
//
设计稿基准宽度
"rpxCalcMaxDeviceWidth"
:
2560
,
//
设备最大宽度
"rpxCalcIncludeWidth"
:
1024
//
包含宽度
},
"uniIdRouter"
:
{},
"condition"
:
{
//模式配置,仅开发期间生效
"current"
:
0
,
//当前激活的模式(list
的索引项)
"list"
:
[
{
"name"
:
""
,
//模式名称
"path"
:
""
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}
]
}
}
pages/home/home.vue
浏览文件 @
713c576b
...
...
@@ -71,7 +71,7 @@
<
script
>
import
{
copyDirectory
}
from
"@/utils/IoReadingAndWriting.js"
;
import
inspectApi
from
"@/api/inspect.js"
;
import
inspectApi
from
"@/api/inspect.js"
;
import
{
cleanTimeoutDataApi
}
from
'@/api/base.js'
export
default
{
data
()
{
...
...
@@ -79,12 +79,12 @@ export default {
cards
:
[
{
image
:
"../../static/img/jf.png"
,
text
:
"机房巡检"
,
text
:
"机房
日常
巡检"
,
url
:
"/pages/inspectionContent/inspectionContentList?backValue=home"
,
},
{
image
:
"../../static/img/jd.png"
,
text
:
"井道巡检"
,
text
:
"井道
日常
巡检"
,
url
:
"/pages/shaftInspection/shaftInspectionList?backValue=home"
,
},
{
...
...
@@ -92,6 +92,16 @@ export default {
text
:
"设备上架"
,
url
:
"/pages/listingManagement/index?backValue=home"
,
},
{
image
:
"../../static/img/jf.png"
,
text
:
"机房月度巡检"
,
url
:
"/pages/inspectionContent/inspectionContentMonthlyList?backValue=home"
,
},
{
image
:
"../../static/img/jf.png"
,
text
:
"机房年度巡检"
,
url
:
"/pages/inspectionContent/inspectionContentYearList?backValue=home"
,
},
],
userName
:
this
.
$store
.
state
.
now_user
.
user
,
};
...
...
@@ -102,7 +112,7 @@ export default {
},
},
created
()
{
console
.
log
(
this
.
$store
.
state
);
console
.
log
(
this
.
$store
.
state
);
cleanTimeoutDataApi
();
},
methods
:
{
...
...
@@ -181,13 +191,13 @@ export default {
align-items: center;
padding: 10px;
position: relative;
margin-bottom:
147
px;
margin-bottom:
60
px;
.title {
position: absolute;
left: 50%;
transform: translateX(-50%);
ont-family: PingFangSC-Medium;
f
ont-family: PingFangSC-Medium;
font-size: 32px;
color: #000000;
text-align: center;
...
...
@@ -234,7 +244,7 @@ export default {
}
.profile-section {
width:
72
0px;
width:
68
0px;
.profile-box {
background-color: #fff;
...
...
@@ -319,21 +329,23 @@ export default {
}
.card-section {
width:
72
0px;
margin-top:
20
px;
width:
68
0px;
margin-top:
16
px;
.card-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
.card {
width: 2
24
px;
height: 1
94
px;
border-radius:
10
px;
width: 2
06
px;
height: 1
40
px;
border-radius:
9
px;
display: flex;
flex-direction: column;
align-items: center;
padding-top:
130
px;
padding-top:
95
px;
background-size: cover; // 背景图覆盖整个卡片
background-position: center; // 背景图居中
...
...
pages/inspectionContent/components/csj.vue
0 → 100644
浏览文件 @
713c576b
<
template
>
<!-- 机房巡检操作 -->
<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
>
<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"
>
<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
>
</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"
;
export
default
{
components
:
{
CommonUpload
,
customPopup
,
},
mixins
:
[
mixin
],
props
:
{
// 父组件传递的巡检状态
status
:
{
type
:
Number
,
default
:
0
,
},
// 父组件传递的巡检事项名
inspectionItem
:
{
type
:
String
,
default
:
""
,
},
// 父组件传递的数据
defaultData
:
{
type
:
Object
,
default
:
()
=>
({}),
},
},
data
()
{
return
{
currentIndex
:
0
,
// 当前操作的索引
photos
:
[],
itemData
:
{
isValid
:
false
,
// false是校验未通过 true是校验通过
status
:
0
,
//0是未巡检 1是已巡检 2巡检异常
statusLabel
:
"未巡检"
,
inspectionItem
:
""
,
//巡检事项
detail
:
[
{
label
:
"温度、湿度显示"
,
inspectionResult
:
""
,
inspectionResultLable
:
"正常"
,
lableArr
:
[
"正常"
,
"异常"
],
conclusion
:
""
,
photos
:
[],
},
],
},
};
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
},
watch
:
{
defaultData
(
newVal
)
{
// 在这里处理数据变化
if
(
Object
.
keys
(
this
.
defaultData
).
length
!==
0
)
{
this
.
itemData
=
this
.
defaultData
;
}
},
},
async
mounted
()
{
console
.
log
(
"sdsadasd"
,
this
.
itemData
);
// if (Object.keys(this.defaultData).length !== 0) {
// this.itemData = this.defaultData;
// }
},
methods
:
{
// 拍照
takePhoto
(
index
)
{
uni
.
chooseImage
({
count
:
1
,
sourceType
:
[
"camera"
],
// 可以从相机拍摄
success
:
async
(
res
)
=>
{
if
(
this
.
photos
.
length
<
5
)
{
const
base64
=
await
this
.
convertFileToBase64
(
res
.
tempFilePaths
[
0
]);
this
.
itemData
.
detail
[
index
].
photos
.
push
(
base64
);
}
else
{
uni
.
showToast
({
title
:
"最多只能上传5张照片"
,
icon
:
"none"
,
});
}
},
});
},
// 转化为base64
convertFileToBase64
(
filePath
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
plus
.
io
.
resolveLocalFileSystemURL
(
filePath
,
function
(
entry
)
{
entry
.
file
(
function
(
file
)
{
const
reader
=
new
plus
.
io
.
FileReader
();
reader
.
onloadend
=
function
(
evt
)
{
const
base64
=
evt
.
target
.
result
;
// 获取 Base64 数据
resolve
(
base64
);
// 返回 Base64 数据
};
reader
.
readAsDataURL
(
file
);
// 读取文件并转换为 Base64
},
function
(
error
)
{
reject
(
"获取文件对象失败:"
+
error
.
message
);
},
);
},
function
(
error
)
{
reject
(
"解析文件路径失败:"
+
error
.
message
);
},
);
});
},
// 删除照片
deletePhoto
(
index
,
itemIndex
)
{
this
.
itemData
.
detail
[
index
].
photos
.
splice
(
itemIndex
,
1
);
},
// 处理弹窗确认
handlePopupConfirm
(
summary
)
{
this
.
itemData
.
detail
[
this
.
currentIndex
].
conclusion
=
summary
;
// 回显到文字显示区域
},
// 处理】数据
getFromData
()
{
const
isValid
=
this
.
areAllObjectsValid
(
this
.
itemData
.
detail
);
//false不通过 true通过
console
.
log
(
"wlhj"
,
isValid
);
const
isAllOne
=
this
.
areAllInspectionResultsOne
(
this
.
itemData
.
detail
);
console
.
log
(
"isAllOne"
,
isAllOne
);
this
.
itemData
.
isValid
=
isValid
;
this
.
itemData
.
inspectionItem
=
this
.
inspectionItem
;
this
.
itemData
.
status
=
isAllOne
.
status
;
//1表示已经巡检过没有异常
this
.
itemData
.
statusLabel
=
isAllOne
.
statusLabel
;
console
.
log
(
"查看数据"
,
this
.
itemData
);
return
this
.
itemData
;
},
// 数据校验方法 true说明有未填项
areAllObjectsValid
(
details
)
{
// 检查是否有任何项的 inspectionResult 为空字符串
const
hasEmptyResult
=
details
.
some
(
(
item
)
=>
item
.
inspectionResult
===
""
,
);
if
(
hasEmptyResult
)
{
return
false
;
}
// 遍历每一项进行检查
for
(
const
item
of
details
)
{
if
(
item
.
inspectionResult
===
0
)
{
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue
;
}
else
if
(
item
.
inspectionResult
===
1
)
{
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if
(
!
item
.
conclusion
||
item
.
photos
.
length
===
0
)
{
return
false
;
}
}
else
{
// 其他情况(理论上不应该存在,根据当前规则)
return
false
;
}
}
// 所有检查都通过
return
true
;
},
areAllInspectionResultsOne
(
details
)
{
let
hasEmpty
=
false
;
let
allZero
=
true
;
let
hasOne
=
false
;
for
(
const
item
of
details
)
{
if
(
item
.
inspectionResult
===
""
)
{
hasEmpty
=
true
;
break
;
}
else
if
(
item
.
inspectionResult
===
1
)
{
hasOne
=
true
;
allZero
=
false
;
}
else
if
(
item
.
inspectionResult
===
0
)
{
// 继续检查
}
else
{
// 如果有其他值,可以在这里处理
allZero
=
false
;
}
}
if
(
hasEmpty
)
{
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
}
else
if
(
allZero
)
{
return
{
statusLabel
:
"已巡检"
,
status
:
1
};
}
else
if
(
hasOne
)
{
return
{
statusLabel
:
"巡检异常"
,
status
:
2
};
}
else
{
// 默认情况,可以根据需求调整
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
}
},
setNormal
()
{
this
.
itemData
.
detail
.
forEach
((
item
)
=>
{
item
.
inspectionResult
=
0
;
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.form-item {
display: flex;
align-items: center;
padding: 9.6px 0;
line-height: 28.8px;
border-bottom: 0.8px solid #f2f3f5;
.form-label {
font-size: 11.2px;
margin-right: 25.6px;
width: 88px;
text-align: right;
color: #7c7c7c;
.required {
color: red;
margin-right: 3.2px;
}
}
.conclusion {
&.no-text {
color: #c7c7c7;
}
.have {
color: #000;
}
}
.label {
font-size: 11.2px;
}
.switch-container {
display: flex;
gap: 9.6px;
.status-btn {
flex: 1;
padding: 5.6px 19.2px;
font-size: 12.8px;
color: #000000;
background: #f2f2f2;
text-align: center;
font-weight: 400;
line-height: 17.6px;
border-radius: 14.4px;
&.active {
color: #ffffff;
background: #3774f6;
border: 0.32px solid rgba(224, 224, 224, 1);
}
}
}
.input-box {
flex: 1;
border-radius: 3.2px;
font-size: 12.8px;
line-height: 19.2px;
}
.photo-limit {
font-size: 12.8px;
color: #959595;
line-height: 19.2px;
font-weight: 400;
}
.photo-container {
display: flex;
flex-wrap: wrap;
margin-bottom: 6.4px;
.photo-item {
position: relative;
margin-right: 6.4px;
margin-bottom: 6.4px;
.photo {
width: 57.6px;
height: 57.6px;
border-radius: 3.2px;
margin-left: 9.6px;
}
.delete-photo {
position: absolute;
top: -6.4px;
right: -6.4px;
background-color: #ff4d4f;
color: #fff;
width: 12.8px;
height: 12.8px;
border-radius: 50%;
text-align: center;
line-height: 12.8px;
font-size: 9.6px;
}
}
}
.photo-btn {
background: #ffffff;
border: 0.272px solid rgba(221, 221, 221, 1);
border-radius: 1.64px;
width: 57.6px;
height: 57.6px;
font-size: 57.6px;
color: #cccccc;
text-align: center;
line-height: 51.2px;
}
}
</
style
>
pages/inspectionContent/components/ktxt.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/components/ledp.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/components/ltdxt.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/components/nwjgzx.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/components/pbxt.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/components/upsxt.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/components/zwjgzx.vue
0 → 100644
浏览文件 @
713c576b
<
template
>
<!-- 机房巡检操作 -->
<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
>
<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"
>
<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
>
</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"
;
export
default
{
components
:
{
CommonUpload
,
customPopup
,
},
mixins
:
[
mixin
],
props
:
{
// 父组件传递的巡检状态
status
:
{
type
:
Number
,
default
:
0
,
},
// 父组件传递的巡检事项名
inspectionItem
:
{
type
:
String
,
default
:
""
,
},
// 父组件传递的数据
defaultData
:
{
type
:
Object
,
default
:
()
=>
({}),
},
},
data
()
{
return
{
currentIndex
:
0
,
// 当前操作的索引
photos
:
[],
itemData
:
{
isValid
:
false
,
// false是校验未通过 true是校验通过
status
:
0
,
//0是未巡检 1是已巡检 2巡检异常
statusLabel
:
"未巡检"
,
inspectionItem
:
""
,
//巡检事项
detail
:
[
{
label
:
"平台使用"
,
inspectionResult
:
""
,
inspectionResultLable
:
"正常"
,
lableArr
:
[
"正常"
,
"异常"
],
conclusion
:
""
,
photos
:
[],
},
],
},
};
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
},
watch
:
{
defaultData
(
newVal
)
{
// 在这里处理数据变化
if
(
Object
.
keys
(
this
.
defaultData
).
length
!==
0
)
{
this
.
itemData
=
this
.
defaultData
;
}
},
},
async
mounted
()
{
console
.
log
(
"sdsadasd"
,
this
.
itemData
);
// if (Object.keys(this.defaultData).length !== 0) {
// this.itemData = this.defaultData;
// }
},
methods
:
{
// 拍照
takePhoto
(
index
)
{
uni
.
chooseImage
({
count
:
1
,
sourceType
:
[
"camera"
],
// 可以从相机拍摄
success
:
async
(
res
)
=>
{
if
(
this
.
photos
.
length
<
5
)
{
const
base64
=
await
this
.
convertFileToBase64
(
res
.
tempFilePaths
[
0
]);
this
.
itemData
.
detail
[
index
].
photos
.
push
(
base64
);
}
else
{
uni
.
showToast
({
title
:
"最多只能上传5张照片"
,
icon
:
"none"
,
});
}
},
});
},
// 转化为base64
convertFileToBase64
(
filePath
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
plus
.
io
.
resolveLocalFileSystemURL
(
filePath
,
function
(
entry
)
{
entry
.
file
(
function
(
file
)
{
const
reader
=
new
plus
.
io
.
FileReader
();
reader
.
onloadend
=
function
(
evt
)
{
const
base64
=
evt
.
target
.
result
;
// 获取 Base64 数据
resolve
(
base64
);
// 返回 Base64 数据
};
reader
.
readAsDataURL
(
file
);
// 读取文件并转换为 Base64
},
function
(
error
)
{
reject
(
"获取文件对象失败:"
+
error
.
message
);
},
);
},
function
(
error
)
{
reject
(
"解析文件路径失败:"
+
error
.
message
);
},
);
});
},
// 删除照片
deletePhoto
(
index
,
itemIndex
)
{
this
.
itemData
.
detail
[
index
].
photos
.
splice
(
itemIndex
,
1
);
},
// 处理弹窗确认
handlePopupConfirm
(
summary
)
{
this
.
itemData
.
detail
[
this
.
currentIndex
].
conclusion
=
summary
;
// 回显到文字显示区域
},
// 处理】数据
getFromData
()
{
const
isValid
=
this
.
areAllObjectsValid
(
this
.
itemData
.
detail
);
//false不通过 true通过
console
.
log
(
"wlhj"
,
isValid
);
const
isAllOne
=
this
.
areAllInspectionResultsOne
(
this
.
itemData
.
detail
);
console
.
log
(
"isAllOne"
,
isAllOne
);
this
.
itemData
.
isValid
=
isValid
;
this
.
itemData
.
inspectionItem
=
this
.
inspectionItem
;
this
.
itemData
.
status
=
isAllOne
.
status
;
//1表示已经巡检过没有异常
this
.
itemData
.
statusLabel
=
isAllOne
.
statusLabel
;
console
.
log
(
"查看数据"
,
this
.
itemData
);
return
this
.
itemData
;
},
// 数据校验方法 true说明有未填项
areAllObjectsValid
(
details
)
{
// 检查是否有任何项的 inspectionResult 为空字符串
const
hasEmptyResult
=
details
.
some
(
(
item
)
=>
item
.
inspectionResult
===
""
,
);
if
(
hasEmptyResult
)
{
return
false
;
}
// 遍历每一项进行检查
for
(
const
item
of
details
)
{
if
(
item
.
inspectionResult
===
0
)
{
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue
;
}
else
if
(
item
.
inspectionResult
===
1
)
{
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if
(
!
item
.
conclusion
||
item
.
photos
.
length
===
0
)
{
return
false
;
}
}
else
{
// 其他情况(理论上不应该存在,根据当前规则)
return
false
;
}
}
// 所有检查都通过
return
true
;
},
areAllInspectionResultsOne
(
details
)
{
let
hasEmpty
=
false
;
let
allZero
=
true
;
let
hasOne
=
false
;
for
(
const
item
of
details
)
{
if
(
item
.
inspectionResult
===
""
)
{
hasEmpty
=
true
;
break
;
}
else
if
(
item
.
inspectionResult
===
1
)
{
hasOne
=
true
;
allZero
=
false
;
}
else
if
(
item
.
inspectionResult
===
0
)
{
// 继续检查
}
else
{
// 如果有其他值,可以在这里处理
allZero
=
false
;
}
}
if
(
hasEmpty
)
{
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
}
else
if
(
allZero
)
{
return
{
statusLabel
:
"已巡检"
,
status
:
1
};
}
else
if
(
hasOne
)
{
return
{
statusLabel
:
"巡检异常"
,
status
:
2
};
}
else
{
// 默认情况,可以根据需求调整
return
{
statusLabel
:
"未巡检"
,
status
:
0
};
}
},
setNormal
()
{
this
.
itemData
.
detail
.
forEach
((
item
)
=>
{
item
.
inspectionResult
=
0
;
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.form-item {
display: flex;
align-items: center;
padding: 9.6px 0;
line-height: 28.8px;
border-bottom: 0.8px solid #f2f3f5;
.form-label {
font-size: 11.2px;
margin-right: 25.6px;
width: 88px;
text-align: right;
color: #7c7c7c;
.required {
color: red;
margin-right: 3.2px;
}
}
.conclusion {
&.no-text {
color: #c7c7c7;
}
.have {
color: #000;
}
}
.label {
font-size: 11.2px;
}
.switch-container {
display: flex;
gap: 9.6px;
.status-btn {
flex: 1;
padding: 5.6px 19.2px;
font-size: 12.8px;
color: #000000;
background: #f2f2f2;
text-align: center;
font-weight: 400;
line-height: 17.6px;
border-radius: 14.4px;
&.active {
color: #ffffff;
background: #3774f6;
border: 0.32px solid rgba(224, 224, 224, 1);
}
}
}
.input-box {
flex: 1;
border-radius: 3.2px;
font-size: 12.8px;
line-height: 19.2px;
}
.photo-limit {
font-size: 12.8px;
color: #959595;
line-height: 19.2px;
font-weight: 400;
}
.photo-container {
display: flex;
flex-wrap: wrap;
margin-bottom: 6.4px;
.photo-item {
position: relative;
margin-right: 6.4px;
margin-bottom: 6.4px;
.photo {
width: 57.6px;
height: 57.6px;
border-radius: 3.2px;
margin-left: 9.6px;
}
.delete-photo {
position: absolute;
top: -6.4px;
right: -6.4px;
background-color: #ff4d4f;
color: #fff;
width: 12.8px;
height: 12.8px;
border-radius: 50%;
text-align: center;
line-height: 12.8px;
font-size: 9.6px;
}
}
}
.photo-btn {
background: #ffffff;
border: 0.272px solid rgba(221, 221, 221, 1);
border-radius: 1.64px;
width: 57.6px;
height: 57.6px;
font-size: 57.6px;
color: #cccccc;
text-align: center;
line-height: 51.2px;
}
}
</
style
>
pages/inspectionContent/inspectionContentList.vue
浏览文件 @
713c576b
...
...
@@ -295,6 +295,7 @@ export default {
isDialog
:
false
,
propList
:
[],
did
:
""
,
// 最近7天数据的id
patrolType
:
"JFXJ"
,
// 巡检类型
};
},
computed
:
{
...
...
@@ -303,7 +304,7 @@ export default {
},
updateDate
()
{
return
moment
(
Number
(
this
.
detailsInfo
.
updateTime
||
this
.
detailsInfo
.
createTime
)
Number
(
this
.
detailsInfo
.
updateTime
||
this
.
detailsInfo
.
createTime
)
,
).
format
(
"YYYY-MM-DD"
);
},
abnormalLengths
()
{
...
...
@@ -330,7 +331,7 @@ export default {
this
.
backValue
=
this
.
options
.
backValue
||
""
;
this
.
isDisable
=
options
.
isDisable
==
1
?
true
:
false
;
this
.
uid
=
this
.
options
.
uid
||
""
;
this
.
value
=
this
.
options
.
value
||
"1"
;
this
.
value
=
this
.
options
.
value
||
"1"
;
},
onShow
()
{
// 已经签名不触发更新,主要用于图片预览关闭后会触发onShow
...
...
@@ -356,9 +357,9 @@ export default {
this
.
listData
=
this
.
listFormat
(
detailsInfo
.
originData
);
this
.
detailsInfo
=
detailsInfo
;
this
.
inspectionNumber
=
detailsInfo
.
inspectionNumber
;
this
.
inspectionCode
=
`
JFXJ
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${
this
.
inspectionCode
=
`
${
this
.
patrolType
}
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${
Math
.
floor
(
Math
.
random
()
*
900
)
+
100
}
`
;
this
.
cardsInfo
=
detailsInfo
.
originData
;
...
...
@@ -377,7 +378,7 @@ export default {
this
.
detailsItem
.
afxt
.
detail
.
slice
(
0
,
3
);
}
this
.
allIsSubmitOne
=
detailsInfo
.
originData
.
every
(
(
item
)
=>
item
.
isSubmit
==
1
(
item
)
=>
item
.
isSubmit
==
1
,
);
let
group1
=
this
.
cardsInfo
.
slice
(
0
,
5
);
...
...
@@ -451,7 +452,7 @@ export default {
if
(
this
.
uid
)
{
this
.
inspectionCode
=
this
.
detailsInfo
.
inspectionCode
;
}
else
{
this
.
inspectionCode
=
`
JFXJ
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${
this
.
inspectionCode
=
`
${
this
.
patrolType
}
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${
Math
.
floor
(
Math
.
random
()
*
900
)
+
100
}
`
;
}
...
...
@@ -509,11 +510,11 @@ export default {
)
{
this
.
detailsItem
.
afxt
.
detail
=
this
.
detailsItem
.
afxt
.
detail
.
slice
(
0
,
3
3
,
);
}
this
.
allIsSubmitOne
=
detailsInfo
.
originData
.
every
(
(
item
)
=>
item
.
isSubmit
==
1
(
item
)
=>
item
.
isSubmit
==
1
,
);
let
group1
=
this
.
cardsInfo
.
slice
(
0
,
5
);
...
...
@@ -597,10 +598,10 @@ export default {
url
:
"/pages/report/sampleTable?isJF=1"
,
});
},
toSign
()
{
if
(
!
this
.
allIsSubmitOne
)
{
return
;
}
toSign
()
{
if
(
!
this
.
allIsSubmitOne
)
{
return
;
}
this
.
$refs
.
signDialog
.
open
();
},
findTargetObject
(
rows
)
{
...
...
@@ -643,12 +644,12 @@ export default {
this
.
detailsInfo
.
signImg
=
signImg
;
// 回显到文字显示区域
this
.
detailsInfo
.
isSubmit
=
1
;
// 提交状态
const
isException
=
this
.
detailsInfo
.
originData
.
some
(
(
item
)
=>
item
.
status
==
2
(
item
)
=>
item
.
status
==
2
,
);
this
.
detailsInfo
.
isException
=
isException
?
1
:
0
;
// 巡检异常
let
allIsSubmitOne
=
this
.
detailsInfo
.
originData
.
every
(
(
item
)
=>
item
.
isSubmit
===
1
(
item
)
=>
item
.
isSubmit
===
1
,
);
if
(
!
allIsSubmitOne
)
{
...
...
@@ -666,7 +667,7 @@ export default {
const
inspectionCode
=
this
.
inspectionCode
||
`
JFXJ
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${
`
${
this
.
patrolType
}
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${
Math
.
floor
(
Math
.
random
()
*
900
)
+
100
}
`
;
...
...
@@ -677,7 +678,7 @@ export default {
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
sys
,
`巡检编号(
${
inspectionCode
}
)`
,
"同步"
"同步"
,
);
this
.
$logApi
.
addlog
(
logContent
);
console
.
log
(
"logContent"
,
logContent
);
...
...
@@ -858,24 +859,24 @@ export default {
margin-right: 12.8px;
}
.record-button {
display: block;
width: 115.2px;
height: 28.8px;
background: #ffffff;
border: 0.8px solid rgba(55, 116, 246, 1);
border-radius: 14.4px;
font-family: PingFangSC-Regular;
font-size: 12.8px;
color: #3774f6;
line-height: 28.8px;
font-weight: 400;
display: flex;
justify-content: center;
&.disabled-btn {
color: #c7c7c7;
background-color: #f9f9f9;
border-color: #f2f2f2;
}
display: block;
width: 115.2px;
height: 28.8px;
background: #ffffff;
border: 0.8px solid rgba(55, 116, 246, 1);
border-radius: 14.4px;
font-family: PingFangSC-Regular;
font-size: 12.8px;
color: #3774f6;
line-height: 28.8px;
font-weight: 400;
display: flex;
justify-content: center;
&.disabled-btn {
color: #c7c7c7;
background-color: #f9f9f9;
border-color: #f2f2f2;
}
}
}
}
...
...
@@ -1097,6 +1098,4 @@ export default {
border: none;
}
}
</
style
>
pages/inspectionContent/inspectionContentMonthlyList.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/inspectionContentMonthlyNew.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/inspectionContentNew.vue
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/inspectionContentYearList.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
pages/inspectionContent/inspectionContentYearNew.vue
0 → 100644
浏览文件 @
713c576b
差异被折叠。
点击展开。
utils/dict.js
浏览文件 @
713c576b
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论