Commit e78e90eb authored by maple's avatar maple

[fix]设施模块修改一

parent 0cea681a
{
"CurrentProjectSetting": "无配置"
}
\ No newline at end of file
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
\ No newline at end of file
File added
......@@ -200,12 +200,12 @@ export default defineConfig({
icon:'HddOutlined',
routes: [
{
path: '/CommunityManagement/CellList',
path: './CellList',
name: 'celllist',
component:'./runTest/Template'
},
{
path: '/CommunityManagement/CommunityAnnouncement',
path: './CommunityAnnouncement',
name: 'communityannouncement',
component:'./runTest/Template'
},
......@@ -219,11 +219,11 @@ export default defineConfig({
{ path: "./Detail", component: './CommunityManagement/FacilityBookings/Detail' },
{ path: "./FacilityEdit", component: './CommunityManagement/FacilityBookings/FacilityManager' },
{ path: "./FacilityDetail", component: './CommunityManagement/FacilityBookings/FacilityManager' },
{path:"./FacilityApply",component:'./CommunityManagement/FacilityBookings/Bookings'}
{ path: "./FacilityApply",component:'./CommunityManagement/FacilityBookings/Bookings'}
]
},
{
path: '/CommunityManagement/VisitorRecord',
path: './VisitorRecord',
name: 'visitorrecord',
component:'./runTest/Template'
},
......@@ -243,12 +243,12 @@ export default defineConfig({
]
},
{
path: '/AccountManagement/CompanyInformation',
path: './CompanyInformation',
name: 'companyinformation',
component:'./AccountManagement/CompanyInformation/CompanyInformation'
},
{
path: '/AccountManagement/LanguageSettings',
path: './LanguageSettings',
name: 'languagesettings',
component:'./AccountManagement/LanguageSettings/LanguageSettings'
},
......
......@@ -21,11 +21,11 @@ export default {
},
},
pre: {
'/api/': {
target: 'http://localhost:8080',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/api/': {
// target: 'http://localhost:8080',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
'/res/': {
target: 'http://mapleonlyone.top',
changeOrigin: true,
......
No preview for this file type
......@@ -2,17 +2,28 @@ import React from 'react';
import styles from './index.less';
import {Button } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
const BackButton = () => {
const BackButton = (props:any) => {
const url = props.url;
const goToReturn = () => {
history.back()
// history.back()
history.go(-1)
}
const goToReturnByParam = () => {
console.log("跳转页面"+url)
history.push(url)
}
return (
<>
<Button onClick={goToReturn}>Back</Button>
{
url != null ?
<Button onClick={goToReturnByParam}>Back</Button>:<Button onClick={goToReturn}>Back</Button>
}
</>
);
)
};
export default BackButton;
......@@ -21,6 +21,9 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> {
const { dispatch } = this.props;
if (dispatch) {
// dispatch({
// type: 'user/deleteCurrent',
// });
dispatch({
type: 'login/logout',
});
......
......@@ -47,12 +47,13 @@ class SelectOptions extends React.Component {
this.state = {
menuList:ArrayToPingYin.get(list),
checkedListOptions:list,
checkedList: list,
checkedList: this.props.single!=null?[]:list,
indeterminate: false,
checkAll: true,
checkNone: false,
resultList:list,
flag:false
resultList:this.props.single!=null?[]:list,
flag:false,
lastValue:null
};
}else{
console.log(checklist)
......@@ -64,7 +65,8 @@ class SelectOptions extends React.Component {
checkAll: true,
checkNone: false,
resultList:checklist,
flag:false
flag:false,
lastValue:null
};
}
}
......@@ -124,6 +126,30 @@ class SelectOptions extends React.Component {
}
};
onChangeValue = (checkedList) => {
if(this.props.single!=null){
var tmp
if(checkedList.length>1){
for(var i=0;i<checkedList.length;i++){
if(checkedList[i]!=(this.state.lastValue)[0]){
tmp=checkedList[i]
}
}
this.setState({
lastValue:[tmp],
checkedList:[tmp],
resultList:[tmp]
});
}else{
tmp=checkedList
this.setState({
lastValue:checkedList,
checkedList:checkedList,
resultList:checkedList
});
}
this.props.onSubmit(tmp[0])
}else{
let difference;
var a=this.state.resultList;
var b=this.state.checkedListOptions
......@@ -140,6 +166,7 @@ class SelectOptions extends React.Component {
});
this.props.onSubmit(difference)
};
}
onCheckAllChange = e => {
this.setState({
checkedList:this.props.list,
......@@ -206,7 +233,7 @@ class SelectOptions extends React.Component {
this.state.componetVisible==this.state.selectoptionsOpen?
<>
<div style={{width:"100%",height:48, position:"relative"}}>
<div style={{ position:"absolute",left:5,top:5}}>{this.state.selectoptionsSelected}{this.state.resultList.length==this.props.list.length?this.state.selectoptionsAllCell:null}</div>
<div style={{ position:"absolute",left:5,top:5}}>{this.state.resultList.length==0?this.state.selectoptionsSelectNone:this.state.selectoptionsSelected}{this.state.resultList.length==this.props.list.length?(this.state.selectoptionsAllCell):(null)}</div>
<div style={{ position:"absolute",right:16,top:5,cursor:"pointer"}} onClick={()=>this.hideAndexpand()}>{this.state.componetVisible}<DownOutlined /></div>
</div>
<div style={{paddingLeft:15,paddingRight:15,paddingBottom:20}}>{this.state.resultList.length==this.props.list.length?null:getDotText(this.state.resultList)}</div>
......@@ -232,8 +259,13 @@ class SelectOptions extends React.Component {
})
}
</div>
{
this.props.single!=null?null:
<>
<Checkbox style={{ position:"absolute",right:130}} indeterminate={this.state.indeterminate} onChange={this.onCheckAllChange} checked={this.state.checkAll}>{this.state.selectoptionsSelectAll}</Checkbox>
<Checkbox style={{ position:"absolute",right:0}} onChange={this.onCheckAllChangeOver} checked={this.state.checkNone} >{this.state.selectoptionsSelectNone}</Checkbox>
</>
}
</div>
<div style={{width:"100%",paddingLeft:16,paddingRight:16}}>
<div style={{width:"100%",backgroundColor:"#ffffff",border:"1px solid #cfcfcf",padding:5}}>
......
This diff is collapsed.
This diff is collapsed.
/* 使用说明:(传入的参数 使用sort排序 )
import SelectOptions from '../../components/SelectOptions/index';
const printContent = (comment: any)=>{
console.log(comment)
}
<SelectOptions list={["美国","美丽的","美好","加拿大","加油","XO"].sort()} onSubmit={printContent}/>
*/
\ No newline at end of file
......@@ -62,7 +62,14 @@ const TimeSelect = (props:any) => {
const timeChange = (index: any, values: any) => {
var tmp = times;
console.log("Maple诊断"+index)
console.log(values)
if (values != null) {
tmp[index].time =timeForm(values)
} else {
tmp[index].time =null
}
props.putSubmit(CheckParm(tmp))
}
return (
......
......@@ -20,7 +20,7 @@ const TitleBack = (props:any) => {
:
<></>
}
<div className={styles.item2}><BackButton/></div>
<div className={styles.item2}><BackButton url={props.url}/></div>
<div className={styles.clear0}></div>
</>
);
......
import React, { useState } from 'react';
import React, { useState,useEffect} from 'react';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import styles from './index.less';
......@@ -14,24 +14,34 @@ import { gray } from 'chalk';
const TitleSearch= (props:any) => {
const { CommunityList } = props;
const {dispatch, CommunityList } = props;
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => {
if (CommunityList == null) {
tosCommunityget(null)
}
}, []);
const key = props.listkey
const name = props.list;
const single=props.single
const status = props.status;
const time = props.time;
const community = props.community;
const [selectOptions, setSelectOptions] = useState(true)
const [communitys, setCommunitys] = useState(CommunityList)
const [datePicker, setDate]=useState(null)
const [datePicker, setDate] = useState(null)
const onFinish = values => {
if (datePicker) {
values[time[0]] = datePicker;
}
if (community) {
values.communitydata=communitys
values[community]=communitys
}
console.log('Success:', values);
props.onSubmit(values)
......@@ -94,7 +104,12 @@ const TitleSearch= (props:any) => {
{
community != null ?
<>
<SelectOptions list={CommunityList.sort()} show={selectOptions} onSubmit={printContent} />
{
CommunityList != null ?
<SelectOptions single={single} list={CommunityList.sort()} show={selectOptions} onSubmit={printContent} />:
null
}
<Form.Item><Button type="primary" htmlType="submit" style={{ backgroundColor: "#e7f4ff",color:"rgba(24,144,255,1)"}}>Search</Button></Form.Item>
</> : null
}
......
......@@ -104,6 +104,9 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
if (dispatch) {
dispatch({
type: 'user/fetchCurrent',
playload: {
userName: "admin",
password:"admin",}
});
}
}, []);
......
import React from 'react';
import { PageLoading } from '@ant-design/pro-layout';
import { Redirect, connect, ConnectProps } from 'umi';
import { Redirect, connect, ConnectProps, StateType } from 'umi';
import { stringify } from 'querystring';
import { ConnectState } from '@/models/connect';
import { CurrentUser } from '@/models/user';
import login from '@/pages/user/login';
interface SecurityLayoutProps extends ConnectProps {
loading?: boolean;
currentUser?: CurrentUser;
login?: StateType;
}
interface SecurityLayoutState {
......@@ -23,30 +25,39 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
this.setState({
isReady: true,
});
const { dispatch } = this.props;
const { dispatch ,login} = this.props;
console.log("登录中")
if (dispatch) {
dispatch({
type: 'user/fetchCurrent',
playload: {
userName: login.userName,
password: login.password
}
});
}
}
render() {
const { isReady } = this.state;
const { children, loading, currentUser } = this.props;
const { children, loading, currentUser,login } = this.props;
// You can replace it to your authentication rule (such as check token exists)
// 你可以把它替换成你自己的登录认证规则(比如判断 token 是否存在)
const isLogin = currentUser && currentUser.userid;//isLogin为关键点
console.log("是否已登录")
// const isLogin = currentUser && currentUser.name;//isLogin为关键点
var isLogin = false
if (currentUser.name != null) {
isLogin=true
}
isLogin=true
const queryString = stringify({
redirect: window.location.href,
});
if ((!isLogin && loading) || !isReady) {
// console.log("页面加载")
return <PageLoading />;
}
if (!isLogin && window.location.pathname !== '/user/login') {
......@@ -56,7 +67,8 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
}
}
export default connect(({ user, loading }: ConnectState) => ({
export default connect(({ user, loading,login}: ConnectState) => ({
currentUser: user.currentUser,
loading: loading.models.user,
login:login
}))(SecurityLayout);
......@@ -19,8 +19,8 @@ export default {
},
reducers: {
returnPage(state, { Data,DataPage}) {
return { ...state, Data,DataPage };
returnPage(state, { Data,DataPage,DataSave}) {
return { ...state, Data,DataPage,DataSave };
},
returnPage2(state, { Data2 }) {
return { ...state, Data2 };
......@@ -39,18 +39,25 @@ export default {
},
returnSource(state, { sourceData }) {
return { ...state, sourceData };
}
},
},
effects: {
//预订设施查询
*RA({ playload }, { call, put }) {
console.log("发送请求")
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500) {
//window.location.href = '/500';
} else {
if (resp.code == 500||resp.error_code!="0000") {
// window.location.href = '/500';
}
if (resp.error_code != "0000") {
console.log("请求错误码:"+resp.error_code)
console.log(playload)
}
else {
switch (playload.index) {
case 0:
case 9:
......@@ -80,6 +87,7 @@ export default {
case 4:
case 5:
case 6: {
message.success("Success Operation!",3)
window.location.href = '/CommunityManagement/FacilityBookings';
} break;
case 7: {
......@@ -118,8 +126,12 @@ export default {
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
}
},
*CA({ playload }, { call, put }) {
var sourceData = playload
yield put({type: 'returnSource',sourceData})
}
},
};
......@@ -3,12 +3,13 @@ import { message } from 'antd';
import { routerRedux } from 'dva/router'
import { timestampToTime } from '../utils/time';
export default {
namespace: 'CommunityService',
state: {
Data: null,
CurData: null,
CurDataDetail:{community:'',address:'',home:'',name:'',phone:'',email:'',content:''},
CurDataDetail:{},
},
reducers: {
......@@ -31,9 +32,14 @@ export default {
console.log(resp)
if (resp.error_code != 0) {
window.location.href = '/500';
} else {
}
console.log(resp.error_code)
if (resp.error_code == "0000") {
let Data = resp.data.rows;
yield put({ type: 'returnPage', Data, });
} else {
let Data = null;
yield put({ type: 'returnPage', Data, });
}
},
*TosCommuntiyServiceReply({ playload }, { call, put }) {
......@@ -46,7 +52,6 @@ export default {
}
},
*TosCommunityServiceGetDetail({ playload }, { call, put }) {
const resp = yield call(service.TosCommunityServiceGetDetail, playload);
console.log(resp)
......@@ -54,7 +59,10 @@ export default {
window.location.href = '/500';
} else {
var tmp = resp.data.rows[0].tosOwerModel;
var tmp2 = resp.data.rows[0].replyContent;
var tmp2 = resp.data.rows[0];
console.log(tmp2.imgUrl)
// TODO:还差图片
var CurDataDetail = {
community: tmp.communityName,
address: tmp.addressAndpostalCode,
......@@ -62,9 +70,10 @@ export default {
name: tmp.owerName,
phone: tmp.owerPhone,
email: tmp.owerEmail,
content: tmp2,
content: resp.data.rows[0].serviceContent,
status: tmp2.handleStatus,
time:timestampToTime(tmp2.createTime.time)
};
yield put({ type: 'returnCurDataDetail', CurDataDetail, });
}
},
......
......@@ -20,8 +20,6 @@ export default {
return { ...state, CurDataFollow };
},
returnCurDataFollowDetail(state, { CurDataFollowDetail }) {
return { ...state, CurDataFollowDetail };
},
......@@ -38,11 +36,19 @@ export default {
const resp = yield call(service.TosTosServiceProviderGet, playload);
console.log(resp)
if (resp.code == 500) {
window.location.href = '/500';
} else {
// window.location.href = '/500';
}
if (resp.error_code == "0000") {
let Data = resp.data.rows;
yield put({ type: 'returnPage', Data, });
} else {
console.log("请求错误码:"+resp.error_code)
let Data = null;
console.log(playload)
yield put({ type: 'returnPage', Data, });
}
},
// 新建服务商
*TosTosServiceProviderSave({ playload }, { call, put }) {
......
......@@ -6,7 +6,7 @@ import { routerRedux } from 'dva/router'
export default {
namespace: 'Init',
state: {
CommunityList: [],
CommunityList: null,
},
reducers: {
......
import { stringify } from 'querystring';
import { history, Reducer, Effect } from 'umi';
import { AccountLogin,AccountCheckLogin } from '@/services/login';
import { AccountLogin,AccountCheckLogin,AccountOut } from '@/services/login';
import { setAuthority } from '@/utils/authority';
import { getPageQuery } from '@/utils/utils';
......@@ -10,6 +10,8 @@ export interface StateType {
type?: string;
currentAuthority?: 'user' | 'guest' | 'admin';
token?: string;
userName?: string;
password?: string;
}
export interface LoginModelType {
......@@ -30,7 +32,9 @@ const Model: LoginModelType = {
state: {
status: undefined,
token:'A',
token: 'A',
userName: '',
password:'',
},
reducers: {
......@@ -42,8 +46,8 @@ const Model: LoginModelType = {
type: payload.type,
};
},
saveToken(state, { token }) {
return{...state,token}
saveToken(state, { token,userName,password }) {
return{...state,token,userName,password}
}
},
......@@ -57,9 +61,11 @@ const Model: LoginModelType = {
// Login successfully
if (response.status === 'ok') {
console.log("登录成功")
console.log(response)
const userMessage = yield call(AccountCheckLogin, payload);//请求时间网络
console.log(userMessage)
console.log(userMessage.token)
yield put({type: 'saveToken',token: userMessage.token});
yield put({type: 'saveToken',token: userMessage.token,userName:payload.userName,password:payload.password});
const urlParams = new URL(window.location.href);
const params = getPageQuery();
let { redirect } = params as { redirect: string };
......@@ -79,9 +85,10 @@ const Model: LoginModelType = {
}
},
logout() {
*logout({},{call,put}) {
const { redirect } = getPageQuery();
// Note: There may be security issues, please note
// const response = yield call(AccountOut, payload);
if (window.location.pathname !== '/user/login' && !redirect) {
history.replace({
pathname: '/user/login',
......
......@@ -4,18 +4,13 @@ import { queryCurrent, query as queryUsers } from '@/services/user';
export interface CurrentUser {
avatar?: string;
name?: string;
title?: string;
group?: string;
signature?: string;
tags?: {
key: string;
label: string;
}[];
token?: string;
userid?: string;
unreadCount?: number;
name?: string;
permission?: [];
}
export interface UserModelState {
currentUser?: CurrentUser;
}
......@@ -26,9 +21,11 @@ export interface UserModelType {
effects: {
fetch: Effect;
fetchCurrent: Effect;
deleteCurrent: Effect;
};
reducers: {
saveCurrentUser: Reducer<UserModelState>;
deleteCurrentUser:Reducer<UserModelState>;
changeNotifyCount: Reducer<UserModelState>;
};
}
......@@ -48,13 +45,19 @@ const UserModel: UserModelType = {
payload: response,
});
},
*fetchCurrent(_, { call, put }) {
const response = yield call(queryCurrent);
*fetchCurrent({playload}, { call, put }) {
const response = yield call(queryCurrent,playload);
console.log(response)
yield put({
type: 'saveCurrentUser',
payload: response,
});
},
*deleteCurrent({playload}, { call, put }) {
yield put({
type: 'deleteCurrentUser',
});
},
},
reducers: {
......@@ -64,6 +67,12 @@ const UserModel: UserModelType = {
currentUser: action.payload || {},
};
},
deleteCurrentUser(state, action) {
return {
...state,
currentUser: {},
};
},
changeNotifyCount(
state = {
currentUser: {},
......
This diff is collapsed.
......@@ -10,12 +10,6 @@ import TitleSearch from '../../components/TitleSearch/TitleSearch';
const PropertyServices = (props: any) => {
const { formatMessage } = useIntl();
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' })
const inputProject = formatMessage({ id: 'R.charge.input.project' })
const search = formatMessage({ id: 'R.charge.search' })
const { dispatch, location, Data } = props;
const TosCommunityServiceGet = (values: any) => { dispatch({ type: 'CommunityService/TosCommunityServiceGet', playload: values }) };
const setCurData = (values: any) => { dispatch({ type: 'CommunityService/setCurData', playload: values }) };
......@@ -25,17 +19,13 @@ const PropertyServices = (props: any) => {
const [loading,setLoading]=useState(false)
const goToFunction = (value, record, e) => {
console.log(record)
setCurData(record)
history.push(location.pathname+(value==0?"/Edit":"/Detail"))
}
const goToRequest = () => {
history.push("./AccessCardApplication/Request")
}
const columns = [
{ title: "community_name",dataIndex: 'community_name',},
{ title: "ower_name",dataIndex: 'ower_name',},
......
import React, { useState, useEffect } from 'react';
import styles from './Bookings.less';
import { Input ,DatePicker,Button,Space,Pagination,message, Radio,TimePicker,Row, Col } from 'antd';
import styles from './css/Bookings.less';
import { Input ,DatePicker,Button,message, Radio,TimePicker,Row, Col } from 'antd';
const { RangePicker } = TimePicker;
import moment from 'moment';
import { Link, useIntl, connect, Dispatch } from 'umi';
import {connect } from 'umi';
import TitleBack from '../../../components/TitleBack/TitleBack';
const Bookings = (props:any) => {
const { dispatch, location, Data3,Data3Error,Data4,DataSave,token} = props;
const { dispatch, Data3,Data3Error,Data4,DataSave,token} = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
const IA = () => { dispatch({ type: 'FacilityBookings/IA' }) };
const [loading, setLoading] = useState(false);
......@@ -35,7 +35,6 @@ const Bookings = (props:any) => {
setLoading(false)
}, [Data3]);
const [radioGroupValue,setRadioGroupValue]=useState(0)
const changeRadio = () => {
}
......@@ -66,7 +65,7 @@ const Bookings = (props:any) => {
<div className={styles.box2item2}>
<Radio.Group onChange={changeRadio} defaultValue={1}>
{
Data3.map((item, index) => {
Data3.map((item:any, index:any) => {
return (
<Radio key={"Radio_" + index} value={item.categoriesId}>{item.categoriesName}</Radio>
)
......@@ -97,8 +96,8 @@ const Bookings = (props:any) => {
<div className={styles.box5item1}>Booking Schedule</div>
<div className={styles.box5item2}>
<Row gutter={8}>
<Col> <DatePicker /></Col>
<Col> <RangePicker defaultValue={moment('12:30', format)} onChange={Mitime} format={format}/></Col>
<Col><DatePicker /></Col>
<Col><RangePicker onChange={Mitime} format={format}/></Col>
</Row>
</div>
</div>
......
import React, { useState, useEffect } from 'react';
import styles from './BookingsView.less';
import styles from './css/BookingsView.less';
import { Input ,Menu,Table,Space,Pagination,Tooltip, Button, Radio } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
......
import React, { useState, useEffect,useRef } from 'react';
import styles from './index.less';
import styles from './css/index.less';
import { Input ,Menu,Table,Space,Form,Radio, Modal,Row,Col, Button } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
......@@ -9,10 +9,11 @@ import TitleBack from '../../../components/TitleBack/TitleBack';
import Line from '../../../components/Line/Line';
import { timestampToTime3 } from '../../../utils/time';
import TextArea from 'antd/lib/input/TextArea';
import { values } from 'lodash';
import {getUrlLast} from '../../../utils/string';
const Detail = (props:any) => {
const { dispatch, DataSave,DataSaveDetail,token} = props;
const { dispatch,location, DataSave,DataSaveDetail,token} = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
useEffect(() => {
......@@ -90,7 +91,7 @@ const Detail = (props:any) => {
return (
<div className={styles.base}>
<TitleBack title={"View Facility Bookings"}/>
<TitleBack title={"View Facility Bookings"} url={getUrlLast(location.pathname)+'?type=Detail'}/>
<Row gutter={8}>
<Col>预订状态</Col><Col span={2}>{statusDes[DataSave.status]}</Col>
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import styles from './css/index.less';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
......@@ -12,22 +12,24 @@ import { timestampToTime } from '../../../utils/time';
import TitleSearch from '../../../components/TitleSearch/TitleSearch';
const managerFeeStatusDes= ["未交", "已交", "已退"]
const marginFeeStatusDes = ["未交", "已交", "未退", "已退部分", "已退全部"]
const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
import { getUrlLastParams } from '../../../utils/string';
const FacilityBookings = (props:any) => {
const { formatMessage } = useIntl();
const { dispatch, location, Data, DataPage, Data2, token } = props;
const { dispatch, location, Data, Data2, token,DataSave } = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: {index:index, body:values } }) };
const SA = (values: any) => { dispatch({ type: 'FacilityBookings/SA', playload: values }) };
const CA = () => { dispatch({ type: 'FacilityBookings/CA', playload: null }) };
const [tab, setTab] = useState(location.query.Facility == "true" ? 2 : 1)
const [curSearchString,setCurSearchString]=useState({subscribeDate:null,status:null,curPage:null})
const [tab, setTab] = useState(1)
const [curPage, setCurPage] = useState(1)
const [curPage2, setCurPage2] = useState(1)
const [loading, setLoading] = useState(false)
......@@ -35,11 +37,26 @@ const FacilityBookings = (props:any) => {
const [columns2, setColumns2] = useState([])
const goToFunction = () => {
if(tab==2){CA()}
history.push(location.pathname + (tab==1?'/Booking':'/Adding'))
}
const savePageAll = (values:any) => {
var tmp = values;
tmp.curSearchString = curSearchString
return tmp
}
function doing(){
console.log(curSearchString)
}
function test(values:any) {
console.log(values)
}
const goToDetail = (values:any) => {
SA(values)
history.push(location.pathname + '/Detail')
console.log("跟踪对象")
console.log(curSearchString)
// SA(savePageAll(values))
// history.push(location.pathname + '/Detail')
}
const makeOperator = (values: any,index:any, e: any) => {
......@@ -62,7 +79,7 @@ const FacilityBookings = (props:any) => {
["Deposit", "marginFeeStatus",(text: any) => (<div>{marginFeeStatusDes[text]}</div>)],
["Status", "status",(text: any) => (<div>{statusDes[text]}</div>)],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this,record)}>Detail</a></Space>)],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <Button onClick={test.bind(this,curSearchString)}>Detail</Button></Space>)],
]
const key2 = [
["小区", "communityName"],
......@@ -74,40 +91,75 @@ const FacilityBookings = (props:any) => {
<a onClick={makeOperator.bind(this,record,2)}>预约</a>
</Space>)]
]
setColumns(objectColumns(key))
setColumns2(objectColumns(key2))
RA(0,{ userToken: token, pageNum: 1 })
RA(8,{ userToken: token, pageNum: 1 })
console.log("核心排查")
console.log(DataSave)
},[]);
useEffect(() => {
setLoading(false)
},[Data]);
const TitleSearchContent = (comment: any) => {
}, [Data]);
// useEffect(() => {
// console.log(location)
// if (location.query.type != null) {
// setCurSearchString(DataSave.curSearchString)
// RA(9, { userToken: token, pageNum: DataSave.curSearchString.curPage, subscribeDate: DataSave.curSearchString.subscribeDate, status: DataSave.curSearchString.status })
// }else {
// RA(0, { userToken: token, pageNum: 1 })
// }
// },[location])
const CallBackTitleSearch= (comment: any) => {
if (tab == 1) {
console.log(comment)
console.log("comment")
if (comment.communitydata != null || comment.key != null || comment.status != null) {
if (comment.communityName != null || comment.key != null || comment.status != null) {
console.log("搜索跟踪对象")
setCurSearchString({ subscribeDate: comment.key, status: comment.status,curPage:1})
RA(9, { userToken: token, pageNum: "1", subscribeDate: comment.key, status: comment.status })
}
} else {
console.log(comment)
// RA(8,{ userToken: token, pageNum: 1 })
RA(8, {
"communityNameList":comment.communityName,
"facilityName":"",
"pageNum":"1"
})
}
}
function TabCallback(tab: any) {
setTab(tab)
if (tab == 1) {
if (curSearchString.subscribeDate != null || curSearchString.status != null) {
RA(9, { userToken: token, pageNum: curSearchString.curPage, subscribeDate: curSearchString.subscribeDate, status: curSearchString.status })
} else {
RA(0, { userToken: token, pageNum: "1" })
}
function TabCallback(key: any) { setTab(key) }
} else {
RA(8,{ userToken: token, pageNum: "1" })
}
}
function Pagechange(current: any, pageSize: any) {
setLoading(true)
if (tab == 1) {
setCurPage(current)
var tmp = curSearchString
console.log("页面跟踪对象")
console.log(curSearchString)
tmp.curPage = current
console.log(tmp)
// setCurSearchString(tmp)
if (curSearchString.subscribeDate != null || curSearchString.status != null) {
// SA(savePageAll({}))
// RA(9, { userToken: token, pageNum: current, subscribeDate: curSearchString.subscribeDate, status: curSearchString.status })
} else {
RA(0, { userToken: token, pageNum: current })
}
} else {
setCurPage2(current)
// RA(0, { userToken: token, pageNum: current })
RA(8, { userToken: token, pageNum: current })
}
}
......@@ -120,43 +172,37 @@ const FacilityBookings = (props:any) => {
<TitleSearch
status={[{ name: ["status", "订单状态"], data: [[0, "全部"], [1, "已申请"], [2, "已预订"], [3, "已使用"], [4, "已取消"]] }]}
time={["key", "预订时间筛选"]}
community={true}
onSubmit={TitleSearchContent} />
community={"communityName"}
// single={true}
onSubmit={CallBackTitleSearch} />
<div style={{position:"relative",height:40}}>
<Button type="primary" style={{ position: "absolute", right: 0 }} onClick={goToFunction}>{tab==1?"Booking":"Add Facility"}</Button>
</div>
<Tabs defaultActiveKey="1" onChange={TabCallback}>
<Button type="primary" onClick={doing}>test</Button>
<Button type="primary" onClick={test.bind(this,curSearchString)}>test2</Button>
<Tabs defaultActiveKey={tab.toString()} onChange={TabCallback}>
<TabPane tab="Facility Bookings" key="1">
<Table loading={loading} rowKey="id" style={{ marginTop: 16 }} dataSource={Data.data } columns={columns} pagination={{ current: curPage, total: Data.total, showSizeChanger: false, onChange:Pagechange }} />
<Table loading={loading} rowKey="id" style={{ marginTop: 16 }} dataSource={Data.data } columns={columns} pagination={{ current: curSearchString.curPage, total: Data.total.totalRow, showSizeChanger: false, onChange:Pagechange }} />
</TabPane>
<TabPane tab="Facility Management" key="2">
<Table rowKey="id" style={{ marginTop: 16 }} dataSource={Data2.data} columns={columns2} pagination={{ current: curPage2, total: Data2.total, showSizeChanger: false, onChange: Pagechange }} />
<Table rowKey="id" style={{ marginTop: 16 }} dataSource={Data2.data} columns={columns2} pagination={{ current: curPage2, total: Data2.total.totalRow, showSizeChanger: false, onChange: Pagechange }} />
</TabPane>
</Tabs>
</div>
);
};
function mapStateToProps(state:any) {
const { Data, DataPage, Data2 } = state.FacilityBookings;
const { Data, DataPage, Data2,DataSave } = state.FacilityBookings;
const { token } = state.login;
return {
Data,
DataPage,
Data2,
DataSave,
token
};
}
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Input ,Upload,Modal,Button,Space,Pagination,Tooltip, Radio, Checkbox } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import { PlusOutlined } from '@ant-design/icons';
function getBase64(file: Blob) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
import TitleBack from '../../../components/TitleBack/TitleBack';
const FacilityBookingsSetting = () => {
const [namelist, setNamelist] = useState(['A']);
const [previewVisible, setPreviewVisible] = useState(false);
const [previewImage, setPreviewImage] = useState("");
const [previewTitle, setPreviewTitle] = useState("");
const [fileList, setFileList] = useState([]);
const uploadButton = ( <div><PlusOutlined /> <div className="ant-upload-text">Upload</div></div>);
const handleCancel = () => { setPreviewVisible(false) };
const handleChange = (Obj: any) => { setFileList(Obj.fileList) }
const handlePreview = async (file: { url: string; preview: string; originFileObj: Blob; name: any; }) => {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
setPreviewImage((file.url || file.preview));
setPreviewVisible(true);
setPreviewTitle(file.name || file.url.substring(file.url.lastIndexOf('/') + 1));
};
const onCreate = () => {
let newlist = [...namelist];
newlist.push('D')
console.log(newlist)
setNamelist(newlist)
}
const onDelete = () => {
let newlist = [...namelist];
newlist.pop();
setNamelist(newlist)
}
return (
<div className={styles.base}>
{/* 头部组件v1.2 */}
<TitleBack title="Add Facility" />
<div className={styles.box1}>
<div className={styles.box1item1}>Project</div>
<div className={styles.box1item2}><Input.Search style={{width:200}} /></div>
</div>
<div className={styles.box2}>
<div className={styles.box2item1}>Facility Name</div>
<div className={styles.box2item2}><Input style={{ width: 200 }} /></div>
<div className={styles.box2item3}>Management Expense</div>
<div className={styles.box2item4}><Input style={{ width: 80 }} /></div>
<div className={styles.box2item5}>Deposit</div>
<div className={styles.box2item6}><Input style={{width:80}} /></div>
</div>
<div style={{marginBottom:20}}>Facility Category</div>
<ul className={styles.ulist}>
{
namelist.map((item, index) => {
return (
<div key={"namelist"+index}>
<li className={styles.llist}><div className={styles.alist2}>
<div className={styles.alist1}>
<Upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76" listType="picture-card" fileList={fileList} onPreview={handlePreview} onChange={handleChange}>
{fileList.length >= 1? null : uploadButton}
</Upload>
<Modal visible={previewVisible} title={previewTitle} footer={null} onCancel={handleCancel}>
<img alt="picture" style={{ width: '100%' }} src={previewImage} />
</Modal>
</div>
<div className={styles.alist2box}>
<div className={styles.alist2boxitem1}>Name</div>
<div className={styles.alist2boxitem2}><Input style={{width:120}}/></div>
<div className={styles.alist2boxitem3}><div style={{cursor:"pointer",color:"#FF5151",fontWeight:600}} onClick={onDelete}>Delete</div></div>
</div>
</div>
</li>
</div>
)})
}
<li className={styles.llist}><div className={styles.alist3} onClick={onCreate}><PlusOutlined /></div></li>
</ul>
<div><p className={styles.alist2boxNone}>none</p></div>
<div className={styles.box3}>
<div className={styles.box3item1}>Facility Detail</div>
<div className={styles.box3item2}>
<div className={styles.box3group1}>
<Upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76" listType="picture-card" fileList={fileList} onPreview={handlePreview} onChange={handleChange}>
{fileList.length >= 1? null : uploadButton}
</Upload>
<Modal visible={previewVisible} title={previewTitle} footer={null} onCancel={handleCancel}>
<img alt="picture" style={{ width: '100%' }} src={previewImage} />
</Modal>
</div>
</div>
</div>
<div className={styles.line}></div>
<div className={styles.box5}>
<div className={styles.box5item1}>Opening Hours</div>
<div className={styles.box5item2}>09:00~20:00</div>
</div>
<div className={styles.box6}>
<div className={styles.box6item1}>Settings For Booking</div>
<div className={styles.box6item2}><Input style={{width:80}} /></div>
<div className={styles.box6item3}>Cancel Appointment</div>
<div className={styles.box6item4}><Input style={{width:80}}/></div>
<div className={styles.box6item5}>No deposit,cancellation</div>
<div className={styles.box6item6}><Input style={{width:80}}/></div>
<div className={styles.box6item7}>Bookable</div>
</div>
<div className={styles.box7}>
<div className={styles.box7item1}><Input style={{width:120}}/></div>
<div className={styles.box7item2}><Input style={{width:80}}/></div>
</div>
<div className={styles.box8}>
<div className={styles.box8item1}><Checkbox>Fixed Time Period For Each Appointment</Checkbox></div>
<div className={styles.box8item2}><Input style={{width:100}}/></div>
<div className={styles.box8item3}></div>
<div className={styles.box8item4}><Input style={{width:100}}/></div>
</div>
<div className={styles.line}></div>
<Button type="primary" style={{ width: 80, height: 32 }}>提交</Button>
</div>
);
};
export default FacilityBookingsSetting;
import React, { useState, useEffect,useRef } from 'react';
import styles from './index.less';
import styles from './css/index.less';
import { Input ,Upload,Modal,Button,Space,Pagination,Tooltip, Radio, Form,Row, Col,Select, message } from 'antd';
const { Option } = Select;
import { Link, useIntl, connect, Dispatch } from 'umi';
import { Link, useIntl, connect, Dispatch,history } from 'umi';
import { FieldTimeOutlined } from '@ant-design/icons';
import PictureOptions from '../../../components/PictureOptions/PictureOptions';
......@@ -11,23 +11,14 @@ import PictureOptionsRow from '../../../components/PictureOptions/PictureOptions
import TitleBack from '../../../components/TitleBack/TitleBack';
import TimeSelect from '../../../components/TimeSelect/TimeSelect';
import Line from '../../../components/Line/Line';
import { values } from 'lodash';
// categoriesDetailsImageName: ["test.jpg"],
// categoriesName: ["篮球场A&test.jpg"],
// reservationQuantumTime: ["09:00-07:00"]
const Data = {
canReservationDay: "5",
canReservationNum: "6",
cancelReservationDay: "3",
categoriesOpenTime: "09:00-20:00",
communityManagerFee: "18",
communityMargin: "20",
communityName: "A9",
facilityName: "篮球场",
nomarginCancelReservationDay: "4",
periodType: "2",
}
import { getUrlLast } from '../../../utils/string'
const FacilityManager = (props:any) => {
const { dispatch, location, token,sourceData,DataSave} = props;
......@@ -51,10 +42,12 @@ const FacilityManager = (props:any) => {
}
useEffect(() => {
if (sourceData != null) {
console.log("当前数据不为空")
console.log(sourceData)
formRef.current.setFieldsValue(sourceData)
}
},[sourceData])
}, [sourceData])
useEffect(() => {
console.log("init one")
console.log(DataSave)
......@@ -129,11 +122,14 @@ const FacilityManager = (props:any) => {
const extendName = (values:any) => {
setExtend(values)
}
const Subscribe = () => {
history.push(getUrlLast(location.pathname)+ "/FacilityApply")
}
return (
<div className={styles.base}>
{/* 头部组件v1.2 */}
<TitleBack title={PATHNAME} />
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname)+"?Facility=true"}/>
<Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} >
<Row gutter={32}>
......@@ -179,13 +175,13 @@ const FacilityManager = (props:any) => {
<Col>预约设置</Col>
<Col>
<Row gutter={100}>
<Col><Form.Item name="cancelReservationDay" ><Input placeholder="取消预订" style={{width:160}} disabled={facilityDetail}/></Form.Item></Col>
<Col><Form.Item name="nomarginCancelReservationDay" ><Input placeholder="不交押金,取消预订" style={{width:160}} disabled={facilityDetail}/></Form.Item></Col>
<Col><Form.Item name="canReservationDay" ><Input placeholder="可预订" style={{width:160}} disabled={facilityDetail}/></Form.Item></Col>
<Col><Form.Item name="cancelReservationDay" label="提前取消预订"><Input placeholder="取消预订" style={{width:160}} disabled={facilityDetail}/></Form.Item></Col>
<Col><Form.Item name="nomarginCancelReservationDay" label="不交押金,自动取消预订"><Input placeholder="不交押金,取消预订" style={{width:160}} disabled={facilityDetail}/></Form.Item></Col>
<Col><Form.Item name="canReservationDay" label="可提前预订"><Input placeholder="可预订" style={{width:160}} disabled={facilityDetail}/></Form.Item></Col>
</Row>
<Row gutter={8}>
<Col>
<Form.Item name="periodType" >
<Form.Item name="periodType" label="预约周期">
<Select placeholder="period" allowClear style={{width:120}} disabled={facilityDetail}>
<Option value="1">Day</Option>
<Option value="2">Month</Option>
......@@ -200,10 +196,10 @@ const FacilityManager = (props:any) => {
<Row gutter={32} style={{ marginTop: 28 }}>
<Col>预约时段</Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={["10:00-12:00","13:00-14:00"]} disabled={facilityDetail}/></Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={["08:00-20:00"]} disabled={facilityDetail}/></Col>
</Row>
{
facilityDetail ? null :
facilityDetail ? <><Line /><Button type="primary" onClick={Subscribe}>Subscribe</Button></> :
<><Line /><Button type="primary" htmlType="submit">Submit</Button></>
}
......@@ -222,3 +218,19 @@ function mapStateToProps(state:any) {
};
}
export default connect(mapStateToProps)(FacilityManager);
// ["10:00-12:00","13:00-14:00"]
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场A"},{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场B" }]}
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" }]}
// const Data = {
// canReservationDay: "5",
// canReservationNum: "6",
// cancelReservationDay: "3",
// categoriesOpenTime: "09:00-20:00",
// communityManagerFee: "18",
// communityMargin: "20",
// communityName: "A9",
// facilityName: "篮球场",
// nomarginCancelReservationDay: "4",
// periodType: "2",
// }
\ No newline at end of file
......@@ -5,7 +5,7 @@ import { Input ,Menu,Table,Space} from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index';
import TitleSearch from '../../../components/TitleSearch/TitleSearch';
const dataSource = [
......@@ -87,18 +87,20 @@ const Users = (props: { location: any; }) => {
},
];
const printContent = (comment: any)=>{
const CallBackTitleSearch = (comment: any)=>{
console.log(comment)
}
return (
<div className={styles.base}>
{/* 头部组件 */}
<div className={styles.box}>
<input className={styles.item1} placeholder={nameofowner} />
</div>
<SelectOptions list={["美国", "美丽的", "美好", "加拿大", "加油", "XO"].sort()} onSubmit={printContent} />
<button className={styles.item3}>{search}</button>
<TitleSearch
listkey={["providerName"]}
list={["Service Provider"]}
community={"serviceCommunityList"}
onSubmit={CallBackTitleSearch} />
{/* 内容组件 */}
<div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToAdd}>Create New Owner</button>
......
......@@ -4,28 +4,33 @@ import styles from './index.less';
import {Form, Input ,Spin,Table,Space, Button} from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
const antIcon = <LoadingOutlined style={{ fontSize: 24 }} spin />;
import { Link, useIntl, connect, Dispatch,history } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index';
import TitleSearch from '../../../components/TitleSearch/TitleSearch';
const ServiceProviderManagement = (props: any) => {
const { formatMessage } = useIntl();
const { dispatch, location,Data,CommunityList} = props;
const { dispatch, location, Data, CommunityList } = props;
const RA = (index:any,values: any) => { dispatch({ type: 'ServiceProvider/RA', playload: {index:index, body:values } }) };
const TosTosServiceProviderGet = (values: any) => { dispatch({ type: 'ServiceProvider/TosTosServiceProviderGet', playload: values }) };
const SaveChooseData = (values: any) => { dispatch({ type: 'ServiceProvider/SaveChooseData', playload: values }) };
const GetList = () => {
if (CommunityList != null) {
TosTosServiceProviderGet({
providerName: "",
serviceCommunityList: CommunityList
})
}
}
useEffect(() => {
TosTosServiceProviderGet(null)
GetList()
}, []);
const formRef = useRef(null);
const onFinish = (values: any) => {TosTosServiceProviderGet(values)};
const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) };
useEffect(() => {
GetList()
}, [CommunityList]);
const goToDetail = (values: any, e: any) => {
SaveChooseData(values)
......@@ -68,7 +73,7 @@ const ServiceProviderManagement = (props: any) => {
return tmp;
}
const printContent = (comment: any)=>{
const CallBackTitleSearch = (comment: any)=>{
console.log(comment)
}
......@@ -76,11 +81,13 @@ const ServiceProviderManagement = (props: any) => {
<div className={styles.base}>
{/* 头部组件 */}
<Form ref={formRef} name="basic" initialValues={{}} onFinish={onFinish} onFinishFailed={onFinishFailed}>
<div className={styles.box}><Form.Item name="providerName" ><Input style={{width:200}} placeholder="Service Provider" /></Form.Item></div>
<SelectOptions list={CommunityList} onSubmit={printContent}/>
<Form.Item><Button type="primary" htmlType="submit">Search</Button></Form.Item>
</Form>
<TitleSearch
listkey={["providerName"]}
list={["Service Provider"]}
community={"serviceCommunityList"}
onSubmit={CallBackTitleSearch} />
{/* 内容组件 */}
<div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToServices}>Avail Services</button>
......
......@@ -29,23 +29,11 @@ const Guard = (props:any) => {
<div className={styles.base}>
<div className={styles.item0}><TitleGet title={"Welcome"}/></div>
<div>{token}</div>
<Line />
<div className={styles.item0}><TitleGet title={"Version 1.0.1"}/></div>
{/* <div>{token}</div>
<Line /> */}
<Form name="basic" onFinish={onFinish}>
<Form.Item name="name" ><Upload name={'file'} listType={'picture-card'}>
<Button>
{uploadButton}
</Button>
</Upload></Form.Item>
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form>
</div>
);
......
......@@ -5,21 +5,25 @@ export interface LoginParamsType {
password: string;
}
export async function fakeAccountLogin(params: LoginParamsType) {
return request('/api/login/account', {
method: 'POST',
data: params,
});
}
// export async function fakeAccountLogin(params: LoginParamsType) {
// return request('/api/login/account', {
// method: 'POST',
// data: params,
// });
// }
export async function getFakeCaptcha(mobile: string) {
return request(`/api/login/captcha?mobile=${mobile}`);
}
export async function AccountLogin(params: LoginParamsType) {
console.log("登录请求")
return request('/tos/user/login', { method: 'POST', data: params, });
}
export async function AccountOut() {
return request('/tos/user/login', { method: 'POST' });
}
export interface LoginCheckParamsType {
userName: string;
password: string;
......@@ -27,5 +31,6 @@ export interface LoginCheckParamsType {
userId: string;
}
export async function AccountCheckLogin(params: LoginCheckParamsType) {
console.log("登录确认请求")
return request('/tos/user/newCurrentUser', { method: 'POST', data: params, });
}
\ No newline at end of file
......@@ -71,13 +71,14 @@ const requestList = [
"/tos/bookingService/lookUp",//7 查看小区设施
"/tos/community/facilities/fuzzy/query",//8 查看设施管理模糊
"/tos/community/categories/subscribe/fuzzy/query",//9 预订列表模糊查询
"/tos/user/newCurrentUser" //10 后台用户信息
]
function requestAuto(url:string,values:any) {
return request(url, Body(values))
}
export function RA(playload: any) {
console.log(playload)
console.log(playload.index)
console.log(requestList[playload.index])
// console.log(playload)
// console.log(playload.index)
// console.log(requestList[playload.index])
return requestAuto(requestList[playload.index],playload.body)
}
\ No newline at end of file
......@@ -4,8 +4,8 @@ export async function query(): Promise<any> {
return request('/api/users');
}
export async function queryCurrent(): Promise<any> {
return request('/api/currentUser');
export async function queryCurrent(values:any): Promise<any> {
return request('/tos/user/newCurrentUser',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}});
}
export async function queryNotices(): Promise<any> {
......
......@@ -23,3 +23,16 @@ export const getUrlPicName=(str:string)=>{
var tmp2=tmp[0].split("/")
return(tmp2[tmp2.length-1])
}
//取url中取url最后的参数路径
export const getUrlLast = (str: string) => {
var index = str.lastIndexOf("/")
var tmp =str.substring(0,index)
return tmp
}
//取url中取url最后的参数
export const getUrlLastParams = (str: string) => {
var index = str.lastIndexOf("?")
var tmp =str.substring(0,index)
return tmp
}
\ No newline at end of file
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