Explorar o código

add readonly alert

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
08a4f86825
Modificáronse 1 ficheiros con 13 adicións e 2 borrados
  1. 13 2
      dashboard/src/components/article/ArticleEdit.tsx

+ 13 - 2
dashboard/src/components/article/ArticleEdit.tsx

@@ -7,7 +7,7 @@ import {
   ProFormTextArea,
   ProFormTextArea,
 } from "@ant-design/pro-components";
 } from "@ant-design/pro-components";
 
 
-import { Button, Form, message, Result, Space, Tabs } from "antd";
+import { Alert, Button, Form, message, Result, Space, Tabs } from "antd";
 
 
 import { get, put } from "../../request";
 import { get, put } from "../../request";
 import {
 import {
@@ -58,7 +58,18 @@ const ArticleEditWidget = ({
     />
     />
   ) : (
   ) : (
     <>
     <>
-      {readonly ? "只读" : undefined}
+      {readonly ? (
+        <Alert
+          message="文章为只读,如果需要修改,请联络拥有者分配权限。"
+          type="warning"
+          closable
+          action={
+            <Button disabled size="small" type="text">
+              详情
+            </Button>
+          }
+        />
+      ) : undefined}
       <ProForm<IFormData>
       <ProForm<IFormData>
         onFinish={async (values: IFormData) => {
         onFinish={async (values: IFormData) => {
           // TODO
           // TODO