Commit 9d412483 authored by 徐乐's avatar 徐乐

feat: 修改

parent 055e748e
......@@ -66,14 +66,14 @@ const AlarmScrollAssembly = (props) => {
userAccess: true,
});
const [realTimeDataList, setRealTimeDataList] = useState(null);
const getDeviceNumber = () => {
return monitorService.getEquipmentInfo({
deviceTypes: props.deviceType,
pageIndex: 1,
pageSize: 1,
...constanceRef.current,
});
};
// const getDeviceNumber = () => {
// return monitorService.getEquipmentInfo({
// deviceTypes: props.deviceType,
// pageIndex: 1,
// pageSize: 1,
// ...constanceRef.current,
// });
// };
const getRealTimeData = (pagination) => {
return monitorService.GetAlarmListRealTime({
deviceType: props.deviceType,
......@@ -86,7 +86,7 @@ const AlarmScrollAssembly = (props) => {
});
};
const getData = async () => {
let firstRequest = await getDeviceNumber();
// let firstRequest = await getDeviceNumber();
let secondRequest = await getRealTimeData({
pageIndex: 1,
// pageSize: firstRequest.data.totalCount,
......
table{
width: 100%;
}
thead{
width: 100%;
}
thead tr{
display: table;
width: 100%;
table-layout: fixed;
line-height: 30px;
}
tbody{
width: 100%;
display: block;
}
tbody tr{
display: table;
width: 100%;
table-layout: fixed;
line-height: 30px;
}
thead tr th{
text-align: center;
}
tbody tr td{
text-align: center;
}
.addBox{
display: flex;
justify-content: center;
}
.inputPublic{
width: 120px;
height: 32px;
border: 1px solid #ccc;
border-radius: 3px;
padding: 0 5px;
margin-right: 20px;
outline: none;
}
.addBtn{
width: 60px;
height: 32px;
text-align: center;
border: 1px solid #ccc;
border-radius: 3px;
line-height: 32px;
cursor: pointer;
}
\ No newline at end of file
import React from 'react';
// eslint-disable-next-line no-unused-vars
import Table from './index';
import './demo.css';
const head = ['序号', '名字', '性别', '年龄'];
class Alphabet extends React.Component {
constructor(props) {
super(props);
this.state = {
data: [
{
index: 1,
name: '张三',
sex: '男',
age: '16',
},
],
};
this.addUser = this.addUser.bind(this);
}
addUser() {
const {data} = this.state;
data.push({
index: this.state.data.length + 1,
name: this.refs.inputName.value,
sex: this.refs.inputSex.value,
age: this.refs.inputAge.value,
});
this.setState(() => ({
data,
}));
this.refs.inputName.value = '';
this.refs.inputSex.value = '';
this.refs.inputAge.value = '';
}
render() {
return (
<>
<div className="addBox">
<input className="inputPublic inputName" ref="inputName" type="text" placeholder="姓名" />
<input className="inputPublic inputSex" ref="inputSex" type="text" placeholder="性别" />
<input className="inputPublic inputAge" ref="inputAge" type="text" placeholder="年龄" />
<p className="addBtn" onClick={this.addUser}>
添加
</p>
</div>
<Table dataSource={this.state.data} header={head} />
</>
);
}
}
export default Alphabet;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment