فهرست منبع

feat(merge): merge wzy

lind 3 سال پیش
والد
کامیت
20c4e9f1cb

+ 1 - 1
config/defaultSettings.ts

@@ -15,7 +15,7 @@ const Settings: LayoutSettings & {
   fixedHeader: false,
   fixSiderbar: true,
   colorWeak: false,
-  title: 'Jetlinks',
+  title: '',
   pwa: false,
   logo: '/logo.svg',
   iconfontUrl: '/icons/iconfont.js',

+ 1 - 1
src/app.tsx

@@ -200,7 +200,7 @@ export const request: RequestConfig = {
 
 // ProLayout 支持的api https://procomponents.ant.design/components/layout
 export const layout: RunTimeLayoutConfig = ({ initialState }) => {
-  console.log({ ...initialState });
+  // console.log({ ...initialState });
   return {
     navTheme: 'light',
     headerTheme: 'light',

+ 2 - 0
src/pages/link/Channel/Opcua/Access/addPoint/index.tsx

@@ -27,6 +27,7 @@ const AddPoint = (props: Props) => {
               name: name,
               deviceId: props.deviceId,
               opcUaId: props.opcUaId,
+              calculateType: 'number',
               configuration: {
                 initialValue: formData.initialValue,
                 multiple: formData.multiple,
@@ -66,6 +67,7 @@ const AddPoint = (props: Props) => {
             name: name,
             deviceId: props.deviceId,
             opcUaId: props.opcUaId,
+            calculateType: 'number',
             configuration: {
               initialValue: formData.initialValue,
               multiple: formData.multiple,

+ 11 - 1
src/pages/media/DashBoard/index.tsx

@@ -7,6 +7,8 @@ import './index.less';
 import encodeQuery from '@/utils/encodeQuery';
 import type { EChartsOption } from 'echarts';
 import moment from 'moment';
+import { Tooltip } from 'antd';
+import { QuestionCircleOutlined } from '@ant-design/icons';
 
 const service = new Service('media');
 
@@ -200,7 +202,14 @@ export default () => {
             <img src={require('/public/images/media/dashboard-3.png')} />
           </DashBoardTopCard.Item>
           <DashBoardTopCard.Item
-            title={'播放中数量'}
+            title={
+              <span>
+                播放中数量
+                <Tooltip title={'当前正在播放的通道数量之和'}>
+                  <QuestionCircleOutlined style={{ marginLeft: 12 }} />
+                </Tooltip>
+              </span>
+            }
             value={playObject ? playObject.playerTotal : 0}
             footer={[
               {
@@ -218,6 +227,7 @@ export default () => {
           title={'播放数量(人次)'}
           options={options}
           height={500}
+          defaultTime={'week'}
           onParamsChange={getEcharts}
         />
       </div>

+ 13 - 2
src/pages/system/Basis/index.less

@@ -1,9 +1,20 @@
 .content {
   margin-left: 30px;
+
+  .text::before {
+    display: inline-block;
+    margin-right: 4px;
+    color: #ff4d4f;
+    font-size: 14px;
+    font-family: SimSun, sans-serif;
+    line-height: 1;
+    content: '*';
+  }
+
   :global {
     .ant-upload.ant-upload-select-picture-card {
-      width: 150px;
-      height: 150px;
+      width: 205px;
+      height: 205px;
     }
   }
 }

+ 26 - 9
src/pages/system/Basis/index.tsx

@@ -54,12 +54,19 @@ const Basis = () => {
   const detail = async (data: any) => {
     const res = await service.detail(data);
     if (res.status === 200) {
-      setImageUrl(res.result?.[0].properties.logo);
-      form.setFieldsValue(res.result?.[0].properties);
+      const basis = res.result?.filter((item: any) => item.scope === 'basis');
+      const api = res?.result.filter((item: any) => item.scope === 'api');
+      // console.log(basis?.[0])
+      setImageUrl(basis[0].properties?.logo);
+      form.setFieldsValue({
+        title: basis[0].properties.title,
+        headerTheme: basis[0].properties.headerTheme,
+        apikey: api[0].properties.api,
+      });
       setInitialState({
         ...initialState,
         settings: {
-          ...res.result?.[0].properties,
+          ...basis[0].properties,
         },
       });
     }
@@ -71,16 +78,23 @@ const Basis = () => {
         {
           scope: 'basis',
           properties: {
-            ...formData,
-            headerTheme: formData.navTheme,
+            title: formData.title,
+            headerTheme: formData.headerTheme,
+            navTheme: formData.headerTheme,
             logo: imageUrl,
           },
         },
+        {
+          scope: 'api',
+          properties: {
+            api: formData.apikey,
+          },
+        },
       ];
       const res = await service.save(item);
       if (res.status === 200) {
         message.success('保存成功');
-        detail(['basis']);
+        detail(['basis', 'api']);
       }
     } else {
       message.error('请上传图片');
@@ -89,7 +103,7 @@ const Basis = () => {
 
   useEffect(() => {
     console.log(initialState);
-    detail(['basis']);
+    detail(['basis', 'api']);
   }, []);
 
   return (
@@ -113,7 +127,7 @@ const Basis = () => {
               </Form.Item>
               <Form.Item
                 label="主题色"
-                name="navTheme"
+                name="headerTheme"
                 rules={[{ required: true, message: '请选择主题色' }]}
               >
                 <Select>
@@ -131,7 +145,10 @@ const Basis = () => {
             </Form>
           </div>
           <div className={styles.content}>
-            <div style={{ marginBottom: 8 }}>系统logo</div>
+            <div style={{ marginBottom: 8, display: 'flex' }}>
+              系统logo
+              <div className={styles.text}></div>
+            </div>
             <Upload {...uploadProps}>
               {imageUrl ? (
                 <img src={imageUrl} alt="avatar" style={{ width: '100%', height: '100%' }} />

+ 5 - 1
src/pages/system/Platforms/Setting/index.tsx

@@ -1,10 +1,14 @@
 import { PageContainer } from '@ant-design/pro-layout';
 import ApiPage from '../Api/base';
+import { ExclamationCircleOutlined } from '@ant-design/icons';
 
 export default () => {
   return (
     <PageContainer>
-      <div style={{ padding: 24, background: '#fff' }}>配置系统支持API赋权的范围</div>
+      <div style={{ padding: '24px 24px 0 24px', background: '#fff' }}>
+        <ExclamationCircleOutlined style={{ marginRight: 12, fontSize: 16 }} />
+        配置系统支持API赋权的范围
+      </div>
       <ApiPage showDebugger={true} isOpenGranted={false} />
     </PageContainer>
   );

+ 16 - 14
src/pages/system/Platforms/index.tsx

@@ -2,8 +2,8 @@ import { PageContainer } from '@ant-design/pro-layout';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
 import { useRef, useState } from 'react';
-import { useIntl, useHistory } from 'umi';
-import { BadgeStatus, PermissionButton, AIcon } from '@/components';
+import { useHistory, useIntl } from 'umi';
+import { AIcon, BadgeStatus, PermissionButton } from '@/components';
 import SearchComponent from '@/components/SearchComponent';
 import {
   DeleteOutlined,
@@ -306,18 +306,20 @@ export default () => {
           </div>,
         ]}
       />
-      <SaveModal
-        visible={saveVisible}
-        data={editData}
-        type={saveType}
-        onCancel={() => {
-          setSaveVisible(false);
-          setEditData(undefined);
-        }}
-        onReload={() => {
-          actionRef.current?.reload();
-        }}
-      />
+      {saveVisible && (
+        <SaveModal
+          visible={saveVisible}
+          data={editData}
+          type={saveType}
+          onCancel={() => {
+            setSaveVisible(false);
+            setEditData(undefined);
+          }}
+          onReload={() => {
+            actionRef.current?.reload();
+          }}
+        />
+      )}
       <PasswordModal
         visible={passwordVisible}
         onCancel={() => {

+ 1 - 1
src/pages/user/Login/service.ts

@@ -52,7 +52,7 @@ const Service = {
       method: 'GET',
       params,
     }),
-  settingDetail: (data?: any) =>
+  settingDetail: (data: any) =>
     request(`/${SystemConst.API_BASE}/system/config/scopes`, {
       method: 'POST',
       data,