wzyyy 2 лет назад
Родитель
Сommit
a4bc2e7b7a

+ 5 - 2
src/components/Player/ScreenPlayer.tsx

@@ -324,7 +324,10 @@ export default forwardRef((props: ScreenProps, ref) => {
                 {/*  <QuestionCircleOutlined />*/}
                 {/*</Tooltip>*/}
               </div>
-              <div className={'screen-tool-save'}>
+              <div
+                className={'screen-tool-save'}
+                style={{ display: 'flex', flexDirection: 'row-reverse', alignItems: 'center' }}
+              >
                 <Popover
                   content={
                     <Form style={{ width: '217px' }} form={historyForm}>
@@ -353,7 +356,7 @@ export default forwardRef((props: ScreenProps, ref) => {
                         type={'primary'}
                         onClick={saveHistory}
                         loading={loading}
-                        style={{ width: '100%', marginTop: 16 }}
+                        style={{ width: '100%', marginRight: 16 }}
                       >
                         保存
                       </Button>

+ 32 - 10
src/pages/device/Product/Detail/Access/index.tsx

@@ -626,11 +626,12 @@ const Access = () => {
           <Col span={12}>
             <div className={styles.config}>
               <div className={styles.item}>
-                <TitleComponent
-                  data={
-                    <span>
-                      接入方式
-                      <Tooltip
+                <div style={{ display: 'flex', width: 150, alignItems: 'flex-start' }}>
+                  <TitleComponent
+                    data={
+                      <span>
+                        接入方式
+                        {/* <Tooltip
                         title={
                           !!(productModel.current?.count && productModel.current?.count > 0)
                             ? '产品下有设备实例时不能更换接入方式'
@@ -651,13 +652,34 @@ const Access = () => {
                         >
                           更换
                         </Button>
-                      </Tooltip>
-                      {/* <Button onClick={async()=>{
+                      </Tooltip> */}
+                        {/* <Button onClick={async()=>{
                           await service.productGuideDetail()
                         }}>删除</Button> */}
-                    </span>
-                  }
-                />
+                      </span>
+                    }
+                  />
+                  <Tooltip
+                    title={
+                      !!(productModel.current?.count && productModel.current?.count > 0)
+                        ? '产品下有设备实例时不能更换接入方式'
+                        : ''
+                    }
+                  >
+                    <Button
+                      size="small"
+                      type="primary"
+                      ghost
+                      style={{ marginLeft: 20 }}
+                      disabled={!!(productModel.current?.count && productModel.current?.count > 0)}
+                      onClick={() => {
+                        setConfigVisible(true);
+                      }}
+                    >
+                      更换
+                    </Button>
+                  </Tooltip>
+                </div>
                 <div className={styles.context}>
                   {/*<Tooltip placement="topLeft" title={access?.name}>*/}
                   {/*  <div className="ellipsis-70">{access?.name}</div>*/}

+ 14 - 6
src/pages/edge/Device/index.tsx

@@ -86,6 +86,9 @@ export default () => {
           }
         });
       }}
+      tooltip={{
+        title: type === 'list' ? '远程控制' : '',
+      }}
       isPermission={permission.setting}
       style={{ padding: 0 }}
       key={'control'}
@@ -102,7 +105,7 @@ export default () => {
       isPermission={permission.password}
       key={'reset'}
       popConfirm={{
-        title: '确认重置密码?',
+        title: '确认重置密码为P@ssw0rd?',
         onConfirm: () => {
           service.restPassword(record.id).then((resp: any) => {
             if (resp.status === 200) {
@@ -162,10 +165,15 @@ export default () => {
       }}
       isPermission={permission.action}
       tooltip={{
-        title: intl.formatMessage({
-          id: `pages.data.option.${record.state.value !== 'notActive' ? 'disabled' : 'enabled'}`,
-          defaultMessage: record.state.value !== 'notActive' ? '禁用' : '启用',
-        }),
+        title:
+          type === 'list'
+            ? intl.formatMessage({
+                id: `pages.data.option.${
+                  record.state.value !== 'notActive' ? 'disabled' : 'enabled'
+                }`,
+                defaultMessage: record.state.value !== 'notActive' ? '禁用' : '启用',
+              })
+            : '',
       }}
     >
       {record.state.value !== 'notActive' ? <StopOutlined /> : <PlayCircleOutlined />}
@@ -185,7 +193,7 @@ export default () => {
       tooltip={
         record.state.value !== 'notActive'
           ? { title: intl.formatMessage({ id: 'pages.device.instance.deleteTip' }) }
-          : undefined
+          : { title: type !== 'list' ? '' : '删除' }
       }
       disabled={record.state.value !== 'notActive'}
       popConfirm={{

+ 1 - 1
src/pages/edge/Resource/index.tsx

@@ -267,7 +267,7 @@ export default () => {
           status: 'enabled',
         },
         disabled: {
-          text: '异常',
+          text: '禁用',
           status: 'disabled',
         },
       },

+ 19 - 1
src/pages/iot-card/CardManagement/ImportModal.tsx

@@ -4,7 +4,7 @@ import { useRequest } from 'ahooks';
 import { service } from '@/pages/iot-card/CardManagement/index';
 import Token from '@/utils/token';
 import SystemConst from '@/utils/const';
-import { downloadFile } from '@/utils/util';
+import { downloadFile, onlyMessage } from '@/utils/util';
 import { CheckOutlined } from '@ant-design/icons';
 
 type ImportModalType = {
@@ -48,6 +48,9 @@ const ImportModal = (props: ImportModalType) => {
       const resp = info.file.response || { result: '' };
       submitData(resp.result);
     }
+    if (!info.file.status) {
+      setLoading(false);
+    }
   };
 
   const downFileFn = (type: string) => {
@@ -124,6 +127,21 @@ const ImportModal = (props: ImportModalType) => {
                 }}
                 showUploadList={false}
                 onChange={fileChange}
+                beforeUpload={(file) => {
+                  const type = fileType === 'csv' ? 'csv' : 'xlsx';
+
+                  const isCsv = file.type === 'text/csv';
+                  const isXlsx =
+                    file.type ===
+                    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
+                  if (!isCsv && type !== 'xlsx') {
+                    onlyMessage('请上传.csv格式文件', 'warning');
+                  }
+                  if (!isXlsx && type !== 'csv') {
+                    onlyMessage('请上传.xlsx格式文件', 'warning');
+                  }
+                  return (isCsv && type !== 'xlsx') || (isXlsx && type !== 'csv');
+                }}
               >
                 <Button loading={loading}>上传文件</Button>
               </Upload>

+ 5 - 5
src/pages/link/DashBoard/index.tsx

@@ -250,7 +250,7 @@ export default () => {
       xAxis: {
         type: 'category',
         data: xAxis,
-        boundaryGap: false,
+        boundaryGap: true,
       },
       tooltip: {
         trigger: 'axis',
@@ -260,8 +260,8 @@ export default () => {
         type: 'value',
       },
       grid: {
-        left: 60,
-        right: 0,
+        left: 70,
+        right: 10,
         top: 10,
         bottom: 20,
       },
@@ -298,7 +298,7 @@ export default () => {
     setJvmOptions({
       xAxis: {
         type: 'category',
-        boundaryGap: false,
+        boundaryGap: true,
         data: arrayReverse(xAxis),
       },
       tooltip: {
@@ -359,7 +359,7 @@ export default () => {
     setCpuOptions({
       xAxis: {
         type: 'category',
-        boundaryGap: false,
+        boundaryGap: true,
         data: arrayReverse(xAxis),
       },
       tooltip: {

+ 8 - 7
src/pages/system/Platforms/Api/basePage.tsx

@@ -22,7 +22,7 @@ export default (props: TableProps) => {
   const [selectKeys, setSelectKeys] = useState<string[]>([]);
   const [dataSource, setDataSource] = useState<any[]>([]);
   const [loading, setLoading] = useState(false);
-  const [GrantKeys, setGrantKeys] = useState<string[] | undefined>(undefined);
+  const [GrantKeys, setGrantKeys] = useState<any>([]);
   const { permission } = PermissionButton.usePermission('system/Platforms/Setting');
 
   const grantCache = useRef<string[]>([]);
@@ -91,14 +91,14 @@ export default (props: TableProps) => {
     const code = param.get('code');
     // 和原有已授权数据进行对比
     const addGrant = selectKeys.filter((key) => {
-      if (grantCache.current.includes(key)) {
+      if (GrantKeys.includes(key)) {
         return false;
       }
       return true;
     });
 
     // 获取删除的数据
-    const removeGrant = grantCache.current.filter((key) => {
+    const removeGrant = GrantKeys.filter((key: any) => {
       if (selectKeys.includes(key)) {
         return false;
       }
@@ -125,8 +125,8 @@ export default (props: TableProps) => {
 
     setLoading(true);
     if (props.isOpenGranted === false) {
-      console.log('del-------', removeGrant);
-      console.log('add-------', addGrant);
+      // console.log('del-------', removeGrant);
+      // console.log('add-------', addGrant);
       const resp2 = removeGrant.length ? await service.apiOperationsRemove(removeGrant) : {};
       const resp = await service.apiOperationsAdd(addGrant);
       if (resp.status === 200 || resp2.status === 200) {
@@ -135,7 +135,7 @@ export default (props: TableProps) => {
       }
     } else {
       const resp2 = await service.removeApiGrant(code!, {
-        operations: removeOperations.filter((item) => item.permissions),
+        operations: removeOperations.filter((item: any) => item.permissions),
       });
       const resp = await service.addApiGrant(code!, {
         operations: addOperations.filter((item) => item.permissions),
@@ -149,7 +149,7 @@ export default (props: TableProps) => {
   }, [selectKeys, location, dataSource, props.isOpenGranted]);
 
   useEffect(() => {
-    console.log('GrantKeys-=========', GrantKeys);
+    // console.log('GrantKeys-=========', GrantKeys);
     if (GrantKeys) {
       setSelectKeys(GrantKeys);
     }
@@ -218,6 +218,7 @@ export default (props: TableProps) => {
                       GrantKeys,
                       dataSource.map((item) => item.operationId),
                     );
+                    // console.log('diffList---',diffList)
                     setSelectKeys(diffList);
                   }
                 },