diff --git a/.umirc.ts b/.umirc.ts index d82f5c0..dccf9cc 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -99,6 +99,10 @@ export default defineConfig({ path: '/manager/basicManager/allotment', component: '@/pages/Manager/BasicManager/List/Allotment', }, + { + path: '/manager/basicManager/demand', + component: '@/pages/Manager/BasicManager/List/Demand', + }, { component: '@/pages/HttpStatus/404' }, ], }, diff --git a/src/pages/Encrypt/List/Index/index.less b/src/pages/Encrypt/List/Index/index.less index 62ca760..18f16f3 100644 --- a/src/pages/Encrypt/List/Index/index.less +++ b/src/pages/Encrypt/List/Index/index.less @@ -15,7 +15,7 @@ height: 44px; display: flex; align-items: center; - font-size: 14px; + font-size: 16px; font-weight: 400; color: #464f66; padding: 20px 0; @@ -36,7 +36,7 @@ i { padding-right: 10px; - font-size: 14px; + font-size: 16px; } } diff --git a/src/pages/Equipment/List/Index/index.less b/src/pages/Equipment/List/Index/index.less index 93e2bbe..a4968fb 100644 --- a/src/pages/Equipment/List/Index/index.less +++ b/src/pages/Equipment/List/Index/index.less @@ -15,7 +15,7 @@ height: 44px; display: flex; align-items: center; - font-size: 14px; + font-size: 16px; font-weight: 400; color: #464f66; padding: 20px 0; @@ -36,7 +36,7 @@ i { padding-right: 10px; - font-size: 14px; + font-size: 16px; } } diff --git a/src/pages/Manager/BasicManager/List/Demand/index.less b/src/pages/Manager/BasicManager/List/Demand/index.less new file mode 100644 index 0000000..856fb32 --- /dev/null +++ b/src/pages/Manager/BasicManager/List/Demand/index.less @@ -0,0 +1,53 @@ +.page { + .title { + height: 36px; + background: #e3effc; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20px; + font-weight: 500; + color: #464f66; + + i { + cursor: pointer; + } + } + + .btn { + padding: 13px 20px; + + i { + font-size: 14px; + margin-right: 5px; + } + } + + .action { + cursor: pointer; + color: #6b758b; + padding: 0 10px; + + &:hover { + color: @primary-color; + } + } +} + +.li { + border-bottom: 1px solid #f5f5f5; + padding-bottom: 10px; + margin-bottom: 10px; + + .name { + font-size: 14px; + font-weight: bold; + color: #333; + } +} + +.li:last-child { + border-bottom: 0; + margin-bottom: 0; + padding-bottom: 0; +} diff --git a/src/pages/Manager/BasicManager/List/Demand/index.tsx b/src/pages/Manager/BasicManager/List/Demand/index.tsx new file mode 100644 index 0000000..885b027 --- /dev/null +++ b/src/pages/Manager/BasicManager/List/Demand/index.tsx @@ -0,0 +1,214 @@ +import styles from './index.less'; +import { + Button, + Select, + Row, + Modal, + Form, + message, + Empty, + Table, + InputNumber, + Input, + Col, + DatePicker, +} from 'antd'; +import Fetch from '@/utils/fetch'; +import { useEffect, useState, FC, useRef, Fragment } from 'react'; +import { ColumnsType } from 'antd/lib/table'; +const RangePicker: any = DatePicker.RangePicker; +import moment from 'moment'; + +interface PageProps {} + +const Page: FC = () => { + const [data, setData] = useState([]); + const [loading, setLoading] = useState(true); + const [total, setTotal] = useState(0); + const [deviceList, setDeviceList] = useState([]); + const [form] = Form.useForm(); + let [params, setParams] = useState({ + pageNumber: 1, + pageSize: 20, + }); + + useEffect(() => { + getData(params); + getDeviceList(); + }, []); + + const getData = async (record: any) => { + setLoading(true); + const res = await Fetch('/openi/device/page', { + method: 'get', + params: record, + }); + if (res.result === 'success') { + setData(res?.data?.[0]?.list); + setTotal(res?.data?.[0]?.total); + } + setLoading(false); + }; + + const getDeviceList = async () => { + const res = await Fetch('/openi/deviceType/list'); + if (res.result === 'success') { + const data = res?.data?.[0]; + setDeviceList(data); + } + }; + + const columns: ColumnsType = [ + { + title: '序号', + align: 'center', + dataIndex: 'index', + render: (text: string, record: any, index: number) => + params.pageSize * (params.pageNumber - 1) + index + 1, + }, + { + title: '装备型号', + dataIndex: 'deviceType', + render: (v: any) => v?.name, + }, + { + title: '装备名称', + dataIndex: 'name', + }, + { + title: '铭牌编号', + dataIndex: 'deviceId', + }, + { + title: '管理标识', + dataIndex: 'sign', + render: (v: any) => v || '--', + }, + { + title: '生产厂商', + dataIndex: 'producer', + render: (v: any) => v?.name, + }, + ]; + + const handleChangePage = (param: any) => { + params.pageNumber = param?.current; + params.pageSize = param?.pageSize; + setParams({ ...params }); + getData(params); + }; + + const handleFinish = async (v: any) => { + params = { ...params, ...v }; + if (v.time) { + params.startDate = moment(v?.time?.[0]).format('YYYY-MM-DD HH:mm:ss'); + params.endDate = moment(v?.time?.[1]).format('YYYY-MM-DD HH:mm:ss'); + } + delete params.time; + setParams({ ...params }); + getData(params); + }; + + return ( +
+
+ 信息查询 + getData(params)} + className="iconfont icon-a-shuaxin2" + /> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ ( + + 共{total}条数据 + + ), + }} + /> + + ); +}; +export default Page; diff --git a/src/pages/Manager/BasicManager/index.less b/src/pages/Manager/BasicManager/index.less index 72443c4..a545fd7 100644 --- a/src/pages/Manager/BasicManager/index.less +++ b/src/pages/Manager/BasicManager/index.less @@ -15,7 +15,7 @@ height: 44px; display: flex; align-items: center; - font-size: 14px; + font-size: 16px; font-weight: 400; color: #464f66; padding: 20px 0; @@ -36,7 +36,7 @@ i { padding-right: 10px; - font-size: 14px; + font-size: 16px; } } diff --git a/src/pages/Manager/BasicManager/index.tsx b/src/pages/Manager/BasicManager/index.tsx index 43570e3..1ddcf8c 100644 --- a/src/pages/Manager/BasicManager/index.tsx +++ b/src/pages/Manager/BasicManager/index.tsx @@ -30,6 +30,11 @@ const Page = ({ ...props }) => { name: '信息统计', key: '2', }, + { + icon: 'iconfont icon-chaxun', + name: '信息查询', + key: '/demand', + }, ]; return ( diff --git a/src/pages/Manager/PasswordManager/index.less b/src/pages/Manager/PasswordManager/index.less index 1a945ac..5549243 100644 --- a/src/pages/Manager/PasswordManager/index.less +++ b/src/pages/Manager/PasswordManager/index.less @@ -15,7 +15,7 @@ height: 44px; display: flex; align-items: center; - font-size: 14px; + font-size: 16px; font-weight: 400; color: #464f66; padding: 20px 0; @@ -36,7 +36,7 @@ i { padding-right: 10px; - font-size: 14px; + font-size: 16px; } } diff --git a/src/styles/iconfont/demo_index.html b/src/styles/iconfont/demo_index.html index 2e394fa..c29859f 100644 --- a/src/styles/iconfont/demo_index.html +++ b/src/styles/iconfont/demo_index.html @@ -54,6 +54,12 @@
    +
  • + +
    查询
    +
    
    +
  • +
  • 统计
    @@ -390,12 +396,12 @@
    @font-face {
       font-family: 'iconfont';
    -  src: url('iconfont.eot?t=1663756037950'); /* IE9 */
    -  src: url('iconfont.eot?t=1663756037950#iefix') format('embedded-opentype'), /* IE6-IE8 */
    -       url('iconfont.woff2?t=1663756037950') format('woff2'),
    -       url('iconfont.woff?t=1663756037950') format('woff'),
    -       url('iconfont.ttf?t=1663756037950') format('truetype'),
    -       url('iconfont.svg?t=1663756037950#iconfont') format('svg');
    +  src: url('iconfont.eot?t=1663901035581'); /* IE9 */
    +  src: url('iconfont.eot?t=1663901035581#iefix') format('embedded-opentype'), /* IE6-IE8 */
    +       url('iconfont.woff2?t=1663901035581') format('woff2'),
    +       url('iconfont.woff?t=1663901035581') format('woff'),
    +       url('iconfont.ttf?t=1663901035581') format('truetype'),
    +       url('iconfont.svg?t=1663901035581#iconfont') format('svg');
     }
     

    第二步:定义使用 iconfont 的样式

    @@ -421,6 +427,15 @@
      +
    • + +
      + 查询 +
      +
      .icon-chaxun +
      +
    • +
    • @@ -925,6 +940,14 @@
        +
      • + +
        查询
        +
        #icon-chaxun
        +
      • +