registry/backend/yjs/metaDetail.yjs
2022-06-01 15:37:08 +08:00

154 lines
5.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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描述"
// };
}
//{"localDataSample":{"owner":"abcdef","size":"1234"},"mapRule":{"所有者":"${val.owner}","大小":"${val.size*1000}","偏移过的大小":"${edp(val.size,30.0)}" }}
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 = [{
"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) {
arg = convertArgToJson(arg);
var ret = org.bdware.sc.registry.RegistryDB.queryMapRuleByOffset(arg);
ret.code = org.bdware.sc.registry.RegistryDB.getLastExecuteStatus();
return ret;
}
//{"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;
}
}