<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="com.lightinit.hsdataplatformresdir.dictionary.DicResourceCatelogType" %>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String basePath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="../../../common/admin/head.jsp"></jsp:include>
</head>
<body>
    <jsp:include page="../../../common/admin/body_pre.jsp"></jsp:include>
    <div class="row hidden-print">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h2>资源活化</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="javascript:void(0);" >数据目录</a>
                        </li>
                        <li class="active">
                            <strong>数据目录详情</strong>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <span><strong>数据目录详情</strong></span><%--表单头，目的修改文字--%>
    <form id="formAdd" action="<%=basePath%>/admin/datacatelog_mgr/addDataCatalog.action" method="post" class="form-horizontal">
        <div class="disabled row">
        <input type="hidden" name="dataCatelogWithBLOBs.id" value="${busiModel.id}"/>
        <div class="form-group">
            <label for="dataName" class="col-md-2 col-sm-2 control-label">信息资源名称：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="dataName" name="dataCatelogWithBLOBs.dataName" >${busiModel.dataName}</label>
            </div>
                <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="dataCode" class="col-md-2 col-sm-2 control-label">信息资源代码：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="dataCode" name="dataCatelogWithBLOBs.dataCode" >${busiModel.dataCode}</label>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="supplier" class="col-md-2 col-sm-2 control-label">信息资源提供方：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="supplier" name="supplier" ></label>
                <button type="button" class="form-control" style="width: 40%;height: 34px" disabled="disabled">
                    <%--<span class="caret" style="margin-left: 10px;"></span>--%>${sector.sectorName}
                </button>
                <div id="divAddSectorTree"></div>
                <span class="help-block"></span>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="supplierDept" class="col-md-2 col-sm-2 control-label">提供方内部部门：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <input type="hidden" id="supplierDept" name="supplierDept" />
                <button type="button" class="form-control" style="width: 40%;height: 34px" disabled="disabled">
                   <%-- <span class="caret" style="margin-left: 100px;"></span>--%>${sector.sectorName}
                </button>
                <div id="divAddSectorTree2"></div>
                <span class="help-block"></span>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="supplierCode" class="col-md-2 col-sm-2 control-label">资源提供方代码：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="supplierCode" name="dataCatelogWithBLOBs.supplierCode" >${busiModel.supplierCode}</label>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="dataSummary" class="col-md-2 col-sm-2 control-label">信息资源摘要：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="dataSummary" name="dataSummary" >${busiModel.dataSummary}</label>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="dataSourceType" class="col-md-2 col-sm-2 control-label">信息资源格式分类:</label>
            <div class="col-md-2 col-sm-2">
                <select id="dataSourceType" name="dataSourceType" class="form-control" disabled="disabled">
                    <c:forEach items="${InfomationResourceIdAndNameModels}" var="item" >
                        <c:choose>
                            <c:when test="${busiModel.dataSourceType == item.id}">
                                <option value="${item.id}"  selected="selected" >${item.groupName}</option>
                            </c:when>
                            <c:otherwise>
                                <option></option>
                            </c:otherwise>
                        </c:choose>
                    </c:forEach>
                </select>
                <span class="field-validation-valid help-block"></span>
            </div>
        </div>
        <div class="form-group">
            <label for="dataSource" class="col-md-2 col-sm-2 control-label">信息资源格式类型:</label>
            <div class="col-md-2 col-sm-2">
                <select id="dataSource" name="dataSource"  class="form-control"  disabled="disabled">
                    <c:forEach items="${list}" var="item" >
                        <c:choose>
                            <c:when test="${busiModel.dataSource == item.id}">
                                <option value="${item.id}"  selected="selected" >${item.groupName}</option>
                            </c:when>
                            <c:otherwise>
                                <option value="${item.id}">${item.groupName}</option>
                            </c:otherwise>
                        </c:choose>
                    </c:forEach>
                </select>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="dataSourceOther" class="col-md-2 col-sm-2 control-label">其他类型资源格式描述:</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="dataSourceOther" name="dataCatelogWithBLOBs.dataSourceOther" >${busiModel.dataSourceOther}</label>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="updateCycle" class="col-md-2 col-sm-2 control-label">更新周期：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="updateCycle" name="dataCatelogWithBLOBs.supplier" >${busiModel.updateCycle}</label>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="publishTime" class="col-md-2 col-sm-2 control-label">发布时间：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="publishTime" name="dataCatelogWithBLOBs.publishTime" ><fmt:formatDate value="${busiModel.publishTime}"  type="Date" pattern="yyyy-MM-dd"/></label>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
        <div class="form-group">
            <label for="relation" class="col-md-2 col-sm-2 control-label">关联及类目名称：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <label type="text" id="relation" name="dataCatelogWithBLOBs.relation" >${busiModel.relation}</label>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>

         <div class="form-group">
             <label  class="col-md-2 col-sm-2 control-label">目录分类：</label>
             <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                 <label type="text" id="catelogType" name="dataCatelogWithBLOBs.catelogType" >${busiModel.catelogType}</label>
             </div>
             <span class="field-validation-valid help-block"></span>
         </div>
        <div class="form-group">
             <label  class="col-md-2 col-sm-2 control-label">基础分类：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <button type="button" class="form-control" style="width: 40%;height: 34px" disabled="disabled">
                   <%-- <span class="caret" style="margin-left: 10px;"></span>--%>
                </button>
                <div id="divCatelogBasic"></div>
                <span class="help-block"></span>
            </div>
         </div>
        <div class="form-group">
            <label for="catelogSector" class="col-md-2 col-sm-2 control-label">部门分类：</label>
            <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
                <input type="hidden" id="catelogSector" name="catelogSector" />
                <button type="button" class="form-control" style="width: 40%;height: 34px" disabled="disabled">
                   <%-- <span class="caret" style="margin-left: 10px;"></span>--%>
                </button>
                <div id="divCatelogSector"></div>
                <span class="help-block"></span>
            </div>
            <span class="field-validation-valid help-block"></span>
        </div>
       <div class="form-group">
           <label for="catelogTheme" class="col-md-2 col-sm-2 control-label">主题分类：</label>
           <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
               <input type="hidden" id="catelogTheme" name="catelogTheme" />
               <button type="button"class="form-control" style="width: 40%;height: 34px" disabled="disabled">
                   <%--<span class="caret" style="margin-left: 10px;"></span>--%>
               </button>
               <div id="divCatelogTheme"></div>
               <span class="help-block"></span>
           </div>
       </div>
       <div class="form-group">
           <label for="catelogCustom" class="col-md-2 col-sm-2 control-label">自定义分类：</label>
           <div class="col-md-7 col-sm-7" style="padding-top: 7px;">
               <input type="hidden" id="catelogCustom" name="catelogCustom" />
               <button type="button" class="form-control" style="width: 40%;height: 34px" disabled="disabled">
                  <%-- <span class="caret" style="margin-left: 10px;"></span>--%>
               </button>
               <div id="divCatelogCustom"></div>
               <span class="help-block"></span>
           </div>
        </div>
        <%--////////////////////////表单div////////////////--%>
        <%--<div class="row">--%>
        <table id="testaaa" class="table table-striped table-bordered table-condensed " align="center">
            <thead>
            <tr>
                <td>信息项名称</td>
                <td>数据项类型</td>
                <td>数据长度</td>
                <td>共享类型</td>
                <td>共享条件</td>
                <td>共享方式分类</td>
                <td>共享方式类型</td>
                <td>是否向社会开放</td>
                <td>开放条件</td>
            </tr>
            </thead>
            <tbody>
                <c:forEach items="${busiModel.dataCatelogItemList}" var="item" varStatus="status">
                    <tr>
                        <td>${item.itemName}</td>
                        <td>${item.itemType}</td>
                        <td>${item.itemLength}</td>
                        <td>${item.shareType}</td>
                        <td>${item.shareCondition}</td>
                        <td>${item.shareMethodCategory}</td>
                        <td>${item.shareMethodType}</td>
                        <td>${item.isOpen==1?"是":"否"}</td>
                        <td>${item.openCondition}</td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
        <button id="btnBack11" type="button" class="btn btn-sm btn-inverse btn-position"><i class="fa fa-reply"></i>返回</button>
       <%-- </div>--%>
    </form>
    <jsp:include page="../../../common/admin/grid_post.jsp"></jsp:include>
    <jsp:include page="../../../common/admin/body_post.jsp"></jsp:include>
    <script type="text/javascript">
        $("#btnBack11").click(function () {
            window.location.href="<%=basePath%>/admin/datacatelog_mgr/index.htm"
        });


        $("#divAddSectorTree").selectTree({url: "<%=basePath%>/admin/common/sector_tree_data.action${busiModel.supplier == null ? "" : "?selectedId="}${busiModel.supplier}"});
        $("#divAddSectorTree2").selectTree({url: "<%=basePath%>/admin/common/sector_tree_data.action${busiModel.supplierDept == null ? "" : "?selectedId="}${busiModel.supplierDept}"});
        $("#divCatelogBasic").selectTree({url: "<%=basePath%>/admin/common/resource_catelog_tree_data.action?resourceCatelogType=<%=DicResourceCatelogType.BASIC%>${busiModel.catelogBasic == null ? "" : "&selectedId="}${busiModel.catelogBasic}"});
        $("#divCatelogSector").selectTree({url: "<%=basePath%>/admin/common/resource_catelog_tree_data.action?resourceCatelogType=<%=DicResourceCatelogType.SECTOR%>${busiModel.catelogSector == null ? "" : "&selectedId="}${busiModel.catelogSector}"});
        $("#divCatelogTheme").selectTree({url: "<%=basePath%>/admin/common/resource_catelog_tree_data.action?resourceCatelogType=<%=DicResourceCatelogType.THEME%>${busiModel.catelogTheme == null ? "" : "&selectedId="}${busiModel.catelogTheme}"});
        $("#divCatelogCustom").selectTree({url: "<%=basePath%>/admin/common/resource_catelog_tree_data.action?resourceCatelogType=<%=DicResourceCatelogType.CUSTOM%>${busiModel.catelogCustom == null ? "" : "&selectedId="}${busiModel.catelogCustom}"});
    </script>
</body>
</html>