个人技术分享

function changeVal (row) {

row.new_order = row.new_order ? row.new_order : 1

const index = weightChangeData.value.findIndex(item => item.prod_code === row.prod_code)

const isValChange = !(row.page_view_order === row.new_order)

if (isValChange) {

if (index === -1) {

row.isChange = true

weightChangeData.value.push(row)

} else {

weightChangeData.value.splice(index, 1, row)

}

} else {

if (index > -1) {

weightChangeData.value.splice(index, 1)

}

}

modifyWeightVal()

}

// 输入框输入事件

const onBlurWeightVal = _.throttle(function (row) {

changeVal(row)

}, 300, {

leading: true,

trailing: false,

})