国产精品,日韩av,hdsexvideos中国少妇,xxxxx性bbbbb欧美熟妇,波多野结衣乳巨码无在线,国产成人亚洲精品乱码

APL函數(shù)代碼開放場景-按鈕Groovy代碼示例

2024-12-21 09:50:06 353 本站

按鈕前驗證函數(shù)對提交數(shù)據(jù)進行校驗

/**
* 按鈕前驗證函數(shù)的返回值是Map,里面有三個字段
* error : 是否出錯
* errorMessage : 出錯后提示的錯誤信息
* block : 提示異常信息后,是否阻塞保存,true 阻塞報錯,false 不阻塞
**/

// 對數(shù)據(jù)進行賦值
String name = context.data.name
context.data.name = name + "test"
if (context.data.field_1Kl84__c < 100) {
 return ["error": true, "errorMessage":"失敗了", "block":true]
}
return ["error": false, "errorMessage":"成功"]

附件類型在提交時,校驗文件格式是否符合需求

// 獲取終端類型
String field_9w6q2__c = context.data['field_9w6q2__c']

// 獲取插件內(nèi)容類型,即獲取需要檢驗的附件類型
List PluginContent = context.data['field_Mbv9y__c'] as List
List PluginContentList = []
PluginContent.each { item ->
 Map PluginContentType = item as Map
 PluginContentList.add(PluginContentType["ext"])
 }

//獲取靜態(tài)文件類型,即獲取需要檢驗的附件類型
List Staticfile = context.data['field_931se__c'] as List
List StaticfileList = []
Staticfile.each { item ->
 Map StaticfileType = item as Map
 StaticfileList.add(StaticfileType["ext"])
 }

//進行校驗,不滿足時彈框提醒無法提交
if (field_9w6q2__c == 'app' && (!['zip'].containsAll(PluginContentList))) {
 return ["error": true, "errorMessage": "當(dāng)終端類型為app時,[插件內(nèi)容]請上傳zip類型文件", "block": true]
} else if(field_9w6q2__c == 'web' && (!['vue','js','less','css'].containsAll(PluginContentList)) || (!['png','jpg','jpeg','svg'].containsAll(StaticfileList))){
 return ["error": true, "errorMessage": "當(dāng)終端類型為web時,[插件內(nèi)容]請上傳vue、js、less、css類型文件,[靜態(tài)文件]請上傳png、jpg、jpeg、svg類型文件", "block": true]
}else {
//輸入正確,繼續(xù)執(zhí)行
return ["block": false]
}

注意事項



部分內(nèi)容來源于互聯(lián)網(wǎng),如有侵權(quán),請聯(lián)系客服刪除處理。
在線咨詢 撥打電話