修改人:邹江涛

修改内容:测试表单插件
修改时间:2024/11/14
This commit is contained in:
zoujiangtao 2024-11-14 14:48:55 +08:00
parent 8448331791
commit cfb429d699
1 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,46 @@
package shkd.sys.sys.plugin.form;
import com.alibaba.fastjson.JSONObject;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.form.control.Toolbar;
import kd.bos.form.control.events.ItemClickEvent;
import kd.sdk.plugin.Plugin;
import shkd.sys.sys.mservice.BIPService;
import java.util.EventObject;
/**
* 单据界面插件
*/
public class ApiTestBillPlugin extends AbstractBillPlugIn implements Plugin {
@Override
public void registerListener(EventObject e) {
// super.registerListener(e);
// 获取工具栏监听整个工具栏
Toolbar save = this.getView().getControl("tbmain");
// 监听工具栏这个按钮的点击事件
save.addItemClickListener(this);
// 获取除了工具栏上的其他按钮
// Button save = this.getView().getControl("qwz5_baritemap");
// save.addClickListener(this); // 添加出菜单栏点击事件监听
}
@Override
public void itemClick(ItemClickEvent evt) {
super.itemClick(evt);
// 获取键
String key = evt.getItemKey();
if ("shkd_token".equals(key)) {
String bipToken = BIPService.getBIPToken();
this.getView().showTipNotification(bipToken);
}
if ("shkd_api".equals(key)) {
JSONObject jsonObject = BIPService.paymentSlipsJson();
this.getView().showTipNotification(jsonObject.toJSONString());
}
}
}