<!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-dangan-edit" th:object="${dangan}">
            <input name="danganId" type="hidden" th:field="*{danganId}" />
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">系统名称：</label>
                        <div class="col-sm-8">
                            <input name="danganName" class="form-control" type="text" th:field="*{danganName}" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">系统状态：</label>
                        <div class="col-sm-8">
                            <select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_dangan_status')}"  >
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">系统负责人：</label>
                        <div class="col-sm-8">
                            <input name="sysPerson" class="form-control" type="text" th:field="*{sysPerson}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">架构模式：</label>
                        <div class="col-sm-8">
                            <select name="mode" class="form-control m-b" th:with="type=${@dict.getType('sys_dangan_mode')}" th:field="*{mode}" >
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">类别：</label>
                        <div class="col-sm-8">
                            <input name="fileType" class="form-control" type="text" th:field="*{fileType}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">型号/版本：</label>
                        <div class="col-sm-8">
                            <input name="model" class="form-control" type="text" th:field="*{model}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">所属项目ID：</label>
                        <div class="col-sm-8">
                            <input name="projectId" class="form-control" type="text" th:field="*{projectId}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">品牌：</label>
                        <div class="col-sm-8">
                            <input name="brand" class="form-control" type="text" th:field="*{brand}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">运行设备ID：</label>
                        <div class="col-sm-8">
                            <input name="runDeviceId" class="form-control" type="text" th:field="*{runDeviceId}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">关联设备ID：</label>
                        <div class="col-sm-8">
                            <input name="relateDeviceId" class="form-control" type="text" th:field="*{relateDeviceId}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">维护项目ID：</label>
                        <div class="col-sm-8">
                            <input name="maintainItemId" class="form-control" type="text" th:field="*{maintainItemId}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">厂家质保期：</label>
                        <div class="col-sm-8">
                            <input name="factoryTime" class="form-control" type="text"  th:field="*{factoryTime}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">项目质保期：</label>
                        <div class="col-sm-8">
                            <input name="projectTime" class="form-control" type="text" th:field="*{projectTime}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">使用单位：</label>
                        <div class="col-sm-8">
                            <input name="useUnit" class="form-control" type="text" th:field="*{useUnit}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">介质：</label>
                        <div class="col-sm-8">
                            <input name="medium" class="form-control" type="text" th:field="*{medium}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">维护时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input name="maintainTime" id="maintainTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text"  th:value="${#dates.format(dangan.maintainTime, 'yyyy-MM-dd HH:mm:ss')}">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">认证页面地址：</label>
                        <div class="col-sm-8">
                            <input name="pageAddress" class="form-control" th:field="*{pageAddress}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">系统状态检测地址：</label>
                        <div class="col-sm-8">
                            <input name="testAddress" class="form-control" type="text" th:field="*{testAddress}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">系统建设厂商：</label>
                        <div class="col-sm-8">
                            <input name="buildFactory" class="form-control" type="text" th:field="*{buildFactory}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">建设时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="buildFactoryTime" class="form-control" placeholder="yyyy-MM-dd" type="text" th:value="${#dates.format(dangan.buildFactoryTime, 'yyyy-MM-dd')}">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">厂商负责人：</label>
                        <div class="col-sm-8">
                            <input name="factoryPerson" class="form-control" type="text" th:field="*{factoryPerson}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">厂商负责人电话：</label>
                        <div class="col-sm-8">
                            <input name="factoryPersonPhone" class="form-control" type="text" th:field="*{factoryPersonPhone}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">

                    <div class="form-group">
                        <label class="col-sm-3 control-label">开发语言：</label>
                        <div class="col-sm-8">
                            <input name="language" class="form-control" type="text" th:field="*{language}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">部署服务器IP：</label>
                        <div class="col-sm-8">
                            <input name="serverIp" class="form-control" type="text" th:field="*{serverIp}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">服务器位置：</label>
                        <div class="col-sm-8">
                            <input name="serverLocation" class="form-control" type="text" th:field="*{serverLocation}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">服务器配置信息：</label>
                        <div class="col-sm-8">
                            <input name="serverInfo" class="form-control" type="text" th:field="*{serverInfo}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">是否专用服务器：</label>
                        <div class="col-sm-8">
                            <select name="serverBasedYesNo" class="form-control m-b" th:with="type=${@dict.getType('sys_dangan_yes_no')}" th:field="*{serverBasedYesNo}" >
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">运维负责人：</label>
                        <div class="col-sm-8">
                            <input name="opsPerson" class="form-control" type="text" th:field="*{opsPerson}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">主管单位：</label>
                        <div class="col-sm-8">
                            <input name="chargeUnit" class="form-control" type="text" th:field="*{chargeUnit}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <input type="hidden" id="fileName" name="fileName">
                        <input type="hidden" id="filePath" name="filePath">
                        <label  class="col-sm-3 control-label "  >文档信息：</label>
                        <div class="col-sm-8">
                            <div class="input-group m-b" th:if="${fileList.size()>0}" th:each="fileInfo,state : ${fileList}" th:id="${state.index}">
                                <span class="input-group-addon" th:onclick="preview([[@{${fileInfo.filePath}}]])"><i class="fa fa-file"></i></span>
                                <span type="text" class="form-control" th:text="${fileInfo.fileName}" ></span>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">备注：</label>
                        <div class="col-sm-9">
                            <textarea name="remark" class="form-control" type="text" th:field="*{remark}"></textarea>
                        </div>
                    </div>
                </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/dangan";
        $("#form-dangan-edit").validate({
            focusCleanup: true
        });

        layui.use('laydate', function() {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#maintainTime',
                type: 'datetime',
                trigger: 'click'
            });
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-dangan-edit').serialize());
            }
        }

        $("input[name='buildFactoryTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        function preview(filePath){
            console.log("filePath="+filePath);
            window.open(filePath);
        }
    </script>
</body>
</html>