修改指向后台的url及优化代码结构

This commit is contained in:
何童崇 2021-06-25 13:15:35 +08:00
parent c36925c136
commit 8594168d33
10 changed files with 28 additions and 86 deletions

14
jsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"educoder": ["./src/common/educoder.js"],
"forge":["./src/forge"],
"military":["./src/military"],
}
},
"exclude": [
"node_modules",
"build"
]
}

View File

@ -1,29 +0,0 @@
import React, { useEffect, useState } from 'react';
import classNames from 'classnames';
import './index.scss';
export default (props) => {
const { title, options, changeOptionId, type } = props;
const [option, setOption] = useState({ code: "", dicItemName: "" ,dicItemCode:""});
useEffect(() => {
changeOptionId(option, type);
}, [option])
return (
<div className="shop-box">
<div className="choose-title">{title}</div>
<div className="choose-list">
<div className={classNames({ "choose-item-checked": option.code === "", "choose-item": true })} key={"all"} onClick={() => { setOption({ code: "", dicItemName: "" }) }}>全部</div>
{
options.map((item) => {
return <div className={classNames({ "choose-item-checked": option.code === item.code, "choose-item": true })} key={item.dicItemName} onClick={() => { setOption(item) }} >{item.dicItemName}</div>
})
}
</div>
</div>
)
}

View File

@ -1,41 +0,0 @@
.nav-content {
margin:20px 0;
background: #fff;
border-bottom: 1px solid #eaeaea;
box-shadow: #ddd 0px 0px 5px;
}
.shop-box {
width: 1280px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: start;
}
.choose-title {
width: 110px;
background: #f3f3f3;
text-align: center;
padding: 16px 0;
font-size: 14px;
color: #666;
font-weight: 600;
}
.choose-list {
width: 1170px;
padding: 16px 0;
display: flex;
justify-content: start;
}
.choose-item {
font-size: 14px;
text-align: center;
padding: 0 15px ;
cursor: pointer;
&:hover{
color: #0072ff;
}
}
.choose-item-checked {
color: #0072ff;
}

View File

@ -2,17 +2,12 @@ import { notification } from 'antd';
import axios from 'axios';
import cookie from 'react-cookies';
// export const httpUrl='http://117.50.100.12:8001';
// export const httpUrl='http://192.168.31.72:8081';
// export const httpUrl='http://192.168.31.72:8083';
// export const httpUrl = 'http://106.75.31.211:58088'; //可视化
export const httpUrl = 'http://117.50.100.12:8008'; //公告
// export const httpUrl = 'http://117.50.100.12:8009'; //公告
// export const httpUrl = 'http://117.50.100.12:8008'; //测试环境
export const httpUrl = 'https://info.osredm.com/'; //生产环境
// const TokenKey = 'autologin_forge_military';
const TokenKey = 'autologin_trustie';
const TokenKey = 'autologin_forge_military';
axios.defaults.withCredentials = true;
// 创建axios实例

View File

@ -1,4 +1,4 @@
import fetch from '../../fetch';
import fetch from '../fetch';
import { notification } from 'antd';

View File

@ -1,5 +1,5 @@
import React from 'react';
import { NewSvg } from '../../notice/svg';
import { NewSvg } from '../../svg';
import './index.scss';
export default (props) => {
const { list, itemClick, } = props;

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import { Icon, } from 'antd';
import { Link } from "react-router-dom";
import { httpUrl } from '../../../fetch';
import { httpUrl } from '../../fetch';
import { getNoticeDetail } from '../api';
import { noticeType } from '../static';
import './index.scss';

View File

@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import classNames from 'classnames';
import { Pagination, Icon, Input, Tabs } from 'antd';
import { Link } from "react-router-dom";
import ItemList from '../../components/itemList';
import ItemList from '../components/itemList';
import Nodata from '../../../forge/Nodata';
import Loading from "../../../Loading";
import { AbandonSvg, AllSvg, ChangeSvg, CheckSvg } from '../svg';
@ -220,7 +220,7 @@ export default (props) => {
list={noticeList}
itemClick={noticeClick}
/>
{noticeList.length > 0 ? <div className="edu-txt-center mt10">
{noticeList.length > 0 ? <div className="edu-txt-center mt30 mb30">
<Pagination
showQuickJumper
onChange={(page) => { setCurPage(page) }}
@ -265,7 +265,7 @@ export default (props) => {
list={noticeList}
itemClick={noticeClick}
/>
{noticeList.length > 0 ? <div className="edu-txt-center mt10">
{noticeList.length > 0 ? <div className="edu-txt-center mt30 mb30">
<Pagination
showQuickJumper
onChange={(page) => { setCurPage(page) }}
@ -308,7 +308,7 @@ export default (props) => {
list={noticeList}
itemClick={noticeClick}
/>
{noticeList.length > 0 ? <div className="edu-txt-center mt10">
{noticeList.length > 0 ? <div className="edu-txt-center mt30 mb30">
<Pagination
showQuickJumper
onChange={(page) => { setCurPage(page) }}

View File

@ -62,6 +62,9 @@
align-items: center;
font-size: 1rem;
font-weight: bold;
svg{
margin-right: .25em;
}
}
}