Skip to content

Commit 972adcc

Browse files
authored
[Fix-4417][web] Fix the menu of subtype on document module does not refresh with document type (#4427)
1 parent 93c2673 commit 972adcc

1 file changed

Lines changed: 12 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: 12 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,14 @@ const DocumentTableList: React.FC = () => {
123127
dataIndex: 'subtype',
124128
filters: true,
125129
filterMultiple: true,
126-
valueEnum: DOCUMENT_FUNCTION_TYPE_ENUMS
130+
valueEnum: DOCUMENT_FUNCTION_TYPE_ENUMS,
131+
renderFormItem: (item, { type }, form) => {
132+
const currentType = form.getFieldValue('type');
133+
let options = currentType === DOCUMENT_TYPE_ENUMS.FUN_UDF.value ? FUNCTION_TYPES : JOB_TYPE;
134+
return (
135+
<Select allowClear options={options} />
136+
);
137+
},
127138
},
128139
{
129140
title: l('rc.doc.category'),

0 commit comments

Comments
 (0)