MicroCommunityWeb/public/components/common/document/document.js
2024-06-01 03:08:50 +08:00

50 lines
1.5 KiB
JavaScript

(function(vc){
let DEFAULT_PAGE = 1;
let DEFAULT_ROW = 10;
vc.extends({
data:{
documentInfo: {
title: '帮助文档',
context: '非常抱歉,当前页面未配置文档'
}
},
_initMethod:function(){
},
_initEvent:function(){
vc.on('document','openDocument',function(_param){
$('#documentModal').modal('show');
$that._loadDocument();
});
},
methods:{
_loadDocument:function () {
let _componentCode = vc.getComponentCode();
var param = {
params: {
page:1,
row:1,
docCode:_componentCode
}
};
//发送get请求
vc.http.apiGet('/sysDocument/querySysDocument',
param,
function (json, res) {
let _json = JSON.parse(json);
let _total = _json.total;
if(_total < 1){
return;
}
$that.documentInfo.title = _json.data[0].docTitle;
$that.documentInfo.context = _json.data[0].docContent;
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
}
}
});
})(window.vc);