From d2ffa50cab29b94b0ae7d5aa369519dae0537303 Mon Sep 17 00:00:00 2001 From: zhengpengju Date: Fri, 21 Jan 2022 08:46:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/config/config.ts | 10 ++++++++- admin/src/pages/course/subject/index.tsx | 27 ++++++++++++------------ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/admin/config/config.ts b/admin/config/config.ts index a3267df..38dd0d7 100644 --- a/admin/config/config.ts +++ b/admin/config/config.ts @@ -83,8 +83,16 @@ export default defineConfig({ { name: '新建主题', icon: 'smile', - path: '/course/subject/step', + path: '/course/subject/step/update/:id', component: './course/subject/step', + hideInMenu: true, + }, + { + name: '编辑主题', + icon: 'smile', + path: '/course/subject/step/create', + component: './course/subject/step', + hideInMenu: true, }, { name: '课程设置', diff --git a/admin/src/pages/course/subject/index.tsx b/admin/src/pages/course/subject/index.tsx index 16c2a57..106b6c6 100644 --- a/admin/src/pages/course/subject/index.tsx +++ b/admin/src/pages/course/subject/index.tsx @@ -1,6 +1,7 @@ import { PlusOutlined } from '@ant-design/icons'; import { Button, message, Input, Drawer } from 'antd'; import React, { useState, useRef } from 'react'; +import { history } from 'umi'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; import type { ProColumns, ActionType } from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table'; @@ -110,7 +111,7 @@ const TableList: React.FC = () => { dataIndex: 'callNo', sorter: true, hideInForm: true, - renderText: (val: string) => `${val}万`, + renderText: (val: string) => `${val}`, }, { title: '状态', @@ -162,25 +163,25 @@ const TableList: React.FC = () => { { - handleUpdateModalVisible(true); - setCurrentRow(record); + history.push(`/course/subject/step/update/${record.subject_id}`) }} > - 查看 + 编辑 , - { - handleUpdateModalVisible(true); - setCurrentRow(record); + // handleCopyItem({}); }} > - 编辑 - , - 复制 , - + { + // handleCopyItem({}); + }} + > 删除 , ], @@ -201,7 +202,7 @@ const TableList: React.FC = () => { type="primary" key="primary" onClick={() => { - handleModalVisible(true); + history.push('/course/subject/step/create') }} > 新建