ebu_ecology_dev1/javascript/common/dev.js

154 lines
6.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

const WfForm = {
isMobile: () => {
// true表示是eMobile、微信、钉钉等移动终端false代表PC端
},
}
WfForm.OPER_SAVE = '保存'
WfForm.OPER_SUBMIT = '提交/批准/提交需反馈/不需反馈等'
WfForm.OPER_SUBMITCONFIRM = '提交至确认页面如果是确认界面点确认触发的是SUBMIT'
WfForm.OPER_REJECT = '退回'
WfForm.OPER_REMARK = '批注提交'
WfForm.OPER_INTERVENE = '干预'
WfForm.OPER_FORWARD = '转发'
WfForm.OPER_TAKEBACK = '强制收回'
WfForm.OPER_DELETE = '删除'
WfForm.OPER_ADDROW = '添加明细行,需拼明细表序号'
WfForm.OPER_DELROW = '删除明细行,需拼明细表序号'
WfForm.OPER_PRINTPREVIEW = '打印预览 KB900190501'
WfForm.OPER_EDITDETAILROW = '移动端-编辑明细 KB900191101'
WfForm.OPER_BEFOREVERIFY = '校验必填前触发事件 KB900191201'
WfForm.OPER_TURNHANDLE = '转办 KB900201101'
WfForm.OPER_ASKOPINION = '意见征询 KB900201101'
WfForm.OPER_TAKFROWARD = '征询转办 KB900201101'
WfForm.OPER_TURNREAD = '传阅 KB900201101'
WfForm.OPER_FORCEOVER = '强制归档 KB900201101'
WfForm.OPER_BEFORECLICKBTN = '点右键按钮前 KB900201101'
WfForm.OPER_SAVECOMPLETE = '保存后页面跳转前 KB900210501'
WfForm.OPER_WITHDRAW = '撤回 KB900201101'
WfForm.OPER_CLOSE = '页面关闭'
WfForm.registerCheckEvent = (type, callback = (callback) = {}) => {
// WfForm.registerCheckEvent(WfForm.OPER_SAVE+","+WfForm.OPER_SUBMIT,function(callback){
// //... 执行自定义逻辑
// callback();
// });
}
WfForm.ACTION_ADDROW = '添加明细行,需拼明细表序号 KB900190407'
WfForm.ACTION_DELROW = '删除明细行,需拼明细表序号 KB900190407'
WfForm.ACTION_EDITDETAILROW = '移动端-编辑明细行,需拼明细表序号 KB900190501'
WfForm.ACTION_SWITCHDETAILPAGING = '切换明细分页 KB900191201'
WfForm.ACTION_SWITCHTABLAYOUT = '切换模板布局标签页 KB900191201'
WfForm.registerAction = (type, callback) => {
// WfForm.registerAction(WfForm.ACTION_ADDROW+"1", function(index){
// alert("添加行下标是"+index);
// }); //下标从1开始明细1添加行触发事件注册函数入参为新添加行下标
// WfForm.registerAction(WfForm.ACTION_DELROW+"2", function(arg){
// alert("删除行下标集合是"+arg.join(","));
// }); //下标从1开始明细2删除行触发事件
// WfForm.registerAction(WfForm.ACTION_SWITCHDETAILPAGING, function(groupid){
// alert("切换明细表"+(groupid+1)+"的页码触发事件");
// });
// WfForm.registerAction(WfForm.ACTION_SWITCHTABLAYOUT, function(tabid){
// alert("切换到标签项"+tabid+"触发事件");
// });
}
WfForm.convertFieldNameToId = (fieldName, table, flag) => {
// var fieldid = WfForm.convertFieldNameToId("zs");
// var fieldid = WfForm.convertFieldNameToId("zs_mx", "detail_1");
// var fieldid = WfForm.convertFieldNameToId("zs_mx", "detail_1", false);
}
WfForm.getFieldValue = function (fieldMark) {
// fieldMark String 是 字段标示格式field${字段ID}_${明细行号}
// var fieldvalue = WfForm.getFieldValue("field110");
}
WfForm.bindFieldChangeEvent = function (fieldMarkStr, funobj = (obj, id, value) => {
}) {
// fieldMarkStr String 是 绑定字段标示可多个拼接逗号隔开例如field110(主字段),field111_2(明细字段)……
// funobj Function 是 字段值变化触发的自定义函数函数默认传递以下三个参数参数1触发字段的DOM对象参数2触发字段的标示(field27555等)参数3修改后的值
// WfForm.bindFieldChangeEvent("field27555,field27556", function (obj, id, value) {
// console.log("WfForm.bindFieldChangeEvent--", obj, id, value);
// });
}
WfForm.controlBtnDisabled = function (isDisabled) {
// isDisabled boolean 是 true按钮全部置灰不可操作,false恢复按钮可操作状态
// function subimtForm(params){
// WfForm.controlBtnDisabled(true); //操作按钮置灰
// ...
// WfForm.controlBtnDisabled(false);
// }
}
WfForm.showMessage = function (msg, type, duration) {
// 参数 参数类型 必须 说明
// msg String true 提示信息内容
// type int false 提示类型1(警告)、2(错误)、3(成功)、4(一般)默认为1不同类型提示信息效果不同
// duration Float false 多长时间自动消失单位秒默认为1.5秒
// WfForm.showMessage("结束时间需大于开始时间"); //警告信息1.5s后自动消失
// WfForm.showMessage("运算错误", 2, 10); //错误信息10s后消失
}
WfForm.getBaseInfo = function () {
// console.log(WfForm.getBaseInfo()); //返回当前请求基础信息
// //输出对象说明:
return {
f_weaver_belongto_userid: "5240", //用户信息
f_weaver_belongto_usertype: "0",
formid: -2010, //表单id
isbill: "1", //新表单/老表单
nodeid: 19275, //节点id
requestid: 4487931, //请求id
workflowid: 16084, //路径id
}
}
WfForm.changeFieldValue = function (fieldMark, valueInfo) {
// fieldMark String 是 字段标示格式field${字段ID}_${明细行号}
// valueInfo JSON 是 字段值信息,非浏览按钮字段格式为{value:”修改的值”};specialobj为浏览按钮信息数组格式;showhtml属性只在单行文本类型且只读情况下生效
//修改文本框、多行文本、选择框等字段类型
// WfForm.changeFieldValue("field123", {value:"1.234"});
// //修改浏览框字段的值必须有specialobj数组结构对象
// WfForm.changeFieldValue("field11_2", {
// value: "2,3",
// specialobj:[
// {id:"2",name:"张三"},
// {id:"3",name:"李四"}
// ]
// });
// //修改check框字段(0不勾选、1勾选)
// WfForm.changeFieldValue("field123", {value:"1"});
// //针对单行文本框字段类型,只读情况,支持显示值跟入库值不一致
// WfForm.changeFieldValue("field123", {
// value: "入库真实值",
// specialobj: {
// showhtml: "界面显示值"
// }
// });
}
/* ******************* 建模表开发依赖 ******************* */
const ModeList = {}
ModeList.dataLoadAfter = function (data) {
// 描述:在列表数据加载完,对列表的数据进行二次加工,并渲染。 dataLoadAfter传入dataHandle方法用来接收并处理数据dataHandle有两个参数。
// var dataHandle = function(datas,displayType){
// //Changes to 'datas' do not directly modify the real database data, but modify the data received at the front end.
// var newDatas = datas;
// if(displayType == 'normal'){
// console.log(newDatas);
// }
// return newDatas;
// }
// ModeList.dataLoadAfter(dataHandle);
};