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

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

上级 cd08b037
......@@ -65,6 +65,11 @@ const getHead = (dataObjId) => {
return apiRequest('/DataColumnApi/getHeaderList', { dataObjId });
};
const getGroupList = (columnId) => {
// 获取表头 workId
return apiRequest('/DataColumnApi/getGroupList', { columnId });
};
/**
* 获取下拉枚举值
* */
......@@ -244,4 +249,5 @@ export {
handleSqlfind,
getSqlOptions,
getHead,
getGroupList,
};
......@@ -74,6 +74,15 @@ const getFormArrayConfig = (header) => {
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) {
config.push({
key: item.name,
......@@ -81,7 +90,7 @@ const getFormArrayConfig = (header) => {
type: 'input',
placeHolder: `请输入${item.name}`,
required: !item.isNull,
base52: item.base52,
base52: item.base52,
});
} else if (number.indexOf(item.type) > -1) {
config.push({
......@@ -91,8 +100,8 @@ const getFormArrayConfig = (header) => {
placeHolder: `请输入${item.name}`,
required: !item.isNull,
min: 0,
base52: item.base52,
});
base52: item.base52,
});
} else if (date.indexOf(item.type) > -1) {
config.push({
key: item.name,
......@@ -101,8 +110,8 @@ const getFormArrayConfig = (header) => {
placeHolder: `请输入${item.name}`,
required: !item.isNull,
format: format[item.type],
base52: item.base52,
});
base52: item.base52,
});
} else {
config.push({
key: item.name,
......@@ -110,8 +119,8 @@ const getFormArrayConfig = (header) => {
type: 'input',
placeHolder: `请输入${item.name}`,
required: !item.isNull,
base52: item.base52,
});
base52: item.base52,
});
}
}
return config;
......@@ -164,17 +173,31 @@ const getSearchCondition = async (id) => {
});
}
});
const refIds = [];
searchHeaders.forEach((x) => {
if (!!x.referenceObjId) {
refIds.push(x.referenceObjId);
for (let item of searchHeaders) {
if (item.isGroupQuery && item.id) { // 获取下拉搜索条件的枚举项
item.options = await service.getGroupList(item.id).then((res) => {
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;
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论