|
|
|
@ -10,18 +10,26 @@
|
|
|
|
|
|
|
|
|
|
// 防抖机制,0.3s无新的data请求,才向后端发送。否则会先打包并等待0.3s
|
|
|
|
|
var requestFunc = BI.debounce(function () { |
|
|
|
|
BI.reqPost("plugin/design/widgets/data", { |
|
|
|
|
widgets: widgets |
|
|
|
|
}, function (res) { |
|
|
|
|
BI.each(handlers, function (wId, handler) { |
|
|
|
|
handler.resolve({ |
|
|
|
|
config: config, |
|
|
|
|
status: 200, |
|
|
|
|
statusText: "success", |
|
|
|
|
headers: {"content-type": "application/json;charset=UTF-8"}, |
|
|
|
|
response: BI.jsonEncode(res.data[wId]) |
|
|
|
|
BI.asyncAjax({ |
|
|
|
|
url: "widgets/data", |
|
|
|
|
type: "POST", |
|
|
|
|
data: { |
|
|
|
|
widgets: widgets |
|
|
|
|
}, |
|
|
|
|
success: function (res) { |
|
|
|
|
BI.each(handlers, function (wId, handler) { |
|
|
|
|
handler.resolve({ |
|
|
|
|
config: config, |
|
|
|
|
status: 200, |
|
|
|
|
statusText: "success", |
|
|
|
|
headers: {"content-type": "application/json;charset=UTF-8"}, |
|
|
|
|
response: BI.jsonEncode(res.data[wId]) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
complete: BI.emptyFn, |
|
|
|
|
opt: {}, |
|
|
|
|
version: "url" |
|
|
|
|
}); |
|
|
|
|
widgets = {}; |
|
|
|
|
handlers = {}; |
|
|
|
|