ebu_ecology_dev1/javascript/youhong.ai/pcn/workflow_code_block.js

78 lines
2.6 KiB
JavaScript
Raw Normal View History

/* ******************* 保时捷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 ******************* */