Skip to content

Commit 185e151

Browse files
authored
[Fix-3912][web] Fix the menu of subtype on document module does not refresh with document type (#4417)
1 parent 0a503e4 commit 185e151

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • dinky-web/src/pages/RegCenter/Document/components/DocumentProTable

dinky-web/src/pages/RegCenter/Document/components/DocumentProTable/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ import { ProTable } from '@ant-design/pro-components';
4343
import type { ActionType, ProColumns } from '@ant-design/pro-table';
4444
import TextArea from 'antd/es/input/TextArea';
4545
import React, { useRef, useState } from 'react';
46+
import { Select } from 'antd';
47+
import { JOB_TYPE } from '@/pages/DataStudio/Toolbar/Project/constants';
48+
49+
const FUNCTION_TYPES = Object.values(DOCUMENT_FUNCTION_TYPE_ENUMS).map(item => ({ label: item.text, value: item.value }));
4650

4751
const DocumentTableList: React.FC = () => {
4852
const [documentState, setDocumentState] = useState<DocumentState>(InitDocumentState);
@@ -123,7 +127,13 @@ const DocumentTableList: React.FC = () => {
123127
dataIndex: 'subtype',
124128
filters: true,
125129
filterMultiple: true,
126-
valueEnum: DOCUMENT_FUNCTION_TYPE_ENUMS
130+
renderFormItem: (item, { type }, form) => {
131+
const currentType = form.getFieldValue('type');
132+
let options = currentType === DOCUMENT_TYPE_ENUMS.FUN_UDF.value ? FUNCTION_TYPES : JOB_TYPE;
133+
return (
134+
<Select allowClear options={options} />
135+
);
136+
},
127137
},
128138
{
129139
title: l('rc.doc.category'),

0 commit comments

Comments
 (0)