【自用门户】如何修改jeecms自定义新增字段为日期时候的,内容页面选择日期是日期,改成时分秒
来源:互联网 发布:盲源分离理论与算法 编辑:程序博客网 时间:2024/06/03 23:08
【自用门户】如何修改jeecms自定义新增字段为日期时候的,内容页面选择日期是日期,改成时分秒
1.自定义新增内容模型,字段新增,其中有日期类型
2.保存这些新增内容模型后,在内容里面新增一条内容,发现日期选择器为日期(不带时分秒)
3.需要修改该字段为日期+时分秒类型如图
。步骤:
一、找到内容添加后台页面、修改页面
webapps\ROOT\WEB-INF\jeecms_sys\content\add.html
webapps\ROOT\WEB-INF\jeecms_sys\content\edit.html
二、修改add里的源码
部分源码:
<#else><@p.selfDefineWidget name="attr_${item.field}" value=content.attr[item.field] size="${item.size!}" list="${item.optValue!}" help=item.help helpPosition="${item.helpPosition!2}" rows="${item.rows!}" cols="${item.cols!}" label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}" type="${item.dataType}" required="${item.required!?string('true','false')}" imageWidth="${item.imageWidth!}" imageHeight="${item.imageHeight!}"/></#if>修改后
<!--mark20171124:修改后台页面源码部分自定义字段时间选择时分秒问题--><!--mark20171124:备份原后台页面源码部分自定义字段时间日期--><!-- 修改判断开始 --><#else><#if item.field=="BulletinEndTime"><@p.td label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}" required="${item.required!?string('true','false')}" ><@p.text style="width:140px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="attr_${item.field}" value=item.defValue size="${item.size!}"/></@p.td><#else><@p.selfDefineWidget name="attr_${item.field}" value=item.defValue size="${item.size!}" list="${item.optValue!}" help=item.help helpPosition="${item.helpPosition!2}" rows="${item.rows!}" cols="${item.cols!}" label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}" type="${item.dataType}" required="${item.required!?string('true','false')}" imageWidth="${item.imageWidth!}" imageHeight="${item.imageHeight!}"/></#if></#if><!-- 修改判断结束 -->二、修改edit.html修改内容后台页面源码
源码部分:
<#else><@p.selfDefineWidget name="attr_${item.field}" value=content.attr[item.field] size="${item.size!}" list="${item.optValue!}" help=item.help helpPosition="${item.helpPosition!2}" rows="${item.rows!}" cols="${item.cols!}" label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}" type="${item.dataType}" required="${item.required!?string('true','false')}" imageWidth="${item.imageWidth!}" imageHeight="${item.imageHeight!}"/></#if>
修改后:
<!--mark20171124:修改后台页面源码部分自定义字段时间选择时分秒问题--><!--mark20171124:备份原后台页面源码部分自定义字段时间日期--><!-- 修改判断开始 --><#else><#if item.field=="BulletinEndTime"> <@p.td label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}" required="${item.required!?string('true','false')}" ><@p.text style="width:140px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="attr_${item.field}" value=content.attr[item.field] size="${item.size!}" /></@p.td><#else><@p.selfDefineWidget name="attr_${item.field}" value=content.attr[item.field] size="${item.size!}" list="${item.optValue!}" help=item.help helpPosition="${item.helpPosition!2}" rows="${item.rows!}" cols="${item.cols!}" label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}" type="${item.dataType}" required="${item.required!?string('true','false')}" imageWidth="${item.imageWidth!}" imageHeight="${item.imageHeight!}"/></#if></#if><!-- 修改判断结束 -->
查询属性表字段类型语句
select modelitem_id,model_id,field,item_label,data_type from jc_model_item
重点ps:
如果要修改所有为日期类型的新增字段,那么add页面的if判断可以改为(edit仿照即可)
<!-- 判断数据类型为5时候(5代表日期字段类型),时间选择器为时分秒 -->
<#if item.dataType==5>
<@p.td label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}" required="${item.required!?string('true','false')}" >
<@p.text style="width:140px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="attr_${item.field}" value=content.attr[item.field] size="${item.size!}" />
</@p.td>
部分参考资料:http://blog.csdn.net/dongdong9223/article/details/76578120
- 【自用门户】如何修改jeecms自定义新增字段为日期时候的,内容页面选择日期是日期,改成时分秒
- Flex4 DateField自定义的日期选择控件,可选择时分秒
- Flex4 DateField自定义的日期选择控件,可选择时分秒
- Flex4 DateField自定义的日期选择控件,可选择时分秒
- Oracle数据库,将日期更新为另一日期字段的年月日,不改时分秒
- 显示日期的时候除去时分秒,只留下年月日
- 单据上业务日期字段时分秒的舍弃处理。
- Extjs5 日期控件扩展,选择时分秒
- Extjs3.3日期控件的扩展,选择时分秒
- hibernate 日期 时分秒
- 时分秒 日期控件
- 为日期年月日加上时间时分秒
- 日期控件如何显示出时分秒
- MySQL修改日期字段的内容
- flex 带有时分秒的日期组件
- 得到日期,时分秒的方法
- bootstrap 带有时分秒的日期控件
- 设置 datetimepicker 只选择日期 不选择时分秒
- 将给定格式的线性结构转换为树形结构
- python之matplotlib应用
- 稀疏矩阵的三元组
- ubuntu 16.04 LTS
- 树 题
- 【自用门户】如何修改jeecms自定义新增字段为日期时候的,内容页面选择日期是日期,改成时分秒
- git分支管理策略
- Eclipse安装SVN插件的几种方式
- 分治法——自顶向下,逐步求精
- 上传项目到gitHub中,只上传了文件夹,没有上传文件夹中的内容
- 开源的验证码框架Kaptcha实现验证码效果
- 走进大前端:电子商务网站(模块化布局)实战
- JAVA基础
- ubuntu环境下一键切换python虚拟环境