import AbstractField from "./AbstractField";
import { Sequence } from "../../utility";

class TreedepartmentField extends AbstractField{
    constructor(container) {
        super();
        this.scope="treedepartmentField"
        this.container = container;
        this.htmlDOM=null;
        this.className="baseField";
        this.propValues.id = Sequence.createUuid();
        this.html=`<div style="padding: 5px 0;line-height: 20px;color: #3d464d;font-weight: 600;">
        <span  class="baseLabel-title" style="font-size: 14px;color: #3d464d;">树形部门选择框</span>
        </div><div class="baseCon fieldId" fieldid='${this.propValues.id}'  style="height: 30px;width:50%">
        <input type="text" fieldId='${this.propValues.id}' class="base-field" readonly><i class=" publicFieldIcon treeDeptIcon"></i></div>`;
        
        this.propValues.name="树形部门选择框"+window.formApp.formPanel.propValues.nameIndex;

        this.propValues.texttype = "text";//显示
        this.propValues.readonlyshowvalonly = true; //只读时仅只显示值
        this.propValues.refreshonchanged = false; //刷新
        this.propValues.calculateonrefresh = false; //重计算
        this.propValues.mobile = true; //手机可用
        this.propValues.refreshmode = "0"; //重刷新的方式
        this.propValues.refreshfields = []; //局部刷新的字段组合
        this.propValues.discript ="";
        // this.propValues.refresh = '0';
        this.propValues.editProp="editTreedepartmentField";
        this.propValues.validatelibs =[]; //校验方式
        this.propValues.isdefaultvalue = false; //仅创建时计算
        this.propValues.validaterule = ""; //校验脚本
        this.propValues.instantvalidate = false; //即时校验（新增属性）


        this.propValues.hiddenscript = ""; //隐藏条件脚本
        this.propValues.hiddenvalue = ""; //隐藏时显示值
        this.propValues.hiddenprintscript = ""; //打印时隐藏条件脚本
        this.propValues.printhiddenvalue = ""; //打印隐藏时显示值
        this.propValues.readonlyscript = ""; //只读条件脚本
        
        this.propValues.limit=""//最多可选
        this.propValues.fieldtype="VALUE_TYPE_TEXT"
    }
    getPropsDesc() {
        return {
            "base":['myselfrows','layout','name','texttype','limit','readonlyshowvalonly','refreshonchanged','refreshmode','refreshfields','calculateonrefresh','mobile','discript'],
            "check":['validatelibs','validaterule','instantvalidate'],
            "hidden":['hiddenscript','hiddenvalue'],
            "hiddenprint":["hiddenprintscript","printhiddenvalue"],
            "readonly":['readonlyscript']


        }
    }
    
}
export default TreedepartmentField;