From 6d0f8e15e42e4b4ad70f5477d8d646655ea9c3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E9=98=B3?= Date: Fri, 3 Jan 2025 23:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AD=98=E5=82=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Oss/index.tsx | 42 ++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/src/pages/Oss/index.tsx b/src/pages/Oss/index.tsx index a1f7363..b787709 100644 --- a/src/pages/Oss/index.tsx +++ b/src/pages/Oss/index.tsx @@ -1,9 +1,10 @@ import { useState, useEffect } from 'react'; import { Table, Button, Form, Input, Popconfirm, message, Card, Modal, Tag } from 'antd'; -import { addOssDataAPI, delOssDataAPI, editOssDataAPI, getOssListAPI, enableOssDataAPI, disableOssDataAPI } from '@/api/Oss'; +import { addOssDataAPI, delOssDataAPI, editOssDataAPI, getOssListAPI, enableOssDataAPI, disableOssDataAPI, getOssDataAPI } from '@/api/Oss'; import type { Oss } from '@/types/app/oss'; import Title from '@/components/Title'; import type { ColumnsType } from 'antd/es/table'; +import { titleSty } from '@/styles/sty'; const StoragePage = () => { const [loading, setLoading] = useState(false); @@ -15,14 +16,9 @@ const StoragePage = () => { const columns: ColumnsType = [ { title: 'ID', dataIndex: 'id', key: 'id', align: 'center', width: 80 }, - { title: '平台', dataIndex: 'platform', key: 'platform', align: 'center', width: 120 }, - { title: 'Access Key', dataIndex: 'accessKey', key: 'accessKey' }, - { title: '地域', dataIndex: 'endPoint', key: 'endPoint' }, - { title: '存储桶', dataIndex: 'bucketName', key: 'bucketName' }, - { title: '域名', dataIndex: 'domain', key: 'domain' }, - { title: '根目录', dataIndex: 'basePath', key: 'basePath', align: 'center', width: 120 }, { title: '状态', + fixed: 'left', dataIndex: 'isEnable', key: 'isEnable', align: 'center', @@ -34,6 +30,22 @@ const StoragePage = () => { ) }, + { + title: '平台', + dataIndex: 'platform', + key: 'platform', + align: 'center', + width: 120, + render: (text: string) => ( +
{text}
+ ) + }, + // { title: 'Access Key', dataIndex: 'accessKey', key: 'accessKey' }, + // { title: 'Secret Key', dataIndex: 'secretKey', key: 'secretKey' }, + { title: '地域', dataIndex: 'endPoint', key: 'endPoint' }, + { title: '存储桶', dataIndex: 'bucketName', key: 'bucketName' }, + { title: '域名', dataIndex: 'domain', key: 'domain' }, + { title: '根目录', dataIndex: 'basePath', key: 'basePath', align: 'center', width: 120 }, { title: '操作', key: 'action', @@ -81,9 +93,10 @@ const StoragePage = () => { getOssList(); }; - const editOssData = (record: Oss) => { + const editOssData = async (record: Oss) => { setOss(record); - form.setFieldsValue(record); + const { data } = await getOssDataAPI(record.id) + form.setFieldsValue(data); setIsModalOpen(true); }; @@ -135,7 +148,7 @@ const StoragePage = () => { - + { - +