删除oldvalue判断

This commit is contained in:
wintsa 2024-07-11 14:01:20 +08:00
parent 48f0c21c62
commit 94a6a5d6c6
2 changed files with 229 additions and 227 deletions

View File

@ -11,7 +11,6 @@ class MinXiUDowm extends React.Component {
let datas=this.state.datas.length>0 ?[this.state.datas[`${this.props.rowIndex}`]]:[{}]
console.log(this.state.datas)
let value=this.state.datas.length>0 ?this.state.datas[this.props.rowIndex]['fileid'] :''
let ids=[value]
let onFileNameEdit=(newName, data)=> {
let datas=this.state.datas[0]
datas.filename=newName

View File

@ -8,13 +8,16 @@ const handler = {
return Reflect.get(target, property, receiver);
},
set: function (target, property, value) {
const oldValue = target[property];
const baseInfo = WfForm.getBaseInfo();
if (baseInfo.requestid && !oldValue) {
target[property] = value;
return false
}
// if (baseInfo.requestid && !oldValue) {
// target[property] = value;
// return false
// }
if (!_.isEqual(oldValue, value)) {
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === value[0].localFieId);
if (!found) return
@ -142,9 +145,9 @@ const config = [
}
]
let firstNum = {}
ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
fn: (newProps) => {
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
if (newProps.fuxie) return; // 控制组件只复写一次
if (!WfForm) return;
@ -152,16 +155,18 @@ ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
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) {
// 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)
proxy[found.detailId] = newProps.datas
// }
}
let onUploading = newProps.onUploading
newProps.onUploading = (string, list, number) => {
if (string == 'uploading') {
@ -176,6 +181,7 @@ ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
window.ecCom.WeaLoadingGlobal.end(); // 停止遮罩loading
WfForm.showMessage(`上传失败`, 2, 30);
}
// onUploading(string, list, number)
}
newProps.className = 'mainfj'
@ -193,7 +199,7 @@ const MinXiUDowm = (props, Com) => { //此函数不允许写在复写方法内
props,
}
const NewCom = Com;
return window.ecCom ? ecodeSDK.getAsyncCom(acParams) : (<NewCom { ...props } />);
return window.ecCom ? ecodeSDK.getAsyncCom(acParams) : (<NewCom {...props} />);
}
ecodeSDK.overwriteClassFnQueueMapSet('WeaUpload', { //组件名
fn: (Com, newProps) => {
@ -201,15 +207,12 @@ ecodeSDK.overwriteClassFnQueueMapSet('WeaUpload', { //组件名
if (!window.location.hash.startsWith('#/main/workflow/req')) return;
const baseInfo = WfForm.getBaseInfo();
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === newProps.fieldName);
console.log(found,'1')
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mxfjid === `field${newProps.fieldid}`);
if (!found) return
const suffixes = config.map(obj => obj.mxfjid.match(/\d+$/)[0]);
console.log(suffixes)
console.log(newProps.fieldid)
// const suffixes = config.map(obj => obj.mxfjid.match(/\d+$/)[0]);
if (!suffixes.includes(newProps.fieldid)) return;
// if (!suffixes.includes(newProps.fieldid)) return;
newProps.datas.forEach(e => e['localFieId'] = newProps.fieldName)
newProps.datas = proxy[found.detailId]