将目标聚焦在“报账人门户 -> 未完成”页面,点击“查询”按钮的提交过程。

From Chrome devtools Console, we can see queryExpenseBillByLike was exposed to global scope.

> window.queryExpenseBillByLike
< function (){
		var textValue = document.getElementById("likequery").value;
		var proxy = new ServerProxy(null,null,true);
		proxy.addParam('clc', 'nc.bs.er.expExpensePortlet.ctrl.MainViewController');…

And the function defined here /portal/sync/yer/weberm/html/nodes/expExpensePortlet/include.js

	queryExpenseBillByLike = function(){
		var textValue = document.getElementById("likequery").value;
		var proxy = new ServerProxy(null,null,true);
		proxy.addParam('clc', 'nc.bs.er.expExpensePortlet.ctrl.MainViewController');
		proxy.addParam('el', '2');
		proxy.addParam('source_id', 'main');
		proxy.addParam('source_type', 'widget');
		proxy.addParam('widget_id', 'main');
		proxy.addParam('m_n', 'doQueryByLikeQuery');
		proxy.addParam('likeQueryValue', textValue);
		proxy.execute();
	}

So we could rewrite function like this, maybe in React.

window.queryExpenseBillByLike = function () {
  ... // do my job
}

Checking whetherServerProxy is in global scope or not.

> window.ServerProxy
< function ServerProxy(listener, eventName, async) {
    this.params = new HashMap();
    this.returnParams = new HashMap();
    this.returnFunc = null;
    this.submitRule = null;
    this.eventName = eventName;…

So we could write click handler in React directly

handleChaxunButtonClick() {
  var textValue = this.state.danjubianhao;
  var proxy = new ServerProxy(null,null,true);
  proxy.addParam(...);
  ...
}
...
const chaxunButton = (
  <span
    style={ {color:'#028FD1',cursor:'pointer'} }
    onClick={::this.handleChaxunButtonClick}
  >查询</span>
);

ServerProxy was defined in /portal/frame/device_pc/script/compressed/3341564807.js, a compressed javascript file. Uncompress it with http://jsbeautifier.org/, so we could see the definition of ServerProxy and even document it.

function ServerProxy(listener, eventName, async) {
  this.params = new HashMap();
  this.returnParams = new HashMap();
  this.returnFunc = null;
  this.submitRule = null;
  this.eventName = eventName;
  this.listener = listener;
  this.async = async;
  this.nmc = true;
};
ServerProxy.prototype.destroySelf = function() {
...

Maybe 3341564807.js was merged by multiple js files.

Try to find ServerProxy in https://github.com/xxd3vin/rsd_web project.