|
发表于 2023-10-20 14:03:18
|
显示全部楼层
本帖最后由 Lxw100514 于 2023-10-20 14:26 编辑
管理员您好 通过脚本修改了文档数据 打印出来是修改后的,但实际在文档中的显示还是原来的,这是为什么啊?
var docid = this.documentContext.getDocument().id;
var action = this.Actions.load("x_cms_assemble_control");
action.DocumentAction.query_getDocumentData(//平台封装好的方法
docid,//uri的参数
function( json ){ //服务调用成功的回调函数, json为服务传回的数据
data2 = json.data; //为变量data赋值
data2.data.age1=3;
console.log("query_getDocumentData data2= "+data2);
console.log("query_getDocumentData data2.data.age1= "+data2.data.age1);
action.DataAction.updateWithDocument(//平台封装好的方法
docid,//uri的参数
data2,//body请求参数
function( json ){ //服务调用成功的回调函数, json为服务传回的数据
data3 = json.data; //为变量data赋值
console.log("修改后data3="+data3);
console.log("修改后age1="+data2.data.age1);
}.bind(this),
function( json ){ //服务调用失败的回调函数, json为服务传回的数据
data = json.data; //为变量data赋值
}.bind(this)
);
}.bind(this),
function( json ){ //服务调用失败的回调函数, json为服务传回的数据
data = json.data; //为变量data赋值
}.bind(this)
);
这是控制台打印的结果
这是实际文档显示结果
}.bind(this),true, 是不是有同步或异步的区别, 我在后面加true或者false 也没啥用,我直接用浏览器调用后台接口来查询和修改 也是一样的结果,文档数据始终没变
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|