module metaStandardDetail { export function getRegistryInfo(arg) { arg = convertArgToJson(arg); var ret = {}; ret.registryID = arg.registryID; ret.description = org.bdware.sc.registry.RegistryDB.getRegistryInfo(arg); ret.code = org.bdware.sc.registry.RegistryDB.getLastExecuteStatus(); return ret; // return { // "code":0, // "registryID":"macjw.ab", // "description":"这是xx市的注册表,添加更多Registry描述" // }; } export function verifyRule(arg) { arg = convertArgToJson(arg); var ret = {}; org.bdware.sc.registry.RuleExecutor.executeRule(arg); ret.code = org.bdware.sc.registry.RuleExecutor.getLastExecuteStatus(); ret.msg = org.bdware.sc.registry.RuleExecutor.getLastExecuteMsg(); return ret; // return { // "code":0, // "msg":"success" // } } export function getFieldTypeList(arg) { return { "code":0, "data":[ { "typeName":"string", "lable":"字符串", "formDesc":{ "固定值":{ "type":"input" }, "默认值":{ "type":"input" }, "最小长度":{ "type":"input" }, "最大长度":{ "type":"input" }, "必备项":{ "type":"select", "options":[ "是", "否" ] }, } }, { "typeName":"boolean", "lable":"真假", "formDesc":{ "固定值":{ "type":"input" }, "默认值":{ "type":"input" }, "必备项":{ "type":"select", "options":[ "是", "否" ] }, } }, ] }; } export function listRemoteRegistry() { arg = convertArgToJson(arg); var ret = []; var ret = [{ "registryID":"macjw", "name":"jw市市级注册" }, { "registryID":"macjw.de.cd", "name":"jw市de县cd镇注册表" } ]; return { "total":10, "data":ret, "code":0 }; } // 如果是offset+count,就按顺序, // controlType=过滤 // createStartDate createEndDate // updateStartDate updateEndDate // 如果是keyword:... 就模糊搜索 // registryID // {"createStartDate":1651334400000,"createEndDate":1653790428000,"offset":0,"count":2} export function listMetaStandard(arg) { arg = convertArgToJson(arg); var ret = org.bdware.sc.registry.RegistryDB.queryMetaStandardsByTimeAndOffset(arg); ret.code = org.bdware.sc.registry.RegistryDB.getLastExecuteStatus(); return ret; } export function updateMetaStandardDetail(arg) { var ret = []; //通知对应的远程注册表,需要更新这个关系。 return { "total":10, "data":ret, "code":0 }; } //{"offset":..,"count":,"localMetaStandardDoid":} export function listMetaStandardRelaction(arg) { var ret = []; ret.push({ "name":"煤矿传感数据映射", "localMetaStandardDoid":"xx.xx/adfa", "remoteMetaStandardDoid":"ab.ccd/aaaaa-aaa", "createDate":167227222, "updateDate":1111111, "creator":"aabbcc", "updater":"aabbcc", "mapRule":{ "owner":"${val.大小}", "pubkey":"function(val){}", } }); return { "total":10, "data":ret, "code":0 }; } //{"localMetaID":"xxx","mapRule":{},"remoteMetaID":"xxx"} export function getPreviewMapResult(arg) { arg = convertArgToJson(arg); arg.localDataSample = org.bdware.sc.registry.RegistryDB.querySampleByMetaID(arg); return getMapResult(arg); } //{"localDataSample":{},"mapRule":{},"remoteMetaID":"xxx"} export function getMapResult(arg) { arg = convertArgToJson(arg); var ret = {}; ret.data = org.bdware.sc.registry.RuleExecutor.executeRule(arg); ret.code = org.bdware.sc.registry.RuleExecutor.getLastExecuteStatus(); return ret; } function convertArgToJson(arg) { if (typeof(arg)=='string') return JSON.parse(arg); return arg; } }