|
版本: |
X5.2.7 |
小版本号: |
|
|
|
数据库: |
MySQL |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 7 |
浏览器: |
Chrome |
|
|
本帖最后由 2286683959 于 2014-10-30 08:21 编辑
修改后功能:
1、在前台页面显示每一条的错误信息,行号、是否通过验证;
2、通过xml文件快速配置验证信息。
3、验证信息支持:唯一(前台数据、后台数据库联合验证)、必须、关联字段赋值并验证;
4、支持正则表达式验证;
Map文件例子:
<mapping>
<default-config>
<sheet all="true" />
<row all="true" />
</default-config>
<concept name="tPerson">
<relation name="fName" cell-number="1" label="姓名" required="true" unique="true" queryaction="quaryTPersonName" />
<relation name="fsex" cell-number="2" label="性别"/>
<relation name="fOld" cell-number="3" label="年龄"/>
<relation name="fGz" cell-number="4" label="工资"/>
<relation name="fEmail" cell-number="5" label="电子邮件" regex="\\w+@(\\w+.)+[a-z]{2,3}" regexErrorMsg="非邮件"/>
<relation name="fDepartName" cell-number="6" label="部门ID" check="true"/>
</concept>
</mapping>
<!-- default-config: 导入默认参数 sheet:excel页 all:是否导入全部页
start:导入开始页
end:导入结束页
row:excel行
all:是否导入全部行
start:导入开始行
end:导入结束行
concept:数据映射
name:概念名称
relation:关系
name: 关系名称
value-type:数据类型,需要转换成的数据类型,没有定义时取relation的类型。类型包括:string,integer,float,date,datetime,time,decimal,text cell-number:关系在excel中对应的列号,从1开始。 date-pattern:数据转换格式,如excel中为文本类型,导入关系为日期类型时,可通过定义该属性设置转换规则,格式如:"yyyy-MM-dd hh:mm:ss" 注意: 系统会读取excel单元格类型,当excel单元格的类型与所导入关系类型不一致时,需要通过定义 value-type或date-pattern属性进行格式转换。否则将造成导入失败的问题。-->
扩展后参数
relation中扩展以下字段:
1、label="名称":提示错误时对应的列中文名(或其他语言) 例如:label="年龄"
2、regex="":正则表达式 例如:regex="./2[1-9]"
3、regexErrorMsg="非邮件":正则错误时的提示信息。
3、isprimary="true":是否联合主键 例如:isprimary="true" 将与其他联合主键一起检查
4、unique="true" :是否唯一queryaction="验证action"
5、required="true" :是否必填
6、AssociationField="",[size=13.333333969116211px]AssociationCheck="true",AssociationAssign="true",AssociationAction=""关联字段的配置
|
-
评分
-
查看全部评分
|