美文网首页
[源码] RuoYi 使用总结

[源码] RuoYi 使用总结

作者: 巨馍蘸酱 | 来源:发表于2022-09-15 16:39 被阅读0次

若依 / RuoYi

RuoYi 若依管理系统 基于SpringBoot的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖。直接运行即可用

若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。

还能说什么? 好人一生平安

列表页面 list.html

  • 下拉查询条件
<li>
    菜单状态:<select name="visible" th:with="type=${@dict.getType('sys_show_hide')}">
        <option value="">所有</option>
        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
    </select>
</li>
  • 表格设置
// 获取字典属性列表
var sys_show_hide = [[${@dict.getType('sys_show_hide')}]];

//...

// columns 设置
{
    field: 'status',
    title: '状态',
    align: 'center',
    formatter: function(value, row, index) {
        return $.table.selectDictLabel(sys_show_hide, value);
    }
}

新增页面 add.html

  • 必填
<div class="form-group">
    <label class="col-sm-3 control-label is-required">名称:</label>
    <div class="col-sm-8">
        <input name="name" th:field="*{name}" 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">
        <select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_show_hide')}">
            <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">
        <div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
            <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
            <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
        </div>
    </div>
</div>

编辑页面 edit.html

  • 单选
<div class="form-group">
    <label class="col-sm-3 control-label is-required">状态:</label>
    <div class="col-sm-8">
        <div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
            <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
            <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
        </div>
    </div>
</div>
  • 下拉选项
<div class="form-group">
    <label class="col-sm-3 control-label">状态:</label>
    <div class="col-sm-8">
        <select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_show_hide')}">
            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
        </select>
    </div>
</div>

相关文章

网友评论

      本文标题:[源码] RuoYi 使用总结

      本文链接:https://www.haomeiwen.com/subject/ozbjortx.html