thymeleaf 基础用法

表单渲染

        <tr th:each="organization,stat:${pageResult.result}">
            <td>
                <input type="checkbox"  name="uniqueCode" th:value="${organization.uniqueCode}">
            </td>
            <td th:text="${organization.name}"></td>
            <td th:text="${organization.sortId}"></td>
            <td th:text="${organization.typeId}"></td>
            <td th:text="${organization.description}" onclick="showDescription(this.text())"></td>
            <td th:text="${organization.cooperation}"></td>

            <td th:text="${organization?.startTime == null?'':#dates.format(organization?.startTime,'yyyy-MM-dd HH:mm')}"></td>
            <td th:text="${organization?.endTime == null?'':#dates.format(organization?.endTime,'yyyy-MM-dd HH:mm')}"></td>

            <td class="td-status">

                <span class="layui-btn layui-btn-normal " th:id="${'status_' + organization?.uniqueCode}" th:switch="${organization?.status}">

				<font th:case="1">启用</font>
				<font th:case="2">禁用</font>

                </span>

            </td>
            <td class="td-manage">

                <a title="编辑"  th:onclick="|javascript:admin_update('添加','/api/organazition/get.html?uniqueCode=','${organization.uniqueCode}','1000','600') |"
                   class="ml-5" style="text-decoration:none">
                    <i class="layui-icon" style="font-size: 20px">&#xe642;</i>
                </a>

                <a title="审核通过"
                   th:id="${ 'enable_'+ organization?.uniqueCode }"
                   th:style="${organization?.status != 2 ?'display:inline-block':'display:none'}"
                   th:onclick="|javascript:updateStatus('审核通过','/api/organazition/review','${organization?.uniqueCode}',2) |"
                   class="ml-5" >
                    <i class="layui-icon layui-icon-ok" style="font-size: 20px; "></i>
                </a>
                <a title="拒绝通过"
                   th:id="${ 'disable_'+ organization.uniqueCode }"
                   th:style="${(organization?.status == 1 || organization?.status == 2)  ?'display:inline-block':'display:none'}"
                   th:onclick="|javascript:updateStatus('拒绝通过','/api/organazition/review','${organization?.uniqueCode}',3) |"
                   class="ml-5" >
                    <i class="layui-icon layui-icon-close" style="font-size: 20px; "></i>
                </a>
            </td>
        </tr>

select 渲染

    <option th:each="temp:${cooperationList}" th:selected="${temp.id eq organazition?.cooperation}"
    th:value="${temp.id}" th:text="${temp.name}"></option>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值