 (function(KDApi, $){
    // 构造函数，变量名随意，与最后一句代码的KDApi.register的第二个参数一致即可
    function HelloWorld (model) {
        this._setModel(model)
    }

    // 原型中封装生命周期函数，固定格式
    HelloWorld.prototype = {
        _setModel: function(model) {
            this.model = model
        },
        init: function(props){
            initFunc(this.model, props);
        },
        update: function(props){
			initFunc(this.model, props);
        },
        destoryed: function(){
        }
    }

    var initFunc = function(model, props) {
		console.log("init");
		KDApi.loadFile("./css/kingdee_fi_subertripcitylist.css", model, function () {
			KDApi.templateFilePath('./html/kingdee_fi_subertripcitylist.html', model,  props.data).then(
				function (result) {
						model.dom.innerHTML = result;
						var dom = model.dom;
						dom.style.overflow = "visible";
						var tripentry;
						var parent = dom.parentElement;
						for (var i = 0; i < parent.children.length; i++) {
							var child = parent.children[i];
							if (child.getAttribute("id") && child.getAttribute("id") === "tripentry") {
							   console.log(child);
							   tripentry = child;
							   break;
							}
						}
						var firstChildElement = tripentry.querySelector('div');
						tripentry.style.overflow = "visible";
						firstChildElement.style.overflow = "visible";
						firstChildElement.style.display = "inline";
				 }
			)
		}
	)}

    // 你只需知道第一个参数是你接下来要新增控件方案时填的方案id，第二个参数是上面声明的构造函数
    KDApi.register('kingdee-fi-subertripcitylist', HelloWorld)
})(window.KDApi, jQuery) // 这里的jQuery不是必须要传进去的，可移除，要用到的时候才传，PC端系统默认会有jQuery对象，版本是1.12.4	



	