若依二次开发添加 select 下拉框 变大 和 有空格存在

在这里插入图片描述
<th:block th:include=“include :: select2-css” />
<th:block th:include=“include :: select2-js” />
引入这个 js css 导致 格式变宽大小不统一

<!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" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-rate-add">
            <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="years" id="years" class="form-control" autocomplete="off"  placeholder="yyyy-MM" 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 is-required">币种:</label>
                <div class="col-sm-8">
                    <select name="currency" class="form-control" th:with="type=${@dict.getType('sem_exchange_currency')}">
                        <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">
                    <input name="exchangeRate"  class="form-control" type="number" step="0.1" placeholder="请输入保留四位小数" required  onkeyup="this.value= this.value.match(/\d+(\.\d{0,4})?/) ? this.value.match(/\d+(\.\d{0,4})?/)[0] : ''" >
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">

        var prefix = ctx + "commerce/rate"
        /*$("#form-rate-add").validate({
            years: false,
            rules:{
                /!*years:{
                    minlength: 2,
                    maxlength: 20,
                    remote: {
                        url: prefix + "/checkYearsUnique",
                        type: "post",
                        dataType: "json",
                        data: {
                            "years": function() {
                                return $.common.trim($("#years").val());
                            }
                        },
                        dataFilter: function(data, type) {
                            return $.validate.unique(data);
                        }
                    }
                },
                currency:{
                   /!* currency:true,*!/
                    remote: {
                        url: prefix + "/checkCurrencyUnique",
                        type: "post",
                        dataType: "json",
                        data: {
                            "currency": function () {
                                return $.common.trim($("#currency").val());
                            }
                        },
                        dataFilter: function (data, type) {
                            return $.validate.unique(data);
                        }
                    }
                },*!/
            },
            messages: {
                "years": {
                    remote: "年月已经存在"
                },
                "currency": {
                    remote: "币种已经存在"
                },
            },
            focusCleanup: true
        });*/

        $("#form-rate-add").validate({
            focusCleanup: true
        });

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

        $("input[name='years']").datetimepicker({
            format: "yyyy-mm",
            minView: 4,
            startView: 3,
            autoclose: true
        });

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

在这里插入图片描述
修改

<!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-rate-edit" th:object="${semExchangeRate}">
            <input name="id" th:field="*{id}" type="hidden">
           <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="years" th:value="${semExchangeRate.years}" class="form-control" placeholder="yyyy-MM" 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 is-required">币种:</label>
                <div class="col-sm-8">
                    <select name="currency" class="form-control" th:with="type=${@dict.getType('sem_exchange_currency')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{currency}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">汇率:</label>
                <div class="col-sm-8">
                    <input name="exchangeRate" th:field="*{exchangeRate}" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "commerce/rate";
        $("#form-rate-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-rate-edit').serialize());
            }
        }
        $("input[name='years']").datetimepicker({
            format: "yyyy-mm",
            minView: 3,
            startView: 3,
            autoclose: true
        });

    </script>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值