export default {
  methods: {
    existTabField(pname, type, bool,showtabfiled) {
      let obj = {};
      showtabfiled.forEach((item) => {
        if (item.pname === pname) {
          obj = JSON.parse(JSON.stringify(item));
          return false;
        }
      });
      const lang = localStorage.getItem("language");
      if (type == "refer") {
        return !!obj.pname;
      } else if (type == "necessary") {
        return obj.necessary == "1";
      } else {
        return obj.pname && lang === "cn"
          ? obj.name + (!bool ? ":" : "")
          : obj.pname && lang === "en"
          ? obj.enname + (!bool ? ":" : "")
          : obj.enname + (!bool ? ":" : "");
      }
    },
  }
}
