提交 7faaab67 authored 作者: 钟是志's avatar 钟是志

一站式流程 审批页面 字段的下拉枚举值获取

上级 994558ec
...@@ -92,18 +92,7 @@ const getOptions = async (id, filterSql = undefined, key, name) => { ...@@ -92,18 +92,7 @@ const getOptions = async (id, filterSql = undefined, key, name) => {
* 批量获取下拉枚举值 * 批量获取下拉枚举值
* */ * */
const getBatchOptions = async (ids) => { const getBatchOptions = async (ids) => {
return await apiRequest('/DataColumnApi/getBatchOptions', { ids }).then((x) => { return await apiRequest('/DataColumnApi/getBatchOptions', { ids });
if (x) {
return x.map((y) => {
return {
key: y[key],
name: y[name],
};
});
} else {
return [];
}
});
}; };
/** /**
......
...@@ -3,6 +3,8 @@ import moment from 'moment'; ...@@ -3,6 +3,8 @@ import moment from 'moment';
import { isJSON } from '@/baseComponent/utils'; import { isJSON } from '@/baseComponent/utils';
import { getDefaultValues } from '../AffairPage/destruction'; import { getDefaultValues } from '../AffairPage/destruction';
import { message } from 'antd'; import { message } from 'antd';
import { deepCopy } from '@/webPublic/one_stop_public/utils/myutils';
import { getBatchOptions } from '../AffairPage/publicApiService';
const text = [ const text = [
'BINARY', 'BINARY',
...@@ -173,8 +175,26 @@ const getSearchCondition = async (id, appId = undefined) => { ...@@ -173,8 +175,26 @@ const getSearchCondition = async (id, appId = undefined) => {
}); });
} }
}); });
// console.log(JSON.stringify(searchHeaders));
for (let item of searchHeaders) { for (let item of searchHeaders) {
if (item.isGroupQuery && item.id) { if(item.referenceObjId && item.id && item.referenceCodeName && item.referenceNameName){ //通过引用去查枚举
item.options = await service.getBatchOptions(item.id).then((res) => {
if(res && res[item.id]){
return res[item.id].filter((g) => {
return !!g.name && !!g.row_id;
}).map((y) => {
return {
key: y[item.referenceCodeName],
name: y[item.referenceNameName],
};
});
}else {
return [];
}
});
}
if (item.isGroupQuery && item.id && (!item.options || !item.options.length)) {
// 获取下拉搜索条件的枚举项 // 获取下拉搜索条件的枚举项
item.options = await service.getGroupList({ item.options = await service.getGroupList({
columnId: item.id, columnId: item.id,
...@@ -183,7 +203,7 @@ const getSearchCondition = async (id, appId = undefined) => { ...@@ -183,7 +203,7 @@ const getSearchCondition = async (id, appId = undefined) => {
if (res && Array.isArray(res)) { if (res && Array.isArray(res)) {
return res return res
.filter((x) => { .filter((x) => {
return x.value !== item.title; return x.value !== item.title && x.value;
}) })
.map((x) => { .map((x) => {
return { return {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论