婷婷六月久久综合丁香76-婷婷六月久久综合丁香可观看-婷婷六月久久综合丁香乐透-婷婷六月天在线-免费一级视频在线播放-免费一级美国片在线观看

產(chǎn)品中心 業(yè)內(nèi)新聞 案例中心 視頻中心

lua 對回車(%3Cbr%3E)處理方法 lua 對回車(%3Cbr%3E)處理方法

lua 對回車(%3Cbr%3E)處理方法

我們在Gird列出數(shù)據(jù)的時候,若數(shù)據(jù)內(nèi)帶%3Cbr%3E,其實(shí)是回車的意思,若grid讀出數(shù)據(jù)不做任何處理,那么就會影響系統(tǒng)表達(dá)

為了解決這個問題,我們可以編輯一個lua腳本,將這個數(shù)據(jù)做處理后再顯示(在顯示前事件里面定義這個lua腳本)

腳本列子

–[[
? ? 功能說明:
? ? ? ? 1) 顯示前做一些字段的處理
? ? ? ? 2)前端導(dǎo)入,新增有換行符號 %%3Cbr%%3E  ,替換成 <br> 前端html支持的換行內(nèi)容
? ? ? ? 3)內(nèi)容中有&,替換成 & 前端解析 &不支持,最好在輸入時進(jìn)行替換
–]]
json = require(“json”)
mobox = require(“OILua_JavelinExt”)
require(“oi_basestrfunc”)
function BeforeGridShow(strLuaDEID)
? ? local nRet, strRetInfo
? ? local arobjs, attrs, success
? ? — 獲取輸入的DataJson數(shù)據(jù)包
? ? nRet, strRetInfo = mobox.getCurEditDataPacket(strLuaDEID)
? ? if (nRet ~= 0) then
? ? ? ? mobox.error(strLuaDEID, “無法獲取數(shù)據(jù)包!”)
? ? ? ? return
? ? end
? ? if (strRetInfo == ” or strRetInfo == nil) then
? ? ? ? return
? ? end
? ? — 解析數(shù)據(jù)包,數(shù)據(jù)包格式
? ? — [{“id”:””,”attrs”:[{“attr”:””,”value”:””},..]},..]
? ? local n, nCount
? ? success, arobjs = pcall(json.decode, strRetInfo)
? ? if (success == false) then
? ? ? ? mobox.error(strLuaDEID, “非法的JSON格式!”)
? ? ? ? return
? ? end
? ? nCount = #arobjs
? ? if (nCount == 0) then
? ? ? ? return
? ? end
? ? local obj, attrs
? ? local nattr_count
? ? local strRow, strAttr, strItem
? ? local strDataJson
? ? local id, strValue
? ? local strAttrs
? ? strDataJson = ‘[‘
? ? local seg = {}
? ? local nSegCount = 0
? ? for n = 1, nCount do
? ? ? ? obj = arobjs[n]
? ? ? ? attrs = obj.attrs
? ? ? ? nattr_count = #attrs
? ? ? ? id = obj.id
? ? ? ? strAttrs=”
? ? ? ? — 開始過濾顯示數(shù)據(jù)對象屬性
? ? ? ? for nIndex = 1, nattr_count do
? ? ? ? ? ? strAttr = attrs[nIndex].attr
? ? ? ? ? ? strValue = attrs[nIndex].value
? ? ? ? ? ? strValue = strValue:gsub(“%%3Cbr%%3E”, “<br>”)
? ? ? ? ? ? strValue = strValue:gsub(“&”, “&”)
? ? ? ? ? ? strItem = ‘{“attr”:”‘ .. strAttr .. ‘”,”value”:”‘ .. strValue .. ‘”},’
? ? ? ? ? ? strAttrs = strAttrs .. strItem
? ? ? ? end
? ? ? ? — 取消最后一個,號
? ? ? ? strAttrs = trim_laster_char(strAttrs)
? ? ? ? strRow = ‘{“id”:”‘ .. id .. ‘”,”attrs”:[‘ .. strAttrs .. ‘]},’
? ? ? ? strDataJson = strDataJson .. strRow
? ? end
? ? — 取消最后一個,號
? ? strDataJson = trim_laster_char(strDataJson)
? ? strDataJson = strDataJson .. ‘]’
? ? local strAction = ‘[{“action_type”:”reset_data_attr”,”value”:’ .. strDataJson .. ‘}]’
? ? mobox.setAction(strLuaDEID, strAction)
end
這個列子也可以用于別的一些非法字符串的處理
標(biāo)簽:低代碼腳本 上一篇: 下一篇:
展開更多
預(yù)約軟件體驗(yàn)

loading...

主站蜘蛛池模板: 国产91精品一区二区视色 | 久久久久久久国产精品视频 | 欧美一级免费片 | 久久免费视频播放 | 久久久久国产精品免费免费 | 亚洲欧美日韩国产vr在线观 | 97久久精品国产精品青草 | 成人禁在线观看午夜亚洲 | 国产三级手机在线 | 免费一级淫片aaa片毛片a级 | 日韩视频观看 | 毛片免费永久不卡视频观看 | 蕾丝视频永久在线入口香蕉 | 免费国产成人18在线观看 | 国内精品伊人久久久影视 | 久久精品免费在线观看 | 无圣光福利视频 | 久久这里只有精品视频99 | 国产一区二区三区成人久久片 | 9丨精品国产高清自在线看 ⅹxx中国xxx人妖 | 欧美成人性性 | 国产高清在线观看视频手机版 | 成人性视频在线三级 | 亚洲欧美网站 | 国产一区二区三区四区波多野结衣 | 欧美一级片在线视频 | 欧美成人精品 | 国产精品国产自线在线观看 | 亚洲另类在线视频 | 欧美在线不卡 | 亚洲综合色dddd26 | 97视频免费公开成人福利 | 中文字幕在线视频网 | 精品无码久久久久久国产 | 国产网站免费 | 日本免费一区二区三区三州 | 日本卡一卡2卡3卡4精品卡无人区 | 国产日韩欧美视频 | 亚洲毛片免费看 | 真人毛片免费全部播放完整 | 萌白酱在线喷水福利视频 |