Commit a6cadda8 authored by MrShi's avatar MrShi

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

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