/**
|
* 自定义页面展示
|
* @author wangting
|
* @date 2021-6-1
|
*/
|
layui.define(['layer','element','flow'],function(exports){
|
var webUtil = $webUtil;
|
var Class = function() {
|
this.MODELNAME = "view/showDetail";
|
this.moduleKey = "showDetail";
|
this.backPath = configData.compatibility?path:configData.objectServicePath;
|
this.url = {
|
};
|
//必有
|
this.getContent = function (id,options) {
|
var that = this;
|
that.id=id;
|
var html = [
|
'<div class="showDetail" id="showDetail_',id,'" lay-filter="showDetail_',id,'" style="display:block;"></div>'
|
].join("");
|
return html;
|
};
|
//必有
|
this.init = function (id, options) {
|
var that = this;
|
webUtil.copyConfig(that, that.moduleKey);
|
that.id=id;
|
|
$.extend(that.sourceData,options);
|
|
that.options=options;
|
};
|
|
//必有,展示UI内容
|
this.loadForUI=function (sourceData) {
|
if (!sourceData) {
|
return;
|
}
|
var that = this;
|
var baseAction = layui['BaseAction'];
|
baseAction.callPreEvent(that.options, that, function (options) {
|
that.doLoad(sourceData, function () {
|
baseAction.callPostEvent(that.options, that, that.options.callback);
|
});
|
});
|
}
|
|
this.doLoad=function (sourceData,callback){
|
var that = this;
|
$("#showDetail_"+that.id).empty();
|
var html=''
|
for (var i in sourceData){
|
html+=i+': '+sourceData[i]+'<hr/>'
|
}
|
$("#showDetail_"+that.id).html(html)
|
if(callback){
|
callback()
|
}
|
}
|
|
|
this.refresh = function(){
|
var that = this;
|
|
};
|
|
this.destory = function(){
|
var that = this;
|
var filter = "showDetail_" + that.id;
|
$('#'+filter).remove()
|
};
|
};
|
var cs = new Class();
|
exports(cs.MODELNAME,cs);
|
});
|