四虎永久在线精品免费无码-亚洲欧美国产精品无码中文字-久久久噜噜噜www成人网-中文字幕av一区乱码-成人国产精品一区二区网站公司

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

lua 對(duì)回車(chē)(%3Cbr%3E)處理方法 lua 對(duì)回車(chē)(%3Cbr%3E)處理方法

lua 對(duì)回車(chē)(%3Cbr%3E)處理方法

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

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

腳本列子

–[[
? ? 功能說(shuō)明:
? ? ? ? 1) 顯示前做一些字段的處理
? ? ? ? 2)前端導(dǎo)入,新增有換行符號(hào) %%3Cbr%%3E  ,替換成 <br> 前端html支持的換行內(nèi)容
? ? ? ? 3)內(nèi)容中有&,替換成 & 前端解析 &不支持,最好在輸入時(shí)進(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, “無(wú)法獲取數(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=”
? ? ? ? — 開(kāi)始過(guò)濾顯示數(shù)據(jù)對(duì)象屬性
? ? ? ? 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
? ? ? ? — 取消最后一個(gè),號(hào)
? ? ? ? strAttrs = trim_laster_char(strAttrs)
? ? ? ? strRow = ‘{“id”:”‘ .. id .. ‘”,”attrs”:[‘ .. strAttrs .. ‘]},’
? ? ? ? strDataJson = strDataJson .. strRow
? ? end
? ? — 取消最后一個(gè),號(hào)
? ? strDataJson = trim_laster_char(strDataJson)
? ? strDataJson = strDataJson .. ‘]’
? ? local strAction = ‘[{“action_type”:”reset_data_attr”,”value”:’ .. strDataJson .. ‘}]’
? ? mobox.setAction(strLuaDEID, strAction)
end
這個(gè)列子也可以用于別的一些非法字符串的處理
標(biāo)簽:低代碼腳本 上一篇: 下一篇:
展開(kāi)更多
預(yù)約軟件體驗(yàn)

loading...

主站蜘蛛池模板: 人妻人人做人做人人爱| 顶级欧美熟妇高潮xxxxx| 亚洲老妇色熟女老太| 日本精品中文字幕在线播放| 亚洲国产成人丁香五月激情| 成年女人黄小视频| 国产精品www夜色视频| 无码人妻丰满熟妇精品区| a在线视频v视频| 无码精品a∨在线观看无广告| 欧美精品人人做人人爱视频| 久久久久99精品成人片直播| 天天躁日日躁狠狠躁欧美老妇小说| 国产精品久久久久影院老司| 99精品视频在线观看免费| 天天做天天欢摸夜夜摸狠狠摸| 性生交大片免费看| 国产影片中文字幕| 成人无码h动漫在线网站免费| 日韩成人无码影院| 国产真实夫妇交换视频| 日韩精品免费一线在线观看| 欧美牲交a欧美牲交aⅴ一| 久久伊人热热精品中文字幕| 激情人妻另类人妻伦| 51国产偷自视频区视频| 欧美性猛交内射兽交老熟妇| 无码国产精成人午夜视频| 欧美黑人又粗又大高潮喷水| 少妇人妻系列无码专区视频| 少妇人妻系列无码专区视频| 国产精品毛片一区二区| 免费情侣作爱视频| 欧美人成精品网站播放| 久在线观看福利视频| 日本内射精品一区二区视频| 女人和拘做爰正片视频| 成本人h无码播放私人影院| 无码人妻精品一区二区三区东京热 | 国产精品青草久久久久福利99| 熟女人妻大叫粗大受不了|