四元表达式

// 展示安全问题详情
        ShowSecurityQues (item) {
            const itemCode = item.label
            this.detailsTitle = itemCode
            const SecurityNum = this.SecurityInfo.findIndex((item) => {
                return item.checkCode === itemCode
            })
            this.work_content_info = [...this.security_content_info]
            this.work_content_info.forEach(item => {
                const SecurityProp = this.SecurityInfo[SecurityNum][item.prop]
                if (item.prop === 'state') {
                    item.info = (SecurityProp === 'back' ? '退回' : (SecurityProp === 'end' ? '通过' : '审批中'))
            this.activeColor = (SecurityProp === 'back' ? '#FF1A1A' : (SecurityProp === 'end' ? '#00D390' : '#FA6400')) } else if (item.prop === 'imgUrl') { this.imageUrl = [] let imgUrls if (SecurityProp !== '') { imgUrls = SecurityProp.split(',') } if (imgUrls && imgUrls.length > 0) { imgUrls.forEach(item => { this.imageUrl.push(window.g.baseUrl + '/downLoad1/' + item + '/' + getStore('bcToken')) }) } else { this.imageUrl = [] } } else if (item.prop === 'problemLevel') { item.info = (SecurityProp === '0' ? '一般' : (SecurityProp === '1' ? '重大' : '严重')) } else { item.info = SecurityProp } }) },

参考:https://www.cnblogs.com/szqtiger/p/12108371.html

原文地址:https://www.cnblogs.com/jvziking/p/15124861.html