Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 18caa65a
authored
Nov 27, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化请求次数
1 parent
f14f0cc6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
html/merchant/edit.html
html/merchant/edit.html
View file @
18caa65
...
@@ -741,10 +741,10 @@ var _currentMerchantLevel = '' //当前的账户等级
...
@@ -741,10 +741,10 @@ var _currentMerchantLevel = '' //当前的账户等级
var
_superMerchantInfo
=
{}
//上级商户的信息
var
_superMerchantInfo
=
{}
//上级商户的信息
var
_searchValue
=
''
var
_searchValue
=
''
var
_searchCount
=
0
var
_searchCount
=
0
// var isDropDownOpen = false; // 用于追踪下拉框状态的标志
// var _initFactoryCheckArr = []
// var _initFactoryCheckArr = []
function
loadSuperiorMerchants
(
pageNum
=
1
)
{
function
loadSuperiorMerchants
(
pageNum
=
1
)
{
// console.log('accountLevelUpdate',_currentMerchantLevel)
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
var
params
=
{
var
params
=
{
method
:
'merchants.api.open.findMerchantListByPage'
,
method
:
'merchants.api.open.findMerchantListByPage'
,
...
@@ -811,7 +811,7 @@ var mySelect = layui.xmSelect.render({
...
@@ -811,7 +811,7 @@ var mySelect = layui.xmSelect.render({
});
});
var
isXmSelectOpen
=
false
;
var
isXmSelectOpen
=
false
;
$
(
'#superiorMerchantSelect'
).
on
(
'
click
'
,
function
()
{
$
(
'#superiorMerchantSelect'
).
on
(
'
focusin
'
,
function
()
{
isXmSelectOpen
=
!
isXmSelectOpen
;
isXmSelectOpen
=
!
isXmSelectOpen
;
});
});
...
@@ -822,12 +822,14 @@ $(document).on('mouseup', function(e) {
...
@@ -822,12 +822,14 @@ $(document).on('mouseup', function(e) {
// 检查点击是否在下拉框内部或下拉框已关闭
// 检查点击是否在下拉框内部或下拉框已关闭
if
(
!
container
.
is
(
e
.
target
)
&&
container
.
has
(
e
.
target
).
length
===
0
&&
!
isXmSelectOpen
)
{
if
(
!
container
.
is
(
e
.
target
)
&&
container
.
has
(
e
.
target
).
length
===
0
&&
!
isXmSelectOpen
)
{
// 下拉框关闭时的逻辑
// 下拉框关闭时的逻辑
isXmSelectOpen
=
true
resetXmSelectSearch
();
resetXmSelectSearch
();
}
}
});
});
function
resetXmSelectSearch
()
{
function
resetXmSelectSearch
()
{
// 重置 currentPage 为初始值
// 重置 currentPage 为初始值
currentPage
=
1
;
currentPage
=
1
;
_searchValue
=
''
var
superiorMerchant
=
layui
.
xmSelect
.
get
(
'#superiorMerchantSelect'
,
true
)?.
getValue
();
var
superiorMerchant
=
layui
.
xmSelect
.
get
(
'#superiorMerchantSelect'
,
true
)?.
getValue
();
// // 重新加载数据
// // 重新加载数据
loadSuperiorMerchants
(
currentPage
).
then
(
function
(
list
)
{
loadSuperiorMerchants
(
currentPage
).
then
(
function
(
list
)
{
...
@@ -1060,11 +1062,11 @@ function clearRoleAuthTabContent() {
...
@@ -1060,11 +1062,11 @@ function clearRoleAuthTabContent() {
// '本身的商户类型',merchantForm.accountType,
// '本身的商户类型',merchantForm.accountType,
// '本身的子商户类型',merchantForm.subAccountTypeList,
// '本身的子商户类型',merchantForm.subAccountTypeList,
// '页面的账户等级',_currentMerchantLevel)
// '页面的账户等级',_currentMerchantLevel)
renderAccountTypes
(
_superMerchantInfo
?.
accountType
?.
split
(
','
),
merchantForm
.
accountType
,
merchantForm
.
subAccountTypeList
,
_currentMerchantLevel
);
renderAccountTypes
(
_superMerchantInfo
?.
accountType
?.
split
(
','
),
merchantForm
.
accountType
,
merchantForm
.
subAccountTypeList
,
_currentMerchantLevel
);
clearRoleAuthTabContent
();
clearRoleAuthTabContent
();
prepareExecuteFindMenuFun
()
prepareExecuteFindMenuFun
()
loadSuperiorMerchants
()
// loadSuperiorMerchants()
resetXmSelectSearch
()
form
.
render
();
// 可选,根据需要重新渲染表单
form
.
render
();
// 可选,根据需要重新渲染表单
});
});
...
...
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