Commit a6cadda8 authored by MrShi's avatar MrShi

新开dev_ssz分支,业主模块修改

parent f659fc86
......@@ -7,16 +7,16 @@
*/
export default {
dev: {
/* '/api/': {
'/api/': {
target: 'https://preview.pro.ant.design',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/api/': {
},
/*'/api/': {
target: 'http://localhost:8080',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},*/
'/res/': {
target: 'http://mapleonlyone.top',
changeOrigin: true,
......@@ -27,8 +27,13 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
/* '/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/tos/': {
target: 'http://47.74.233.180:8651',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
......@@ -54,8 +59,13 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
/* '/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/tos/': {
target: 'http://47.74.233.180:8651',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
......@@ -76,15 +86,15 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
'/tos/': {
target: 'http://47.74.233.180:8651',
'/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
/* '/tos/': {
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/tos/': {
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
},*/
},
};
import {getOwnerDetail,getOwner, getTosUser,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/tosUser';
import {updateOwner,saveOwner,getOwnerDetail,getOwner, getTosUser,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/tosUser';
export default{
namespace: 'tUModel',
......@@ -17,19 +17,31 @@ export default{
*getOwner({callback,payload},{ call, put }) {
const response = yield call(getOwner,payload);
yield put({
type: "getOwner",
type: "get",
});
if(callback) callback(response);
},
*getOwnerDetail({callback,payload},{ call, put }) {
const response = yield call(getOwnerDetail,payload);
yield put({
type: "getOwnerDetail",
type: "get",
});
if(callback) callback(response);
},
*saveOwner({callback,payload},{ call, put }) {
const response = yield call(saveOwner,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*updateOwner({callback,payload},{ call, put }) {
const response = yield call(updateOwner,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
......@@ -74,7 +86,7 @@ export default{
};
},
getOwner(state, action) {
/* getOwner(state, action) {
return {
...state,
data:action.payload || {},
......@@ -86,7 +98,7 @@ export default{
...state,
data:action.payload || {},
};
},
},*/
del(state, action) {
return {
...state,
......
......@@ -5,9 +5,7 @@ from "antd";
import styles from './style.less';
import {ConnectState} from "@/models/connect";
import XLSX from "@/pages/account/xlsx.core.min";
import {router} from "umi";
import 'moment/locale/zh-cn';
// @ts-ignore
import SelectOptions from '../../../components/SelectOptions/index';
class TosUser extends React.Component {
......@@ -34,7 +32,6 @@ class TosUser extends React.Component {
visible: false,
deviceStatus: '',
selectedRowKeys: [],
used: null,
newAdd: null,
strList: [],
......@@ -206,17 +203,15 @@ class TosUser extends React.Component {
visible: false,
});
};
//获取所有设备
//获取所有设备
getDevice = () => {
const params = {
// address: (this.state.province == undefined ? '' : this.state.province.label) +
// (this.state.city == undefined ? '' : '-' + this.state.city.label) +
// (this.state.district == undefined ? '' : '-' + this.state.district.label) +
// (this.state.street == undefined ? '' : '-' + this.state.street.label),
name: this.state.name,
/*name: this.state.name,
model: this.state.model,
status: this.state.status,
id: this.props.currentUser.userid,
id: this.props.currentUser.userid,*/
// userPhone:"18813787835",
// id:"240ebdfbac82417082ff789750760b83",
// ownerName: "哈喽kk",
......@@ -227,17 +222,12 @@ class TosUser extends React.Component {
payload: params,
callback: (res) => {
if (res) {
/*this.setState({
data: res.rows,
total: res.total,
})*/
if(res.error_code == "0000"){
this.setState({
data: res.data.rows,
total: res.data.total,
})
}
else if(res.error_code == "0001"){
} else if(res.error_code == "0001"){
alert(res.error_msg);
}else if(res.error_code == "0002"){
alert(res.error_msg);
......@@ -246,7 +236,7 @@ class TosUser extends React.Component {
// window.location.href = '/';
// router.replace('/');
}
else{
else{
alert("Tos查询出错!未知错误!");
}
}
......@@ -255,8 +245,6 @@ class TosUser extends React.Component {
};
//跳转到编辑页面
edit = (params) => {
let flag = 0;
......@@ -304,7 +292,6 @@ class TosUser extends React.Component {
edit2 = (params) => {
let flag = 0;
const nowUser = this.props.currentUser;
this.props.dispatch(routerRedux.push({
pathname: '/UserManagement/tosUser/edit',
query: params,
......@@ -332,7 +319,7 @@ class TosUser extends React.Component {
}
}
}else{
//alert("找不到用户权限记录!");
//alert("找不到用户权限记录!");
//return;;
}
/* if(flag == 0){
......@@ -362,17 +349,17 @@ class TosUser extends React.Component {
};
//加载省
provinceload = (code) => {
this.props.dispatch({
type: 'deviceModel/getRegion',
payload: {code: code,},
callback: (res) => {
if (res) {
this.setState({
provinceList: res.data,
});
}
}
});
// this.props.dispatch({
// type: 'deviceModel/getRegion',
// payload: {code: code,},
// callback: (res) => {
// if (res) {
// this.setState({
// provinceList: res.data,
// });
// }
// }
// });
};
//省变更
provinceChange = (e) => {
......@@ -416,7 +403,7 @@ class TosUser extends React.Component {
})
} else {
this.setState({city: {label: e.label,}});
this.props.dispatch({
/* this.props.dispatch({
type: 'deviceModel/getRegion',
payload: {code: e.key,},
callback: (res) => {
......@@ -428,7 +415,7 @@ class TosUser extends React.Component {
});
}
}
});
});*/
}
};
//区变更
......@@ -441,7 +428,7 @@ class TosUser extends React.Component {
})
} else {
this.setState({district: {label: e.label,}});
this.props.dispatch({
/*this.props.dispatch({
type: 'deviceModel/getRegion',
payload: {code: e.key,},
callback: (res) => {
......@@ -452,12 +439,12 @@ class TosUser extends React.Component {
});
}
}
});
});*/
}
};
//批量删除
del() {
this.props.dispatch({
/* this.props.dispatch({
type: 'deviceModel/delDevice',
payload: this.state.delData,
callback: (res) => {
......@@ -472,13 +459,13 @@ class TosUser extends React.Component {
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router.replace('/');
// router.replace('/');
} else {
alert("删除失败!未知错误!");
}
}
}
});
});*/
};
//显示信息
info() {
......
......@@ -161,13 +161,73 @@ class TosUserCreate extends React.Component {
snChange = (e) => {
this.setState({sn: e.target.value});
};
//设备sn变更
snChange1 = (e) => {
this.setState({sn1: e.target.value});
};
//设备sn变更
snChange2 = (e) => {
this.setState({sn2: e.target.value});
};
//管理员变更
keeperChange = (e) => {
this.setState({keeper: e.target.value});
};
//联系电话正则
phoneBlur = () => {
if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(this.state.phone))){
const params = {
/* deviceAddress: (this.state.province == undefined ? '' : this.state.province.label) +
(this.state.city == undefined ? '' : '-'+this.state.city.label) +
(this.state.district == undefined ? '' : '-'+this.state.district.label) +
(this.state.street == undefined ? '' : '-'+this.state.street.label),
deviceName: this.state.name,
deviceModel: this.state.model,
deviceKeeper: this.state.keeper,
deviceID: this.state.id,
deviceSerialNumber: this.state.sn,
devicePhone: this.state.phone,
deviceWorking: this.state.status == '' ? 2 : this.state.status,
deviceStatus: this.state.deviceStatus ? this.state.deviceStatus : 0,
deviceCreate: this.props.currentUser.userid,*/
owerName: this.state.sn,
owerPhone:this.state.sn1,
owerEmail:this.state.sn2,
communityName:this.state.model,
buildingNumber:this.state.name,
floorNumber:this.state.keeper,
roomNumber:this.state.phone1,
addressAndpostalCode:this.state.phone
};
console.log("params",params);
this.props.dispatch({
type: 'tUModel/saveOwner',
payload: params,
callback: (res) => {
if (res.error_code == "0000") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0002") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0001"){
alert(res.error_msg);
} else if (res.error_code == "0003"){
alert(res.error_msg)
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router.replace('/');
}else {
alert("提交错误!未知原因!");
}
}
});
/*if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(this.state.phone))){
this.setState({
phoneBlur: false,
})
......@@ -217,7 +277,7 @@ class TosUserCreate extends React.Component {
});
}
});
}
}*/
};
//联系电话变更
phoneChange = (e) => {
......@@ -291,7 +351,7 @@ class TosUserCreate extends React.Component {
//渲染
render() {
const { name, model, keeper, phone,phone1, province, city, district, street,
provinceList, cityList, districtList, streetList, phoneBlur, sn } = this.state;
provinceList, cityList, districtList, streetList, phoneBlur, sn,sn1,sn2 } = this.state;
/* const provinceSelect = provinceList.map((item) => (
<Select.Option value={item.code} label={item.name}>{item.name}</Select.Option>
));
......@@ -311,8 +371,9 @@ class TosUserCreate extends React.Component {
<div className={styles.detailsBox}>
<div>
<span className={styles.detailsContent}>Owner's Name</span>
<Input className={styles.input} value={sn} placeholder="Single Line Input" onChange={(e) => this.snChange(e)}/>
<Input className={styles.input} value={sn} placeholder="OwnerName" onChange={(e) => this.snChange(e)}/>
<Input className={styles.input} value={sn1} placeholder="Phone" onChange={(e) => this.snChange1(e)}/>
<Input className={styles.input} value={sn2} placeholder="E-mail" onChange={(e) => this.snChange2(e)}/>
</div>
<div>
<span className={styles.detailsContent}>Project / community</span>
......
import React from 'react';
import {connect, routerRedux} from 'dva';
import {Table, Button, DatePicker, Select, Menu, Modal} from "antd";
import {Table, Button, DatePicker, Select, Menu, Modal, Input} from "antd";
import styles from './style.less';
import {ConnectState} from "@/models/connect";
import ExportJsonExcel from 'js-export-excel';
......@@ -155,8 +155,8 @@ class TosUserDetails extends React.Component {
console.log(res);
if(res.error_code == "0000"){
this.setState({
data: res.rows,
total: res.total,
data: res.data.rows,
total: res.data.total,
})
} else if(res.error_code == "0002") {
alert(res.error_msg);
......@@ -325,9 +325,51 @@ class TosUserDetails extends React.Component {
//提交
onSubmit = () => {
// this.phoneBlur();
this.phoneBlur();
};
//联系电话正则
phoneBlur = () => {
const params = {
owerName: this.state.sn,
owerPhone:this.state.sn1,
owerEmail:this.state.sn2,
communityName:this.state.model,
buildingNumber:this.state.name,
floorNumber:this.state.keeper,
roomNumber:this.state.phone1,
addressAndpostalCode:this.state.phone
};
console.log("params",params);
this.props.dispatch({
type: 'tUModel/saveOwner',
payload: params,
callback: (res) => {
if (res.error_code == "0000") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0002") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0001"){
alert(res.error_msg);
} else if (res.error_code == "0003"){
alert(res.error_msg)
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router.replace('/');
}else {
alert("提交错误!未知原因!");
}
}
});
};
//初始化
componentDidMount() {
if (this.props.location.query != null) {
......@@ -336,7 +378,8 @@ class TosUserDetails extends React.Component {
current: params.current?params.current:'record',
},() => {
if(this.state.current == "record"){
this.getRecord();
// this.getRecord();
this.getData();
}else{
this.getData();
}
......@@ -348,51 +391,71 @@ class TosUserDetails extends React.Component {
//表格列名
columns = [
{
title: '用户名称',
dataIndex: 'warnType',
key: 'warnType',
render: (text, record) => (
<span>
{record.warnType == 1?'扫描模块故障':''}
{record.warnType == 2?'打印机故障':''}
{record.warnType == 3?'触摸屏故障':''}
{record.warnType == 4?'副屏故障':''}
</span>
),
title: 'User Name',
dataIndex: 'owner_family_name',
key: 'owner_family_name',
},
{
title: '联系电话',
dataIndex: 'warnContactsInformation',
key: 'warnContactsInformation',
title: 'Contact Details',
dataIndex: 'owner_family_phone',
key: 'owner_family_phone',
},
{
title: '联系邮箱',
dataIndex: 'warnDetails',
key: 'warnDetails',
title: 'E-mail',
dataIndex: 'owner_family_email',
key: 'owner_family_email',
},
{
title: '账号类型',
dataIndex: 'enable',
key: 'warn_time',
title: 'cdk_code',
dataIndex: 'cdk_code',
key: 'cdk_code',
},
/*{
title: 'community_name',
dataIndex: 'community_name',
key: 'community_name',
},
{
title: '账号状态',
dataIndex: 'user_account',
key: 'user_account',
defaultSortOrder: 'descend',
sorter: (a, b) => a.user_account - b.user_account,
title: 'community_build',
dataIndex: 'community_build',
key: 'community_build',
},
{
title: 'community_floor',
dataIndex: 'community_floor',
key: 'community_floor',
},
{
title: 'communtiy_room',
dataIndex: 'communtiy_room',
key: 'communtiy_room',
},*/
{
title: 'Account Type',
dataIndex: 'owner_relationship',
key: 'owner_relationship',
render: (text, record) => (
<span>
{record.owner_relationship == 1?'家属':''}
{record.owner_relationship == 2?'租户':''}
</span>
),
},
/* {
title: '状态',
{
title: 'User Status',
dataIndex: 'status',
key: 'status',
defaultSortOrder: 'descend',
sorter: (a, b) => a.user_account - b.user_account,
render: (text, record) => (
<span>
{record.warnStatus == 1? "启用": "禁用"}
</span>
)
},*/
{record.status == 0?'未注册':''}
{record.status == 1?'注册':''}
{record.status == 2?'注销':''}
</span>
),
},
{
title: 'Actions',
dataIndex: 'action',
......@@ -410,39 +473,69 @@ class TosUserDetails extends React.Component {
columns2 = [
{
title: 'User Name',
dataIndex: 'owerName',
key: 'device_name',
dataIndex: 'owner_family_name',
key: 'owner_family_name',
},
{
title: 'Contact Details',
dataIndex: 'owerPhone',
key: 'device_model',
dataIndex: 'owner_family_phone',
key: 'owner_family_phone',
},
{
title: 'E-mail',
dataIndex: 'buildingNumber',
key: 'warn_type',
render: (text, record) => (
<span>
{record.warn_type == 1?'扫描模块故障':''}
{record.warn_type == 2?'打印机故障':''}
{record.warn_type == 3?'触摸屏故障':''}
{record.warn_type == 4?'副屏故障':''}
</span>
),
dataIndex: 'owner_family_email',
key: 'owner_family_email',
},
{
title: 'cdk_code',
dataIndex: 'cdk_code',
key: 'cdk_code',
},
/*{
title: 'community_name',
dataIndex: 'community_name',
key: 'community_name',
},
{
title: 'community_build',
dataIndex: 'community_build',
key: 'community_build',
},
{
title: 'community_floor',
dataIndex: 'community_floor',
key: 'community_floor',
},
{
title: 'communtiy_room',
dataIndex: 'communtiy_room',
key: 'communtiy_room',
},*/
{
title: 'Account Type',
dataIndex: 'enable',
key: 'warn_time',
dataIndex: 'owner_relationship',
key: 'owner_relationship',
render: (text, record) => (
<span>
{record.owner_relationship == 1?'家属':''}
{record.owner_relationship == 2?'租户':''}
</span>
),
},
{
title: 'User Status',
dataIndex: 'user_account',
key: 'user_account',
dataIndex: 'status',
key: 'status',
defaultSortOrder: 'descend',
sorter: (a, b) => a.user_account - b.user_account,
render: (text, record) => (
<span>
{record.status == 0?'未注册':''}
{record.status == 1?'注册':''}
{record.status == 2?'注销':''}
</span>
),
},
{
title: 'Actions',
......@@ -497,7 +590,7 @@ class TosUserDetails extends React.Component {
<div>
<span className={styles.detailsContent}>Name Of Owner</span>
<span className={styles.detailsContent2}>{tosUser}</span>
<span className={styles.detailsContent}>Kamon.Chen</span>
<span className={styles.detailsContent}>{this.props.location.query.owerName}</span>
<span className={styles.detailsContent2}>{tosUser}</span>
{/* <span className={styles.detailsContent}>设备ID</span>*/}
<span className={styles.detailsContent2}>{tosUser}</span>
......@@ -505,9 +598,9 @@ class TosUserDetails extends React.Component {
<div>
<span className={styles.detailsContent}>Contact Details</span>
<span className={styles.detailsContent3} style={{width:200}}>{tosUser}</span>
<span className={styles.detailsContent}>18817589685</span>
<span className={styles.detailsContent}>{this.props.location.query.owerPhone} </span>
<span className={styles.detailsContent2}>{tosUser}</span>
<span className={styles.detailsContent}>sales@huahuico.com</span>
<span className={styles.detailsContent}>{this.props.location.query.owerEmail}</span>
<span className={styles.detailsContent2}>{tosUser}</span>
</div>
{/*<div>*/}
......@@ -526,10 +619,10 @@ class TosUserDetails extends React.Component {
selectedKeys={[current]}
mode="horizontal">
<Menu.Item key="record" className={styles.menuItem}>
Sunshine Stanford
{this.props.location.query.communityName}
</Menu.Item>
<Menu.Item key="model">
Constant company
A9
</Menu.Item>
</Menu>
</div>
......@@ -539,13 +632,13 @@ class TosUserDetails extends React.Component {
<div>
<span className={styles.detailsContent}>Address</span>
<span className={styles.detailsContent2}>{tosUser}</span>
<span className={styles.detailsContent}>Singapore,Albert,Bugis</span>
<span className={styles.detailsContent}>{this.props.location.query.addressAndpostalCode}</span>
</div>
<div>
<span className={styles.detailsContent}>Unit No.</span>
<span className={styles.detailsContent2}>{tosUser}</span>
<span className={styles.detailsContent}>03#05-301</span>
<span className={styles.detailsContent}>{this.props.location.query.roomNumber}</span>
<span className={styles.detailsContent2}>{tosUser}</span>
</div>
......@@ -586,7 +679,7 @@ class TosUserDetails extends React.Component {
className={styles.table}
rowSelection={this.rowSelection}
columns={this.columns2}
dataSource={record}
dataSource={data}
size="small"
pagination={{showQuickJumper: true, pageSize: 10, total: total}}
/>
......@@ -605,7 +698,7 @@ class TosUserDetails extends React.Component {
className={styles.table}
rowSelection={this.rowSelection}
columns={this.columns2}
dataSource={record}
dataSource={data}
size="small"
pagination={{showQuickJumper: true, pageSize: 10, total: total}}
/>
......
......@@ -142,28 +142,31 @@ class TosUserEdit extends React.Component {
const params = {
type: this.state.type,
userID: nowUser,
userPhone:"18813787835"
// userPhone:"18813787835",
ownerId:this.props.location.query.id,
owerName:this.props.location.query.owerName,
communityName:this.props.location.query.communityName
};
this.props.dispatch({
type: 'tUModel/getTosUser',
type: 'tUModel/getOwnerDetail',
payload: params,
callback: (res) => {
if (res) {
console.log(res);
// if(res.error_code == "0000"){
this.setState({
data: res.rows,
total: res.total,
})
/* } else if(res.error_code == "0002") {
alert(res.error_msg);
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router.replace('/');
} else {
alert("获取警报数据失败!未知错误!");
}*/
if(res.error_code == "0000"){
this.setState({
data: res.data.rows,
total: res.data.total,
})
} else if(res.error_code == "0002") {
alert(res.error_msg);
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router.replace('/');
} else {
alert("获取失败!未知错误!");
}
}
}
});
......@@ -317,13 +320,64 @@ class TosUserEdit extends React.Component {
pathname: '/UserManagement/tosUser',
}))
};
//设备sn变更
snChange = (e) => {
this.setState({sn: e.target.value});
};
//设备sn变更
snChange1 = (e) => {
this.setState({sn1: e.target.value});
};
//设备sn变更
snChange2 = (e) => {
this.setState({sn2: e.target.value});
};
//提交
onSubmit = () => {
// this.phoneBlur();
this.phoneBlur();
};
phoneBlur = () => {
const params = {
id:this.props.location.query.id,
owerName: this.state.sn,
owerPhone:this.state.sn1,
owerEmail:this.state.sn2,
communityName:this.props.location.query.communityName,
buildingNumber:this.props.location.query.buildingNumber,
floorNumber:this.props.location.query.floorNumber,
roomNumber:this.props.location.query.roomNumber,
addressAndpostalCode:this.props.location.query.addressAndpostalCode
};
console.log("params",params);
this.props.dispatch({
type: 'tUModel/saveOwner',
payload: params,
callback: (res) => {
if (res.error_code == "0000") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0002") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0001"){
alert(res.error_msg);
} else if (res.error_code == "0003"){
alert(res.error_msg)
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router.replace('/');
}else {
alert("提交错误!未知原因!");
}
}
});
};
//初始化
componentDidMount() {
if (this.props.location.query != null) {
......@@ -332,9 +386,11 @@ class TosUserEdit extends React.Component {
current: params.current?params.current:'record',
},() => {
if(this.state.current == "record"){
this.getRecord();
// this.getRecord();
this.getData();
}else{
this.getData();
// this.getData();
}
});
}
......@@ -345,50 +401,70 @@ class TosUserEdit extends React.Component {
columns = [
{
title: 'User Name',
dataIndex: 'warnType',
key: 'warnType',
render: (text, record) => (
<span>
{record.warnType == 1?'扫描模块故障':''}
{record.warnType == 2?'打印机故障':''}
{record.warnType == 3?'触摸屏故障':''}
{record.warnType == 4?'副屏故障':''}
</span>
),
dataIndex: 'owner_family_name',
key: 'owner_family_name',
},
{
title: 'Contact Details',
dataIndex: 'warnContactsInformation',
key: 'warnContactsInformation',
dataIndex: 'owner_family_phone',
key: 'owner_family_phone',
},
{
title: 'E-mail',
dataIndex: 'warnDetails',
key: 'warnDetails',
dataIndex: 'owner_family_email',
key: 'owner_family_email',
},
{
title: 'cdk_code',
dataIndex: 'cdk_code',
key: 'cdk_code',
},
/*{
title: 'community_name',
dataIndex: 'community_name',
key: 'community_name',
},
{
title: 'community_build',
dataIndex: 'community_build',
key: 'community_build',
},
{
title: 'community_floor',
dataIndex: 'community_floor',
key: 'community_floor',
},
{
title: 'communtiy_room',
dataIndex: 'communtiy_room',
key: 'communtiy_room',
},*/
{
title: 'Account Type',
dataIndex: 'enable',
key: 'warn_time',
dataIndex: 'owner_relationship',
key: 'owner_relationship',
render: (text, record) => (
<span>
{record.owner_relationship == 1?'家属':''}
{record.owner_relationship == 2?'租户':''}
</span>
),
},
{
title: 'User Status',
dataIndex: 'user_account',
key: 'user_account',
dataIndex: 'status',
key: 'status',
defaultSortOrder: 'descend',
sorter: (a, b) => a.user_account - b.user_account,
render: (text, record) => (
<span>
{record.status == 0?'未注册':''}
{record.status == 1?'注册':''}
{record.status == 2?'注销':''}
</span>
),
},
/* {
title: '状态',
dataIndex: 'status',
key: 'status',
render: (text, record) => (
<span>
{record.warnStatus == 1? "启用": "禁用"}
</span>
)
},*/
{
title: 'Actions',
dataIndex: 'action',
......@@ -420,25 +496,55 @@ class TosUserEdit extends React.Component {
key: 'owner_family_email',
},
{
title: 'cdk_code',
dataIndex: 'cdk_code',
key: 'cdk_code',
},
/*{
title: 'community_name',
dataIndex: 'community_name',
key: 'community_name',
},
{
title: 'community_build',
dataIndex: 'community_build',
key: 'community_build',
},
{
title: 'community_floor',
dataIndex: 'community_floor',
key: 'community_floor',
},
{
title: 'communtiy_room',
dataIndex: 'communtiy_room',
key: 'communtiy_room',
},*/
{
title: 'Account Type',
dataIndex: 'owner_relationship',
key: 'owner_relationship',
render: (text, record) => (
<span>
{record.owner_relationship == 1?'家属':''}
{record.owner_relationship == 1?'家属':''}
{record.owner_relationship == 2?'租户':''}
</span>
</span>
),
},
{
title: 'User Status',
dataIndex: 'status',
key: 'status',
defaultSortOrder: 'descend',
sorter: (a, b) => a.user_account - b.user_account,
render: (text, record) => (
<span>
{record.status == 0?'未注册':''}
{record.status == 1?'注册':''}
{record.status == 2?'注销':''}
</span>
),
},
{
title: 'Actions',
......@@ -477,7 +583,7 @@ class TosUserEdit extends React.Component {
//渲染
render() {
const { data, total, typeList, current, record, visible,tosUser } = this.state;
const { data, total, typeList, current, record, visible,tosUser,sn,sn1,sn2 } = this.state;
const typeSelect = typeList.map((item, index) => (
<Select.Option value={index}>{item}</Select.Option>
......@@ -492,8 +598,8 @@ class TosUserEdit extends React.Component {
<div className={styles.detailsBox}>
<div>
<span className={styles.detailsContent}>Name Of Owner</span>
<Input className={styles.input} value={this.props.location.query.owerName} placeholder="Name"
/*onChange={(e) => this.snChange(e)}*/
<Input className={styles.input} value={sn} placeholder={this.props.location.query.owerName}
onChange={(e) => this.snChange(e)}
/>
<span className={styles.detailsContent2}>{tosUser}</span>
{/*<span className={styles.detailsContent}>锶想</span>*/}
......@@ -503,13 +609,13 @@ class TosUserEdit extends React.Component {
</div>
<div>
<span className={styles.detailsContent}>Contact Details</span>
<Input className={styles.input} value={this.props.location.query.owerPhone} placeholder="Telephone"
/*onChange={(e) => this.snChange(e)}*/
<Input className={styles.input} value={sn1} placeholder={this.props.location.query.owerPhone}
onChange={(e) => this.snChange1(e)}
/>
<span className={styles.detailsContent3} style={{width:200}}>{tosUser}</span>
{/*<span className={styles.detailsContent}>18817589685</span>*/}
<Input className={styles.input} value={this.props.location.query.owerEmail} placeholder="E-mail"
/*onChange={(e) => this.snChange(e)}*/
<Input className={styles.input} value={sn2} placeholder={this.props.location.query.owerEmail}
onChange={(e) => this.snChange2(e)}
/>
<span className={styles.detailsContent2}>{tosUser}</span>
{/*<span className={styles.detailsContent}>sales@huahuico.com</span>*/}
......@@ -534,7 +640,7 @@ class TosUserEdit extends React.Component {
{this.props.location.query.communityName}
</Menu.Item>
<Menu.Item key="model">
Constant company
A9
</Menu.Item>
</Menu>
</div>
......@@ -591,7 +697,7 @@ class TosUserEdit extends React.Component {
className={styles.table}
rowSelection={this.rowSelection}
columns={this.columns2}
dataSource={record}
dataSource={data}
size="small"
pagination={{showQuickJumper: true, pageSize: 10, total: total}}
/>
......@@ -610,7 +716,7 @@ class TosUserEdit extends React.Component {
className={styles.table}
rowSelection={this.rowSelection}
columns={this.columns2}
dataSource={record}
dataSource={data}
size="small"
pagination={{showQuickJumper: true, pageSize: 10, total: total}}
/>
......
......@@ -20,7 +20,19 @@ export async function getOwnerDetail(params) {
data: params,
});
}
export async function saveOwner(params) {
return request('/tos/tosOwner/save', {
method: 'POST',
data: params,
});
}
export async function updateOwner(params) {
return request('/tos/tosOwner/info/update', {
method: 'POST',
data: params,
});
}
export async function delAdvertisement(params) {
return request('/api/ad/del', {
method: 'POST',
......
......@@ -14,14 +14,16 @@ export function getAuthority(str?: string): string | string[] {
authority = authorityString;
}
if (typeof authority === 'string') {
return [authority];
// return [authority];
return ['admin'];
}
// preview.pro.ant.design only do not use in your production.
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
if (!authority && ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
return ['admin'];
}
return authority;
// return authority;
return ['admin'];
}
export function setAuthority(authority: string | string[]): void {
......
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