'更新JS通过字段属性中的SQL查询数据库的代码'

This commit is contained in:
ForeverSmiYng 2024-06-27 10:04:28 +08:00
parent efd9632d5e
commit eb06b45d3a

View File

@ -1,3 +1,6 @@
/*
SFP_myJSON参数需从已有流程字段属性设置中抓取可通过查看网络请求的方式进行抓取
示例
let myJSON = `{ let myJSON = `{
"workflowid":"71025", "workflowid":"71025",
"nodeid": 109529, "nodeid": 109529,
@ -16,5 +19,16 @@ let myJSON = `{
"linkageid": 117552, "linkageid": 117552,
"wfTestStr": "" "wfTestStr": ""
}`; }`;
let postObj = JSON.parse(myJSON); */
$.post("/api/workflow/linkage/reqFieldSqlResult", postObj); /*
这是个异步函数返回结果为promise调用时需要加await前缀以实现同步即await selectByFieldProp(myJSON)
*/
async function selectByFieldPropSyn(SFP_myJSON) {
try {
let postObj = JSON.parse(SFP_myJSON);
const response = await $.post("/api/workflow/linkage/reqFieldSqlResult", postObj);
return response;
} catch (error) {
console.error('Error:', error);
}
}