Skip to content

Commit

Permalink
第二次提交
Browse files Browse the repository at this point in the history
  • Loading branch information
tallgao committed Aug 5, 2023
1 parent 4d52bd1 commit 5526d47
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 25 deletions.
59 changes: 42 additions & 17 deletions src/pages/PublishInfo/compounents/buttona.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import styles from './buttona.module.css'
import { Button, Input, DatePicker, Form, Select, Space, Table, Tag } from 'antd';
const { Column, ColumnGroup } = Table;
interface DataType {
key: React.Key;
people: string;
time: number;
name: string;
num: number;
endnum: number;
}

const OtherPage = ({ history }) => {
const handleGoBack = () => {
history.goBack();
};

const HomePage = () => {
const [data, setData] = useState(null);
useEffect(() => {
fetch('https://api.example.com/data') // 替换为你的GET请求地址
.then(response => response.json())
.then(data => setData(data));
}, []);
}

var data = [
{
title: '主讲',
Expand All @@ -35,10 +42,35 @@ var data = [
dataIndex: 'endnum',
key: 'endnum',
},];
const ButtonA = () => {
const ButtonA = () => {
var setData=(data)=>{
var tbody=document.querySelector('tbody');
for(var i=0;i<data.length;i++){
var tr=document.createElement('tr');
tbody.appendChild(tr);
for(var key in data[i]){
var td=document.createElement('td');
td.innerHTML=data[i][key];
tr.appendChild(td);
}

var td =document.createElement('td');
td.innerHTML='<a href="javascript:;">删除</a>';
tr.appendChild(td);
}
var as=document.querySelectorAll('a');
for(var i=0;i<as.length;i++){
as[i].onclick=function(){
tbody.removeChild(this.parentNode.parentNode);
}
}
}



return (
<div>
<Button>返回</Button>
<Button onClick={handleGoBack} >返回</Button>
<Form
labelCol={{ span: 4 }}
wrapperCol={{ span: 14 }}
Expand Down Expand Up @@ -81,13 +113,6 @@ const ButtonA = () => {
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
Expand Down
16 changes: 8 additions & 8 deletions src/pages/PublishInfo/compounents/buttonb.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ const OtherPage = ({ history }) => {
const handleGoBack = () => {
history.goBack();
};
const HomePage = () => {
const [data, setData] = useState(null);

useEffect(() => {
fetch('https://api.example.com/data') // 替换为你的GET请求地址
.then(response => response.json())
.then(data => setData(data));
}, []);
const HomePage = () => {
const [data, setData] = useState(null);

useEffect(() => {
fetch('https://api.example.com/data') // 替换为你的GET请求地址
.then(response => response.json())
.then(data => setData(data));
}, []);
}
const ButtonB = () => {
var box = document.getElementById("box")
var table = document.createElement("table")
Expand Down

0 comments on commit 5526d47

Please sign in to comment.