删除oldvalue判断
This commit is contained in:
parent
48f0c21c62
commit
94a6a5d6c6
1
index.js
1
index.js
@ -11,7 +11,6 @@ class MinXiUDowm extends React.Component {
|
|||||||
let datas=this.state.datas.length>0 ?[this.state.datas[`${this.props.rowIndex}`]]:[{}]
|
let datas=this.state.datas.length>0 ?[this.state.datas[`${this.props.rowIndex}`]]:[{}]
|
||||||
console.log(this.state.datas)
|
console.log(this.state.datas)
|
||||||
let value=this.state.datas.length>0 ?this.state.datas[this.props.rowIndex]['fileid'] :''
|
let value=this.state.datas.length>0 ?this.state.datas[this.props.rowIndex]['fileid'] :''
|
||||||
let ids=[value]
|
|
||||||
let onFileNameEdit=(newName, data)=> {
|
let onFileNameEdit=(newName, data)=> {
|
||||||
let datas=this.state.datas[0]
|
let datas=this.state.datas[0]
|
||||||
datas.filename=newName
|
datas.filename=newName
|
||||||
|
455
register.js
455
register.js
@ -4,259 +4,262 @@ let flagNum = 0
|
|||||||
const target = {};
|
const target = {};
|
||||||
// 代理对象
|
// 代理对象
|
||||||
const handler = {
|
const handler = {
|
||||||
get: function (target, property, receiver) {
|
get: function (target, property, receiver) {
|
||||||
return Reflect.get(target, property, receiver);
|
return Reflect.get(target, property, receiver);
|
||||||
},
|
},
|
||||||
set: function (target, property, value) {
|
set: function (target, property, value) {
|
||||||
const oldValue = target[property];
|
|
||||||
const baseInfo = WfForm.getBaseInfo();
|
|
||||||
|
const oldValue = target[property];
|
||||||
|
const baseInfo = WfForm.getBaseInfo();
|
||||||
|
|
||||||
if (baseInfo.requestid && !oldValue) {
|
// if (baseInfo.requestid && !oldValue) {
|
||||||
target[property] = value;
|
// target[property] = value;
|
||||||
return false
|
// return false
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (!_.isEqual(oldValue, value)) {
|
||||||
|
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === value[0].localFieId);
|
||||||
|
if (!found) return
|
||||||
|
|
||||||
|
_.difference(_.map(value, 'fileid'), _.map(oldValue, 'fileid'), tmpArr).forEach((e, i) => {
|
||||||
|
WfForm.addDetailRow(property, { [found.fjld]: { value: e }, [found.fjgs]: { value: value[i].fileExtendName } })
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
target[property] = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!_.isEqual(oldValue, value)) {
|
|
||||||
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === value[0].localFieId);
|
|
||||||
if (!found) return
|
|
||||||
|
|
||||||
_.difference(_.map(value, 'fileid'), _.map(oldValue, 'fileid'), tmpArr).forEach((e, i) => {
|
|
||||||
WfForm.addDetailRow(property, { [found.fjld]: { value: e }, [found.fjgs]: { value: value[i].fileExtendName } })
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
target[property] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
// 创建代理
|
// 创建代理
|
||||||
let proxy = new Proxy(target, handler);
|
let proxy = new Proxy(target, handler);
|
||||||
|
|
||||||
|
|
||||||
const config = [
|
const config = [
|
||||||
{
|
{
|
||||||
workflowId: 93026, //资料签收
|
workflowId: 93026, //资料签收
|
||||||
detailId: 'detail_2',
|
detailId: 'detail_2',
|
||||||
fjld: "field114944", //明细表附件id 单行文本字段
|
fjld: "field114944", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field114963",//主表附件字段
|
mainfjid: "field114963",//主表附件字段
|
||||||
mxfjid: "field114942",//明细表附件字段
|
mxfjid: "field114942",//明细表附件字段
|
||||||
nodeid: "135541", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "135541", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: "field114948"//附件后缀
|
fjgs: "field114948"//附件后缀
|
||||||
}, {
|
}, {
|
||||||
workflowId: 93526, //项目图片
|
workflowId: 93526, //项目图片
|
||||||
detailId: 'detail_1',
|
detailId: 'detail_1',
|
||||||
fjld: "field114498", //明细表附件id 单行文本字段
|
fjld: "field114498", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field114521",//主表附件字段
|
mainfjid: "field114521",//主表附件字段
|
||||||
mxfjid: "field114500",//明细表附件字段
|
mxfjid: "field114500",//明细表附件字段
|
||||||
nodeid: "136041", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "136041", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: "field114497"//附件后缀
|
fjgs: "field114497"//附件后缀
|
||||||
}
|
}
|
||||||
, {
|
, {
|
||||||
workflowId: 93527, //踏勘
|
workflowId: 93527, //踏勘
|
||||||
detailId: 'detail_1',
|
detailId: 'detail_1',
|
||||||
fjld: "field114473", //明细表附件id 单行文本字段
|
fjld: "field114473", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field114477",//主表附件字段
|
mainfjid: "field114477",//主表附件字段
|
||||||
mxfjid: "field114644",//明细表附件字段
|
mxfjid: "field114644",//明细表附件字段
|
||||||
nodeid: "136044", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "136044", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: "field114470"//附件后缀
|
fjgs: "field114470"//附件后缀
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
workflowId: 108027, //日常费用报销
|
workflowId: 108027, //日常费用报销
|
||||||
detailId: 'detail_4',
|
detailId: 'detail_4',
|
||||||
fjld: "field179935", //明细表附件id 单行文本字段
|
fjld: "field179935", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field179944",//主表附件字段
|
mainfjid: "field179944",//主表附件字段
|
||||||
mxfjid: "field179872",//明细表附件字段
|
mxfjid: "field179872",//明细表附件字段
|
||||||
nodeid: "153048", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153048", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
workflowId: 108027, //日常费用报销
|
workflowId: 108027, //日常费用报销
|
||||||
detailId: 'detail_1',
|
detailId: 'detail_1',
|
||||||
fjld: "field179933", //明细表附件id 单行文本字段
|
fjld: "field179933", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field179945",//主表附件字段
|
mainfjid: "field179945",//主表附件字段
|
||||||
mxfjid: "field179871",//明细表附件字段
|
mxfjid: "field179871",//明细表附件字段
|
||||||
nodeid: "153048", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153048", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
workflowId: 108027, //日常费用报销
|
workflowId: 108027, //日常费用报销
|
||||||
detailId: 'detail_2',
|
detailId: 'detail_2',
|
||||||
fjld: "field179934", //明细表附件id 单行文本字段
|
fjld: "field179934", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field179946",//主表附件字段
|
mainfjid: "field179946",//主表附件字段
|
||||||
mxfjid: "field179876",//明细表附件字段
|
mxfjid: "field179876",//明细表附件字段
|
||||||
nodeid: "153048", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153048", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
workflowId: 109026, //管理经费报销
|
workflowId: 109026, //管理经费报销
|
||||||
detailId: 'detail_4',
|
detailId: 'detail_4',
|
||||||
fjld: "field180615", //明细表附件id 单行文本字段
|
fjld: "field180615", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field180616",//主表附件字段
|
mainfjid: "field180616",//主表附件字段
|
||||||
mxfjid: "field180614",//明细表附件字段
|
mxfjid: "field180614",//明细表附件字段
|
||||||
nodeid: "153548", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153548", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
workflowId: 109026, //管理经费报销
|
workflowId: 109026, //管理经费报销
|
||||||
detailId: 'detail_1',
|
detailId: 'detail_1',
|
||||||
fjld: "field180605", //明细表附件id 单行文本字段
|
fjld: "field180605", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field180617",//主表附件字段
|
mainfjid: "field180617",//主表附件字段
|
||||||
mxfjid: "field180603",//明细表附件字段
|
mxfjid: "field180603",//明细表附件字段
|
||||||
nodeid: "153548", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153548", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}, {
|
}, {
|
||||||
workflowId: 109026, //管理经费报销
|
workflowId: 109026, //管理经费报销
|
||||||
detailId: 'detail_2',
|
detailId: 'detail_2',
|
||||||
fjld: "field180611", //明细表附件id 单行文本字段
|
fjld: "field180611", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field180618",//主表附件字段
|
mainfjid: "field180618",//主表附件字段
|
||||||
mxfjid: "field180609",//明细表附件字段
|
mxfjid: "field180609",//明细表附件字段
|
||||||
nodeid: "153548", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153548", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}, {
|
}, {
|
||||||
workflowId: 109028, //管理经费报销
|
workflowId: 109028, //管理经费报销
|
||||||
detailId: 'detail_4',
|
detailId: 'detail_4',
|
||||||
fjld: "field180959", //明细表附件id 单行文本字段
|
fjld: "field180959", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field181053",//主表附件字段
|
mainfjid: "field181053",//主表附件字段
|
||||||
mxfjid: "field180957",//明细表附件字段
|
mxfjid: "field180957",//明细表附件字段
|
||||||
nodeid: "153559", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153559", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}, {
|
}, {
|
||||||
workflowId: 109028, //管理经费报销
|
workflowId: 109028, //管理经费报销
|
||||||
detailId: 'detail_1',
|
detailId: 'detail_1',
|
||||||
fjld: "field180914", //明细表附件id 单行文本字段
|
fjld: "field180914", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field181054",//主表附件字段
|
mainfjid: "field181054",//主表附件字段
|
||||||
mxfjid: "field180912",//明细表附件字段
|
mxfjid: "field180912",//明细表附件字段
|
||||||
nodeid: "153559", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153559", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}, {
|
}, {
|
||||||
workflowId: 109028, //管理经费报销
|
workflowId: 109028, //管理经费报销
|
||||||
detailId: 'detail_2',
|
detailId: 'detail_2',
|
||||||
fjld: "field180937", //明细表附件id 单行文本字段
|
fjld: "field180937", //明细表附件id 单行文本字段
|
||||||
mainfjid: "field181055",//主表附件字段
|
mainfjid: "field181055",//主表附件字段
|
||||||
mxfjid: "field180935",//明细表附件字段
|
mxfjid: "field180935",//明细表附件字段
|
||||||
nodeid: "153559", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
nodeid: "153559", //使用WfForm.getBaseInfo()查看,nodeid为节点一的id,节点二id不允许审批删除附件
|
||||||
fjgs: ""//附件后缀
|
fjgs: ""//附件后缀
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
let firstNum = {}
|
|
||||||
ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
|
ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
|
||||||
fn: (newProps) => {
|
fn: (newProps) => {
|
||||||
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
|
|
||||||
if (newProps.fuxie) return; // 控制组件只复写一次
|
|
||||||
if (!WfForm) return;
|
|
||||||
|
|
||||||
const baseInfo = WfForm.getBaseInfo();
|
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
|
||||||
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === newProps.fieldName);
|
if (newProps.fuxie) return; // 控制组件只复写一次
|
||||||
|
if (!WfForm) return;
|
||||||
|
|
||||||
|
const baseInfo = WfForm.getBaseInfo();
|
||||||
|
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === newProps.fieldName);
|
||||||
|
|
||||||
|
|
||||||
|
if (!found) return
|
||||||
|
// const suffixes = config.map(obj => obj.mainfjid.match(/\d+$/)[0]);
|
||||||
|
// if (!suffixes.includes(newProps.fieldid)) return;
|
||||||
|
if (newProps.datas.length > 0) {
|
||||||
|
|
||||||
if (!found) return
|
|
||||||
const suffixes = config.map(obj => obj.mainfjid.match(/\d+$/)[0]);
|
|
||||||
if (!suffixes.includes(newProps.fieldid)) return;
|
|
||||||
// if (newProps.datas.length > 0) {
|
|
||||||
|
|
||||||
newProps.datas.forEach(e => e['localFieId'] = newProps.fieldName)
|
newProps.datas.forEach(e => e['localFieId'] = newProps.fieldName)
|
||||||
|
|
||||||
proxy[found.detailId] = newProps.datas
|
proxy[found.detailId] = newProps.datas
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
let onUploading = newProps.onUploading
|
|
||||||
newProps.onUploading = (string, list, number) => {
|
|
||||||
if (string == 'uploading') {
|
|
||||||
window.ecCom.WeaLoadingGlobal.start({
|
|
||||||
tip: "上传中,请稍后..." // 自定义tip文字
|
|
||||||
})
|
|
||||||
} if (string == 'uploaded') {
|
|
||||||
window.ecCom.WeaLoadingGlobal.end(); // 停止遮罩loading
|
|
||||||
window.ecCom.WeaLoadingGlobal.destroy(); // 销毁遮罩loading
|
|
||||||
}
|
|
||||||
if (string == 'error') {
|
|
||||||
window.ecCom.WeaLoadingGlobal.end(); // 停止遮罩loading
|
|
||||||
WfForm.showMessage(`上传失败`, 2, 30);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
newProps.className = 'mainfj'
|
|
||||||
|
|
||||||
return newProps
|
}
|
||||||
},
|
let onUploading = newProps.onUploading
|
||||||
order: 1, //排序字段,如果存在同一个页面复写了同一个组件,控制顺序时使用
|
newProps.onUploading = (string, list, number) => {
|
||||||
desc: '资料签收附件显示'
|
if (string == 'uploading') {
|
||||||
|
window.ecCom.WeaLoadingGlobal.start({
|
||||||
|
tip: "上传中,请稍后..." // 自定义tip文字
|
||||||
|
})
|
||||||
|
} if (string == 'uploaded') {
|
||||||
|
window.ecCom.WeaLoadingGlobal.end(); // 停止遮罩loading
|
||||||
|
window.ecCom.WeaLoadingGlobal.destroy(); // 销毁遮罩loading
|
||||||
|
}
|
||||||
|
if (string == 'error') {
|
||||||
|
window.ecCom.WeaLoadingGlobal.end(); // 停止遮罩loading
|
||||||
|
WfForm.showMessage(`上传失败`, 2, 30);
|
||||||
|
}
|
||||||
|
// onUploading(string, list, number)
|
||||||
|
}
|
||||||
|
newProps.className = 'mainfj'
|
||||||
|
|
||||||
|
return newProps
|
||||||
|
},
|
||||||
|
order: 1, //排序字段,如果存在同一个页面复写了同一个组件,控制顺序时使用
|
||||||
|
desc: '资料签收附件显示'
|
||||||
});
|
});
|
||||||
const MinXiUDowm = (props, Com) => { //此函数不允许写在复写方法内,会导致实例重复创建,也就是dimout不断执行
|
const MinXiUDowm = (props, Com) => { //此函数不允许写在复写方法内,会导致实例重复创建,也就是dimout不断执行
|
||||||
const acParams = {
|
const acParams = {
|
||||||
appId: '${appId}', //appId会自动识别
|
appId: '${appId}', //appId会自动识别
|
||||||
name: 'MinXiUDowm', //模块名称
|
name: 'MinXiUDowm', //模块名称
|
||||||
isPage: false, //是否是路由页面
|
isPage: false, //是否是路由页面
|
||||||
noCss: true, //是否禁止单独加载css,通常为了减少css数量,css默认前置加载
|
noCss: true, //是否禁止单独加载css,通常为了减少css数量,css默认前置加载
|
||||||
props,
|
props,
|
||||||
}
|
}
|
||||||
const NewCom = Com;
|
const NewCom = Com;
|
||||||
return window.ecCom ? ecodeSDK.getAsyncCom(acParams) : (<NewCom { ...props } />);
|
return window.ecCom ? ecodeSDK.getAsyncCom(acParams) : (<NewCom {...props} />);
|
||||||
}
|
}
|
||||||
ecodeSDK.overwriteClassFnQueueMapSet('WeaUpload', { //组件名
|
ecodeSDK.overwriteClassFnQueueMapSet('WeaUpload', { //组件名
|
||||||
fn: (Com, newProps) => {
|
fn: (Com, newProps) => {
|
||||||
//进行位置判断
|
//进行位置判断
|
||||||
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
|
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
|
||||||
const baseInfo = WfForm.getBaseInfo();
|
const baseInfo = WfForm.getBaseInfo();
|
||||||
|
|
||||||
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === newProps.fieldName);
|
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mxfjid === `field${newProps.fieldid}`);
|
||||||
console.log(found,'1')
|
|
||||||
|
|
||||||
if (!found) return
|
if (!found) return
|
||||||
const suffixes = config.map(obj => obj.mxfjid.match(/\d+$/)[0]);
|
// const suffixes = config.map(obj => obj.mxfjid.match(/\d+$/)[0]);
|
||||||
console.log(suffixes)
|
|
||||||
console.log(newProps.fieldid)
|
|
||||||
|
|
||||||
if (!suffixes.includes(newProps.fieldid)) return;
|
// if (!suffixes.includes(newProps.fieldid)) return;
|
||||||
|
|
||||||
newProps.datas.forEach(e => e['localFieId'] = newProps.fieldName)
|
newProps.datas.forEach(e => e['localFieId'] = newProps.fieldName)
|
||||||
newProps.datas = proxy[found.detailId]
|
newProps.datas = proxy[found.detailId]
|
||||||
newProps.info = [found]
|
newProps.info = [found]
|
||||||
newProps.editable = true
|
newProps.editable = true
|
||||||
newProps.viewAttr = 2
|
newProps.viewAttr = 2
|
||||||
newProps.showUpload = false
|
newProps.showUpload = false
|
||||||
newProps.showUploader = true
|
newProps.showUploader = true
|
||||||
newProps.maxUploadSize = 0
|
newProps.maxUploadSize = 0
|
||||||
newProps.showUploadTime = true
|
newProps.showUploadTime = true
|
||||||
newProps.className = 'detailFj'
|
newProps.className = 'detailFj'
|
||||||
return {
|
return {
|
||||||
com: MinXiUDowm.bind(this, newProps, Com),
|
com: MinXiUDowm.bind(this, newProps, Com),
|
||||||
props: newProps
|
props: newProps
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
order: 10, //排序字段,如果存在同一个页面复写了同一个组件,控制顺序时使用
|
order: 10, //排序字段,如果存在同一个页面复写了同一个组件,控制顺序时使用
|
||||||
desc: '资料签收附件显示'
|
desc: '资料签收附件显示'
|
||||||
});
|
});
|
||||||
let fuxie = false //不允许重复触发
|
let fuxie = false //不允许重复触发
|
||||||
ecodeSDK.overwritePropsFnQueueMapSet('WeaReqTop', { //提交时把明细删除的附件在主表删除
|
ecodeSDK.overwritePropsFnQueueMapSet('WeaReqTop', { //提交时把明细删除的附件在主表删除
|
||||||
fn: (newProps) => {
|
fn: (newProps) => {
|
||||||
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
|
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
|
||||||
const baseInfo = WfForm.getBaseInfo();
|
const baseInfo = WfForm.getBaseInfo();
|
||||||
const found = config.find(item => item.workflowId === baseInfo.workflowid);
|
const found = config.find(item => item.workflowId === baseInfo.workflowid);
|
||||||
if (!found) return
|
if (!found) return
|
||||||
if (!WfForm) return;
|
if (!WfForm) return;
|
||||||
if (newProps.fuxie) return;
|
if (newProps.fuxie) return;
|
||||||
if (fuxie) return;
|
if (fuxie) return;
|
||||||
let num = found.detailId.match(/\d+$/)[0];
|
let num = found.detailId.match(/\d+$/)[0];
|
||||||
let del = []
|
let del = []
|
||||||
WfForm.registerCheckEvent(WfForm.OPER_DELROW + num, function (callback) {
|
WfForm.registerCheckEvent(WfForm.OPER_DELROW + num, function (callback) {
|
||||||
del = _.concat(del, WfForm.getDetailCheckedRowIndexStr(found.detailId).split(','))
|
del = _.concat(del, WfForm.getDetailCheckedRowIndexStr(found.detailId).split(','))
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
WfForm.registerCheckEvent(WfForm.OPER_SAVE + "," + WfForm.OPER_SUBMIT + "," + WfForm.OPER_SUBMITCONFIRM, function (callback) {
|
WfForm.registerCheckEvent(WfForm.OPER_SAVE + "," + WfForm.OPER_SUBMIT + "," + WfForm.OPER_SUBMITCONFIRM, function (callback) {
|
||||||
let oldValue = WfForm.getFieldValue(found.mainfjid).split(',')
|
let oldValue = WfForm.getFieldValue(found.mainfjid).split(',')
|
||||||
const filteredArr = oldValue.filter((item, index) => { return !del.includes(String(index)) });
|
const filteredArr = oldValue.filter((item, index) => { return !del.includes(String(index)) });
|
||||||
WfForm.changeFieldValue(found.mainfjid, { value: filteredArr.join() });
|
WfForm.changeFieldValue(found.mainfjid, { value: filteredArr.join() });
|
||||||
//... 执行自定义逻辑
|
//... 执行自定义逻辑
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
fuxie = true
|
fuxie = true
|
||||||
newProps.fuxie = true
|
newProps.fuxie = true
|
||||||
|
|
||||||
return newProps;
|
return newProps;
|
||||||
},
|
},
|
||||||
order: 1, //排序字段,如果存在同一个页面复写了同一个组件,控制顺序时使用
|
order: 1, //排序字段,如果存在同一个页面复写了同一个组件,控制顺序时使用
|
||||||
desc: '设置提交或者保存时修改附件主表数量'
|
desc: '设置提交或者保存时修改附件主表数量'
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user