Commit 6bb60036 authored by 皮倩雯's avatar 皮倩雯

Merge branch 'master' of https://g.civnet.cn:8443/ReactWeb5/maintenance

# Conflicts: # src/pages/productCenter/productConfig/components/editForm.jsx
parents 7318ca79 66d003f4
Pipeline #44747 skipped with stages
......@@ -19,7 +19,7 @@
}
.modal {
.ant-tabs-content{
height: 100%;
// height: 100%;
.ant-tabs-tabpane{
padding-left: 0 !important;
}
......@@ -43,6 +43,7 @@
}
.search{
width: 50%;
margin: 10px 20px;
}
.hide{
display: none !important;
......
......@@ -460,13 +460,13 @@ class PicturesWall extends React.Component<PicturesWallType> {
}
return (
<TabPane tab={tabNames[item.moduleName] || item.moduleName} key={item.moduleName}>
{/* <Input
<Input
placeholder="搜索图库"
className={styles.search}
size="middle"
value={this.state.search}
onChange={e => this.setState({search: e.target.value})}
allowClear/> */}
allowClear/>
<div className={styles.imgBox}>
<Collapse
bordered
......
......@@ -34,6 +34,8 @@ const Workflow = () => {
const [treeVisible, setTreeVisible] = useState(true);
const [chartLoading, setChartLoading] = useState(false); // 流程图的loading
const [canSelect, setCanSelect] = useState(true); // 是否可以切换树
const [expandedKey, setExpandedKey] = useState(''); // 默认展开项
const [flag, setFlag] = useState(1);
const [visible, setVisible] = useState({
FlowModal: false,
FlowGroupModal: false,
......@@ -41,6 +43,27 @@ const Workflow = () => {
useEffect(() => {
getFlowList();
}, []);
useEffect(() => {
if (flag === 2) {
console.log(treeData);
setExpandedKey(treeData[0].name + 0);
setCurrentSelectId(treeData[0].children[0].FlowID);
setTreeId(treeData[0].children[0].FlowID);
GetFlowNode({ flowID: treeData[0].children[0].FlowID }).then(res => {
setChartLoading(false);
if (res.code === 0) {
setFlowData(res.data);
} else {
setFlowData({ Nodes: [], Lines: [] });
notification.error({
title: '提示',
duration: 3,
description: res.msg,
});
}
});
}
}, [treeData]);
// 弹窗显示控制
const showModal = (key, value) => {
setVisible({ ...visible, [key]: value });
......@@ -51,6 +74,7 @@ const Workflow = () => {
WFGetAllFlow().then(res => {
setTreeLoading(false);
if (res.code === 0) {
setFlag(flag + 1);
let data = res.data.map(item => {
item.isOld = true;
return item;
......@@ -269,6 +293,7 @@ const Workflow = () => {
onSelect={onSelect}
selectedKeys={[currentSelectId]}
treeData={treeData.map((item, index) => mapTree(item, index))}
expandedKeys={expandedKey}
/>
</div>
</div>
......
......@@ -46,6 +46,7 @@ const MiniMenu = props => {
const [submitLoading, setSubmitLoading] = useState(false);
const [addList, setAddList] = useState([]);
const [newTreeList, setNewTreeList] = useState([]);
const [expendKey, setExpendKey] = useState(''); // 保存默认展开项
// 获取菜单树
useEffect(() => {
......@@ -66,6 +67,10 @@ const MiniMenu = props => {
}, [flag, clientName]);
// 获取菜单信息
useEffect(() => {
console.log(flag, 'flag');
if (flag === 2) {
setExpendKey(menuID);
}
getInfo();
}, [menuID]);
......@@ -86,6 +91,32 @@ const MiniMenu = props => {
const result = obj.children[1].children;
console.log(result, 'result');
setTreeData(result);
if (result.length > 0) {
setFlag(flag + 1);
if (flag === 1) {
setMenuID(result[0].menuID);
switch (result[0].menuType) {
case 'MiniAppMenuGroup':
setNodeType(1);
setAddType(2);
break;
case 'MiniAppMenuGroupTwo':
setNodeType(2);
setAddType(4);
break;
case 'MiniAppMenu':
setNodeType(3);
setAddType(3);
break;
case 'MiniAppMenuThree':
setNodeType(4);
setAddType(4);
break;
default:
break;
}
}
}
setLoading(false);
// 第一次加载,默认选择第一个组织
// if (treeFlag) {
......@@ -573,7 +604,7 @@ const MiniMenu = props => {
onDrop={handleDrop}
// onDragEnter={handleDragEnter}
selectedKeys={[menuID]}
// expandedKeys={[menuID]}
expandedKeys={expendKey}
/>
</div>
) : (
......
......@@ -78,7 +78,7 @@ const EditForm = props => {
// },
// ]}
>
<Input placeholder="请输入产品名称" allowClear disabled />
<Input placeholder="请输入产品名称" allowClear />
</Item>
<Item
label="产品说明:"
......@@ -91,7 +91,7 @@ const EditForm = props => {
// },
// ]}
>
<Input placeholder="请输入产品说明" disabled />
<Input placeholder="请输入产品说明" />
</Item>
<Item
label="发布状态:"
......
......@@ -49,7 +49,7 @@ const MiniMenu = props => {
const [newTreeList, setNewTreeList] = useState([]);
const [checkList, setCheckList] = useState([]);
const [flagg, setFlagg] = useState(0);
const [expendKey, setExpendKey] = useState(''); // 保存默认展开项
const [menuList, setMenuList] = useState([]); // 菜单树
const [keepId, setKeepId] = useState('');
......@@ -58,6 +58,10 @@ const MiniMenu = props => {
// 获取菜单信息
useEffect(() => {
console.log(menuID, flag);
if (flag === 1) {
setExpendKey(menuID);
}
getInfo();
}, [menuID, webid]);
useEffect(() => {
......@@ -112,7 +116,6 @@ const MiniMenu = props => {
};
// 树的点击事件
const handleSelect = (prop, treeNode) => {
console.log(prop);
if (treeNode) {
const {
node: { menuType },
......@@ -422,6 +425,25 @@ const MiniMenu = props => {
console.log(arr2[0]);
setKeepId(arr2[0]);
setMenuList(arr2 || []);
// 进页面后默认展示第一条数据
if (arr2.length > 0) {
if (flag === 1) {
setMenuID(arr2[0].menuID);
setCurMenuType(arr2[0].menuType);
switch (arr2[0].menuType) {
case 'Web4MenuGroup':
setNodeType(2);
setAddType(2);
break;
default:
setNodeType(1);
setAddType(1);
break;
}
}
setFlag(flag + 1);
}
}
})
.catch(err => {
......@@ -567,7 +589,7 @@ const MiniMenu = props => {
autoExpandParent
selectedKeys={[menuID]}
onDrop={handleDrop}
// expandedKeys={[menuID]}
expandedKeys={expendKey}
/>
</div>
)}
......
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