Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
28d77f08
提交
28d77f08
authored
4月 09, 2025
作者:
zs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edit
上级
19bf2018
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
74 行增加
和
85 行删除
+74
-85
inspect.js
api/inspect.js
+42
-6
table.js
api/sqllite/table.js
+1
-1
index.vue
components/inspectionItem/index.vue
+12
-1
dialog.vue
pages/inspectionManagement/dialog.vue
+1
-1
index.vue
pages/inspectionManagement/index.vue
+17
-76
sqllitedb.js
utils/sqllitedb.js
+1
-0
没有找到文件。
api/inspect.js
浏览文件 @
28d77f08
...
@@ -20,8 +20,15 @@ export default {
...
@@ -20,8 +20,15 @@ export default {
}
}
},
},
async
selectDataForTime
(
data
)
{
async
selectDataForTime
(
data
)
{
console
.
log
(
'传进来了'
,
data
.
inspectionTime
)
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
try
{
try
{
let
inspectionTimeCondition
=
''
;
if
(
Array
.
isArray
(
data
.
inspectionTime
)
&&
data
.
inspectionTime
.
length
===
2
)
{
const
startTime
=
new
Date
(
data
.
inspectionTime
[
0
]).
getTime
();
const
endTime
=
new
Date
(
data
.
inspectionTime
[
1
]).
getTime
();
inspectionTimeCondition
=
`AND inspectionTime >= '
${
startTime
}
' AND inspectionTime <= '
${
endTime
}
'`
;
}
let
rs
=
await
sqllitedb
.
selectSQL
(
let
rs
=
await
sqllitedb
.
selectSQL
(
`SELECT id,inspectionType,inspectionCode
`SELECT id,inspectionType,inspectionCode
,recordName
,recordName
...
@@ -30,16 +37,17 @@ export default {
...
@@ -30,16 +37,17 @@ export default {
,inspectionTime
,inspectionTime
,isException
,isException
,synFlag
,synFlag
,createTime
,createTime
,delFlag
FROM
${
table
.
inspectionRecordName
}
FROM
${
table
.
inspectionRecordName
}
where 1=1
where 1=1
${
data
.
inspectionType
?
`AND inspectionType = '
${
data
.
inspectionType
}
'`
:
''
}
${
data
.
inspectionType
?
`AND inspectionType = '
${
data
.
inspectionType
}
'`
:
''
}
${
data
.
synFlag
?
`AND synFlag = '
${
data
.
synFlag
}
'`
:
''
}
${
data
.
synFlag
?
`AND synFlag = '
${
data
.
synFlag
}
'`
:
''
}
${
data
.
isException
?
`AND isException = '
${
data
.
isException
}
'`
:
''
}
${
data
.
isException
?
`AND isException = '
${
data
.
isException
}
'`
:
''
}
${
data
.
inspectionTime
?
`AND inspectionTime >='
${
new
Date
(
data
.
inspectionTime
[
0
]).
getTime
()
}
'`
:
''
}
${
inspectionTimeCondition
}
${
data
.
inspectionTime
?
`AND inspectionTime <='
${
new
Date
(
data
.
inspectionTime
[
1
]).
getTime
()
}
'`
:
''
}
and delFlag = 0
order by createTime desc`
order by createTime desc`
);
);
return
rs
;
return
rs
;
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
console
.
log
(
e
.
message
);
...
@@ -61,11 +69,11 @@ export default {
...
@@ -61,11 +69,11 @@ export default {
// await sqllitedb.closeDB();
// await sqllitedb.closeDB();
}
}
},
},
async
remove
(
id
)
{
async
remove
(
arr
)
{
if
(
!
id
)
{
if
(
!
id
)
{
return
;
return
;
}
}
let
sql
=
`delete from
${
table
.
inspectionRecordName
}
where id
=
'
${
id
}
'`
;
let
sql
=
`delete from
${
table
.
inspectionRecordName
}
where id
in
'
${
id
}
'`
;
try
{
try
{
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
await
sqllitedb
.
executeSQL
(
sql
);
await
sqllitedb
.
executeSQL
(
sql
);
...
@@ -75,7 +83,35 @@ export default {
...
@@ -75,7 +83,35 @@ export default {
// await sqllitedb.closeDB();
// await sqllitedb.closeDB();
}
}
},
},
async
saveBatch
(
list
)
{
async
batchRemove
(
id
)
{
let
sql
=
`update
${
table
.
inspectionRecordName
}
set delFlag=1 where id = '
${
id
}
'`
;
console
.
log
(
sql
)
try
{
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
let
rs
=
await
sqllitedb
.
executeReturnDataSQL
(
sql
);
return
rs
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
}
finally
{
// await sqllitedb.closeDB();
}
},
async
remove
(
arr
)
{
if
(
!
id
)
{
return
;
}
let
sql
=
`delete from
${
table
.
inspectionRecordName
}
where id = '
${
id
}
'`
;
try
{
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
await
sqllitedb
.
executeSQL
(
sql
);
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
}
finally
{
// await sqllitedb.closeDB();
}
},
async
saveBatch
(
list
)
{
if
(
list
.
length
===
0
)
{
if
(
list
.
length
===
0
)
{
return
;
return
;
}
}
...
...
api/sqllite/table.js
浏览文件 @
28d77f08
...
@@ -100,7 +100,7 @@ module.exports = {
...
@@ -100,7 +100,7 @@ module.exports = {
},
},
{
{
field
:
"delFlag"
,
field
:
"delFlag"
,
format
:
"
TEXT
"
,
format
:
"
INTEGER DEFAULT 0
"
,
},
},
{
{
field
:
"isException"
,
field
:
"isException"
,
...
...
components/inspectionItem/index.vue
浏览文件 @
28d77f08
<
template
>
<
template
>
<view
class=
"inspect-item"
@
click=
"toPage"
>
<view
class=
"inspect-item"
@
click=
"toPage"
@
longpress=
"onLongPress"
>
<view
class=
"content"
:class=
"details.synFlag == 1 ? 'synchronization' : ''"
>
<view
class=
"content"
:class=
"details.synFlag == 1 ? 'synchronization' : ''"
>
<view
class=
"name"
>
{{
<view
class=
"name"
>
{{
synFlags
[
details
.
synFlag
]
synFlags
[
details
.
synFlag
]
...
@@ -85,6 +85,17 @@
...
@@ -85,6 +85,17 @@
url
:
`
${
url
}
&uid=
${
this
.
details
.
id
}
`
,
url
:
`
${
url
}
&uid=
${
this
.
details
.
id
}
`
,
});
});
},
},
onLongPress
(){
uni
.
showModal
({
title
:
'删除确认'
,
content
:
'确定要删除此项吗?'
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
this
.
$emit
(
'longpress'
,
this
.
details
)
}
}
});
}
},
},
};
};
</
script
>
</
script
>
...
...
pages/inspectionManagement/dialog.vue
浏览文件 @
28d77f08
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<text
class=
"title"
>
待打包数据
</text>
<text
class=
"title"
>
待打包数据
</text>
</view>
</view>
<view
class=
"row-item count-num"
>
<view
class=
"row-item count-num"
>
<text
class=
"num"
>
{{
notSynchronizationL
ist
.
length
}}
</text>
<text
class=
"num"
>
{{
l
ist
.
length
}}
</text>
<text>
条
</text>
<text>
条
</text>
</view>
</view>
...
...
pages/inspectionManagement/index.vue
浏览文件 @
28d77f08
...
@@ -30,7 +30,8 @@
...
@@ -30,7 +30,8 @@
{{
index
}}
{{
index
}}
</view>
</view>
<view
class=
"inspect-list"
>
<view
class=
"inspect-list"
>
<InspectionItem
v-for=
"(its,index) in item"
:key=
"its.id"
:details=
"its"
/>
<InspectionItem
v-for=
"(its,idx) in item"
:details=
"its"
@
longpress=
"onLongPress"
/>
</view>
</view>
</view>
</view>
...
@@ -75,6 +76,7 @@
...
@@ -75,6 +76,7 @@
// 搜索条件
// 搜索条件
},
},
countNum
:
0
,
// 统计查询总数
countNum
:
0
,
// 统计查询总数
currentIndexToDelete
:
null
};
};
},
},
async
mounted
()
{
async
mounted
()
{
...
@@ -105,9 +107,8 @@
...
@@ -105,9 +107,8 @@
}
}
},
},
async
init
()
{
async
init
()
{
console
.
log
(
'这都是个啥'
,
this
.
searchForm
)
let
res
=
await
inspectApi
.
selectDataForTime
(
this
.
searchForm
)
let
res
=
await
inspectApi
.
selectDataForTime
(
this
.
searchForm
)
this
.
propList
=
res
this
.
propList
=
res
.
filter
(
e
=>
e
.
synFlag
==
0
)
this
.
countNum
=
res
.
length
this
.
countNum
=
res
.
length
const
resultMap
=
{};
const
resultMap
=
{};
res
.
forEach
(
e
=>
{
res
.
forEach
(
e
=>
{
...
@@ -127,79 +128,8 @@
...
@@ -127,79 +128,8 @@
});
});
this
.
list
=
resultMap
this
.
list
=
resultMap
return
return
const
all_data
=
this
.
all_data
||
[];
// this.isPackedDataBtn =
// all_data.filter((item) => item.synchronization == 0).length > 0;
const
{
inspectionTime
=
[]
}
=
this
.
searchForm
;
const
startTime
=
inspectionTime
[
0
];
const
endTime
=
inspectionTime
[
1
];
// 第一步: 筛选有效的时间范围
const
timeFrame
=
all_data
.
filter
((
item
)
=>
{
if
(
!
inspectionTime
.
length
)
{
return
true
;
}
else
{
return
(
new
Date
(
startTime
).
getTime
()
<=
new
Date
(
item
.
submitTime
).
getTime
()
&&
new
Date
(
item
.
submitTime
).
getTime
()
<=
new
Date
(
endTime
).
getTime
()
);
}
});
// 属于同一个月的数据 聚合
const
tempAllData
=
{};
timeFrame
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitMonth
]
||
[];
if
(
val
.
length
)
{
tempAllData
[
item
.
submitMonth
].
push
(
item
);
}
else
{
tempAllData
[
item
.
submitMonth
]
=
[
item
];
}
});
const
keys
=
Object
.
keys
(
tempAllData
);
// 第二步: 根据搜索条件过滤
const
list
=
keys
.
map
((
key
)
=>
{
return
{
time
:
key
,
list
:
this
.
coverData
(
tempAllData
[
key
]),
};
});
this
.
countNum
=
0
;
list
.
forEach
((
item
)
=>
{
this
.
countNum
+=
item
.
list
.
length
;
});
this
.
list
=
list
;
console
.
log
(
"this.list"
,
this
.
list
);
},
},
coverData
(
arr
=
[])
{
console
.
log
(
"arr"
,
arr
);
const
{
isException
=
""
,
inspectionType
=
""
,
synchronization
=
""
,
}
=
this
.
searchForm
;
return
arr
.
filter
((
item
)
=>
{
return
(
(
!
isException
||
isException
==
"all"
||
item
.
isException
==
isException
)
&&
(
!
inspectionType
||
inspectionType
==
"all"
||
item
.
inspectionType
==
inspectionType
)
&&
(
!
synchronization
||
synchronization
==
"all"
||
item
.
synchronization
==
synchronization
)
);
});
},
openDialog
(
show
)
{
openDialog
(
show
)
{
this
.
isDialog
=
show
;
this
.
isDialog
=
show
;
if
(
!
show
)
{
if
(
!
show
)
{
...
@@ -211,10 +141,21 @@
...
@@ -211,10 +141,21 @@
if
(
e
.
inspectionTime
&&
e
.
inspectionTime
.
length
==
0
)
{
if
(
e
.
inspectionTime
&&
e
.
inspectionTime
.
length
==
0
)
{
delete
this
.
searchForm
.
inspectionTime
delete
this
.
searchForm
.
inspectionTime
}
}
console
.
log
(
'搜索'
,
this
.
searchForm
)
console
.
log
(
'搜索'
,
this
.
searchForm
)
this
.
init
(
this
.
searchForm
);
this
.
init
(
this
.
searchForm
);
},
},
async
onLongPress
(
item
)
{
let
rs
=
await
inspectApi
.
batchRemove
(
item
.
id
)
if
(
rs
){
await
this
.
init
()
}
},
deleteItem
()
{
if
(
this
.
currentIndexToDelete
!==
null
)
{
this
.
list
.
splice
(
this
.
currentIndexToDelete
,
1
);
this
.
currentIndexToDelete
=
null
;
// 重置索引
}
},
toPage
()
{
toPage
()
{
uni
.
showLoading
();
uni
.
showLoading
();
...
...
utils/sqllitedb.js
浏览文件 @
28d77f08
...
@@ -137,6 +137,7 @@ export default class SqlliteDB {
...
@@ -137,6 +137,7 @@ export default class SqlliteDB {
name
:
_
.
dbName
,
name
:
_
.
dbName
,
sql
:
queryLastInsertIdSql
,
sql
:
queryLastInsertIdSql
,
success
(
result
)
{
success
(
result
)
{
console
.
log
(
'理论上'
,
result
)
if
(
result
&&
result
.
length
>
0
)
{
if
(
result
&&
result
.
length
>
0
)
{
let
lastInsertId
=
result
[
0
].
lastId
;
let
lastInsertId
=
result
[
0
].
lastId
;
resolve
({
success
:
true
,
lastInsertId
:
lastInsertId
});
resolve
({
success
:
true
,
lastInsertId
:
lastInsertId
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论