layui.use(['element', 'form'], function(){ //加载code模块
var form = layui.form;
// key:module
var docItemStore = {};
function initDocModules() {
$.getJSON(SopConfig.url + '/doc/getDocBaseInfo', function (baseInfo) {
var html = [];
var modules = baseInfo.docModuleVOList;
for (var i = 0; i < modules.length; i++) {
var docDefinition = modules[i];
var module = docDefinition.module;
var selected = i === 0 ? 'selected="selected"' : '';
html.push('');
}
$('#moduleList').html(html.join(''));
form.render('select');
if (modules && modules.length > 0) {
selectModule(modules[0].module);
}
$('.url-prod').text(baseInfo.urlProd);
})
}
function selectModule(docModule) {
$.getJSON(SopConfig.url + '/doc/module/' + docModule, function (module) {
var docItems = module.docItems;
var html = ['
' + docModule + '
'];
for (var i = 0; i < docItems.length; i++) {
var docItem = docItems[i];
docItemStore[docItem.nameVersion] = docItem;
/*