Bladeren bron

feat: merge

xieyonghong 3 jaren geleden
bovenliggende
commit
12468eb17f

+ 0 - 15
src/pages/link/AccessConfig/Detail/Provider/index.less

@@ -27,18 +27,3 @@
   white-space: nowrap;
   text-overflow: ellipsis;
 }
-
-.title {
-  width: 100%;
-  margin-bottom: 10px;
-  overflow: hidden;
-  font-weight: 800;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-}
-
-.title::before {
-  margin-right: 10px;
-  background-color: #2810ff;
-  content: '|';
-}

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

@@ -1,3 +1,4 @@
+import { TitleComponent } from '@/components';
 import { Button, Card, Col, Row } from 'antd';
 import { useEffect, useState } from 'react';
 import styles from './index.less';
@@ -28,7 +29,7 @@ const Provider = (props: Props) => {
   return (
     <>
       <Card>
-        <div className={styles.title}>自定义设备接入</div>
+        <TitleComponent data={'自定义设备接入'} />
         <Row gutter={[16, 16]}>
           {dataSource.map((item) => (
             <Col key={item.name} span={12}>
@@ -70,7 +71,7 @@ const Provider = (props: Props) => {
         </Row>
       </Card>
       <Card style={{ marginTop: 20 }}>
-        <div className={styles.title}>视频类设备接入</div>
+        <TitleComponent data={'视频类设备接入'} />
         <Row gutter={[16, 16]}>
           {mediaSource.map((item) => (
             <Col key={item.name} span={12}>

+ 28 - 6
src/pages/rule-engine/Alarm/Config/index.tsx

@@ -1,5 +1,5 @@
 import { PageContainer } from '@ant-design/pro-layout';
-import { Button, Card, Col, Divider, message, Row, Table } from 'antd';
+import { Button, Card, Col, Divider, message, Row, Table, Tooltip, Image } from 'antd';
 import TitleComponent from '@/components/TitleComponent';
 import { createSchemaField } from '@formily/react';
 import { ArrayItems, Form, FormButtonGroup, FormGrid, FormItem, Input } from '@formily/antd';
@@ -10,8 +10,8 @@ import FLevelInput from '@/components/FLevelInput';
 import type { IOConfigItem } from '@/pages/rule-engine/Alarm/Config/typing';
 import Service from '@/pages/rule-engine/Alarm/Config/service';
 import styles from './index.less';
-import { Image } from 'antd';
 import ReactMarkdown from 'react-markdown';
+import { QuestionCircleOutlined } from '@ant-design/icons';
 
 export const service = new Service('alarm/config');
 const ioImg = require('/public/images/alarm/io.png');
@@ -411,7 +411,7 @@ const Config = () => {
     <Row>
       <Col span={14}>
         <Card>
-          <TitleComponent data="告警级别配置" />
+          <TitleComponent data={'告警级别配置'} />
           <Form form={levelForm}>
             <SchemaField schema={levelSchema} />
             <FormButtonGroup.Sticky>
@@ -440,12 +440,30 @@ const Config = () => {
       <Col span={14}>
         <div>
           <Card>
-            <TitleComponent data="告警数据输出" />
+            <TitleComponent
+              data={
+                <span>
+                  告警数据输出
+                  <Tooltip title={'将告警数据输出到其他第三方系统'}>
+                    <QuestionCircleOutlined style={{ marginLeft: 5 }} />
+                  </Tooltip>
+                </span>
+              }
+            />
             <Form form={outputForm} layout="vertical">
               <SchemaField schema={ioSchema} />
             </Form>
             <Divider />
-            <TitleComponent data="告警处理结果输入" />
+            <TitleComponent
+              data={
+                <span>
+                  告警处理结果输入
+                  <Tooltip title={'接收第三方系统处理的告警结果'}>
+                    <QuestionCircleOutlined style={{ marginLeft: 5 }} />
+                  </Tooltip>
+                </span>
+              }
+            />
             <Form form={inputForm} layout="vertical">
               <SchemaField schema={ioSchema} />
               <FormButtonGroup.Sticky>
@@ -488,7 +506,11 @@ const Config = () => {
   );
 
   const list = [
-    { key: 'config', tab: '告警级别', component: level },
+    {
+      key: 'config',
+      tab: '告警级别',
+      component: level,
+    },
     { key: 'io', tab: '数据流转', component: io },
   ];
 

+ 1 - 1
src/pages/rule-engine/Alarm/Log/SolveLog/index.tsx

@@ -59,7 +59,7 @@ const SolveLog = (props: Props) => {
       },
     },
     {
-      dataIndex: 'createTime',
+      dataIndex: 'alarmTime',
       title: '告警时间',
       valueType: 'dateTime',
       // render: (text: any, record: any) => <span>{moment(record.createTime).format('YYYY-MM-DD HH:mm:ss')}</span>,

+ 3 - 3
src/pages/rule-engine/Scene/Save/action/VariableItems/user.tsx

@@ -83,7 +83,7 @@ export default (props: UserProps) => {
   };
 
   useEffect(() => {
-    if (['dingTalk', 'weChart'].includes(props.notifyType)) {
+    if (['dingTalk', 'weixin'].includes(props.notifyType)) {
       if (source === 'fixed') {
         // 钉钉,微信用户
         getRelationUsers(props.notifyType, props.configId);
@@ -316,7 +316,7 @@ export default (props: UserProps) => {
       <Select
         value={source}
         options={
-          props.notifyType && ['dingTalk', 'weChart'].includes(props.notifyType)
+          props.notifyType && ['dingTalk', 'weixin'].includes(props.notifyType)
             ? options
             : otherOptions
         }
@@ -326,7 +326,7 @@ export default (props: UserProps) => {
           onchange(key, undefined);
         }}
       />
-      {props.notifyType && ['dingTalk', 'weChart'].includes(props.notifyType) ? userSelect : null}
+      {props.notifyType && ['dingTalk', 'weixin'].includes(props.notifyType) ? userSelect : null}
       {props.notifyType && ['email'].includes(props.notifyType) ? emailSelect : null}
       {props.notifyType && ['sms', 'voice'].includes(props.notifyType) ? voiceSelect : null}
     </ItemGroup>

+ 1 - 1
src/pages/rule-engine/Scene/Save/components/TimeSelect/index.tsx

@@ -74,7 +74,7 @@ export default (props: TimeSelect) => {
   useEffect(() => {
     document.body.onclick = (e) => {
       const elem: any = e.target;
-      const isSelectDom = elem && elem.className.includes('time-select');
+      const isSelectDom = elem && elem.className?.includes?.('time-select');
 
       if (!isSelectDom) {
         setVisible(false);

+ 43 - 5
src/pages/rule-engine/Scene/TriggerTerm/index.tsx

@@ -30,6 +30,7 @@ import { useAsyncDataSource } from '@/utils/util';
 import { Store } from 'jetlinks-store';
 import { treeFilter } from '@/utils/tree';
 import FInputGroup from '@/components/FInputGroup';
+import { Button } from 'antd';
 
 const service = new Service('scene');
 
@@ -46,11 +47,40 @@ const TriggerTerm = (props: Props, ref: any) => {
     service.getParseTerm(props.params).then((data) => {
       Store.set('trigger-parse-term', data);
       parseTermRef.current = data;
-      return data.map((item: any) => ({
-        column: item.column,
-        name: item.name,
-        children: item.children,
-      }));
+      const handleName = (_data: any): any => (
+        <Space>
+          {_data.name}
+          <div style={{ color: 'grey', marginLeft: '5px' }}>{_data.description}</div>
+        </Space>
+      );
+      const handleChildrenName = (_data: any[]): any[] => {
+        if (_data?.length > 0) {
+          return _data.map((it) => {
+            if (it.children) {
+              return {
+                ...it,
+                key: it.column,
+                name: handleName(it),
+                disabled: true,
+                children: handleChildrenName(it.children),
+              };
+            }
+            return { ...it, key: it.column, name: handleName(it) };
+          });
+        } else {
+          return [];
+        }
+      };
+      return data.map((item: any) => {
+        const disabled = item.children?.length > 0;
+        return {
+          column: item.column,
+          key: item.column,
+          name: handleName(item),
+          disabled: disabled,
+          children: handleChildrenName(item.children),
+        };
+      });
     });
 
   const form = useMemo(
@@ -227,6 +257,7 @@ const TriggerTerm = (props: Props, ref: any) => {
                         'x-component-props': {
                           placeholder: '请选择参数',
                           fieldNames: { value: 'column', label: 'name', options: 'children' },
+                          // treeNodeLabelProp: 'name',
                         },
                         'x-reactions': '{{useAsyncDataSource(getParseTerm)}}',
                       },
@@ -320,6 +351,13 @@ const TriggerTerm = (props: Props, ref: any) => {
   return (
     <Form form={form} layout="vertical" className={styles.form}>
       <SchemaField schema={schema} scope={{ useAsyncDataSource, getParseTerm }} />
+      <Button
+        onClick={async () => {
+          console.log(await form.submit(), '保存');
+        }}
+      >
+        保存
+      </Button>
     </Form>
   );
 };