// sortArr为要进行排序数组,standardArr为排序模板,比如['3级', '2级', '1级'],排序成['1级', '2级', '3级']
function sortCommon(sortArr) { return sortArr.sort((obj1, obj2) => { let obj1Value let obj2Value this.standardArr.forEach((v, k) => { if (v === obj1) { obj1Value = k } else if (v === obj2) { obj2Value = k } }) return obj1Value - obj2Value }) }