// 显示工具栏按钮
export default (store) => (dataElements) => {
  const headerItems = [...store.getActiveHeaderItems, ...store.getTools, ...store.getActiveRightHeaderItems, ...store.getToolItems.annotation[0].tools, ...store.getToolItems.form];

  if (Array.isArray(dataElements)) {
    for (let i = 0; i < headerItems.length; i++) {
      dataElements.forEach(element => {
        if (headerItems[i].dataElement === element) {
          headerItems[i].hidden = false;
        }
      });
    }
  } else if (typeof dataElements === 'string') {
    const obj = headerItems.find(obj => obj.dataElement === dataElements);
    if (obj) {
      obj.hidden = false;
    } else {
      console.warn('DataElement not found.');
    }
  } else {
    console.error('Wrong dataElements type.');
  }
};