健康知识集锦

页面

在这里插入图片描述

页面代码

<% layout('/layouts/default.html', {title: '健康知识管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('健康知识管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('health:health:edit')){ %>
					<a href="${ctx}/health/health/form" class="btn btn-default btnTool" title="${text('新增健康知识')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${health}" action="${ctx}/health/health/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('健康知识')}:</label>
					<div class="control-inline">
						<#form:input path="healthKnowleage" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm"><i class="glyphicon glyphicon-search"></i> ${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm isQuick"><i class="glyphicon glyphicon-repeat"></i> ${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
//# // 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $('#searchForm'),
	columnModel: [
		{header:'${text("健康知识")}', name:'healthKnowleage', index:'a.health_knowleage', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/health/health/form?healthCode='+row.healthCode+'" class="btnList" data-title="${text("编辑健康知识")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
			var actions = [];
			//# if(hasPermi('health:health:edit')){
				actions.push('<a href="${ctx}/health/health/form?healthCode='+row.healthCode+'" class="btnList" title="${text("编辑健康知识")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/health/health/delete?healthCode='+row.healthCode+'" class="btnList" title="${text("删除健康知识")}" data-confirm="${text("确认要删除该健康知识吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			//# }
			return actions.join('');
		}}
	],
	//# // 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>

数据库表

CREATE TABLE `health` (
  `health_code` varchar(100) NOT NULL COMMENT '编号',
  `health_knowleage` text COMMENT '健康知识',
  PRIMARY KEY (`health_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='健康知识';

INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('1', '如果牛奶不喝,就喝酸奶;酸奶不喝,就喝豆浆;如果牛奶、酸奶、豆浆都不喝,那就等死了。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('2', '鹿群没有了敌人,越来越胖,是狼救了它们。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('3', '每日250克碳水就能调控体重。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('4', '为什么广东人瘦,饭前喝汤。饭后喝汤,越喝越胖。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('5', '获得“健康食品”的殊荣,世界上仅有两种:黄豆和燕麦。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('6', '每顿不能吃太饱。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('7', '水果、蔬菜,预防癌症最好。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('8', '红黄色蔬菜-维生素A之最。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('9', '饮料里茶最好,茶叶当中绿茶最好。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('10', '吃了一个半月黑木耳,3个血管都通了。');
INSERT INTO `jeesite`.`health` (`health_code`, `health_knowleage`) VALUES ('11', '少纤维,少运动,能不便秘?广播操,多按摩,保你健康。');

  • 24
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值