实现自动匹配证书和批量选择证书功能

This commit is contained in:
刘祥超
2023-03-25 20:50:27 +08:00
parent 48e2907426
commit 2bc43ee2a5
9 changed files with 377 additions and 103 deletions

View File

@@ -11,4 +11,67 @@ Tea.context(function () {
}
})
}
this.encodeURL = function (arg) {
return window.encodeURIComponent(arg)
}
/**
* 复选框
*/
this.countChecked = 0
this.certs.forEach(function (cert) {
cert.isChecked = false
})
this.changeAll = function (b) {
let that = this
this.certs.forEach(function (cert) {
cert.isChecked = b
})
if (b) {
let countChecked = 0
this.certs.forEach(function (cert, index) {
if (cert.isChecked && !that.certInfos[index].isSelected) {
countChecked++
}
})
this.countChecked = countChecked
} else {
this.countChecked = 0
}
}
this.changeCertChecked = function () {
let countChecked = 0
this.certs.forEach(function (cert) {
if (cert.isChecked) {
countChecked++
}
})
this.countChecked = countChecked
}
this.confirmChecked = function () {
let resultCerts = []
let resultCertRefs = []
this.certs.forEach(function (cert) {
if (cert.isChecked) {
resultCerts.push(cert)
resultCertRefs.push({
isOn: true,
certId: cert.id
})
}
})
NotifyPopup({
code: 200,
data: {
certs: resultCerts,
certRefs: resultCertRefs
}
})
}
})