Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
3419a7e0
提交
3419a7e0
authored
4月 08, 2025
作者:
zs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
表结构更改
上级
691cf0cd
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
135 行增加
和
95 行删除
+135
-95
inspect.js
api/inspect.js
+21
-10
init.js
api/sqllite/init.js
+4
-4
table.js
api/sqllite/table.js
+0
-0
index.vue
components/inspectionItem/index.vue
+1
-1
content.vue
pages/home/content.vue
+1
-1
home.vue
pages/home/home.vue
+1
-1
homeCopy.vue
pages/home/homeCopy.vue
+1
-1
inspectionContentList.vue
pages/inspectionContent/inspectionContentList.vue
+2
-2
inspectionContentNew.vue
pages/inspectionContent/inspectionContentNew.vue
+1
-1
index.vue
pages/inspectionManagement/index.vue
+58
-65
shaftInspectionList.vue
pages/shaftInspection/shaftInspectionList.vue
+1
-1
shaftInspectionNew - 副本.vue
pages/shaftInspection/shaftInspectionNew - 副本.vue
+2
-2
shaftInspectionNew.vue
pages/shaftInspection/shaftInspectionNew.vue
+1
-1
defaultAvatar.png
static/img/add-img/defaultAvatar.png
+0
-0
sqllitedb.js
utils/sqllitedb.js
+41
-5
没有找到文件。
api/inspect.js
浏览文件 @
3419a7e0
import
SqlliteDbUtil
from
"@/utils/sqllitedb"
;
import
table
from
"./sqllite/table.js"
;
import
{
fixNullVal
}
from
"@/utils/common"
;
import
{
fixNullVal
}
from
"@/utils/common"
;
// 巡检
export
default
{
...
...
@@ -11,7 +13,13 @@ export default {
);
return
rs
;
},
async
selectDataForTime
()
{
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
let
rs
=
await
sqllitedb
.
selectSQL
(
`SELECT *,strftime( '%Y年%m月',createTime) AS yearMonth FROM
${
table
.
inspectionRecordName
}
order by createTime desc`
);
return
rs
;
},
async
info
(
id
)
{
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
let
sql
=
`select * from
${
table
.
inspectionRecordName
}
where id = '
${
id
}
'`
;
...
...
@@ -53,12 +61,12 @@ export default {
idx
++
;
}
column
=
column
.
endsWith
(
","
)
?
column
.
substring
(
0
,
column
.
length
-
1
)
:
column
;
values
=
values
.
endsWith
(
","
)
?
values
.
substring
(
0
,
values
.
length
-
1
)
:
values
;
column
=
column
.
endsWith
(
","
)
?
column
.
substring
(
0
,
column
.
length
-
1
)
:
column
;
values
=
values
.
endsWith
(
","
)
?
values
.
substring
(
0
,
values
.
length
-
1
)
:
values
;
let
sql
=
`insert into
${
table
.
inspectionRecordName
}
(
${
column
}
) values(
${
values
}
)`
;
let
has
=
await
this
.
info
(
data
.
id
);
...
...
@@ -106,8 +114,11 @@ export default {
'
${
data
.
updateTime
}
',
'
${
data
.
signImg
}
',
'
${
JSON
.
stringify
(
data
.
inspectionData
)}
'
)`
;
await
sqllitedb
.
executeSQL
(
sql
);
);
`
;
debugger
let
result
=
await
sqllitedb
.
executeReturnDataSQL
(
sql
);
console
.
log
(
result
,
'有有有有有有'
)
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
}
finally
{
...
...
api/sqllite/init.js
浏览文件 @
3419a7e0
...
...
@@ -14,11 +14,11 @@ export default {
// app初始化
async
init
()
{
uni
.
showLoading
({
title
:
'正在初始化...'
,
})
//
uni.showLoading({
//
title: '正在初始化...',
//
})
// 初始化目录
await
this
.
initDir
()
//
await this.initDir()
// 初始化数据库
this
.
initSqlLite
()
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
()
...
...
api/sqllite/table.js
浏览文件 @
3419a7e0
components/inspectionItem/index.vue
浏览文件 @
3419a7e0
...
...
@@ -17,7 +17,7 @@
<text>
编号:
</text>
<text
class=
"code-num"
>
{{
details
.
inspectionCode
}}
</text>
<text>
巡检日期:
</text>
<text
class=
"code-num"
>
{{
details
.
submit
Time
}}
</text>
<text
class=
"code-num"
>
{{
details
.
inspection
Time
}}
</text>
</view>
</view>
<view
class=
"img"
>
...
...
pages/home/content.vue
浏览文件 @
3419a7e0
...
...
@@ -12,7 +12,7 @@
<image
class=
"bg-img"
mode=
"aspectFill"
src=
"@/static/img/add-img/
home1
.png"
src=
"@/static/img/add-img/
defaultAvatar
.png"
></image>
</view>
<view
class=
"card-item"
@
click=
"toSyncPage"
>
...
...
pages/home/home.vue
浏览文件 @
3419a7e0
...
...
@@ -33,7 +33,7 @@
<view
class=
"profile-left"
>
<view
class=
"avatar"
>
<image
src=
"@/static/img/add-img/
home1
.png"
src=
"@/static/img/add-img/
defaultAvatar
.png"
mode=
"aspectFit"
></image>
<view
class=
"change-password"
@
click=
"updatePassword"
...
...
pages/home/homeCopy.vue
浏览文件 @
3419a7e0
...
...
@@ -2,7 +2,7 @@
<view
class=
"home-page"
>
<view
class=
"left-tab"
>
<view
class=
"user-info"
>
<image
class=
"user-img"
src=
"@/static/img/add-img/
home1
.png"
></image>
<image
class=
"user-img"
src=
"@/static/img/add-img/
defaultAvatar
.png"
></image>
<text
class=
"text"
>
{{
userName
}}
</text>
</view>
...
...
pages/inspectionContent/inspectionContentList.vue
浏览文件 @
3419a7e0
...
...
@@ -22,7 +22,7 @@
<view
class=
"profile-left"
>
<view
class=
"avatar"
>
<image
src=
"@/static/img/add-img/
home1
.png"
src=
"@/static/img/add-img/
defaultAvatar
.png"
mode=
"aspectFit"
></image>
</view>
...
...
@@ -164,7 +164,7 @@
<view
class=
"first-row"
>
<image
class=
"icon"
src=
"@/static/img/add-img/
home1
.png"
src=
"@/static/img/add-img/
defaultAvatar
.png"
></image>
<text
class=
"status"
>
{{
card
.
statusLable
}}
</text>
</view>
...
...
pages/inspectionContent/inspectionContentNew.vue
浏览文件 @
3419a7e0
...
...
@@ -495,7 +495,7 @@ export default {
const
send
=
dataToSql
(
data
);
const
api
=
this
.
uid
?
inspectApi
.
update
:
inspectApi
.
save
;
api
(
this
.
uid
?
{
id
:
this
.
uid
,
...
send
}
:
send
).
then
((
res
)
=>
{
console
.
log
(
"保存成功"
);
console
.
log
(
"保存成功"
,
res
);
});
},
// 提交
...
...
pages/inspectionManagement/index.vue
浏览文件 @
3419a7e0
<
template
>
<!-- 巡检管理 -->
<view
class=
"inspection-management"
>
<uni-nav-bar
:fixed=
"true"
background-color=
"rgba(214, 240, 255, 0.0)"
status-bar
rightWidth=
"300"
>
<uni-nav-bar
:fixed=
"true"
background-color=
"rgba(214, 240, 255, 0.0)"
status-bar
rightWidth=
"300"
>
<block
slot=
"left"
>
<view
class=
""
@
click=
"back"
>
<text
class=
"iconfont icon-fanhui"
></text>
...
...
@@ -20,8 +15,7 @@
</block>
</uni-nav-bar>
<!-- 搜索项 -->
<SearchCom
@
change=
"change"
/>
<!--
<SearchCom
@
change=
"change"
/>
-->
<!-- 结果 -->
<view
class=
"inspection-management-content"
>
<view
class=
"count-tatal"
>
...
...
@@ -31,21 +25,13 @@
<view
class=
"month-list"
>
<!-- 每月记录 -->
<view
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item.list || []).length"
class=
"seconed-title"
>
{{
item
.
submitTime
||
item
.
time
}}
<view
class=
"month-record-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
v-if=
"(item || []).length"
class=
"seconed-title"
>
{{
'2025-04'
}}
</view>
<view
class=
"inspect-list"
>
<InspectionItem
v-for=
"ele in item.list"
:key=
"ele.uid"
:details=
"ele"
/>
<InspectionItem
:details=
"item"
/>
</view>
</view>
...
...
@@ -55,25 +41,25 @@
<!-- 开始巡检 -->
<!--
<view
class=
"inspection-button"
@
click=
"toPage"
>
开始巡检
</view>
-->
<view
class=
"inspection-button"
@
click=
"openDialog(true)"
>
同步数据
</view
>
<!-- 打包弹窗 -->
<Dialog
v-show=
"isDialog && list.length"
:list=
"list"
@
close=
"openDialog(false)"
></Dialog>
<view
class=
"inspection-button"
@
click=
"openDialog(true)"
>
同步数据
</view>
<!-- 打包弹窗 -->
<Dialog
v-show=
"isDialog && list.length"
:list=
"list"
@
close=
"openDialog(false)"
></Dialog>
</view>
</
template
>
<
script
>
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
{
getDarft
}
from
"@/request/index.js"
;
import
Dialog
from
"./dialog.vue"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
export
default
{
import
SearchCom
from
"@/components/searchCom/index.vue"
;
import
InspectionItem
from
"@/components/inspectionItem/index.vue"
;
import
{
getDarft
}
from
"@/request/index.js"
;
import
Dialog
from
"./dialog.vue"
;
import
{
getAllInspections
}
from
"@/request/index.js"
;
import
Empty
from
"@/components/empty/index.vue"
;
import
inspectApi
from
"@/api/inspect"
;
export
default
{
components
:
{
SearchCom
,
InspectionItem
,
...
...
@@ -91,26 +77,11 @@ export default {
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
();
});
async
mounted
()
{
// this.getInspectRecord()
let
res
=
await
inspectApi
.
selectDataForTime
()
this
.
list
=
res
console
.
log
(
res
.
length
,
'永远永远永远永远=---=>'
)
},
computed
:
{
userInfo
()
{
...
...
@@ -118,6 +89,13 @@ export default {
},
},
methods
:
{
async
getInspectRecord
()
{
let
res
=
await
inspectApi
.
selectList
()
console
.
log
(
'阿斗者'
,
res
)
this
.
list
=
res
||
[]
this
.
countNum
=
this
.
list
.
length
},
// 返回
back
()
{
uni
.
navigateTo
({
...
...
@@ -140,7 +118,9 @@ export default {
// this.isPackedDataBtn =
// all_data.filter((item) => item.synchronization == 0).length > 0;
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
...
...
@@ -258,10 +238,10 @@ export default {
});
},
},
};
};
</
script
>
<
style
scoped
lang=
"less"
>
.uni-nav-bar-text {
.uni-nav-bar-text {
height: 28.8px;
width: 28.8px;
background: #ffffff;
...
...
@@ -278,14 +258,17 @@ export default {
font-size: 16px;
line-height: 28.8px;
}
}
.nav-right {
}
.nav-right {
width: 192px;
}
.header-buttons {
}
.header-buttons {
display: flex;
align-items: center;
margin-left: auto;
.button {
width: 89.6px;
height: 28.8px;
...
...
@@ -299,10 +282,12 @@ export default {
font-weight: 400;
text-align: center;
}
}
.inspection-management {
}
.inspection-management {
background-image: linear-gradient(115deg, #e8f0fb 0%, #e1ebfa 100%);
padding: 0 25.6px;
.inspection-management-content {
.count-tatal {
font-family: PingFangSC-Medium;
...
...
@@ -312,6 +297,7 @@ export default {
font-weight: 400;
height: 22.4px;
line-height: 22.4px;
.num {
font-size: 16px;
color: #3774f6;
...
...
@@ -320,9 +306,11 @@ export default {
margin-right: 1.6px;
}
}
.month-list {
height: calc(100vh - 20.8px - 12.8px - 6.4px - 28.8px - 49.6px - 25px);
overflow: auto;
// padding-bottom: 112px;
.seconed-title {
font-size: 16px;
...
...
@@ -331,11 +319,14 @@ export default {
font-weight: 500;
margin-bottom: 9.6px;
}
.month-record-item {
margin-bottom: 19.2px;
&:last-of-type {
margin: 0;
}
.inspect-list {
display: flex;
flex-wrap: wrap;
...
...
@@ -344,6 +335,7 @@ export default {
}
}
}
.inspection-button {
display: flex;
align-items: center;
...
...
@@ -359,5 +351,5 @@ export default {
box-shadow: 0px 8px 19.2px 0px rgba(51, 104, 246, 0.24);
border-radius: 21.6px;
}
}
}
</
style
>
\ No newline at end of file
pages/shaftInspection/shaftInspectionList.vue
浏览文件 @
3419a7e0
...
...
@@ -24,7 +24,7 @@
<view
class=
"profile-left"
>
<view
class=
"avatar"
>
<image
src=
"@/static/img/add-img/
home1
.png"
src=
"@/static/img/add-img/
defaultAvatar
.png"
mode=
"aspectFit"
></image>
</view>
...
...
pages/shaftInspection/shaftInspectionNew - 副本.vue
浏览文件 @
3419a7e0
...
...
@@ -12,7 +12,7 @@
<view
class=
"profile-box"
>
<view
class=
"profile-left"
>
<view
class=
"avatar"
>
<image
src=
"@/static/img/add-img/
home1
.png"
mode=
"aspectFit"
></image>
<image
src=
"@/static/img/add-img/
defaultAvatar
.png"
mode=
"aspectFit"
></image>
</view>
<view
class=
"info"
>
<view
class=
"username"
>
井道巡检
</view>
...
...
@@ -54,7 +54,7 @@
</view>
</view>
<view
class=
"tip"
>
<image
class=
"tip-icon"
src=
"@/static/img/add-img/
home1
.png"
mode=
"aspectFit"
></image>
请点击“需巡检井道”执行巡检
<image
class=
"tip-icon"
src=
"@/static/img/add-img/
defaultAvatar
.png"
mode=
"aspectFit"
></image>
请点击“需巡检井道”执行巡检
</view>
<view
class=
"tab-content"
>
<!-- 操作区域 -->
...
...
pages/shaftInspection/shaftInspectionNew.vue
浏览文件 @
3419a7e0
...
...
@@ -18,7 +18,7 @@
<view
class=
"profile-left"
>
<view
class=
"avatar"
>
<image
src=
"@/static/img/add-img/
home1
.png"
src=
"@/static/img/add-img/
defaultAvatar
.png"
mode=
"aspectFit"
></image>
</view>
...
...
static/img/add-img/defaultAvatar.png
0 → 100644
浏览文件 @
3419a7e0
18.9 KB
utils/sqllitedb.js
浏览文件 @
3419a7e0
...
...
@@ -115,7 +115,8 @@ export default class SqlliteDB {
name
:
this
.
dbName
,
sql
:
sql
,
success
(
res
)
{
resolve
();
console
.
log
(
'SQL execution result:'
,
res
);
resolve
(
res
);
// 暂时直接返回,方便调试
},
fail
(
e
)
{
console
.
log
(
e
.
message
);
...
...
@@ -124,7 +125,40 @@ export default class SqlliteDB {
});
});
}
// 增删改返回最后增加的id
async
executeReturnDataSQL
(
sql
)
{
console
.
log
(
'Executing SQL:'
,
sql
);
let
_
=
this
return
new
Promise
((
resolve
,
reject
)
=>
{
plus
.
sqlite
.
executeSql
({
name
:
_
.
dbName
,
sql
:
sql
,
success
(
res
)
{
const
queryLastInsertIdSql
=
"SELECT last_insert_rowid() AS lastId"
;
plus
.
sqlite
.
selectSql
({
name
:
_
.
dbName
,
sql
:
queryLastInsertIdSql
,
success
(
result
)
{
if
(
result
&&
result
.
length
>
0
)
{
let
lastInsertId
=
result
[
0
].
lastId
;
console
.
log
(
'Last Insert ID:'
,
lastInsertId
);
resolve
({
success
:
true
,
lastInsertId
:
lastInsertId
});
}
else
{
resolve
({
success
:
true
,
lastInsertId
:
null
});
}
},
fail
(
e
)
{
reject
(
e
);
},
});
},
fail
(
e
)
{
console
.
error
(
'SQL execution failed:'
,
e
.
message
);
reject
(
e
);
},
});
});
}
// 查询使用
async
selectSQL
(
sql
)
{
await
this
.
checkDB
();
...
...
@@ -155,10 +189,10 @@ export default class SqlliteDB {
plus
.
sqlite
.
transaction
({
name
:
this
.
dbName
,
operation
:
oper
,
success
:
function
(
e
)
{
success
:
function
(
e
)
{
resolve
();
},
fail
:
function
(
e
)
{
fail
:
function
(
e
)
{
reject
(
e
.
message
);
},
});
...
...
@@ -180,6 +214,7 @@ export default class SqlliteDB {
}
static
async
markDataAsImported
(
sqllitedb
)
{
await
sqllitedb
.
executeSQL
(
'INSERT OR REPLACE INTO SYS_CONFIG (key, value) VALUES ("data_imported", "true")'
);
await
sqllitedb
.
executeSQL
(
'INSERT OR REPLACE INTO SYS_CONFIG (key, value) VALUES ("data_imported", "true")'
);
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论