数据共享搜索列中配置了搜索列,相应的数据共享接口中也需要支持根据配置的字段搜索,配置实体时,支持搜索的入参code必须是searchKeys,且接口应该是需要支持分页(入参必须是 current、pageSize)的。current 是当前页 ,pageSize 是每页显示条数
类似这样的配置:
共享数据的实体和对应的数据共享 API 需要包含 searchKeys 入参,表单会自动将搜索框中的内容以 searchKeys 的值再次查询实体数据。
数据共享接口只支持配置一个检索字段的参数即searchKeys 如果需要根据多个字段检索,需要业务系统侧处理下入参,根据逗号分割参数再传给各个字段,参数的顺序即(\"卫生所,北京\")是根据数据共享搜索列中的配置顺序(全称,地址)传递的:
# 获取表单内的数据 :
"enterpriseName": "fel:form.value('self.QYMC121')",
"enterpriseCode": "fel:form.value('self.TYSHXYDM250')",#获取表格某行某字段(0 是哪一行 xx哪一个字段)
${self.CSDBG_0317}.pageData.data.0.xx
页面源码示例:
"_request": [{"requestId": "jzsgqyfzrzsjy","tablePropertyId": "self.JZSGQYZYFZRXMFZRZZAQSCGLRYZSXX","params": {"entityCode": "jzsgqyfzrzsjy","scriptId": "1032023102761521","bizCode": "1111","enterpriseName": "fel:form.value('self.QYMC121')","enterpriseCode": "fel:form.value('self.TYSHXYDM250')","current": "1","pageSize": "100","searchKeys": "fel:form.value('searchKeys')"},"target": {"SFZH81": {"mapToColumn": "idno"},"ZSBH77": {"mapToColumn": "cerno"},"FZRQ8": {"mapToColumn": "sendDate"},"YXRQ43": {"mapToColumn": "validDate"},"RYLX": {"mapToColumn": "cerType"},"XM07": {"mapToColumn": "name"},"XB2": {"mapToColumn": "sex"},"DWMC386": {"mapToColumn": "enterpriseName"},"ID": {"mapToColumn": "id"}}}],
脚本示例:
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSON;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import com.alibaba.gov.common.form.model.TextValueModel;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;List returnListMap = new ArrayList(); for (int i = 0; i < originalTable.size(); i++) {
Map staffinfo = originalTable.get(i);
//时间处理def sendDate = staffinfo.get("sendDate").toString()def validDate = staffinfo.get("validDate").toString()if(sendDate!=null){SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");try {staffinfo.put("sendDate",dateFormat.parse(sendDate));} catch (ParseException e) {}}if(validDate!=null){SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd");try {staffinfo.put("validDate",dateFormat2.parse(validDate));} catch (ParseException e) {}}
//单选框
def sex = staffinfo.get("sex").toString();
def sex_val = "2"
if(sex == "男"){sex_val = "1"
}
staffinfo.put("sex",new TextValueModel(sex,sex_val));
//性别男女文本
staffinfo.put("sex_txt",sex);//是否激活def haveAct = staffinfo.get("haveAct").toString();if(haveAct=="1"){staffinfo.put("haveAct","是");}else{staffinfo.put("haveAct","否");}returnListMap.add(staffinfo);
}return returnListMap;