修改新需求

dev
陈博文 3 years ago
parent d331ae58a4
commit c06ef2e9dc

@ -4,7 +4,7 @@ let publicPath = process.env.NODE_ENV === 'development' ? '/' : '/react/build/';
export default defineConfig({
publicPath,
title: '管理基础设施',
title: false,
nodeModulesTransform: {
type: 'none',
},

@ -48,6 +48,15 @@
}
}
.s0 {
flex: 0 0 50px !important;
text-align: center !important;
> i {
cursor: pointer;
}
}
.s1 {
flex: 1 !important;
}

@ -1,8 +1,21 @@
import styles from './index.less';
import { message, Input, Button, Row, Modal, Form, Tabs, Empty } from 'antd';
import {
message,
Input,
Button,
Row,
Modal,
Form,
Table,
Empty,
Col,
Select,
DatePicker,
} from 'antd';
import Fetch from '@/utils/fetch';
import { useEffect, useState, FC, Fragment, useRef } from 'react';
import { cloneDeep } from 'lodash';
import { ColumnsType } from 'antd/lib/table';
const testData = {
id: 1,
@ -26,7 +39,7 @@ const testData = {
cProgress: 0,
};
const Progress = ({ item, onFinish, start }: any) => {
const Progress = ({ item, onFinish, start, setVisible }: any) => {
const [data, setData] = useState<any>({});
const timer = useRef<any>(null);
const dataSave = useRef<any>({});
@ -88,6 +101,12 @@ const Progress = ({ item, onFinish, start }: any) => {
<div className={styles.s2}>
<div className={styles.s1}>{data.deviceId}</div>
<div className={styles.s2}>{data.name}</div>
<div className={styles.s0}>
<i
onClick={() => setVisible(true)}
className="iconfont icon-bianji10"
/>
</div>
</div>
<div className={styles.s1}>
<div>{data.aText}</div>
@ -100,6 +119,9 @@ const Progress = ({ item, onFinish, start }: any) => {
</div>
<div className={styles.t}>{data.aProgress}%</div>
</div>
<div className={styles.s0}>
<i className="iconfont icon-bianji10" />
</div>
</div>
<div className={styles.s1}>
<div>{data.bText}</div>
@ -112,6 +134,9 @@ const Progress = ({ item, onFinish, start }: any) => {
</div>
<div className={styles.t}>{data.bProgress}%</div>
</div>
<div className={styles.s0}>
<i className="iconfont icon-bianji10" />
</div>
</div>
<div className={styles.s1}>
<div>{data.cText}</div>
@ -124,6 +149,9 @@ const Progress = ({ item, onFinish, start }: any) => {
</div>
<div className={styles.t}>{data.cProgress}%</div>
</div>
<div className={styles.s0}>
<i className="iconfont icon-bianji10" />
</div>
</div>
</div>
);
@ -134,10 +162,16 @@ const Page = () => {
const [disabled, setDisabled] = useState<boolean>(false);
const [start, setStart] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
const [visible, setVisible] = useState<any>(false);
const [modalData, setModalData] = useState<any>([]);
const [modalSelectKey, setModalSelectKey] = useState<any>([]);
const resizeBar = useRef<any>(null);
const resizeBox = useRef<any>(null);
const iframeBox = useRef<any>(null);
const dataSave = useRef<any>([]);
const [form] = Form.useForm();
console.log(data, 'data');
@ -154,7 +188,7 @@ const Page = () => {
const getData = (e: any) => {
if (e.origin === 'https://edu-xnfz.educoder.net') {
// alert(e.data)
console.log(e.data, 22222);
let newData: any = [];
try {
if (e.data) {
@ -284,6 +318,40 @@ const Page = () => {
}
};
const handleModalFinish = async (v: any) => {
console.log(v, 222);
};
const getModalData = async (p: any) => {};
const columns: ColumnsType<any> = [
{
width: 120,
title: '编号',
align: 'center',
dataIndex: 'index',
},
{
title: '设备物理标识',
dataIndex: 'number',
},
{
title: '注册时间',
dataIndex: 'beginTime',
},
{
width: 120,
title: '状态',
dataIndex: 'status',
render: (v: any, r: any) =>
v === '1' ? (
<span style={{ color: 'green' }}></span>
) : (
<span></span>
),
},
];
return (
<div className={styles.page}>
<iframe
@ -312,59 +380,31 @@ const Page = () => {
<div className={styles.s2}>
<div className={styles.s1}></div>
<div className={styles.s2}></div>
<div className={styles.s0}></div>
</div>
<div className={styles.s1}>
<div></div>
<div></div>
<div className={styles.s0}></div>
</div>
<div className={styles.s1}>
<div></div>
<div></div>
<div className={styles.s0}></div>
</div>
<div className={styles.s1}>
<div></div>
<div></div>
<div className={styles.s0}></div>
</div>
</div>
{/* <div className={styles.row}>
<div className={styles.s2}>
<div className={styles.s1}>1</div>
<div className={styles.s2}>MPT574_179064679</div>
</div>
<div className={styles.s1}>
<div></div>
<div className={styles.progress}>
<div className={styles.pw}>
<span style={{ width: `${num}%` }} className={styles.p}></span>
</div>
<div className={styles.t}>{num}%</div>
</div>
</div>
<div className={styles.s1}>
<div></div>
<div className={styles.progress}>
<div className={styles.pw}>
<span style={{ width: `${num}%` }} className={styles.p}></span>
</div>
<div className={styles.t}>{num}%</div>
</div>
</div>
<div className={styles.s1}>
<div></div>
<div className={styles.progress}>
<div className={styles.pw}>
<span style={{ width: `${num}%` }} className={styles.p}></span>
</div>
<div className={styles.t}>{num}%</div>
</div>
</div>
</div> */}
{!!data.length ? (
data.map((e: any) => (
<Progress
key={e.id}
item={e}
start={start}
setVisible={setVisible}
onFinish={handleFinish}
/>
))
@ -383,6 +423,100 @@ const Page = () => {
</Button>
</div>
</div>
<Modal
centered
title="设备详细信息"
visible={visible}
okText="确认"
width={924}
afterClose={() => {
form.resetFields();
setModalSelectKey([]);
setModalData([]);
}}
cancelText="取消"
onOk={() => {
setVisible(false);
}}
onCancel={() => {
setVisible(false);
}}
>
<Form
form={form}
colon={false}
onFinish={handleModalFinish}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<Row align="middle">
<Col span={12}>
<Form.Item label="装备类型" name="type" initialValue={''}>
<Select>
<Select.Option key={''}></Select.Option>
<Select.Option key={'电脑'}></Select.Option>
<Select.Option key={'键盘'}></Select.Option>
<Select.Option key={'显示器'}></Select.Option>
</Select>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="注册时间" name="deviceId" initialValue={''}>
<DatePicker style={{ width: 328 }} />
</Form.Item>
</Col>
</Row>
<Row align="middle">
<Col span={12}>
<Form.Item label="资源状态" name="status" initialValue={''}>
<Select>
<Select.Option key={''}></Select.Option>
<Select.Option key={'已分发'}></Select.Option>
<Select.Option key={'未分发'}></Select.Option>
</Select>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="铭牌号" name="num" initialValue={''}>
<Input />
</Form.Item>
</Col>
</Row>
<Row justify="end">
<Form.Item>
<Button
className="mr20"
onClick={() => {
form.resetFields();
getModalData({});
}}
>
</Button>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">
</Button>
</Form.Item>
</Row>
</Form>
<Table
dataSource={modalData}
rowSelection={{
type: 'checkbox',
selectedRowKeys: modalSelectKey,
onChange: (selectedRowKeys: any[], selectedRows: any[]) => {
setModalSelectKey(selectedRowKeys);
},
}}
bordered={false}
rowKey="id"
columns={columns}
scroll={{ y: 400 }}
pagination={false}
/>
</Modal>
</div>
);
};

@ -54,6 +54,24 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe9e3;</span>
<div class="name">批量删除备份</div>
<div class="code-name">&amp;#xe9e3;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xea4b;</span>
<div class="name">编辑</div>
<div class="code-name">&amp;#xea4b;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe671;</span>
<div class="name">附件</div>
<div class="code-name">&amp;#xe671;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe7c4;</span>
<div class="name">光标</div>
@ -366,12 +384,12 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.eot?t=1660800866982'); /* IE9 */
src: url('iconfont.eot?t=1660800866982#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660800866982') format('woff2'),
url('iconfont.woff?t=1660800866982') format('woff'),
url('iconfont.ttf?t=1660800866982') format('truetype'),
url('iconfont.svg?t=1660800866982#iconfont') format('svg');
src: url('iconfont.eot?t=1662519548491'); /* IE9 */
src: url('iconfont.eot?t=1662519548491#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1662519548491') format('woff2'),
url('iconfont.woff?t=1662519548491') format('woff'),
url('iconfont.ttf?t=1662519548491') format('truetype'),
url('iconfont.svg?t=1662519548491#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -397,6 +415,33 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-piliangshanchubeifen"></span>
<div class="name">
批量删除备份
</div>
<div class="code-name">.icon-piliangshanchubeifen
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-bianji10"></span>
<div class="name">
编辑
</div>
<div class="code-name">.icon-bianji10
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-fujian"></span>
<div class="name">
附件
</div>
<div class="code-name">.icon-fujian
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-guangbiao"></span>
<div class="name">
@ -865,6 +910,30 @@
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-piliangshanchubeifen"></use>
</svg>
<div class="name">批量删除备份</div>
<div class="code-name">#icon-piliangshanchubeifen</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-bianji10"></use>
</svg>
<div class="name">编辑</div>
<div class="code-name">#icon-bianji10</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fujian"></use>
</svg>
<div class="name">附件</div>
<div class="code-name">#icon-fujian</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-guangbiao"></use>

@ -1,11 +1,11 @@
@font-face {
font-family: "iconfont"; /* Project id 3579477 */
src: url('iconfont.eot?t=1660800866982'); /* IE9 */
src: url('iconfont.eot?t=1660800866982#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1660800866982') format('woff2'),
url('iconfont.woff?t=1660800866982') format('woff'),
url('iconfont.ttf?t=1660800866982') format('truetype'),
url('iconfont.svg?t=1660800866982#iconfont') format('svg');
src: url('iconfont.eot?t=1662519548491'); /* IE9 */
src: url('iconfont.eot?t=1662519548491#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff2?t=1662519548491') format('woff2'),
url('iconfont.woff?t=1662519548491') format('woff'),
url('iconfont.ttf?t=1662519548491') format('truetype'),
url('iconfont.svg?t=1662519548491#iconfont') format('svg');
}
.iconfont {
@ -16,6 +16,18 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-piliangshanchubeifen:before {
content: "\e9e3";
}
.icon-bianji10:before {
content: "\ea4b";
}
.icon-fujian:before {
content: "\e671";
}
.icon-guangbiao:before {
content: "\e7c4";
}

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -5,6 +5,27 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "27904347",
"name": "批量删除备份",
"font_class": "piliangshanchubeifen",
"unicode": "e9e3",
"unicode_decimal": 59875
},
{
"icon_id": "29889324",
"name": "编辑",
"font_class": "bianji10",
"unicode": "ea4b",
"unicode_decimal": 59979
},
{
"icon_id": "826201",
"name": "附件",
"font_class": "fujian",
"unicode": "e671",
"unicode_decimal": 58993
},
{
"icon_id": "17272329",
"name": "光标",

@ -14,6 +14,12 @@
/>
<missing-glyph />
<glyph glyph-name="piliangshanchubeifen" unicode="&#59875;" d="M0 676.571429h1024v-73.142858H0zM899.657143-128H124.342857V618.057143h73.142857V-54.857143h629.028572V618.057143h73.142857zM292.571429 896h438.857142v-73.142857H292.571429zM358.4 618.057143h73.142857v-709.485714h-73.142857zM592.457143 618.057143h73.142857v-709.485714h-73.142857z" horiz-adv-x="1024" />
<glyph glyph-name="bianji10" unicode="&#59979;" d="M936.228571 384H877.714286c-7.314286 0-7.314286-7.314286-7.314286-7.314286v-351.085714H153.6V742.4h351.085714L512 749.714286v65.828571V822.857143H109.714286c-7.314286 0-21.942857 0-29.257143-7.314286s-7.314286-21.942857-7.314286-29.257143v-804.571428c0-14.628571 14.628571-36.571429 36.571429-36.571429h804.571428c7.314286 0 14.628571 7.314286 21.942857 7.314286 7.314286 7.314286 7.314286 14.628571 7.314286 21.942857V376.685714c7.314286 7.314286 0 7.314286-7.314286 7.314286zM336.457143 362.057143v-131.657143c0-7.314286 0-7.314286 7.314286-14.628571s7.314286-7.314286 14.628571-7.314286H497.371429L950.857143 661.942857V676.571429l-138.971429 146.285714h-14.628571L336.457143 362.057143c7.314286 0 0 0 0 0z m73.142857-29.257143L804.571429 727.771429l51.2-51.2-394.971429-387.657143h-51.2v43.885714z" horiz-adv-x="1024" />
<glyph glyph-name="fujian" unicode="&#58993;" d="M902.656 389.079c-1.044-1.004-2.13-2.068-3.256-3.256l-371.241-371.343c-0.942-0.655-1.802-1.475-2.642-2.314-92.57-89.682-241.684-88.617-332.8 2.519-91.279 91.238-92.18 240.62-2.048 333.107 6.349 6.431 421.356 421.765 425.513 425.923 65.004 64.922 170.701 64.922 235.643 0 31.293-31.355 48.62-73.052 48.62-117.453-0.082-44.564-17.49-86.446-49.070-117.924l-427.233-427.151c-36.065-32.748-91.156-31.355-125.747 3.215-34.591 34.529-35.717 89.825-2.683 125.891 0.635 0.594 1.188 1.311 1.679 2.068l0.143 0.061c0.164 0.164 0.307 0.307 0.43 0.451l1.085 1.106c0.082 0.061 0.205 0.102 0.307 0.266l371.425 371.446c9.81 9.83 9.81 25.743 0 35.594-9.81 9.83-25.784 9.83-35.615 0l-372.879-372.838c-0.287-0.307-0.635-0.635-0.963-0.983l-4.178-4.116c-1.659-1.638-3.011-3.523-4.116-5.489-45.65-55.972-42.004-137.523 9.646-189.153 53.924-53.821 139.899-55.726 195.953-4.28 0.225 0.225 0.492 0.451 0.758 0.696l427.54 427.54c41.124 40.98 63.775 95.539 63.775 153.58 0.041 57.856-22.385 112.23-63.304 153.068-84.562 84.541-222.29 84.541-306.913 0l-425.349-425.718c-0.164-0.225-0.348-0.389-0.492-0.553v0c-109.404-112.067-108.319-293.315 2.396-403.948 55.808-55.828 129.516-83.763 203.264-83.763 71.352 0 142.848 26.173 198.124 78.643 0.43 0.307 0.819 0.696 1.208 1.004 0.43 0.369 0.717 0.696 1.147 1.065l2.683 2.58c0.102 0.164 0.184 0.164 0.307 0.328l371.405 371.446c0.041 0.061 0.184 0.266 0.225 0.328 0.635 0.512 1.188 1.208 1.925 1.843 10.015 9.544 10.486 25.416 1.004 35.533-9.646 10.056-25.58 10.527-35.676 0.983v0 0zM902.656 389.079z" horiz-adv-x="1024" />
<glyph glyph-name="guangbiao" unicode="&#59332;" d="M0 541.675558m59.054074 0l1653.514063 0q59.054074 0 59.054074-59.054074l0 0q0-59.054074-59.054074-59.054074l-1653.514063 0q-59.054074 0-59.054074 59.054074l0 0q0 59.054074 59.054074 59.054074ZM874.827048 891.629999a29.527037 29.527037 0 0 0 21.909061 0l437.000145-174.859113a29.527037 29.527037 0 0 0-10.925003-56.987181h-874.000291a29.527037 29.527037 0 0 0-10.984058 56.928127zM896.795163 73.61297a29.527037 29.527037 0 0 0-21.909061 0l-437.000146 174.859112a29.527037 29.527037 0 0 0 10.925004 56.987181h874.000291a29.527037 29.527037 0 0 0 10.984057-56.928127z" horiz-adv-x="2194" />
<glyph glyph-name="xiazai" unicode="&#58992;" d="M620.8 51.2c-6.4 0-12.8 0-19.2 6.4l-172.8 128 32 32 160-121.6 160 121.6 38.4-32-179.2-128c-6.4-6.4-12.8-6.4-19.2-6.4zM268.8 96H128c-51.2 0-96 44.8-96 96V768C32 819.2 76.8 864 128 864h576c51.2 0 96-44.8 96-96v-140.8h-64V768c0 19.2-12.8 32-32 32H128c-19.2 0-32-12.8-32-32v-576c0-19.2 12.8-32 32-32h140.8v-64zM896-96H320c-51.2 0-96 44.8-96 96V576c0 51.2 44.8 96 96 96h576c51.2 0 96-44.8 96-96v-576c0-51.2-44.8-96-96-96z m-576 704c-19.2 0-32-12.8-32-32v-576c0-19.2 12.8-32 32-32h576c19.2 0 32 12.8 32 32V576c0 19.2-12.8 32-32 32H320zM582.4 480h64v-403.2h-64z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save