Bladeren bron

删除冗余文件

zhaojijng 2 jaren geleden
bovenliggende
commit
d61c1c6df0
5 gewijzigde bestanden met toevoegingen van 10 en 155 verwijderingen
  1. 10 10
      config/routes.ts
  2. 0 22
      src/models/map.ts
  3. 0 73
      src/tenants-ui/SearchInput/index.jsx
  4. 0 50
      src/tenants-ui/SearchInput/index.less
  5. 0 0
      src/tenants-ui/SgIcon/index.jsx

+ 10 - 10
config/routes.ts

@@ -3,16 +3,16 @@
     path: '/user',
     layout: false,
     routes: [
-      {
-        path: '/user',
-        routes: [
-          {
-            name: 'login',
-            path: '/user/login',
-            component: './user/Login',
-          },
-        ],
-      },
+      //   {
+      //     path: '/user',
+      //     routes: [
+      //       {
+      //         name: 'login',
+      //         path: '/user/login',
+      //         component: './user/Login',
+      //       },
+      //     ],
+      //   },
       {
         component: './404',
       },

+ 0 - 22
src/models/map.ts

@@ -1,22 +0,0 @@
-import React, { useState, useCallback } from 'react';
-import { getMapList } from '@/services/ant-design-pro/environment';
-
-//不用了
-export default function () {
-  const [mapList, setMapList] = useState<API.MapInfo[]>([]);
-
-  const getMapListData = useCallback((selFloorId) => {
-    if (selFloorId) {
-      //debugger;
-      getMapList({ floorId: selFloorId, projectId: '' }).then((res) => {
-        var data: API.MapInfo[] = (res.data || {}).spaceList || [];
-        setMapList(data);
-      });
-    }
-  }, []);
-
-  return {
-    mapList,
-    getMapListData,
-  };
-}

+ 0 - 73
src/tenants-ui/SearchInput/index.jsx

@@ -1,73 +0,0 @@
-import React, { useState, useEffect, useCallback, useRef } from 'react';
-import { useDebounceFn } from 'ahooks';
-import { Input } from 'antd';
-import Icon from '@/tenants-ui/Icon';
-import cx from 'classnames';
-import styles from './index.less';
-
-export default ({ placeholder, onSearch, onCancel }) => {
-  const ref = useRef();
-  const [focus, setFocus] = useState(false);
-  const [searchValue, setSearchValue] = useState('');
-
-  const { run } = useDebounceFn(
-    (val) => {
-      onSearch(val);
-    },
-    {
-      wait: 500,
-    },
-  );
-
-  const handleClose = useCallback((e) => {
-    if (e.keyCode === 27) {
-      setFocus(false);
-      setSearchValue('');
-      onCancel();
-      ref.current.blur();
-    }
-  }, []);
-
-  useEffect(() => {
-    document.addEventListener('keyup', handleClose);
-    return () => {
-      document.removeEventListener('keyup', handleClose);
-    };
-  }, []);
-
-  return (
-    <div
-      className={cx(styles.searchInput, {
-        [styles.focus]: focus,
-      })}
-    >
-      <Icon type="search" style={{ color: '#C4C4C4' }} />
-      <div className={styles.input}>
-        <Input
-          style={{ width: '100%' }}
-          ref={ref}
-          size="large"
-          bordered={false}
-          onFocus={() => setFocus(true)}
-          onBlur={() => {
-            if (!searchValue) {
-              setFocus(false);
-            }
-          }}
-          value={searchValue}
-          placeholder={placeholder}
-          onChange={(e) => {
-            const val = e.target.value;
-            setSearchValue(val);
-            //run(val);
-            onSearch(val);
-          }}
-        />
-      </div>
-      <div className={styles.cancel} onClick={() => handleClose({ keyCode: 27 })}>
-        <Icon type="backward" />
-        取消搜索
-      </div>
-    </div>
-  );
-};

+ 0 - 50
src/tenants-ui/SearchInput/index.less

@@ -1,50 +0,0 @@
-.searchInput {
-  height: 50px;
-  display: flex;
-  position: relative;
-  align-items: center;
-  border-bottom: 1px solid #C4C4C4;
-  transition: all 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
-  &::after {
-    content: "";
-    position: absolute;
-    left: 0;
-    width: 0;
-    bottom: 0;
-    height: 1px;
-    background: #000;
-    transition: all 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
-  }
-  &:hover::after {
-    width: 100%;
-  }
-  &.focus {
-    padding: 0 15px;
-    background-color: #fff;
-    border-bottom: 1px solid transparent;
-    &::after {
-      width: 0;
-    }
-    .input {
-      width: 580px;
-    }
-    .cancel {
-      display: block;
-    }
-  }
-}
-
-.input {
-  width: 200px;
-  transition: all 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
-}
-
-.cancel {
-  display: none;
-  color: #656872;
-  cursor: pointer;
-  transition: all 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
-  &:hover {
-    color: #000;
-  }
-}

src/tenants-ui/Icon/index.jsx → src/tenants-ui/SgIcon/index.jsx