Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
monthReport_smzx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
monthReport_smzx
Commits
cfe5e0c6
提交
cfe5e0c6
authored
11月 20, 2024
作者:
邓文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(月报): 页面初始化
上级
866e9232
隐藏空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
1795 行增加
和
5354 行删除
+1795
-5354
index.vue
components/commonTopTitle/index.vue
+127
-0
package-lock.json
package-lock.json
+30
-23
package.json
package.json
+1
-0
content.vue
pages/home/content.vue
+0
-376
home.vue
pages/home/home.vue
+9
-58
inspFirst.vue
pages/inspection/inspFirst.vue
+0
-293
inspectionContent.vue
pages/inspectionContent/inspectionContent.vue
+0
-793
batteryRoom.vue
pages/inspectionContent/model/batteryRoom.vue
+0
-361
computerRoomDuty.vue
pages/inspectionContent/model/computerRoomDuty.vue
+0
-182
dutyHandover.vue
pages/inspectionContent/model/dutyHandover.vue
+0
-226
gatherDataCenter.vue
pages/inspectionContent/model/gatherDataCenter.vue
+0
-364
shieldedComputerRoom.vue
pages/inspectionContent/model/shieldedComputerRoom.vue
+0
-361
tabs.vue
pages/inspectionContent/model/tabs.vue
+0
-153
index.vue
pages/inspectionManagement/index.vue
+0
-265
rightBar.vue
pages/monthReport/components/rightBar.vue
+96
-0
rightItem.vue
pages/monthReport/components/rightItem.vue
+70
-0
rightLine.vue
pages/monthReport/components/rightLine.vue
+131
-0
rightPie.vue
pages/monthReport/components/rightPie.vue
+439
-0
tem1.vue
pages/monthReport/components/tem1.vue
+91
-0
tem2.vue
pages/monthReport/components/tem2.vue
+51
-0
tem3.vue
pages/monthReport/components/tem3.vue
+57
-0
tem4.vue
pages/monthReport/components/tem4.vue
+60
-0
config.js
pages/monthReport/config.js
+311
-0
index.vue
pages/monthReport/index.vue
+319
-0
tabContentItem.vue
pages/shaftInspection/model/tabContentItem.vue
+0
-408
tabs.vue
pages/shaftInspection/model/tabs.vue
+0
-148
shaftInspection.vue
pages/shaftInspection/shaftInspection.vue
+0
-683
dialog.vue
pages/synchronousManagement/dialog.vue
+0
-408
index.vue
pages/synchronousManagement/index.vue
+0
-249
systemCofig.js
utils/systemCofig.js
+3
-3
没有找到文件。
components/commonTopTitle/index.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<div
class=
"titleModel-box"
>
<span
:class=
"
{ titleClass, title: isTitleNormal }"
>
{{
titletext
}}
</span>
<div
class=
"title-center"
>
<slot
name=
"centerBox"
></slot>
</div>
<div
class=
"fixSize"
>
<slot
name=
"rightBox"
></slot>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
titletext
:
{
type
:
String
,
default
:
""
,
// required: true,
},
titleClass
:
{
type
:
String
,
default
:
""
,
},
isTitleNormal
:
{
type
:
Boolean
,
default
:
true
,
},
isShowLeftTime
:
{
type
:
Boolean
,
default
:
false
,
},
},
data
()
{
return
{
nowTime
:
""
,
// 当前时间
time
:
""
,
// 定时器
};
},
mounted
()
{
},
methods
:
{
},
beforeDestroy
()
{
clearInterval
(
this
.
time
);
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.titleModel-box
{
display
:
flex
;
align-items
:
center
;
font-size
:
16px
;
color
:
#000000
;
font-family
:
"AlibabaPuHuiTi-Medium"
;
span
{
// width: 90%;
width
:
max-content
;
}
.detection_time
{
margin-left
:
16px
;
border-radius
:
3px
;
font-family
:
AlibabaPuHuiTi-Regular
;
font-size
:
14px
;
color
:
#7c7c7c
;
font-weight
:
400
;
}
.title
{
/* margin-bottom: 5px; */
margin-right
:
20px
;
position
:
relative
;
padding-left
:
12px
;
line-height
:
18px
;
font-size
:
16px
;
color
:
#000000
;
font-family
:
"AlibabaPuHuiTi-Medium"
;
}
.
title
:
:
before
{
content
:
""
;
position
:
absolute
;
top
:
50%
;
left
:
0
;
width
:
4px
;
height
:
90%
;
background
:
#12ccf5
;
display
:
block
;
transform
:
translateY
(
-50%
);
}
.
title
:
:
after
{
content
:
""
;
position
:
absolute
;
top
:
0
;
left
:
3px
;
width
:
6px
;
height
:
100%
;
display
:
block
;
}
}
.fixSize
{
font-size
:
14px
;
color
:
#005cb8
;
text-align
:
center
;
line-height
:
24px
;
font-weight
:
400
;
cursor
:
pointer
;
font-family
:
"AlibabaPuHuiTi-Regular"
;
}
.title-center
{
flex
:
1
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
</
style
>
\ No newline at end of file
package-lock.json
浏览文件 @
cfe5e0c6
{
{
"name"
:
"computedRoomPad"
,
"lockfileVersion"
:
3
,
"requires"
:
true
,
"requires"
:
true
,
"packages"
:
{
"lockfileVersion"
:
1
,
""
:
{
"dependencies"
:
{
"dependencies"
:
{
"echarts"
:
{
"js-base64"
:
"^3.7.5"
,
"version"
:
"5.5.1"
,
"lodash"
:
"^4.17.21"
,
"resolved"
:
"https://registry.npmjs.org/echarts/-/echarts-5.5.1.tgz"
,
"moment"
:
"^2.30.1"
,
"integrity"
:
"sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA=="
,
"sm-crypto"
:
"^0.3.12"
"requires"
:
{
},
"tslib"
:
"2.3.0"
,
"devDependencies"
:
{
"zrender"
:
"5.6.0"
"js-md5"
:
"^0.7.3"
}
}
},
},
"
node_modules/
js-base64"
:
{
"js-base64"
:
{
"version"
:
"3.7.5"
,
"version"
:
"3.7.5"
,
"resolved"
:
"https://registry.npmmirror.com/js-base64/-/js-base64-3.7.5.tgz"
,
"resolved"
:
"https://registry.npmmirror.com/js-base64/-/js-base64-3.7.5.tgz"
,
"integrity"
:
"sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
"integrity"
:
"sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
},
},
"
node_modules/
js-md5"
:
{
"js-md5"
:
{
"version"
:
"0.7.3"
,
"version"
:
"0.7.3"
,
"resolved"
:
"https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz"
,
"resolved"
:
"https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz"
,
"integrity"
:
"sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
,
"integrity"
:
"sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
,
"dev"
:
true
"dev"
:
true
},
},
"
node_modules/
jsbn"
:
{
"jsbn"
:
{
"version"
:
"1.1.0"
,
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz"
,
"resolved"
:
"https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz"
,
"integrity"
:
"sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
"integrity"
:
"sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
},
"
node_modules/
lodash"
:
{
"lodash"
:
{
"version"
:
"4.17.21"
,
"version"
:
"4.17.21"
,
"resolved"
:
"https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
,
"resolved"
:
"https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
,
"integrity"
:
"sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
"integrity"
:
"sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
},
"
node_modules/
moment"
:
{
"moment"
:
{
"version"
:
"2.30.1"
,
"version"
:
"2.30.1"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.30.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.30.1.tgz"
,
"integrity"
:
"sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
,
"integrity"
:
"sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
"engines"
:
{
"node"
:
"*"
}
},
},
"
node_modules/
sm-crypto"
:
{
"sm-crypto"
:
{
"version"
:
"0.3.12"
,
"version"
:
"0.3.12"
,
"resolved"
:
"https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.12.tgz"
,
"resolved"
:
"https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.12.tgz"
,
"integrity"
:
"sha512-272PBzB4PYaBdeGa41TH9ZlMGLPVRmS36Gs4FjmHwXIdihQypAbhhFWZTaa/3de69q2KfMme1M5O2W5+spAdrg=="
,
"integrity"
:
"sha512-272PBzB4PYaBdeGa41TH9ZlMGLPVRmS36Gs4FjmHwXIdihQypAbhhFWZTaa/3de69q2KfMme1M5O2W5+spAdrg=="
,
"
dependenci
es"
:
{
"
requir
es"
:
{
"jsbn"
:
"^1.1.0"
"jsbn"
:
"^1.1.0"
}
}
},
"tslib"
:
{
"version"
:
"2.3.0"
,
"resolved"
:
"https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz"
,
"integrity"
:
"sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"zrender"
:
{
"version"
:
"5.6.0"
,
"resolved"
:
"https://registry.npmjs.org/zrender/-/zrender-5.6.0.tgz"
,
"integrity"
:
"sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg=="
,
"requires"
:
{
"tslib"
:
"2.3.0"
}
}
}
}
}
}
}
package.json
浏览文件 @
cfe5e0c6
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"
js-md5
"
:
"^0.7.3"
"
js-md5
"
:
"^0.7.3"
},
},
"dependencies"
:
{
"dependencies"
:
{
"
echarts
"
:
"^5.5.1"
,
"
js-base64
"
:
"^3.7.5"
,
"
js-base64
"
:
"^3.7.5"
,
"
lodash
"
:
"^4.17.21"
,
"
lodash
"
:
"^4.17.21"
,
"
moment
"
:
"^2.30.1"
,
"
moment
"
:
"^2.30.1"
,
...
...
pages/home/content.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"home-page-content"
>
<!-- 内容区 -->
<view
class=
"card-list"
>
<view
class=
"card-item"
>
<view
class=
"title"
>
HI,欢迎回来
{{
userInfo
.
name
}}{{
userInfo
.
user
}}
!
</view
>
<view
class=
"unit"
>
所属单位:
{{
userInfo
.
unitName
||
"--"
}}
</view>
<view
class=
"time"
>
上次同步时间:
{{
lastTime
||
"--"
}}
</view>
<image
class=
"bg-img"
mode=
"aspectFill"
src=
"@/static/img/add-img/home1.png"
></image>
</view>
<view
class=
"card-item"
@
click=
"toSyncPage"
>
<view
class=
"title2x"
>
巡检记录
</view>
<view
class=
"count"
>
<text
class=
"num"
>
{{
syncCount
}}
</text
>
条
</view>
<view
class=
"button-text"
><text>
待同步
</text>
<view
class=
"iconfont icon-Arrow-Right"
></view>
</view>
<image
class=
"bg-img"
mode=
"aspectFill"
src=
"@/static/img/add-img/home2.png"
></image>
</view>
<view
class=
"card-item card-item3x"
@
click=
"toPage"
>
<view
class=
"title"
>
开始巡检
</view>
<view
class=
"button-text"
><text>
进入
</text>
<text
class=
"iconfont icon-Arrow-Right"
></text>
</view>
<image
class=
"bg-img"
mode=
"aspectFill"
src=
"@/static/img/add-img/home3.png"
></image>
</view>
</view>
<view
class=
"seconed-title"
>
最新记录
</view>
<view
class=
"month-list"
>
<!-- 每月记录 -->
<view
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
submitTime
||
item
.
time
}}
</view>
<view
class=
"inspect-list"
>
<InspectionItem
v-for=
"ele in item.list"
:key=
"ele.uid"
:details=
"ele"
/>
</view>
</view>
<Empty
v-if=
"list.length == 0"
/>
</view>
</view>
</
template
>
<
script
>
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
{
getAllInspections
,
getDarft
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
components
:
{
InspectionItem
,
Empty
,
},
data
()
{
return
{
isDialog
:
false
,
//
list
:
[],
// 展示数据
all_data
:
[],
// 所有数据
searchForm
:
{
// 搜索条件
},
countNum
:
0
,
// 统计查询总数
syncCount
:
0
,
// 待同步条数
lastTime
:
""
,
// 上次登陆时间
};
},
created
()
{
this
.
lastTime
=
uni
.
getStorageSync
(
"last_time"
)
||
""
;
// uni.getStorageSync("last_time", this.$store.state.now_user.LastSynchronizationTime || "");
},
mounted
()
{
this
.
init
();
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
},
methods
:
{
init
()
{
uni
.
showLoading
();
getAllInspections
()
.
then
((
res
)
=>
{
this
.
all_data
=
res
;
this
.
getList
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
0
==
error
.
code
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
this
.
all_data
=
[];
uni
.
hideLoading
();
});
},
toSyncPage
()
{
this
.
$emit
(
"changeTab"
,
{},
2
);
},
// 待同步数据
initSyncCount
()
{
this
.
syncCount
=
(
this
.
all_data
||
[]).
filter
(
(
item
)
=>
item
.
synchronization
==
0
).
length
;
},
// 初始化
getList
()
{
const
all_data
=
this
.
all_data
||
[];
const
tempAllData
=
{};
all_data
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitMonth
]
||
[];
if
(
val
.
length
)
{
tempAllData
[
item
.
submitMonth
].
push
(
item
);
}
else
{
tempAllData
[
item
.
submitMonth
]
=
[
item
];
}
});
const
keys
=
Object
.
keys
(
tempAllData
);
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
// 第一步: 筛选有效的时间范围
const
timeFrame
=
keys
.
filter
((
key
)
=>
{
if
(
!
inspectionTime
.
length
)
{
return
true
;
}
else
{
return
(
new
Date
(
startTime
).
getTime
()
<=
new
Date
(
key
).
getTime
()
&&
new
Date
(
key
).
getTime
()
<=
new
Date
(
endTime
).
getTime
()
);
}
});
// 第二步: 根据搜索条件过滤
const
list
=
timeFrame
.
map
((
key
)
=>
{
return
{
time
:
key
,
list
:
this
.
coverData
(
tempAllData
[
key
]),
};
});
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
this
.
countNum
+=
item
.
list
.
length
;
});
this
.
list
=
list
;
this
.
initSyncCount
();
},
coverData
(
arr
=
[])
{
const
{
isException
=
""
,
inspectionType
=
""
,
synchronization
=
""
,
}
=
this
.
searchForm
;
return
arr
.
filter
((
item
)
=>
{
return
(
(
!
isException
||
item
.
isException
==
isException
)
&&
(
!
inspectionType
||
item
.
inspectionType
==
inspectionType
)
&&
(
!
synchronization
||
item
.
synchronization
==
synchronization
)
);
});
},
change
(
e
)
{
this
.
searchForm
=
e
;
this
.
init
();
},
toIndex
()
{
uni
.
navigateTo
({
url
:
"/pages/index/index"
,
});
},
toPage
()
{
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
if
(
darf_data
.
inspectionType
==
1
)
{
uni
.
navigateTo
({
url
:
`/pages/inspectionContent/inspectionContent?isDarf=1`
,
});
}
else
if
(
darf_data
.
inspectionType
==
2
)
{
uni
.
navigateTo
({
url
:
`/pages/shaftInspection/shaftInspection?isDarf=1`
,
});
}
else
{
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
}
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
0
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
uni
.
hideLoading
();
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.home-page-content {
.card-list {
display: flex;
.card-item {
border-radius: 12px;
flex: 1;
margin-right: 16px;
height: 166px;
box-sizing: border-box;
padding: 32px 0 24px 12px;
position: relative;
overflow: hidden;
&:nth-of-type(1) {
background-image: linear-gradient(-67deg, #dbeeff 6%, #f5fbff 100%);
}
&:nth-of-type(2) {
background-image: linear-gradient(108deg, #f2f6ff 0%, #e6eeff 92%);
}
&:nth-of-type(3) {
background-image: linear-gradient(-66deg, #dbeeff 6%, #f5fbff 100%);
}
.bg-img {
position: absolute;
right: 0px;
bottom: 0px;
width: 110px;
height: 130px;
z-index: 1;
}
.title {
font-size: 18px;
color: #000000;
font-weight: bold;
margin-bottom: 24px;
}
.unit {
margin-bottom: 16px;
}
.unit,
.time {
font-size: 12px;
color: #7c7c7c;
font-weight: 400;
z-index: 10;
}
.title2x {
font-size: 14px;
color: #4a4a4a;
font-weight: 400;
margin-bottom: 8px;
}
.count {
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
.num {
margin-right: 2px;
font-size: 32px;
color: #000000;
line-height: 40px;
font-weight: bold;
}
}
.button-text {
display: flex;
align-items: center;
font-size: 14px;
color: #3774f6;
font-weight: 400;
}
}
.card-item3x {
padding-top: 40px;
}
}
.seconed-title {
margin: 16px 0;
font-size: 18px;
color: #000000;
font-weight: bold;
}
.month-list {
height: calc(100vh - 166px - 25px - 16px - 16px - 20px);
overflow: auto;
.seconed-title {
margin-top: 0;
margin-bottom: 5px;
}
.month-record-item {
&:last-of-type {
margin: 0;
}
.inspect-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
</
style
>
pages/home/home.vue
浏览文件 @
cfe5e0c6
...
@@ -7,20 +7,7 @@
...
@@ -7,20 +7,7 @@
<text
class=
"text"
>
{{
userName
}}
</text>
<text
class=
"text"
>
{{
userName
}}
</text>
</view>
</view>
<view
class=
"tab-list"
>
<view
v-for=
"(item, index) in tabList"
:key=
"item.text"
class=
"tab-item"
@
click=
"tabClick(item, index)"
:class=
"activeTabIndex == index ? 'active-tab' : ''"
>
<view
class=
"icon-item"
><text
class=
"iconfont"
:class=
"item.defaultIcon"
></text>
</view>
<text
class=
"text"
>
{{
item
.
text
}}
</text>
</view>
</view>
<view
class=
"button-group"
>
<view
class=
"button-group"
>
<view
v-if=
"isAdmin"
class=
"log-button"
@
click=
"lookLog"
>
操作日志
</view>
<view
v-if=
"isAdmin"
class=
"log-button"
@
click=
"lookLog"
>
操作日志
</view>
...
@@ -33,16 +20,9 @@
...
@@ -33,16 +20,9 @@
<!-- 内容区 -->
<!-- 内容区 -->
<view
class=
"right-container"
>
<view
class=
"right-container"
>
<!-- 首页 -->
<Content
v-if=
"activeTabIndex == 0"
@
changeTab=
"tabClick"
/>
<MonthReport
/>
<RouterView
/>
<!-- 杭州内网机房巡检 -->
<InspectionManagement
v-if=
"activeTabIndex == 1"
/>
<!-- 同步管理 -->
<SynchronousManagement
v-if=
"activeTabIndex == 2"
/>
<RouterView
/>
</view>
</view>
<!-- 退出账号弹出 -->
<!-- 退出账号弹出 -->
...
@@ -59,39 +39,17 @@
...
@@ -59,39 +39,17 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
InspectionManagement
from
"@/pages/inspectionManagement/index.vue"
;
import
SynchronousManagement
from
"@/pages/synchronousManagement/index.vue"
;
import
OperLog
from
"@/pages/index/operLog.vue"
;
import
OperLog
from
"@/pages/index/operLog.vue"
;
import
MonthReport
from
"@/pages/monthReport/index.vue"
import
Content
from
"./content.vue"
;
export
default
{
export
default
{
components
:
{
components
:
{
Content
,
InspectionManagement
,
SynchronousManagement
,
OperLog
,
OperLog
,
MonthReport
},
},
data
()
{
data
()
{
return
{
return
{
activeTabIndex
:
0
,
tabList
:
[
{
defaultIcon
:
"iconfont icon-yingyongyewuguanli1"
,
isActive
:
true
,
text
:
"主页"
,
},
{
defaultIcon
:
"iconfont icon-Inspection"
,
isActive
:
false
,
text
:
"巡检管理"
,
},
{
defaultIcon
:
"iconfont icon-a-ActivityConfiguration"
,
isActive
:
false
,
text
:
"同步管理"
,
},
],
userName
:
this
.
$store
.
state
.
now_user
.
user
,
userName
:
this
.
$store
.
state
.
now_user
.
user
,
};
};
},
},
...
@@ -101,9 +59,7 @@ export default {
...
@@ -101,9 +59,7 @@ export default {
},
},
},
},
onLoad
(
options
=
{})
{
onLoad
(
options
=
{})
{
// options就是路由参数,它是一个对象
// this.tabIndex = ;
this
.
tabClick
({},
options
.
tabIndex
||
0
);
},
},
watch
:
{
watch
:
{
...
@@ -122,7 +78,6 @@ export default {
...
@@ -122,7 +78,6 @@ export default {
url
:
"/pages/index/operLog"
,
url
:
"/pages/index/operLog"
,
});
});
// this.activeTabIndex = 4
},
},
//退出--弹出对话框
//退出--弹出对话框
...
@@ -148,11 +103,7 @@ export default {
...
@@ -148,11 +103,7 @@ export default {
this
.
$refs
.
inputDialog2
.
open
();
this
.
$refs
.
inputDialog2
.
open
();
},
},
// 切换tab
tabClick
(
item
,
index
)
{
this
.
activeTabIndex
=
index
;
},
toIndex
()
{
toIndex
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/index/index"
,
url
:
"/pages/index/index"
,
...
...
pages/inspection/inspFirst.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"container"
>
<!-- 导航栏 -->
<!--
<uni-nav-bar
dark
:fixed=
"true"
background-color=
"#5474e8"
status-bar
left-text=
"返回"
title=
"杭州内网监管在线"
left-icon=
"left"
@
clickLeft=
"back"
>
</uni-nav-bar>
-->
<uni-nav-bar
:fixed=
"true"
background-color=
"rgba(214, 240, 255, 0.0)"
status-bar
rightWidth=
"300"
>
<block
slot=
"left"
>
<view
class=
"uni-nav-bar-text"
@
click=
"back"
>
<text
class=
"iconfont icon-Arrow-Left"
></text
></view>
</block>
</uni-nav-bar>
<view
class=
"content"
>
<!-- 占位---不可删除 -->
<view
class=
"seize-seat"
>
</view>
<view
class=
"main box-shaow-box"
>
<view
class=
"content_header"
>
机房巡检
</view>
<uni-forms
class=
"formClass"
:modelValue=
"formData"
label-width=
"100px"
ref=
"forms"
label-align=
"right"
>
<uni-forms-item
label=
"巡检类型"
required
>
<uni-data-checkbox
mode=
"tag"
v-model=
"formData.inspectionType"
@
change=
"change"
:localdata=
"rooms"
/>
</uni-forms-item>
<uni-forms-item
label=
"巡检编号"
>
<view
class=
"text"
>
{{
formData
.
inspectionCode
}}
</view>
</uni-forms-item>
<uni-forms-item
label=
"记录名称"
>
<view
class=
"text"
>
{{
formData
.
recordName
}}
</view>
</uni-forms-item>
<uni-forms-item
label=
"巡检时间"
>
<view
class=
"text"
>
{{
formData
.
inspectionTime
}}
</view>
</uni-forms-item>
<uni-forms-item
label=
"巡检人"
>
<view
class=
"text"
>
{{
formData
.
inspectionBy
}}
</view>
</uni-forms-item>
</uni-forms>
<view
class=
"btn-class"
@
tap=
"clickNext"
>
开始巡检
</view>
</view>
</view>
</view>
</
template
>
<
script
>
import
getDateTime
from
"@/common/getdateTime.js"
;
import
moment
from
"moment"
;
export
default
{
data
()
{
return
{
rooms
:
[
{
text
:
"机房巡检"
,
value
:
"1"
,
},
{
text
:
"井道巡检"
,
value
:
"2"
,
},
],
formData
:
{
inspectionType
:
""
,
inspectionCode
:
""
,
recordName
:
""
,
inspectionTime
:
""
,
inspectionBy
:
""
,
},
};
},
onLoad
()
{},
mounted
()
{
this
.
init
();
},
methods
:
{
init
()
{
this
.
formData
=
{
inspectionType
:
"1"
,
inspectionCode
:
`JFXJ
${
moment
().
format
(
"yyyyMMDDHHmmss"
)}${(
Math
.
floor
(
Math
.
random
()
*
900
)
+
100
)}
`
,
recordName
:
`
${
moment
().
format
(
"yyyyMMDD"
)}
-机房巡检记录`
,
inspectionTime
:
moment
().
format
(
"yyyy-MM-DD HH:mm"
),
inspectionBy
:
this
.
$store
.
state
.
now_user
.
user
,
inspectionById
:
this
.
$store
.
state
.
now_user
.
userId
,
createByName
:
this
.
$store
.
state
.
now_user
.
user
,
isException
:
""
,
// 是否有异常
position
:
""
,
// 位置
isSubmit
:
""
,
// 0 是草稿态; 1 是正式提交
conclusion
:
""
,
//结论
fillCheck
:
""
,
// tab字典的value值, 校验通过的
creatTime
:
`
${
new
Date
().
getTime
()}
`
,
items
:
[
// {
// "itemCode": "1", // 检查项
// "measuredData": "2,3", // 异常的楼层
// "inspectionResult": "1" // 检查项的结果, 1是异常 0 是正常
// },
],
};
},
change
(
val
)
{
this
.
formData
.
recordName
=
`
${
moment
().
format
(
"yyyyMMDD"
)}
-
${
val
.
detail
.
data
.
text
}
`
;
this
.
formData
.
inspectionType
=
val
.
detail
.
value
;
const
inspectionCode
=
`
${
val
.
detail
.
value
==
1
?
"JFXJ"
:
"JDXJ"
}${
moment
().
format
(
"yyyyMMDDHHmmss"
)}
`
;
this
.
formData
.
inspectionCode
=
inspectionCode
+
(
Math
.
floor
(
Math
.
random
()
*
900
)
+
100
);
},
back
()
{
uni
.
navigateBack
();
},
showRoomName
(
val
)
{
let
res
=
""
;
switch
(
val
)
{
case
"1"
:
res
=
"核密机房"
;
break
;
case
"2"
:
res
=
"普密机房"
;
break
;
case
"3"
:
res
=
"传输机房"
;
break
;
case
"4"
:
res
=
"机要值班室"
;
break
;
case
"5"
:
res
=
"UPS机房"
;
break
;
case
"6"
:
res
=
"其他区域"
;
break
;
}
return
res
;
},
clickNext
()
{
this
.
$store
.
commit
(
"SET_TEMP_DATA"
,
this
.
formData
);
// 缓存[巡检信息]
if
(
this
.
formData
.
inspectionType
==
2
)
{
// 井道巡检
uni
.
redirectTo
({
url
:
"/pages/shaftInspection/shaftInspection"
,
success
()
{
uni
.
hideLoading
();
},
});
}
else
{
// 机房巡检
uni
.
redirectTo
({
url
:
"/pages/inspectionContent/inspectionContent"
,
success
()
{
uni
.
hideLoading
();
},
});
}
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.container {
width: 100%;
height: 100%;
background-image: linear-gradient(
90deg,
#e9f7fe 0%,
#dceffe 40%,
#d5ebfd 66%,
#c9e8fe 100%
);
.content {
margin-top: -44px;
width: 100%;
height: calc(100vh - var(--status-bar-height) - 50px);
background-size: 100% 40rpx;
background-repeat: no-repeat;
.seize-seat {
height: 50px;
width: 100%;
background-image: linear-gradient(
90deg,
#e9f7fe 0%,
#dceffe 40%,
#d5ebfd 66%,
#c9e8fe 100%
);
}
.main {
width: 100%;
height: 100%;
background-color: #ffffff;
padding: 20px 24px;
position: relative;
.uni-forms-item {
padding: 6px 0;
border-bottom: 1px solid #eee;
margin-bottom: 0px;
}
.content_header {
font-size: 18px;
color: #000000;
line-height: 26px;
font-weight: 500;
}
.formClass {
margin-top: 18px;
}
.btn-class {
width: 240px;
height: 48px;
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
font-size: 20px;
color: #ffffff;
text-align: center;
font-weight: 400;
text-align: center;
line-height: 48px;
position: absolute;
bottom: 32px;
left: 50%;
transform: translateX(-50%);
}
}
}
/deep/ .uni-forms-item__content {
display: flex;
align-items: center;
}
// 导航栏样式
.uni-nav-bar-text {
height: 36px;
width: 36px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 18px;
border-radius: 50%;
color: #333;
text-align: center;
.iconfont {
font-size: 20px;
line-height: 36px;
}
}
}
</
style
>
pages/inspectionContent/inspectionContent.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"inspectionContent"
>
<!-- 导航栏 -->
<uni-nav-bar
:fixed=
"true"
background-color=
"rgba(214, 240, 255, 0.0)"
status-bar
rightWidth=
"300"
>
<block
slot=
"left"
>
<view
class=
"uni-nav-bar-text"
@
click=
"back"
>
<text
class=
"iconfont icon-Arrow-Left"
></text
></view>
</block>
<block
slot=
"right"
>
<view
class=
"nav-right"
>
<view
v-if=
"isOperationPermissions"
class=
"uni-nav-bar-text"
@
click=
"deleteClick"
>
<text
class=
"iconfont icon-delete"
></text
></view>
<view
class=
"look-from"
@
click=
"lookTable"
>
<text
class=
"iconfont icon-see-s"
></text>
查看样表
</view
></view
>
</block>
</uni-nav-bar>
<view
class=
"content"
>
<view
class=
"base-info"
>
<view
class=
"title"
>
{{
baseInfo
.
recordName
}}
</view>
<view
class=
"base-row"
>
<view
class=
"base-row-item"
><text
class=
"name"
>
巡检编号
</text
><text
class=
"text"
>
{{
baseInfo
.
inspectionCode
}}
</text>
</view>
<view
class=
"base-row-item"
><text
class=
"name"
>
巡检时间
</text
><text
class=
"text"
>
{{
baseInfo
.
inspectionTime
}}
</text>
</view>
<view
class=
"base-row-item"
><text
class=
"name"
>
巡检人
</text
><text
class=
"text"
>
{{
baseInfo
.
inspectionBy
}}
</text>
</view>
</view>
<image
class=
"bg-img"
mode=
"aspectFill"
src=
"@/static/img/add-img/inspection_bg.png"
></image>
</view>
<view
class=
"main"
>
<view
class=
"content_header"
>
巡检项目
</view>
<!-- tabls -->
<Tabs
class=
"tabs"
ref=
"tabs"
:options=
"tabList"
@
change=
"changeTab"
/>
<GatherDataCenter
v-show=
"activeTabIndex == 0"
:isDisable=
"isDisable"
ref=
"GatherDataCenter"
/>
<ShieldedComputerRoom
ref=
"ShieldedComputerRoom"
v-show=
"activeTabIndex == 1"
/>
<BatteryRoom
ref=
"BatteryRoom"
:isDisable=
"isDisable"
v-show=
"activeTabIndex == 2"
/>
<ComputerRoomDuty
ref=
"ComputerRoomDuty"
:isDisable=
"isDisable"
v-show=
"activeTabIndex == 3"
></ComputerRoomDuty>
<DutyHandover
ref=
"DutyHandover"
:isDisable=
"isDisable"
v-show=
"activeTabIndex == 4"
></DutyHandover>
</view>
<view
v-if=
"isOperationPermissions && !isDisable"
class=
"fixed-btns"
>
<view
class=
"button-group"
>
<!-- isSubmit 标识: 0 是草稿态; 1 是正式提交 -->
<view
v-if=
"!detailsInfo.isSubmit || detailsInfo.isSubmit == 0"
class=
"btn-draft btn-class"
@
tap=
"draft(activeTabIndex)"
>
保存草稿
</view>
<view
class=
"btn-class"
@
tap=
"submit"
>
提交
</view>
</view>
</view>
</view>
<!-- 退出账号弹出 -->
<uni-popup
ref=
"inputDialog2"
type=
"dialog"
>
<uni-popup-dialog
ref=
"inputClose2"
mode=
"base"
title=
"确定删除巡检内容?"
@
confirm=
"dialogInputConfirm2"
>
</uni-popup-dialog>
</uni-popup>
</view>
</
template
>
<
script
>
import
moment
from
"moment"
;
import
Tabs
from
"./model/tabs.vue"
;
import
BatteryRoom
from
"./model/batteryRoom.vue"
;
import
GatherDataCenter
from
"./model/gatherDataCenter.vue"
;
import
ShieldedComputerRoom
from
"./model/shieldedComputerRoom.vue"
;
import
ComputerRoomDuty
from
"./model/computerRoomDuty.vue"
;
import
DutyHandover
from
"./model/dutyHandover.vue"
;
import
{
addLog
,
getLogContent
,
LOG_TYPE_ENUM
,
writeDarf
,
writeInspectionData
,
}
from
"@/utils/IoReadingAndWriting.js"
;
import
{
pad_1_1_inspection_position
,
pad_1_2_inspection_position
,
pad_1_3_inspection_position
,
pad_room_type
,
}
from
"@/utils/dict.js"
;
import
{
getInspectionDetails
,
getDarft
}
from
"@/request/index.js"
;
export
default
{
components
:
{
Tabs
,
BatteryRoom
,
GatherDataCenter
,
ShieldedComputerRoom
,
ComputerRoomDuty
,
DutyHandover
,
},
data
()
{
return
{
tabList
:
[
{
name
:
"汇聚机房"
,
isVaild
:
false
,
// 校验通过
position
:
pad_1_1_inspection_position
.
rows
,
descript
:
"痕迹检查地面、墙壁、天花板、是否有裂痕、水渍,机房内是否有鼠患、蚁患、蟑螂活动的痕迹,温湿度取最高值,正常室温:20~25℃,湿度:40~60%。"
,
},
{
name
:
"屏蔽机房"
,
isVaild
:
false
,
// 校验通过
position
:
pad_1_2_inspection_position
.
rows
,
descript
:
"UPS检查包含UPS主机、UPS输入柜、UPS输出柜。"
,
},
{
name
:
"电池间"
,
isVaild
:
false
,
// 校验通过
position
:
pad_1_3_inspection_position
.
rows
,
descript
:
""
,
},
{
name
:
"机房值班"
,
isVaild
:
false
,
// 校验通过
descript
:
"记录哪些人员进出机房、总计次数。"
,
position
:
[],
},
{
name
:
"值班交接"
,
isVaild
:
false
,
// 校验通过
descript
:
"未完事项交换。"
,
position
:
[],
},
],
activeTabIndex
:
0
,
baseInfo
:
{},
// 基础信息
tempForm
:
{
// 对应每个tab下的数据 [示例 0: 数据]
},
detailsInfo
:
{},
// 详情
isDisable
:
false
,
// 禁用
loading
:
false
,
};
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
isOperationPermissions
()
{
// 是否有操作权限
const
{
uid
,
createByName
}
=
this
.
detailsInfo
;
return
!
uid
||
(
uid
&&
createByName
==
this
.
userInfo
.
user
);
},
},
onLoad
(
options
)
{
this
.
isDisable
=
options
.
isDisable
==
1
?
true
:
false
;
if
(
options
.
uid
)
{
// 获取详情
this
.
getDetails
(
options
.
uid
);
}
else
if
(
options
.
isDarf
)
{
// 获取草稿数据
// const darf_data = this.$store.state.darf_data;
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
this
.
baseInfo
=
darf_data
.
originData
.
baseInfo
;
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
this
.
detailsInfo
=
darf_data
;
this
.
init
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
}
},
mounted
()
{
this
.
init
();
},
methods
:
{
init
()
{
pad_room_type
.
rows
.
forEach
((
item
,
index
)
=>
{
this
.
tabList
[
index
].
value
=
item
.
dictValue
;
});
if
(
this
.
detailsInfo
.
inspectionType
)
{
const
fillCheck
=
this
.
detailsInfo
.
fillCheck
.
split
(
","
);
this
.
tabList
.
forEach
((
item
,
index
)
=>
{
item
.
isVaild
=
fillCheck
.
includes
(
item
.
value
);
this
.
tempForm
[
index
]
&&
this
.
setComponentData
(
index
,
this
.
tempForm
[
index
]);
});
}
else
{
this
.
baseInfo
=
this
.
$store
.
state
.
temp_data
;
}
},
// 回显数据
getDetails
(
uid
)
{
uni
.
showLoading
();
getInspectionDetails
(
uid
)
.
then
((
res
)
=>
{
const
detailsInfo
=
res
;
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
detailsInfo
=
detailsInfo
;
this
.
isDisable
=
this
.
isDisable
||
detailsInfo
.
synchronization
==
1
;
uni
.
hideLoading
();
this
.
init
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
},
// 回显组件数据
setComponentData
(
activeTabIndex
,
componentData
)
{
let
refName
=
""
;
switch
(
activeTabIndex
)
{
case
0
:
refName
=
"GatherDataCenter"
;
break
;
case
1
:
refName
=
"ShieldedComputerRoom"
;
break
;
case
2
:
refName
=
"BatteryRoom"
;
break
;
case
3
:
refName
=
"ComputerRoomDuty"
;
break
;
case
4
:
refName
=
"DutyHandover"
;
break
;
}
this
.
$refs
[
refName
].
setForm
(
componentData
);
},
//--弹出对话框
dialogInputConfirm2
()
{
const
all_data
=
this
.
$store
.
state
.
all_data
;
const
baseInfo
=
this
.
baseInfo
const
detailsInfo
=
this
.
detailsInfo
;
const
tempAllData
=
all_data
.
filter
(
(
element
)
=>
element
.
uid
!=
detailsInfo
.
uid
);
// 更新巡检list
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
tempAllData
);
const
userInfo
=
this
.
userInfo
;
const
inspectList
=
tempAllData
.
filter
((
item
)
=>
item
.
createByName
==
userInfo
.
user
)
writeInspectionData
(
inspectList
,
userInfo
.
user
);
if
(
!
detailsInfo
.
uid
){
// 清空草稿数据
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
{});
// 缓存[巡检信息]
writeDarf
(
""
).
then
((
res
)
=>
{
console
.
log
(
"写入草稿文件成功"
);
});
}
// 更新日志
const
log_list
=
this
.
$store
.
state
.
log_list
;
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
delete
,
`
${
baseInfo
.
recordName
}
(
${
baseInfo
.
inspectionCode
}
)`
,
"巡检模块"
);
logContent
.
inspectionType
=
baseInfo
.
inspectionType
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
uni
.
showToast
({
icon
:
`success`
,
title
:
`删除成功`
,
});
uni
.
redirectTo
({
url
:
"/pages/home/home?tabIndex=1"
,
success
()
{
uni
.
hideLoading
();
},
});
},
// 删除
deleteClick
()
{
this
.
$refs
.
inputDialog2
.
open
();
},
lookTable
()
{
uni
.
navigateTo
({
url
:
"/pages/report/sampleTable?isJF=1"
,
});
},
// tab选中change 时间
changeTab
(
index
,
item
)
{
this
.
draft
(
this
.
activeTabIndex
,
false
,
false
).
then
(()
=>
{
this
.
activeTabIndex
=
index
;
});
},
back
()
{
uni
.
navigateBack
();
},
// 处理提交数据
getParams
()
{
const
tabList
=
this
.
tabList
;
const
tempForm
=
this
.
tempForm
;
const
baseInfo
=
this
.
baseInfo
;
const
fillCheck
=
tabList
.
filter
((
item
)
=>
item
.
isVaild
)
.
map
((
item
)
=>
item
.
value
)
.
join
(
","
);
let
temp
=
{
...
baseInfo
,
isSubmit
:
0
,
fillCheck
,
isException
:
""
,
roomWatch
:
""
,
dutyHandover
:
""
,
successor
:
""
,
handoverPerson
:
""
,
};
const
tempItems
=
[];
tabList
.
forEach
((
element
,
index
)
=>
{
if
(
Array
.
isArray
(
tempForm
[
index
]))
{
tempItems
.
push
(...
tempForm
[
index
]);
}
else
{
temp
=
{
...
temp
,
...
tempForm
[
index
],
};
}
});
const
items
=
tempItems
.
map
((
item
)
=>
{
return
{
itemCode
:
item
.
itemCode
,
measuredData
:
item
.
measuredData
,
notes
:
item
.
notes
,
inspectionResult
:
item
.
inspectionResult
,
roomType
:
item
.
roomType
,
};
});
const
isException
=
items
.
filter
((
item
)
=>
item
.
inspectionResult
>
0
)
.
length
?
1
:
0
;
return
{
...
temp
,
items
,
isException
,
synchronization
:
0
,
// 是否导出过
submitTime
:
moment
().
format
(
"yyyy-MM-DD"
),
// 记录提交时间
submitMonth
:
moment
().
format
(
"yyyy-MM"
),
// 记录提交月份
originData
:
{
baseInfo
,
tempForm
,
},
};
},
// 提交按钮
submit
()
{
this
.
draft
(
this
.
activeTabIndex
,
false
,
false
).
then
(()
=>
{
const
vaild
=
this
.
$refs
.
tabs
.
isAllVails
();
const
uid
=
this
.
detailsInfo
.
uid
;
this
.
loading
=
true
;
if
(
vaild
)
{
/**
* 校验通过,
* 1.更新 store 数据,
* 2. 巡检list文件
* 3.清空草稿文件数据、store草稿数据
*/
const
params
=
this
.
getParams
();
const
all_data
=
this
.
$store
.
state
.
all_data
;
params
.
isSubmit
=
1
;
let
logContent
=
""
;
// 新增 or 编辑
if
(
uid
)
{
const
index
=
all_data
.
findIndex
((
element
)
=>
element
.
uid
==
uid
);
params
.
uid
=
uid
;
all_data
[
index
]
=
params
;
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
edit
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
}
else
{
params
.
uid
=
new
Date
().
getTime
();
// 唯一标识 pad 端使用
all_data
.
push
(
params
);
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
add
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
}
// 更新巡检list
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
all_data
);
const
userInfo
=
this
.
userInfo
;
const
inspectList
=
all_data
.
filter
((
item
)
=>
item
.
createByName
==
userInfo
.
user
)
writeInspectionData
(
inspectList
,
userInfo
.
user
);
// 更新日志
const
log_list
=
this
.
$store
.
state
.
log_list
;
logContent
.
inspectionType
=
params
.
inspectionType
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
// 清空草稿数据
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
{});
// 缓存[巡检信息]
writeDarf
(
""
).
then
((
res
)
=>
{
console
.
log
(
"写入草稿文件成功"
);
});
// 清空基础缓存信息
this
.
$store
.
commit
(
"SET_TEMP_DATA"
,
{});
// 缓存[巡检信息]
this
.
loading
=
false
;
}
uni
.
showToast
({
icon
:
`
${
vaild
?
"success"
:
"error"
}
`
,
title
:
`
${
vaild
?
"校验通过"
:
"请完善填写内容"
}
`
,
});
if
(
!
vaild
)
{
this
.
loading
=
false
;
return
;
}
uni
.
redirectTo
({
url
:
"/pages/home/home?tabIndex=1"
,
success
()
{
uni
.
hideLoading
();
},
});
});
},
// 保存草稿按钮
draft
(
activeTabIndex
,
isSave
=
true
,
iSwtich
=
true
)
{
let
refName
=
""
;
return
new
Promise
((
resolve
,
reject
)
=>
{
switch
(
activeTabIndex
)
{
case
0
:
refName
=
"GatherDataCenter"
;
break
;
case
1
:
refName
=
"ShieldedComputerRoom"
;
break
;
case
2
:
refName
=
"BatteryRoom"
;
break
;
case
3
:
refName
=
"ComputerRoomDuty"
;
break
;
case
4
:
refName
=
"DutyHandover"
;
break
;
}
if
(
this
.
loading
)
return
;
this
.
$refs
[
refName
].
vaildForm
().
then
(({
vaild
,
formData
})
=>
{
this
.
$refs
.
tabs
.
setTabVaild
(
activeTabIndex
,
vaild
,
iSwtich
)
.
then
(()
=>
{
this
.
tempForm
[
activeTabIndex
]
=
formData
;
this
.
loading
=
true
;
if
(
isSave
)
{
// 写入草稿文件 更新 store 草稿内容
const
params
=
this
.
getParams
();
params
.
isSubmit
=
0
;
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
params
);
// 缓存草稿
writeDarf
(
params
).
then
((
res
)
=>
{
console
.
log
(
"写入草稿文件成功"
);
uni
.
showToast
({
icon
:
"success"
,
title
:
"保存草稿成功"
,
});
});
// 新增日志信息
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
darf
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
logContent
.
inspectionType
=
params
.
inspectionType
;
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
this
.
loading
=
false
;
}
else
{
this
.
loading
=
false
;
}
resolve
();
});
});
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.inspectionContent {
width: 100%;
height: 100%;
background-image: linear-gradient(
180deg,
#f8fafc 0%,
rgba(255, 255, 255, 0) 91%
);
.content {
position: absolute;
top: 0;
width: 100%;
background-image: linear-gradient(
0deg,
#f3f6fa 0%,
rgba(130, 153, 238, 0.73) 49%,
#5474e8 100%
);
height: calc(100vh - 44px - var(--status-bar-height) - 20px);
background-size: 100% 40rpx;
background-repeat: no-repeat;
padding-bottom: 160px;
.content_header {
font-size: 18px;
color: #000000;
line-height: 26px;
font-weight: 500;
}
.main {
width: 100%;
height: 100%;
overflow: auto;
padding: 20px 0;
position: relative;
padding: 0 20px 20px 20px;
.tabs {
margin: 16px 0;
}
}
}
// 基础信息
.base-info {
height: 170px;
padding: 20px 24px;
background-image: linear-gradient(
90deg,
#e9f7fe 0%,
#dceffe 40%,
#d5ebfd 66%,
#c9e8fe 100%
);
background-repeat: no-repeat;
background-size: 100% 100%;
margin-bottom: 16px;
padding-top: 80px;
position: relative;
.bg-img {
right: 0;
bottom: 0;
position: absolute;
width: 250px;
height: 100px;
}
.title {
font-size: 26px;
color: #000000;
line-height: 34px;
font-weight: 600;
margin-bottom: 16px;
}
.base-row {
display: flex;
align-items: center;
.base-row-item {
margin-right: 32px;
}
}
.name {
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.text {
margin-left: 12px;
font-size: 14px;
color: #000000;
font-weight: 400;
}
}
.fixed-btns {
height: 70px;
background-image: linear-gradient(-87deg, #ecf1f4 3%, #eaf6fc 100%);
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.button-group {
display: flex;
align-items: center;
background-image: linear-gradient(-87deg, #ecf1f4 3%, #eaf6fc 100%);
.btn-class {
width: 180px;
height: 40px;
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
font-size: 18px;
color: #ffffff;
text-align: center;
font-weight: 400;
text-align: center;
line-height: 40px;
margin-right: 24px;
}
.btn-draft {
background: #fff;
border: 1px solid #3773f6;
color: #3773f6;
box-shadow: none;
}
}
}
// 导航栏样式
.uni-nav-bar-text {
height: 36px;
width: 36px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 18px;
border-radius: 50%;
color: #333;
text-align: center;
.iconfont {
font-size: 20px;
line-height: 36px;
}
}
.nav-right {
display: flex;
align-items: center;
.icon-delete {
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
}
.look-from {
margin-left: 12px;
height: 36px;
line-height: 36px;
padding: 0 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 10px;
.iconfont {
margin-top: 5px;
margin-right: 5px;
font-size: 14px;
}
}
}
}
</
style
>
pages/inspectionContent/model/batteryRoom.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"gather-dataCenter"
>
<uni-forms
v-for=
"(item, parentIndex) in list"
:key=
"item.dictLabel"
:modelValue=
"item"
label-width=
"82px"
class=
"inspection-item"
:ref=
"`forms_$
{parentIndex}`"
:rules="rules"
>
<uni-forms-item
class=
"row-item"
label=
"巡检项"
>
<view
class=
"text"
>
{{
item
.
dictLabel
}}
</view>
</uni-forms-item>
<uni-forms-item
required
class=
"row-item"
label=
"巡检结论"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.resultArr"
class=
"tag"
:key=
"eleIndex"
@
click=
"tagClick(parentIndex, eleIndex, ele.isActive)"
:class=
"ele.isActive ? 'active-tag' : ''"
>
{{
ele
.
label
}}
</view>
</view>
</uni-forms-item>
<!-- 异常状态时显示 -->
<uni-forms-item
required
class=
"row-item"
label=
"异常定位"
name=
"measuredDataArr"
v-if=
"item.inspectionResult == 1"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.postionList"
class=
"tag"
@
click=
"postionChange(parentIndex, eleIndex, ele.isActive)"
:class=
"
item.measuredDataArr.includes(ele.dictValue) ? 'active-tag' : ''
"
>
{{
ele
.
dictLabel
}}
</view>
</view>
</uni-forms-item>
<!-- 异常状态时显示 -->
<uni-forms-item
v-if=
"item.inspectionResult == 1"
required
class=
"row-item note-item"
label=
"情况摘要"
name=
"notes"
>
<textarea
type=
"text"
:disabled=
"isDisable"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
<view
class=
"qucik-content"
>
<view
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</view>
<view
v-if=
"!isDisable"
>
<text
class=
"qucik-text"
v-for=
"quickItem in quickTextList"
:key=
"quickItem.text"
@
click=
"clickQuick(item, quickItem)"
>
{{
quickItem
.
text
}}
</text
>
</view>
</view>
</uni-forms-item>
</uni-forms>
</view>
</
template
>
<
script
>
import
{
pad_1_3_inspection_items
,
pad_1_3_inspection_position
,
pad_room_type
,
}
from
"@/utils/dict.js"
;
/**
* 电池间
*/
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
return
{
list
:
[],
rules
:
{
// 对notes字段进行必填验证
notes
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请输入情况摘要"
,
},
],
},
measuredDataArr
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请选择"
,
},
],
},
},
roomTypeLabel
:
"电池间巡检"
,
// 用于获取类型值
quickTextList
:
[
{
text
:
"有异常"
,
},
{
text
:
"已处理"
,
},
{
text
:
"需派单维修"
,
},
],
};
},
mounted
()
{
this
.
coverlist
();
},
methods
:
{
// tag 点击事件
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
isActive
||
this
.
isDisable
)
{
return
;
}
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
element
.
isActive
=
false
;
});
const
item
=
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
];
item
.
isActive
=
!
isActive
;
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
]
=
item
;
// 赋值数据
this
.
list
[
parentIndex
].
inspectionResult
=
item
.
value
;
// 记录结论
this
.
list
[
parentIndex
].
postionList
.
forEach
(
(
item
)
=>
(
item
.
isActive
=
false
)
);
this
.
list
[
parentIndex
].
measuredDataArr
=
[];
// 重置异常位置
this
.
list
[
parentIndex
].
notes
=
""
;
// 重置摘要信息
},
// tag 点击事件
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
this
.
isDisable
)
{
return
;
}
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
item
=
postionList
[
eleIndex
];
item
.
isActive
=
!
isActive
;
postionList
[
eleIndex
]
=
item
;
this
.
list
[
parentIndex
].
postionList
=
postionList
;
this
.
list
[
parentIndex
].
measuredDataArr
=
postionList
.
filter
((
item
)
=>
item
.
isActive
)
.
map
((
item
)
=>
item
.
dictValue
);
},
// 数据结构重组
coverlist
()
{
const
roomTypeLabel
=
this
.
roomTypeLabel
;
const
roomType
=
pad_room_type
.
rows
.
filter
(
(
item
)
=>
item
.
dictLabel
==
roomTypeLabel
)[
0
].
dictValue
;
const
temp
=
pad_1_3_inspection_items
.
rows
.
map
((
item
)
=>
{
return
{
// ...item,
dictLabel
:
item
.
dictLabel
,
dictValue
:
item
.
dictValue
,
notes
:
""
,
// 情况摘要
inspectionResult
:
0
,
// 异常
itemCode
:
item
.
dictValue
,
// 检查项 如:门禁
roomType
,
// 机房类型
resultArr
:
[
{
value
:
0
,
label
:
"正常"
,
isActive
:
true
,
},
{
value
:
1
,
label
:
"异常"
,
},
],
measuredData
:
""
,
// 逗号分隔字符串
measuredDataArr
:
[],
// 前端本地使用
postionList
:
pad_1_3_inspection_position
.
rows
.
map
((
item
)
=>
{
return
{
...
item
,
};
}),
};
});
this
.
list
=
temp
;
},
// 回显数据
setForm
(
componentData
)
{
this
.
list
=
componentData
;
},
// 获取数据
getForm
()
{
const
temp
=
this
.
list
.
map
((
item
)
=>
{
return
{
...
item
,
measuredData
:
item
.
measuredDataArr
.
join
(
","
),
};
});
return
temp
;
},
// 校验数据 所有表单
async
vaildForm
()
{
const
temp
=
this
.
list
.
map
((
item
,
index
)
=>
{
return
this
.
$refs
[
`forms_
${
index
}
`
][
0
]
.
validate
()
.
then
(()
=>
{
return
{
result
:
true
,
index
,
};
})
.
catch
(()
=>
{
return
{
result
:
false
,
item
,
};
});
});
return
Promise
.
all
(
temp
).
then
((
res
)
=>
{
const
allVaildList
=
res
.
filter
((
item
)
=>
item
.
result
);
const
formData
=
this
.
getForm
();
return
{
vaild
:
this
.
list
.
length
==
allVaildList
.
length
,
formData
,
};
});
},
clickQuick
(
item
,
quickItem
)
{
item
.
notes
=
`
${
item
.
notes
}${
quickItem
.
text
}
`
;
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.gather-dataCenter {
.inspection-item {
border: 1px solid;
margin-bottom: 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
padding: 24px 24px 8px 24px;
.text {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: bold;
}
.row-item {
border-bottom: 1px solid #eee;
// border: 1px solid;
padding-bottom: 18px;
margin-bottom: 12px;
&:last-of-type {
border-bottom: none;
margin-bottom: 0;
}
.tags {
display: flex;
align-items: center;
.tag {
background: #f2f3f5;
width: 55px;
height: 36px;
border-radius: 10px;
text-align: center;
line-height: 36px;
margin-right: 10px;
font-size: 14px;
color: #4a4a4a;
text-align: center;
font-weight: 400;
}
.active-tag {
background: #3774f6;
color: #fff;
}
}
}
}
.note-item {
textarea{
width: 100%;
min-height: 96px;
background: #f7f7f7;
border-radius: 1px;
font-size: 14px;
color: #4a4a4a;
padding: 16px;
font-weight: 400;
}
.qucik-content {
display: flex;
align-items: center;
.quick-input {
margin: 16px 18px 18px 0 ;
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.qucik-text {
display: inline-block;
border: 1px solid rgba(242, 242, 242, 1);
border-radius: 8px;
padding: 0 10px;
height: 32px;
font-size: 12px;
color: #4a4a4a;
line-height: 20px;
font-weight: 400;
margin-right: 12px;
line-height: 32px;
text-align: center;
}
}
}
/deep/ .uni-forms-item__content {
display: flex;
align-items: center;
}
.note-item {
/deep/ .uni-forms-item__content {
display: block;
}
}
}
</
style
>
pages/inspectionContent/model/computerRoomDuty.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"gather-dataCenter"
>
<uni-forms
:modelValue=
"form"
label-width=
"82px"
class=
"inspection-item"
ref=
"forms"
:rules=
"rules"
label-position=
"top"
>
<uni-forms-item
class=
"row-item"
required
label=
"机房值班"
name=
"roomWatch"
>
<textarea
class=
"textarea"
v-model=
"form.roomWatch"
placeholder-style=
"color:#C7C7C7"
placeholder=
"请输入需求文字"
:disabled=
"isDisable"
/>
<view
>
<text
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</text>
<text
v-if=
"!isDisable"
>
<text
class=
"qucik-text"
v-for=
"item in quickTextList"
:key=
"item.text"
@
click=
"clickQuick(item)"
>
{{
item
.
text
}}
</text
>
</text>
</view>
</uni-forms-item>
</uni-forms>
</view>
</
template
>
<
script
>
import
{
pad_room_type
}
from
"@/utils/dict.js"
;
/**
* 机房值班
*/
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
return
{
list
:
[],
rules
:
{
// 对notes字段进行必填验证
roomWatch
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请输入内容"
,
},
],
},
},
form
:
{
roomWatch
:
""
,
// 机房值班
},
quickTextList
:
[
{
text
:
"进出总人数:"
,
},
{
text
:
"访客记录:"
,
},
{
text
:
"有"
,
},
{
text
:
"无"
,
},
],
roomTypeLabel
:
"机房值班"
,
// 用于获取类型值
};
},
mounted
()
{
const
roomTypeLabel
=
this
.
roomTypeLabel
;
const
roomType
=
pad_room_type
.
rows
.
filter
(
(
item
)
=>
item
.
dictLabel
==
roomTypeLabel
)[
0
].
dictValue
;
this
.
form
.
roomType
=
roomType
;
},
methods
:
{
// 回显数据
setForm
(
componentData
)
{
this
.
form
=
componentData
;
},
clickQuick
(
item
)
{
this
.
form
.
roomWatch
=
`
${
this
.
form
.
roomWatch
}${
item
.
text
}
`
;
},
// 校验数据 所有表单
async
vaildForm
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$refs
.
forms
.
validate
()
.
then
((
res
)
=>
{
resolve
({
vaild
:
true
,
formData
:
this
.
form
,
});
})
.
catch
((
error
)
=>
{
resolve
({
vaild
:
false
,
formData
:
this
.
form
,
});
});
});
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.gather-dataCenter {
.inspection-item {
border: 1px solid;
margin-bottom: 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
padding: 24px 24px 8px 24px;
.text {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: bold;
}
.textarea {
width: 100%;
min-height: 96px;
background: #f7f7f7;
border-radius: 12px;
font-size: 14px;
color: #4a4a4a;
padding: 16px;
font-weight: 400;
margin-bottom: 14px;
}
.quick-input {
margin: 16px 18px 18px 0;
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.qucik-text {
display: inline-block;
border: 1px solid rgba(242, 242, 242, 1);
border-radius: 8px;
padding: 0 10px;
height: 32px;
font-size: 12px;
color: #4a4a4a;
line-height: 20px;
font-weight: 400;
margin-right: 12px;
line-height: 32px;
text-align: center;
}
}
// /deep/ .uni-forms-item__content {
// display: flex;
// align-items: center;
// }
}
</
style
>
pages/inspectionContent/model/dutyHandover.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"gather-dataCenter"
>
<uni-forms
:modelValue=
"form"
label-width=
"82px"
class=
"inspection-item"
ref=
"forms"
:rules=
"rules"
label-position=
"top"
>
<uni-forms-item
class=
"row-item"
required
label=
"值班交接"
name=
"dutyHandover"
>
<textarea
class=
"textarea"
v-model=
"form.dutyHandover"
placeholder-style=
"color:#C7C7C7"
placeholder=
"请输入"
:disabled=
"isDisable"
/>
<text
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</text>
<text
v-if=
"!isDisable"
>
<text
class=
"qucik-text"
v-for=
"item in quickTextList"
:key=
"item.text"
@
click=
"clickQuick(item)"
>
{{
item
.
text
}}
</text
>
</text>
</uni-forms-item>
<view
class=
"user-info"
>
<uni-forms-item
class=
"row-item"
label=
"交班人"
>
<text
class=
"text"
>
{{
form
.
handoverPerson
}}
</text>
</uni-forms-item>
<uni-forms-item
class=
"row-item"
required
label=
"接班人"
name=
"successor"
>
<uni-easyinput
:disabled=
"isDisable"
type=
"text"
v-model=
"form.successor"
placeholder=
"请输入"
/>
</uni-forms-item>
</view>
</uni-forms>
</view>
</
template
>
<
script
>
import
{
pad_room_type
}
from
"@/utils/dict.js"
;
/**
* 值班交接
*/
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
return
{
rules
:
{
// 对notes字段进行必填验证
dutyHandover
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请输入内容"
,
},
],
},
successor
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请输入内容"
,
},
],
},
},
form
:
{
dutyHandover
:
""
,
// 机房值班
handoverPerson
:
""
,
//交班人
successor
:
""
,
// 接班人
},
quickTextList
:
[
{
text
:
"未完成事项:"
,
},
{
text
:
"有"
,
},
{
text
:
"无"
,
},
],
roomTypeLabel
:
"值班交接"
,
// 用于获取类型值
};
},
mounted
()
{
this
.
init
();
},
methods
:
{
init
()
{
const
roomTypeLabel
=
this
.
roomTypeLabel
;
const
roomType
=
pad_room_type
.
rows
.
filter
(
(
item
)
=>
item
.
dictLabel
==
roomTypeLabel
)[
0
].
dictValue
;
this
.
form
.
roomType
=
roomType
;
this
.
form
.
handoverPerson
=
this
.
$store
.
state
.
now_user
.
user
;
},
// 回显数据
setForm
(
componentData
)
{
this
.
form
=
componentData
;
},
clickQuick
(
item
)
{
this
.
form
.
dutyHandover
=
`
${
this
.
form
.
dutyHandover
}${
item
.
text
}
`
;
},
// 校验数据 所有表单
async
vaildForm
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$refs
.
forms
.
validate
()
.
then
((
res
)
=>
{
resolve
({
vaild
:
true
,
formData
:
this
.
form
,
});
})
.
catch
((
error
)
=>
{
resolve
({
vaild
:
false
,
formData
:
this
.
form
,
});
});
});
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.gather-dataCenter {
.inspection-item {
border: 1px solid;
margin-bottom: 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
padding: 24px 24px 8px 24px;
.text {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: bold;
}
.textarea {
width: 100%;
min-height: 96px;
background: #f7f7f7;
border-radius: 12px;
font-size: 14px;
color: #4a4a4a;
padding: 16px;
font-weight: 400;
margin-bottom: 14px;
}
.quick-input {
margin: 16px 18px 18px 0 ;
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.qucik-text {
display: inline-block;
border: 1px solid rgba(242, 242, 242, 1);
border-radius: 8px;
// width: 72px;
padding: 0 10px;
height: 32px;
font-size: 12px;
color: #4a4a4a;
line-height: 20px;
font-weight: 400;
margin-right: 12px;
line-height: 32px;
text-align: center;
}
}
.user-info {
display: flex;
.uni-forms-item {
flex: 1;
display: flex;
flex-direction: row;
}
}
// /deep/ .uni-forms-item__content {
// display: flex;
// align-items: center;
// }
}
</
style
>
pages/inspectionContent/model/gatherDataCenter.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"gather-dataCenter"
>
<uni-forms
v-for=
"(item, parentIndex) in list"
:key=
"item.dictLabel"
:modelValue=
"item"
label-width=
"82px"
class=
"inspection-item"
:ref=
"`forms_$
{parentIndex}`"
:rules="rules"
>
<uni-forms-item
class=
"row-item"
label=
"巡检项"
name=
"name"
>
<view
class=
"text"
>
{{
item
.
dictLabel
}}
</view>
</uni-forms-item>
<uni-forms-item
required
class=
"row-item"
label=
"巡检结论"
name=
"name"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.resultArr"
class=
"tag"
:key=
"eleIndex"
@
click=
"tagClick(parentIndex, eleIndex, ele.isActive)"
:class=
"ele.isActive ? 'active-tag' : ''"
>
{{
ele
.
label
}}
</view>
</view>
</uni-forms-item>
<!-- 异常状态时显示 -->
<uni-forms-item
required
class=
"row-item"
label=
"异常定位"
name=
"measuredDataArr"
v-if=
"item.inspectionResult == 1"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.postionList"
class=
"tag"
:key=
"eleIndex"
@
click=
"postionChange(parentIndex, eleIndex, ele.isActive)"
:class=
"
item.measuredDataArr.includes(ele.dictValue) ? 'active-tag' : ''
"
>
{{
ele
.
dictLabel
}}
</view>
</view>
</uni-forms-item>
<!-- 异常状态时显示 -->
<uni-forms-item
v-if=
"item.inspectionResult == 1"
required
class=
"row-item note-item"
label=
"情况摘要"
name=
"notes"
>
<textarea
type=
"text"
:disabled=
"isDisable"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
<view
class=
"qucik-content"
>
<view
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</view>
<view
v-if=
"!isDisable"
>
<text
class=
"qucik-text"
v-for=
"quickItem in quickTextList"
:key=
"quickItem.text"
@
click=
"clickQuick(item, quickItem)"
>
{{
quickItem
.
text
}}
</text
>
</view>
</view>
</uni-forms-item>
</uni-forms>
</view>
</
template
>
<
script
>
import
{
pad_1_1_inspection_items
,
pad_1_1_inspection_position
,
pad_room_type
,
}
from
"@/utils/dict.js"
;
/**
* 汇集机房
*/
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
return
{
list
:
[],
rules
:
{
// 对notes字段进行必填验证
notes
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请输入情况摘要"
,
},
],
},
measuredDataArr
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请选择"
,
},
],
},
},
roomTypeLabel
:
"汇聚机房巡检"
,
// 用于获取类型值
quickTextList
:
[
{
text
:
"有异常"
,
},
{
text
:
"已处理"
,
},
{
text
:
"需派单维修"
,
},
],
};
},
mounted
()
{
this
.
coverlist
();
},
methods
:
{
// tag 点击事件
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
isActive
||
this
.
isDisable
)
{
return
;
}
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
element
.
isActive
=
false
;
});
const
item
=
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
];
item
.
isActive
=
!
isActive
;
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
]
=
item
;
// 赋值数据
this
.
list
[
parentIndex
].
inspectionResult
=
item
.
value
;
// 记录结论
this
.
list
[
parentIndex
].
postionList
.
forEach
(
(
item
)
=>
(
item
.
isActive
=
false
)
);
this
.
list
[
parentIndex
].
measuredDataArr
=
[];
// 重置异常位置
this
.
list
[
parentIndex
].
notes
=
""
;
// 重置摘要信息
},
// tag 点击事件
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
this
.
isDisable
)
{
return
;
}
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
item
=
postionList
[
eleIndex
];
item
.
isActive
=
!
isActive
;
postionList
[
eleIndex
]
=
item
;
this
.
list
[
parentIndex
].
postionList
=
postionList
;
this
.
list
[
parentIndex
].
measuredDataArr
=
postionList
.
filter
((
item
)
=>
item
.
isActive
)
.
map
((
item
)
=>
item
.
dictValue
);
},
// 数据结构重组
coverlist
()
{
const
roomTypeLabel
=
this
.
roomTypeLabel
;
const
roomType
=
pad_room_type
.
rows
.
filter
(
(
item
)
=>
item
.
dictLabel
==
roomTypeLabel
)[
0
].
dictValue
;
const
temp
=
pad_1_1_inspection_items
.
rows
.
map
((
item
)
=>
{
return
{
// ...item,
dictLabel
:
item
.
dictLabel
,
dictValue
:
item
.
dictValue
,
notes
:
""
,
// 情况摘要
inspectionResult
:
0
,
// 异常
itemCode
:
item
.
dictValue
,
// 检查项 如:门禁
roomType
,
// 机房类型
resultArr
:
[
{
value
:
0
,
label
:
"正常"
,
isActive
:
true
,
},
{
value
:
1
,
label
:
"异常"
,
},
],
measuredData
:
""
,
// 逗号分隔字符串
measuredDataArr
:
[],
// 前端本地使用
postionList
:
pad_1_1_inspection_position
.
rows
.
map
((
item
)
=>
{
return
{
...
item
,
};
}),
};
});
this
.
list
=
temp
;
},
// 回显数据
setForm
(
componentData
)
{
this
.
list
=
componentData
;
},
// 获取数据
getForm
()
{
const
temp
=
this
.
list
.
map
((
item
)
=>
{
return
{
...
item
,
measuredData
:
item
.
measuredDataArr
.
join
(
","
),
};
});
return
temp
;
},
// 校验数据 所有表单
async
vaildForm
()
{
const
temp
=
this
.
list
.
map
((
item
,
index
)
=>
{
return
this
.
$refs
[
`forms_
${
index
}
`
][
0
]
.
validate
()
.
then
(()
=>
{
return
{
result
:
true
,
index
,
};
})
.
catch
(()
=>
{
return
{
result
:
false
,
item
,
};
});
});
return
Promise
.
all
(
temp
).
then
((
res
)
=>
{
const
allVaildList
=
res
.
filter
((
item
)
=>
item
.
result
);
const
formData
=
this
.
getForm
();
return
{
vaild
:
this
.
list
.
length
==
allVaildList
.
length
,
formData
,
};
});
},
clickQuick
(
item
,
quickItem
)
{
item
.
notes
=
`
${
item
.
notes
}${
quickItem
.
text
}
`
;
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.gather-dataCenter {
.inspection-item {
border: 1px solid;
margin-bottom: 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
padding: 24px 24px 8px 24px;
.text {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: bold;
}
.row-item {
border-bottom: 1px solid #eee;
// border: 1px solid;
padding-bottom: 18px;
margin-bottom: 12px;
&:last-of-type {
border-bottom: none;
margin-bottom: 0;
}
.tags {
display: flex;
align-items: center;
.tag {
background: #f2f3f5;
width: 55px;
height: 36px;
border-radius: 10px;
text-align: center;
line-height: 36px;
margin-right: 10px;
font-size: 14px;
color: #4a4a4a;
text-align: center;
font-weight: 400;
}
.active-tag {
background: #3774f6;
color: #fff;
}
}
}
}
.note-item {
textarea{
width: 100%;
min-height: 96px;
background: #f7f7f7;
border-radius: 1px;
font-size: 14px;
color: #4a4a4a;
padding: 16px;
font-weight: 400;
}
.qucik-content {
display: flex;
align-items: center;
.quick-input {
margin: 16px 18px 18px 0 ;
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.qucik-text {
display: inline-block;
border: 1px solid rgba(242, 242, 242, 1);
border-radius: 8px;
padding: 0 10px;
height: 32px;
font-size: 12px;
color: #4a4a4a;
line-height: 20px;
font-weight: 400;
margin-right: 12px;
line-height: 32px;
text-align: center;
}
}
}
/deep/ .uni-forms-item__content {
display: flex;
align-items: center;
}
.note-item {
/deep/ .uni-forms-item__content {
display: block;
}
}
}
</
style
>
pages/inspectionContent/model/shieldedComputerRoom.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"gather-dataCenter"
>
<uni-forms
v-for=
"(item, parentIndex) in list"
:key=
"item.dictLabel"
:modelValue=
"item"
label-width=
"82px"
class=
"inspection-item"
:ref=
"`forms_$
{parentIndex}`"
:rules="rules"
>
<uni-forms-item
class=
"row-item"
label=
"巡检项"
name=
"name"
>
<view
class=
"text"
>
{{
item
.
dictLabel
}}
</view>
</uni-forms-item>
<uni-forms-item
required
class=
"row-item"
label=
"巡检结论"
name=
"name"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.resultArr"
class=
"tag"
:key=
"eleIndex"
@
click=
"tagClick(parentIndex, eleIndex, ele.isActive)"
:class=
"ele.isActive ? 'active-tag' : ''"
>
{{
ele
.
label
}}
</view>
</view>
</uni-forms-item>
<!-- 异常状态时显示 -->
<uni-forms-item
required
class=
"row-item"
label=
"异常定位"
name=
"measuredDataArr"
v-if=
"item.inspectionResult == 1"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.postionList"
class=
"tag"
@
click=
"postionChange(parentIndex, eleIndex, ele.isActive)"
:class=
"
item.measuredDataArr.includes(ele.dictValue) ? 'active-tag' : ''
"
>
{{
ele
.
dictLabel
}}
</view>
</view>
</uni-forms-item>
<!-- 异常状态时显示 -->
<uni-forms-item
required
class=
"row-item note-item"
label=
"情况摘要"
name=
"notes"
v-if=
"item.inspectionResult == 1"
>
<textarea
type=
"text"
:disabled=
"isDisable"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
<view
class=
"qucik-content"
>
<view
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</view>
<view
v-if=
"!isDisable"
>
<text
class=
"qucik-text"
v-for=
"quickItem in quickTextList"
:key=
"quickItem.text"
@
click=
"clickQuick(item, quickItem)"
>
{{
quickItem
.
text
}}
</text
>
</view>
</view>
</uni-forms-item>
</uni-forms>
</view>
</
template
>
<
script
>
import
{
pad_1_2_inspection_items
,
pad_1_2_inspection_position
,
pad_room_type
,
}
from
"@/utils/dict.js"
;
/**
* 屏蔽机房巡检
*/
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
return
{
list
:
[],
rules
:
{
// 对notes字段进行必填验证
notes
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请输入情况摘要"
,
},
],
},
measuredDataArr
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请选择"
,
},
],
},
},
roomTypeLabel
:
"屏蔽机房巡检"
,
// 用于获取类型值
quickTextList
:
[
{
text
:
"有异常"
,
},
{
text
:
"已处理"
,
},
{
text
:
"需派单维修"
,
},
],
};
},
mounted
()
{
this
.
coverlist
();
},
methods
:
{
// tag 点击事件
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
isActive
||
this
.
isDisable
)
{
return
;
}
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
element
.
isActive
=
false
;
});
const
item
=
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
];
item
.
isActive
=
!
isActive
;
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
]
=
item
;
// 赋值数据
this
.
list
[
parentIndex
].
inspectionResult
=
item
.
value
;
// 记录结论
this
.
list
[
parentIndex
].
postionList
.
forEach
(
(
item
)
=>
(
item
.
isActive
=
false
)
);
this
.
list
[
parentIndex
].
measuredDataArr
=
[];
// 重置异常位置
this
.
list
[
parentIndex
].
notes
=
""
;
// 重置摘要信息
},
// tag 点击事件
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
this
.
isDisable
)
{
return
;
}
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
item
=
postionList
[
eleIndex
];
item
.
isActive
=
!
isActive
;
postionList
[
eleIndex
]
=
item
;
this
.
list
[
parentIndex
].
postionList
=
postionList
;
this
.
list
[
parentIndex
].
measuredDataArr
=
postionList
.
filter
((
item
)
=>
item
.
isActive
)
.
map
((
item
)
=>
item
.
dictValue
);
},
// 数据结构重组
coverlist
()
{
const
roomTypeLabel
=
this
.
roomTypeLabel
;
const
roomType
=
pad_room_type
.
rows
.
filter
(
(
item
)
=>
item
.
dictLabel
==
roomTypeLabel
)[
0
].
dictValue
;
const
temp
=
pad_1_2_inspection_items
.
rows
.
map
((
item
)
=>
{
return
{
// ...item,
dictLabel
:
item
.
dictLabel
,
dictValue
:
item
.
dictValue
,
notes
:
""
,
// 情况摘要
inspectionResult
:
0
,
// 异常
itemCode
:
item
.
dictValue
,
// 检查项 如:门禁
roomType
,
// 机房类型
resultArr
:
[
{
value
:
0
,
label
:
"正常"
,
isActive
:
true
,
},
{
value
:
1
,
label
:
"异常"
,
},
],
measuredData
:
""
,
// 逗号分隔字符串
measuredDataArr
:
[],
// 前端本地使用
postionList
:
pad_1_2_inspection_position
.
rows
.
map
((
item
)
=>
{
return
{
...
item
,
};
}),
};
});
this
.
list
=
temp
;
},
// 回显数据
setForm
(
componentData
)
{
this
.
list
=
componentData
;
},
// 获取数据
getForm
()
{
const
temp
=
this
.
list
.
map
((
item
)
=>
{
return
{
...
item
,
measuredData
:
item
.
measuredDataArr
.
join
(
","
),
};
});
return
temp
;
},
// 校验数据 所有表单
async
vaildForm
()
{
const
temp
=
this
.
list
.
map
((
item
,
index
)
=>
{
return
this
.
$refs
[
`forms_
${
index
}
`
][
0
]
.
validate
()
.
then
(()
=>
{
return
{
result
:
true
,
index
,
};
})
.
catch
(()
=>
{
return
{
result
:
false
,
item
,
};
});
});
return
Promise
.
all
(
temp
).
then
((
res
)
=>
{
const
allVaildList
=
res
.
filter
((
item
)
=>
item
.
result
);
const
formData
=
this
.
getForm
();
return
{
vaild
:
this
.
list
.
length
==
allVaildList
.
length
,
formData
,
};
});
},
clickQuick
(
item
,
quickItem
)
{
item
.
notes
=
`
${
item
.
notes
}${
quickItem
.
text
}
`
;
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.gather-dataCenter {
.inspection-item {
border: 1px solid;
margin-bottom: 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
padding: 24px 24px 8px 24px;
.text {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: bold;
}
.row-item {
border-bottom: 1px solid #eee;
// border: 1px solid;
padding-bottom: 18px;
margin-bottom: 12px;
&:last-of-type {
border-bottom: none;
margin-bottom: 0;
}
.tags {
display: flex;
align-items: center;
.tag {
background: #f2f3f5;
width: 55px;
height: 36px;
border-radius: 10px;
text-align: center;
line-height: 36px;
margin-right: 10px;
font-size: 14px;
color: #4a4a4a;
text-align: center;
font-weight: 400;
}
.active-tag {
background: #3774f6;
color: #fff;
}
}
}
}
.note-item {
textarea{
width: 100%;
min-height: 96px;
background: #f7f7f7;
border-radius: 1px;
font-size: 14px;
color: #4a4a4a;
padding: 16px;
font-weight: 400;
}
.qucik-content {
display: flex;
align-items: center;
.quick-input {
margin: 16px 18px 18px 0 ;
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.qucik-text {
display: inline-block;
border: 1px solid rgba(242, 242, 242, 1);
border-radius: 8px;
padding: 0 10px;
height: 32px;
font-size: 12px;
color: #4a4a4a;
line-height: 20px;
font-weight: 400;
margin-right: 12px;
line-height: 32px;
text-align: center;
}
}
}
/deep/ .uni-forms-item__content {
display: flex;
align-items: center;
}
.note-item {
/deep/ .uni-forms-item__content {
display: block;
}
}
}
</
style
>
pages/inspectionContent/model/tabs.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"tabs-component"
>
<view
class=
"tabs-list"
>
<view
v-for=
"(item, index) in list"
:key=
"item.name"
class=
"tab-item"
@
click=
"tabClick(index, item)"
:class=
"index == activeIndex ? 'active-tab-item' : ''"
>
<text
class=
"iconfont icon-yiwancheng1"
:class=
"item.isVaild ? 'vaild-icon' : ''"
></text>
{{
item
.
name
}}
</view
>
</view>
<!-- 描述 -->
<view
v-if=
"(list[activeIndex]||
{}).value" class="descript">
<view
v-if=
"(list[activeIndex].position || []).length"
class=
"descript-item"
>
<text
class=
"name"
>
巡检位置
</text>
<text
class=
"text"
>
{{
list
[
activeIndex
].
position
.
map
((
item
)
=>
item
.
dictLabel
).
join
(
"、"
)
}}
</text>
</view>
<view
v-if=
"list[activeIndex].descript"
class=
"descript-item"
>
<text
class=
"name"
>
巡检说明
</text>
<text
class=
"text"
>
{{
list
[
activeIndex
].
descript
}}
</text>
</view>
</view>
</view>
</
template
>
<
script
>
import
{
pad_1_1_inspection_position
,
pad_1_2_inspection_position
,
pad_1_3_inspection_position
,
}
from
"@/utils/dict.js"
;
export
default
{
props
:
{
options
:
{
tyep
:
Array
,
},
},
data
()
{
return
{
activeIndex
:
0
,
list
:
[],
};
},
mounted
()
{
this
.
list
=
this
.
options
;
},
watch
:
{
options
(
newData
)
{
this
.
list
=
newData
;
},
},
methods
:
{
tabClick
(
index
,
item
)
{
this
.
activeIndex
=
index
;
this
.
$emit
(
"change"
,
index
,
item
);
},
/**
* 设置单个校验状态
* @param index
* @param vaild
* @param iSwtich 是否自动切换到下一个tab
*/
setTabVaild
(
index
,
vaild
=
false
,
iSwtich
=
true
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
list
[
index
].
isVaild
=
vaild
;
if
(
iSwtich
&&
index
<
this
.
list
.
length
-
1
)
{
this
.
tabClick
(
index
+
1
,
{});
}
resolve
();
});
},
// 校验所有内容是否填写完成
isAllVails
()
{
return
this
.
list
.
every
((
item
)
=>
{
return
item
.
isVaild
;
});
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.tabs-component {
.tabs-list {
display: flex;
align-items: center;
margin-bottom: 16px;
.iconfont {
margin-right: 5px;
color: #999;
font-size: 14px;
}
.tab-item {
margin-right: 24px;
font-size: 14px;
color: #000000;
line-height: 22px;
font-weight: 400;
position: relative;
padding-bottom: 5px;
&::after {
content: " ";
position: absolute;
bottom: 0px;
width: 100%;
height: 3px;
border-radius: 10px;
left: 0;
}
}
.vaild-icon {
color: #3774f6;
}
.active-tab-item {
color: #3774f6;
&::after {
background: #3774f6;
}
}
}
.descript {
padding: 8px 16px;
background: #e0f1ff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 8px;
.descript-item {
font-size: 12px;
color: #959595;
line-height: 28px;
font-weight: 400;
.name {
margin-right: 8px;
}
.text {
color: #000000;
}
}
}
}
</
style
>
pages/inspectionManagement/index.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"inspection-management"
>
<!-- 搜索项 -->
<SearchCom
@
change=
"change"
/>
<!-- 结果 -->
<view
class=
"inspection-management-content"
>
<view
class=
"count-tatal"
>
<text
class=
"num"
>
{{
countNum
||
0
}}
条
</text>
<text>
查询结果
</text>
</view>
<view
class=
"month-list"
>
<!-- 每月记录 -->
<view
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
submitTime
||
item
.
time
}}
</view>
<view
class=
"inspect-list"
>
<InspectionItem
v-for=
"ele in item.list"
:key=
"ele.uid"
:details=
"ele"
/>
</view>
</view>
<Empty
v-if=
"list.length == 0"
/>
</view>
</view>
<!-- 开始巡检 -->
<view
class=
"inspection-button"
@
click=
"toPage"
>
开始巡检
</view
>
</view>
</
template
>
<
script
>
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
{
getDarft
}
from
"@/request/index.js"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
components
:
{
SearchCom
,
InspectionItem
,
Empty
,
},
data
()
{
return
{
isDialog
:
false
,
//
list
:
[],
// 展示数据
all_data
:
[],
// 所有数据
searchForm
:
{
// 搜索条件
},
countNum
:
0
,
// 统计查询总数
};
},
mounted
()
{
uni
.
showLoading
();
getAllInspections
()
.
then
((
res
)
=>
{
this
.
all_data
=
res
;
this
.
init
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
0
==
error
.
code
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
this
.
all_data
=
[];
uni
.
hideLoading
();
});
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
},
methods
:
{
init
()
{
const
all_data
=
this
.
all_data
||
[];
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
// 第一步: 筛选有效的时间范围
const
timeFrame
=
all_data
.
filter
((
item
)
=>
{
if
(
!
inspectionTime
.
length
)
{
return
true
;
}
else
{
return
(
new
Date
(
startTime
).
getTime
()
<=
new
Date
(
item
.
submitTime
).
getTime
()
&&
new
Date
(
item
.
submitTime
).
getTime
()
<=
new
Date
(
endTime
).
getTime
()
);
}
});
// 属于同一个月的数据 聚合
const
tempAllData
=
{};
timeFrame
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitMonth
]
||
[];
if
(
val
.
length
)
{
tempAllData
[
item
.
submitMonth
].
push
(
item
);
}
else
{
tempAllData
[
item
.
submitMonth
]
=
[
item
];
}
});
const
keys
=
Object
.
keys
(
tempAllData
);
// 第二步: 根据搜索条件过滤
const
list
=
keys
.
map
((
key
)
=>
{
return
{
time
:
key
,
list
:
this
.
coverData
(
tempAllData
[
key
]),
};
});
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
this
.
countNum
+=
item
.
list
.
length
;
});
this
.
list
=
list
;
},
coverData
(
arr
=
[])
{
const
{
isException
=
""
,
inspectionType
=
""
,
synchronization
=
""
,
}
=
this
.
searchForm
;
return
arr
.
filter
((
item
)
=>
{
return
(
(
!
isException
||
isException
==
"all"
||
item
.
isException
==
isException
)
&&
(
!
inspectionType
||
inspectionType
==
"all"
||
item
.
inspectionType
==
inspectionType
)
&&
(
!
synchronization
||
synchronization
==
"all"
||
item
.
synchronization
==
synchronization
)
);
});
},
change
(
e
)
{
this
.
searchForm
=
e
;
this
.
init
();
},
toPage
()
{
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
if
(
darf_data
.
inspectionType
==
1
)
{
uni
.
navigateTo
({
url
:
`/pages/inspectionContent/inspectionContent?isDarf=1`
,
});
}
else
if
(
darf_data
.
inspectionType
==
2
)
{
uni
.
navigateTo
({
url
:
`/pages/shaftInspection/shaftInspection?isDarf=1`
,
});
}
else
{
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
}
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
error
.
code
==
0
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
uni
.
hideLoading
();
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.inspection-management {
padding-top: 16px;
.count-tatal {
margin: 16px 0 8px 0;
font-size: 14px;
color: #4a4a4a;
font-weight: 400;
.num {
font-size: 18px;
color: #3774f6;
line-height: 26px;
font-weight: 600;
margin-right: 5px;
}
}
.inspection-management-content {
.month-list {
height: calc(100vh - 26px - 16px - 8px - 36px - 62px);
overflow: auto;
padding-bottom: 140px;
.seconed-title {
margin-top: 16px;
font-size: 18px;
color: #000000;
font-weight: bold;
}
.month-record-item {
margin-bottom: 24px;
&:last-of-type {
margin: 0;
}
.inspect-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
.inspection-button {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 60px;
width: 240px;
height: 48px;
left: 50%;
color: #fff;
transform: translateX(-50%);
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
}
}
</
style
>
pages/monthReport/components/rightBar.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
class=
"echartsBar"
id=
"echartsBar"
></view>
</
template
>
<
script
>
import
*
as
echarts
from
"echarts"
;
export
default
{
props
:
{},
data
()
{
return
{};
},
computed
:
{
option
()
{
let
data1
=
[
1
,
2
,
3
,
4
,
5
,
61
],
data2
=
[
6
,
5
,
4
,
3
,
2
,
1
];
return
{
tooltip
:
{
trigger
:
"axis"
,
axisPointer
:
{
type
:
"shadow"
,
},
},
legend
:
{
right
:
"0"
,
},
grid
:
{
left
:
"3%"
,
right
:
"4%"
,
bottom
:
"3%"
,
containLabel
:
true
,
},
color
:
[
"#4BB4FF"
,
"#1183F5"
],
yAxis
:
{
type
:
"value"
,
boundaryGap
:
[
0
,
0.01
],
},
xAxis
:
{
type
:
"category"
,
data
:
[
"终端告警"
,
"应用告警"
,
"机房告警"
,
"网络告警"
,
"数据中心告警"
,
"用户疑似违规"
,
],
},
series
:
[
{
name
:
"上月"
,
type
:
"bar"
,
barWidth
:
"10"
,
itemStyle
:
{
borderRadius
:
[
20
,
20
,
0
,
0
],
// 设置顶部两个角的圆角半径为20像素
},
data
:
data1
,
},
{
name
:
"本月"
,
type
:
"bar"
,
barWidth
:
"10"
,
itemStyle
:
{
borderRadius
:
[
20
,
20
,
0
,
0
],
// 设置顶部两个角的圆角半径为20像素
},
data
:
data2
,
},
],
};
},
},
async
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
init
();
});
},
methods
:
{
init
()
{
const
DOM
=
document
.
getElementById
(
"echartsBar"
);
const
myChart
=
echarts
.
init
(
DOM
);
myChart
.
setOption
(
this
.
option
);
window
.
addEventListener
(
"resize"
,
()
=>
{
myChart
.
clear
();
myChart
.
setOption
(
this
.
option
);
myChart
&&
myChart
.
resize
();
});
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.echartsBar
{
height
:
100%
;
width
:
100%
;
}
</
style
>
pages/monthReport/components/rightItem.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<ul>
<li
v-for=
"item in rightOneData"
:key=
"item.label"
>
<view
class=
"label"
>
{{
item
.
label
}}
</view>
<view
class=
"value"
>
{{
item
.
value
}}
</view>
</li>
</ul>
</
template
>
<
script
>
export
default
{
props
:
{},
data
()
{
return
{
rightOneData
:
[
{
label
:
"现状分析:"
,
value
:
"本月告警总数X次。终端告警X次、应用告警X次、网络告警X次、机房告警X次、数据中心告警X次。总体环比上升(下降 | 持平)XX%。"
,
},
{
label
:
"问题识别:"
,
value
:
"本月对比上月,XX场景告警、XX场景告警发生率正在上升;本月对比上月,XX场景告警、XX场景告警发生率明显下降。"
,
},
{
label
:
"原因分析:"
,
value
:
"XX场景告警(XXXXXX告警项)本月发生X次;XX场景告警的(XXXXXX告警项)本月发生X次 。"
,
},
{
label
:
"趋势预测:"
,
value
:
"基于以上数据,XXXXX类、XXXX类告警有上升趋势,近期需重点关注,加强防范。"
,
},
{
label
:
"风险预警:"
,
value
:
"请重点关注机房环控状态,加强巡检力度;请重点关注行为违规,加强规范机房人员个人行为。"
,
},
],
};
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
ul
{
list-style
:
none
;
li
{
list-style
:
none
;
display
:
flex
;
.label
{
width
:
65px
;
height
:
auto
;
font-size
:
14px
;
line-height
:
22px
;
color
:
#000000
;
}
.value
{
width
:
calc
(
100%
-
75px
);
height
:
auto
;
margin-left
:
10px
;
font-size
:
14px
;
color
:
#4A4A4A
;
line-height
:
22px
;
}
}
}
</
style
>
pages/monthReport/components/rightLine.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
class=
"echartsBar"
id=
"echartsLine"
></view>
</
template
>
<
script
>
import
*
as
echarts
from
"echarts"
;
export
default
{
props
:
{},
data
()
{
return
{
lists
:
[
{
name
:
"终端"
,
yData
:
[],
},
{
name
:
"应用"
,
yData
:
[],
},
{
name
:
"机房"
,
yData
:
[],
},
{
name
:
"网络"
,
yData
:
[],
},
{
name
:
"数据中心"
,
yData
:
[],
},
{
name
:
"用户疑似违规"
,
yData
:
[],
},
],
};
},
computed
:
{
option
()
{
let
legendData
=
[];
let
serverData
=
[];
let
xData
=
[];
this
.
lists
.
forEach
((
item
)
=>
{
legendData
.
push
(
item
.
name
);
let
yData
=
[];
xData
=
[];
for
(
let
i
=
1
;
i
<=
31
;
i
++
)
{
yData
.
push
(
Math
.
floor
(
Math
.
random
()
*
100
));
xData
.
push
(
"10-"
+
i
.
toString
().
padStart
(
2
,
'0'
));
}
serverData
.
push
({
name
:
item
.
name
,
type
:
"line"
,
data
:
yData
,
});
});
return
{
tooltip
:
{
trigger
:
"axis"
,
},
legend
:
{
data
:
legendData
,
right
:
"0"
,
icon
:
"rect"
,
},
color
:
[
"#4B81FF"
,
"#F542D1"
,
"#DC6B49"
,
"#FADF63"
,
"#5FD87E"
,
"#63C7EF"
,
],
grid
:
{
left
:
"3%"
,
right
:
"4%"
,
bottom
:
"18%"
,
containLabel
:
true
,
},
xAxis
:
{
type
:
"category"
,
boundaryGap
:
false
,
data
:
xData
,
},
yAxis
:
{
type
:
"value"
,
},
series
:
serverData
,
dataZoom
:
[
{
type
:
"slider"
,
// 滑动条缩放
start
:
66
,
// 初始显示前10%的数据
end
:
100
,
},
{
type
:
"inside"
,
// 内置缩放
start
:
0
,
end
:
10
,
},
],
};
},
},
async
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
init
();
});
},
methods
:
{
init
()
{
const
DOM
=
document
.
getElementById
(
"echartsLine"
);
const
myChart
=
echarts
.
init
(
DOM
);
myChart
.
setOption
(
this
.
option
);
window
.
addEventListener
(
"resize"
,
()
=>
{
myChart
.
clear
();
myChart
.
setOption
(
this
.
option
);
myChart
&&
myChart
.
resize
();
});
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.echartsBar
{
height
:
100%
;
width
:
100%
;
}
</
style
>
pages/monthReport/components/rightPie.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
id=
"lineTendencyChart"
></view>
</
template
>
<
script
>
import
*
as
echarts
from
"echarts"
;
export
default
{
props
:
{
value
:
{
type
:
Number
,
default
:
0
,
}
},
data
()
{
return
{
Chart
:
null
,
};
},
async
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
initChart
();
});
},
computed
:
{
options
()
{
let
dataTmp
=
this
.
value
;
let
max
=
100
;
let
min
=
0
;
let
scoresPercentage
=
dataTmp
/
max
;
let
name
=
"健康指数"
;
return
{
backgroundColor
:
"#fff"
,
title
:
{
// text: '{a|' + value + '}{c|%}',
text
:
"{a|"
+
dataTmp
+
"%}{c|
\
n"
+
name
+
"}"
,
x
:
"center"
,
y
:
"center"
,
textStyle
:
{
rich
:
{
a
:
{
fontSize
:
24
,
color
:
"rgba(38, 38, 38)"
,
padding
:
[
5
,
0
],
},
c
:
{
fontSize
:
20
,
color
:
"rgba(158, 158, 158)"
,
// padding: [5,0]
},
},
},
},
series
:
[
// 内部中心进度,包含指针
{
zlevel
:
2
,
center
:
[
"50%"
,
"50%"
],
type
:
"gauge"
,
radius
:
"90%"
,
//95
startAngle
:
225
,
endAngle
:
-
45
,
min
:
min
,
max
:
max
,
axisLine
:
{
show
:
true
,
lineStyle
:
{
//假设值为20,小于20指针扫过区域
width
:
30
,
color
:
[
[
(
dataTmp
-
min
)
/
(
max
-
min
),
new
echarts
.
graphic
.
LinearGradient
(
1
,
1
,
0
,
0
,
[
{
offset
:
0
,
color
:
"rgba(44,125,255,0.2)"
,
},
{
offset
:
1
,
color
:
"rgba(255,49,127,0.1)"
,
//起始red渐变色
},
]),
],
[
1
,
"#fff"
],
],
},
},
axisTick
:
{
show
:
0
,
},
splitLine
:
{
show
:
0
,
},
axisLabel
:
{
show
:
0
,
},
pointer
:
{
show
:
false
,
// length: '100%',
// width: 4,
// itemStyle: {
// color: "red"//箭头颜色
// }
},
//底部点位名称
detail
:
{
show
:
false
,
// offsetCenter: [0, '75%'],
// formatter: ['{name|' + '温度' + '}'].join('\n'),
// rich: {
// name: {
// fontFamily: 'Microsoft YaHei',
// fontSize:14,
// color: 'red',
// lineHeight: 52
// }
// }
},
data
:
[
{
value
:
dataTmp
,
},
],
},
// 仪表盘值得渐变
{
type
:
"pie"
,
zlevel
:
10
,
radius
:
[
"46%"
,
"47%"
],
//100
center
:
[
"50%"
,
"50%"
],
silent
:
true
,
startAngle
:
225
,
endAngle
:
-
45
,
label
:
{
show
:
false
,
},
labelLine
:
{
show
:
false
,
},
data
:
[
{
name
:
""
,
value
:
dataTmp
,
itemStyle
:
{
color
:
{
x
:
0
,
y
:
0
,
x2
:
1
,
y2
:
0
,
type
:
"linear"
,
global
:
false
,
colorStops
:
[
{
offset
:
0
,
color
:
"#ff3190"
,
},
{
offset
:
1
,
color
:
"#409aff"
,
},
],
},
},
},
{
value
:
100
-
dataTmp
,
itemStyle
:
{
opacity
:
0
,
color
:
"rgba(255, 255, 255, 0)"
,
},
},
],
},
// 值d尾巴,那个圆圈
{
type
:
"pie"
,
radius
:
[
"45%"
,
"46%"
],
//100
center
:
[
"50%"
,
"50%"
],
zlevel
:
10
,
silent
:
true
,
startAngle
:
225
,
endAngle
:
-
45
,
data
:
[
{
name
:
""
,
value
:
dataTmp
,
label
:
{
show
:
false
,
},
labelLine
:
{
show
:
false
,
},
itemStyle
:
{
color
:
"rgba(0,0,0,0)"
,
},
},
// 画中间的图标
{
name
:
""
,
value
:
0
,
label
:
{
position
:
"inside"
,
backgroundColor
:
"#fff"
,
borderRadius
:
5
,
padding
:
4
,
// 可以控制圆的大小
borderWidth
:
2
,
borderColor
:
"#409bff"
,
},
},
{
name
:
""
,
value
:
100
-
dataTmp
,
label
:
{
show
:
false
,
},
labelLine
:
{
show
:
false
,
},
itemStyle
:
{
color
:
"rgba(255,255,255,0)"
,
},
},
],
},
//刻度圈
{
type
:
"gauge"
,
radius
:
"90%"
,
//100
center
:
[
"50%"
,
"50%"
],
zlevel
:
10
,
min
:
min
,
max
:
max
,
splitNumber
:
10
,
startAngle
:
225
,
endAngle
:
-
45
,
//最外层渐变色圈,宽度
axisLine
:
{
show
:
true
,
lineStyle
:
{
width
:
5
,
color
:
[
[
1
,
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
1
,
1
,
[
{
offset
:
0
,
color
:
"rgba(228, 228, 253,1)"
,
},
{
offset
:
1
,
color
:
"rgba(255, 213, 229,1)"
,
},
]),
],
],
},
},
axisLabel
:
{
//刻度值与刻度距离
distance
:
8
,
textStyle
:
{
color
:
"rgba(74,74,74,1)"
,
fontSize
:
12
,
},
},
//小刻度
axisTick
:
{
show
:
true
,
distance
:
0
,
},
//大刻度
splitLine
:
{
show
:
true
,
length
:
12
,
distance
:
0
,
lineStyle
:
{
width
:
2
,
},
},
pointer
:
{
show
:
0
,
},
detail
:
{
show
:
0
,
},
},
//内部中心圈
{
type
:
"pie"
,
zlevel
:
1
,
silent
:
true
,
//取消高亮
radius
:
[
"40%"
,
"41%"
],
center
:
[
"50%"
,
"50%"
],
itemStyle
:
{
normal
:
{
show
:
false
,
color
:
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
// x0, y0, x1, y1
[
{
offset
:
0
,
color
:
"#ffebf3"
},
// 0% 处的颜色
{
offset
:
1
,
color
:
"#e8eafd"
},
// 100% 处的颜色
]
),
},
},
labelLine
:
{
show
:
false
,
normal
:
{
length
:
10
,
length2
:
0
,
lineStyle
:
{
color
:
"transparent"
,
},
},
},
label
:
{
show
:
false
,
},
data
:
[
100
],
},
// 底圈
{
type
:
"pie"
,
zlevel
:
-
1
,
radius
:
"45%"
,
silent
:
true
,
center
:
[
"50%"
,
"50%"
],
label
:
{
show
:
true
,
},
labelLine
:
{
show
:
false
,
},
animation
:
false
,
data
:
[
{
value
:
100
,
itemStyle
:
{
color
:
"#fcfdff"
,
// {
// type: 'linear',
// x: 0,
// y: 0,
// x2: 0,
// y2: 1,
// colorStops: [
// {
// offset: 0,
// color: '##fcfdff',
// },
// {
// offset: 1,
// color: '#fff',
// },
// ],
// },
},
},
],
},
// 底圈2
{
type
:
"pie"
,
zlevel
:
0
,
radius
:
"40%"
,
silent
:
true
,
center
:
[
"50%"
,
"50%"
],
label
:
{
show
:
true
,
},
labelLine
:
{
show
:
false
,
},
animation
:
false
,
data
:
[
{
value
:
100
,
itemStyle
:
{
color
:
"#fff"
,
// {
// type: 'linear',
// x: 0,
// y: 0,
// x2: 0,
// y2: 1,
// colorStops: [
// {
// offset: 0,
// color: '##fcfdff',
// },
// {
// offset: 1,
// color: '#fff',
// },
// ],
// },
},
},
],
},
],
};
},
},
methods
:
{
initChart
()
{
let
Chart
=
echarts
.
init
(
document
.
getElementById
(
"lineTendencyChart"
));
Chart
.
setOption
(
this
.
options
);
this
.
Chart
=
Chart
;
window
.
addEventListener
(
"resize"
,
function
()
{
Chart
.
resize
();
});
},
},
watch
:
{
value
:
{
immediate
:
true
,
handler
(
val
)
{
this
.
$nextTick
(()
=>
{
this
.
initChart
();
});
},
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
#lineTendencyChart
{
width
:
230px
;
height
:
230px
;
}
</
style
>
pages/monthReport/components/tem1.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
class=
"tem1 padding_all_16"
>
<view
class=
"label"
>
{{
item
.
label
}}
</view>
<view
class=
"value"
>
<span>
{{
item
.
value
||
0
}}
</span>
<span
class=
"unit"
>
{{
item
.
unit
||
""
}}
</span>
<span
class=
"upValue"
v-if=
"item.upValue"
>
{{
item
.
upValue
}}
</span>
</view>
<el-row
v-if=
"item.children && item.children.length > 0"
class=
"children"
>
<el-col
v-for=
"(child, j) in item.children"
:key=
"child.label + j"
:span=
"8"
>
<view
class=
"childrenLabel"
>
<span
:style=
"
{ backgroundColor: child.color || '#ccc' }">
</span>
{{
child
.
label
}}
</view>
<view
class=
"childrenValue"
>
{{
child
.
value
||
0
}}
</view>
</el-col>
</el-row>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
item
:
{
typeof
:
Object
,
default
:
()
=>
({}),
},
},
data
()
{
return
{};
},
created
()
{},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.tem1
{
width
:
100%
;
height
:
100%
;
background
:
#f9f9f9
;
border-radius
:
3px
;
cursor
:
pointer
;
.label
{
font-size
:
14px
;
color
:
#000000
;
}
.value
{
font-size
:
22px
;
color
:
#000000
;
margin-top
:
8px
;
.unit
{
font-size
:
14px
;
color
:
#7c7c7c
;
margin-left
:
4px
;
}
.upValue
{
font-size
:
16px
;
color
:
#ef5e59
;
margin-left
:
12px
;
&
.down
{
color
:
#0cc991
;
}
}
}
.children
{
margin-top
:
8px
;
.childrenLabel
{
font-size
:
12px
;
color
:
#7c7c7c
;
span
{
display
:
inline-block
;
width
:
6px
;
height
:
6px
;
border-radius
:
50%
;
margin-right
:
4px
;
}
}
.childrenValue
{
padding-left
:
10px
;
font-size
:
16px
;
color
:
#000000
;
}
}
}
</
style
>
pages/monthReport/components/tem2.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
class=
"tem2"
:style=
"item.style || ''"
>
<view
class=
"label"
>
{{
item
.
label
}}
</view>
<view
class=
"value"
>
<span>
{{
item
.
value
||
0
}}
</span>
<span
class=
"unit"
>
{{
item
.
unit
||
""
}}
</span>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
item
:
{
typeof
:
Object
,
default
:
()
=>
({}),
},
},
data
()
{
return
{};
},
created
()
{},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.tem2
{
width
:
100%
;
height
:
100%
;
padding
:
10px
16px
;
background
:
#f9f9f9
;
border-radius
:
3px
;
cursor
:
pointer
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.label
{
font-size
:
14px
;
color
:
#000000
;
}
.value
{
font-size
:
22px
;
color
:
#000000
;
.unit
{
font-size
:
14px
;
color
:
#7c7c7c
;
margin-left
:
4px
;
}
}
}
</
style
>
pages/monthReport/components/tem3.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
class=
"tem1 padding_all_16"
>
<view
class=
"label"
>
{{
item
.
label
}}
</view>
<view
class=
"value"
>
<span>
{{
item
.
value
||
0
}}
</span>
<span
class=
"unit"
>
{{
item
.
unit
||
""
}}
</span>
<span
class=
"upValue"
v-if=
"item.upValue"
>
{{
item
.
upValue
}}
</span>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
item
:
{
typeof
:
Object
,
default
:
()
=>
({}),
},
},
data
()
{
return
{};
},
created
()
{},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.tem1
{
width
:
100%
;
height
:
100%
;
background
:
#f9f9f9
;
border-radius
:
3px
;
cursor
:
pointer
;
.label
{
font-size
:
14px
;
color
:
#000000
;
}
.value
{
font-size
:
22px
;
color
:
#000000
;
margin-top
:
4px
;
.unit
{
font-size
:
14px
;
color
:
#7c7c7c
;
margin-left
:
4px
;
}
.upValue
{
font-size
:
16px
;
color
:
#ef5e59
;
margin-left
:
12px
;
&
.down
{
color
:
#0cc991
;
}
}
}
}
</
style
>
pages/monthReport/components/tem4.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
class=
"lineItem"
:style=
"item.style || ''"
>
<view
class=
"topContent"
>
<view>
{{
item
.
label
}}
</view>
<view>
{{
item
.
value
}}
%
</view>
</view>
<view
class=
"line"
>
<view
class=
"activeLine"
:style=
"
{
width: item.value + '%',
backgroundColor: item.value >= 60 ? '#00D7A4' : '#F39800',
}"
>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
item
:
{
type
:
Object
,
default
:
()
=>
{},
},
data
:
{
type
:
Object
,
default
:
()
=>
{},
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.lineItem
{
width
:
100%
;
.topContent
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
font-family
:
PingFangSC-Medium
;
font-size
:
14px
;
color
:
#000000
;
line-height
:
22px
;
font-weight
:
500
;
margin-bottom
:
4px
;
}
.line
{
background
:
#f2f2f2
;
width
:
100%
;
height
:
12px
;
position
:
relative
;
.activeLine
{
height
:
12px
;
position
:
absolute
;
z-index
:
99
;
}
}
}
</
style
>
pages/monthReport/config.js
0 → 100644
浏览文件 @
cfe5e0c6
// 终端
export
const
terminal
=
[
{
label
:
'终端数量(已接入)'
,
value
:
1364
,
unit
:
'台'
,
upValue
:
106
,
type
:
'tem1'
,
span
:
8
,
children
:
[
{
label
:
'接入'
,
value
:
10
,
color
:
'#1183F5'
},
{
label
:
'变更'
,
value
:
10
,
color
:
'#F39800'
},
{
label
:
'撤销'
,
value
:
10
,
color
:
'#959595'
},
]
},
{
label
:
'个人证书(使用中)'
,
value
:
1364
,
unit
:
'个'
,
upValue
:
106
,
type
:
'tem1'
,
span
:
8
,
children
:
[
{
label
:
'接入'
,
value
:
10
,
color
:
'#1183F5'
},
{
label
:
'撤销'
,
value
:
10
,
color
:
'#959595'
},
]
},
{
label
:
'单位证书(使用中)'
,
value
:
1364
,
unit
:
'个'
,
upValue
:
106
,
type
:
'tem1'
,
span
:
8
,
children
:
[
{
label
:
'接入'
,
value
:
10
,
color
:
'#1183F5'
},
{
label
:
'变更'
,
value
:
10
,
color
:
'#F39800'
},
{
label
:
'接入'
,
value
:
10
,
color
:
'#959595'
},
]
}
]
// 应用
export
const
application
=
[
{
label
:
'应用数量(监测中)'
,
value
:
1364
,
unit
:
'套'
,
upValue
:
106
,
type
:
'tem1'
,
span
:
24
,
children
:
[
{
label
:
'上线'
,
value
:
10
,
color
:
'#1183F5'
},
{
label
:
'下线'
,
value
:
10
,
color
:
'#959595'
},
]
}
]
// 机房
export
const
computerData
=
[
{
label
:
'设备资产'
,
value
:
1364
,
unit
:
'台'
,
upValue
:
106
,
type
:
'tem1'
,
span
:
12
,
children
:
[
{
label
:
'进入'
,
value
:
10
,
color
:
'#1183F5'
},
{
label
:
'搬出'
,
value
:
10
,
color
:
'#959595'
,
},
]
},
{
type
:
'tem2'
,
span
:
12
,
children
:
[
{
label
:
'机房'
,
value
:
1364
,
unit
:
'个'
,
},
{
label
:
'监测采集器'
,
value
:
1364
,
unit
:
'台'
,
style
:
'margin-top: 16px;'
}
]
}
]
// 数据中心
export
const
dataCenter
=
[
{
label
:
'资源实例'
,
value
:
1364
,
unit
:
'个'
,
upValue
:
106
,
type
:
'tem1'
,
span
:
12
,
children
:
[
{
label
:
'申请'
,
value
:
10
,
color
:
'#1183F5'
},
{
label
:
'释放'
,
value
:
10
,
color
:
'#959595'
},
]
},
{
type
:
'tem4'
,
span
:
12
,
children
:
[
{
label
:
'CPU资源余量'
,
value
:
0
,
unit
:
''
,
},
{
label
:
'内存资源余量'
,
value
:
20
,
unit
:
''
,
style
:
'margin-top: 16px;'
},
{
label
:
'存储资源余量'
,
value
:
80
,
unit
:
''
,
style
:
'margin-top: 16px;'
}
]
}
]
// 网络
export
const
netData
=
[
{
label
:
'网络接入单位'
,
value
:
1364
,
unit
:
'家'
,
upValue
:
106
,
type
:
'tem3'
,
span
:
6
,
},
{
type
:
'tem2'
,
span
:
18
,
children
:
[
{
label
:
'汇聚交换机'
,
value
:
1364
,
unit
:
'台'
,
},
{
label
:
'防火墙'
,
value
:
1364
,
unit
:
'台'
,
},
{
label
:
'核心交换机'
,
value
:
1364
,
unit
:
'台'
,
},
{
label
:
'接入交换机'
,
value
:
1364
,
unit
:
'台'
,
style
:
'margin-top: 16px;'
},
{
label
:
'应用服务器'
,
value
:
1364
,
unit
:
'台'
,
style
:
'margin-top: 16px;'
},
{
label
:
'安全产品服务器'
,
value
:
1364
,
unit
:
'台'
,
style
:
'margin-top: 16px;'
},
]
}
]
// 网络
export
const
userData
=
[
{
label
:
'内网用户'
,
value
:
1364
,
unit
:
'人'
,
upValue
:
106
,
type
:
'tem3'
,
span
:
6
,
},
{
label
:
'涉密用户'
,
value
:
1364
,
unit
:
'人'
,
upValue
:
106
,
type
:
'tem3'
,
span
:
6
,
},
{
label
:
'非涉密用户'
,
value
:
1364
,
unit
:
'人'
,
upValue
:
106
,
type
:
'tem3'
,
span
:
6
,
},
]
// 运维
export
const
ywData
=
[
{
label
:
'告警派单'
,
value
:
1364
,
unit
:
'单'
,
type
:
'tem3'
,
span
:
8
,
},
{
label
:
'人工派单'
,
value
:
1364
,
unit
:
'单'
,
type
:
'tem3'
,
span
:
8
,
},
{
label
:
'电话咨询'
,
value
:
1364
,
unit
:
'单'
,
type
:
'tem3'
,
span
:
8
,
},
]
// fb
export
const
fbData
=
[
{
label
:
'日常备案'
,
value
:
1364
,
unit
:
'个'
,
type
:
'tem3'
,
span
:
8
,
},
{
label
:
'自测任务'
,
value
:
1364
,
unit
:
'次'
,
type
:
'tem3'
,
span
:
8
,
},
{
label
:
'自查自测'
,
value
:
1364
,
unit
:
'次'
,
type
:
'tem3'
,
span
:
8
,
},
]
\ No newline at end of file
pages/monthReport/index.vue
0 → 100644
浏览文件 @
cfe5e0c6
<
template
>
<view
class=
"padding_all_16 page_box"
>
<!--
<common-back
title=
"态势分析研判月报"
/>
-->
<view
class=
"monthReport"
>
<view
class=
"left"
>
<view
class=
"margin_t_16 padding_16_24 background_white"
>
<common-top-title
titletext=
"本月资产监管数据"
:isTitleNormal=
"false"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
:span=
"18"
>
<common-top-title
titletext=
"终端"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in terminal"
:key=
"item.label"
:span=
"item.span"
>
<tem1
:item=
"item"
style=
"height: 137px"
/>
</view>
</view>
</view>
<view
:span=
"6"
>
<common-top-title
titletext=
"应用"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in application"
:key=
"item.label"
:span=
"item.span"
>
<tem1
:item=
"item"
style=
"height: 137px"
/>
</view>
</view>
</view>
</view>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
:span=
"12"
>
<common-top-title
titletext=
"机房"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in computerData"
:key=
"item.label"
:span=
"item.span"
>
<view
v-if=
"item.type == 'tem2'"
class=
"baseFlex"
>
<template
v-for=
"child in item.children"
>
<tem2
:item=
"child"
:key=
"child.label"
style=
"height: 60px"
/>
</
template
>
</view>
<tem1
v-else
:item=
"item"
style=
"height: 137px"
/>
</view>
</view>
</view>
<view
:span=
"12"
>
<common-top-title
titletext=
"数据中心"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in dataCenter"
:key=
"item.label"
:span=
"item.span"
>
<view
v-if=
"item.type == 'tem4'"
class=
"baseFlex"
>
<
template
v-for=
"child in item.children"
>
<tem4
:item=
"child"
:key=
"child.label"
style=
"height: 33px"
/>
</
template
>
</view>
<tem1
v-else
:item=
"item"
style=
"height: 137px"
/>
</view>
</view>
</view>
</view>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
:span=
"24"
>
<common-top-title
titletext=
"网络"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in netData"
:key=
"item.label"
:span=
"item.span"
>
<view
:gutter=
"8"
v-if=
"item.type == 'tem2'"
class=
"baseFlex"
>
<view
v-for=
"child in item.children"
:key=
"child.label"
:span=
"8"
>
<tem2
:item=
"child"
style=
"height: 30px"
/>
</view>
</view>
<tem3
v-else-if=
"item.type == 'tem3'"
:item=
"item"
style=
"height: 76px"
/>
</view>
</view>
</view>
</view>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
:span=
"24"
>
<common-top-title
titletext=
"用户"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in userData"
:key=
"item.label"
:span=
"item.span"
>
<tem3
:item=
"item"
style=
"height: 76px"
/>
</view>
</view>
</view>
</view>
</view>
<view
class=
"margin_t_16 padding_16_24 background_white"
>
<common-top-title
titletext=
"本月运维、分保监管数据"
:isTitleNormal=
"false"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
:span=
"12"
>
<common-top-title
titletext=
"运维"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in ywData"
:key=
"item.label"
:span=
"item.span"
>
<tem3
:item=
"item"
style=
"height: 78px"
/>
</view>
</view>
</view>
<view
:span=
"12"
>
<common-top-title
titletext=
"分保"
:isTitleNormal=
"true"
></common-top-title>
<view
:gutter=
"8"
class=
"margin_t_16"
>
<view
v-for=
"item in fbData"
:key=
"item.label"
:span=
"item.span"
>
<tem3
:item=
"item"
style=
"height: 78px"
/>
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"right"
>
<view
class=
"margin_t_16 padding_16_24 background_white"
>
<common-top-title
titletext=
"态势分析研判报告"
:isTitleNormal=
"false"
></common-top-title>
<view
class=
"rightOne"
>
<rightPie
class=
"margin_t_16 rightPie"
:value=
"80"
/>
<rightItem
class=
"rightItem"
/>
</view>
</view>
<view
class=
"margin_t_16 padding_16_24 background_white rightHeight"
>
<common-top-title
titletext=
"本月场景告警图"
:isTitleNormal=
"false"
></common-top-title>
<rightBar
class=
"margin_t_16"
style=
"width: 100%; height: calc(100% - 32px)"
/>
</view>
<view
class=
"margin_t_16 padding_16_24 background_white rightHeight"
>
<common-top-title
titletext=
"本月场景告警趋势图"
:isTitleNormal=
"false"
></common-top-title>
<rightLine
class=
"margin_t_16"
style=
"width: 100%; height: calc(100% - 32px)"
/>
</view>
</view>
</view>
</view>
</template>
<
script
>
// import commonBack from "@/components_jg/commonBackNeed/index.vue";
import
commonTopTitle
from
"@/components/commonTopTitle/index.vue"
;
import
tem1
from
"./components/tem1.vue"
;
import
tem2
from
"./components/tem2.vue"
;
import
tem3
from
"./components/tem3.vue"
;
import
tem4
from
"./components/tem4.vue"
;
import
rightPie
from
"./components/rightPie.vue"
;
import
rightItem
from
"./components/rightItem.vue"
;
import
rightBar
from
"./components/rightBar.vue"
;
import
rightLine
from
"./components/rightLine.vue"
;
import
{
terminal
,
application
,
computerData
,
dataCenter
,
netData
,
userData
,
ywData
,
fbData
,
}
from
"./config.js"
;
export
default
{
components
:
{
// commonBack,
commonTopTitle
,
tem1
,
tem2
,
tem3
,
tem4
,
rightPie
,
rightItem
,
rightBar
,
rightLine
,
},
data
()
{
return
{
terminal
,
application
,
computerData
,
dataCenter
,
netData
,
userData
,
ywData
,
fbData
,
};
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.page_box
{
background
:
#f2f2f2
;
.monthReport
{
display
:
flex
;
justify-content
:
space-between
;
height
:
calc
(
100vh
-
54px
);
.left
{
width
:
55%
;
height
:
100%
;
}
.right
{
width
:
calc
(
45%
-
16px
);
height
:
100%
;
.rightOne
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.rightPie
{
width
:
230px
;
height
:
230px
;
}
.rightItem
{
width
:
calc
(
100%
-
230px
-
16px
);
height
:
auto
;
}
}
.rightHeight
{
height
:
calc
((
100%
-
300px
-
32px
)
/
2
);
}
}
}
.baseFlex
{
display
:
flex
;
flex-wrap
:
wrap
;
}
.margin_t_16
{
margin-top
:
13px
!
important
;
}
.background_white
{
background-color
:
#fff
;
border-radius
:
3px
;
}
.padding_16_24
{
padding
:
16px
24px
;
}
}
</
style
>
pages/shaftInspection/model/tabContentItem.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"gather-dataCenter"
>
<uni-forms
label-position=
"top"
:modelValue=
"form"
:ref=
"`forms`"
:rules=
"rules"
class=
"inspection-item"
>
<uni-forms
v-for=
"(item, parentIndex) in list"
:key=
"item.dictLabel"
:modelValue=
"item"
label-width=
"82px"
:ref=
"`forms_$
{parentIndex}`"
:rules="rules"
>
<uni-forms-item
class=
"row-item"
label=
"巡检项"
name=
"name"
>
<view
class=
"text"
>
{{
item
.
dictLabel
}}
</view>
</uni-forms-item>
<uni-forms-item
required
class=
"row-item"
label=
"巡检结论"
name=
"name"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.resultArr"
class=
"tag"
:key=
"eleIndex"
@
click=
"tagClick(parentIndex, eleIndex, ele.isActive)"
:class=
"ele.isActive ? 'active-tag' : ''"
>
{{
ele
.
label
}}
</view>
</view>
</uni-forms-item>
<!-- 异常状态时显示 -->
<uni-forms-item
required
class=
"row-item"
label=
"异常定位"
name=
"measuredDataArr"
v-if=
"item.inspectionResult == 1"
>
<view
class=
"tags"
>
<view
v-for=
"(ele, eleIndex) in item.postionList"
class=
"tag"
:key=
"eleIndex"
@
click=
"postionChange(parentIndex, eleIndex, ele.isActive)"
:class=
"
item.measuredDataArr.includes(ele.dictValue) ? 'active-tag' : ''
"
>
{{
ele
.
dictLabel
}}
</view>
</view>
</uni-forms-item>
</uni-forms>
<!-- 结论 -->
<uni-forms-item
required
class=
"row-item textarea-form"
label=
"结论"
name=
"conclusion"
>
<textarea
class=
"textarea"
v-model=
"form.conclusion"
:disabled=
"isDisable"
placeholder-style=
"color:#C7C7C7"
placeholder=
"请输入"
/>
<view>
<text
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</text>
<text
v-if=
"!isDisable"
>
<text
class=
"qucik-text"
v-for=
"item in quickTextList"
:key=
"item.text"
@
click=
"clickQuick(item)"
>
{{
item
.
text
}}
</text
>
</text>
</view>
</uni-forms-item>
</uni-forms>
</view>
</
template
>
<
script
>
import
{
pad_2_1_inspection_items
,
pad_2_1_floor
,
pad_room_type
,
}
from
"@/utils/dict.js"
;
/**
* 汇集机房
*/
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
return
{
list
:
[],
form
:
{
conclusion
:
''
},
rules
:
{
// 对notes字段进行必填验证
notes
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请输入情况摘要"
,
},
],
},
conclusion
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请选择"
,
},
],
},
measuredDataArr
:
{
rules
:
[
{
required
:
true
,
errorMessage
:
"请选择"
,
},
],
},
},
quickTextList
:
[
{
text
:
"全部正常"
,
},
{
text
:
"门禁异常:"
,
},
{
text
:
"卫生异常:"
,
},
{
text
:
"设备告警:"
,
},
{
text
:
"有"
,
},
{
text
:
"无"
,
},
],
// roomTypeLabel: "汇聚机房巡检", // 用于获取类型值
};
},
mounted
()
{
this
.
coverlist
();
},
methods
:
{
// tag 点击事件
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
isActive
||
this
.
isDisable
)
{
return
;
}
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
element
.
isActive
=
false
;
});
const
item
=
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
];
item
.
isActive
=
!
isActive
;
this
.
list
[
parentIndex
].
resultArr
[
eleIndex
]
=
item
;
// 赋值数据
this
.
list
[
parentIndex
].
inspectionResult
=
item
.
value
;
// 记录结论
this
.
list
[
parentIndex
].
postionList
.
forEach
(
(
item
)
=>
(
item
.
isActive
=
false
)
);
this
.
list
[
parentIndex
].
measuredDataArr
=
[];
// 重置异常位置
this
.
list
[
parentIndex
].
notes
=
""
;
// 重置摘要信息
},
// tag 点击事件
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
this
.
isDisable
)
{
return
;
}
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
item
=
postionList
[
eleIndex
];
item
.
isActive
=
!
isActive
;
postionList
[
eleIndex
]
=
item
;
this
.
list
[
parentIndex
].
postionList
=
postionList
;
this
.
list
[
parentIndex
].
measuredDataArr
=
postionList
.
filter
((
item
)
=>
item
.
isActive
)
.
map
((
item
)
=>
item
.
dictValue
);
},
// 数据结构重组
coverlist
()
{
// const roomTypeLabel = this.roomTypeLabel;
// const roomType = pad_room_type.rows.filter(
// (item) => item.dictLabel == roomTypeLabel
// )[0].dictValue;
const
temp
=
pad_2_1_inspection_items
.
rows
.
map
((
item
)
=>
{
return
{
// ...item,
dictLabel
:
item
.
dictLabel
,
dictValue
:
item
.
dictValue
,
notes
:
""
,
// 情况摘要
// roomType,
inspectionResult
:
0
,
// 异常结论
itemCode
:
item
.
dictValue
,
// 检查项 如:门禁
resultArr
:
[
{
value
:
0
,
label
:
"正常"
,
isActive
:
true
,
},
{
value
:
1
,
label
:
"异常"
,
isActive
:
false
,
},
],
measuredData
:
""
,
// 逗号分隔字符串
measuredDataArr
:
[],
// 前端本地使用
postionList
:
pad_2_1_floor
.
rows
.
map
((
item
)
=>
{
return
{
...
item
,
isActive
:
false
,
};
}),
};
});
this
.
list
=
temp
;
},
// 回显数据
setForm
(
componentData
)
{
this
.
list
=
componentData
.
temp
;
if
(
componentData
.
conclusion
)
{
this
.
form
=
{
conclusion
:
componentData
.
conclusion
,
};
}
},
// 获取数据
getForm
()
{
const
temp
=
this
.
list
.
map
((
item
)
=>
{
return
{
...
item
,
measuredData
:
item
.
measuredDataArr
.
join
(
","
),
};
});
return
{
...
this
.
form
,
temp
,
};
},
// 校验数据 所有表单
async
vaildForm
()
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
let
result
=
""
;
this
.
$refs
.
forms
.
validate
()
.
then
((
res
)
=>
{
result
=
true
;
})
.
catch
((
error
)
=>
{
result
=
false
;
});
const
temp
=
this
.
list
.
map
((
item
,
index
)
=>
{
return
this
.
$refs
[
`forms_
${
index
}
`
][
0
]
.
validate
()
.
then
(()
=>
{
return
{
result
:
true
,
index
,
};
})
.
catch
(()
=>
{
return
{
result
:
false
,
item
,
};
});
});
Promise
.
all
(
temp
).
then
((
res
)
=>
{
const
allVaildList
=
res
.
filter
((
item
)
=>
item
.
result
);
const
formData
=
this
.
getForm
();
resolve
({
vaild
:
result
&&
this
.
list
.
length
==
allVaildList
.
length
,
formData
,
});
});
return
;
});
},
clickQuick
(
item
)
{
this
.
form
.
conclusion
=
`
${
this
.
form
.
conclusion
}${
item
.
text
}
`
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.gather-dataCenter {
.inspection-item {
border: 1px solid;
margin-bottom: 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
padding: 24px 24px 8px 24px;
.text {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: bold;
}
}
.row-item {
border-bottom: 1px solid #eee;
padding-bottom: 18px;
margin-bottom: 12px;
&:last-of-type {
// border-bottom: none;
// margin-bottom: 0;
}
.tags {
display: flex;
align-items: center;
.tag {
background: #f2f3f5;
width: 55px;
height: 36px;
border-radius: 10px;
text-align: center;
line-height: 36px;
margin-right: 10px;
font-size: 14px;
color: #4a4a4a;
text-align: center;
font-weight: 400;
}
.active-tag {
background: #3774f6;
color: #fff;
}
}
}
/deep/ .uni-forms-item__content {
display: flex;
align-items: center;
}
.textarea-form {
/deep/ .uni-forms-item__content {
display: block;
}
border-bottom: none;
margin-bottom: 0;
.textarea {
width: 100%;
min-height: 96px;
background: #f7f7f7;
border-radius: 12px;
font-size: 14px;
color: #4a4a4a;
padding: 16px;
font-weight: 400;
margin-bottom: 14px;
}
.quick-input {
margin: 16px 18px 18px 0;
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.qucik-text {
display: inline-block;
border: 1px solid rgba(242, 242, 242, 1);
border-radius: 8px;
padding: 0 10px;
height: 32px;
font-size: 12px;
color: #4a4a4a;
line-height: 20px;
font-weight: 400;
margin-right: 12px;
line-height: 32px;
text-align: center;
}
}
}
</
style
>
pages/shaftInspection/model/tabs.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"tabs-component"
>
<view
class=
"tabs-list"
>
<view
v-for=
"(item, index) in list"
:key=
"item.name"
class=
"tab-item"
@
click=
"tabClick(index, item)"
:class=
"index == activeIndex ? 'active-tab-item' : ''"
>
<text
class=
"iconfont icon-yiwancheng1"
:class=
"item.isVaild ? 'vaild-icon' : ''"
></text>
{{
item
.
name
}}
</view
>
</view>
<!-- 描述 -->
<view
class=
"descript"
>
<view
v-if=
"(list[activeIndex] ||
{}).position" class="descript-item">
<text
class=
"name"
>
巡检位置
</text>
<text
class=
"text"
>
{{
(
list
[
activeIndex
].
position
||
[]).
map
((
item
)
=>
item
.
dictLabel
).
join
(
"、"
)
}}
</text>
</view>
<view
class=
"descript-item"
>
<text
class=
"name"
>
巡检说明
</text>
<text
class=
"text"
>
{{
(
list
[
activeIndex
]
||
{
}
).
descript
}}
<
/text
>
<
/view
>
<
/view
>
<
/view
>
<
/template
>
<
script
>
export
default
{
props
:
{
options
:
{
tyep
:
Array
,
}
,
}
,
data
()
{
return
{
activeIndex
:
0
,
list
:
[],
}
;
}
,
created
()
{
}
,
mounted
()
{
this
.
list
=
this
.
options
;
}
,
watch
:
{
options
(
newData
)
{
this
.
list
=
newData
;
}
,
}
,
methods
:
{
tabClick
(
index
,
item
)
{
this
.
activeIndex
=
index
;
this
.
$emit
(
"change"
,
index
,
item
);
}
,
/**
* 设置单个校验状态
* @param index
* @param vaild
* @param iSwtich 是否自动切换到下一个tab
*/
setTabVaild
(
index
,
vaild
=
false
,
iSwtich
=
true
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
list
[
index
].
isVaild
=
vaild
;
if
(
iSwtich
&&
index
<
this
.
list
.
length
-
1
)
{
this
.
tabClick
(
index
+
1
,
{
}
);
}
resolve
();
}
);
}
,
// 校验所有内容是否填写完成
isAllVails
()
{
return
this
.
list
.
every
((
item
)
=>
{
return
item
.
isVaild
;
}
);
}
,
}
,
}
;
<
/script
>
<
style
lang
=
"less"
scoped
>
.
tabs
-
component
{
.
tabs
-
list
{
display
:
flex
;
align
-
items
:
center
;
margin
-
bottom
:
16
px
;
.
iconfont
{
margin
-
right
:
5
px
;
color
:
#
999
;
font
-
size
:
14
px
;
}
.
tab
-
item
{
margin
-
right
:
24
px
;
font
-
size
:
14
px
;
color
:
#
000000
;
line
-
height
:
22
px
;
font
-
weight
:
400
;
position
:
relative
;
padding
-
bottom
:
5
px
;
&
::
after
{
content
:
" "
;
position
:
absolute
;
bottom
:
0
px
;
width
:
100
%
;
height
:
3
px
;
border
-
radius
:
10
px
;
left
:
0
;
}
}
.
vaild
-
icon
{
color
:
#
3774
f6
;
}
.
active
-
tab
-
item
{
color
:
#
3774
f6
;
&
::
after
{
background
:
#
3774
f6
;
}
}
}
.
descript
{
padding
:
8
px
16
px
;
background
:
#
e0f1ff
;
border
:
0.4
px
solid
rgba
(
224
,
224
,
224
,
1
);
border
-
radius
:
8
px
;
.
descript
-
item
{
font
-
size
:
12
px
;
color
:
#
959595
;
line
-
height
:
28
px
;
font
-
weight
:
400
;
.
name
{
margin
-
right
:
8
px
;
}
.
text
{
color
:
#
000000
;
}
}
}
}
<
/style
>
pages/shaftInspection/shaftInspection.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"shaftInspection"
>
<!-- 导航栏 -->
<uni-nav-bar
:fixed=
"true"
background-color=
"rgba(214, 240, 255, 0.0)"
status-bar
rightWidth=
"300"
>
<block
slot=
"left"
>
<view
class=
"uni-nav-bar-text"
@
click=
"back"
>
<text
class=
"iconfont icon-Arrow-Left"
></text
></view>
</block>
<block
slot=
"right"
>
<view
class=
"nav-right"
>
<view
v-if=
"isOperationPermissions"
class=
"uni-nav-bar-text"
@
click=
"deleteClick"
>
<text
class=
"iconfont icon-delete"
></text
></view>
<view
class=
"look-from"
@
click=
"lookTable"
>
<text
class=
"iconfont icon-see-s"
></text>
查看样表
</view
></view
>
</block>
</uni-nav-bar>
<view
class=
"content"
>
<view
class=
"base-info"
>
<view
class=
"title"
>
{{
baseInfo
.
recordName
}}
</view>
<view
class=
"base-row"
>
<view
class=
"base-row-item"
><text
class=
"name"
>
巡检编号
</text
><text
class=
"text"
>
{{
baseInfo
.
inspectionCode
}}
</text>
</view>
<view
class=
"base-row-item"
><text
class=
"name"
>
巡检时间
</text
><text
class=
"text"
>
{{
baseInfo
.
inspectionTime
}}
</text>
</view>
<view
class=
"base-row-item"
><text
class=
"name"
>
巡检人
</text
><text
class=
"text"
>
{{
baseInfo
.
inspectionBy
}}
</text>
</view>
</view>
<image
class=
"bg-img"
mode=
"aspectFill"
src=
"@/static/img/add-img/inspection_bg.png"
></image>
</view>
<view
class=
"main"
>
<view
class=
"content_header"
>
巡检项目
</view>
<!-- tabls -->
<Tabs
class=
"tabs"
ref=
"tabs"
:options=
"tabList"
@
change=
"changeTab"
/>
<TabContentItem
v-for=
"(item, index) in tabList"
:key=
"index"
:ref=
"item.refName"
v-show=
"activeTabIndex == index"
:isDisable=
"isDisable"
></TabContentItem>
</view>
<view
v-if=
"isOperationPermissions && !isDisable"
class=
"fixed-btns"
>
<view
class=
"button-group"
>
<!-- 保存草稿 0:草稿 1:提交 -->
<view
v-if=
"!detailsInfo.isSubmit || detailsInfo.isSubmit == 0"
class=
"btn-draft btn-class"
@
tap=
"draft(activeTabIndex)"
>
保存草稿
</view>
<view
class=
"btn-class"
@
tap=
"submit"
>
提交
</view>
</view>
</view>
</view>
<!-- 退出账号弹出 -->
<uni-popup
ref=
"inputDialog2"
type=
"dialog"
>
<uni-popup-dialog
ref=
"inputClose2"
mode=
"base"
title=
"确定删除巡检内容?"
@
confirm=
"dialogInputConfirm2"
>
</uni-popup-dialog>
</uni-popup>
</view>
</
template
>
<
script
>
import
moment
from
"moment"
;
import
Tabs
from
"./model/tabs.vue"
;
import
TabContentItem
from
"./model/tabContentItem.vue"
;
import
{
addLog
,
getLogContent
,
LOG_TYPE_ENUM
,
writeDarf
,
writeInspectionData
,
}
from
"@/utils/IoReadingAndWriting.js"
;
import
{
pad_2_1_inspection_position
,
pad_2_1_floor
}
from
"@/utils/dict.js"
;
import
{
getInspectionDetails
,
getDarft
}
from
"@/request/index.js"
;
export
default
{
components
:
{
Tabs
,
TabContentItem
,
},
data
()
{
return
{
tabList
:
[],
activeTabIndex
:
0
,
baseInfo
:
{},
// 基础信息
tempForm
:
{
// 对应每个tab下的数据 [示例 0: 数据]
},
detailsInfo
:
{},
// 详情
isDisable
:
false
,
// 禁用
};
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
isOperationPermissions
()
{
// 是否有操作权限
const
{
uid
,
createByName
}
=
this
.
detailsInfo
;
return
!
uid
||
(
uid
&&
createByName
==
this
.
userInfo
.
user
);
},
},
onLoad
(
options
)
{
this
.
isDisable
=
options
.
isDisable
==
1
?
true
:
false
;
if
(
options
.
uid
)
{
this
.
getDetails
(
options
.
uid
);
}
else
if
(
options
.
isDarf
)
{
// 获取草稿数据
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
this
.
baseInfo
=
darf_data
.
originData
.
baseInfo
;
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
this
.
detailsInfo
=
darf_data
;
uni
.
hideLoading
();
this
.
init
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
}
},
mounted
()
{
this
.
init
();
},
methods
:
{
init
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
tabList
=
pad_2_1_inspection_position
.
rows
.
map
((
item
,
index
)
=>
{
return
{
name
:
item
.
dictLabel
,
value
:
item
.
dictValue
,
isVaild
:
false
,
// 校验通过
// type: 1, // 枚举值
position
:
pad_2_1_floor
.
rows
,
refName
:
`TabContentItem_
${
index
}
`
,
descript
:
"检查内容包括门禁、卫生、设备告警。"
,
};
});
if
(
this
.
detailsInfo
.
inspectionType
)
{
const
fillCheck
=
this
.
detailsInfo
.
fillCheck
.
split
(
","
);
setTimeout
(()
=>
{
this
.
tabList
.
forEach
((
item
,
index
)
=>
{
item
.
isVaild
=
fillCheck
.
includes
(
item
.
value
);
this
.
tempForm
[
index
]
&&
this
.
setComponentData
(
item
.
refName
,
this
.
tempForm
[
index
]);
});
},
500
);
}
else
{
this
.
baseInfo
=
this
.
$store
.
state
.
temp_data
;
}
resolve
();
});
},
// 回显数据
getDetails
(
uid
)
{
uni
.
showLoading
();
getInspectionDetails
(
uid
)
.
then
((
res
)
=>
{
const
detailsInfo
=
res
;
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
detailsInfo
=
detailsInfo
;
this
.
isDisable
=
this
.
isDisable
||
detailsInfo
.
synchronization
==
1
;
// 是否禁用 1:已同步数据 0: 未同步数据
uni
.
hideLoading
();
this
.
init
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
},
// 回显组件数据
setComponentData
(
refName
,
componentData
)
{
this
.
$refs
[
refName
][
0
]
&&
this
.
$refs
[
refName
][
0
].
setForm
(
componentData
);
},
//--弹出对话框
dialogInputConfirm2
()
{
// uni.redirectTo({
// url: "/pages/home/home?tabIndex=1",
// success: () => {
const
userInfo
=
this
.
userInfo
;
const
all_data
=
this
.
$store
.
state
.
all_data
;
const
detailsInfo
=
this
.
detailsInfo
;
const
baseInfo
=
this
.
baseInfo
;
const
tempAllData
=
all_data
.
filter
(
(
element
)
=>
element
.
uid
!=
detailsInfo
.
uid
);
// console.log(
// "---删除内容",
// all_data.filter((element) => element.uid == detailsInfo.uid)
// );
// 更新巡检list
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
tempAllData
);
const
inspectList
=
tempAllData
.
filter
(
(
item
)
=>
item
.
createByName
==
userInfo
.
user
);
writeInspectionData
(
inspectList
,
userInfo
.
user
);
if
(
!
detailsInfo
.
uid
)
{
// 清空草稿数据
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
{});
// 缓存[巡检信息]
writeDarf
(
""
).
then
((
res
)
=>
{
console
.
log
(
"写入草稿文件成功"
);
});
}
// 更新日志
const
log_list
=
this
.
$store
.
state
.
log_list
;
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
delete
,
`
${
baseInfo
.
recordName
}
(
${
baseInfo
.
inspectionCode
}
)`
,
"巡检模块"
);
logContent
.
inspectionType
=
baseInfo
.
inspectionType
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
uni
.
showToast
({
icon
:
`success`
,
title
:
`删除成功`
,
});
uni
.
redirectTo
({
url
:
"/pages/home/home?tabIndex=1"
,
success
()
{
uni
.
hideLoading
();
},
});
// },
// });
},
// 删除
deleteClick
()
{
this
.
$refs
.
inputDialog2
.
open
();
},
// tab选中change 时间
changeTab
(
index
,
item
)
{
this
.
draft
(
this
.
activeTabIndex
,
false
,
false
).
then
(()
=>
{
this
.
activeTabIndex
=
index
;
});
},
lookTable
()
{
uni
.
navigateTo
({
url
:
"/pages/report/sampleTable?isJF=0"
,
});
},
back
()
{
uni
.
navigateBack
();
},
// 处理提交数据
getParams
()
{
const
baseInfo
=
this
.
baseInfo
;
const
tempForm
=
this
.
tempForm
;
const
fillCheck
=
this
.
tabList
.
filter
((
item
)
=>
item
.
isVaild
)
.
map
((
item
)
=>
item
.
value
)
.
join
(
","
);
const
temp
=
this
.
tabList
.
map
((
item
,
index
)
=>
{
const
items
=
((
tempForm
[
index
]
||
{}).
temp
||
[]).
map
((
ele
)
=>
{
return
{
itemCode
:
ele
.
itemCode
,
measuredData
:
ele
.
measuredData
,
inspectionResult
:
ele
.
inspectionResult
,
};
});
// 一个tab栏下的数据,是否有异常
const
isException
=
((
tempForm
[
index
]
||
{}).
temp
||
[]).
filter
(
(
item
)
=>
item
.
inspectionResult
>
0
).
length
?
1
:
0
;
return
{
...
baseInfo
,
isSubmit
:
1
,
conclusion
:
(
tempForm
[
index
]
||
{}).
conclusion
||
""
,
fillCheck
,
position
:
item
.
value
,
isException
,
items
,
};
});
const
item
=
{
...
temp
[
0
],
isSubmit
:
0
,
isException
:
temp
.
filter
((
item
)
=>
item
.
isException
>
0
).
length
?
1
:
0
,
// 总的数据
items
:
[],
synchronization
:
0
,
// 是否导出过
submitTime
:
moment
().
format
(
"yyyy-MM-DD"
),
// 记录提交时间
submitMonth
:
moment
().
format
(
"yyyy-MM"
),
// 记录提交月份
originData
:
{
baseInfo
,
tempForm
,
},
};
item
[
baseInfo
.
inspectionCode
]
=
temp
;
return
item
;
},
// 提交按钮
submit
()
{
this
.
draft
(
this
.
activeTabIndex
,
false
,
false
).
then
(()
=>
{
const
vaild
=
this
.
$refs
.
tabs
.
isAllVails
();
if
(
vaild
)
{
/**
* 校验通过,
* 1.更新 store 数据,
* 2. 巡检list文件
* 3.清空草稿文件数据、store草稿数据
*/
const
params
=
this
.
getParams
();
const
all_data
=
this
.
$store
.
state
.
all_data
;
const
uid
=
this
.
detailsInfo
.
uid
;
params
.
isSubmit
=
1
;
let
logContent
=
""
;
// 新增 or 编辑
if
(
uid
)
{
const
index
=
all_data
.
findIndex
((
element
)
=>
element
.
uid
==
uid
);
params
.
uid
=
uid
;
all_data
[
index
]
=
params
;
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
edit
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
}
else
{
params
.
uid
=
new
Date
().
getTime
();
// 唯一标识 pad 端使用
all_data
.
push
(
params
);
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
add
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
}
// 更新巡检list
const
userInfo
=
this
.
userInfo
;
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
all_data
);
const
inspectList
=
all_data
.
filter
(
(
item
)
=>
item
.
createByName
==
userInfo
.
user
);
writeInspectionData
(
inspectList
,
userInfo
.
user
);
// 更新日志
const
log_list
=
this
.
$store
.
state
.
log_list
;
logContent
.
inspectionType
=
params
.
inspectionType
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
// 清空草稿数据
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
{});
// 缓存[巡检信息]
writeDarf
(
""
).
then
((
res
)
=>
{
console
.
log
(
"写入草稿文件成功"
);
});
// 清空基础缓存信息
this
.
$store
.
commit
(
"SET_TEMP_DATA"
,
{});
// 缓存[巡检信息]
}
uni
.
showToast
({
icon
:
`
${
vaild
?
"success"
:
"error"
}
`
,
title
:
`
${
vaild
?
"提交成功"
:
"请完善填写内容"
}
`
,
});
if
(
!
vaild
)
{
return
;
}
uni
.
redirectTo
({
url
:
"/pages/home/home?tabIndex=1"
,
success
()
{
uni
.
hideLoading
();
},
});
});
},
// 保存草稿按钮
draft
(
activeTabIndex
,
isSave
=
true
,
iSwtich
=
true
)
{
let
refName
=
this
.
tabList
[
activeTabIndex
].
refName
;
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$refs
[
refName
][
0
].
vaildForm
().
then
(({
vaild
,
formData
})
=>
{
this
.
$refs
.
tabs
.
setTabVaild
(
activeTabIndex
,
vaild
,
iSwtich
)
.
then
(()
=>
{
this
.
tempForm
[
activeTabIndex
]
=
formData
;
if
(
isSave
)
{
// 写入草稿文件 更新 store 草稿内容
const
params
=
this
.
getParams
();
params
.
isSubmit
=
0
;
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
params
);
// 缓存[巡检信息]
writeDarf
(
params
).
then
((
res
)
=>
{
console
.
log
(
"写入草稿文件成功"
);
uni
.
showToast
({
icon
:
"success"
,
title
:
"保存草稿成功"
,
});
});
// 新增日志信息
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
darf
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
const
log_list
=
this
.
$store
.
state
.
log_list
;
logContent
.
inspectionType
=
params
.
inspectionType
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
}
resolve
();
});
});
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.shaftInspection {
width: 100%;
height: 100%;
background-image: linear-gradient(
180deg,
#f8fafc 0%,
rgba(255, 255, 255, 0) 91%
);
.content {
position: absolute;
top: 0;
width: 100%;
background-image: linear-gradient(
0deg,
#f3f6fa 0%,
rgba(130, 153, 238, 0.73) 49%,
#5474e8 100%
);
height: calc(100vh - 44px - var(--status-bar-height) - 20px);
background-size: 100% 40rpx;
background-repeat: no-repeat;
padding-bottom: 160px;
.content_header {
font-size: 18px;
color: #000000;
line-height: 26px;
font-weight: 500;
}
.main {
width: 100%;
height: 100%;
overflow: auto;
padding: 20px 0;
position: relative;
padding: 0 20px 20px 20px;
.tabs {
margin: 16px 0;
}
}
}
// 基础信息
.base-info {
height: 170px;
padding: 20px 24px;
background-image: linear-gradient(
90deg,
#e9f7fe 0%,
#dceffe 40%,
#d5ebfd 66%,
#c9e8fe 100%
);
background-repeat: no-repeat;
background-size: 100% 100%;
margin-bottom: 16px;
padding-top: 80px;
position: relative;
.bg-img {
right: 0;
bottom: 0;
position: absolute;
width: 250px;
height: 100px;
}
.title {
font-size: 26px;
color: #000000;
line-height: 34px;
font-weight: 600;
margin-bottom: 16px;
}
.base-row {
display: flex;
align-items: center;
.base-row-item {
margin-right: 32px;
}
}
.name {
font-size: 14px;
color: #7c7c7c;
font-weight: 400;
}
.text {
margin-left: 12px;
font-size: 14px;
color: #000000;
font-weight: 400;
}
}
.fixed-btns {
height: 70px;
background-image: linear-gradient(-87deg, #ecf1f4 3%, #eaf6fc 100%);
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.button-group {
display: flex;
align-items: center;
background-image: linear-gradient(-87deg, #ecf1f4 3%, #eaf6fc 100%);
.btn-class {
width: 180px;
height: 40px;
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
font-size: 18px;
color: #ffffff;
text-align: center;
font-weight: 400;
text-align: center;
line-height: 40px;
margin-right: 24px;
}
.btn-draft {
background: #fff;
border: 1px solid #3773f6;
color: #3773f6;
box-shadow: none;
}
}
}
// 导航栏样式
.uni-nav-bar-text {
height: 36px;
width: 36px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 18px;
border-radius: 50%;
color: #333;
text-align: center;
.iconfont {
font-size: 20px;
line-height: 36px;
}
}
.nav-right {
display: flex;
align-items: center;
.icon-delete {
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
}
.look-from {
margin-left: 12px;
height: 36px;
line-height: 36px;
padding: 0 12px;
background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 10px;
.iconfont {
margin-top: 5px;
margin-right: 5px;
font-size: 14px;
}
}
}
}
</
style
>
pages/synchronousManagement/dialog.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"synchronous-dialog"
>
<view
class=
"synchronous-content"
>
<view
class=
"row-item"
>
<text
class=
"title"
>
待打包数据
</text>
</view>
<view
class=
"row-item count-num"
>
<text
class=
"num"
>
{{
notSynchronizationList
.
length
}}
</text>
<text>
条
</text>
</view>
<view
class=
"operating-instructions"
>
<view
class=
"title"
>
操作说明:
</view>
<view
class=
"instructions-item"
>
1、在PAD端,点击“数据打包”,做好同步准备。
</view>
<view
class=
"instructions-item"
>
2、完成打包后,将PAD直联PC机,等待PC机自动导入需同步记录。
</view>
<view
class=
"instructions-item"
>
3、PC端自动导入完成后,请点击“同步数据”,同步成功后,列表自动刷新展示同步数据;且PAD同步的数据不支持修改。
</view>
</view>
<view
class=
"row-item bottom-row"
>
<button
class=
"button"
:loading=
"loading"
@
click=
"clickHandle"
>
数据打包
</button>
</view>
<!-- 关闭按钮 -->
<div
class=
"close-button"
>
<text
class=
"iconfont icon-a-bianzu16beifen"
@
click=
"close"
></text>
</div>
</view>
</view>
</
template
>
<
script
>
import
{
SYNCHRONIZE_DATA_PAD
,
checkAndCreateDirectory
,
createFileWithPlusIO
,
setSm2
,
USER_FILE_NAME
,
getUserList
,
}
from
"@/utils/systemCofig"
;
import
{
writeInspectionData
,
copyDirectory
,
deleteAllFilesInDirectory
,
addLog
,
getLogContent
,
LOG_TYPE_ENUM
,
}
from
"@/utils/IoReadingAndWriting.js"
;
import
moment
from
"moment"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
{
Base64
}
from
"js-base64"
;
export
default
{
props
:
{
list
:
{
type
:
Array
,
default
:
()
=>
{
return
[];
},
},
},
components
:
{},
data
()
{
return
{
loading
:
false
,
notSynchronizationList
:
[],
// 未同步数据
allList
:
[],
// 所有数据
};
},
mounted
()
{
const
temp
=
[];
this
.
list
.
forEach
((
item
)
=>
{
temp
.
push
(...(
item
.
list
||
[]));
});
this
.
notSynchronizationList
=
temp
.
filter
(
(
item
)
=>
item
.
synchronization
==
0
);
getAllInspections
().
then
((
res
)
=>
{
this
.
allList
=
res
;
});
},
watch
:
{
list
(
newData
)
{
const
temp
=
[];
newData
.
forEach
((
item
)
=>
{
temp
.
push
(...(
item
.
list
||
[]));
});
this
.
notSynchronizationList
=
temp
.
filter
(
(
item
)
=>
item
.
synchronization
==
0
);
},
},
methods
:
{
close
()
{
this
.
$emit
(
"close"
);
},
/**
* 1.生成两个文件. 机房文件 和 井道文件
* 2. 更新巡检数据状态 synchronization 置为 1
* 3. 写入数据
* 读取上一次打包的文件, 复制到 [ history ] 文件夹中
*/
clickHandle
()
{
if
(
this
.
loading
)
return
;
const
directoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/发送数据`
;
const
targetDirectoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/history`
;
checkAndCreateDirectory
(
directoryPath
).
then
(()
=>
{
copyDirectory
(
directoryPath
,
targetDirectoryPath
)
.
then
(()
=>
{
return
deleteAllFilesInDirectory
(
directoryPath
);
})
.
then
(()
=>
{
this
.
coverData
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
duration
:
1000
,
});
});
});
},
// 处理数据
coverData
()
{
const
userName
=
this
.
$store
.
state
.
now_user
.
user
;
const
notSynchronizationList
=
this
.
notSynchronizationList
;
const
allList
=
this
.
allList
;
let
timeStr
=
moment
().
format
(
"yyyy_MM_DD_hh_mm_ss"
);
const
JFXJ_DATA
=
notSynchronizationList
.
filter
((
item
)
=>
item
.
inspectionType
==
1
)
.
map
((
item
)
=>
{
return
{
...
item
,
originData
:
[],
};
});
// 机房数据类型是 1
const
JDXJ_DATA
=
notSynchronizationList
.
filter
((
item
)
=>
item
.
inspectionType
==
2
)
.
map
((
item
)
=>
{
return
item
[
item
.
inspectionCode
];
});
// 井道数据类型是 2
this
.
loading
=
true
;
const
tmepList
=
[];
if
(
JFXJ_DATA
.
length
)
{
let
JFXJ_DATA_FILE_NAME
=
`
${
userName
}
_JFXJ_
${
timeStr
}
.txt`
;
tmepList
.
push
(
this
.
packedData
(
JFXJ_DATA
,
JFXJ_DATA_FILE_NAME
));
}
JDXJ_DATA
.
forEach
((
item
,
index
)
=>
{
let
JDXJ_DATA_FILE_NAME
=
`
${
userName
}
_JDXJ_
${
timeStr
}
_
${
index
}
.txt`
;
tmepList
.
push
(
this
.
packedData
(
item
,
JDXJ_DATA_FILE_NAME
));
});
Promise
.
all
(
tmepList
)
.
then
(()
=>
{
// 更新巡检数据状态
const
synchronizationUids
=
notSynchronizationList
.
map
((
item
)
=>
{
item
.
synchronization
=
1
;
return
item
.
uid
;
});
const
userData
=
{};
allList
.
forEach
((
item
)
=>
{
if
(
synchronizationUids
.
includes
(
item
.
uid
))
{
item
.
synchronization
=
1
;
}
if
(
userData
[
item
.
createByName
])
{
userData
[
item
.
createByName
].
push
(
item
);
}
else
{
userData
[
item
.
createByName
]
=
[
item
];
}
});
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
allList
);
const
keys
=
Object
.
keys
(
userData
);
const
promiseArr
=
keys
.
map
((
key
)
=>
{
const
val
=
userData
[
key
];
return
writeInspectionData
(
val
,
key
);
});
Promise
.
all
(
promiseArr
)
.
then
(()
=>
{
setTimeout
(()
=>
{
uni
.
showToast
({
title
:
"打包成功"
,
icon
:
"none"
,
duration
:
2000
,
});
this
.
close
();
this
.
loading
=
false
;
// 生成日志
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
sys
,
""
,
"同步模块"
);
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
});
// 更新同步时间
this
.
updateSysTime
();
},
2
*
1000
);
})
.
catch
((
error
)
=>
{
this
.
loading
=
false
;
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
duration
:
2000
,
});
});
})
.
catch
(()
=>
{
setTimeout
(()
=>
{
uni
.
showToast
({
title
:
"打包失败"
,
icon
:
"none"
,
duration
:
2000
,
});
this
.
loading
=
false
;
},
2
*
1000
);
});
},
// 打包文件
packedData
(
content
,
fileName
)
{
const
fileContent
=
setSm2
(
content
);
return
createFileWithPlusIO
(
`
${
SYNCHRONIZE_DATA_PAD
}
/发送数据`
,
fileName
,
fileContent
);
},
// 更新最近一次同步时间
updateSysTime
()
{
getUserList
().
then
((
personList
)
=>
{
const
now_user
=
this
.
$store
.
state
.
now_user
;
const
key
=
personList
.
findIndex
(
(
item
)
=>
item
.
userId
==
now_user
.
userId
);
// 更新用户同步时间
const
userInfo
=
personList
[
key
];
const
LastSynchronizationTime
=
moment
().
format
(
"yyyy-MM-DD HH:mm"
);
personList
[
key
].
LastSynchronizationTime
=
LastSynchronizationTime
;
userInfo
.
LastSynchronizationTime
=
LastSynchronizationTime
;
this
.
$store
.
commit
(
"SET_USER"
,
userInfo
);
uni
.
setStorageSync
(
"last_time"
,
userInfo
.
LastSynchronizationTime
||
""
);
// 更新用户数据
const
fileContent
=
JSON
.
stringify
(
Base64
.
encode
(
JSON
.
stringify
(
personList
))
);
uni
.
setStorage
({
key
:
"user_data"
,
data
:
JSON
.
stringify
(
personList
),
fail
:
(
error
)
=>
{
console
.
log
(
"APP.vue 存储数据失败"
,
error
);
},
});
createFileWithPlusIO
(
SYNCHRONIZE_DATA_PAD
,
USER_FILE_NAME
,
fileContent
).
then
(()
=>
{
console
.
log
(
"---用户数据更新成功"
)
}).
catch
(
error
=>
{
console
.
log
(
"---用户数据更新失败"
,
error
)
})
});
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.synchronous-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
.synchronous-content {
padding: 3% 20px 32px 24px;
width: 400px;
height: 60%;
box-sizing: border-box;
background-image: linear-gradient(
-6deg,
#f9ffe7 0%,
#ffffff 12%,
#fcfeff 73%,
#ccf1ff 100%
);
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
position: relative;
.row-item {
display: flex;
align-items: center;
justify-content: center;
}
.title {
font-family: PingFangSC-Medium;
font-size: 18px;
color: #000000;
text-align: center;
line-height: 26px;
font-weight: 500;
}
.count-num {
margin: 5% 0 5% 0;
align-items: flex-end;
.num {
display: inline-block;
font-family: AlibabaPuHuiTi_2_65_Medium;
font-size: 50px;
color: #3774f6;
line-height: 44px;
font-weight: 500;
}
}
.operating-instructions {
margin-bottom: 8%;
.title {
font-size: 13px;
color: #4a4a4a;
line-height: 24px;
font-weight: 600;
text-align: left;
}
.instructions-item {
font-size: 12px;
color: #7c7c7c;
line-height: 22px;
font-weight: 400;
}
}
// 打包按钮
.bottom-row {
position: absolute;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
.button {
display: flex;
align-items: center;
justify-content: center;
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
width: 160px;
height: 40px;
color: #fff;
}
}
// 关闭按钮
.close-button {
position: absolute;
bottom: -40px;
left: 50%;
transform: translateX(-50%);
.iconfont {
color: #fff;
font-size: 24px;
}
}
}
}
</
style
>
pages/synchronousManagement/index.vue
deleted
100644 → 0
浏览文件 @
866e9232
<
template
>
<view
class=
"synchronous-management"
>
<!-- 搜索项 -->
<SearchCom
@
change=
"change"
:hiddenSearch=
"['synchronization']"
/>
<!-- 结果 -->
<view
class=
"synchronous-management-content"
>
<view
class=
"count-tatal"
>
<text
class=
"num"
>
{{
countNum
||
0
}}
条
</text>
<text>
查询结果
</text>
</view>
<view
class=
"month-list"
>
<!-- 每月记录 -->
<view
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
submitTime
||
item
.
time
}}
</view>
<view
class=
"inspect-list"
>
<InspectionItem
v-for=
"ele in item.list"
:key=
"ele.uid"
:details=
"ele"
:isDisable=
"true"
/>
</view>
</view>
<Empty
v-if=
"list.length == 0"
/>
</view>
</view>
<!-- 数据打包 -->
<view
v-show=
"isPackedDataBtn"
class=
"synchronous-button"
@
click=
"openDialog(true)"
>
数据打包
</view
>
<!-- 打包弹窗 -->
<Dialog
v-show=
"isDialog && list.length"
:list=
"list"
@
close=
"openDialog(false)"
></Dialog>
</view>
</
template
>
<
script
>
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
Dialog
from
"./dialog.vue"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
components
:
{
SearchCom
,
InspectionItem
,
Dialog
,
Empty
,
},
data
()
{
return
{
isDialog
:
false
,
//
list
:
[],
// 展示数据
all_data
:
[],
// 所有数据
searchForm
:
{
// 搜索条件
},
countNum
:
0
,
// 统计查询总数
isPackedDataBtn
:
false
,
// 控制打包按钮显示
};
},
mounted
()
{
this
.
init
();
},
computed
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
},
methods
:
{
init
()
{
uni
.
showLoading
();
getAllInspections
()
.
then
((
res
)
=>
{
this
.
all_data
=
res
.
filter
((
item
)
=>
item
.
synchronization
==
0
);
this
.
getList
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
0
==
error
.
code
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
this
.
all_data
=
[];
uni
.
hideLoading
();
});
},
getList
()
{
const
all_data
=
this
.
all_data
||
[];
this
.
isPackedDataBtn
=
all_data
.
filter
((
item
)
=>
item
.
synchronization
==
0
).
length
>
0
;
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
// 第一步: 筛选有效的时间范围
const
timeFrame
=
all_data
.
filter
((
item
)
=>
{
if
(
!
inspectionTime
.
length
)
{
return
true
;
}
else
{
return
(
new
Date
(
startTime
).
getTime
()
<=
new
Date
(
item
.
submitTime
).
getTime
()
&&
new
Date
(
item
.
submitTime
).
getTime
()
<=
new
Date
(
endTime
).
getTime
()
);
}
});
// 属于同一个月的数据 聚合
const
tempAllData
=
{};
timeFrame
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitMonth
]
||
[];
if
(
val
.
length
)
{
tempAllData
[
item
.
submitMonth
].
push
(
item
);
}
else
{
tempAllData
[
item
.
submitMonth
]
=
[
item
];
}
});
const
keys
=
Object
.
keys
(
tempAllData
);
// 第二步: 根据搜索条件过滤
const
list
=
keys
.
map
((
key
)
=>
{
return
{
time
:
key
,
list
:
this
.
coverData
(
tempAllData
[
key
]),
};
});
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
this
.
countNum
+=
item
.
list
.
length
;
});
this
.
list
=
list
;
},
coverData
(
arr
=
[])
{
const
{
isException
=
""
,
inspectionType
=
""
,
synchronization
=
""
,
}
=
this
.
searchForm
;
return
arr
.
filter
((
item
)
=>
{
return
(
(
!
isException
||
isException
==
"all"
||
item
.
isException
==
isException
)
&&
(
!
inspectionType
||
inspectionType
==
"all"
||
item
.
inspectionType
==
inspectionType
)
&&
(
!
synchronization
||
synchronization
==
"all"
||
item
.
synchronization
==
synchronization
)
);
});
},
change
(
e
)
{
this
.
searchForm
=
e
;
this
.
getList
();
},
openDialog
(
show
)
{
this
.
isDialog
=
show
;
if
(
!
show
)
{
this
.
init
();
}
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
.synchronous-management {
padding-top: 16px;
.count-tatal {
margin: 16px 0 8px 0;
font-size: 14px;
color: #4a4a4a;
font-weight: 400;
.num {
font-size: 18px;
color: #3774f6;
line-height: 26px;
font-weight: 600;
margin-right: 5px;
}
}
.synchronous-management-content {
.month-list {
height: calc(100vh - 26px - 16px - 8px - 36px - 62px);
overflow: auto;
padding-bottom: 140px;
.seconed-title {
margin-top: 16px;
font-size: 18px;
color: #000000;
font-weight: bold;
}
.month-record-item {
margin-bottom: 24px;
&:last-of-type {
margin: 0;
}
.inspect-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
.synchronous-button {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 60px;
width: 240px;
height: 48px;
left: 50%;
color: #fff;
transform: translateX(-50%);
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
}
}
</
style
>
utils/systemCofig.js
浏览文件 @
cfe5e0c6
import
{
Base64
}
from
"js-base64"
;
import
{
Base64
}
from
"js-base64"
;
export
const
BASE_PATH
=
"_documents/data/
asmzx
"
;
// 基础路径
export
const
BASE_PATH
=
"_documents/data/
monthReport
"
;
// 基础路径
export
const
SYNCHRONIZE_DATA_PATH
=
"_documents/data/
asmzx
"
;
// 同步数据
export
const
SYNCHRONIZE_DATA_PATH
=
"_documents/data/
monthReport
"
;
// 同步数据
export
const
SYNCHRONIZE_DATA_PAD
=
"_documents/data/
asmzx
/pad"
;
// 存储pad端的生产数据
export
const
SYNCHRONIZE_DATA_PAD
=
"_documents/data/
monthReport
/pad"
;
// 存储pad端的生产数据
export
const
USER_FILE_NAME
=
"userList.txt"
;
// 存储内置用户的文件名
export
const
USER_FILE_NAME
=
"userList.txt"
;
// 存储内置用户的文件名
export
const
FILE_ENUM
=
{
export
const
FILE_ENUM
=
{
// 文件枚举
// 文件枚举
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论