function All() {} All.prototype = { timer: '', arrToStr(arr: any) { if (arr) { return arr .map((item: any) => { return item.subjectName }) .toString() } }, toggleClass(arr: any, elem: any, key = 'id') { return arr.some((item: any) => { return item[key] == elem[key] }) }, toChecked(arr: any, elem: any, key = 'id') { const isIncludes = this.toggleClass(arr, elem, key) !isIncludes ? arr.push(elem) : this.removeEle(arr, elem, key) }, removeEle(arr: any, elem: any, key = 'id') { let includesIndex arr.map((item: any, index: any) => { if (item[key] == elem[key]) { includesIndex = index } }) arr.splice(includesIndex, 1) }, setApproverStr(nodeConfig: any) { if (nodeConfig.settype == 1 || nodeConfig.settype == 3) { if (nodeConfig.subjects.length == 1) { return nodeConfig.subjects[0].subjectName } else if (nodeConfig.subjects.length > 1) { if (nodeConfig.examineMode == 1) { return this.arrToStr(nodeConfig.subjects) } else if (nodeConfig.examineMode == 2) { return nodeConfig.subjects.length + '人会签' } } } else if (nodeConfig.settype == 2) { const level = nodeConfig.directorLevel == 1 ? '直接主管' : '第' + nodeConfig.directorLevel + '级主管' if (nodeConfig.examineMode == 1) { return level } else if (nodeConfig.examineMode == 2) { return level + '会签' } } else if (nodeConfig.settype == 4) { if (nodeConfig.selectRange == 1) { return '发起人自选' } else { if (nodeConfig.subjects.length > 0) { if (nodeConfig.selectRange == 2) { return '发起人自选' } else { return '发起人从' + nodeConfig.subjects[0].name + '中自选' } } else { return '' } } } else if (nodeConfig.settype == 5) { return '发起人自己' } }, dealStr(str: any, obj: any) { const arr = ref([]) const list = str.split(',') for (var elem in obj) { list.map((item: any) => { if (item == elem) { arr.push(obj[elem].value) } }) } return arr.join('或') }, conditionStr(nodeConfig: any, index: any) { const { condGroup, subjects } = nodeConfig.conditionNodes[index] if (condGroup.items.length == 0) { return index == nodeConfig.conditionNodes.length - 1 && nodeConfig.conditionNodes[0].condGroup.items.length != 0 ? '其他条件进入此流程' : '请设置条件' } else { const str = '已设置条件' return str ? str : '请设置条件' } }, copyerStr(nodeConfig: any) { if (nodeConfig.copyTo.length != 0) { return this.arrToStr(nodeConfig.copyTo) } else { if (nodeConfig.ccSelfSelectFlag == 1) { return '发起人自选' } } }, toggleStrClass(item: any, key: any) { const a = item.zdy1 ? item.zdy1.split(',') : [] return a.some((item: any) => { return item == key }) } } export default new (All as any)()