<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增短剧基础')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-item-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">剧集ID：</label>
            <div class="col-sm-8">
                <input name="itemId" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">任务ID：</label>
            <div class="col-sm-8">
                <input name="taskId" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">剧集名称：</label>
            <div class="col-sm-8">
                <input name="videoName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">平台：</label>
            <div class="col-sm-8">
                <label th:each="sourceType:${sourceTypes}" class="check-box">
                    <input name="sourceType" type="checkbox" th:value="${sourceType.dictValue}" th:text="${sourceType.dictLabel}">
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">剧集方：</label>
            <div class="col-sm-8">
                <select name="producerType" class="form-control m-b" th:with="type=${@dict.getType('playlet_producer_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">视频是否完结：</label>
            <div class="col-sm-8">
                <select name="completeNot" class="form-control m-b" th:with="type=${@dict.getType('playlet_complete_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">视频封面图：</label>
            <div class="col-sm-8">
                <input name="coverPic" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">网盘地址：</label>
            <div class="col-sm-8">
                <input name="connectSite" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">主角名称：</label>
            <div class="col-sm-8">
                <input name="actorName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">出品方：</label>
            <div class="col-sm-8">
                <input name="producer" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">推荐标签：</label>
            <div class="col-sm-8">
                <input name="tags" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">对标用户：</label>
            <div class="col-sm-8">
                <input name="forUser" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否精品：</label>
            <div class="col-sm-8">
                <input name="specialItem" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">剧集类型：</label>
            <div class="col-sm-8">
                <input name="videoType" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">标签：</label>
            <div class="col-sm-8">
                <input name="labelType" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">总集数：</label>
            <div class="col-sm-8">
                <input name="numberEpisode" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">收费集数：</label>
            <div class="col-sm-8">
                <input name="numberCost" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">上架时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="upTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">短剧介绍：</label>
            <div class="col-sm-8">
                <input name="remark" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/playlet/item"
    $("#form-item-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-item-add").serializeArray();
            var sourceTypeIds = $.form.selectCheckeds("sourceType");
            data.push({"name": "sourceTypeIds", "value": sourceTypeIds});
            $.operate.save(prefix + "/add", data);
        }
    }

    // $("input[name='releaseTime']").datetimepicker({
    //     format: 'yyyy-mm-dd hh:ii',
    //     todayBtn:  true,
    //     dateFormat: 'yyyy-mm-dd',//日期显示格式
    //     timeFormat: 'HH:mm:ss',//时间显示格式
    //     autoclose: true,
    // });

    $("input[name='upTime']").datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        todayBtn:  true,
        dateFormat: 'yyyy-mm-dd',//日期显示格式
        timeFormat: 'HH:mm:ss',//时间显示格式
        autoclose: true,
    });

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