Commit 67c11eeb authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent 64e50d1e
......@@ -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: { '^': '' },
},
},
};
......@@ -14,18 +14,23 @@ export default {
Data3: null,
DataSave: null,
DataSaveDetail: null,
sourceData: null,
curString: {
subscribeDate: null,
status: 0,
communityNameList: null,
communityNameList2: null,
tab: 1,
curPage: 1,
curPage2: 1,
globalMark: 'yes',
//表格1搜索条件
search: {
communityNameList: null, // 小区
status: 0, //状态
subscribeDate: null, // 时间
pageNum: 1, // 页码
globalMark: 'yes', // 状态
},
//表格2搜索条件
search2: {
communityNameList: null, //选择小区
facilityName: null, // 设施名
pageNum: '1', // 页码
},
tab: 1, // 是哪一张表格
Result: null,
......@@ -73,8 +78,19 @@ export default {
returnSource(state, { sourceData }) {
return { ...state, sourceData };
},
returnCurString(state, { curString }) {
return { ...state, curString };
// 表格
returnTab(state, { tabs }) {
let tab = tabs;
console.log({ ...state, tab });
return { ...state, tab };
},
// 表格1 搜索条件
returnCurString(state, { search }) {
return { ...state, search };
},
// 表格2 搜索条件
returnCurString2(state, { search2 }) {
return { ...state, search2 };
},
returnResult(state, { Result }) {
return { ...state, Result };
......@@ -238,9 +254,22 @@ export default {
yield put({ type: 'returnSource', sourceData });
},
// 当前表格
*TB({ playload }, { call, put }) {
console.log(playload);
var tabs = playload;
yield put({ type: 'returnTab', tabs });
},
// 搜索条件
*QA({ playload }, { call, put }) {
var curString = playload;
yield put({ type: 'returnCurString', curString });
var search = playload;
yield put({ type: 'returnCurString', search });
},
// 拉取条件
*QA2({ playload }, { call, put }) {
var search2 = playload;
yield put({ type: 'returnCurString2', search2 });
},
*ResultClear({}, { put }) {
......
......@@ -13,7 +13,7 @@ import { RA } from '@/utils/method';
const Account = (props: any) => {
const module = 'Account';
const { dispatch, SubResult, loading, user, Info } = props;
const { dispatch, SubResult, load, user, Info } = props;
// 权限列表
const treeData = localStorage.getItem('umi_locale') == 'zh-CN' ? zhCnFaci : enUsFaci;
......@@ -28,6 +28,9 @@ const Account = (props: any) => {
const [towAccountId, settowAccountId] = useState(null); // 二级账户id
const [treeDataList, settreeDataList] = useState(treeData); // 权限列表
// 加载情况
const [loading, setLoading] = useState(true);
// 表单标识
const [form] = Form.useForm();
const formRef = useRef(null);
......@@ -82,6 +85,7 @@ const Account = (props: any) => {
// 赋值改变
treeDatas[0].children = _p;
settreeDataList(treeDatas as any); // 可勾选列表
setLoading(false);
}
}, [user, values]);
......@@ -93,6 +97,7 @@ const Account = (props: any) => {
message.success('Submitted Successfully !');
dispatch({ type: module + '/ReData' });
dispatch({ type: module + '/AccountClear' });
setLoading(false);
history.go(-1);
}
}
......@@ -208,6 +213,7 @@ const Account = (props: any) => {
// console.log(obj);
RA(38, value, module, dispatch); // 信息上传
RA(42, obj, module, dispatch); // 权限上传
setLoading(true);
return true;
}
};
......@@ -272,7 +278,7 @@ const Account = (props: any) => {
};
return (
<Spin spinning={loading}>
<Spin spinning={load || loading}>
<div className="contop" style={{ padding: '12px 20px' }}>
<h3 className="capi">
<EditOutlined />
......@@ -376,7 +382,7 @@ const Account = (props: any) => {
<div className="diy">
<div className="label"></div>
<div className="label">
<Button type="primary" htmlType="submit" loading={loading}>
<Button type="primary" htmlType="submit" loading={load || loading}>
Submit
</Button>
</div>
......@@ -389,14 +395,14 @@ const Account = (props: any) => {
const AccountProps = (state: any) => {
const { Data, DataSave, DataSaveDetail, Result, SubResult, Info } = state.Account;
const loading = state.loading.global;
const load = state.loading.global;
const { user } = state;
return {
Data,
DataSave,
DataSaveDetail,
Result,
loading,
load,
user, // 获取当前账户信息
SubResult,
Info,
......
import React, { useState, useEffect, useRef } from 'react';
import { Form, Input, Button, message, Descriptions, Spin, Tree, Radio, Select, Modal } from 'antd';
import { connect, history } from 'umi';
import { connect, history, Prompt } from 'umi';
import { EditOutlined, LeftOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import './Account.less';
......@@ -13,7 +13,7 @@ import { RA } from '@/utils/method';
const Account = (props: any) => {
const module = 'Account';
const { Option } = Select;
const { dispatch, SubResult, loading, user, DataSave, Permission, Info } = props;
const { dispatch, SubResult, user, DataSave, Permission, Info, load } = props;
// 权限列表
const treeData = localStorage.getItem('umi_locale') == 'zh-CN' ? zhCnFaci : enUsFaci;
......@@ -32,6 +32,9 @@ const Account = (props: any) => {
// const [frequency, setfrequency] = useState(0); // 权限列表
const [TreeDisabled, setTreeDisabled] = useState(true); // 权限是否可编辑
// 加载情况
const [loading, setLoading] = useState(true);
// 表单标识
const [form] = Form.useForm();
const formRef = useRef(null);
......@@ -75,7 +78,7 @@ const Account = (props: any) => {
}
}, [DataSave, user]);
// 提交信息结果
//提交信息结果
useEffect(() => {
if (SubResult != null) {
if (SubResult.statr == 0 && SubResult.desc == 0) {
......@@ -83,12 +86,13 @@ const Account = (props: any) => {
message.success('Submitted Successfully !');
dispatch({ type: module + '/ReData' });
dispatch({ type: module + '/AccountClear' });
setLoading(true);
history.go(-1);
}
}
}, [SubResult]);
// 已选权限
// 获取已选权限
useEffect(() => {
if (Permission != null) {
let data = Permission.curUserPermission ? Permission.curUserPermission.split(',') : [];
......@@ -150,6 +154,7 @@ const Account = (props: any) => {
}
setCheckedKeys(data);
setLoading(false);
}
}, [Permission, DataSave]);
......@@ -226,8 +231,17 @@ const Account = (props: any) => {
permissionArray: newData,
subPermissionArray,
};
// Promise.all([RA(38, value, module, dispatch), RA(42, obj, module, dispatch)]).then(
// (v: any) => {
// console.log(v);
// },
// (e: any) => {
// console.log(e);
// },
// );
RA(38, value, module, dispatch); // 信息上传
RA(42, obj, module, dispatch); // 权限上传
setLoading(true);
return true;
}
};
......@@ -540,7 +554,7 @@ const Account = (props: any) => {
/* --------------------------- 更新 End---------------------------------- */
return (
<Spin spinning={loading}>
<Spin spinning={loading || load}>
<div className="contop" style={{ padding: '12px 20px' }}>
<h3 className="capi">
<EditOutlined />
......@@ -661,7 +675,7 @@ const Account = (props: any) => {
<div className="diy">
<div className="label"></div>
<div className="label">
<Button type="primary" htmlType="submit" loading={loading}>
<Button type="primary" htmlType="submit" loading={loading || load}>
Submit
</Button>
</div>
......@@ -673,20 +687,19 @@ const Account = (props: any) => {
};
const AccountProps = (state: any) => {
// console.log(state.loading);
const { Data, DataSave, DataSaveDetail, Result, SubResult, Permission, Info } = state.Account;
const loading = state.loading.global;
const { user } = state;
const load = state.loading.global;
return {
Data,
DataSave,
DataSaveDetail,
Result,
loading,
Permission,
user, // 获取当前账户信息
SubResult,
Info,
load,
};
};
......
......@@ -46,7 +46,8 @@ const VisitorRecord = (props: any) => {
// 点击搜索
const onSubmitForm = (value: any) => {
let obj = {
communityNames: value.community.value,
communityNames:
value.community.value && value.community.value.length > 0 ? value.community.value : null,
inviterName: value.inviterName ? value.inviterName : null,
showTime: value.showTime ? moment(value.showTime).format('YYYY-MM-DD') : null,
pageNum: 1,
......
......@@ -46,7 +46,8 @@ const VisitorRecord = (props: any) => {
// 点击搜索
const onSubmitForm = (value: any) => {
let obj = {
communityNames: value.community.value,
communityNames:
value.community.value && value.community.value.length > 0 ? value.community.value : null,
inviterName: value.inviterName ? value.inviterName : null,
showTime: value.showTime ? moment(value.showTime).format('YYYY-MM-DD') : null,
pageNum: 1,
......
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