提交 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()
......
...@@ -27,190 +27,201 @@ module.exports = { ...@@ -27,190 +27,201 @@ module.exports = {
}, },
], ],
// 巡检记录表 // 巡检记录表
inspectionRecordName: "INSPECTION_RECORD", inspectionRecordName: "INSPECTION_RECORD",
inspectionRecord: [{ inspectionRecord: [
field: "id", {
format: "TEXT NOT NULL", field: "id",
}, format: "TEXT NOT NULL",
{ },
field: "inspectionType", {
format: "TEXT", field: "inspectionType",
}, format: "TEXT",
{ },
field: "recordName", {
format: "TEXT", field: "recordName",
}, format: "TEXT",
{ },
field: "userId", {
format: "TEXT", field: "userId",
}, format: "TEXT",
{ },
field: "userName", {
format: "TEXT", field: "userName",
}, format: "TEXT",
{ },
field: "inspectionTime", {
format: "TEXT", field: "inspectionTime",
}, format: "TEXT",
{ },
field: "inspectionCode", {
format: "TEXT", field: "inspectionCode",
}, format: "TEXT",
{ },
field: "synFlag", {
format: "TEXT", field: "synFlag",
}, format: "TEXT",
},
{
field: "createTime", {
format: "TEXT", field: "createTime",
}, format: "TEXT",
{ },
field: "createBy", {
format: "TEXT", field: "createBy",
}, format: "TEXT",
{ },
field: "updateTime", {
format: "TEXT", field: "updateTime",
}, format: "TEXT",
{ },
field: "updateBy", {
format: "TEXT", field: "updateBy",
}, format: "TEXT",
{ },
field: "delFlag", {
format: "TEXT", field: "delFlag",
}, format: "TEXT",
{ },
field: "isException", {
format: "TEXT", field: "isException",
}, format: "TEXT",
{ },
field: "inspectionData", {
format: "TEXT", field: "inspectionData",
} format: "TEXT",
], }
],
// 机房、井道信息表
assRoomName: "ASS_ROOM", // 机房、井道信息表
assRoom: [{ assRoomName: "ASS_ROOM",
field: "id", assRoom: [
format: "TEXT NOT NULL", {
}, field: "id",
format: "TEXT NOT NULL",
{ },
field: "roomName",
format: "TEXT", {
}, field: "roomName",
{ format: "TEXT",
field: "buildingId", },
format: "TEXT", {
}, field: "buildingId",
format: "TEXT",
{ },
field: "buildingName",
format: "TEXT", {
}, field: "buildingName",
{ format: "TEXT",
field: "roomType", },
format: "TEXT", {
}, field: "roomType",
{ format: "TEXT",
field: "roomFile", },
format: "TEXT", {
}, field: "roomFile",
{ format: "TEXT",
field: "roomAddress", },
format: "TEXT", {
}, field: "roomAddress",
{ format: "TEXT",
field: "keynoteFlag", },
format: "TEXT", {
}, field: "keynoteFlag",
{ format: "TEXT",
field: "sort", },
format: "TEXT", {
}, field: "sort",
{ format: "TEXT",
field: "roomDesc", },
format: "TEXT", {
}, field: "roomDesc",
{ format: "TEXT",
field: "remark", },
format: "TEXT", {
}, field: "remark",
{ format: "TEXT",
field: "createTime", },
format: "TEXT", {
}, field: "createTime",
{ format: "TEXT",
field: "createBy", },
format: "TEXT", {
}, field: "createBy",
{ format: "TEXT",
field: "updateTime", },
format: "TEXT", {
}, field: "updateTime",
{ format: "TEXT",
field: "updateBy", },
format: "TEXT", {
}, field: "updateBy",
{ format: "TEXT",
field: "delFlag", },
format: "TEXT", {
}, field: "delFlag",
{ format: "TEXT",
field: "synFlag", },
format: "TEXT", {
}, field: "synFlag",
{ format: "TEXT",
field: "SHOW", },
format: "TEXT", {
} field: "SHOW",
], format: "TEXT",
// 楼宇信息 },
assBuildingName: "ASS_BUILDING", {
assBuilding: [{ field: "roomFeature",
field: "id", format: "TEXT",
format: "TEXT NOT NULL", },
}, {
field: "dictValue",
{ format: "TEXT",
field: "buildingName", }
format: "TEXT", ],
}, // 楼宇信息
assBuildingName: "ASS_BUILDING",
{ assBuilding: [
field: "sort", {
format: "TEXT", field: "id",
}, format: "TEXT NOT NULL",
{ },
field: "remark",
format: "TEXT", {
}, field: "buildingName",
{ format: "TEXT",
field: "createTime", },
format: "TEXT",
}, {
{ field: "sort",
field: "createBy", format: "TEXT",
format: "TEXT", },
}, {
{ field: "remark",
field: "updateTime", format: "TEXT",
format: "TEXT", },
}, {
{ field: "createTime",
field: "updateBy", format: "TEXT",
format: "TEXT", },
}, {
{ field: "createBy",
field: "delFlag", format: "TEXT",
format: "TEXT", },
}, {
{ field: "updateTime",
field: "synFlag", format: "TEXT",
format: "TEXT", },
} {
] field: "updateBy",
format: "TEXT",
},
{
field: "delFlag",
format: "TEXT",
},
{
field: "synFlag",
format: "TEXT",
}
]
}; };
\ No newline at end of file
...@@ -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>
...@@ -74,88 +74,89 @@ ...@@ -74,88 +74,89 @@
<script> <script>
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.userName,
userName: this.$store.state.now_user.user, };
}; },
}, computed: {
computed: { isAdmin() {
isAdmin() { return this.$store.state.now_user.isAdmin;
return this.$store.state.now_user.isAdmin; },
}, },
}, methods: {
methods: { // 修改密码
// 修改密码 updatePassword() {
updatePassword() { uni.navigateTo({
uni.navigateTo({ url: "/pages/index/editPd",
url: "/pages/index/editPd", });
}); },
}, //退出
//退出 logOut() {
logOut() { this.$refs.inputDialog2.open();
this.$refs.inputDialog2.open(); },
}, // 查看操作日志
// 查看操作日志 lookLog() {
lookLog() { uni.navigateTo({
uni.navigateTo({ url: "/pages/index/operLog",
url: "/pages/index/operLog", });
}); },
}, // 三模块卡片跳转页面
// 三模块卡片跳转页面 toList(url){
toList(url) { uni.navigateTo({
uni.navigateTo({ url: url,
url: url, });
});
}, },
// 巡检管理 // 巡检管理
toInspectionManagement() { toInspectionManagement() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/inspectionManagement/index?backValue=home", url: "/pages/inspectionManagement/index?backValue=home",
}); });
}, },
toListingManagement() { toListingManagement() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/listingManagement/index?backValue=home", url: "/pages/listingManagement/index?backValue=home",
}); });
}, },
// 井道巡检 // 井道巡检
toShaftInspection() { toShaftInspection() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew?backValue=home", url: "/pages/shaftInspection/shaftInspectionNew?backValue=home",
}); });
}, },
//退出--弹出对话框 //退出--弹出对话框
dialogInputConfirm2() { dialogInputConfirm2() {
uni.redirectTo({ uni.redirectTo({
url: "/pages/login/login", url: "/pages/login/login",
success: () => { success: () => {
// uni.clearStorage(); //测试将所有缓存清除 // uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user); uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync( uni.setStorageSync(
"last_time", "last_time",
this.$store.state.now_user.LastSynchronizationTime || "" this.$store.state.now_user.LastSynchronizationTime || ""
); );
}, },
}); });
}, },
},
}
}; };
</script> </script>
......
差异被折叠。
...@@ -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: [],
...@@ -61,7 +58,7 @@ ...@@ -61,7 +58,7 @@
return this.passwordVisible ? "密码" : "********"; return this.passwordVisible ? "密码" : "********";
}, },
}, },
created() {}, created() {},
onShow() {}, onShow() {},
async mounted() { async mounted() {
...@@ -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.$store.commit("SET_USER", this.personList); this.personList = res.data;
uni.navigateTo({ this.$store.commit("SET_USER", this.personList);
url: "/pages/home/home", uni.navigateTo({
}); 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论