2022-05-03 07:46:11 +00:00
|
|
|
|
module metaStandardDetail {
|
|
|
|
|
export function getRegistryInfo(arg) {
|
2022-05-30 07:34:01 +00:00
|
|
|
|
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描述"
|
|
|
|
|
// };
|
2022-05-03 07:46:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-05-30 07:34:01 +00:00
|
|
|
|
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"
|
|
|
|
|
// }
|
2022-05-03 07:46:11 +00:00
|
|
|
|
}
|
2022-05-30 07:34:01 +00:00
|
|
|
|
|
2022-05-03 07:46:11 +00:00
|
|
|
|
export function getFieldTypeList(arg) {
|
|
|
|
|
return {
|
2022-05-30 07:34:01 +00:00
|
|
|
|
"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":[
|
|
|
|
|
"是",
|
|
|
|
|
"否"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
]
|
2022-05-03 07:46:11 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function listRemoteRegistry() {
|
2022-05-30 07:34:01 +00:00
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
var ret = [];
|
|
|
|
|
|
|
|
|
|
var ret = [{
|
|
|
|
|
"registryID":"macjw",
|
|
|
|
|
"name":"jw市市级注册"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"registryID":"macjw.de.cd",
|
|
|
|
|
"name":"jw市de县cd镇注册表"
|
|
|
|
|
}
|
2022-05-03 07:46:11 +00:00
|
|
|
|
];
|
|
|
|
|
return {
|
2022-05-30 07:34:01 +00:00
|
|
|
|
"total":10,
|
|
|
|
|
"data":ret,
|
|
|
|
|
"code":0
|
2022-05-03 07:46:11 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
2022-05-05 13:37:56 +00:00
|
|
|
|
// 如果是offset+count,就按顺序,
|
2022-05-03 07:46:11 +00:00
|
|
|
|
// controlType=过滤
|
|
|
|
|
// createStartDate createEndDate
|
|
|
|
|
// updateStartDate updateEndDate
|
2022-05-05 13:37:56 +00:00
|
|
|
|
// 如果是keyword:... 就模糊搜索
|
2022-05-03 07:46:11 +00:00
|
|
|
|
// registryID
|
2022-05-30 07:34:01 +00:00
|
|
|
|
// {"createStartDate":1651334400000,"createEndDate":1653790428000,"offset":0,"count":2}
|
|
|
|
|
|
2022-05-03 07:46:11 +00:00
|
|
|
|
export function listMetaStandard(arg) {
|
2022-05-30 07:34:01 +00:00
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
var ret = org.bdware.sc.registry.RegistryDB.queryMetaStandardsByTimeAndOffset(arg);
|
|
|
|
|
ret.code = org.bdware.sc.registry.RegistryDB.getLastExecuteStatus();
|
|
|
|
|
return ret;
|
2022-05-03 07:46:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function updateMetaStandardDetail(arg) {
|
|
|
|
|
var ret = [];
|
|
|
|
|
//通知对应的远程注册表,需要更新这个关系。
|
|
|
|
|
return {
|
2022-05-30 07:34:01 +00:00
|
|
|
|
"total":10,
|
|
|
|
|
"data":ret,
|
|
|
|
|
"code":0
|
2022-05-03 07:46:11 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//{"offset":..,"count":,"localMetaStandardDoid":}
|
|
|
|
|
export function listMetaStandardRelaction(arg) {
|
|
|
|
|
var ret = [];
|
|
|
|
|
ret.push({
|
2022-05-30 07:34:01 +00:00
|
|
|
|
"name":"煤矿传感数据映射",
|
|
|
|
|
"localMetaStandardDoid":"xx.xx/adfa",
|
|
|
|
|
"remoteMetaStandardDoid":"ab.ccd/aaaaa-aaa",
|
|
|
|
|
"createDate":167227222,
|
|
|
|
|
"updateDate":1111111,
|
|
|
|
|
"creator":"aabbcc",
|
|
|
|
|
"updater":"aabbcc",
|
|
|
|
|
"mapRule":{
|
|
|
|
|
"owner":"${val.大小}",
|
|
|
|
|
"pubkey":"function(val){}",
|
|
|
|
|
}
|
2022-05-03 07:46:11 +00:00
|
|
|
|
});
|
|
|
|
|
return {
|
2022-05-30 07:34:01 +00:00
|
|
|
|
"total":10,
|
|
|
|
|
"data":ret,
|
|
|
|
|
"code":0
|
2022-05-03 07:46:11 +00:00
|
|
|
|
};
|
2022-05-02 16:04:26 +00:00
|
|
|
|
}
|
2022-05-03 07:46:11 +00:00
|
|
|
|
|
|
|
|
|
//{"localMetaID":"xxx","mapRule":{},"remoteMetaID":"xxx"}
|
|
|
|
|
export function getPreviewMapResult(arg) {
|
2022-05-05 13:37:56 +00:00
|
|
|
|
arg = convertArgToJson(arg);
|
|
|
|
|
arg.localDataSample = org.bdware.sc.registry.RegistryDB.querySampleByMetaID(arg);
|
|
|
|
|
return getMapResult(arg);
|
2022-05-03 07:46:11 +00:00
|
|
|
|
}
|
2022-05-05 13:37:56 +00:00
|
|
|
|
|
2022-05-03 07:46:11 +00:00
|
|
|
|
//{"localDataSample":{},"mapRule":{},"remoteMetaID":"xxx"}
|
|
|
|
|
export function getMapResult(arg) {
|
|
|
|
|
arg = convertArgToJson(arg);
|
2022-05-05 13:37:56 +00:00
|
|
|
|
var ret = {};
|
2022-05-03 07:46:11 +00:00
|
|
|
|
ret.data = org.bdware.sc.registry.RuleExecutor.executeRule(arg);
|
|
|
|
|
ret.code = org.bdware.sc.registry.RuleExecutor.getLastExecuteStatus();
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2022-05-05 13:37:56 +00:00
|
|
|
|
|
|
|
|
|
function convertArgToJson(arg) {
|
|
|
|
|
if (typeof(arg)=='string') return JSON.parse(arg);
|
|
|
|
|
return arg;
|
|
|
|
|
}
|
2022-05-02 16:04:26 +00:00
|
|
|
|
}
|