Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
ee1ff23c
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ee1ff23c
编写于
7月 06, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
0e02d3dd
7a790bc2
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
83 addition
and
60 deletion
+83
-60
packages/uni-cli-shared/components/unicloud-db.vue
packages/uni-cli-shared/components/unicloud-db.vue
+82
-59
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
未找到文件。
packages/uni-cli-shared/components/unicloud-db.vue
浏览文件 @
ee1ff23c
...
...
@@ -203,7 +203,7 @@ export default {
// #ifdef MP-TOUTIAO
let
changeName
const
events
=
this
.
$scope
.
dataset
.
eventOpts
const
events
=
this
.
$scope
.
dataset
.
eventOpts
||
[]
for
(
var
i
=
0
;
i
<
events
.
length
;
i
++
)
{
const
event
=
events
[
i
]
if
(
event
[
0
].
includes
(
'
^load
'
))
{
...
...
@@ -410,63 +410,7 @@ export default {
complete
&&
complete
()
})
},
_execLoadData
(
callback
,
clear
)
{
if
(
this
.
loading
)
{
return
}
this
.
loading
=
true
this
.
errorMessage
=
''
this
.
_getExec
().
then
((
res
)
=>
{
this
.
loading
=
false
const
{
data
,
count
}
=
res
.
result
this
.
_isEnded
=
data
.
length
<
this
.
pageSize
this
.
hasMore
=
!
this
.
_isEnded
const
data2
=
this
.
getone
?
(
data
.
length
?
data
[
0
]
:
undefined
)
:
data
if
(
this
.
getcount
)
{
this
.
paginationInternal
.
count
=
count
}
callback
&&
callback
(
data2
,
this
.
_isEnded
,
this
.
paginationInternal
)
this
.
_dispatchEvent
(
events
.
load
,
data2
)
if
(
this
.
getone
||
this
.
pageData
===
pageMode
.
replace
)
{
this
.
dataList
=
data2
}
else
{
if
(
clear
)
{
this
.
dataList
=
data2
}
else
{
this
.
dataList
.
push
(...
data2
)
}
}
// #ifdef H5
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
this
.
_debugDataList
.
length
=
0
const
formatData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dataList
))
if
(
Array
.
isArray
(
this
.
dataList
))
{
this
.
_debugDataList
.
push
(...
formatData
)
}
else
{
this
.
_debugDataList
.
push
(
formatData
)
}
}
// #endif
}).
catch
((
err
)
=>
{
this
.
loading
=
false
this
.
errorMessage
=
err
callback
&&
callback
()
this
.
$emit
(
events
.
error
,
err
)
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
console
.
error
(
err
)
}
})
},
_getExec
()
{
getTemp
(
isTemp
=
true
)
{
/* eslint-disable no-undef */
let
db
=
uniCloud
.
database
()
...
...
@@ -516,10 +460,89 @@ export default {
if
(
this
.
gettreepath
)
{
getOptions
.
getTreePath
=
treeOptions
}
db
=
db
.
skip
(
size
*
(
current
-
1
)).
limit
(
size
).
get
(
getOptions
)
db
=
db
.
skip
(
size
*
(
current
-
1
)).
limit
(
size
)
if
(
isTemp
)
{
db
=
db
.
getTemp
(
getOptions
)
db
.
udb
=
this
}
else
{
db
=
db
.
get
(
getOptions
)
}
return
db
},
setResult
(
result
)
{
if
(
result
.
code
===
0
)
{
this
.
_execLoadDataSuccess
(
result
)
}
else
{
this
.
_execLoadDataFail
(
new
Error
(
result
.
message
))
}
},
_execLoadData
(
callback
,
clear
)
{
if
(
this
.
loading
)
{
return
}
this
.
loading
=
true
this
.
errorMessage
=
''
this
.
_getExec
().
then
((
res
)
=>
{
this
.
loading
=
false
this
.
_execLoadDataSuccess
(
res
.
result
,
callback
,
clear
)
// #ifdef H5
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
this
.
_debugDataList
.
length
=
0
const
formatData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dataList
))
if
(
Array
.
isArray
(
this
.
dataList
))
{
this
.
_debugDataList
.
push
(...
formatData
)
}
else
{
this
.
_debugDataList
.
push
(
formatData
)
}
}
// #endif
}).
catch
((
err
)
=>
{
this
.
loading
=
false
this
.
_execLoadDataFail
(
err
,
callback
)
})
},
_execLoadDataSuccess
(
result
,
callback
,
clear
)
{
const
{
data
,
count
}
=
result
this
.
_isEnded
=
data
.
length
<
this
.
pageSize
this
.
hasMore
=
!
this
.
_isEnded
const
data2
=
this
.
getone
?
(
data
.
length
?
data
[
0
]
:
undefined
)
:
data
if
(
this
.
getcount
)
{
this
.
paginationInternal
.
count
=
count
}
callback
&&
callback
(
data2
,
this
.
_isEnded
,
this
.
paginationInternal
)
this
.
_dispatchEvent
(
events
.
load
,
data2
)
if
(
this
.
getone
||
this
.
pageData
===
pageMode
.
replace
)
{
this
.
dataList
=
data2
}
else
{
if
(
clear
)
{
this
.
dataList
=
data2
}
else
{
this
.
dataList
.
push
(...
data2
)
}
}
},
_execLoadDataFail
(
err
,
callback
)
{
this
.
errorMessage
=
err
callback
&&
callback
()
this
.
$emit
(
events
.
error
,
err
)
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
console
.
error
(
err
)
}
},
_getExec
()
{
return
this
.
getTemp
(
false
)
},
_execRemove
(
id
,
action
,
success
,
fail
,
complete
,
needConfirm
,
needLoading
,
loadingTitle
)
{
if
(
!
this
.
collection
||
!
id
)
{
return
...
...
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
ee1ff23c
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录