From 91ae690fb528ec85a86846eaa8ef8f19c32221de Mon Sep 17 00:00:00 2001 From: zhengpengju Date: Tue, 8 Feb 2022 16:53:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/pages/examination/option/index.tsx | 30 +++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/admin/src/pages/examination/option/index.tsx b/admin/src/pages/examination/option/index.tsx index f55791a..744bcc6 100644 --- a/admin/src/pages/examination/option/index.tsx +++ b/admin/src/pages/examination/option/index.tsx @@ -6,7 +6,7 @@ import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Form } import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; import type { ProColumns, ActionType } from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table'; -import { BetaSchemaForm, ModalForm, ProFormText, ProFormTextArea } from '@ant-design/pro-form'; +import { BetaSchemaForm, ModalForm, ProFormColumnsType, ProFormText, ProFormTextArea } from '@ant-design/pro-form'; import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; import ProDescriptions from '@ant-design/pro-descriptions'; import type { FormValueType } from './components/UpdateForm'; @@ -95,7 +95,7 @@ const ExaminationList: React.FC = () => { const [selectedRowsState, setSelectedRows] = useState([]); /** 列表项定义 */ - const columns: ProColumns[] = [ + const columns: ProFormColumnsType[] = [ { title: '序号', key: 'index', @@ -153,7 +153,7 @@ const ExaminationList: React.FC = () => { hideInForm: false, hideInSearch: true, request: async () => { - const { data: Items } = await querySubjectList({}); + const { data: Items } = await querySubjectList({page_size:1000}); // console.log(Items, ')))'); const sinfo = [] @@ -176,25 +176,21 @@ const ExaminationList: React.FC = () => { }, { title: '关联的规则', - dataIndex: 'subject_id2', - valueType: 'text', + dataIndex: 'rule_id', + valueType: 'select', hideInTable: true, hideInForm: false, hideInSearch: true, - request: async (e, a) => { - console.log(e, a, 'OOOOOOOOO'); - - const { data: Items } = await queryRulesList({}); - // console.log(Items, ')))'); - const sinfo = [] - for (let i = 0; i < Items.list.length; i++) { - // console.log(Items.list[i], ">>>") - sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id }) + dependencies: ['subject_id'], + request: async (params) => { + console.log(params, 'params::::'); + const { table_List: Items } = await queryRulesList({rules_type: 1, subject_id: params.subject_id,}); + const rules = []; + for (let i = 0; i < Items.length; i++) { + rules.push({ label: Items[i].rules_name, value: Items[i].id }) } - console.log(sinfo, 'sinfo'); - - return sinfo; + return rules; }, formItemProps: { rules: [