|  |  |  | 
|---|
|  |  |  | var pageCount = 0; | 
|---|
|  |  |  | layui.config({ | 
|---|
|  |  |  | base: baseUrl + "/static/layui/lay/modules/" | 
|---|
|  |  |  | }).use(['table','laydate', 'form', 'admin', 'xmSelect'], function(){ | 
|---|
|  |  |  | var table = layui.table; | 
|---|
|  |  |  | }).use(['treeTable','laydate', 'form', 'admin', 'xmSelect'], function(){ | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var layDate = layui.laydate; | 
|---|
|  |  |  | var form = layui.form; | 
|---|
|  |  |  | var admin = layui.admin; | 
|---|
|  |  |  | var xmSelect = layui.xmSelect; | 
|---|
|  |  |  | var table = layui.treeTable; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 数据渲染 | 
|---|
|  |  |  | tableIns = table.render({ | 
|---|
|  |  |  | 
|---|
|  |  |  | height: 'full-120', | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox'} | 
|---|
|  |  |  | ,{field: 'id', align: 'center',title: 'ID'} | 
|---|
|  |  |  | ,{field: 'uuid', align: 'center',title: '编号'} | 
|---|
|  |  |  | ,{field: 'name', align: 'center',title: '名称'} | 
|---|
|  |  |  | ,{field: 'parentId', align: 'center',title: '父级'} | 
|---|
|  |  |  | ,{field: 'parentName', align: 'center',title: '父级名称'} | 
|---|
|  |  |  | ,{field: 'path', align: 'center',title: '关联路径'} | 
|---|
|  |  |  | ,{field: 'pathName', align: 'center',title: '关联路径名'} | 
|---|
|  |  |  | ,{type: 'numbers'} | 
|---|
|  |  |  | ,{field: 'name', align: 'left',title: '名称', minWidth: 150} | 
|---|
|  |  |  | // ,{field: 'uuid', align: 'center',title: '编号'} | 
|---|
|  |  |  | ,{field: 'type$', align: 'center',title: '类型'} | 
|---|
|  |  |  | ,{field: 'leading', align: 'center',title: '负责人'} | 
|---|
|  |  |  | ,{field: 'img', align: 'center',title: '图片'} | 
|---|
|  |  |  | ,{field: 'brief', align: 'center',title: '简要描述'} | 
|---|
|  |  |  | ,{field: 'count', align: 'center',title: '数量'} | 
|---|
|  |  |  | ,{field: 'level', align: 'center',title: '等级'} | 
|---|
|  |  |  | ,{field: 'img', align: 'center',title: '图片', hide: true} | 
|---|
|  |  |  | // ,{field: 'brief', align: 'center',title: '简要描述'} | 
|---|
|  |  |  | // ,{field: 'count', align: 'center',title: '数量'} | 
|---|
|  |  |  | ,{field: 'sort', align: 'center',title: '排序'} | 
|---|
|  |  |  | ,{field: 'status$', align: 'center',title: '状态'} | 
|---|
|  |  |  | ,{field: 'createTime$', align: 'center',title: '添加时间'} | 
|---|
|  |  |  | ,{field: 'createBy$', align: 'center',title: '添加人员'} | 
|---|
|  |  |  | ,{field: 'updateTime$', align: 'center',title: '修改时间'} | 
|---|
|  |  |  | ,{field: 'updateBy$', align: 'center',title: '修改人员'} | 
|---|
|  |  |  | ,{field: 'memo', align: 'center',title: '备注'} | 
|---|
|  |  |  | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} | 
|---|
|  |  |  | ,{field: 'memo', align: 'center',title: '备注', hide: true} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | request: { | 
|---|
|  |  |  | pageName: 'curr', | 
|---|
|  |  |  | 
|---|
|  |  |  | form.val('detail', mData); | 
|---|
|  |  |  | layDateRender(mData); | 
|---|
|  |  |  | form.on('submit(editSubmit)', function (data) { | 
|---|
|  |  |  | data.field.parentId = insXmSel.getValue('valueStr'); | 
|---|
|  |  |  | var loadIndex = layer.load(2); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/tag/"+(mData?'update':'add')+"/auth", | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // 渲染下拉树 | 
|---|
|  |  |  | var insXmSel = xmSelect.render({ | 
|---|
|  |  |  | el: '#tagParentSel', | 
|---|
|  |  |  | height: '250px', | 
|---|
|  |  |  | data: tableIns.options.data, | 
|---|
|  |  |  | initValue: mData ? [mData.parentId] : [], | 
|---|
|  |  |  | model: {label: {type: 'text'}}, | 
|---|
|  |  |  | prop: { | 
|---|
|  |  |  | name: 'name', | 
|---|
|  |  |  | value: 'id' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | radio: true, | 
|---|
|  |  |  | clickClose: true, | 
|---|
|  |  |  | tree: { | 
|---|
|  |  |  | show: true, | 
|---|
|  |  |  | indent: 15, | 
|---|
|  |  |  | strict: false, | 
|---|
|  |  |  | expandedKeys: false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $(layero).children('.layui-layer-content').css('overflow', 'visible'); | 
|---|
|  |  |  | layui.form.render('select'); | 
|---|
|  |  |  | } | 
|---|