提交 c528b6d4 authored 作者: JaxBBLL's avatar JaxBBLL
...@@ -8,6 +8,7 @@ import assRoomApi from '@/api/assRoom.js' ...@@ -8,6 +8,7 @@ import assRoomApi from '@/api/assRoom.js'
import hoistwayjson from '../../baseData/hoistway.json' import hoistwayjson from '../../baseData/hoistway.json'
import userjson from '../../baseData/user.json' import userjson from '../../baseData/user.json'
import assroomjson from '../../baseData/assroom.json' import assroomjson from '../../baseData/assroom.json'
import fileImport from '@/utils/fileImport.js'
export default { export default {
// app初始化 // app初始化
...@@ -25,8 +26,8 @@ export default { ...@@ -25,8 +26,8 @@ export default {
// 导入用戶文件文件 // 导入用戶文件文件
// await this.importFileData(); // await this.importFileData();
await userApi.saveBatch(userjson) await userApi.saveBatch(userjson)
await hoistwayApi.saveBatch(hoistwayjson) // await hoistwayApi.saveBatch(hoistwayjson)
await assRoomApi.saveBatch(assroomjson) // await assRoomApi.saveBatch(assroomjson)
// 初始化完成通知首页 // 初始化完成通知首页
uni.$emit("initDone", "ok") uni.$emit("initDone", "ok")
uni.hideLoading() uni.hideLoading()
......
...@@ -28,7 +28,8 @@ module.exports = { ...@@ -28,7 +28,8 @@ module.exports = {
], ],
// 巡检记录表 // 巡检记录表
inspectionRecordName: "INSPECTION_RECORD", inspectionRecordName: "INSPECTION_RECORD",
inspectionRecord: [{ inspectionRecord: [
{
field: "id", field: "id",
format: "TEXT NOT NULL", format: "TEXT NOT NULL",
}, },
...@@ -93,7 +94,8 @@ module.exports = { ...@@ -93,7 +94,8 @@ module.exports = {
// 机房、井道信息表 // 机房、井道信息表
assRoomName: "ASS_ROOM", assRoomName: "ASS_ROOM",
assRoom: [{ assRoom: [
{
field: "id", field: "id",
format: "TEXT NOT NULL", format: "TEXT NOT NULL",
}, },
...@@ -166,11 +168,20 @@ module.exports = { ...@@ -166,11 +168,20 @@ module.exports = {
{ {
field: "SHOW", field: "SHOW",
format: "TEXT", format: "TEXT",
},
{
field: "roomFeature",
format: "TEXT",
},
{
field: "dictValue",
format: "TEXT",
} }
], ],
// 楼宇信息 // 楼宇信息
assBuildingName: "ASS_BUILDING", assBuildingName: "ASS_BUILDING",
assBuilding: [{ assBuilding: [
{
field: "id", field: "id",
format: "TEXT NOT NULL", format: "TEXT NOT NULL",
}, },
......
...@@ -15,9 +15,10 @@ export default { ...@@ -15,9 +15,10 @@ export default {
async login(data) { async login(data) {
let sqllitedb = await SqlliteDbUtil.initSqlliteDB() let sqllitedb = await SqlliteDbUtil.initSqlliteDB()
let account = data.account let {
let pwd = data.pwd account,
pwd
} = data
const sql = `select * from ${table.userName} where userName = '${account}'` const sql = `select * from ${table.userName} where userName = '${account}'`
let res = await sqllitedb.selectSQL(sql); let res = await sqllitedb.selectSQL(sql);
...@@ -27,7 +28,7 @@ export default { ...@@ -27,7 +28,7 @@ export default {
msg: '登录成功' msg: '登录成功'
}; };
}, },
async remove(id) { async remove(id) {
if (!id) { if (!id) {
return return
} }
...@@ -47,12 +48,30 @@ async remove(id) { ...@@ -47,12 +48,30 @@ async remove(id) {
async changePwd(data) { async changePwd(data) {
let { let {
userName, userName,
userPwd, oldPwd,
newPwd,
userId userId
} = data } = data
let sqllitedb = await SqlliteDbUtil.initSqlliteDB() let sqllitedb = await SqlliteDbUtil.initSqlliteDB()
let sql = `update ${table.userName} set userPwd = ${userPwd} where userName = '${userName} and userId = '${userId}'`; const [current] = await sqllitedb.selectSQL(
let res = await sqllitedb.executeSQL(sql); `select * from ${table.userName} where userId = '${userId}' and userName = '${userName}'`, [userId,
userName
]
);
if (current.password !== oldPwd) {
return {
data: false,
msg: '原密码错误'
};
}
const update = await sqllitedb.executeSQL(
`UPDATE ${table.userName} SET password = '${newPwd}'
WHERE userId = '${userId}'`
);
return {
data: true,
msg: '恭喜您,密码更新成功。'
};
}, },
async saveBatch(list) { async saveBatch(list) {
......
[ [
{ {
"id": "f7f20d3d78902f8d105e7d62d6e60ba0", "id": "1",
"roomName": "测试机房1", "roomName": "F3内环屏蔽机房",
"roomFeature":"2",
"dictValue": "1",
"show": "0", "show": "0",
"roomDesc": "G座-1层", "roomDesc": "G座-1层",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/25/20de409bc81f48dbbeaeb9c198683ee6_20250325143326A008.jpeg,http://192.168.100.103:8099/profile/upload/2025/03/25/1711459331134717_20250325143340A009.png", "roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/25/20de409bc81f48dbbeaeb9c198683ee6_20250325143326A008.jpeg,http://192.168.100.103:8099/profile/upload/2025/03/25/1711459331134717_20250325143340A009.png",
"delFlag": "0", "delFlag": "0",
"synFlag": 1, "synFlag": 0,
"sort": 1, "sort": 1,
"roomType": 1, "roomType": 1,
"buildingId": "8a02454d00bd9df7bda41f7d1a6c471e", "buildingId": "8a02454d00bd9df7bda41f7d1a6c471e",
"buildingName": "G座", "buildingName": "G座",
"keynoteFlag": 0,
"roomFeature": "1",
"roomArea": "60",
"createBy": "", "createBy": "",
"createTime": 1743593139000, "createTime": 1744009761000,
"updateBy": "", "updateBy": "",
"updateTime": 1743593139000, "updateTime": 1744009761000,
"params": {} "params": {}
}, },
{ {
...@@ -26,6 +31,7 @@ ...@@ -26,6 +31,7 @@
"sort": 1, "sort": 1,
"roomType": 0, "roomType": 0,
"buildingId": "71dbde340369e1188acbbb8307d4504e", "buildingId": "71dbde340369e1188acbbb8307d4504e",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -41,6 +47,7 @@ ...@@ -41,6 +47,7 @@
"sort": 1, "sort": 1,
"roomType": 0, "roomType": 0,
"buildingId": "10", "buildingId": "10",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -56,6 +63,7 @@ ...@@ -56,6 +63,7 @@
"sort": 1, "sort": 1,
"roomType": 0, "roomType": 0,
"buildingId": "cf53d80f01241013d498a9f52d58b793", "buildingId": "cf53d80f01241013d498a9f52d58b793",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -71,6 +79,7 @@ ...@@ -71,6 +79,7 @@
"sort": 1, "sort": 1,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -86,6 +95,7 @@ ...@@ -86,6 +95,7 @@
"delFlag": "0", "delFlag": "0",
"synFlag": 1, "synFlag": 1,
"sort": 2, "sort": 2,
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1742546558000, "createTime": 1742546558000,
"updateBy": "", "updateBy": "",
...@@ -101,6 +111,7 @@ ...@@ -101,6 +111,7 @@
"sort": 2, "sort": 2,
"roomType": 0, "roomType": 0,
"buildingId": "10", "buildingId": "10",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -116,6 +127,7 @@ ...@@ -116,6 +127,7 @@
"sort": 2, "sort": 2,
"roomType": 0, "roomType": 0,
"buildingId": "cf53d80f01241013d498a9f52d58b793", "buildingId": "cf53d80f01241013d498a9f52d58b793",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -131,6 +143,7 @@ ...@@ -131,6 +143,7 @@
"sort": 2, "sort": 2,
"roomType": 0, "roomType": 0,
"buildingId": "71dbde340369e1188acbbb8307d4504e", "buildingId": "71dbde340369e1188acbbb8307d4504e",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -146,6 +159,7 @@ ...@@ -146,6 +159,7 @@
"sort": 2, "sort": 2,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -161,6 +175,7 @@ ...@@ -161,6 +175,7 @@
"sort": 3, "sort": 3,
"roomType": 0, "roomType": 0,
"buildingId": "10", "buildingId": "10",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -176,6 +191,7 @@ ...@@ -176,6 +191,7 @@
"sort": 3, "sort": 3,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -191,6 +207,7 @@ ...@@ -191,6 +207,7 @@
"sort": 3, "sort": 3,
"roomType": 0, "roomType": 0,
"buildingId": "cf53d80f01241013d498a9f52d58b793", "buildingId": "cf53d80f01241013d498a9f52d58b793",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -198,8 +215,10 @@ ...@@ -198,8 +215,10 @@
"params": {} "params": {}
}, },
{ {
"id": "58b0d83a6d34ac1f39d3f6af0123d657", "id": "2",
"roomName": "A2汇聚机房2", "roomName": "F3外环屏蔽机房",
"roomFeature":"2",
"dictValue": "2",
"show": "0", "show": "0",
"roomDesc": "A座3楼", "roomDesc": "A座3楼",
"roomFile": "/profile/upload/2025/03/24/sample_640×426 - 副本_20250324135659A007.JPG", "roomFile": "/profile/upload/2025/03/24/sample_640×426 - 副本_20250324135659A007.JPG",
...@@ -209,6 +228,7 @@ ...@@ -209,6 +228,7 @@
"roomType": 1, "roomType": 1,
"buildingId": "8", "buildingId": "8",
"buildingName": "A座", "buildingName": "A座",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1742804535000, "createTime": 1742804535000,
"updateBy": "", "updateBy": "",
...@@ -224,6 +244,7 @@ ...@@ -224,6 +244,7 @@
"sort": 4, "sort": 4,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -231,8 +252,10 @@ ...@@ -231,8 +252,10 @@
"params": {} "params": {}
}, },
{ {
"id": "9", "id": "3",
"roomName": "F3内环机房", "roomName": "F2汇聚机房",
"roomFeature":"1",
"dictValue": "3",
"show": "0", "show": "0",
"roomDesc": "市民中心A座3楼", "roomDesc": "市民中心A座3楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/20de409bc81f48dbbeaeb9c198683ee6_20250318141902A009.jpeg", "roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/20de409bc81f48dbbeaeb9c198683ee6_20250318141902A009.jpeg",
...@@ -242,6 +265,7 @@ ...@@ -242,6 +265,7 @@
"roomType": 1, "roomType": 1,
"buildingId": "10", "buildingId": "10",
"buildingName": "B座", "buildingName": "B座",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1742799587000, "createTime": 1742799587000,
"updateBy": "", "updateBy": "",
...@@ -249,8 +273,10 @@ ...@@ -249,8 +273,10 @@
"params": {} "params": {}
}, },
{ {
"id": "3e08f060b5fbb94b213be5dff7ee22a7", "id": "4",
"roomName": "泰源8楼", "roomName": " A2汇聚机房",
"roomFeature":"1",
"dictValue": "4",
"show": "0", "show": "0",
"roomDesc": "泰源8楼", "roomDesc": "泰源8楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/27/微信截图_20250327155657_20250327155711A005.png", "roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/27/微信截图_20250327155657_20250327155711A005.png",
...@@ -260,6 +286,7 @@ ...@@ -260,6 +286,7 @@
"roomType": 1, "roomType": 1,
"buildingId": "10", "buildingId": "10",
"buildingName": "B座", "buildingName": "B座",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -275,6 +302,7 @@ ...@@ -275,6 +302,7 @@
"sort": 5, "sort": 5,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -282,8 +310,11 @@ ...@@ -282,8 +310,11 @@
"params": {} "params": {}
}, },
{ {
"id": "10", "id": "5",
"roomName": "A2汇聚机房3", "roomName": "A3屏蔽机房",
"roomFeature":"2",
"dictValue": "5",
"show": "0", "show": "0",
"roomDesc": "市民中心A座4楼", "roomDesc": "市民中心A座4楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/1711459331134717_20250318150705A002.png", "roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/1711459331134717_20250318150705A002.png",
...@@ -293,6 +324,7 @@ ...@@ -293,6 +324,7 @@
"roomType": 1, "roomType": 1,
"buildingId": "10", "buildingId": "10",
"buildingName": "B座", "buildingName": "B座",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1742785634000, "createTime": 1742785634000,
"updateBy": "", "updateBy": "",
...@@ -300,8 +332,10 @@ ...@@ -300,8 +332,10 @@
"params": {} "params": {}
}, },
{ {
"id": "1", "id": "6",
"roomName": "A2汇聚机房4", "roomName": "A-1UPS间",
"roomFeature":"3",
"dictValue": "6",
"show": "0", "show": "0",
"roomDesc": "市民中心A座4楼", "roomDesc": "市民中心A座4楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/1711459331134717_20250318150705A002.png", "roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/1711459331134717_20250318150705A002.png",
...@@ -311,6 +345,7 @@ ...@@ -311,6 +345,7 @@
"roomType": 1, "roomType": 1,
"buildingId": "8", "buildingId": "8",
"buildingName": "A1座", "buildingName": "A1座",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1742785643000, "createTime": 1742785643000,
"updateBy": "", "updateBy": "",
...@@ -326,6 +361,7 @@ ...@@ -326,6 +361,7 @@
"sort": 6, "sort": 6,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -341,6 +377,7 @@ ...@@ -341,6 +377,7 @@
"sort": 7, "sort": 7,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -349,7 +386,9 @@ ...@@ -349,7 +386,9 @@
}, },
{ {
"id": "7", "id": "7",
"roomName": "A2汇聚机房5", "roomName": "B2汇聚机房",
"roomFeature":"1",
"dictValue": "7",
"show": "0", "show": "0",
"roomDesc": "市民中心A座4楼", "roomDesc": "市民中心A座4楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/1711459331134717_20250318150705A002.png", "roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/18/1711459331134717_20250318150705A002.png",
...@@ -359,6 +398,7 @@ ...@@ -359,6 +398,7 @@
"roomType": 1, "roomType": 1,
"buildingId": "10", "buildingId": "10",
"buildingName": "B座", "buildingName": "B座",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1742785651000, "createTime": 1742785651000,
"updateBy": "", "updateBy": "",
...@@ -374,6 +414,7 @@ ...@@ -374,6 +414,7 @@
"sort": 8, "sort": 8,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -389,6 +430,7 @@ ...@@ -389,6 +430,7 @@
"sort": 9, "sort": 9,
"roomType": 0, "roomType": 0,
"buildingId": "8", "buildingId": "8",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1743407833000, "createTime": 1743407833000,
"updateBy": "", "updateBy": "",
...@@ -396,8 +438,73 @@ ...@@ -396,8 +438,73 @@
"params": {} "params": {}
}, },
{ {
"id": "586a67286d9d1d6e737f32d9e42c3054", "id": "8",
"roomName": "测试机房2", "roomName": "C2汇聚机房",
"roomFeature":"1",
"dictValue": "8",
"show": "0",
"roomDesc": "A座-3楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/20/sample_640×426 - 副本_20250320091529A001.JPG",
"delFlag": "0",
"synFlag": 1,
"sort": 9,
"roomType": 1,
"buildingId": "8",
"buildingName": "A1座",
"keynoteFlag": 0,
"createBy": "",
"createTime": 1742785675000,
"updateBy": "",
"updateTime": 1742785675000,
"params": {}
},
{
"id": "9",
"roomName": "D2汇聚机房",
"roomFeature":"1",
"dictValue": "9",
"show": "0",
"roomDesc": "A座-3楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/20/sample_640×426 - 副本_20250320091529A001.JPG",
"delFlag": "0",
"synFlag": 1,
"sort": 9,
"roomType": 1,
"buildingId": "8",
"buildingName": "A1座",
"keynoteFlag": 0,
"createBy": "",
"createTime": 1742785675000,
"updateBy": "",
"updateTime": 1742785675000,
"params": {}
},
{
"id": "10",
"roomName": "E2汇聚机房",
"roomFeature":"1",
"dictValue": "10",
"show": "0",
"roomDesc": "A座-3楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/20/sample_640×426 - 副本_20250320091529A001.JPG",
"delFlag": "0",
"synFlag": 1,
"sort": 9,
"roomType": 1,
"buildingId": "8",
"buildingName": "A1座",
"keynoteFlag": 0,
"createBy": "",
"createTime": 1742785675000,
"updateBy": "",
"updateTime": 1742785675000,
"params": {}
},
{
"id": "11",
"roomName": "F-2UPS间",
"roomFeature":"1",
"dictValue": "11",
"show": "0", "show": "0",
"roomDesc": "A座-3楼", "roomDesc": "A座-3楼",
"roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/20/sample_640×426 - 副本_20250320091529A001.JPG", "roomFile": "http://192.168.100.103:8099/profile/upload/2025/03/20/sample_640×426 - 副本_20250320091529A001.JPG",
...@@ -407,6 +514,7 @@ ...@@ -407,6 +514,7 @@
"roomType": 1, "roomType": 1,
"buildingId": "8", "buildingId": "8",
"buildingName": "A1座", "buildingName": "A1座",
"keynoteFlag": 0,
"createBy": "", "createBy": "",
"createTime": 1742785675000, "createTime": 1742785675000,
"updateBy": "", "updateBy": "",
......
[ { [ {
"userId": 29, "userId": 1,
"userName": "叶一凡", "userName": "姜安平",
"userType": "normal",
"avatar": "",
"password": "Jap@123",
"rememberPwd": "0"
}, {
"userId": 2,
"userName": "段树梁",
"userType": "sys_user",
"avatar": "",
"password": "Dsl@123",
"rememberPwd": "0"
}, {
"userId": 3,
"userName": "孔佳真",
"userType": "sys_user", "userType": "sys_user",
"avatar": "", "avatar": "",
"password": "123456", "password": "Kjz@123",
"rememberPwd": "0" "rememberPwd": "0"
}, { }, {
"userId": 30, "userId": 4,
"userName": "bjqxj", "userName": "钟校明",
"userType": "sys_user", "userType": "sys_user",
"avatar": "", "avatar": "",
"password": "JF85250920", "password": "Zxm@123",
"rememberPwd": "0" "rememberPwd": "0"
}] }]
\ No newline at end of file
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
src="@/static/img/add-img/home1.png" src="@/static/img/add-img/home1.png"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<!-- <view class="change-password" @click="updatePassword" <view class="change-password" @click="updatePassword"
>修改密码</view >修改密码</view
> --> >
</view> </view>
<view class="username">{{ userName }}</view> <view class="username">{{ userName }}</view>
</view> </view>
...@@ -76,24 +76,23 @@ ...@@ -76,24 +76,23 @@
export default { export default {
data() { data() {
return { return {
cards: [ cards: [{
{ image: '../../static/img/jf.png',
image: "../../static/img/jf.png", text: '机房巡检',
text: "机房巡检", url:"/pages/inspectionContent/inspectionContentList?backValue=home"
url: "/pages/inspectionContent/inspectionContentList?backValue=home",
}, },
{ {
image: "../../static/img/jd.png", image: '../../static/img/jd.png',
text: "井道巡检", text: '井道巡检',
url: "/pages/shaftInspection/shaftInspectionList?backValue=home", url:"/pages/shaftInspection/shaftInspectionList?backValue=home"
}, },
{ {
image: "../../static/img/sj.png", image: '../../static/img/sj.png',
text: "设备上架", text: '设备上架',
url: "/pages/listingManagement/index?backValue=home", url: "/pages/listingManagement/index?backValue=home"
}, }
], ],
userName: this.$store.state.now_user.user, userName: this.$store.state.now_user.userName,
}; };
}, },
computed: { computed: {
...@@ -119,10 +118,11 @@ export default { ...@@ -119,10 +118,11 @@ export default {
}); });
}, },
// 三模块卡片跳转页面 // 三模块卡片跳转页面
toList(url) { toList(url){
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
}); });
}, },
// 巡检管理 // 巡检管理
toInspectionManagement() { toInspectionManagement() {
...@@ -155,7 +155,8 @@ export default { ...@@ -155,7 +155,8 @@ export default {
}, },
}); });
}, },
},
}
}; };
</script> </script>
......
<template> <template>
<view class="edit-password"> <view class="edit-password">
<uni-nav-bar <uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="300">
:fixed="true"
background-color="rgba(214, 240, 255, 0.0)"
status-bar
rightWidth="300"
>
<block slot="left"> <block slot="left">
<view class="uni-nav-bar-text" @click="back"> <view class="uni-nav-bar-text" @click="back">
<text class="iconfont icon-fanhui"></text <text class="iconfont icon-fanhui"></text>
></view> </view>
</block> </block>
</uni-nav-bar> </uni-nav-bar>
{{user}}
<view class="edit-main"> <view class="edit-main">
<!-- 占位---不可删除 --> <!-- 占位---不可删除 -->
<view class="seize-seat"> </view> <view class="seize-seat"> </view>
...@@ -23,28 +18,15 @@ ...@@ -23,28 +18,15 @@
<!-- <input type="text" class="uni-input" v-model="user.user" disabled="true" > --> <!-- <input type="text" class="uni-input" v-model="user.user" disabled="true" > -->
<uni-forms ref="form" :modelValue="formData" :rules="rules"> <uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item> <uni-forms-item>
<uni-easyinput <uni-easyinput class="uni-input" v-model="user.userName" :disabled="true"></uni-easyinput>
class="uni-input"
v-model="user.user"
:disabled="true"
></uni-easyinput>
</uni-forms-item> </uni-forms-item>
<uni-forms-item name="oldPd"> <uni-forms-item name="oldPd">
<uni-easyinput <uni-easyinput type="password" class="uni-input" placeholder="原密码" v-model="formData.oldPd">
type="password"
class="uni-input"
placeholder="原密码"
v-model="formData.oldPd"
>
</uni-easyinput> </uni-easyinput>
</uni-forms-item> </uni-forms-item>
<uni-forms-item name="newPd"> <uni-forms-item name="newPd">
<uni-easyinput <uni-easyinput type="password" class="uni-input" placeholder="新密码(密码必须为字母、数字,6-18个字符,区分大小写)"
type="password" v-model="formData.newPd">
class="uni-input"
placeholder="新密码(密码必须为字母、数字,6-18个字符,区分大小写)"
v-model="formData.newPd"
>
</uni-easyinput> </uni-easyinput>
</uni-forms-item> </uni-forms-item>
<button type="primary" class="uni-btn" @click="clickEdit"> <button type="primary" class="uni-btn" @click="clickEdit">
...@@ -58,20 +40,23 @@ ...@@ -58,20 +40,23 @@
</template> </template>
<script> <script>
import getDateTime from "@/common/getdateTime.js"; import getDateTime from "@/common/getdateTime.js";
import { Base64 } from "js-base64"; import {
import { Base64
} from "js-base64";
import {
addLog, addLog,
getLogContent, getLogContent,
LOG_TYPE_ENUM, LOG_TYPE_ENUM,
} from "@/utils/IoReadingAndWriting.js"; } from "@/utils/IoReadingAndWriting.js";
import { import {
SYNCHRONIZE_DATA_PAD, SYNCHRONIZE_DATA_PAD,
createFileWithPlusIO, createFileWithPlusIO,
USER_FILE_NAME, USER_FILE_NAME,
} from "@/utils/systemCofig"; } from "@/utils/systemCofig";
export default { import userApi from '@/api/user.js'
export default {
data() { data() {
return { return {
user: {}, user: {},
...@@ -82,16 +67,13 @@ export default { ...@@ -82,16 +67,13 @@ export default {
}, },
rules: { rules: {
oldPd: { oldPd: {
rules: [ rules: [{
{
required: true, required: true,
errorMessage: "请输入原密码", errorMessage: "请输入原密码",
}, }, ],
],
}, },
newPd: { newPd: {
rules: [ rules: [{
{
required: true, required: true,
errorMessage: "请输入新密码", errorMessage: "请输入新密码",
}, },
...@@ -99,8 +81,7 @@ export default { ...@@ -99,8 +81,7 @@ export default {
{ {
minLength: 6, minLength: 6,
maxLength: 18, maxLength: 18,
errorMessage: errorMessage: "更新失败,密码必须为字母、数字,{minLength}-{maxLength}个字符,区分大小写",
"更新失败,密码必须为字母、数字,{minLength}-{maxLength}个字符,区分大小写",
}, },
], ],
label: "新密码", label: "新密码",
...@@ -113,6 +94,7 @@ export default { ...@@ -113,6 +94,7 @@ export default {
}, },
onShow() { onShow() {
const value = this.$store.state.now_user; const value = this.$store.state.now_user;
console.log(value, '----')
if (value) { if (value) {
this.user = value; this.user = value;
} }
...@@ -141,73 +123,50 @@ export default { ...@@ -141,73 +123,50 @@ export default {
.validate() .validate()
.then((res) => { .then((res) => {
// 输入密码与该账号密码一致 // 输入密码与该账号密码一致
if (this.formData.oldPd == this.user.passWord) { userApi.changePwd({
const userId = this.user.userId; userId: this.user.userId,
const tempPersonList = this.personList.map((item) => { userName: this.user.userName,
if (item.userId == userId) { oldPwd: this.formData.oldPd,
item.passWord = this.formData.newPd; newPwd: this.formData.newPd
} }).then((res) => {
return item; if(res.data){
});
const temp = JSON.stringify(tempPersonList);
const fileContent = JSON.stringify(Base64.encode(temp));
createFileWithPlusIO(
SYNCHRONIZE_DATA_PAD,
USER_FILE_NAME,
fileContent
).then((res) => {
uni.setStorageSync("user_data", temp);
uni.showToast({ uni.showToast({
title: "恭喜您,密码更新成功!", title: "恭喜您,密码更新成功!",
icon: "none", icon: "success",
duration: 2000, duration: 3000,
});
// 生成日志
const logContent = getLogContent(LOG_TYPE_ENUM.updatePassword);
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.logOut(); this.logOut();
}); }else{
} else {
this.formData = {
oldPd: "",
newPd: "",
};
uni.showToast({ uni.showToast({
title: "更新失败,原密码错误,请重新输入!", title: res.msg,
icon: "none", icon: "error",
duration: 2000, duration: 3000,
}); });
} }
});
}) })
.catch((err) => {}); .catch((err) => {});
}, },
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.uni-easyinput__placeholder-class { .uni-easyinput__placeholder-class {
font-size: 14px !important; font-size: 14px !important;
} }
.edit-password { .edit-password {
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;
...@@ -254,14 +213,13 @@ export default { ...@@ -254,14 +213,13 @@ export default {
.seize-seat { .seize-seat {
height: 50px; height: 50px;
width: 100%; width: 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%);
);
} }
// 导航栏样式 // 导航栏样式
.uni-nav-bar-text { .uni-nav-bar-text {
height: 36px; height: 36px;
...@@ -272,10 +230,11 @@ export default { ...@@ -272,10 +230,11 @@ export default {
border-radius: 50%; border-radius: 50%;
color: #333; color: #333;
text-align: center; text-align: center;
.iconfont { .iconfont {
font-size: 20px; font-size: 20px;
line-height: 36px; line-height: 36px;
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -43,11 +43,8 @@ ...@@ -43,11 +43,8 @@
data() { data() {
return { return {
person: { person: {
// user: "bjqxj", account: "姜安平", // 超管账号
// pd: "JF85250920", pwd: "Jap@123",
account: "叶一凡", // 超管账号
pwd: "123456",
}, },
backButtonPress: 0, backButtonPress: 0,
personList: [], personList: [],
...@@ -88,25 +85,20 @@ ...@@ -88,25 +85,20 @@
return true; return true;
}, },
methods: { methods: {
changePwd(){
userApi.changePwd({
userName:'叶一凡',
userPwd:'qwer1234',
userId:'29'
})
},
// 切换密码显示/隐藏 // 切换密码显示/隐藏
togglePasswordVisible() { togglePasswordVisible() {
this.passwordVisible = !this.passwordVisible; this.passwordVisible = !this.passwordVisible;
}, },
// 点击登录 // 点击登录
async login() { async login() {
userApi.login(this.person).then((personList) => { userApi.login(this.person).then((res) => {
this.personList = personList.data; if (res.data) {
this.personList = res.data;
this.$store.commit("SET_USER", this.personList); this.$store.commit("SET_USER", this.personList);
uni.navigateTo({ uni.navigateTo({
url: "/pages/home/home", url: "/pages/home/home",
}); });
}
}); });
}, },
}, },
......
...@@ -9,19 +9,12 @@ ...@@ -9,19 +9,12 @@
// const userFilePath = "/storage/emulated/0/Android/data/io.dcloud.HBuilder/inspect/user/user.json" // const userFilePath = "/storage/emulated/0/Android/data/io.dcloud.HBuilder/inspect/user/user.json"
// const userFilePath = "/storage/emulated/0/Android/data/io.dcloud.HBuilder/inspect/export/" // const userFilePath = "/storage/emulated/0/Android/data/io.dcloud.HBuilder/inspect/export/"
import userApi from '@/api/service/user' import userApi from '@/api/user.js'
import feedbackApi from '@/api/service/feedback' import assroomApi from '@/api/assRoom.js'
import checkDetailApi from '@/api/service/checkDetail' import hoistwayApi from '@/api/hoistway.js'
import templateApi from '@/api/service/feedbackTemplate' import inspectApi from '@/api/inspect.js'
import peopleApi from '@/api/service/peopleConfig'
import sampleApi from '@/api/service/sample'
import presenceApi from '@/api/service/presence'
import doubleRandomApi from '@/api/service/doubleRandom'
import _Path from '@/constant/ioPath' import _Path from '@/constant/ioPath'
import logger from './logger'
import ioUtil from "./ioUtil"; import ioUtil from "./ioUtil";
import dateUtil from "./date";
import cookie from './cookie'
// 检查是否有zip包 // 检查是否有zip包
async function hasCheckFile() { async function hasCheckFile() {
...@@ -31,126 +24,6 @@ async function hasCheckFile() { ...@@ -31,126 +24,6 @@ async function hasCheckFile() {
zipFiles = zipFiles.filter(i => i.name.indexOf('.zip') !== -1); zipFiles = zipFiles.filter(i => i.name.indexOf('.zip') !== -1);
return zipFiles.length; return zipFiles.length;
} }
// 导入检查数据
async function importCheckFile() {
const baseFilePath = _Path.getImportData()
const baseFileEntry = await ioUtil.getFileEntry(baseFilePath)
const unzipPath = baseFileEntry.fullPath + 'unzip/';
const zipFiles = await ioUtil.getFiles(baseFileEntry);
if (!zipFiles || zipFiles.length === 0) {
return
}
// 此处为每次导入的包
for (let zipFile of zipFiles) {
// 解压
if (zipFile.isDirectory || zipFile.name.indexOf('.zip') === -1) {
continue;
}
let dirName = zipFile.name.indexOf('.') > -1 ? zipFile.name.substring(0, zipFile.name.indexOf('.')) : zipFile.name
let unzipDir = unzipPath + dirName + '/'
await ioUtil.removeExistFile(unzipDir)
// 防止解压文件有问题
try{
let errorInfo = await ioUtil.decompressZip(zipFile.fullPath, unzipDir)
if (errorInfo && errorInfo.message) {
const errorDate = dateUtil.parseTime(new Date(), '{y}-{m}-{d}')
await ioUtil.createDir(_Path.getErrorDir(), errorDate)
const errorDirEntry = await ioUtil.getFileEntry(_Path.getErrorDir() + errorDate + '/')
await ioUtil.moveFile(zipFile, errorDirEntry)
}
}catch(e){
console.log(e.message)
}
let unzipDirEntry = await ioUtil.getFileEntry(unzipDir)
let checkZipFiles = await ioUtil.getFiles(unzipDirEntry)
// 导入数据
// 仅仅保证单个完整包不重复导入,单词导出检查数据是一致的
let checkList = []
for (let checkZipEntry of checkZipFiles) {
if (!checkZipEntry.isFile || checkZipEntry.name.indexOf('.zip') === -1) {
continue
}
let filename = ioUtil.getFilenameNoExt(checkZipEntry.name)
if (!filename || checkList.indexOf(filename) > -1) {
continue;
}
checkList.push(filename)
let nameArr = filename.split('_')
let id = nameArr[0]
let checkType = nameArr[1]
let checkPath = unzipDir + checkType + '/' + id
await ioUtil.decompressZip(checkZipEntry.fullPath, checkPath)
// 导入
await importCheck(checkPath, id, checkType)
}
// 处理完毕删除
await ioUtil.removeExistFile(zipFile.fullPath)
await ioUtil.removeExistFile(unzipDirEntry.fullPath)
}
}
// 导入检查
async function importCheck(checkPath, id, checkType) {
const checkDirEntry = await ioUtil.getFileEntry(checkPath)
const files = await ioUtil.getFiles(checkDirEntry)
if (!files || files.length === 0) {
return
}
// 创建附件文件目录
let checkFilePath = _Path.getCheckFileDir() + checkType + '/' + id
await ioUtil.removeExistFile(checkFilePath)
await ioUtil.createDir(_Path.getCheckFileDir(), checkType)
await ioUtil.createDir(_Path.getCheckFileDir() + '/' + checkType, id)
let checkFileEntry = await ioUtil.getFileEntry(checkFilePath)
for (let checkEntry of files) {
if (checkEntry.isFile && checkEntry.name.indexOf('.json') !== -1) {
// 写入数据库
let data = await ioUtil.readFile(checkEntry)
if (!data) {
continue
}
let checkData = JSON.parse(data)
// 把评分结果预先存入缓存,用于判断首页用户是否已评分
let checkScored = cookie.get('checkScored')
if (!checkScored) {
checkScored = {}
cookie.set('checkScored', checkScored)
}
const key = checkData.id + '_' + checkData.checkType
if (checkData.recheck === '1' && checkData.recheckScore) {
checkScored[key] = true
} else if (checkData.recheck === '0' && checkData.firstScore) {
checkScored[key] = true
} else {
checkScored[key] = false
}
cookie.set('checkScored', checkScored)
// 评分
await feedbackApi.saveBatch(checkData.feedbackList)
// 明细
await checkDetailApi.saveBatch(checkData.checkDetailList)
// 检查
if (checkData.checkType === '1') {
await sampleApi.save(checkData)
} else if (checkData.checkType === '2') {
await presenceApi.save(checkData)
} else if (checkData.checkType > 2) {
await doubleRandomApi.save(checkData)
}
} else {
await ioUtil.copyFileDir(checkEntry, checkFileEntry)
}
}
}
// 导入基础数据,包括:用户、人员配置、检查明细、评分表模板等 // 导入基础数据,包括:用户、人员配置、检查明细、评分表模板等
async function importBaseFile() { async function importBaseFile() {
...@@ -166,6 +39,7 @@ async function importBaseFile() { ...@@ -166,6 +39,7 @@ async function importBaseFile() {
await ioUtil.decompressZip(zipFileEntry.fullPath, unzipPath) await ioUtil.decompressZip(zipFileEntry.fullPath, unzipPath)
unzipEntry = await ioUtil.getFileEntry(unzipPath); unzipEntry = await ioUtil.getFileEntry(unzipPath);
} }
debugger
// 导入 // 导入
let fileEntries = [] let fileEntries = []
if (unzipEntry) { if (unzipEntry) {
...@@ -207,7 +81,6 @@ async function importBaseFile() { ...@@ -207,7 +81,6 @@ async function importBaseFile() {
} }
export default { export default {
importCheckFile,
importBaseFile, importBaseFile,
hasCheckFile hasCheckFile
}; };
...@@ -109,7 +109,6 @@ export default class SqlliteDB { ...@@ -109,7 +109,6 @@ export default class SqlliteDB {
// 增删改使用 // 增删改使用
async executeSQL(sql) { async executeSQL(sql) {
await this.checkDB();
// console.log('excuteSQL:' + sql) // console.log('excuteSQL:' + sql)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
plus.sqlite.executeSql({ plus.sqlite.executeSql({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论