Compare commits
3 Commits
df1e8bb8c1
...
76beae6bfc
Author | SHA1 | Date |
---|---|---|
youHong.ai | 76beae6bfc | |
youHong.ai | 72f8bca9aa | |
youHong.ai | a85e0777e3 |
|
@ -0,0 +1,40 @@
|
|||
$(() => {
|
||||
/**
|
||||
* @author youhong.ai
|
||||
* @desc 获取react组件实例
|
||||
*/
|
||||
function findReact(dom, traverseUp = 0) {
|
||||
const key = Object.keys(dom).find(key => {
|
||||
return key.startsWith("__reactFiber$") // react 17+
|
||||
|| key.startsWith("__reactInternalInstance$") // react <17
|
||||
});
|
||||
const domFiber = dom[key];
|
||||
if (domFiber == null) return null;
|
||||
// react <16
|
||||
if (domFiber._currentElement) {
|
||||
let compFiber = domFiber._currentElement._owner;
|
||||
for (let i = 0; i < traverseUp; i++) {
|
||||
compFiber = compFiber._currentElement._owner;
|
||||
}
|
||||
return compFiber._instance;
|
||||
}
|
||||
// react 16+
|
||||
const GetCompFiber = fiber => {
|
||||
let parentFiber = fiber.return;
|
||||
while (typeof parentFiber.type == "string") {
|
||||
parentFiber = parentFiber.return;
|
||||
}
|
||||
return parentFiber;
|
||||
};
|
||||
let compFiber = GetCompFiber(domFiber);
|
||||
for (let i = 0; i < traverseUp; i++) {
|
||||
compFiber = GetCompFiber(compFiber);
|
||||
}
|
||||
return compFiber.stateNode;
|
||||
}
|
||||
|
||||
window.Utils = {
|
||||
findReact,
|
||||
}
|
||||
|
||||
})
|
|
@ -0,0 +1,78 @@
|
|||
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) => {
|
||||
// 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) {
|
||||
// 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);
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1 +1,77 @@
|
|||
// 流程代码块
|
||||
/* ******************* 保时捷target setting流程提交控制 start ******************* */
|
||||
/**
|
||||
* @author youhong.ai
|
||||
* @desc 禁止点击提交按钮
|
||||
*/
|
||||
function doNotClickSubmit() {
|
||||
let submitButton = $('.ant-btn.ant-btn-primary[ecid="_Route@vmt0lk_Comp@upn4fo_Button@2oxqe7@0_button@xq1ea3"][title="Submit "]')
|
||||
if (submitButton.length === 0) {
|
||||
submitButton = $('.ant-btn.ant-btn-primary[ecid="_Route@vmt0lk_Comp@upn4fo_Button@2oxqe7@0_button@xq1ea3"][title="提交"]')
|
||||
}
|
||||
if (submitButton.length === 0) {
|
||||
submitButton = $("#weareqtop_9v5e5i_1670481049632 div.ant-row.wea-new-top-req div.ant-col-xs-18.ant-col-sm-18.ant-col-md-16.ant-col-lg-14 button[title='提交'],[title='Submit '],[title='Submit']")
|
||||
}
|
||||
if (submitButton.length !== 0) {
|
||||
let buttonReact = window.Utils.findReact(submitButton[0])
|
||||
console.log(buttonReact)
|
||||
buttonReact.props.disabled = true
|
||||
buttonReact.setState({disabled: true})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author youhong.ai
|
||||
* @desc 允许点击按钮
|
||||
*/
|
||||
function allowClickSubmit() {
|
||||
let submitButton = $('.ant-btn.ant-btn-primary[ecid="_Route@vmt0lk_Comp@upn4fo_Button@2oxqe7@0_button@xq1ea3"][title="Submit "]')
|
||||
if (submitButton.length === 0) {
|
||||
submitButton = $('.ant-btn.ant-btn-primary[ecid="_Route@vmt0lk_Comp@upn4fo_Button@2oxqe7@0_button@xq1ea3"][title="提交"]')
|
||||
}
|
||||
if (submitButton.length === 0) {
|
||||
submitButton = $("#weareqtop_9v5e5i_1670481049632 div.ant-row.wea-new-top-req div.ant-col-xs-18.ant-col-sm-18.ant-col-md-16.ant-col-lg-14 button[title='提交'],[title='Submit '],[title='Submit']")
|
||||
}
|
||||
if (submitButton.length !== 0) {
|
||||
let buttonReact = window.Utils.findReact(submitButton[0])
|
||||
console.log(buttonReact)
|
||||
buttonReact.props.disabled = false
|
||||
buttonReact.setState({disabled: false})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听qzhj字段值改变
|
||||
* @param id 字段id
|
||||
* @param value 字段值
|
||||
* @param obj 字段值对象
|
||||
*/
|
||||
function onQzhjFieldChangeValue(id, value, obj) {
|
||||
console.log(value)
|
||||
if (value != '100') {
|
||||
doNotClickSubmit()
|
||||
} else {
|
||||
allowClickSubmit()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查qzhj字段值
|
||||
* @param fieldId qzhj字段id
|
||||
*/
|
||||
function checkOnQzhJfiedlChangeValue(fieldId) {
|
||||
let value = WfForm.getFieldValue(fieldId);
|
||||
onQzhjFieldChangeValue(null, value)
|
||||
}
|
||||
|
||||
|
||||
$(() => {
|
||||
let qzhjFieldId = WfForm.convertFieldNameToId("qzhj")
|
||||
checkOnQzhJfiedlChangeValue(qzhjFieldId)
|
||||
WfForm.bindFieldChangeEvent(qzhjFieldId, onQzhjFieldChangeValue)
|
||||
})
|
||||
|
||||
/* ******************* 保时捷target setting流程提交控制 end ******************* */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import aiyh.utils.httpUtil.ResponeVo;
|
|||
import aiyh.utils.httpUtil.util.HttpUtils;
|
||||
import basetest.BaseTest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.api.youhong.ai.pcn.organization.orgchart.service.OrgChartService;
|
||||
import com.api.youhong.ai.pcn.organization.orgchart.vo.OrgChartNodeVo;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
@ -223,6 +222,4 @@ public class TestOrganization extends BaseTest {
|
|||
List<OrgChartNodeVo> orgChartTree = orgChartService.getOrgChartTree(user);
|
||||
System.out.println(JSON.toJSONString(orgChartTree));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue