Commit eb5c602e authored by cellee's avatar cellee

设施大改

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 61c5de68
/*
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-01-13 10:34:13
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
*/
// https://umijs.org/config/
import { defineConfig } from 'umi';
import defaultSettings from './defaultSettings';
......@@ -314,7 +322,7 @@ export default defineConfig({
},
{
path: './FacilityEdit',
component: './CommunityManagement/FacilityBookings/Facility',
component: './CommunityManagement/FacilityBookings/FacilityTow',
},
{
path: './FacilityDetail',
......@@ -364,6 +372,17 @@ export default defineConfig({
],
},
{
path: './SystemFeedback',
name: 'systemfeedback',
routes: [
{ path: './', component: './AccountManagement/SystemFeedback/SystemFeedback' },
{
path: './BugDetail',
component: './AccountManagement/SystemFeedback/BugDetail',
},
],
},
{
path: './CompanyInformation',
name: 'companyinformation',
......
......@@ -86,15 +86,15 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/tos/': {
// target: 'http://47.74.233.180:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
'/tos/': {
target: 'http://192.168.1.28:8651',
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/tos/': {
// target: 'http://192.168.1.28:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
},
};
/*
* @Author: your name
* @Date: 2020-12-14 18:52:22
* @LastEditTime: 2021-01-12 14:43:56
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\locales\en-US\menu.ts
*/
export default {
'menu.welcome': 'Welcome',
'menu.more-blocks': 'More Blocks',
......@@ -72,6 +80,7 @@ export default {
'menu.communitymanagement.visitorrecord': 'Visitor Record',
'menu.accountmanagement': 'Account Management',
'menu.accountmanagement.accountmanagement1': 'Account Management',
'menu.accountmanagement.systemfeedback': 'System Feedback',
'menu.accountmanagement.companyinformation': 'Company Information',
'menu.accountmanagement.languagesettings': 'Language Settings',
};
......@@ -72,6 +72,7 @@ export default {
'menu.communitymanagement.visitorrecord': '访客记录',
'menu.accountmanagement': '后台管理',
'menu.accountmanagement.accountmanagement1': '账号管理',
'menu.accountmanagement.systemfeedback': 'BUG反馈',
'menu.accountmanagement.companyinformation': '公司信息',
'menu.accountmanagement.languagesettings': '语言设置',
};
/*
* @Author: your name
* @Date: 2021-01-14 09:23:51
* @LastEditTime: 2021-01-14 10:51:37
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\Bug.ts
*/
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router';
import { printf } from '@/utils/log';
export default {
namespace: 'Bug',
state: {
Data: null,
DataSave: null,
},
reducers: {
returnPage(state, { Data }) {
return { ...state, Data };
},
returnDataSave(state, { DataSave }) {
return { ...state, DataSave };
},
},
effects: {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
if (resp.error_code != '0000') {
printf(playload, resp);
message.error(`${resp.error_code}:${resp.error_msg}`);
} else {
switch (playload.index) {
case 59: // 获取后台所有账号
{
let Data = resp.data;
yield put({ type: 'returnPage', Data });
}
break;
}
}
},
*SA({ DataSave }, { call, put }) {
yield put({ type: 'returnDataSave', DataSave });
},
},
};
......@@ -127,8 +127,8 @@ export default {
yield put({ type: 'returnPage3', Data3});
}break;
case 2: {
case 2:
case 60:{
let DataSaveDetail = resp.data;
yield put({ type: 'DataSaveDetail', DataSaveDetail });
......
import React, { useEffect } from 'react';
import { Button, Descriptions, Image } from 'antd';
import { EditOutlined, LeftOutlined } from '@ant-design/icons';
import './index.less';
import { connect, history } from 'umi';
import moment from 'moment';
const BugDetail = (props: any) => {
const { DataSave } = props;
useEffect(() => {
if (!DataSave) {
history.push('/AccountManagement/SystemFeedback');
}
}, [DataSave]);
const goToReturn = () => {
history.go(-1);
};
return (
<>
<div className="contop bug">
<h3 className="capi">
<EditOutlined />
&nbsp;System Feedback Details
<div className="back" onClick={goToReturn}>
<Button>
<LeftOutlined />
Back
</Button>
</div>
</h3>
<hr></hr>
<Descriptions column={{ xxl: 1, xl: 1, lg: 1, md: 1, sm: 1, xs: 1 }}>
<Descriptions.Item label="Mobile phone brands">
{DataSave ? DataSave.phoneBrand : '-'}
</Descriptions.Item>
<Descriptions.Item label="Phone model">
{DataSave ? DataSave.deviceModel : '-'}
</Descriptions.Item>
<Descriptions.Item label="System version">
{DataSave ? DataSave.osVersion : '-'}
</Descriptions.Item>
<Descriptions.Item label="Software version">
{DataSave ? DataSave.appVersion : '-'}
</Descriptions.Item>
<Descriptions.Item label="Feedback content">
{DataSave ? DataSave.description : '-'}
</Descriptions.Item>
<Descriptions.Item className="diys" label="&nbsp;">
{DataSave
? DataSave.imageUrls.map((item: any) => {
return <Image width={120} src={item} />;
})
: '-'}
</Descriptions.Item>
<Descriptions.Item label="Actions">
{DataSave ? moment(DataSave.updateTime.time).calendar() : '-'}
</Descriptions.Item>
</Descriptions>
</div>
</>
);
};
function BugDetailProps(state: any) {
const { DataSave } = state.Bug;
const loading = state.loading.models.Bug || false;
return {
DataSave,
loading,
};
}
export default connect(BugDetailProps)(BugDetail);
import React, { useState, useEffect, useRef } from 'react';
import { Pagination } from 'antd';
import {} from '@ant-design/icons';
import ProTable from '@ant-design/pro-table';
import { RA } from '@/utils/method';
import { connect, history } from 'umi';
import moment from 'moment';
import './index.less';
const SystemFeedback = (props: any) => {
const { dispatch, Data, loading } = props;
const module = 'Bug';
const [term, setTerm] = useState({ pageNum: 1 } as any); //页码
useEffect(() => {
if (!Data) {
Refresh();
}
}, [Data]);
const columns = [
{ title: 'Brand', dataIndex: 'phoneBrand' },
{ title: 'Phone model', dataIndex: 'deviceModel' },
{ title: 'System version', dataIndex: 'osVersion' },
{ title: 'Software version', dataIndex: 'appVersion' },
{ title: 'Problem Description', dataIndex: 'description', ellipsis: true },
{
title: 'Submission time',
dataIndex: 'createTime',
render: (text: any) => {
// let data =
// moment(text.time).format('YYYY-MM-DD hh') +
// ':00' +
// (parseInt(moment(text.time).format('HH')) > 11 ? 'PM' : 'AM');
let data = moment(text.time).calendar();
return data;
},
},
{
title: 'Actions',
valueType: 'option',
render: (text: any) => {
return (
<a
key="link"
onClick={() => {
Details(text);
}}
>
Details
</a>
);
},
},
];
// 跳到内页
const Details = (item: any) => {
let DataSave = item;
dispatch({ type: 'Bug/SA', DataSave });
history.push('/AccountManagement/SystemFeedback/BugDetail');
};
// 页码切换
const sopens = (page: any) => {
let p = {
pageNum: page,
};
setTerm({ ...p });
RA(59, p, module, dispatch);
};
// 刷新
const Refresh = () => {
RA(59, term, module, dispatch);
};
return (
<>
<ProTable
dataSource={Data ? Data.list : null}
rowKey={'id'}
columns={columns as any}
pagination={false}
options={{
density: false,
fullScreen: false,
reload: () => {
Refresh();
},
setting: false,
}}
loading={loading}
search={false}
headerTitle="System Feedback"
/>
<div className="pages">
<Pagination
// onShowSizeChange={pageSizeHandler}
current={Data ? Data.page.currentPage : 0}
onChange={sopens}
total={Data ? Data.page.totalRow : 0}
pageSize={Data ? Data.page.curPageSize : 0}
showSizeChanger={false}
/>
</div>
</>
);
};
function mapStateToProps(state: any) {
const { Data } = state.Bug;
const loading = state.loading.models.Bug || false;
return {
Data,
loading,
};
}
export default connect(mapStateToProps)(SystemFeedback);
.contop {
background: #fff;
padding: 20px;
border-right: 4px;
margin-bottom: 0;
h3 {
margin-bottom: 15px;
position: relative;
.back {
position: absolute;
right: 0;
top: 0;
top: -2px;
background: #fff;
}
}
}
hr {
border: 0;
height: 1px;
background: #eee;
margin-bottom: 24px;
}
.bug {
.ant-descriptions-item-label {
display: inline-block;
min-width: 160px;
}
.diys {
.ant-descriptions-item-label {
color: #fff;
}
}
.ant-image {
margin-right: 15px;
}
}
.pages {
text-align: right;
padding: 10px;
}
......@@ -69,15 +69,15 @@ const Account = (props: any) => {
key: 'userAccount',
},
{
title: 'Grade',
title: 'Authority Level',
dataIndex: 'tosUserLevel',
key: 'userLevel',
render: (text: any) => (
<span>
{text == 0 ? 'Administrator' : ''}
{text == 1 ? 'First Level' : ''}
{text == 2 ? 'Two Level' : ''}
{text == 3 ? 'Three Level' : ''}
{text == 2 ? 'Second Level' : ''}
{text == 3 ? 'Third Level' : ''}
</span>
),
},
......
import React, { useState, useEffect } from 'react';
import { Input, Tabs, Pagination, Space, Button } from 'antd';
import { Input, Tabs, Pagination, Space, Button, message } from 'antd';
const { TabPane } = Tabs;
import { Link, useIntl, connect, Dispatch, history } from 'umi';
......@@ -42,8 +42,6 @@ const FacilityBookings = (props: any) => {
CommunityList,
} = props;
// console.log(Data2);
const RA = (index: any, values: any) => {
dispatch({
type: 'FacilityBookings/RA',
......@@ -63,9 +61,38 @@ const FacilityBookings = (props: any) => {
dispatch({ type: 'FacilityBookings/CA', playload: null });
};
// 表头格式
const [columns, setColumns] = useState([]);
const [columns2, setColumns2] = useState([]);
// 设施列表数据
const [Facility, setFacility] = useState([] as any);
useEffect(() => {
if (Data2 != null) {
// 提取出列表的值
let Array = [];
for (let i in Data2.data) {
let a = {
community: '',
facilities: [] as any,
};
a.community = Object.keys(Data2.data[i])[0];
let arr = Data2.data[i][Object.keys(Data2.data[i])[0]];
arr.map((item: any) => {
let id = Object.keys(item)[0];
let obj = {
id: id,
name: item[id],
};
a.facilities.push(obj);
});
Array.push(a);
}
setFacility(Array);
}
}, [Data2]);
const goToFunction = () => {
if (curString.tab == 2) {
CA();
......@@ -89,6 +116,10 @@ const FacilityBookings = (props: any) => {
// 列表2 点击跳转
const makeOperator = (values: any, index: any) => {
const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply'];
if (index != 1) {
message.error('In function development!');
return false;
}
SA(values);
// 清空设施列表图
let list: any = [];
......@@ -127,9 +158,18 @@ const FacilityBookings = (props: any) => {
],
];
const key2 = [
['Community', 'communityName'],
['Facilities', 'facilityName'],
['Opening Hours', 'categoriesOpenTime'],
['Community', 'community'],
[
'Facilities',
'facilities',
(text: any, record: any) => {
let a = '';
text.map((item: any) => {
a += item.name + '、';
});
return a;
},
],
[
'Action',
null,
......@@ -356,8 +396,8 @@ const FacilityBookings = (props: any) => {
<TabPane tab="Facility Management" key="2">
<ProTable
loading={loading}
rowKey="id"
dataSource={Data2.data}
rowKey={'community'}
dataSource={Facility}
columns={columns2}
// pagination={{
// current: curString.curPage2,
......
This diff is collapsed.
......@@ -331,12 +331,10 @@ hr {
}
.divIconMoney {
position: absolute;
z-index: 99;
top: 50%;
transform: translateY(-50%);
left: 8px;
color: #999;
display: inline-block;
margin-right: 10px;
color: rgba(0, 0, 0, 0.85);
line-height: 32px;
}
.required {
......
hr {
border: 0;
height: 1px;
background: #eee;
margin-bottom: 24px;
}
.FacilityName {
margin-bottom: 15px;
label {
display: inline-block;
min-width: 100px;
}
}
/*
* @Author: your name
* @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-01-07 15:08:08
* @LastEditTime: 2021-01-14 15:31:59
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
......@@ -91,4 +91,6 @@ export const requestList = [
['/tos/user/twoLevel/get', '56 获取二级账号', {}],
['/tos/user/twoLevel/get/CommunityAuth', '57 根据用户id获取用户管辖小区名和权限', {}],
['/tos/community/categories/subscribe/reservationNum', '58 获取小区设施可预约次数', {}],
['/tos/bug/feedback/list', '59 获取用户反馈列表', {}],
['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}],
];
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