删除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}`]]:[{}] 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

View File

@ -8,13 +8,16 @@ const handler = {
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 oldValue = target[property];
const baseInfo = WfForm.getBaseInfo(); 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)) { if (!_.isEqual(oldValue, value)) {
const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === value[0].localFieId); const found = config.find(item => item.workflowId === baseInfo.workflowid && item.mainfjid === value[0].localFieId);
if (!found) return if (!found) return
@ -142,9 +145,9 @@ const config = [
} }
] ]
let firstNum = {}
ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', { ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
fn: (newProps) => { fn: (newProps) => {
if (!window.location.hash.startsWith('#/main/workflow/req')) return; if (!window.location.hash.startsWith('#/main/workflow/req')) return;
if (newProps.fuxie) return; // 控制组件只复写一次 if (newProps.fuxie) return; // 控制组件只复写一次
if (!WfForm) return; if (!WfForm) return;
@ -152,16 +155,18 @@ ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
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.mainfjid === newProps.fieldName);
if (!found) return if (!found) return
const suffixes = config.map(obj => obj.mainfjid.match(/\d+$/)[0]); // const suffixes = config.map(obj => obj.mainfjid.match(/\d+$/)[0]);
if (!suffixes.includes(newProps.fieldid)) return; // if (!suffixes.includes(newProps.fieldid)) return;
// if (newProps.datas.length > 0) { 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 let onUploading = newProps.onUploading
newProps.onUploading = (string, list, number) => { newProps.onUploading = (string, list, number) => {
if (string == 'uploading') { if (string == 'uploading') {
@ -176,6 +181,7 @@ ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload', {
window.ecCom.WeaLoadingGlobal.end(); // 停止遮罩loading window.ecCom.WeaLoadingGlobal.end(); // 停止遮罩loading
WfForm.showMessage(`上传失败`, 2, 30); WfForm.showMessage(`上传失败`, 2, 30);
} }
// onUploading(string, list, number)
} }
newProps.className = 'mainfj' newProps.className = 'mainfj'
@ -201,15 +207,12 @@ ecodeSDK.overwriteClassFnQueueMapSet('WeaUpload', { //组件名
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]