以importTest.xml为例:
<?xmlversion="1.0" encoding="utf-8"?>
<root>
<myquery title="导入测试问题">
<select>
<column name="funid" title="所属模块" type="select" urlformatstring="sql:selectname,id from s_fun">
</column>
<column name="iclass"title="严重程度"type="select" urlformatstring="严重,1;次要,2;一般,3;新需求,4">
</column>
<column name="iflag"title="当前状态"type="select" urlformatstring="发现,0;确认1;解决,2;关闭,3">
</column>
<column name="rdate"title="发现日期"type="calcscript" value="getdate"usefields="this">
getDate("{0}")
</column>
<column name="optime" title="操作时间" value="getdate"></column>
<column name="userid"title="操作人员"value="useraccount"></column>
</select>
<fromtype="xls"></from>
<import isparameter="true">
<table name="s_test" title="测试问题" isbase="true">
<column name="rdate"title="发现日期"datatype="date" isnull="false"scope="all"></column>
<column name="funid"title="所属模块"datatype="string" isnull="false"scope="add"></column>
<column name="title"title="标题"datatype="string" maxlength="250" isnull="false"scope="add">
问题,BUG
</column>
<column name="notes"title="描述"datatype="string" isnull="false" scope="all">
问题描述,BUG描述
</column>
<column name="iclass" title="严重程度" datatype="string" scope="all">
</column>
<column name="iflag"title="当前状态"datatype="string" scope="add">
状态
</column>
<column name="optime"datatype="date" scope="add"></column>
<column name="userid"datatype="string" scope="add"></column>
<wherekeycolumnnames="id">
<column name="funid">
and funid={0}
</column>
<column name="title">
and title={0}
</column>
</where>
</table>
<javascript>
<![CDATA[function getDate(value) {
if (!value) {
return "";
}
if (value.indexOf("T") !=-1) {
return value.substr(0,value.indexOf("T"));
} else if (value.search(/[\-\/\.]+/) !=-1) {
return value;
} else if (value.length == 8) {
var year = value.substr(0, 4);
var month = value.substr(4, 2);
var day = value.substr(6, 2);
newDate = new Date(year, month -1, day);
if (newDate.toString() =="NaN") {
return "";
}
else {
return year + "-"+ month + "-" + day;
}
} else {
return "";
}
}]]>
</javascript>
<notes>
<![CDATA[请选择本地对应的Excel文件(文件后缀为.xls或.xlsx或.xlsm或.xlsb或.xml);<br />
文件必须是满足导入需求的定制格式文件;<br />
选择文件与选择的导入目标必须一致否则会导致数据错误;]]>
</notes>
</import>
</myquery>
</root>
欢迎访问:http://121.18.78.216 适易查询分析、工作流、内容管理及项目管理演示平台
标签:return,配置,value,else,substr,导入,举例,year,month From: https://blog.51cto.com/u_14751752/5868981