Commit c0cf7174 authored by 皮倩雯's avatar 皮倩雯

fix: '消息平台推送模板配置新增WEB,APP配置'

parent 9e324b11
Pipeline #49031 passed with stages
in 4 minutes 34 seconds
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-03-04 18:33:24 * @Date: 2022-03-04 18:33:24
* @LastEditTime: 2022-03-24 17:41:25 * @LastEditTime: 2022-04-27 14:26:14
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import { Tree } from 'antd'; import { Tree } from 'antd';
...@@ -18,7 +18,8 @@ export default props => { ...@@ -18,7 +18,8 @@ export default props => {
const { expandedKeys, onExpand, onSelect, selectedKeys, keepTree, ...rest } = props; const { expandedKeys, onExpand, onSelect, selectedKeys, keepTree, ...rest } = props;
const [epKeys, setEpKeys] = useState([expandedKeys]); const [epKeys, setEpKeys] = useState([expandedKeys]);
useEffect(() => { useEffect(() => {
console.log(expandedKeys, 'expandedKeys'); console.log(expandedKeys);
console.log(selectedKeys);
setEpKeys([expandedKeys]); setEpKeys([expandedKeys]);
}, [expandedKeys]); }, [expandedKeys]);
......
...@@ -31,6 +31,7 @@ const StandingBook = props => { ...@@ -31,6 +31,7 @@ const StandingBook = props => {
const [allData, setAllData] = useState([]); const [allData, setAllData] = useState([]);
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [treeLoading, setTreeLoading] = useState(false); const [treeLoading, setTreeLoading] = useState(false);
const [tableLoading, setTableLoading] = useState(false);
const [maxLength, setMaxLength] = useState(0); const [maxLength, setMaxLength] = useState(0);
const [treeVisible, setTreeVisible] = useState(true); // 左边列表是否可见 const [treeVisible, setTreeVisible] = useState(true); // 左边列表是否可见
const [formObj, setFormObj] = useState(''); const [formObj, setFormObj] = useState('');
...@@ -180,7 +181,7 @@ const StandingBook = props => { ...@@ -180,7 +181,7 @@ const StandingBook = props => {
setShowSearchStyle(false); setShowSearchStyle(false);
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示 // 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem); flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem);
// pickItem ? setPickItem(pickItem) : setPickItem(newArr[0]); setPickItem(newArr[0]);
console.log(newArr, 'newArr'); console.log(newArr, 'newArr');
setTableData(newArr); setTableData(newArr);
} }
...@@ -257,9 +258,9 @@ const StandingBook = props => { ...@@ -257,9 +258,9 @@ const StandingBook = props => {
const onSearch = () => { const onSearch = () => {
console.log(searchWord); console.log(searchWord);
console.log(pickItem); console.log(pickItem);
setTreeLoading(true); setTableLoading(true);
GetCM_Ledger_LoadLedgers({ accountName: searchWord }).then(res => { GetCM_Ledger_LoadLedgers({ accountName: searchWord }).then(res => {
setTreeLoading(false); setTableLoading(false);
if (res.msg === 'Ok' && res.data.root) { if (res.msg === 'Ok' && res.data.root) {
console.log(res.data.root); console.log(res.data.root);
setMaxLength(res.data.root.length + 1); setMaxLength(res.data.root.length + 1);
...@@ -270,7 +271,7 @@ const StandingBook = props => { ...@@ -270,7 +271,7 @@ const StandingBook = props => {
}); });
console.log(arr); console.log(arr);
setShowSearchStyle(true); setShowSearchStyle(true);
setAllData(arr); // setAllData(arr);
setSearchData(res.data.root); setSearchData(res.data.root);
setPickItem(''); setPickItem('');
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示 // 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
...@@ -285,7 +286,27 @@ const StandingBook = props => { ...@@ -285,7 +286,27 @@ const StandingBook = props => {
console.log(e.target.value); console.log(e.target.value);
setSearchWord(e.target.value); setSearchWord(e.target.value);
if (e.target.value == '') { if (e.target.value == '') {
handleReset(); setTableLoading(true);
GetCM_Ledger_LoadLedgers().then(res => {
setTableLoading(false);
if (res.msg === 'Ok' && res.data.root) {
console.log(res.data.root);
setMaxLength(res.data.root.length + 1);
let arr = formateArrDataA(res.data.root, 'type');
let newArr = [];
Object.keys(arr).map((item, index) => {
newArr.push(item);
});
console.log(arr);
setAllData(arr);
setShowSearchStyle(false);
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem);
setPickItem(newArr[0]);
console.log(newArr, 'newArr');
setTableData(newArr);
}
});
} }
}; };
...@@ -301,7 +322,6 @@ const StandingBook = props => { ...@@ -301,7 +322,6 @@ const StandingBook = props => {
}; };
const handleReset = () => { const handleReset = () => {
setFlag(flag + 1); setFlag(flag + 1);
setSearchWord('');
}; };
return ( return (
<PageContainer className={styles.userManageContainer}> <PageContainer className={styles.userManageContainer}>
...@@ -354,7 +374,10 @@ const StandingBook = props => { ...@@ -354,7 +374,10 @@ const StandingBook = props => {
[styles.pickItem]: item === pickItem, [styles.pickItem]: item === pickItem,
[styles.listHover]: item !== pickItem && item === hoverItemIndex, [styles.listHover]: item !== pickItem && item === hoverItemIndex,
})} })}
onClick={e => setPickItem(item)} onClick={() => {
setPickItem(item);
setSearchWord('');
}}
onMouseEnter={() => { onMouseEnter={() => {
setHoverItemIndex(item); setHoverItemIndex(item);
}} }}
...@@ -422,6 +445,7 @@ const StandingBook = props => { ...@@ -422,6 +445,7 @@ const StandingBook = props => {
}; };
}} }}
columns={columns} columns={columns}
loading={tableLoading}
dataSource={pickItem ? allData[pickItem] : searchData} dataSource={pickItem ? allData[pickItem] : searchData}
// loading={tableLoading} // loading={tableLoading}
scroll={{ x: 'max-content', y: 'calc(100vh - 180px)' }} scroll={{ x: 'max-content', y: 'calc(100vh - 180px)' }}
......
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