删除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
|
||||||
|
35
register.js
35
register.js
@ -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'
|
||||||
|
|
||||||
@ -193,7 +199,7 @@ const MinXiUDowm = (props, Com) => { //此函数不允许写在复写方法内
|
|||||||
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) => {
|
||||||
@ -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]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user