// 内库使用-start
import Loading from "./../../../Loading";
// 内库使用-end

/* 测试使用-start
import { Loading } from 'seedsui-react'
测试使用-end */

// 显隐Loading
function showLoading(rootDOM) {
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
    content = _ref.content,
    index = _ref.index;
  if (!rootDOM) return;
  // 根节点遮罩
  rootDOM.classList.add('uploading');
  // 新增按钮遮罩
  var chooseDOM = rootDOM.querySelector('[data-type="upload"]');
  if (chooseDOM) chooseDOM.classList.add('uploading');
  // 当前项遮罩
  var itemDOM = typeof index === 'number' ? rootDOM.querySelector("[data-index=\"".concat(index, "\"]")) : null;
  if (itemDOM) {
    itemDOM.classList.remove('fail');
    itemDOM.classList.add('uploading');
  }
  Loading.show(content ? {
    content: content
  } : {
    className: 'hide'
  });
}
export default showLoading;