/**
* @description:
* @param location_selector 要赋值的选择器
* @param id 要赋予或删除的值
* @param type 1、赋予 2、删除
* @return
*/
function click_to_value(location_selector,id,type)
{
let vals = $(location_selector).val();
if (vals == '') {
vals = [];
} else {
vals = vals.split(',');
}
if (type == 1) {
let index = vals.indexOf(id);
if (index == -1) {
vals.push(id);
}
} else {
let index = vals.indexOf(id);
if (index != -1) {
vals.splice(index,1);
}
}
$(location_selector).val(vals.join(','));
}