Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
monthReport_smzx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
monthReport_smzx
Commits
01fa8e11
提交
01fa8e11
authored
9月 25, 2024
作者:
邓文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(机房巡检): 加载时间优化
上级
5bcd8979
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
35 行增加
和
10 行删除
+35
-10
App.vue
App.vue
+4
-1
home.vue
pages/home/home.vue
+4
-1
login.vue
pages/login/login.vue
+6
-1
index.js
request/index.js
+14
-0
IoReadingAndWriting.js
utils/IoReadingAndWriting.js
+7
-7
没有找到文件。
App.vue
浏览文件 @
01fa8e11
...
...
@@ -66,7 +66,10 @@ export default {
uni
.
setStorageSync
(
"now_user"
,
this
.
$store
.
state
.
now_user
);
uni
.
setStorageSync
(
"last_time"
,
this
.
$store
.
state
.
now_user
.
LastSynchronizationTime
);
// 清除store 数据
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
{});
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
[]);
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
[]);
},
onUnload
()
{
},
...
...
pages/home/home.vue
浏览文件 @
01fa8e11
...
...
@@ -84,7 +84,7 @@ export default {
{
defaultIcon
:
"iconfont icon-Inspection"
,
isActive
:
false
,
text
:
"
杭州内网机房巡检
"
,
text
:
"
巡检管理
"
,
},
{
defaultIcon
:
"iconfont icon-a-ActivityConfiguration"
,
...
...
@@ -137,6 +137,9 @@ export default {
"last_time"
,
this
.
$store
.
state
.
now_user
.
LastSynchronizationTime
||
""
);
},
});
},
...
...
pages/login/login.vue
浏览文件 @
01fa8e11
...
...
@@ -63,7 +63,12 @@ export default {
},
created
()
{},
onShow
()
{},
mounted
()
{},
mounted
()
{
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
{});
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
[]);
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
[]);
},
// 定义返回退出
onBackPress
(
options
)
{
this
.
backButtonPress
++
;
...
...
request/index.js
浏览文件 @
01fa8e11
...
...
@@ -14,6 +14,13 @@ import lodash from "lodash";
*/
export
const
getAllInspections
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
store
.
state
.
all_data
.
length
){
const
tempRes
=
lodash
.
orderBy
(
store
.
state
.
all_data
,
"creatTime"
,
[
'desc'
]);
const
result
=
lodash
.
orderBy
(
tempRes
,
"synchronization"
,
[
'asc'
]);
resolve
(
result
)
return
;
}
readInspectionData
()
.
then
((
res
)
=>
{
const
tempRes
=
lodash
.
orderBy
(
res
,
"creatTime"
,
[
'desc'
]);
...
...
@@ -34,6 +41,13 @@ export const getAllInspections = () => {
*/
export
const
getLogList
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
store
.
state
.
log_list
.
length
){
const
tempRes
=
lodash
.
orderBy
(
store
.
state
.
log_list
,
"time"
,
"desc"
);
resolve
(
tempRes
)
return
;
}
readLogData
()
.
then
((
res
)
=>
{
const
tempRes
=
lodash
.
orderBy
(
res
,
"time"
,
"desc"
);
...
...
utils/IoReadingAndWriting.js
浏览文件 @
01fa8e11
...
...
@@ -58,6 +58,10 @@ export const addLog = (content) => {
const
fileContent
=
Base64
.
encode
(
JSON
.
stringify
(
temp
));
// 方便验证
// store 更新日志
store
.
commit
(
"SET_LOG_LIST"
,
content
);
createFileWithPlusIO
(
`
${
SYNCHRONIZE_DATA_PAD
}
/日志文件/
${
now_user
.
user
}
`
,
fileName
,
...
...
@@ -147,15 +151,14 @@ export const readDarfData = () => {
*/
export
const
writeInspectionData
=
(
content
,
userName
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// const now_user = store.state.now_user;
let
timeStr
=
moment
().
format
(
"yyyy-MM-DD"
);
// let fileName = `${timeStr}.txt`;
let
fileName
=
`list.txt`
;
const
fileContent
=
Base64
.
encode
(
JSON
.
stringify
(
content
));
// store 更新 巡检数据
store
.
commit
(
"SET_ALL_DATA"
,
content
);
const
fileContent
=
Base64
.
encode
(
JSON
.
stringify
(
content
));
createFileWithPlusIO
(
`
${
SYNCHRONIZE_DATA_PAD
}
/巡检数据/
${
userName
}
`
,
...
...
@@ -385,9 +388,6 @@ export function deleteAllFilesInDirectory(directoryPath) {
});
}
// // 使用示例
// const directoryPath = '_doc/exampleDirectory';
// deleteAllFilesInDirectory(directoryPath);
// 初始化 -- 读取数据文件
export
const
readDirectoryData
=
()
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论