Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
monthReport_smzx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
monthReport_smzx
Commits
2a537883
提交
2a537883
authored
9月 17, 2024
作者:
邓文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(数据获取): 模拟接口的形式获取数据
上级
6a65e0f4
显示空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
791 行增加
和
334 行删除
+791
-334
App.vue
App.vue
+4
-56
index.vue
components/empty/index.vue
+24
-0
index.vue
components/inspectionItem/index.vue
+11
-4
content.vue
pages/home/content.vue
+183
-8
operLog.vue
pages/index/operLog.vue
+20
-5
inspFirst.vue
pages/inspection/inspFirst.vue
+1
-60
inspectionContent.vue
pages/inspectionContent/inspectionContent.vue
+39
-5
batteryRoom.vue
pages/inspectionContent/model/batteryRoom.vue
+0
-1
gatherDataCenter.vue
pages/inspectionContent/model/gatherDataCenter.vue
+0
-2
shieldedComputerRoom.vue
pages/inspectionContent/model/shieldedComputerRoom.vue
+0
-1
index.vue
pages/inspectionManagement/index.vue
+140
-7
login.vue
pages/login/login.vue
+17
-60
tabContentItem.vue
pages/shaftInspection/model/tabContentItem.vue
+1
-2
shaftInspection.vue
pages/shaftInspection/shaftInspection.vue
+35
-5
synchronization.vue
pages/synchronization/synchronization.vue
+0
-43
dialog.vue
pages/synchronousManagement/dialog.vue
+1
-2
index.vue
pages/synchronousManagement/index.vue
+42
-15
index.js
request/index.js
+106
-0
index.js
store/index.js
+4
-12
IoReadingAndWriting.js
utils/IoReadingAndWriting.js
+57
-23
common.js
utils/common.js
+5
-0
systemCofig.js
utils/systemCofig.js
+101
-23
没有找到文件。
App.vue
浏览文件 @
2a537883
...
@@ -12,9 +12,7 @@ import {
...
@@ -12,9 +12,7 @@ import {
}
from
"./utils/systemCofig"
;
}
from
"./utils/systemCofig"
;
import
{
Base64
}
from
"js-base64"
;
import
{
Base64
}
from
"js-base64"
;
import
{
import
{
readDirectoryData
}
from
"@/utils/IoReadingAndWriting.js"
;
readDirectoryData
}
from
"@/utils/IoReadingAndWriting.js"
;
export
default
{
export
default
{
onLaunch
:
function
()
{
onLaunch
:
function
()
{
// #ifdef APP-PLUS
// #ifdef APP-PLUS
...
@@ -56,68 +54,18 @@ export default {
...
@@ -56,68 +54,18 @@ export default {
},
},
function
(
e
)
{}
function
(
e
)
{}
);
);
// #endif
// if (!uni.getStorageSync("all_data")) {
// uni.setStorageSync("all_data", []);
// } else {
// this.$store.state.all_data = uni.getStorageSync("all_data");
// }
// if (!uni.getStorageSync("last_time")) {
// uni.setStorageSync("last_time", "");
// } else {
// // console.log('有数据',2);
// this.$store.state.last_time = uni.getStorageSync("last_time");
// }
// if (!uni.getStorageSync("oper_record")) {
// uni.setStorageSync("oper_record", []);
// } else {
// // console.log('有数据',3);
// this.$store.state.oper_record = uni.getStorageSync("oper_record");
// }
// if (
// uni.getStorageSync("now_user") &&
// JSON.stringify(uni.getStorageSync("now_user")) !== "{}"
// ) {
// this.$store.commit("SET_USER", uni.getStorageSync("now_user"));
// } else {
// uni.navigateTo({
// url: "/pages/login/login",
// });
// }
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// console.log(
const
now_user
=
uni
.
getStorageSync
(
"now_user"
)
||
{};
// "-onShowonShowonShowonShowonShowonShowonShowonShowonShowonShow-----"
if
(
now_user
.
name
)
{
// );
// this.init();
const
now_user
=
uni
.
getStorageSync
(
"now_user"
)
||
{}
if
(
now_user
.
name
){
this
.
$store
.
commit
(
"SET_USER"
,
now_user
);
this
.
$store
.
commit
(
"SET_USER"
,
now_user
);
console
.
log
(
'----------------------------------------------------'
)
readDirectoryData
()
}
}
// this.$store.state.all_data = uni.getStorageSync("all_data") || []
// this.$store.state.darf_data = uni.getStorageSync("darf_data") || {}
// this.$store.state.last_time = uni.getStorageSync("last_time") || ""
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// app关闭时将数据存储到本地缓存
// app关闭时将数据存储到本地缓存
// uni.setStorageSync("darf_data", this.$store.state.darf_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
);
console
.
log
(
"--onHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHide---"
)
// uni.clearStorage(); //测试将所有缓存清除
},
},
onUnload
()
{},
onUnload
()
{},
methods
:
{
methods
:
{
...
...
components/empty/index.vue
0 → 100644
浏览文件 @
2a537883
<
template
>
<view
class=
"empty-components"
>
暂无数据
</view>
</
template
>
<
script
>
export
default
{
name
:
'Empty'
,
props
:
{
text
:
{
type
:
String
,
default
:
''
}
}
}
</
script
>
<
style
scoped
lang=
"less"
>
.empty-components{
}
</
style
>
\ No newline at end of file
components/inspectionItem/index.vue
浏览文件 @
2a537883
...
@@ -45,6 +45,9 @@ export default {
...
@@ -45,6 +45,9 @@ export default {
details
:
{
details
:
{
type
:
Object
,
type
:
Object
,
},
},
isDisable
:
{
type
:
Boolean
,
},
},
},
methods
:
{
methods
:
{
getLabel
(
val
)
{
getLabel
(
val
)
{
...
@@ -58,13 +61,17 @@ export default {
...
@@ -58,13 +61,17 @@ export default {
toPage
()
{
toPage
()
{
const
url
=
const
url
=
this
.
details
.
inspectionType
==
1
this
.
details
.
inspectionType
==
1
?
"/pages/inspectionContent/inspectionContent"
?
`/pages/inspectionContent/inspectionContent?isDisable=
${
:
"/pages/shaftInspection/shaftInspection"
;
this
.
isDisable
?
1
:
0
}
`
:
`/pages/shaftInspection/shaftInspection?isDisable=
${
this
.
isDisable
?
1
:
0
}
`
;
console
.
log
(
" this.details"
,
this
.
details
.
uid
);
console
.
log
(
" this.details"
,
url
,
this
.
details
);
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`
${
url
}
?
uid=
${
this
.
details
.
uid
}
`
,
url
:
`
${
url
}
&
uid=
${
this
.
details
.
uid
}
`
,
});
});
},
},
},
},
...
...
pages/home/content.vue
浏览文件 @
2a537883
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
<!-- 内容区 -->
<!-- 内容区 -->
<view
class=
"card-list"
>
<view
class=
"card-list"
>
<view
class=
"card-item"
>
<view
class=
"card-item"
>
<view
class=
"title"
>
HI,欢迎回来巡检员001!
</view>
<view
class=
"title"
<view
class=
"unit"
>
所属单位:浙江泰源科技有限公司
</view>
>
HI,欢迎回来
{{
userInfo
.
name
}}{{
userInfo
.
user
}}
!
</view
<view
class=
"time"
>
上次登录时间:2024-08-24
</view>
>
<view
class=
"unit"
>
所属单位:
{{
userInfo
.
unitName
||
"--"
}}
</view>
<view
class=
"time"
>
上次登录时间:
{{
lastTime
||
"--"
}}
</view>
<image
<image
class=
"bg-img"
class=
"bg-img"
...
@@ -15,7 +17,10 @@
...
@@ -15,7 +17,10 @@
</view>
</view>
<view
class=
"card-item"
>
<view
class=
"card-item"
>
<view
class=
"title2x"
>
巡检、报修记录
</view>
<view
class=
"title2x"
>
巡检、报修记录
</view>
<view
class=
"count"
>
<text
class=
"num"
>
12
</text>
条
</view>
<view
class=
"count"
>
<text
class=
"num"
>
{{
syncCount
}}
</text
>
条
</view>
<view
class=
"button-text"
<view
class=
"button-text"
><text>
待同步
</text>
><text>
待同步
</text>
<view
class=
"iconfont icon-Arrow-Right"
></view>
<view
class=
"iconfont icon-Arrow-Right"
></view>
...
@@ -27,7 +32,7 @@
...
@@ -27,7 +32,7 @@
src=
"@/static/img/add-img/home2.png"
src=
"@/static/img/add-img/home2.png"
></image>
></image>
</view>
</view>
<view
class=
"card-item card-item3x"
>
<view
class=
"card-item card-item3x"
@
click=
"toPage"
>
<view
class=
"title"
>
开始巡检
</view>
<view
class=
"title"
>
开始巡检
</view>
<view
class=
"button-text"
<view
class=
"button-text"
><text>
进入
</text>
><text>
进入
</text>
...
@@ -46,22 +51,38 @@
...
@@ -46,22 +51,38 @@
<view
class=
"month-list"
>
<view
class=
"month-list"
>
<!-- 每月记录 -->
<!-- 每月记录 -->
<view
class=
"month-record-item"
v-for=
"item in 20"
:key=
"item"
>
<view
<view
class=
"seconed-title"
>
2024年08月
</view>
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
time
}}
</view>
<view
class=
"inspect-list"
>
<view
class=
"inspect-list"
>
<InspectionItem
/>
<InspectionItem
v-for=
"ele in item.list"
:key=
"ele.inspectionCode"
:details=
"ele"
/>
</view>
</view>
</view>
</view>
<Empty
v-if=
"list.length == 0"
/>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
{
getAllInspections
,
getDarft
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
export
default
{
components
:
{
components
:
{
InspectionItem
,
InspectionItem
,
Empty
,
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -83,9 +104,131 @@ export default {
...
@@ -83,9 +104,131 @@ export default {
text
:
"同步管理"
,
text
:
"同步管理"
,
},
},
],
],
isDialog
:
false
,
//
list
:
[],
// 展示数据
all_data
:
[],
// 所有数据
searchForm
:
{
// 搜索条件
},
countNum
:
0
,
// 统计查询总数
syncCount
:
0
,
// 待同步条数
lastTime
:
""
,
// 上次登陆时间
};
};
},
},
created
()
{
this
.
lastTime
=
uni
.
getStorageSync
(
"last_time"
)
||
""
;
},
mounted
()
{
uni
.
showLoading
();
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
:
{
userInfo
()
{
return
this
.
$store
.
state
.
now_user
||
{};
},
},
methods
:
{
methods
:
{
// 待同步数据
initSyncCount
()
{
this
.
syncCount
=
(
this
.
all_data
||
[]).
filter
(
(
item
)
=>
item
.
synchronization
==
0
).
length
;
},
// 初始化
init
()
{
const
all_data
=
this
.
all_data
||
[];
const
tempAllData
=
{};
all_data
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitTime
]
||
[];
if
(
val
.
length
)
{
tempAllData
[
item
.
submitTime
].
push
(
item
);
}
else
{
tempAllData
[
item
.
submitTime
]
=
[
item
];
}
});
const
keys
=
Object
.
keys
(
tempAllData
);
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
// 第一步: 筛选有效的时间范围
const
timeFrame
=
keys
.
filter
((
key
)
=>
{
if
(
!
inspectionTime
.
length
)
{
return
true
;
}
else
{
return
(
new
Date
(
startTime
).
getTime
()
<=
new
Date
(
key
).
getTime
()
&&
new
Date
(
key
).
getTime
()
<=
new
Date
(
endTime
).
getTime
()
);
}
});
// 第二步: 根据搜索条件过滤
const
list
=
timeFrame
.
map
((
key
)
=>
{
return
{
time
:
key
,
list
:
this
.
coverData
(
tempAllData
[
key
]),
};
});
console
.
log
(
"list 数据----"
,
list
);
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
this
.
countNum
+=
item
.
list
.
length
;
});
this
.
list
=
list
;
this
.
initSyncCount
();
},
coverData
(
arr
=
[])
{
const
{
isException
=
""
,
inspectionType
=
""
,
iSynchronization
=
""
,
}
=
this
.
searchForm
;
return
arr
.
filter
((
item
)
=>
{
return
(
(
!
isException
||
item
.
isException
==
isException
)
&&
(
!
inspectionType
||
item
.
inspectionType
==
inspectionType
)
&&
(
!
iSynchronization
||
item
.
iSynchronization
==
iSynchronization
)
);
});
},
change
(
e
)
{
console
.
log
(
"----"
,
e
);
this
.
searchForm
=
e
;
this
.
init
();
},
tabClick
(
item
,
index
)
{
tabClick
(
item
,
index
)
{
console
.
log
(
"----"
);
console
.
log
(
"----"
);
this
.
activeTabIndex
=
index
;
this
.
activeTabIndex
=
index
;
...
@@ -96,6 +239,38 @@ export default {
...
@@ -96,6 +239,38 @@ export default {
url
:
"/pages/index/index"
,
url
:
"/pages/index/index"
,
});
});
},
},
toPage
()
{
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
if
(
darf_data
.
inspectionType
==
1
)
{
uni
.
navigateTo
({
url
:
`/pages/inspectionContent/inspectionContent?isDarf=1`
,
});
}
else
if
(
darf_data
.
inspectionType
==
2
)
{
uni
.
navigateTo
({
url
:
`/pages/shaftInspection/shaftInspection?isDarf=1`
,
});
}
else
{
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
}
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
},
},
},
};
};
</
script
>
</
script
>
...
...
pages/index/operLog.vue
浏览文件 @
2a537883
...
@@ -68,6 +68,7 @@
...
@@ -68,6 +68,7 @@
<text
class=
"time bold"
>
{{
item
.
time
}}
</text>
<text
class=
"time bold"
>
{{
item
.
time
}}
</text>
<view
class=
"desc"
>
<view
class=
"desc"
>
<!-- 不可删除 -->
<text
class=
"xuxian"
>
......
</text>
<text
class=
"xuxian"
>
......
</text>
<text
class=
"bold"
>
{{
item
.
name
||
item
.
user
}}
</text>
<text
class=
"bold"
>
{{
item
.
name
||
item
.
user
}}
</text>
...
@@ -85,7 +86,7 @@
...
@@ -85,7 +86,7 @@
<
script
>
<
script
>
import
timeSelect
from
"@/components/global/timeSelect.vue"
;
import
timeSelect
from
"@/components/global/timeSelect.vue"
;
import
lodash
from
"lodash"
import
{
getLogList
}
from
"@/request/index.js"
;
export
default
{
export
default
{
components
:
{
components
:
{
timeSelect
,
timeSelect
,
...
@@ -118,7 +119,6 @@ export default {
...
@@ -118,7 +119,6 @@ export default {
text
:
"其他"
,
text
:
"其他"
,
value
:
"其他"
,
value
:
"其他"
,
},
},
],
],
searchForm
:
{
searchForm
:
{
type
:
""
,
type
:
""
,
...
@@ -133,8 +133,24 @@ export default {
...
@@ -133,8 +133,24 @@ export default {
uni
.
navigateBack
();
uni
.
navigateBack
();
},
},
onLoad
()
{
onLoad
()
{
this
.
recordData
=
lodash
.
flattenDeep
(
this
.
$store
.
state
.
log_list
);
uni
.
showLoading
();
getLogList
()
.
then
((
res
)
=>
{
this
.
recordData
=
res
;
this
.
getData
();
this
.
getData
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
0
==
error
.
code
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
uni
.
hideLoading
();
});
},
},
methods
:
{
methods
:
{
change
(
e
)
{
change
(
e
)
{
...
@@ -162,7 +178,7 @@ export default {
...
@@ -162,7 +178,7 @@ export default {
getData
()
{
getData
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
const
{
type
,
startTime
,
endTime
}
=
this
.
searchForm
;
const
{
type
,
startTime
,
endTime
}
=
this
.
searchForm
;
console
.
log
(
"--this.recordData--"
,
this
.
recordData
)
console
.
log
(
"--this.recordData--"
,
this
.
recordData
)
;
this
.
tableData
=
this
.
recordData
.
filter
((
item
)
=>
{
this
.
tableData
=
this
.
recordData
.
filter
((
item
)
=>
{
let
matchType
=
true
;
// 类型筛选
let
matchType
=
true
;
// 类型筛选
...
@@ -180,7 +196,6 @@ export default {
...
@@ -180,7 +196,6 @@ export default {
});
});
this
.
loading
=
false
;
this
.
loading
=
false
;
},
},
},
},
};
};
...
...
pages/inspection/inspFirst.vue
浏览文件 @
2a537883
...
@@ -113,6 +113,7 @@ export default {
...
@@ -113,6 +113,7 @@ export default {
isSubmit
:
""
,
// 0 是草稿态; 1 是正式提交
isSubmit
:
""
,
// 0 是草稿态; 1 是正式提交
conclusion
:
""
,
//结论
conclusion
:
""
,
//结论
fillCheck
:
""
,
// tab字典的value值, 校验通过的
fillCheck
:
""
,
// tab字典的value值, 校验通过的
creatTime
:
`
${
new
Date
().
getTime
()}
`
,
items
:
[
items
:
[
// {
// {
...
@@ -186,66 +187,6 @@ export default {
...
@@ -186,66 +187,6 @@ export default {
},
},
});
});
}
}
return
;
this
.
$refs
.
forms
.
validate
()
.
then
((
res
)
=>
{
uni
.
showLoading
({
title
:
"加载中"
,
});
// console.log('校验通过');
// let timeStr = getDateTime.dateTimeStr("y-m-d h:i");
// let timeStr2 = getDateTime.dateTimeStr("y-m-d h:i:s");
// this.formData.type = "1"; //巡检为1
// this.formData.oid = this.$store.state.now_user.areaName; //区域名
// this.formData.status = "编辑中"; //pad端添加状态
// this.formData.isDel = "0";
// this.formData.id = "";
// this.formData.errorData = {};
// this.formData.createBy = this.$store.state.now_user.name;
// this.formData.creatTime = timeStr2;
// this.formData.uid =
// this.$store.state.now_user.oid +
// Number(
// Math.random().toString().substr(3, 10) + Date.now()
// ).toString(36);
// this.$store.state.all_data.push(this.formData);
// 记录操作日志
let
operData
=
{
name
:
this
.
$store
.
state
.
now_user
.
name
,
level
:
"秘密"
,
user
:
this
.
$store
.
state
.
now_user
.
user
,
module
:
"巡检"
,
detail
:
this
.
showRoomName
(
this
.
formData
.
room
)
+
"巡检记录"
+
"("
+
this
.
formData
.
number
+
")"
,
type
:
this
.
$store
.
state
.
oper_type
,
time
:
timeStr
,
...
this
.
formData
,
level
:
"秘密"
,
};
this
.
$store
.
state
.
oper_record
.
unshift
(
operData
);
//保存该操作记录
this
.
$store
.
commit
(
"SET_TEMP_DATA"
,
this
.
formData
);
// 缓存[巡检信息]
uni
.
redirectTo
({
url
:
"/pages/inspectionContent/inspectionContent"
,
success
()
{
uni
.
hideLoading
();
},
});
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
});
},
},
},
},
};
};
...
...
pages/inspectionContent/inspectionContent.vue
浏览文件 @
2a537883
...
@@ -132,6 +132,8 @@ import {
...
@@ -132,6 +132,8 @@ import {
pad_room_type
,
pad_room_type
,
}
from
"@/utils/dict.js"
;
}
from
"@/utils/dict.js"
;
import
{
getInspectionDetails
,
getDarft
}
from
"@/request/index.js"
;
export
default
{
export
default
{
components
:
{
components
:
{
Tabs
,
Tabs
,
...
@@ -186,17 +188,35 @@ export default {
...
@@ -186,17 +188,35 @@ export default {
};
};
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
this
.
isDisable
=
options
.
isDisable
==
1
?
true
:
false
;
this
.
init
();
this
.
init
();
if
(
options
.
uid
)
{
if
(
options
.
uid
)
{
// 获取详情
// 获取详情
this
.
getDetails
(
options
.
uid
);
this
.
getDetails
(
options
.
uid
);
}
else
if
(
options
.
isDarf
)
{
}
else
if
(
options
.
isDarf
)
{
// 获取草稿数据
// 获取草稿数据
const
darf_data
=
this
.
$store
.
state
.
darf_data
;
// const darf_data = this.$store.state.darf_data;
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
this
.
baseInfo
=
darf_data
.
originData
.
baseInfo
;
this
.
baseInfo
=
darf_data
.
originData
.
baseInfo
;
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
console
.
log
(
"获取草稿数据---"
,
darf_data
);
console
.
log
(
"获取草稿数据---"
,
darf_data
);
this
.
detailsInfo
=
darf_data
;
this
.
detailsInfo
=
darf_data
;
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -221,14 +241,28 @@ export default {
...
@@ -221,14 +241,28 @@ export default {
},
},
// 回显数据
// 回显数据
getDetails
(
uid
)
{
getDetails
(
uid
)
{
const
all_data
=
this
.
$store
.
state
.
all_data
||
[];
uni
.
showLoading
();
const
detailsInfo
=
all_data
.
filter
((
item
)
=>
item
.
uid
==
uid
)[
0
]
||
{};
console
.
log
(
"--detailsInfo--"
,
detailsInfo
);
getInspectionDetails
(
uid
)
.
then
((
res
)
=>
{
console
.
log
(
"-getInspectionDetails--"
,
res
)
const
detailsInfo
=
res
;
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
detailsInfo
=
detailsInfo
;
this
.
detailsInfo
=
detailsInfo
;
this
.
isDisable
=
detailsInfo
.
synchronization
==
1
;
this
.
isDisable
=
this
.
isDisable
||
detailsInfo
.
synchronization
==
1
;
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
},
},
// 回显组件数据
// 回显组件数据
setComponentData
(
activeTabIndex
,
componentData
)
{
setComponentData
(
activeTabIndex
,
componentData
)
{
...
...
pages/inspectionContent/model/batteryRoom.vue
浏览文件 @
2a537883
...
@@ -187,7 +187,6 @@ export default {
...
@@ -187,7 +187,6 @@ export default {
});
});
this
.
list
=
temp
;
this
.
list
=
temp
;
console
.
log
(
"---temp"
,
temp
);
},
},
// 回显数据
// 回显数据
setForm
(
componentData
)
{
setForm
(
componentData
)
{
...
...
pages/inspectionContent/model/gatherDataCenter.vue
浏览文件 @
2a537883
...
@@ -188,11 +188,9 @@ export default {
...
@@ -188,11 +188,9 @@ export default {
});
});
this
.
list
=
temp
;
this
.
list
=
temp
;
console
.
log
(
"---temp"
,
temp
);
},
},
// 回显数据
// 回显数据
setForm
(
componentData
)
{
setForm
(
componentData
)
{
console
.
log
(
"-componentData---"
,
componentData
);
this
.
list
=
componentData
;
this
.
list
=
componentData
;
},
},
// 获取数据
// 获取数据
...
...
pages/inspectionContent/model/shieldedComputerRoom.vue
浏览文件 @
2a537883
...
@@ -185,7 +185,6 @@ export default {
...
@@ -185,7 +185,6 @@ export default {
});
});
this
.
list
=
temp
;
this
.
list
=
temp
;
console
.
log
(
"---temp"
,
temp
);
},
},
// 回显数据
// 回显数据
setForm
(
componentData
)
{
setForm
(
componentData
)
{
...
...
pages/inspectionManagement/index.vue
浏览文件 @
2a537883
...
@@ -6,19 +6,31 @@
...
@@ -6,19 +6,31 @@
<!-- 结果 -->
<!-- 结果 -->
<view
class=
"inspection-management-content"
>
<view
class=
"inspection-management-content"
>
<view
class=
"count-tatal"
>
<view
class=
"count-tatal"
>
<text
class=
"num"
>
123
条
</text>
<text
class=
"num"
>
{{
countNum
||
0
}}
条
</text>
<text>
查询结果
</text>
<text>
查询结果
</text>
</view>
</view>
<view
class=
"month-list"
>
<view
class=
"month-list"
>
<!-- 每月记录 -->
<!-- 每月记录 -->
<view
class=
"month-record-item"
v-for=
"item in 20"
:key=
"item"
>
<view
<view
class=
"seconed-title"
>
2024年08月
</view>
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
time
}}
</view>
<view
class=
"inspect-list"
>
<view
class=
"inspect-list"
>
<InspectionItem
/>
<InspectionItem
v-for=
"ele in item.list"
:key=
"ele.inspectionCode"
:details=
"ele"
/>
</view>
</view>
</view>
</view>
<Empty
v-if=
"list.length == 0"
/>
</view>
</view>
</view>
</view>
...
@@ -30,23 +42,126 @@
...
@@ -30,23 +42,126 @@
<
script
>
<
script
>
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
{
getDarft
}
from
"@/request/index.js"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
export
default
{
components
:
{
components
:
{
SearchCom
,
SearchCom
,
InspectionItem
,
InspectionItem
,
Empty
,
},
},
data
()
{
data
()
{
return
{};
return
{
isDialog
:
false
,
//
list
:
[],
// 展示数据
all_data
:
[],
// 所有数据
searchForm
:
{
// 搜索条件
},
countNum
:
0
,
// 统计查询总数
};
},
mounted
()
{
uni
.
showLoading
();
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
();
});
},
},
methods
:
{
methods
:
{
init
()
{
const
all_data
=
this
.
all_data
||
[];
const
tempAllData
=
{};
all_data
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitTime
]
||
[];
if
(
val
.
length
)
{
tempAllData
[
item
.
submitTime
].
push
(
item
);
}
else
{
tempAllData
[
item
.
submitTime
]
=
[
item
];
}
});
const
keys
=
Object
.
keys
(
tempAllData
);
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
// 第一步: 筛选有效的时间范围
const
timeFrame
=
keys
.
filter
((
key
)
=>
{
if
(
!
inspectionTime
.
length
)
{
return
true
;
}
else
{
return
(
new
Date
(
startTime
).
getTime
()
<=
new
Date
(
key
).
getTime
()
&&
new
Date
(
key
).
getTime
()
<=
new
Date
(
endTime
).
getTime
()
);
}
});
// 第二步: 根据搜索条件过滤
const
list
=
timeFrame
.
map
((
key
)
=>
{
return
{
time
:
key
,
list
:
this
.
coverData
(
tempAllData
[
key
]),
};
});
console
.
log
(
"list 数据----"
,
list
);
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
this
.
countNum
+=
item
.
list
.
length
;
});
this
.
list
=
list
;
},
coverData
(
arr
=
[])
{
const
{
isException
=
""
,
inspectionType
=
""
,
iSynchronization
=
""
,
}
=
this
.
searchForm
;
return
arr
.
filter
((
item
)
=>
{
return
(
(
!
isException
||
item
.
isException
==
isException
)
&&
(
!
inspectionType
||
item
.
inspectionType
==
inspectionType
)
&&
(
!
iSynchronization
||
item
.
iSynchronization
==
iSynchronization
)
);
});
},
change
(
e
)
{
change
(
e
)
{
console
.
log
(
"----"
,
e
);
console
.
log
(
"----"
,
e
);
this
.
searchForm
=
e
;
this
.
init
();
},
},
toPage
()
{
toPage
()
{
const
darf_data
=
this
.
$store
.
state
.
darf_data
||
{};
uni
.
showLoading
();
console
.
log
(
"---读取的草稿数据"
,
darf_data
)
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
if
(
darf_data
.
inspectionType
==
1
)
{
if
(
darf_data
.
inspectionType
==
1
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
`/pages/inspectionContent/inspectionContent?isDarf=1`
,
url
:
`/pages/inspectionContent/inspectionContent?isDarf=1`
,
...
@@ -60,6 +175,24 @@ export default {
...
@@ -60,6 +175,24 @@ export default {
url
:
"/pages/inspection/inspFirst"
,
url
:
"/pages/inspection/inspFirst"
,
});
});
}
}
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"error"
,
error
);
if
(
error
.
code
==
0
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
uni
.
navigateTo
({
url
:
"/pages/inspection/inspFirst"
,
});
uni
.
hideLoading
();
});
},
},
},
},
};
};
...
...
pages/login/login.vue
浏览文件 @
2a537883
...
@@ -31,16 +31,16 @@ import {
...
@@ -31,16 +31,16 @@ import {
checkAndCreateDirectory
,
checkAndCreateDirectory
,
createFileWithPlusIO
,
createFileWithPlusIO
,
TEST
,
TEST
,
TEST_2X
TEST_2X
,
}
from
"@/utils/systemCofig"
;
}
from
"@/utils/systemCofig"
;
import
{
import
{
LOG_TYPE_ENUM
,
LOG_TYPE_ENUM
,
getLogContent
,
getLogContent
,
addLog
,
addLog
,
readDirectoryData
,
readDirectoryData
,
}
from
"@/utils/IoReadingAndWriting.js"
;
}
from
"@/utils/IoReadingAndWriting.js"
;
import
moment
from
"moment"
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -49,8 +49,8 @@ export default {
...
@@ -49,8 +49,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
person
:
{
person
:
{
user
:
"
test
"
,
user
:
"
xhqxj
"
,
pd
:
"
Aa123456
"
,
pd
:
"
JF85250920
"
,
},
},
backButtonPress
:
0
,
backButtonPress
:
0
,
personList
:
[],
personList
:
[],
...
@@ -60,15 +60,7 @@ export default {
...
@@ -60,15 +60,7 @@ export default {
onShow
()
{
onShow
()
{
this
.
setUser
();
this
.
setUser
();
},
},
mounted
()
{
mounted
()
{},
// let timeStr = getDateTime.dateTimeStr('y-m-d h-i-s')
// let fileName = "用户名" + timeStr + '.txt'
// const fileContent = this.setSm2(TEST_2X)
// console.log("---加密内容", fileContent)
// createFileWithPlusIO(`${SYNCHRONIZE_DATA_PAD}/同步数据`, fileName,fileContent ).then(res => {
// console.log("---写入成功", res)
// })
},
// 定义返回退出
// 定义返回退出
onBackPress
(
options
)
{
onBackPress
(
options
)
{
this
.
backButtonPress
++
;
this
.
backButtonPress
++
;
...
@@ -145,64 +137,29 @@ export default {
...
@@ -145,64 +137,29 @@ export default {
this
.
person
.
user
==
this
.
personList
[
key
].
user
&&
this
.
person
.
user
==
this
.
personList
[
key
].
user
&&
this
.
person
.
pd
==
this
.
personList
[
key
].
passWord
this
.
person
.
pd
==
this
.
personList
[
key
].
passWord
)
{
)
{
// this.$store.state.now_user = this.personList[key]
const
last_time
=
moment
().
format
(
"yyyy-MM-DD HH:mm:ss"
);
this
.
$store
.
commit
(
"SET_USER"
,
this
.
personList
[
key
]);
this
.
$store
.
commit
(
"SET_USER"
,
this
.
personList
[
key
]);
uni
.
setStorageSync
(
"now_user"
,
this
.
personList
[
key
]);
uni
.
setStorageSync
(
"now_user"
,
this
.
personList
[
key
]);
this
.
$store
.
commit
(
"SET_TIME"
,
last_time
);
uni
.
setStorageSync
(
"last_time"
,
last_time
);
// let timeStr = getDateTime.dateTimeStr("y-m-d h:i");
uni
.
navigateTo
({
// let operData = {
url
:
"/pages/home/home"
,
// name: this.$store.state.now_user.name,
});
// level: "秘密",
uni
.
showToast
({
// user: this.$store.state.now_user.user,
title
:
"登录成功"
,
// module: "其他",
icon
:
"none"
,
// detail: "无",
duration
:
2000
,
// type: "登录",
});
// time: timeStr,
// };
// 读取文件夹数据
readDirectoryData
()
.
then
((
res
)
=>
{
// 更新日志信息
// 更新日志信息
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
login
);
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
login
);
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
);
addLog
(
log_list
);
// uni.showToast({
// title: "登录成功",
// icon: "none",
// duration: 2000,
// });
uni
.
navigateTo
({
url
:
"/pages/home/home"
,
});
uni
.
hideLoading
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"--login.vue--"
,
error
);
uni
.
hideLoading
();
});
// return;
// this.$store.state.oper_record.unshift(operData);
// console.log("--this.personList[key]-", this.personList[key]);
// 检查文件夹是否创建, 没有就创建
// checkAndCreateDirectory(
// `${SYNCHRONIZE_DATA_PAD}/${this.$store.state.now_user.user}`
// );
// 更新日志信息
// const logContent = getLogContent(LOG_TYPE_ENUM.login);
// addLog(logContent);
// uni.navigateTo({
// url: "/pages/home/home",
// });
// 密码不正确
// 密码不正确
}
else
{
}
else
{
...
...
pages/shaftInspection/model/tabContentItem.vue
浏览文件 @
2a537883
...
@@ -79,6 +79,7 @@ import {
...
@@ -79,6 +79,7 @@ import {
pad_room_type
,
pad_room_type
,
}
from
"@/utils/dict.js"
;
}
from
"@/utils/dict.js"
;
/**
/**
* 汇集机房
* 汇集机房
*/
*/
...
@@ -204,11 +205,9 @@ export default {
...
@@ -204,11 +205,9 @@ export default {
});
});
this
.
list
=
temp
;
this
.
list
=
temp
;
// console.log("---temp", temp);
},
},
// 回显数据
// 回显数据
setForm
(
componentData
)
{
setForm
(
componentData
)
{
console
.
log
(
"-componentData---"
,
componentData
);
this
.
list
=
componentData
.
temp
;
this
.
list
=
componentData
.
temp
;
if
(
componentData
.
conclusion
)
{
if
(
componentData
.
conclusion
)
{
this
.
form
=
{
this
.
form
=
{
...
...
pages/shaftInspection/shaftInspection.vue
浏览文件 @
2a537883
...
@@ -104,7 +104,7 @@ import {
...
@@ -104,7 +104,7 @@ import {
}
from
"@/utils/IoReadingAndWriting.js"
;
}
from
"@/utils/IoReadingAndWriting.js"
;
import
{
pad_2_1_inspection_position
}
from
"@/utils/dict.js"
;
import
{
pad_2_1_inspection_position
}
from
"@/utils/dict.js"
;
import
{
Base64
}
from
"js-base64
"
;
import
{
getInspectionDetails
,
getDarft
}
from
"@/request/index.js
"
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -124,15 +124,31 @@ export default {
...
@@ -124,15 +124,31 @@ export default {
};
};
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
this
.
isDisable
=
options
.
isDisable
==
1
?
true
:
false
;
if
(
options
.
uid
)
{
if
(
options
.
uid
)
{
this
.
getDetails
(
options
.
uid
);
this
.
getDetails
(
options
.
uid
);
}
else
if
(
options
.
isDarf
)
{
}
else
if
(
options
.
isDarf
)
{
// 获取草稿数据
// 获取草稿数据
const
darf_data
=
this
.
$store
.
state
.
darf_data
;
uni
.
showLoading
();
getDarft
()
.
then
((
res
)
=>
{
const
darf_data
=
res
||
{};
this
.
baseInfo
=
darf_data
.
originData
.
baseInfo
;
this
.
baseInfo
=
darf_data
.
originData
.
baseInfo
;
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
console
.
log
(
"获取草稿数据---"
,
darf_data
);
console
.
log
(
"获取草稿数据---"
,
darf_data
);
this
.
detailsInfo
=
darf_data
;
this
.
detailsInfo
=
darf_data
;
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -171,14 +187,28 @@ export default {
...
@@ -171,14 +187,28 @@ export default {
},
},
// 回显数据
// 回显数据
getDetails
(
uid
)
{
getDetails
(
uid
)
{
const
all_data
=
this
.
$store
.
state
.
all_data
||
[];
uni
.
showLoading
();
const
detailsInfo
=
all_data
.
filter
((
item
)
=>
item
.
uid
==
uid
)[
0
]
||
{};
getInspectionDetails
(
uid
)
.
then
((
res
)
=>
{
const
detailsInfo
=
res
;
// const all_data = this.$store.state.all_data || [];
// const detailsInfo = all_data.filter((item) => item.uid == uid)[0] || {};
console
.
log
(
"--detailsInfo-"
,
detailsInfo
);
console
.
log
(
"--detailsInfo-"
,
detailsInfo
);
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
detailsInfo
=
detailsInfo
;
this
.
detailsInfo
=
detailsInfo
;
this
.
isDisable
=
detailsInfo
.
synchronization
==
1
;
this
.
isDisable
=
this
.
isDisable
||
detailsInfo
.
synchronization
==
1
;
// 是否禁用 1:已同步数据 0: 未同步数据
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
uni
.
hideLoading
();
});
},
},
// 回显组件数据
// 回显组件数据
setComponentData
(
refName
,
componentData
)
{
setComponentData
(
refName
,
componentData
)
{
...
...
pages/synchronization/synchronization.vue
浏览文件 @
2a537883
...
@@ -317,49 +317,6 @@
...
@@ -317,49 +317,6 @@
let
data
=
this
.
setSm2
(
this
.
listData
)
let
data
=
this
.
setSm2
(
this
.
listData
)
// plus.io.resolveLocalFileSystemURL(
// `/storage/emulated/0/Android/data/asmzx/同步数据/${this.$store.state.now_user.user}/`, //指定的目录
// function(entry) {
// // 创建或打开文件, fs.root是根目录操作对象,直接fs表示当前操作对象
// entry.getFile(
// fileName, {
// create: true // 文件不存在则创建
// },
// fileEntry => {
// // 文件在手机中的路径
// console.log(fileEntry.fullPath)
// fileEntry.createWriter(writer => {
// // 向文件中写入数据
// writer.write(
// JSON.stringify(data)
// );
// // 写入文件成功完成的回调函数
// writer.onwrite = e => {
// // uni.showToast({
// // title: '同步成功',
// // icon: 'none',
// // duration: 2000
// // })
// // _this.$refs.alertDialog.open()
// };
// });
// },
// e => {
// console.log('getFile failed: ' + e.message);
// }
// );
// },
// e => {
// console.log(e.message);
// },
// function(err) {
// console.log("访问指定目录失败:" + err.message);
// });
createFileWithPlusIO
(
`
${
SYNCHRONIZE_DATA_PAD
}
/同步数据`
,
fileName
,
data
).
then
(
res
=>
{
createFileWithPlusIO
(
`
${
SYNCHRONIZE_DATA_PAD
}
/同步数据`
,
fileName
,
data
).
then
(
res
=>
{
console
.
log
(
"---写入成功"
,
res
)
console
.
log
(
"---写入成功"
,
res
)
...
...
pages/synchronousManagement/dialog.vue
浏览文件 @
2a537883
...
@@ -66,8 +66,7 @@ export default {
...
@@ -66,8 +66,7 @@ export default {
},
},
mounted
()
{
mounted
()
{
// const all_data = this.$store.state.all_data;
this
.
all_data
=
(
this
.
$store
.
state
.
all_data
||
[]).
filter
(
item
=>
item
.
synchronization
==
0
);
this
.
all_data
=
this
.
$store
.
state
.
all_data
||
[];
},
},
methods
:
{
methods
:
{
change
(
e
)
{},
change
(
e
)
{},
...
...
pages/synchronousManagement/index.vue
浏览文件 @
2a537883
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<!-- 结果 -->
<!-- 结果 -->
<view
class=
"synchronous-management-content"
>
<view
class=
"synchronous-management-content"
>
<view
class=
"count-tatal"
>
<view
class=
"count-tatal"
>
<text
class=
"num"
>
{{
countNum
||
0
}}
条
</text>
<text
class=
"num"
>
{{
countNum
||
0
}}
条
</text>
<text>
查询结果
</text>
<text>
查询结果
</text>
</view>
</view>
...
@@ -17,21 +17,31 @@
...
@@ -17,21 +17,31 @@
v-for=
"(item, index) in list"
v-for=
"(item, index) in list"
:key=
"index"
:key=
"index"
>
>
<view
class=
"seconed-title"
>
{{
item
.
time
}}
</view>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
time
}}
</view>
<view
class=
"inspect-list"
>
<view
class=
"inspect-list"
>
<InspectionItem
<InspectionItem
v-for=
"ele in item.list"
v-for=
"ele in item.list"
:key=
"ele.inspectionCode"
:key=
"ele.inspectionCode"
:details=
"ele"
:details=
"ele"
:isDisable=
"true"
/>
/>
</view>
</view>
</view>
</view>
<Empty
v-if=
"list.length == 0"
/>
</view>
</view>
</view>
</view>
<!-- 数据打包 -->
<!-- 数据打包 -->
<view
v-show=
"isPackedDataBtn"
class=
"synchronous-button"
@
click=
"openDialog(true)"
>
数据打包
</view>
<view
v-show=
"isPackedDataBtn"
class=
"synchronous-button"
@
click=
"openDialog(true)"
>
数据打包
</view
>
<!-- 打包弹窗 -->
<!-- 打包弹窗 -->
<Dialog
v-show=
"isDialog"
@
close=
"openDialog(false)"
></Dialog>
<Dialog
v-show=
"isDialog"
@
close=
"openDialog(false)"
></Dialog>
...
@@ -42,13 +52,15 @@
...
@@ -42,13 +52,15 @@
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
Dialog
from
"./dialog.vue"
;
import
Dialog
from
"./dialog.vue"
;
import
moment
from
"moment"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
export
default
{
components
:
{
components
:
{
SearchCom
,
SearchCom
,
InspectionItem
,
InspectionItem
,
Dialog
,
Dialog
,
Empty
,
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -59,19 +71,36 @@ export default {
...
@@ -59,19 +71,36 @@ export default {
// 搜索条件
// 搜索条件
},
},
countNum
:
0
,
// 统计查询总数
countNum
:
0
,
// 统计查询总数
isPackedDataBtn
:
false
// 控制打包按钮显示
isPackedDataBtn
:
false
,
// 控制打包按钮显示
};
};
},
},
mounted
()
{
mounted
()
{
uni
.
showLoading
();
getAllInspections
()
.
then
((
res
)
=>
{
this
.
all_data
=
res
;
this
.
init
();
this
.
init
();
uni
.
hideLoading
();
})
.
catch
((
error
)
=>
{
if
(
0
==
error
.
code
)
{
uni
.
showToast
({
title
:
error
.
msg
,
icon
:
"none"
,
duration
:
1000
,
});
}
this
.
all_data
=
[];
uni
.
hideLoading
();
});
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
const
all_data
=
this
.
$store
.
state
.
all_data
||
[];
const
all_data
=
this
.
all_data
||
[];
console
.
log
(
"---all_data-"
,
all_data
)
this
.
isPackedDataBtn
=
this
.
isPackedDataBtn
=
all_data
.
filter
(
item
=>
item
.
synchronization
==
0
).
length
>
0
;
all_data
.
filter
((
item
)
=>
item
.
synchronization
==
0
).
length
>
0
;
console
.
log
(
"all_data"
,
all_data
);
const
tempAllData
=
{};
const
tempAllData
=
{};
all_data
.
forEach
((
item
)
=>
{
all_data
.
forEach
((
item
)
=>
{
...
@@ -101,7 +130,6 @@ export default {
...
@@ -101,7 +130,6 @@ export default {
}
}
});
});
// 第二步: 根据搜索条件过滤
// 第二步: 根据搜索条件过滤
const
list
=
timeFrame
.
map
((
key
)
=>
{
const
list
=
timeFrame
.
map
((
key
)
=>
{
return
{
return
{
...
@@ -110,10 +138,6 @@ export default {
...
@@ -110,10 +138,6 @@ export default {
};
};
});
});
// this.list = this.all_data
// console.log("timeFramea", timeFrame);
// console.log("this.all_data", all_data);
console
.
log
(
"list 数据----"
,
list
);
console
.
log
(
"list 数据----"
,
list
);
this
.
countNum
=
0
;
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
list
.
forEach
((
item
)
=>
{
...
@@ -146,6 +170,9 @@ export default {
...
@@ -146,6 +170,9 @@ export default {
},
},
openDialog
(
show
)
{
openDialog
(
show
)
{
this
.
isDialog
=
show
;
this
.
isDialog
=
show
;
if
(
!
show
)
{
this
.
init
();
}
},
},
},
},
};
};
...
...
request/index.js
0 → 100644
浏览文件 @
2a537883
import
store
from
"../store/index"
;
import
{
readLogData
,
readInspectionData
,
readDarfData
}
from
"@/utils/IoReadingAndWriting.js"
;
import
{
sortTimeDesc
}
from
"@/utils/common.js"
;
import
lodash
from
"lodash"
;
/**
*
* 获取所有巡检数据
* @returns
*/
export
const
getAllInspections
=
()
=>
{
const
all_data
=
store
.
state
.
all_data
||
[];
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
all_data
.
length
)
{
resolve
(
all_data
)
}
else
{
readInspectionData
()
.
then
((
res
)
=>
{
// console.log("----读出来的巡检文件", res);
const
tempRes
=
lodash
.
orderBy
(
res
,
"creatTime"
,
[
'desc'
]);
store
.
commit
(
"SET_ALL_DATA"
,
tempRes
);
resolve
(
tempRes
)
})
.
catch
((
error
)
=>
{
reject
(
error
)
})
}
})
}
/**
*
* 获取所有日志数据
* @returns
*/
export
const
getLogList
=
()
=>
{
const
log_list
=
store
.
state
.
log_list
||
[];
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
log_list
.
length
)
{
resolve
(
log_list
)
}
else
{
readLogData
()
.
then
((
res
)
=>
{
console
.
log
(
"----读出来的日志文件"
,
res
);
store
.
commit
(
"SET_LOG_LIST"
,
res
);
resolve
(
res
)
})
.
catch
((
error
)
=>
{
reject
(
error
)
})
}
})
}
/**
*
* 获取巡检数据详情
* @returns
*/
export
const
getInspectionDetails
=
(
uid
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getAllInspections
()
.
then
((
res
)
=>
{
console
.
log
(
"--list-"
,
res
)
const
detailsInfo
=
res
.
filter
((
item
)
=>
item
.
uid
==
uid
)[
0
]
||
{};
resolve
(
detailsInfo
)
})
.
catch
((
error
)
=>
{
reject
(
error
)
})
})
}
/**
*
* 获取草稿数据
* @returns
*/
export
const
getDarft
=
()
=>
{
const
darf_data
=
store
.
state
.
darf_data
||
{};
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
darf_data
.
inspectionType
)
{
resolve
(
darf_data
)
}
else
{
readDarfData
()
.
then
((
res
)
=>
{
console
.
log
(
"----读出来的草稿文件"
,
res
);
store
.
commit
(
"SET_DARF_DATA"
,
res
);
resolve
(
res
)
})
.
catch
((
error
)
=>
{
reject
(
error
)
})
}
})
}
\ No newline at end of file
store/index.js
浏览文件 @
2a537883
...
@@ -9,15 +9,7 @@ const store = new Vuex.Store({
...
@@ -9,15 +9,7 @@ const store = new Vuex.Store({
log_list
:
[],
// 保存操作记录数据--日志数据
log_list
:
[],
// 保存操作记录数据--日志数据
now_user
:
{
now_user
:
{
},
//保存当前登录用户
id
:
1
,
user
:
"hzsgjy"
,
passWord
:
"JFXJ85250920"
,
areaName
:
"市本级"
,
permission
:
1
,
name
:
"超管"
,
oid
:
"scq"
,
},
//保存当前登录用户
darf_data
:
{},
// 保存草稿内容
darf_data
:
{},
// 保存草稿内容
temp_data
:
{},
// 当前编辑或者查看的数据,
temp_data
:
{},
// 当前编辑或者查看的数据,
...
@@ -51,9 +43,9 @@ const store = new Vuex.Store({
...
@@ -51,9 +43,9 @@ const store = new Vuex.Store({
//保存当前登录用户
//保存当前登录用户
state
.
now_user
=
payload
;
state
.
now_user
=
payload
;
},
},
//
SET_TIME(state, payload) { //保存上次上报时间
SET_TIME
(
state
,
payload
)
{
//保存上次上报时间
//
state.last_time = payload
state
.
last_time
=
payload
//
},
},
DEL_DATA
(
state
,
index
)
{
DEL_DATA
(
state
,
index
)
{
//删除数据
//删除数据
state
.
all_data
.
splice
(
index
,
1
);
state
.
all_data
.
splice
(
index
,
1
);
...
...
utils/IoReadingAndWriting.js
浏览文件 @
2a537883
...
@@ -10,6 +10,7 @@ import {
...
@@ -10,6 +10,7 @@ import {
readFileContent
,
readFileContent
,
readFilesInDirectory
,
readFilesInDirectory
,
checkFileExists
,
checkFileExists
,
FILE_ENUM
}
from
"./systemCofig"
;
}
from
"./systemCofig"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
import
lodash
from
"lodash"
;
import
lodash
from
"lodash"
;
...
@@ -30,7 +31,7 @@ export const LOG_TYPE_ENUM = {
...
@@ -30,7 +31,7 @@ export const LOG_TYPE_ENUM = {
};
};
// 生成日志
// 生成日志
export
const
getLogContent
=
(
type
,
detail
=
""
,
module
=
"其他模块"
)
=>
{
export
const
getLogContent
=
(
type
,
detail
=
""
,
module
=
"其他模块"
)
=>
{
const
now_user
=
store
.
state
.
now_user
;
const
now_user
=
store
.
state
.
now_user
;
let
timeStr
=
moment
().
format
(
"yyyy-MM-DD HH:mm:ss"
);
let
timeStr
=
moment
().
format
(
"yyyy-MM-DD HH:mm:ss"
);
return
{
return
{
...
@@ -134,7 +135,10 @@ export const readDarfData = () => {
...
@@ -134,7 +135,10 @@ export const readDarfData = () => {
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
reject
(
error
);
reject
(
error
);
});
});
});
}).
catch
((
error
)
=>
{
reject
(
error
);
})
});
});
};
};
...
@@ -239,8 +243,11 @@ export function copyDirectory(sourceDirectoryPath, targetDirectoryPath) {
...
@@ -239,8 +243,11 @@ export function copyDirectory(sourceDirectoryPath, targetDirectoryPath) {
}
}
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
(
"文件复制失败:"
,
error
.
message
);
console
.
error
(
"创建目标目录失败:"
,
error
.
message
);
reject
(
"文件复制失败"
);
reject
({
...
FILE_ENUM
.
copyFileError
});
}
}
);
);
}
else
if
(
entry
.
isDirectory
)
{
}
else
if
(
entry
.
isDirectory
)
{
...
@@ -257,34 +264,49 @@ export function copyDirectory(sourceDirectoryPath, targetDirectoryPath) {
...
@@ -257,34 +264,49 @@ export function copyDirectory(sourceDirectoryPath, targetDirectoryPath) {
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
(
"创建目标目录失败:"
,
error
.
message
);
console
.
error
(
"copyDirectory:"
,
error
);
reject
(
"创建目标目录失败"
);
reject
({
...
FILE_ENUM
.
createFileError
});
}
}
);
);
}
}
}
}
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
(
"读取目录条目失败:"
,
error
.
message
);
console
.
error
(
"copyDirectory:"
,
error
);
reject
(
"读取目录条目失败"
);
reject
({
...
FILE_ENUM
.
readDirectoryError
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
(
"获取目标目录失败:"
,
error
.
message
);
console
.
error
(
"copyDirectory:"
,
error
);
reject
(
"获取目标目录失败"
);
reject
({
...
FILE_ENUM
.
readDirectoryError
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
(
"获取源目录失败:"
,
error
.
message
);
console
.
error
(
"copyDirectory:"
,
error
);
reject
(
"获取源目录失败"
);
reject
({
...
FILE_ENUM
.
getDirectoryError
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
(
"请求文件系统失败:"
,
error
.
message
);
console
.
error
(
"copyDirectory:"
,
error
);
reject
(
"请求文件系统失败"
);
reject
({
...
FILE_ENUM
.
fileSystemError
});
}
}
);
);
});
});
...
@@ -329,29 +351,41 @@ export function deleteAllFilesInDirectory(directoryPath) {
...
@@ -329,29 +351,41 @@ export function deleteAllFilesInDirectory(directoryPath) {
}
}
},
},
function
(
error
)
{
function
(
error
)
{
reject
(
"文件删除失败"
);
console
.
error
(
"deleteAllFilesInDirectory:"
,
error
);
console
.
error
(
"文件删除失败:"
,
error
.
message
);
reject
({
...
FILE_ENUM
.
deleteFileError
});
}
}
);
);
}
}
}
}
},
},
function
(
error
)
{
function
(
error
)
{
reject
(
"读取目录条目失败"
);
console
.
error
(
"deleteAllFilesInDirectory:"
,
error
);
console
.
error
(
"读取目录条目失败:"
,
error
.
message
);
reject
({
...
FILE_ENUM
.
readDirectoryError
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
reject
(
"获取目录失败"
);
console
.
error
(
"deleteAllFilesInDirectory:"
,
error
);
reject
({
...
FILE_ENUM
.
getDirectoryError
});
console
.
error
(
"获取目录失败:"
,
error
.
message
);
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
(
"请求文件系统失败:"
,
error
.
message
);
console
.
error
(
"deleteAllFilesInDirectory:"
,
error
);
reject
(
"请求文件系统失败"
);
reject
({
...
FILE_ENUM
.
fileSystemError
});
}
}
);
);
});
});
...
@@ -380,7 +414,7 @@ export const readDirectoryData = () => {
...
@@ -380,7 +414,7 @@ export const readDirectoryData = () => {
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
"--读取数据文件-报错"
,
error
);
console
.
log
(
"--读取数据文件-报错"
,
error
);
re
solve
(
);
re
ject
(
error
);
});
});
});
});
};
};
utils/common.js
0 → 100644
浏览文件 @
2a537883
// 时间倒序排列
export
const
sortTimeDesc
=
(
a
,
b
)
=>
{
return
a
.
creatTime
<
b
.
creatTime
?
1
:
-
1
;
};
\ No newline at end of file
utils/systemCofig.js
浏览文件 @
2a537883
...
@@ -4,19 +4,61 @@ export const BASE_PATH = "_documents/data/asmzx"; // 基础路径
...
@@ -4,19 +4,61 @@ export const BASE_PATH = "_documents/data/asmzx"; // 基础路径
export
const
SYNCHRONIZE_DATA_PATH
=
"_documents/data/asmzx"
;
// 同步数据
export
const
SYNCHRONIZE_DATA_PATH
=
"_documents/data/asmzx"
;
// 同步数据
export
const
SYNCHRONIZE_DATA_PAD
=
"_documents/data/asmzx/pad"
;
// 存储pad端的生产数据
export
const
SYNCHRONIZE_DATA_PAD
=
"_documents/data/asmzx/pad"
;
// 存储pad端的生产数据
export
const
USER_FILE_NAME
=
"userList.txt"
;
// 存储内置用户的文件名
export
const
USER_FILE_NAME
=
"userList.txt"
;
// 存储内置用户的文件名
export
const
FILE_ENUM
=
{
// 文件枚举
fileSystemError
:
{
code
:
0
,
msg
:
"请求文件系统失败"
,
},
getDirectoryError
:
{
code
:
1
,
msg
:
"获取目录失败"
,
},
getFileError
:
{
code
:
2
,
msg
:
"获取文件失败"
,
},
readFileError
:
{
code
:
3
,
msg
:
"读取文件失败"
,
},
fileNotExist
:
{
code
:
4
,
msg
:
"文件不存在"
,
},
writeFileError
:
{
code
:
5
,
msg
:
"写入文件失败"
,
},
createFileError
:
{
code
:
6
,
msg
:
"创建文件失败"
,
},
deleteFileError
:
{
code
:
7
,
msg
:
"删除文件失败"
,
},
readDirectoryError
:
{
code
:
8
,
msg
:
"读取目录条目失败"
,
}
,
copyFileError
:
{
code
:
9
,
msg
:
"文件复制失败"
,
}
}
// 内置的用户信息
// 内置的用户信息
export
const
USER_LiST
=
[
export
const
USER_LiST
=
[
{
id
:
2
,
user
:
"test"
,
// 测试账号
passWord
:
"Aa123456789"
,
areaName
:
"市本级"
,
permission
:
1
,
name
:
"巡检员"
,
oid
:
"sbj"
,
},
{
{
id
:
1
,
id
:
1
,
user
:
"hzsgjy"
,
user
:
"hzsgjy"
,
...
@@ -25,6 +67,8 @@ export const USER_LiST = [
...
@@ -25,6 +67,8 @@ export const USER_LiST = [
permission
:
1
,
permission
:
1
,
name
:
"超管"
,
name
:
"超管"
,
oid
:
"scq"
,
oid
:
"scq"
,
unitName
:
"所属单位"
},
},
{
{
id
:
3
,
id
:
3
,
...
@@ -258,7 +302,10 @@ export async function checkFileExists(directoryPath, fileName) {
...
@@ -258,7 +302,10 @@ export async function checkFileExists(directoryPath, fileName) {
// 文件不存在
// 文件不存在
reject
({
reject
({
...
error
,
...
error
,
msg
:
"checkFileExists_文件不存在"
,
...
FILE_ENUM
.
fileNotExist
,
// code: FILE_ENUM
// msg: "checkFileExists_文件不存在",
});
});
}
}
);
);
...
@@ -267,7 +314,8 @@ export async function checkFileExists(directoryPath, fileName) {
...
@@ -267,7 +314,8 @@ export async function checkFileExists(directoryPath, fileName) {
console
.
error
(
"获取目录失败:"
,
error
.
message
);
console
.
error
(
"获取目录失败:"
,
error
.
message
);
reject
({
reject
({
...
error
,
...
error
,
msg
:
"checkFileExists_获取目录失败"
,
...
FILE_ENUM
.
getDirectoryError
,
// msg: "checkFileExists_获取目录失败",
});
});
}
}
);
);
...
@@ -276,7 +324,8 @@ export async function checkFileExists(directoryPath, fileName) {
...
@@ -276,7 +324,8 @@ export async function checkFileExists(directoryPath, fileName) {
console
.
error
(
"请求文件系统失败:"
,
error
.
message
);
console
.
error
(
"请求文件系统失败:"
,
error
.
message
);
reject
({
reject
({
...
error
,
...
error
,
msg
:
"checkFileExists_请求文件系统失败"
,
...
FILE_ENUM
.
fileSystemError
,
// msg: "checkFileExists_请求文件系统失败",
});
});
}
}
);
);
...
@@ -321,23 +370,42 @@ export const readFilesInDirectory = async (directoryPath) => {
...
@@ -321,23 +370,42 @@ export const readFilesInDirectory = async (directoryPath) => {
resolve
(
res
);
resolve
(
res
);
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
reject
(
"读取文件内容失败:"
+
error
.
message
);
console
.
log
(
"readFilesInDirectory:"
,
error
);
reject
({
...
FILE_ENUM
.
getFileError
// "读取文件内容失败:" + error.message
});
});
});
},
},
function
(
error
)
{
function
(
error
)
{
reject
(
"读取目录条目失败:"
+
error
.
message
);
console
.
log
(
"readFilesInDirectory:"
,
error
);
reject
({
...
FILE_ENUM
.
readDirectoryError
// "读取目录条目失败:" + error.message
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
();
console
.
log
(
"readFilesInDirectory:"
,
error
,
directoryPath
);
reject
(
"获取目录失败:"
+
error
.
message
);
reject
({
...
FILE_ENUM
.
getDirectoryError
// "获取目录失败:" + error.message
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
error
();
console
.
log
(
"readFilesInDirectory:"
,
error
);
reject
(
"请求文件系统失败:"
+
error
.
message
);
reject
({
...
FILE_ENUM
.
fileSystemError
// "请求文件系统失败:" + error.message
});
}
}
);
);
});
});
...
@@ -360,8 +428,9 @@ export async function readFileContent(fileEntry) {
...
@@ -360,8 +428,9 @@ export async function readFileContent(fileEntry) {
);
);
reject
({
reject
({
msg
:
"systemCofig.js_readFileContent_读取文件失败:"
,
//
msg: "systemCofig.js_readFileContent_读取文件失败:",
...
e
.
target
.
error
,
...
e
.
target
.
error
,
...
FILE_ENUM
.
readFileError
});
});
};
};
// 以文本方式读取文件
// 以文本方式读取文件
...
@@ -404,9 +473,10 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) {
...
@@ -404,9 +473,10 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) {
resolve
(
fileContent
);
resolve
(
fileContent
);
};
};
fileWriter
.
onerror
=
function
(
error
)
{
fileWriter
.
onerror
=
function
(
error
)
{
console
.
log
(
"createFileWithPlusIO_文件创建或写入失败:"
,
error
);
reject
({
reject
({
...
error
,
...
error
,
msg
:
"createFileWithPlusIO_文件创建或写入失败:"
,
...
FILE_ENUM
.
writeFileError
,
});
});
};
};
...
@@ -414,25 +484,31 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) {
...
@@ -414,25 +484,31 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) {
fileWriter
.
write
(
fileContent
);
fileWriter
.
write
(
fileContent
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
log
(
"createFileWithPlusIO_创建文件写入器失败:"
,
error
);
reject
({
reject
({
...
error
,
...
error
,
msg
:
"createFileWithPlusIO_创建文件写入器失败:"
,
...
FILE_ENUM
.
createFileError
,
});
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
log
(
"createFileWithPlusIO_获取文件失败:"
,
error
);
reject
({
reject
({
...
error
,
...
error
,
msg
:
"createFileWithPlusIO_获取文件失败:"
,
...
FILE_ENUM
.
getFileError
,
});
});
}
}
);
);
},
},
function
(
error
)
{
function
(
error
)
{
console
.
log
(
"createFileWithPlusIO_获取目录失败:"
,
error
);
reject
({
reject
({
...
error
,
...
error
,
msg
:
"createFileWithPlusIO_获取目录失败:"
,
...
FILE_ENUM
.
getDirectoryError
,
});
});
}
}
);
);
...
@@ -440,6 +516,8 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) {
...
@@ -440,6 +516,8 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) {
function
(
error
)
{
function
(
error
)
{
reject
({
reject
({
...
error
,
...
error
,
...
FILE_ENUM
.
fileSystemError
,
msg
:
"createFileWithPlusIO_请求文件系统失败:"
,
msg
:
"createFileWithPlusIO_请求文件系统失败:"
,
});
});
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论