Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
monthReport_smzx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
monthReport_smzx
Commits
3bb66450
提交
3bb66450
authored
11月 21, 2024
作者:
邓文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(文件读取): 文件读取
上级
4669d370
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
103 行增加
和
89 行删除
+103
-89
App.vue
App.vue
+0
-3
index.vue
components/searchCom/index.vue
+9
-56
pages.json
pages.json
+0
-0
home.vue
pages/home/home.vue
+11
-19
rightPie.vue
pages/monthReport/components/rightPie.vue
+2
-6
index.vue
pages/monthReport/index.vue
+32
-4
index.js
request/index.js
+23
-1
portrait.png
static/img/portrait.png
+0
-0
index.js
store/index.js
+9
-0
IoReadingAndWriting.js
utils/IoReadingAndWriting.js
+17
-0
没有找到文件。
App.vue
浏览文件 @
3bb66450
<
script
>
<
script
>
import
{
import
{
BASE_PATH
,
SYNCHRONIZE_DATA_PATH
,
SYNCHRONIZE_DATA_PAD
,
SYNCHRONIZE_DATA_PAD
,
checkAndCreateDirectory
,
checkAndCreateDirectory
,
checkFileExists
,
checkFileExists
,
...
@@ -13,7 +11,6 @@ import {
...
@@ -13,7 +11,6 @@ import {
import
{
Base64
}
from
"js-base64"
;
import
{
Base64
}
from
"js-base64"
;
import
{
differenceBy
}
from
"lodash"
;
import
{
differenceBy
}
from
"lodash"
;
import
{
readDirectoryData
}
from
"@/utils/IoReadingAndWriting.js"
;
export
default
{
export
default
{
onLaunch
:
function
()
{
onLaunch
:
function
()
{
// #ifdef APP-PLUS
// #ifdef APP-PLUS
...
...
components/searchCom/index.vue
浏览文件 @
3bb66450
...
@@ -2,52 +2,18 @@
...
@@ -2,52 +2,18 @@
<view
class=
"search-com"
>
<view
class=
"search-com"
>
<view
class=
"search-com-left"
>
<view
class=
"search-com-left"
>
<uni-data-select
<uni-data-select
v-if=
"!hiddenSearch.includes('inspectionType')"
class=
"uni-search-item"
class=
"uni-search-item"
v-model=
"searchFrom.
inspectionTyp
e"
v-model=
"searchFrom.
reportTim
e"
:localdata=
"inspectArr"
:localdata=
"inspectArr"
@
change=
"(e) => change(e, '
inspectionTyp
e')"
@
change=
"(e) => change(e, '
reportTim
e')"
placeholder=
"
巡检类型:全部
"
placeholder=
"
选择月份
"
:clear=
"true"
:clear=
"true"
:key=
"new Date().getTime()"
:key=
"new Date().getTime()"
></uni-data-select>
></uni-data-select>
<uni-data-select
v-if=
"!hiddenSearch.includes('synchronization')"
class=
"uni-search-item"
v-model=
"searchFrom.synchronization"
:localdata=
"synchronization"
placeholder=
"是否同步:全部"
@
change=
"(e) => change(e, 'synchronization')"
:clear=
"true"
:key=
"new Date().getTime()"
></uni-data-select>
<uni-data-select
v-if=
"!hiddenSearch.includes('isException')"
class=
"uni-search-item"
v-model=
"searchFrom.isException"
:localdata=
"exceptionArr"
placeholder=
"有无异常:全部"
@
change=
"(e) => change(e, 'isException')"
:clear=
"true"
:key=
"new Date().getTime()"
></uni-data-select>
</view>
</view>
<view
class=
"search-com-right"
v-if=
"!hiddenSearch.includes('inspectionTime')"
>
<uni-datetime-picker
class=
"uni-datetime-picker"
type=
"daterange"
v-model=
"searchFrom.inspectionTime"
:border=
"false"
@
change=
"(e) => change(e, 'inspectionTime')"
/>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -64,27 +30,14 @@ export default {
...
@@ -64,27 +30,14 @@ export default {
data
()
{
data
()
{
return
{
return
{
searchFrom
:
{
searchFrom
:
{
inspectionType
:
""
,
// 巡检类型
reportTime
:
"202410"
,
synchronization
:
""
,
// 同部数据
isException
:
""
,
// 有无异常
inspectionTime
:
""
,
// 时间选择
},
},
inspectArr
:
[
inspectArr
:
[
{
value
:
"all"
,
text
:
"全部"
},
{
value
:
"202410"
,
text
:
"2024年10月"
},
{
value
:
"1"
,
text
:
"机房巡检"
},
{
value
:
"202411"
,
text
:
"2024年11月"
},
{
value
:
"2"
,
text
:
"井道巡检"
},
],
synchronization
:
[
{
value
:
"all"
,
text
:
"全部"
},
{
value
:
"0"
,
text
:
"未同步"
},
{
value
:
"1"
,
text
:
"已同步"
},
],
exceptionArr
:
[
{
value
:
"all"
,
text
:
"全部"
},
{
value
:
"1"
,
text
:
"有异常"
},
{
value
:
"0"
,
text
:
"无异常"
},
],
],
};
};
},
},
methods
:
{
methods
:
{
...
@@ -104,7 +57,7 @@ export default {
...
@@ -104,7 +57,7 @@ export default {
.search-com-left {
.search-com-left {
display: flex;
display: flex;
align-items: center;
align-items: center;
flex: 1
;
width: 200px
;
.uni-search-item {
.uni-search-item {
margin-right: 12px;
margin-right: 12px;
width: 130px;
width: 130px;
...
...
pages.json
浏览文件 @
3bb66450
pages/home/home.vue
浏览文件 @
3bb66450
...
@@ -2,18 +2,17 @@
...
@@ -2,18 +2,17 @@
<view
class=
"home-page"
>
<view
class=
"home-page"
>
<view
class=
"left-tab"
>
<view
class=
"left-tab"
>
<view
class=
"user-info"
>
<view
class=
"user-info"
>
<image
class=
"user-img"
src=
"@/static/img/add-img/home1.png"
></image>
<view
class=
"user-img"
>
<image
src=
"@/static/img/portrait.png"
></image>
</view>
<text
class=
"text"
>
{{
userName
}}
</text>
<text
class=
"text"
>
{{
userName
}}
</text>
</view>
</view>
<view
class=
"button-group"
>
<view
class=
"button-group"
>
<!--
<view
class=
"log-button"
@
click=
"updatePassword"
>
修改密码?
</view>
<!--
<view
class=
"log-button"
@
click=
"updatePassword"
>
修改密码?
</view>
<view
class=
"log-button"
@
click=
"lookLog"
>
操作日志
</view>
-->
<view
class=
"log-button"
@
click=
"lookLog"
>
操作日志
</view>
-->
<view
class=
"reset-password-button"
@
click=
"updatePassword"
<view
class=
"reset-password-button"
@
click=
"updatePassword"
>
修改密码?
</view
>
修改密码?
</view
>
>
...
@@ -23,7 +22,6 @@
...
@@ -23,7 +22,6 @@
<!-- 内容区 -->
<!-- 内容区 -->
<view
class=
"right-container"
>
<view
class=
"right-container"
>
<MonthReport
/>
<MonthReport
/>
<RouterView
/>
<RouterView
/>
</view>
</view>
...
@@ -43,16 +41,15 @@
...
@@ -43,16 +41,15 @@
<
script
>
<
script
>
import
OperLog
from
"@/pages/index/operLog.vue"
;
import
OperLog
from
"@/pages/index/operLog.vue"
;
import
MonthReport
from
"@/pages/monthReport/index.vue"
import
MonthReport
from
"@/pages/monthReport/index.vue"
;
export
default
{
export
default
{
components
:
{
components
:
{
OperLog
,
OperLog
,
MonthReport
MonthReport
,
},
},
data
()
{
data
()
{
return
{
return
{
userName
:
this
.
$store
.
state
.
now_user
.
user
,
userName
:
this
.
$store
.
state
.
now_user
.
user
,
};
};
},
},
...
@@ -61,12 +58,8 @@ export default {
...
@@ -61,12 +58,8 @@ export default {
return
this
.
$store
.
state
.
now_user
.
isAdmin
;
return
this
.
$store
.
state
.
now_user
.
isAdmin
;
},
},
},
},
onLoad
(
options
=
{})
{
onLoad
(
options
=
{})
{},
watch
:
{},
},
watch
:
{
},
methods
:
{
methods
:
{
// 修改密码
// 修改密码
updatePassword
()
{
updatePassword
()
{
...
@@ -80,7 +73,6 @@ export default {
...
@@ -80,7 +73,6 @@ export default {
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/index/operLog"
,
url
:
"/pages/index/operLog"
,
});
});
},
},
//退出--弹出对话框
//退出--弹出对话框
...
@@ -95,9 +87,6 @@ export default {
...
@@ -95,9 +87,6 @@ export default {
"last_time"
,
"last_time"
,
this
.
$store
.
state
.
now_user
.
LastSynchronizationTime
||
""
this
.
$store
.
state
.
now_user
.
LastSynchronizationTime
||
""
);
);
},
},
});
});
},
},
...
@@ -106,7 +95,6 @@ export default {
...
@@ -106,7 +95,6 @@ export default {
this
.
$refs
.
inputDialog2
.
open
();
this
.
$refs
.
inputDialog2
.
open
();
},
},
toIndex
()
{
toIndex
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/index/index"
,
url
:
"/pages/index/index"
,
...
@@ -146,6 +134,10 @@ export default {
...
@@ -146,6 +134,10 @@ export default {
border-radius: 50%;
border-radius: 50%;
overflow: hidden;
overflow: hidden;
box-shadow: 5px 5px 10px #e7e7e7;
box-shadow: 5px 5px 10px #e7e7e7;
image{
height: 48px;
width: 48px;
}
}
}
.text {
.text {
font-size: 16px;
font-size: 16px;
...
...
pages/monthReport/components/rightPie.vue
浏览文件 @
3bb66450
...
@@ -22,12 +22,10 @@ export default {
...
@@ -22,12 +22,10 @@ export default {
value
:
{
value
:
{
type
:
Number
,
type
:
Number
,
default
:
0
,
default
:
0
,
}
}
,
},
},
data
()
{
data
()
{
return
{
return
{};
};
},
},
onLoad
()
{},
onLoad
()
{},
...
@@ -36,7 +34,6 @@ export default {
...
@@ -36,7 +34,6 @@ export default {
let
dataTmp
=
this
.
value
||
0
;
let
dataTmp
=
this
.
value
||
0
;
let
max
=
100
;
let
max
=
100
;
let
min
=
0
;
let
min
=
0
;
let
scoresPercentage
=
dataTmp
/
max
;
let
name
=
"健康指数"
;
let
name
=
"健康指数"
;
return
{
return
{
backgroundColor
:
"#fff"
,
backgroundColor
:
"#fff"
,
...
@@ -115,7 +112,6 @@ export default {
...
@@ -115,7 +112,6 @@ export default {
//底部点位名称
//底部点位名称
detail
:
{
detail
:
{
show
:
false
,
show
:
false
,
},
},
data
:
[
data
:
[
{
{
...
...
pages/monthReport/index.vue
浏览文件 @
3bb66450
<
template
>
<
template
>
<view
class=
"padding_all_16 page_box"
>
<view
class=
"padding_all_16 page_box"
>
<SearchCom
@
change=
"searchChange"
/>
<!-- 态势分析研判报告 -->
<!-- 态势分析研判报告 -->
<view
class=
"margin_t_16 padding_16_24 background_white"
>
<view
class=
"margin_t_16 padding_16_24 background_white"
>
<common-top-title
<common-top-title
...
@@ -9,7 +12,7 @@
...
@@ -9,7 +12,7 @@
<view
class=
"rightOne"
>
<view
class=
"rightOne"
>
<rightPie
<rightPie
class=
"margin_t_16 rightPie"
class=
"margin_t_16 rightPie"
:value=
"detailData.report_value"
:value=
"detailData.report_value
"
/>
/>
<rightItem
:detailData=
"detailData"
class=
"rightItem"
/>
<rightItem
:detailData=
"detailData"
class=
"rightItem"
/>
</view>
</view>
...
@@ -280,7 +283,11 @@ import rightPie from "./components/rightPie.vue";
...
@@ -280,7 +283,11 @@ import rightPie from "./components/rightPie.vue";
import
rightItem
from
"./components/rightItem.vue"
;
import
rightItem
from
"./components/rightItem.vue"
;
import
rightBar
from
"./components/rightBar.vue"
;
import
rightBar
from
"./components/rightBar.vue"
;
import
rightLine
from
"./components/rightLine.vue"
;
import
rightLine
from
"./components/rightLine.vue"
;
import
{
mergeObjectsWithUnderscoreKey
}
from
"./_monthReportUtil.js"
import
{
mergeObjectsWithUnderscoreKey
}
from
"./_monthReportUtil.js"
;
import
{
getReportList
}
from
"@/request/index.js"
;
import
SearchCom
from
"@/components/searchCom/index.vue"
import
{
import
{
terminal
,
terminal
,
...
@@ -305,6 +312,7 @@ export default {
...
@@ -305,6 +312,7 @@ export default {
rightItem
,
rightItem
,
rightBar
,
rightBar
,
rightLine
,
rightLine
,
SearchCom
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -318,16 +326,36 @@ export default {
...
@@ -318,16 +326,36 @@ export default {
fbData
,
fbData
,
detailData
:
{},
//数据详情
detailData
:
{},
//数据详情
allReport
:
[],
// 所有汇报数据
defaultReportTime
:
"202410"
,
// 默认选中时间
};
};
},
},
created
()
{
created
()
{
this
.
getDetailData
();
getReportList
().
then
((
res
)
=>
{
this
.
allReport
=
res
.
map
(
item
=>
JSON
.
parse
(
item
))
this
.
getDetailData
(
this
.
defaultReportTime
)
});
},
},
methods
:
{
methods
:
{
getDetailData
()
{
getDetailData
(
reportTime
)
{
// const result = this.allReport.filter(item => item.data.reportTime == reportTime)[0]
// console.log("--result-", result)
// this.detailData = mergeObjectsWithUnderscoreKey(result.data);
this
.
detailData
=
mergeObjectsWithUnderscoreKey
(
result
);
this
.
detailData
=
mergeObjectsWithUnderscoreKey
(
result
);
},
},
// 搜索 change
searchChange
(
val
){
console
.
log
(
"searchItem"
,
val
)
this
.
getDetailData
(
val
.
reportTime
)
}
},
},
};
};
</
script
>
</
script
>
...
...
request/index.js
浏览文件 @
3bb66450
...
@@ -2,7 +2,8 @@ import store from "../store/index";
...
@@ -2,7 +2,8 @@ import store from "../store/index";
import
{
import
{
readLogData
,
readLogData
,
readInspectionData
,
readInspectionData
,
readDarfData
readDarfData
,
readReportData
}
from
"@/utils/IoReadingAndWriting.js"
;
}
from
"@/utils/IoReadingAndWriting.js"
;
import
lodash
from
"lodash"
;
import
lodash
from
"lodash"
;
...
@@ -99,3 +100,24 @@ export const getDarft = () => {
...
@@ -99,3 +100,24 @@ export const getDarft = () => {
})
})
})
})
}
}
// 获取所有月报数据
export
const
getReportList
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
store
.
state
.
reportList
.
length
){
resolve
(
store
.
state
.
reportList
)
return
;
}
readReportData
()
.
then
((
res
)
=>
{
store
.
commit
(
"SET_REPORT_LIST"
,
res
);
resolve
(
res
)
})
.
catch
((
error
)
=>
{
reject
(
error
)
})
})
}
static/img/portrait.png
0 → 100644
浏览文件 @
3bb66450
差异被折叠。
点击展开。
store/index.js
浏览文件 @
3bb66450
...
@@ -21,6 +21,8 @@ const store = new Vuex.Store({
...
@@ -21,6 +21,8 @@ const store = new Vuex.Store({
flgObj
:
false
,
flgObj
:
false
,
roomNum
:
null
,
roomNum
:
null
,
startTime
:
""
,
startTime
:
""
,
reportList
:
[],
// 所有月报数据
},
},
mutations
:
{
mutations
:
{
SET_STARTTIME
(
state
,
payload
)
{
SET_STARTTIME
(
state
,
payload
)
{
...
@@ -71,6 +73,13 @@ const store = new Vuex.Store({
...
@@ -71,6 +73,13 @@ const store = new Vuex.Store({
// 保存 日志文件
// 保存 日志文件
state
.
log_list
=
payload
;
state
.
log_list
=
payload
;
},
},
SET_REPORT_LIST
(
state
,
payload
)
{
// 保存 月报数据
state
.
reportList
=
payload
;
},
},
},
});
});
...
...
utils/IoReadingAndWriting.js
浏览文件 @
3bb66450
...
@@ -410,3 +410,20 @@ export const readDirectoryData = () => {
...
@@ -410,3 +410,20 @@ export const readDirectoryData = () => {
});
});
});
});
};
};
// 读取报告数据
export
const
readReportData
=
()
=>
{
const
directoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/reportData`
return
new
Promise
((
resolve
,
reject
)
=>
{
readFilesInDirectory
(
directoryPath
)
.
then
((
res
)
=>
{
resolve
(
lodash
.
flattenDeep
(
res
));
})
.
catch
((
error
)
=>
reject
(
error
));
});
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论