<%@ page import="com.lightinit.hsdataplatform.dictionary.DicResourceCatelogType" %>
<%@ page import="com.lightinit.hsdataplatform.dictionary.DicResourceState" %>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<jsp:include page="../../../common/admin/modal_content_pre.jsp"><jsp:param name="modal_title" value="属性图谱"/></jsp:include>
<button id="btnImgs" onclick="themeListHiddens()" type="button" class="btn btn-sm btn-primary "><i class="fa fa-bars" aria-hidden="true"></i></button>
<button id="btnNoImgs"  onclick="themeListShows()" type="button" class="btn btn-sm btn-primary "><i class="fa fa-bullseye" aria-hidden="true"></i></button>
<div id="mains" style="width: 600px;height:550px;"></div>
<div id="divGridResourceLists" hidden>

</div>
<input type="hidden" id="resourceId" value="${resourceId}">
<jsp:include page="../../../common/admin/modal_content_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/modal_footer_pre.jsp"></jsp:include>
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i>取消</button>
<jsp:include page="../../../common/admin/modal_footer_post.jsp"></jsp:include>
<script type="text/javascript">
    $("#btnNoImgs").hide() ;

    var dom = document.getElementById("mains");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    myChart.showLoading();
    $.get('<%=basePath%>/admin/resourceDeptImg/findResourceById.action?resourceId='+$("#resourceId").val(), function (data) {
        myChart.hideLoading();

        myChart.setOption(option = {
            tooltip: {
                trigger: 'item',
                triggerOn: 'mousemove'
            },
            series: [
                {
                    type: 'tree',

                    data: [data],

                    top: '18%',
                    bottom: '14%',

                    layout: 'radial',

                    symbol: 'emptyCircle',

                    symbolSize: 7,

                    initialTreeDepth: 3,

                    animationDurationUpdate: 750

                }
            ]
        });
    });;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }

    function themeListHiddens(){
        $("#mains").hide() ;
        $("#divGridResourceLists").show() ;
        $("#btnNoImgs").show() ;
        $("#btnImgs").hide() ;
    }

    function themeListShows(){
        $("#mains").show() ;
        $("#divGridResourceLists").hide() ;
        $("#btnNoImgs").hide() ;
        $("#btnImgs").show() ;
    }

    $("#divGridResourceLists").renderPartial({url: "<%=basePath%>/admin/resourceDeptImg/resourceList.action?resourceId="+$("#resourceId").val()});

</script>