layui.config({
base: '../../assets/lib/layuiext/module/'
}).extend({
treetable: 'treetable-lay/treetable'
}).use(['element', 'form', 'treetable'], function(){ //加载code模块
var form = layui.form;
var treetable = layui.treetable;
var $ = layui.jquery;
// key:module
var docItemStore = {};
function initDocModules() {
$.getJSON(SopConfig.url + '/doc/getDocBaseInfo', function (baseInfo) {
var html = [];
var docInfoList = baseInfo.docInfoList;
for (var i = 0; i < docInfoList.length; i++) {
var docInfo = docInfoList[i];
var selected = i === 0 ? 'selected="selected"' : '';
var title = docInfo.title;
html.push('');
}
$('#moduleList').html(html.join(''));
$('.url-prod').text(baseInfo.urlProd);
form.render('select');
if (docInfoList && docInfoList.length > 0) {
selectDocInfo(docInfoList[0].title);
}
})
}
function selectDocInfo(title) {
$.getJSON(SopConfig.url + '/doc/docinfo/' + title, function (docInfo) {
var moduleList = docInfo.docModuleList;
var html = [];
var firstItem;
for (var j = 0; j < moduleList.length; j++) {
var module = moduleList[j];
var docItems = module.docItems;
html.push('
' + module.module + '
');
for (var i = 0; i < docItems.length; i++) {
var docItem = docItems[i];
var first = j == 0 && j == 0;
if (first) {
firstItem = docItem;
}
docItemStore[docItem.nameVersion] = docItem;
/*