// import FormPanel from '../form/view/FormPanel';
class HTMLOperate {
  constructor(form) {
   this.form=form;
  }
  toHtml(html){
    let h=html;
    let arr=[];
    
    // h=h.replace(/<tableLayout/g,'<table');
    // h=h.replace(/<\/tableLayout/g,'</table');
    // h=h.replace(/<tbody>/g,"")
    // h=h.replace(/<\/tbody>/g,"")
    // h=h.replace(/<tr>/g,"")
    // h=h.replace(/<\/tr>/g,"")
    // h=h.replace(/<td/g,"<tableLayoutTd");
    // h=h.replace(/\/td/g,"/tableLayoutTd");
    // h=h.replace(/tablelayout-base/,"tablelayout tablelayout-base")
    h=h.replace(/<f-input/g,"<input")
    h=h.replace(/f-input>/g,"input>")
    h=h.replace(/<f-textarea/g,"<textarea")
    h=h.replace(/f-textarea>/g,"textarea>")
    h=h.replace(/<f-radio/g,"<radio")
    h=h.replace(/f-radio>/g,"radio>")
    h=h.replace(/<f-checkbox/g,"<checkbox")
    h=h.replace(/f-checkbox>/g,"checkbox>")
    h=h.replace(/<f-data/g,"<data")
    h=h.replace(/f-data>/g,"data>")
    h=h.replace(/<f-select/g,"<select")
    h=h.replace(/f-select>/g,"select>")
    h=h.replace(/<f-dept/g,"<dept")
    h=h.replace(/f-dept>/g,"dept>")
    h=h.replace(/<f-selectaboutfield/g,"<selectaboutfield")
    h=h.replace(/f-selectaboutfield>/g,"selectaboutfield>")
    h=h.replace(/<f-treedepartmentfield/g,"<treedepartmentfield")
    h=h.replace(/f-treedepartmentfield>/g,"treedepartmentfield>")
    h=h.replace(/<f-userfield/g,"<userfield")
    h=h.replace(/f-userfield>/g,"userfield>")
    h=h.replace(/<f-suggestfield/g,"<suggestfield")
    h=h.replace(/f-suggestfield>/g,"suggestfield>")
    h=h.replace(/<f-button/g,"<button")
    h=h.replace(/f-button>/g,"button>")
    h=h.replace(/<f-viewdialogfield/g,"<viewdialogfield")
    h=h.replace(/f-viewdialogfield>/g,"viewdialogfield>")
    h=h.replace(/<f-img/g,"<img")
    h=h.replace(/f-img>/g,"img>")
    // arr=h.split(">");
    // let length=arr.length;
    
    // for(let i=0;i<length;i++){
    //   this.form
    // }

    console.log(h);
    return h;
  }
  hadleHtml(html){
    let h=html;
    // let arr=[];
    // h=h.replace(/<div style='position:relative'>/,"");
    // h=h.replace(/<\/div>/,"");

    h=h.replace(/<table/g,'<tableLayout');
    h=h.replace(/<\/table/g,'</tableLayout');
    h=h.replace(/<tbody>/g,"")
    h=h.replace(/<\/tbody>/g,"")
    h=h.replace(/<tr>/g,"")
    h=h.replace(/<\/tr>/g,"")
    h=h.replace(/<td/g,"<tableLayoutTd");
    h=h.replace(/\/td/g,"/tableLayoutTd");
    h=h.replace(/tablelayout-base/,"tablelayout tablelayout-base")
    h=h.replace(/<input/g,"<f-input")
    h=h.replace(/input>/g,"f-input>")
    h=h.replace(/<textarea/g,"<f-textarea")
    h=h.replace(/textarea>/g,"f-textarea>")
    h=h.replace(/<radio/g,"<f-radio")
    h=h.replace(/radio>/g,"f-radio>")
    h=h.replace(/<checkbox/g,"<f-checkbox")
    h=h.replace(/checkbox>/g,"f-checkbox>")
    h=h.replace(/<data/g,"<f-data")
    h=h.replace(/data>/g,"f-data>")
    h=h.replace(/<select/g,"<f-select")
    h=h.replace(/select>/g,"f-select>")
    h=h.replace(/<dept/g,"<f-dept")
    h=h.replace(/dept>/g,"f-dept>")
    h=h.replace(/<selectaboutfield/g,"<f-selectaboutfield")
    h=h.replace(/selectaboutfield>/g,"f-selectaboutfield>")
    h=h.replace(/<treedepartmentfield/g,"<f-treedepartmentfield")
    h=h.replace(/treedepartmentfield>/g,"f-treedepartmentfield>")
    h=h.replace(/<userfield/g,"<f-userfield")
    h=h.replace(/userfield>/g,"f-userfield>")
    h=h.replace(/<suggestfield/g,"<f-suggestfield")
    h=h.replace(/suggestfield>/g,"f-suggestfield>")
    h=h.replace(/<button/g,"<f-button")
    h=h.replace(/button>/g,"f-button>")
    h=h.replace(/<viewdialogfield/g,"<f-viewdialogfield")
    h=h.replace(/viewdialogfield>/g,"f-viewdialogfield>")
    h=h.replace(/<img/g,"<f-img")
    h=h.replace(/img>/g,"f-img>")
    // arr=h.split(">");
    // let length=arr.length;
    
    // for(let i=0;i<length;i++){
    //   this.form
    // }

    console.log(h);
    return h;
  }
  parseHtml(){
    
  }
}

export default HTMLOperate;
