var url="${servletURL}?viewlet=photosynthetic/complaint_customer.cpt";
var widgetNames = ['datetype', 'begin', 'end', 'manager_cl', 'site_cl', 'manager_c', 'codetype', 'code', 'manager_zr', 'site_zr', 'manager_s', 'attribute', 'dutyreason', 'status', 'source', 'type', 'return', 'vastype', 'is_custtag', 'begin_c', 'end_c', 'intention', 'call_result', 'is_calldisp', 'begin_d', 'end_d', 'first_result', 'first_timeout', 'is_involved', 'dispman', 'fr_level', 'fr_auth_pwd', 'format'];
//定义数组存放控件名称。
function getWidgetValueByName(name) {
var widget = _g().parameterEl.getWidgetByName(name);
//根据控件名获取控件值
if (widget == undefined) return;
var obj = {};
obj[name] = widget.getValue();
return obj;
//返回控件值组成的数组
}
//将参数拼接起来,若新增参数,直接 widgetNames中此增加控件名即可,此处无需修改。
var paramJson = widgetNames.map(getWidgetValueByName).reduce(function(a, b) {
return Object.assign(a, b)
});
var config = JSON.stringify(paramJson);
//将JSON数据转换为字符串
console.log(config);
FR.doHyperlinkByPost(url,config,"_self") 代码2: var url="${servletURL}?viewlet=photosynthetic/complaint_customer.cpt" var config = {"datetype":"工单创建日期","begin":"20211116","end":"20211116","manager_cl":"","site_cl":"71915,56455,35590,77561","manager_c":"","codetype":"工单号","code":"","manager_zr":"","site_zr":"","manager_s":"","attribute":"","dutyreason":"","status":"","source":"","type":"","return":"","vastype":"","is_custtag":"","begin_c":"","end_c":"","intention":"","call_result":"","is_calldisp":"","begin_d":"","end_d":"","first_result":"","first_timeout":"","is_involved":"","dispman":"","fr_level":"ALL","fr_auth_pwd":"466a4e9feebff36d68ceb12c864480cd","format":"excel"} FR.doHyperlinkByPost(url,config,"_self")代码2中的config内容就是代码1打印出来的内容 直接写死的话是可以成功调用的,但是用参数的方式就会报错 很奇怪 有哪位老哥遇到过没 |
最佳回答 |
||||
0
|
|