提交 55567b83 authored 作者: 钟是志's avatar 钟是志

20187 国家助学金、奖学金、励志奖学金、贫困生认定--添加查询条件

上级 cd08b037
...@@ -65,6 +65,11 @@ const getHead = (dataObjId) => { ...@@ -65,6 +65,11 @@ const getHead = (dataObjId) => {
return apiRequest('/DataColumnApi/getHeaderList', { dataObjId }); return apiRequest('/DataColumnApi/getHeaderList', { dataObjId });
}; };
const getGroupList = (columnId) => {
// 获取表头 workId
return apiRequest('/DataColumnApi/getGroupList', { columnId });
};
/** /**
* 获取下拉枚举值 * 获取下拉枚举值
* */ * */
...@@ -244,4 +249,5 @@ export { ...@@ -244,4 +249,5 @@ export {
handleSqlfind, handleSqlfind,
getSqlOptions, getSqlOptions,
getHead, getHead,
getGroupList,
}; };
...@@ -74,6 +74,15 @@ const getFormArrayConfig = (header) => { ...@@ -74,6 +74,15 @@ const getFormArrayConfig = (header) => {
required: !item.isNull, required: !item.isNull,
} }
);*/ );*/
} else if (item.options && Array.isArray(item.options) && item.options.length) {
config.push({
key: item.name,
name: item.title,
type: 'select',
required: !item.isNull,
base52: item.base52,
options: item.options,
});
} else if (text.indexOf(item.type) > -1) { } else if (text.indexOf(item.type) > -1) {
config.push({ config.push({
key: item.name, key: item.name,
...@@ -81,7 +90,7 @@ const getFormArrayConfig = (header) => { ...@@ -81,7 +90,7 @@ const getFormArrayConfig = (header) => {
type: 'input', type: 'input',
placeHolder: `请输入${item.name}`, placeHolder: `请输入${item.name}`,
required: !item.isNull, required: !item.isNull,
base52: item.base52, base52: item.base52,
}); });
} else if (number.indexOf(item.type) > -1) { } else if (number.indexOf(item.type) > -1) {
config.push({ config.push({
...@@ -91,8 +100,8 @@ const getFormArrayConfig = (header) => { ...@@ -91,8 +100,8 @@ const getFormArrayConfig = (header) => {
placeHolder: `请输入${item.name}`, placeHolder: `请输入${item.name}`,
required: !item.isNull, required: !item.isNull,
min: 0, min: 0,
base52: item.base52, base52: item.base52,
}); });
} else if (date.indexOf(item.type) > -1) { } else if (date.indexOf(item.type) > -1) {
config.push({ config.push({
key: item.name, key: item.name,
...@@ -101,8 +110,8 @@ const getFormArrayConfig = (header) => { ...@@ -101,8 +110,8 @@ const getFormArrayConfig = (header) => {
placeHolder: `请输入${item.name}`, placeHolder: `请输入${item.name}`,
required: !item.isNull, required: !item.isNull,
format: format[item.type], format: format[item.type],
base52: item.base52, base52: item.base52,
}); });
} else { } else {
config.push({ config.push({
key: item.name, key: item.name,
...@@ -110,8 +119,8 @@ const getFormArrayConfig = (header) => { ...@@ -110,8 +119,8 @@ const getFormArrayConfig = (header) => {
type: 'input', type: 'input',
placeHolder: `请输入${item.name}`, placeHolder: `请输入${item.name}`,
required: !item.isNull, required: !item.isNull,
base52: item.base52, base52: item.base52,
}); });
} }
} }
return config; return config;
...@@ -164,17 +173,31 @@ const getSearchCondition = async (id) => { ...@@ -164,17 +173,31 @@ const getSearchCondition = async (id) => {
}); });
} }
}); });
const refIds = []; for (let item of searchHeaders) {
searchHeaders.forEach((x) => { if (item.isGroupQuery && item.id) { // 获取下拉搜索条件的枚举项
if (!!x.referenceObjId) { item.options = await service.getGroupList(item.id).then((res) => {
refIds.push(x.referenceObjId); if (res && Array.isArray(res)) {
return res.filter((x) => {
return x.value !== item.title;
}).map((x) => {
return {
key: x.value,
name: x.value,
};
});
} else {
return [];
}
});
} }
});
const condition = getFormArrayConfig(searchHeaders);
if (refIds && refIds.length) { // TODO 暂时不处理下拉的搜索条件 要考虑 getOpts 里面提及的各种问题
const options = await service.getBatchOptions(refIds);
console.log(options);
} }
const condition = getFormArrayConfig(searchHeaders);
console.log(condition);
condition.forEach((x) => {
x.required = false;
});
return condition; return condition;
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论