<%@ 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 prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    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>API发布需求</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="javascript:void(0);">供需管理</a>
                    </li>
                    <li>
                        <a href="javascript:void(0);">API发布需求</a>
                    </li>
                    <li class="active">
                        <strong>API发布需求</strong>
                    </li>
                </ol>
            </div>
        </div>
    </div>

    <div class="col-md-12 column" >
        <form class="form-horizontal" id="settingFrom"  method="post" role="form" class="form-horizontal"  enctype="multipart/form-data"
        action="<%=basePath%>/admin/data_supply_api/release.action">
            <input type="hidden" name="api_badge" id="api_badge" value=0>
            <div class="form-group">
                <label for="rqrmntName" class="col-sm-2 control-label"><span style="color: red;">*</span>需求名称</label>
                <div class="col-sm-7">
                    <input type="text" id="rqrmntName" name="rqrmntName" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label for="rqrmntSummary" class="col-sm-2 control-label"><span style="color: red;">*</span>需求说明</label>
                <div class="col-sm-7">
                    <input type="text" id="rqrmntSummary" name="rqrmntSummary" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label for="systemName" class="col-sm-2 control-label"><span style="color: red;">*</span>系统名称</label>
                <div class="col-sm-7">
                    <input type="text" id="systemName" name="systemName" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="systemType" class="col-sm-2 control-label"><span style="color: red;">*</span>系统类型</label>
                <div class="col-sm-7">
                    <input type="text" id="systemType" name="systemType" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="systemDesc" class="col-sm-2 control-label"><span style="color: red;">*</span>系统描述</label>
                <div class="col-sm-7">
                    <textarea  id="systemDesc" cols="30" rows="2" name="systemDesc" class="form-control"></textarea>
                </div>
            </div>

            <div class="form-group">
                <label for="belongTo" class="col-sm-2 control-label"><span style="color: red;"></span>所属单位</label>
                <div class="col-sm-7">
                    <input type="text" id="belongTo" name="belongTo" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label  class="col-sm-2 control-label"><span style="color: red;"></span>所有权</label>
                <div class="col-sm-7">
                    <div class="radio">
                        <label>
                            <input type="radio" name="hasOwnership" value="0" checked  class="radio">是
                        </label>
                    </div>
                    <div class="radio">
                        <label>
                            <input type="radio" name="hasOwnership" value="1" class="radio">否
                        </label>
                    </div>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="url" class="col-sm-2 control-label"><span style="color: red;"></span>访问网址</label>
                <div class="col-sm-7">
                    <input type="text" id="url" name="url" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label  class="col-sm-2 control-label"><span style="color: red;">*</span>网络性质</label>
                <div class="col-sm-7">
                    <div class="radio">
                        <label>
                            <input type="radio" name="networkType" value="内网系统" checked  class="radio">内网系统
                        </label>
                    </div>
                    <div class="radio">
                        <label>
                            <input type="radio" name="networkType" value="公网系统" class="radio">公网系统
                        </label>
                    </div>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label  class="col-sm-2 control-label"><span style="color: red;"></span>开发语言</label>
                <div class="col-md-7 col-sm-7">
                    <input type="checkbox" name="devLanguage"  value="java" />java
                    <input type="checkbox" name="devLanguage" value="C/C++" />C/C++
                    <input type="checkbox" name="devLanguage" value="C#" />C#
                    <input type="checkbox" name="devLanguage" value="JS" />JS
                    <input type="checkbox" name="devLanguage"  value="CSS" />CSS
                    <input type="checkbox" name="devLanguage" value="html"/>html
                    <input type="checkbox" name="devLanguage" value="PHP" />PHP
                    <input type="checkbox" name="devLanguage" value="其他"/>其他
                </div>
            </div>

            <div class="form-group">
                <label for="interfaceCount" class="col-sm-2 control-label"><span style="color: red;">*</span>接口个数</label>
                <div class="col-sm-7">
                    <input type="number" id="interfaceCount" name="interfaceCount" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="deadline" class="col-sm-2 control-label">截止日期</label>
                <div class="col-sm-7">
                    <div class="input-group date">
                        <input type="text" id="deadline" name="deadline" class="form-control" />
                        <span class="field-validation-valid help-block"></span>
                        <span class="input-group-addon">
                    <span class="glyphicon glyphicon-calendar"></span>
                </span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label for="contact1" class="col-sm-2 control-label"><span style="color: red;"></span>主联系人</label>
                <div class="col-sm-7">
                    <input type="text" id="contact1" name="contact1" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="phone1" class="col-sm-2 control-label"><span style="color: red;"></span>主联系人电话</label>
                <div class="col-sm-7">
                    <input type="text" id="phone1" name="phone1" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="contact2" class="col-sm-2 control-label"><span style="color: red;"></span>备用联系人</label>
                <div class="col-sm-7">
                    <input type="text" id="contact2" name="contact2" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="phone2" class="col-sm-2 control-label"><span style="color: red;"></span>备用联系人电话</label>
                <div class="col-sm-7">
                    <input type="text" id="phone2" name="phone2" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label  class="col-sm-2 control-label"><span style="color: red;"></span>是否需要平台撮合交易</label>
                <div class="col-sm-7">
                    <div class="radio">
                        <label>
                            <input type="radio" name="needPlatformSupport" value="是" checked  class="radio">是
                        </label>
                    </div>
                    <div class="radio">
                        <label>
                            <input type="radio" name="needPlatformSupport" value="否" class="radio">否
                        </label>
                    </div>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label  class="col-sm-2 control-label"><span style="color: red;">*</span>分类</label>
                <div class="col-md-7 col-sm-7">
                    <input type="checkbox" name="categoryId"  value="1" />数据API
                    <input type="checkbox" name="categoryId" value="2" />模型API
                    <input type="checkbox" name="categoryId" value="3" />工具API
                </div>
            </div>

            <div class="form-group">
                <label for="expectedQuote" class="col-sm-2 control-label"><span style="color: red;"></span>预期报价</label>
                <div class="col-sm-7">
                    <input type="text" id="expectedQuote" name="expectedQuote" class="form-control"/>
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="attachment" class="col-sm-2 control-label"><span style="color: red;"></span>附件</label>
                <div class="col-sm-7">
                    <input type="file" id="attachment" name="attachment" />
                    <span class="field-validation-valid help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="description" class="col-sm-2 control-label"><span style="color: red;">*</span>说明</label>
                <div class="col-sm-7">
                    <textarea  id="description" cols="30" rows="2" name="description" class="form-control"></textarea>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-7 text-center">
                    <button type="button"  onclick="publish()" class="btn btn-primary"><i class="fa fa-check"></i>发布</button>
                    <button type="button" id="cancel" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"></i>返回</button>
                </div>
            </div>
        </form>
    </div>
</div>
<jsp:include page="../../../common/admin/body_post.jsp"></jsp:include>
<script type="text/javascript">

    function publish() {
        var msg = "您真的确定要发布吗？";
        if (confirm(msg)){
            $('.tishi4').text('');//清空验证
            <%--$.post("<%=basePath%>/admin/data_supply_api/release.action",$('#settingFrom').serialize(),function(result){--%>
                <%--if(result.stateCode==200){--%>
                    <%--window.location.href="<%=basePath%>/admin/data_supply_api/index.htm" ;--%>
                <%--}else{--%>
                    <%--if(result.data ==null){--%>
                        <%--alert(result.msg);//弹出发布失败提示--%>
                    <%--}else{--%>
                        <%--for(var item in result.data){--%>
                            <%--$("[name='"+item+"']").next().text("! "+result.data[item]);--%>
                            <%--$("[name='"+item+"']").next().show();--%>
                        <%--}--%>
                    <%--}--%>
                <%--}--%>
            <%--})--%>
            $('#settingFrom').ajaxValSubmit({
                ajaxSubmitOptions: {
                    onSuccess: function () {
                        window.location.href = "<%=basePath%>/admin/data_supply_api/index.htm";
                    }
                }
            });
        }
    }

    $(".input-group.date").datetimepicker({
        format: "YYYY-MM-DD",
        locale: "zh-cn"
    });


    $("#cancel").click(function () {
        window.location.href="<%=basePath%>/admin/data_supply_api/index.htm" ;
    });

</script>
</body>
</html>