2022-12-08 15:32:28 +08:00
|
|
|
|
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 = '页面关闭'
|
|
|
|
|
|
2022-12-09 23:10:13 +08:00
|
|
|
|
WfForm.registerCheckEvent = (type, callback = (callback) = {}) => {
|
2022-12-08 15:32:28 +08:00
|
|
|
|
// 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");
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-09 23:10:13 +08:00
|
|
|
|
WfForm.bindFieldChangeEvent = function (fieldMarkStr, funobj = (obj, id, value) => {
|
|
|
|
|
}) {
|
2022-12-08 15:32:28 +08:00
|
|
|
|
// 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);
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-02 10:26:35 +08:00
|
|
|
|
WfForm.bindDetailFieldChangeEvent = function (fieldMarkStr, funobj = (id, rowIndex, value) => {
|
|
|
|
|
}) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-12-09 23:10:13 +08:00
|
|
|
|
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: "界面显示值"
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-02 10:26:35 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取流览框显示值
|
|
|
|
|
* fieldMark String 是 字段标示,格式field${字段ID}_${明细行号}
|
|
|
|
|
* splitChar String 否 分隔符,默认以逗号分隔
|
|
|
|
|
* @param fieldMark
|
|
|
|
|
* @param splitChar
|
|
|
|
|
*/
|
|
|
|
|
WfForm.getBrowserShowName = function (fieldMark, splitChar) {
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-13 10:40:45 +08:00
|
|
|
|
/**
|
|
|
|
|
* 获取明细行所有行标示
|
|
|
|
|
* @param detailMark
|
|
|
|
|
*/
|
|
|
|
|
WfForm.getDetailAllRowIndexStr = function (detailMark) {
|
|
|
|
|
// 遍历明细行的写法
|
|
|
|
|
// var rowArr = WfForm.getDetailAllRowIndexStr("detail_1").split(",");
|
|
|
|
|
// for(var i=0; i<rowArr.length; i++){
|
|
|
|
|
// var rowIndex = rowArr[i];
|
|
|
|
|
// if(rowIndex !== ""){
|
|
|
|
|
// var fieldMark = "field111_"+rowIndex; //遍历明细行字段
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-09 23:10:13 +08:00
|
|
|
|
|
2022-12-13 10:35:10 +08:00
|
|
|
|
/* ******************* 建模表开发依赖 ******************* */
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
};
|
2022-12-08 15:32:28 +08:00
|
|
|
|
|
|
|
|
|
|
2023-02-02 10:26:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-13 10:40:45 +08:00
|
|
|
|
|
|
|
|
|
|