代码优化

This commit is contained in:
BianLzhaoMin 2024-11-11 15:40:08 +08:00
parent 80fdebcb4e
commit 9645d6160c
20 changed files with 100 additions and 98 deletions

View File

@ -13,7 +13,7 @@
"type" : "uniCloud" "type" : "uniCloud"
}, },
{ {
"playground" : "standard", "playground" : "custom",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]

View File

@ -40,7 +40,7 @@
activeBorderColor="#003778" activeBorderColor="#003778"
activeBackgroundColor="#003778" activeBackgroundColor="#003778"
style="transform: scale(0.7)" style="transform: scale(0.7)"
@tap="onCheckBoxChangeAll()" @tap="onCheckBoxChangeAll(isAllChecked)"
/> />
</label> </label>
</view> </view>
@ -324,14 +324,14 @@ export default {
}, },
onCheckBoxChange(item) { onCheckBoxChange(item) {
item.isChecked = !item.isChecked item.isChecked = !item.isChecked
try { // try {
this.subUserListAll.forEach(e => { // this.subUserListAll.forEach(e => {
if (e.idNumber == item.idNumber) { // if (e.idNumber == item.idNumber) {
e.isChecked = !eisChecked // e.isChecked = !eisChecked
throw new Error() // throw new Error()
} // }
}) // })
} catch (error) {} // } catch (error) {}
this.subUserListTemp = [] this.subUserListTemp = []
this.subUserList.forEach(e => { this.subUserList.forEach(e => {
@ -419,12 +419,13 @@ export default {
// } else { // } else {
// } // }
this.subUserList.forEach(e => {
console.log('选择的每一项', e)
this.fixedPersonList = [] this.fixedPersonList = []
this.tempPersonList = [] this.tempPersonList = []
this.returnPersonList = [] this.returnPersonList = []
this.subUserList.forEach(e => {
console.log('选择的每一项', e)
if (e.isChecked) { if (e.isChecked) {
if (e.userState == 1) { if (e.userState == 1) {
// //
@ -455,9 +456,10 @@ export default {
}) })
}, },
// //
onCheckBoxChangeAll() { onCheckBoxChangeAll(isAllChecked) {
console.log(isAllChecked, 'isAllChecked')
this.subUserList.forEach(e => { this.subUserList.forEach(e => {
e.isChecked = !e.isChecked e.isChecked = !isAllChecked
}) })
if (this.subUserList.every(e => e.isChecked == true)) { if (this.subUserList.every(e => e.isChecked == true)) {

View File

@ -644,11 +644,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -647,11 +647,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -535,11 +535,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -539,11 +539,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -650,11 +650,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -600,11 +600,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -544,11 +544,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -640,11 +640,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
isSHowBtn(item) { isSHowBtn(item) {

View File

@ -604,11 +604,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -662,11 +662,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -691,11 +691,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -556,11 +556,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -586,11 +586,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -648,11 +648,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -745,11 +745,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { /* this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) e.auditingInfo = e.auditingInfo.splice(-1, 1)
} }
}) }) */
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -631,11 +631,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -642,11 +642,11 @@ export default {
} }
} }
}) })
this.processList.forEach(e => { // this.processList.forEach(e => {
if (e.auditingInfo.length > 1) { // if (e.auditingInfo.length > 1) {
e.auditingInfo = e.auditingInfo.splice(-1, 1) // e.auditingInfo = e.auditingInfo.splice(-1, 1)
} // }
}) // })
} }
}, },
/* 复选框事件 */ /* 复选框事件 */

View File

@ -15,7 +15,7 @@ let isRequesting = false // 请求锁,防止重复请求
const request = config => { const request = config => {
// 如果正在请求中,直接返回一个 rejected promise // 如果正在请求中,直接返回一个 rejected promise
if (isRequesting) { if (isRequesting) {
return uni.showToast({ title: '请求正在处理中...请稍后', icon: 'none' }) // return uni.showToast({ title: '请求正在处理中...请稍后', icon: 'none' })
// return Promise.reject('请求正在处理中,请稍后再试') // return Promise.reject('请求正在处理中,请稍后再试')
// uni.showToast({ title: '请求正在处理中...', icon: 'none' }) // uni.showToast({ title: '请求正在处理中...', icon: 'none' })
} }