node删除 + 下载+导入+到处功能
删除 node_modules操作
window.open(location.origin + location.pathname + '#/' + item.url, '_blank')
//新开窗口下载
openwin(url) {
var a = document.createElement("a");
a.setAttribute("href", url);
a.setAttribute("target", "_blank");
a.setAttribute("id", "openwin");
document.body.appendChild(a);
a.click();
},
// 导出人员信息
exportInfo(){
let ids = this.selectedChangeData
const loading = this.$loading({
lock: true,
text: '拼命加载中',
spinner: 'el-icon-loading',
customClass: 'el-icon-loadings'
});
exportEmps(ids).then(res => {
let url = res.data.data
this.openwin(url)
}, this.err).finally(() => loading.close())
},
//滚动
var scrollHeights = obj.parents('.readItem')[0].offsetTop
obj.parents('.infor_cont_kecheng').animate({ scrollTop: scrollHeights }, 200)
var height = document.getElementsByClassName('infor_cont_wrap')[1].scrollTop
var timer = setInterval(function(){
height--
if(height == 0){
alert(11)
clearInterval(timer)
return false
}
document.getElementsByClassName('infor_cont_wrap') [1].scrollTo(0,height)
},10)
var height = document.getElementsByClassName('infor_cont_wrap')[1].scrollTop
console.log(height)
var timer = setInterval(function(){
height = height - 2
if(height < 2){
alert(11)
clearInterval(timer)
return false
}
document.getElementsByClassName('infor_cont_wrap') [1].scrollTo(0,height)
},1)
//大数据运用此方法去创建虚拟节点 只需要添加一次
function addSchoolNameListener() {
$('#registerPanel').on('input propertychange', '.schoolName', function() {
var name = $(this).val()
var schoolData = []
for (var i = 0, len = curSchoolList.length; i < len; i++) {
if (curSchoolList[i].itemValue.includes(name)) {
schoolData.push(curSchoolList[i])
}
}
var ul = document.getElementById('schoolList');
$('#schoolList').html('')
// 创建虚拟节点
var fragment = document.createDocumentFragment();
for (var i = 0, len = schoolData.length; i < len; i++) {
var li = document.createElement("option");
li.innerText = schoolData[i].itemValue;
fragment.appendChild(li);
}
ul.appendChild(fragment);
});