Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
monthReport_smzx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
monthReport_smzx
Commits
eb4a4e3e
提交
eb4a4e3e
authored
9月 17, 2024
作者:
邓文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(功能走查): 上次登陆时间的存储时间节点。存在疑问
上级
4b9c8a9d
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
72 行增加
和
150 行删除
+72
-150
App.vue
App.vue
+1
-1
content.vue
pages/home/content.vue
+34
-49
home.vue
pages/home/home.vue
+2
-2
editPd.vue
pages/index/editPd.vue
+14
-89
login.vue
pages/login/login.vue
+21
-9
没有找到文件。
App.vue
浏览文件 @
eb4a4e3e
...
@@ -66,7 +66,7 @@ export default {
...
@@ -66,7 +66,7 @@ export default {
onHide
:
function
()
{
onHide
:
function
()
{
// app关闭时将数据存储到本地缓存
// app关闭时将数据存储到本地缓存
uni
.
setStorageSync
(
"now_user"
,
this
.
$store
.
state
.
now_user
);
uni
.
setStorageSync
(
"now_user"
,
this
.
$store
.
state
.
now_user
);
uni
.
setStorageSync
(
"last_time"
,
this
.
$store
.
state
.
last_time
);
//
uni.setStorageSync("last_time", this.$store.state.last_time);
},
},
onUnload
()
{},
onUnload
()
{},
...
...
pages/home/content.vue
浏览文件 @
eb4a4e3e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
>
HI,欢迎回来
{{
userInfo
.
name
}}{{
userInfo
.
user
}}
!
</view
>
HI,欢迎回来
{{
userInfo
.
name
}}{{
userInfo
.
user
}}
!
</view
>
>
<view
class=
"unit"
>
所属单位:
{{
userInfo
.
unitName
||
"--"
}}
</view>
<view
class=
"unit"
>
所属单位:
{{
userInfo
.
unitName
||
"--"
}}
</view>
<view
class=
"time"
>
上次登录时间:
{{
lastT
ime
||
"--"
}}
</view>
<view
class=
"time"
>
上次登录时间:
{{
userInfo
.
last_t
ime
||
"--"
}}
</view>
<image
<image
class=
"bg-img"
class=
"bg-img"
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
src=
"@/static/img/add-img/home1.png"
src=
"@/static/img/add-img/home1.png"
></image>
></image>
</view>
</view>
<view
class=
"card-item"
>
<view
class=
"card-item"
@
click=
"toSyncPage"
>
<view
class=
"title2x"
>
巡检、报修记录
</view>
<view
class=
"title2x"
>
巡检、报修记录
</view>
<view
class=
"count"
>
<view
class=
"count"
>
<text
class=
"num"
>
{{
syncCount
}}
</text
<text
class=
"num"
>
{{
syncCount
}}
</text
...
@@ -86,25 +86,7 @@ export default {
...
@@ -86,25 +86,7 @@ export default {
},
},
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
:
"同步管理"
,
},
],
isDialog
:
false
,
//
isDialog
:
false
,
//
list
:
[],
// 展示数据
list
:
[],
// 展示数据
all_data
:
[],
// 所有数据
all_data
:
[],
// 所有数据
...
@@ -114,33 +96,14 @@ export default {
...
@@ -114,33 +96,14 @@ export default {
countNum
:
0
,
// 统计查询总数
countNum
:
0
,
// 统计查询总数
syncCount
:
0
,
// 待同步条数
syncCount
:
0
,
// 待同步条数
lastTime
:
""
,
// 上次登陆时间
//
lastTime: "", // 上次登陆时间
};
};
},
},
created
()
{
created
()
{
this
.
lastTime
=
uni
.
getStorageSync
(
"last_time"
)
||
""
;
//
this.lastTime = uni.getStorageSync("last_time") || "";
},
},
mounted
()
{
mounted
()
{
uni
.
showLoading
();
this
.
init
();
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
:
{
computed
:
{
...
@@ -149,6 +112,32 @@ export default {
...
@@ -149,6 +112,32 @@ export default {
},
},
},
},
methods
:
{
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
()
{
initSyncCount
()
{
this
.
syncCount
=
(
this
.
all_data
||
[]).
filter
(
this
.
syncCount
=
(
this
.
all_data
||
[]).
filter
(
...
@@ -157,7 +146,7 @@ export default {
...
@@ -157,7 +146,7 @@ export default {
},
},
// 初始化
// 初始化
ini
t
()
{
getLis
t
()
{
const
all_data
=
this
.
all_data
||
[];
const
all_data
=
this
.
all_data
||
[];
const
tempAllData
=
{};
const
tempAllData
=
{};
...
@@ -223,16 +212,12 @@ export default {
...
@@ -223,16 +212,12 @@ export default {
});
});
},
},
change
(
e
)
{
change
(
e
)
{
console
.
log
(
"----"
,
e
);
this
.
searchForm
=
e
;
this
.
searchForm
=
e
;
this
.
init
();
this
.
init
();
},
},
tabClick
(
item
,
index
)
{
console
.
log
(
"----"
);
this
.
activeTabIndex
=
index
;
},
toIndex
()
{
toIndex
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
...
...
pages/home/home.vue
浏览文件 @
eb4a4e3e
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<!-- 内容区 -->
<!-- 内容区 -->
<view
class=
"right-container"
>
<view
class=
"right-container"
>
<!-- 首页 -->
<!-- 首页 -->
<Content
v-if=
"activeTabIndex == 0"
/>
<Content
v-if=
"activeTabIndex == 0"
@
changeTab=
"tabClick"
/>
<!-- 巡检管理 -->
<!-- 巡检管理 -->
<InspectionManagement
v-if=
"activeTabIndex == 1"
/>
<InspectionManagement
v-if=
"activeTabIndex == 1"
/>
...
@@ -127,7 +127,7 @@ export default {
...
@@ -127,7 +127,7 @@ export default {
success
()
{
success
()
{
_this
.
$store
.
commit
(
"SET_USER"
,
{});
_this
.
$store
.
commit
(
"SET_USER"
,
{});
uni
.
setStorageSync
(
"now_user"
,
this
.
$store
.
state
.
now_user
);
uni
.
setStorageSync
(
"now_user"
,
this
.
$store
.
state
.
now_user
);
uni
.
setStorageSync
(
"last_time"
,
this
.
$store
.
state
.
last_time
);
//
uni.setStorageSync("last_time", this.$store.state.last_time);
uni
.
clearStorage
();
//测试将所有缓存清除
uni
.
clearStorage
();
//测试将所有缓存清除
},
},
...
...
pages/index/editPd.vue
浏览文件 @
eb4a4e3e
...
@@ -142,20 +142,8 @@ export default {
...
@@ -142,20 +142,8 @@ export default {
this
.
$refs
.
form
this
.
$refs
.
form
.
validate
()
.
validate
()
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
// console.log(this.formData.oldPd,this.user.pd)
// 输入密码与该账号密码一致
// 输入密码与该账号密码一致
if
(
this
.
formData
.
oldPd
==
this
.
user
.
passWord
)
{
if
(
this
.
formData
.
oldPd
==
this
.
user
.
passWord
)
{
// this.user.passWord = this.formData.newPd;
// let key = null;
// this.personList.some((item, index) => {
// if (item.id == this.user.id) {
// key = index;
// }
// });
// console.log("---- this.user", this.user)
// 将数组中与当前登录账号ID相同项替换
// this.personList.splice(key, 1, this.user);
const
id
=
this
.
user
.
id
;
const
id
=
this
.
user
.
id
;
const
tempPersonList
=
this
.
personList
.
map
((
item
)
=>
{
const
tempPersonList
=
this
.
personList
.
map
((
item
)
=>
{
if
(
item
.
id
==
id
)
{
if
(
item
.
id
==
id
)
{
...
@@ -164,68 +152,6 @@ export default {
...
@@ -164,68 +152,6 @@ export default {
return
item
;
return
item
;
});
});
// let timeStr = getDateTime.dateTimeStr("y-m-d h:i");
// let operData = {
// name: this.$store.state.now_user.name,
// level: "秘密",
// user: this.$store.state.now_user.user,
// module: "其他",
// detail: "无",
// type: "修改密码",
// time: timeStr,
// };
// this.$store.state.oper_record.unshift(operData);
// 重新存储本地用户信息
// let _this = this;
// plus.io.resolveLocalFileSystemURL(
// "/storage/emulated/0/Android/data/asmzx/pd/", //指定的目录
// function(entry) {
// // 创建或打开文件, fs.root是根目录操作对象,直接fs表示当前操作对象
// entry.getFile(
// 'u.txt', {
// create: true // 文件不存在则创建
// },
// fileEntry => {
// // 文件在手机中的路径
// console.log(fileEntry.fullPath)
// fileEntry.createWriter(writer => {
// let data = _this.$Base64.encode(JSON.stringify(_this
// .personList))
// console.log(data, 123);
// // 写入文件成功完成的回调函数
// writer.onwrite = e => {
// // console.log('写入成功');
// };
// // 向文件中写入数据
// writer.write(
// JSON.stringify(data)
// );
// });
// },
// e => {
// console.log('getFile failed: ' + e.message);
// }
// );
// },
// e => {
// console.log(e.message);
// },
// function(err) {
// console.log("访问指定目录失败:" + err.message);
// });
// uni.setStorageSync('user_data', this.personList)
// uni.showToast({
// title: '恭喜您,密码更新成功!',
// icon: 'none',
// duration: 2000
// })
// this.logOut()
const
temp
=
JSON
.
stringify
(
tempPersonList
);
const
temp
=
JSON
.
stringify
(
tempPersonList
);
const
fileContent
=
JSON
.
stringify
(
Base64
.
encode
(
temp
));
const
fileContent
=
JSON
.
stringify
(
Base64
.
encode
(
temp
));
...
@@ -242,15 +168,14 @@ export default {
...
@@ -242,15 +168,14 @@ export default {
duration
:
2000
,
duration
:
2000
,
});
});
// 生成日志
// 生成日志
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
updatePassword
);
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
updatePassword
);
const
log_list
=
this
.
$store
.
state
.
log_list
;
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
console
.
log
(
"日志文件写入成功"
);
});
});
this
.
logOut
();
this
.
logOut
();
});
});
...
@@ -277,12 +202,12 @@ export default {
...
@@ -277,12 +202,12 @@ export default {
width: 100%;
width: 100%;
height: 100%;
height: 100%;
background-image: linear-gradient(
background-image: linear-gradient(
90deg,
90deg,
#e9f7fe 0%,
#e9f7fe 0%,
#dceffe 40%,
#dceffe 40%,
#d5ebfd 66%,
#d5ebfd 66%,
#c9e8fe 100%
#c9e8fe 100%
);
);
.edit-main {
.edit-main {
margin-top: -44px;
margin-top: -44px;
...
...
pages/login/login.vue
浏览文件 @
eb4a4e3e
...
@@ -32,6 +32,8 @@ import {
...
@@ -32,6 +32,8 @@ import {
createFileWithPlusIO
,
createFileWithPlusIO
,
TEST
,
TEST
,
TEST_2X
,
TEST_2X
,
USER_FILE_NAME
,
}
from
"@/utils/systemCofig"
;
}
from
"@/utils/systemCofig"
;
import
{
import
{
...
@@ -42,6 +44,8 @@ import {
...
@@ -42,6 +44,8 @@ import {
readLogData
,
readLogData
,
}
from
"@/utils/IoReadingAndWriting.js"
;
}
from
"@/utils/IoReadingAndWriting.js"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
import
{
Base64
}
from
"js-base64"
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -50,11 +54,11 @@ export default {
...
@@ -50,11 +54,11 @@ export default {
data
()
{
data
()
{
return
{
return
{
person
:
{
person
:
{
user
:
"bjqxj"
,
//
user: "bjqxj",
pd
:
"JF85250920"
,
//
pd: "JF85250920",
//
user: "hzsgjy", // 超管账号
user
:
"hzsgjy"
,
// 超管账号
//
pd: "JFXJ85250920",
pd
:
"JFXJ85250920"
,
},
},
backButtonPress
:
0
,
backButtonPress
:
0
,
personList
:
[],
personList
:
[],
...
@@ -72,7 +76,7 @@ export default {
...
@@ -72,7 +76,7 @@ export default {
uni
.
setStorageSync
(
"oper_record"
,
this
.
$store
.
state
.
oper_record
);
uni
.
setStorageSync
(
"oper_record"
,
this
.
$store
.
state
.
oper_record
);
uni
.
setStorageSync
(
"all_data"
,
this
.
$store
.
state
.
all_data
);
uni
.
setStorageSync
(
"all_data"
,
this
.
$store
.
state
.
all_data
);
uni
.
setStorageSync
(
"now_user"
,
this
.
$store
.
state
.
now_user
);
uni
.
setStorageSync
(
"now_user"
,
this
.
$store
.
state
.
now_user
);
uni
.
setStorageSync
(
"last_time"
,
this
.
$store
.
state
.
last_time
);
//
uni.setStorageSync("last_time", this.$store.state.last_time);
plus
.
runtime
.
quit
();
plus
.
runtime
.
quit
();
}
else
{
}
else
{
plus
.
nativeUI
.
toast
(
"再划一次退出应用"
);
plus
.
nativeUI
.
toast
(
"再划一次退出应用"
);
...
@@ -142,10 +146,18 @@ export default {
...
@@ -142,10 +146,18 @@ export default {
this
.
person
.
pd
==
this
.
personList
[
key
].
passWord
this
.
person
.
pd
==
this
.
personList
[
key
].
passWord
)
{
)
{
const
last_time
=
moment
().
format
(
"yyyy-MM-DD HH:mm:ss"
);
const
last_time
=
moment
().
format
(
"yyyy-MM-DD HH:mm:ss"
);
this
.
$store
.
commit
(
"SET_USER"
,
this
.
personList
[
key
]);
this
.
personList
[
key
].
last_time
=
last_time
;
uni
.
setStorageSync
(
"now_user"
,
this
.
personList
[
key
]);
this
.
$store
.
commit
(
"SET_TIME"
,
last_time
);
const
userInfo
=
this
.
personList
[
key
];
uni
.
setStorageSync
(
"last_time"
,
last_time
);
this
.
$store
.
commit
(
"SET_USER"
,
userInfo
);
uni
.
setStorageSync
(
"now_user"
,
userInfo
);
const
fileContent
=
JSON
.
stringify
(
Base64
.
encode
(
this
.
personList
));
createFileWithPlusIO
(
SYNCHRONIZE_DATA_PAD
,
USER_FILE_NAME
,
fileContent
);
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/home/home"
,
url
:
"/pages/home/home"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论