up
This commit is contained in:
@@ -27,7 +27,8 @@ DBCust.FilterGroup = {
|
||||
custTypeList = "custTypeList", -- list 客户类型
|
||||
dealFlagList = "dealFlagList", -- list 客户状态
|
||||
loginNoList = "loginNoList", -- list 归属工号
|
||||
taskList = "taskList" -- list 任务名称
|
||||
taskList = "taskList", -- list 任务名称
|
||||
followUpTypeList = "followUpTypeList" -- 跟进类型
|
||||
}
|
||||
|
||||
DBCust.FieldType = {
|
||||
@@ -37,7 +38,16 @@ DBCust.FieldType = {
|
||||
number = "数字文本框",
|
||||
dateTime = "时间文本框",
|
||||
text = "普通文本框",
|
||||
phone = "电话号码框"
|
||||
phone = "电话号码框",
|
||||
empty ="empty"
|
||||
}
|
||||
---@class _FieldMode
|
||||
_FieldMode = {
|
||||
inputOnly = 0, -- 纯输入
|
||||
showOnly = 1, -- 纯展示模式
|
||||
modifyOnly = 2, -- 修改模式
|
||||
showAndModify = 3, -- 展示械式,同时也可以modify
|
||||
button = 4, -- 类似按钮的功能
|
||||
}
|
||||
|
||||
DBCust.onGetFilter = function(data)
|
||||
|
||||
@@ -4,12 +4,14 @@ require "db.DBCust"
|
||||
require "db.DBStatistics"
|
||||
require "db.DBUser"
|
||||
require "db.DBOrder"
|
||||
require "db.DBTextures"
|
||||
|
||||
---@class DBRoot
|
||||
DBRoot = {}
|
||||
DBRoot.db = {}
|
||||
DBRoot.init = function()
|
||||
DBMessage.init()
|
||||
DBTextures.init()
|
||||
NetProto.setReceiveCMDCallback(DBRoot.onReceiveData)
|
||||
end
|
||||
|
||||
@@ -18,6 +20,7 @@ DBRoot.clean = function()
|
||||
DBMessage.clean()
|
||||
DBCust.clean()
|
||||
DBStatistics.clean()
|
||||
DBTextures.clean()
|
||||
end
|
||||
|
||||
DBRoot.funcs = {
|
||||
|
||||
53
Assets/trCRM/upgradeRes4Dev/priority/lua/db/DBTextures.lua
Normal file
53
Assets/trCRM/upgradeRes4Dev/priority/lua/db/DBTextures.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
DBTextures = {}
|
||||
local db = {}
|
||||
|
||||
function DBTextures.init()
|
||||
InvokeEx.cancelInvoke(DBTextures.releaseTimeout)
|
||||
InvokeEx.invoke(DBTextures.releaseTimeout, 60)
|
||||
end
|
||||
|
||||
function DBTextures.clean()
|
||||
InvokeEx.cancelInvoke(DBTextures.releaseTimeout)
|
||||
for k, v in ipairs(db) do
|
||||
GameObject.DestroyImmediate(v)
|
||||
end
|
||||
db = {}
|
||||
end
|
||||
|
||||
function DBTextures.releaseTimeout()
|
||||
for k, v in ipairs(db) do
|
||||
if DateEx.nowMS - v.lastUseTime > 300000 then
|
||||
GameObject.DestroyImmediate(v.texture)
|
||||
db[k] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---@return UnityEngine.UnityWebRequest
|
||||
function DBTextures.getByUrl(url, callback, orgs)
|
||||
local tt = db[url]
|
||||
if tt then
|
||||
tt.lastUseTime = DateEx.nowMS
|
||||
db[url] = tt
|
||||
Utl.doCallback(callback, tt.texture, orgs)
|
||||
return nil
|
||||
end
|
||||
|
||||
local request =
|
||||
WWWEx.get(
|
||||
url,
|
||||
nil,
|
||||
CLAssetType.texture,
|
||||
function(content)
|
||||
db[url] = {texture = content, lastUseTime = DateEx.nowMS}
|
||||
Utl.doCallback(callback, content, orgs)
|
||||
end,
|
||||
nil,
|
||||
orgs,
|
||||
true,
|
||||
1
|
||||
)
|
||||
return request
|
||||
end
|
||||
|
||||
return DBTextures
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c5a5751e2f924a6abdab89e00841a0f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user