Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2fc0e2ed
authored
Mar 24, 2025
by
huyue
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V4.51' of
http://192.168.3.233:8090/glsx/gl_tape
into SAAS+V4.51
2 parents
c74f4519
85ab95d0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
2 deletions
manifest.json
mixin/record/merge.js
utils/cache/constantData.js
manifest.json
View file @
2fc0e2e
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"name"
:
"展业助手"
,
"name"
:
"展业助手"
,
"appid"
:
"__UNI__D3BD3DF"
,
"appid"
:
"__UNI__D3BD3DF"
,
"description"
:
""
,
"description"
:
""
,
"versionName"
:
"2.
5
.0"
,
"versionName"
:
"2.
6
.0"
,
"versionCode"
:
"2
5
0"
,
"versionCode"
:
"2
6
0"
,
"transformPx"
:
false
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
/*
5
+App特有相关
*/
"app-plus"
:
{
"app-plus"
:
{
...
...
mixin/record/merge.js
View file @
2fc0e2e
...
@@ -2,8 +2,152 @@ import { storageApi } from '@/utils/cache'
...
@@ -2,8 +2,152 @@ import { storageApi } from '@/utils/cache'
export
default
{
export
default
{
mounted
()
{
mounted
()
{
this
.
mergeRecord
()
this
.
mergeRecord
()
this
.
clearPrevFile
()
},
},
methods
:
{
methods
:
{
deleteDirectory
(
dirPath
)
{
const
_this
=
this
plus
.
io
.
resolveLocalFileSystemURL
(
dirPath
,
function
(
entry
)
{
if
(
entry
.
isDirectory
)
{
const
directoryReader
=
entry
.
createReader
()
directoryReader
.
readEntries
(
function
(
entries
)
{
if
(
entries
.
length
===
0
)
{
// 如果目录为空,直接删除
entry
.
remove
(
function
()
{
console
.
log
(
'目录删除成功:'
,
dirPath
)
uni
.
$logger
.
local
.
info
(
`目录删除成功: ->
${
dirPath
}
`
)
},
function
(
e
)
{
console
.
log
(
'目录删除失败:'
,
e
.
message
)
uni
.
$logger
.
local
.
info
(
`目录删除失败: ->
${
dirPath
}
->
${
e
.
message
}
`
)
}
)
}
else
{
// 递归删除子文件和子目录
let
deleteCount
=
0
const
totalEntries
=
entries
.
length
function
processNextEntry
()
{
if
(
deleteCount
>=
totalEntries
)
{
// 所有条目处理完毕,尝试删除当前目录
entry
.
remove
(
function
()
{
console
.
log
(
'目录删除成功:'
,
dirPath
)
uni
.
$logger
.
local
.
info
(
`目录删除成功: ->
${
dirPath
}
`
)
},
function
(
e
)
{
console
.
log
(
'目录删除失败:'
,
e
.
message
)
uni
.
$logger
.
local
.
info
(
`目录删除失败: ->
${
dirPath
}
->
${
e
.
message
}
`
)
}
)
return
}
const
entry
=
entries
[
deleteCount
]
entry
.
getMetadata
(
function
(
metadata
)
{
if
(
entry
.
isFile
)
{
// 删除文件
entry
.
remove
(
function
()
{
console
.
log
(
'文件删除成功:'
,
entry
.
fullPath
)
uni
.
$logger
.
local
.
info
(
`文件删除成功: ->
${
entry
.
fullPath
}
`
)
deleteCount
++
processNextEntry
()
// 处理下一个条目
},
function
(
e
)
{
console
.
log
(
'文件删除失败:'
,
e
.
message
)
uni
.
$logger
.
local
.
info
(
`文件删除失败: ->
${
entry
.
fullPath
}
->
${
e
.
message
}
`
)
deleteCount
++
processNextEntry
()
// 处理下一个条目
}
)
}
else
if
(
entry
.
isDirectory
)
{
// 递归删除子目录
_this
.
deleteDirectory
(
entry
.
fullPath
)
deleteCount
++
processNextEntry
()
// 处理下一个条目
}
},
function
(
e
)
{
console
.
log
(
'获取元数据失败:'
,
e
.
message
)
deleteCount
++
processNextEntry
()
// 处理下一个条目
}
)
}
// 开始处理第一个条目
processNextEntry
()
}
},
function
(
e
)
{
console
.
log
(
'读取目录内容失败:'
,
e
.
message
)
uni
.
$logger
.
local
.
info
(
`读取目录内容失败: ->
${
e
.
message
}
`
)
}
)
}
else
{
console
.
log
(
'路径不是目录:'
,
dirPath
)
uni
.
$logger
.
local
.
info
(
`路径不是目录: ->
${
dirPath
}
`
)
}
},
function
(
e
)
{
console
.
log
(
'无法访问目录:'
,
e
.
message
)
uni
.
$logger
.
local
.
info
(
`无法访问目录: ->
${
dirPath
}
`
)
}
)
},
clearPrevFile
()
{
let
version
=
plus
.
runtime
.
version
let
clearVersion
=
uni
.
$storage
.
get
(
'clearVersion'
)
if
(
clearVersion
!=
version
)
{
const
wwwPath
=
plus
.
io
.
convertLocalFileSystemURL
(
'doc'
)
// const filesPath = wwwPath.replace(/apps.+/, 'apps/')
// console.log(filesPath)
const
filesPath
=
wwwPath
.
replace
(
/gltap.+/
,
'gltap/'
)
this
.
getDirectoryContents
(
filesPath
)
}
setTimeout
(()
=>
{
uni
.
$storage
.
set
(
'clearVersion'
,
version
)
},
5000
)
},
getDirectoryContents
(
dirPath
)
{
// 解析目录路径
const
_this
=
this
const
excludeFile
=
[
'databases'
]
plus
.
io
.
resolveLocalFileSystemURL
(
dirPath
,
function
(
entry
)
{
// 创建 DirectoryReader
const
directoryReader
=
entry
.
createReader
()
// 读取目录内容
directoryReader
.
readEntries
(
function
(
entries
)
{
console
.
log
(
'目录内容读取成功:'
)
_this
.
directoryList
=
entries
entries
.
forEach
(
function
(
entry
)
{
console
.
log
(
'文件路径:'
,
entry
.
fullPath
)
if
(
!
excludeFile
.
includes
(
entry
.
name
))
{
_this
.
deleteDirectory
(
entry
.
fullPath
)
}
})
},
function
(
e
)
{
console
.
log
(
'读取目录内容失败:'
,
e
.
message
)
}
)
},
function
(
e
)
{
console
.
log
(
'无法访问目录:'
,
e
.
message
)
}
)
},
async
mergeRecord
()
{
async
mergeRecord
()
{
try
{
try
{
const
tempRecords
=
storageApi
.
getRecords
(
'preRecordList'
)
||
[]
const
tempRecords
=
storageApi
.
getRecords
(
'preRecordList'
)
||
[]
...
...
utils/cache/constantData.js
View file @
2fc0e2e
...
@@ -25,6 +25,7 @@ export const STORAGE_OBJECTKEY = {
...
@@ -25,6 +25,7 @@ export const STORAGE_OBJECTKEY = {
recordSuccessList
:
'recordSuccessList'
,
recordSuccessList
:
'recordSuccessList'
,
historyList
:
'historyList'
,
historyList
:
'historyList'
,
storageVersion
:
'storageVersion'
,
storageVersion
:
'storageVersion'
,
clearVersion
:
'clearVersion'
,
byd_mock_data
:
'byd_mock_data'
,
byd_mock_data
:
'byd_mock_data'
,
boutique_mock_data
:
'boutique_mock_data'
,
boutique_mock_data
:
'boutique_mock_data'
,
findReceptionpriproConfigList
:
'findReceptionpriproConfigList'
,
findReceptionpriproConfigList
:
'findReceptionpriproConfigList'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment