/**
* markdown文件预览
* @author weidy@2021-3-16
* @constructor
*/
layui.define(['layer','element','form','table','tree'],function(exports){
var MD = function(){
this.MODELNAME = "platform/objectService/VciMd";
this.moduleKey = "VciMd";
this.id='VciMd';
this.sourceData={};
this.backPath = configData.compatibility?path:configData.objectServicePath;
this.url={
controller:'mdController/',
tree:'treeAllMD'
};
this.getContent=function(){
var that = this;
var html = "";
html = [
that.getToolbarHtml(),
'
'
].join("");
return html;
};
this.getToolbarHtml = function(){
var that = this;
return ['',//主列表的按钮
'',
'
'].join("");
};
this.init=function(){//基础的html被添加后,再执行初始化
var that = this;
$webUtil.copyConfig(that,that.moduleKey);
var tree = layui.tree;
var scrollHeight = window.innerHeight;
var treeUL = $('[layui-filter="tree_' + that.id + '"]');
var treeHeight = scrollHeight - 200;
treeUL.parent().height(treeHeight);
tree.init("tree_" + that.id, treeUL, {
url: that.url.controller + that.url.tree,
backPath: that.backPath,
showSearch:true,
loadType:tree.loadType.all,
click: function (item, elem, options) {
that.showMd(item.oid);
}
});
$webUtil.bindDefultButtonLisenter(that, that.id);
};
this.showMd = function (fileName) {
var that = this;
$("#md_" + that.id).html('');
};
this.refresh = function(){
var that = this;
var tree = layui.tree;
tree.reload("tree_" + that.id);
};
};
var md = new MD();
exports(md.MODELNAME,md);
});