This commit is contained in:
2020-08-18 09:43:15 +08:00
parent 21eb68aeab
commit 0b577c501c
4 changed files with 48 additions and 7 deletions

View File

@@ -3,7 +3,9 @@
---@field loginName
---@field groupId
---@field imageUrl string 头像
---@field char string 首字母
---@field PY
---@field PYFirst string 首字母
---@field isHeadPy
DBUser = {}
local db = {}
@@ -34,7 +36,7 @@ function DBUser.onGetUsers(userlist, groupList, permissions)
--------------------------------------------
for i, v in ipairs(userlist) do
v.PY = CLUIFormUtl.GetChineseSpell(v.loginName) -- 拼音首字母
v.PYFirst = v.PY[1] -- 设置首字母
v.PYFirst = string.sub(v.PY, 1, 1) -- 设置首字母
if v.loginName == "系统生成" then
name = joinStr(v.loginNo, "_", v.loginName)
else
@@ -79,9 +81,46 @@ function DBUser.wrapUserList(userlist, groupList)
end
)
-- for i, v in ipairs(userlist) do
-- printe(v.PY)
-- end
db.userList = userlist
db.userPyIndexs = {} -- 拼音字母所在的index
db.groupTree = {}
db.userGroupList = {}
local char = ""
---@param v _DBUser
for i, v in ipairs(userlist) do
if char == "" or char ~= v.PYFirst then
char = v.PYFirst
v.isHeadPy = true
db.userPyIndexs[v.PYFirst] = i
else
v.isHeadPy = false
end
local list = db.userGroupList[v.groupId] or {}
table.insert(list, v)
db.userGroupList[v.groupId] = list
end
--//TODO:组装部门的数据
end
function DBUser.getUserList()
return db.userList
end
function DBUser.getGroupList(parentGId)
parentGId = parentGId or -1
return db.groupTree[parentGId]
end
function DBUser.getUsersByGId(groupId)
return db.userGroupList[groupId]
end
---public 取得拼音字母所在的index
function DBUser.getUserPyIndex(pyChar)
return db.userPyIndexs[pyChar]
end
function DBUser.getFilters(group)

View File

@@ -103,7 +103,9 @@ function TRPSetting:setEventDelegate()
Utl.chgToSDCard(
Path.Combine(Application.persistentDataPath, CLPathCfg.self.basePath, "download")
)
Directory.Delete(downloadDir)
if Directory.Exists(downloadDir) then
Directory.Delete(downloadDir)
end
pcall(cleanRes)
local panel = CLPanelManager.getPanel(CLMainBase.self.firstPanel)

View File

@@ -1525,7 +1525,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &4350464794319423872
Transform:
m_ObjectHideFlags: 0