Parcourir la source

feat(merge): merge sc

fix: 表单添加提示语
Lind il y a 3 ans
Parent
commit
ab03c3e568

+ 9 - 8
package.json

@@ -62,20 +62,20 @@
     "@ant-design/pro-descriptions": "^1.6.8",
     "@ant-design/pro-form": "^1.18.3",
     "@ant-design/pro-layout": "^6.27.2",
-    "@formily/antd": "2.0.18",
-    "@formily/core": "2.0.18",
-    "@formily/json-schema": "2.0.18",
-    "@formily/react": "2.0.18",
-    "@formily/reactive": "2.0.18",
-    "@formily/reactive-react": "2.0.18",
-    "@formily/shared": "2.0.18",
+    "@formily/antd": "2.0.0-rc.17",
+    "@formily/core": "2.0.0-rc.17",
+    "@formily/json-schema": "2.0.0-rc.17",
+    "@formily/react": "2.0.0-rc.17",
+    "@formily/reactive": "2.0.0-rc.17",
+    "@formily/reactive-react": "2.0.0-rc.17",
+    "@formily/shared": "2.0.0-rc.17",
     "@jetlinks/pro-list": "^1.10.8",
     "@jetlinks/pro-table": "^2.63.11",
     "@liveqing/liveplayer": "^2.6.4",
     "@types/react-syntax-highlighter": "^13.5.2",
     "@umijs/route-utils": "^1.0.36",
     "ahooks": "^2.10.9",
-    "antd": "^4.19.5",
+    "antd": "^4.18.8",
     "braft-editor": "^2.3.9",
     "classnames": "^2.3.1",
     "dexie": "^3.0.3",
@@ -91,6 +91,7 @@
     "react-dev-inspector": "^1.1.1",
     "react-dom": "^17.0.0",
     "react-helmet-async": "^1.0.4",
+    "react-json-view": "^1.21.3",
     "react-markdown": "^8.0.0",
     "react-monaco-editor": "^0.46.0",
     "react-syntax-highlighter": "^15.4.5",

BIN
public/images/diagnose/message-error.png


BIN
public/images/diagnose/status-error.png


BIN
public/images/diagnose/status-success-active.png


BIN
public/images/diagnose/status-success.png


BIN
public/images/diagnose/waiting.png


BIN
public/images/notice/dingtalk-background.png


BIN
public/images/notice/dingtalk.png


BIN
public/images/notice/email-background.png


BIN
public/images/notice/email.png


BIN
public/images/notice/sms-background.png


BIN
public/images/notice/sms.png


BIN
public/images/notice/voice-background.png


BIN
public/images/notice/voice.png


BIN
public/images/notice/wechat-background.png


BIN
public/images/notice/wechat.png


+ 2 - 1
src/components/SipComponent/index.tsx

@@ -32,11 +32,12 @@ const SipComponent = (props: SipComponentProps) => {
         }}
         value={data?.host}
         style={{ marginRight: 10 }}
-        placeholder="请输入"
+        placeholder="请输入IP地址"
       />
       <InputNumber
         style={{ minWidth: 100 }}
         value={data?.port}
+        placeholder="请输入端口"
         min={1}
         max={65535}
         onChange={(e: number) => {

+ 8 - 6
src/pages/Log/Access/index.tsx

@@ -43,11 +43,11 @@ const Access = () => {
         id: 'pages.table.description',
         defaultMessage: '说明',
       }),
-      dataIndex: 'description',
+      dataIndex: 'describe',
       ellipsis: true,
-      render: (text, record) => {
-        return `${record.action}-${record.describe}`;
-      },
+      // render: (text, record) => {
+      //   return `${record.action}-${record.describe}`;
+      // },
     },
     {
       title: intl.formatMessage({
@@ -76,8 +76,10 @@ const Access = () => {
         id: 'pages.log.access.requestUser',
         defaultMessage: '请求用户',
       }),
-      dataIndex: 'context.username',
-      render: (text) => <Tag color="geekblue">{text}</Tag>,
+      dataIndex: 'username',
+      render: (text, record: any) => (
+        <Tag color="geekblue">{record?.context?.username || '--'}</Tag>
+      ),
     },
     {
       title: intl.formatMessage({

+ 6 - 6
src/pages/link/AccessConfig/Detail/Access/index.tsx

@@ -395,8 +395,8 @@ const Access = (props: Props) => {
               <Button
                 type="primary"
                 onClick={() => {
-                  const url = getMenuPathByCode(MENUS_CODE['link/Protocol?save=true']);
-                  const tab: any = window.open(`${origin}/#${url}`);
+                  const url = getMenuPathByCode(MENUS_CODE[`link/Protocol`]);
+                  const tab: any = window.open(`${origin}/#${url}?save=true`);
                   tab!.onTabSaveSuccess = (value: any) => {
                     if (value) {
                       queryProcotolList(props.provider?.id);
@@ -438,8 +438,8 @@ const Access = (props: Props) => {
                     暂无数据
                     <a
                       onClick={() => {
-                        const url = getMenuPathByCode(MENUS_CODE['link/Protocol?save=true']);
-                        const tab: any = window.open(`${origin}/#${url}`);
+                        const url = getMenuPathByCode(MENUS_CODE[`link/Protocol`]);
+                        const tab: any = window.open(`${origin}/#${url}?save=true`);
                         tab!.onTabSaveSuccess = (value: any) => {
                           if (value) {
                             queryProcotolList(props.provider?.id);
@@ -467,10 +467,10 @@ const Access = (props: Props) => {
                     name="name"
                     rules={[{ required: true, message: '请输入名称' }]}
                   >
-                    <Input />
+                    <Input placeholder="请输入名称" />
                   </Form.Item>
                   <Form.Item name="description" label="说明">
-                    <Input.TextArea showCount maxLength={200} />
+                    <Input.TextArea showCount maxLength={200} placeholder="请输入说明" />
                   </Form.Item>
                 </Form>
                 <div className={styles.action} style={{ marginTop: 50 }}>

+ 2 - 2
src/pages/link/AccessConfig/Detail/Media/index.tsx

@@ -388,10 +388,10 @@ const Media = (props: Props) => {
                 name="name"
                 rules={[{ required: true, message: '请输入名称' }]}
               >
-                <Input />
+                <Input placeholder="请输入名称" />
               </Form.Item>
               <Form.Item name="description" label="说明">
-                <Input.TextArea showCount maxLength={200} />
+                <Input.TextArea showCount maxLength={200} placeholder="请输入说明" />
               </Form.Item>
             </Form>
             <div className={styles.action}>

+ 1 - 0
src/pages/link/Protocol/FileUpload/index.tsx

@@ -46,6 +46,7 @@ const FileUpload = connect((props: Props) => {
               e.preventDefault();
               e.stopPropagation();
             }}
+            placeholder="请上传文件"
           />
           <Button shape="round" style={{ width: '100px', textAlign: 'center' }} type="primary">
             上传jar包

+ 11 - 1
src/pages/link/Protocol/index.tsx

@@ -205,6 +205,9 @@ const Protocol = () => {
                 },
               },
             ],
+            'x-component-props': {
+              placeholder: '请输入ID',
+            },
           },
           name: {
             title: '名称',
@@ -213,6 +216,9 @@ const Protocol = () => {
             'x-decorator-props': {
               gridSpan: 1,
             },
+            'x-component-props': {
+              placeholder: '请输入名称',
+            },
             'x-validator': [
               {
                 required: true,
@@ -231,6 +237,9 @@ const Protocol = () => {
             'x-decorator-props': {
               tooltip: <div>jar:上传协议jar包,文件格式支持.jar或.zip</div>,
             },
+            'x-component-props': {
+              placeholder: '请选择类型',
+            },
             'x-validator': [
               {
                 required: true,
@@ -269,7 +278,8 @@ const Protocol = () => {
                     state: {
                       visible: '{{["jar","local"].includes($deps[0])}}',
                       componentType: '{{$deps[0]==="jar"?"FileUpload":"Input"}}',
-                      componentProps: '{{$deps[0]==="jar"?{type:"file", accept: ".jar, .zip"}:{}}}',
+                      componentProps:
+                        '{{$deps[0]==="jar"?{type:"file", accept: ".jar, .zip"}:{placeholder: "请输入文件地址"}}}',
                     },
                   },
                 },

+ 55 - 9
src/pages/notice/index.less

@@ -1,16 +1,62 @@
-.action {
+@import '~antd/es/style/themes/default.less';
+
+.content {
   display: flex;
-  flex-direction: column;
   align-items: center;
-  justify-content: center;
-  height: 70%;
+  justify-content: space-between;
 
-  .icon {
-    margin-bottom: 10px;
-    font-size: 32px;
+  .left {
+    display: flex;
+    .context {
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      height: 100px;
+      margin-left: 15px;
+      .title {
+        font-size: 24px;
+      }
+      .desc {
+        color: rgba(0, 0, 0, 0.65);
+        font-size: 14px;
+      }
+    }
   }
+  .right {
+    .action {
+      display: flex;
+      justify-content: center;
+      width: 100px;
+      height: 100px;
+      background-color: #fff;
+      border: 1px solid @primary-color;
+
+      .btn {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        width: 100px;
+        height: 100px;
+        .icon {
+          margin-bottom: 10px;
+          color: @primary-color;
+          font-size: 32px;
+        }
+
+        div {
+          color: @primary-color;
+          font-size: 16px;
+        }
+      }
+    }
 
-  div {
-    font-size: 16px;
+    .action:hover {
+      background-color: @primary-color;
+      .icon,
+      div {
+        color: #fff;
+      }
+    }
   }
 }

+ 73 - 42
src/pages/notice/index.tsx

@@ -1,7 +1,6 @@
 import { ContainerFilled, ToolFilled } from '@ant-design/icons';
 import { PageContainer } from '@ant-design/pro-layout';
-import { Button, Card, Col, Row } from 'antd';
-import dingding from '/public/images/dingding.png';
+import { Button, Card, Col, Row, Space } from 'antd';
 import styles from './index.less';
 import { observer } from '@formily/react';
 import { history } from 'umi';
@@ -79,26 +78,45 @@ const Type = observer(() => {
   const list = [
     {
       type: 'dingTalk',
-      icon: dingding,
+      name: '钉钉',
+      describe: '支持钉钉消息、群机器人消息类型',
     },
     {
       type: 'weixin',
-      icon: dingding,
+      name: '微信',
+      describe: '支持企业消息、服务号消息类型',
     },
     {
       type: 'email',
-      icon: dingding,
+      name: '邮件',
+      describe: '支持国内通用和自定义邮件类型',
     },
     {
       type: 'voice',
-      icon: dingding,
+      name: '语音',
+      describe: '支持阿里云语音消息类型',
     },
     {
       type: 'sms',
-      icon: dingding,
+      name: '短信',
+      describe: '支持阿里云短信消息类型',
     },
   ];
 
+  const iconMap = new Map();
+  iconMap.set('dingTalk', require('/public/images/notice/dingtalk.png'));
+  iconMap.set('weixin', require('/public/images/notice/wechat.png'));
+  iconMap.set('email', require('/public/images/notice/email.png'));
+  iconMap.set('voice', require('/public/images/notice/voice.png'));
+  iconMap.set('sms', require('/public/images/notice/sms.png'));
+
+  const bGroundMap = new Map();
+  bGroundMap.set('dingTalk', require('/public/images/notice/dingtalk-background.png'));
+  bGroundMap.set('weixin', require('/public/images/notice/wechat-background.png'));
+  bGroundMap.set('email', require('/public/images/notice/email-background.png'));
+  bGroundMap.set('voice', require('/public/images/notice/voice-background.png'));
+  bGroundMap.set('sms', require('/public/images/notice/sms-background.png'));
+
   return (
     <PageContainer
       title={false}
@@ -109,42 +127,55 @@ const Type = observer(() => {
       <Row gutter={[24, 24]}>
         {list.map((i) => (
           <Col span={12} key={i.type}>
-            <Card>
-              <Row>
-                <Col span={12}>
-                  <img style={{ height: 100 }} src={dingding} alt="dingding" />
-                </Col>
-                <Col span={3} push={4}>
-                  <div className={styles.action}>
-                    <Button
-                      type={'link'}
-                      onClick={() => {
-                        history.push(
-                          `${getMenuPathByCode(MENUS_CODE['notice/Template'])}?id=${i.type}`,
-                        );
-                      }}
-                    >
-                      <ContainerFilled className={styles.icon} />
-                      <div>通知模版</div>
-                    </Button>
-                  </div>
-                </Col>
-                <Col span={3} push={6}>
-                  <div className={styles.action}>
-                    <Button
-                      type={'link'}
-                      onClick={() => {
-                        history.push(
-                          `${getMenuPathByCode(MENUS_CODE['notice/Config'])}?id=${i.type}`,
-                        );
-                      }}
-                    >
-                      <ToolFilled className={styles.icon} />
-                      <div>通知配置</div>
-                    </Button>
+            <Card
+              style={{
+                background: `url(${bGroundMap.get(i.type)}) no-repeat`,
+                backgroundSize: '100% 100%',
+              }}
+            >
+              <div className={styles.content}>
+                <div className={styles.left}>
+                  <img style={{ height: 104 }} src={iconMap.get(i.type)} alt="dingding" />
+                  <div className={styles.context}>
+                    <div className={styles.title}>{i.name}</div>
+                    <div className={styles.desc}>{i.describe}</div>
                   </div>
-                </Col>
-              </Row>
+                </div>
+                <div className={styles.right}>
+                  <Space>
+                    <div className={styles.action}>
+                      <Button
+                        type={'link'}
+                        onClick={() => {
+                          history.push(
+                            `${getMenuPathByCode(MENUS_CODE['notice/Template'])}?id=${i.type}`,
+                          );
+                        }}
+                      >
+                        <div className={styles.btn}>
+                          <ContainerFilled className={styles.icon} />
+                          <div>通知模版</div>
+                        </div>
+                      </Button>
+                    </div>
+                    <div className={styles.action}>
+                      <Button
+                        type={'link'}
+                        onClick={() => {
+                          history.push(
+                            `${getMenuPathByCode(MENUS_CODE['notice/Config'])}?id=${i.type}`,
+                          );
+                        }}
+                      >
+                        <div className={styles.btn}>
+                          <ToolFilled className={styles.icon} />
+                          <div>通知配置</div>
+                        </div>
+                      </Button>
+                    </div>
+                  </Space>
+                </div>
+              </div>
             </Card>
           </Col>
         ))}

+ 6 - 0
src/pages/system/Permission/Save/index.tsx

@@ -72,6 +72,9 @@ const Save = (props: Props) => {
         type: 'string',
         'x-decorator': 'FormItem',
         'x-component': 'Input',
+        'x-component-props': {
+          placeholder: '请输入标识(ID)',
+        },
         name: 'id',
         'x-decorator-props': {
           tooltip: <div>标识ID需与代码中的标识ID一致</div>,
@@ -96,6 +99,9 @@ const Save = (props: Props) => {
         'x-decorator': 'FormItem',
         'x-component': 'Input',
         name: 'name',
+        'x-component-props': {
+          placeholder: '请输入名称',
+        },
         'x-validator': [
           {
             max: 64,

+ 4 - 1
src/pages/system/Role/index.tsx

@@ -136,10 +136,12 @@ const Role: React.FC = observer(() => {
         type: 'string',
         'x-decorator': 'FormItem',
         'x-component': 'Input',
-        'x-component-props': {},
         'x-decorator-props': {},
         name: 'name',
         required: true,
+        'x-component-props': {
+          placeholder: '请输入角色名称',
+        },
         'x-validator': [
           {
             max: 64,
@@ -161,6 +163,7 @@ const Role: React.FC = observer(() => {
         'x-component': 'Input.TextArea',
         'x-component-props': {
           checkStrength: true,
+          placeholder: '请输入描述',
         },
         'x-decorator-props': {},
         name: 'password',