|
|
@@ -146,9 +146,12 @@ export default observer(function Frame(props) {
|
|
146
|
146
|
const history = useHistory();
|
|
147
|
147
|
const [curKey, setKey] = useState("1");
|
|
148
|
148
|
const moveBar = useRef();
|
|
149
|
|
- const $search = useRef();
|
|
150
|
|
- const leftMenu = useRef();
|
|
151
|
|
- const [isMove, setisMove] = useState(false);
|
|
|
149
|
+ const [isMove,setisMove] = useState(false);
|
|
|
150
|
+ const name_arr = {
|
|
|
151
|
+ "#/home/gvc": "产供销价值链",
|
|
|
152
|
+ "#/home/operation": "运营数据中心",
|
|
|
153
|
+ }
|
|
|
154
|
+ const [titleName, setTitleName] = useState(name_arr[window.location.hash]);
|
|
152
|
155
|
|
|
153
|
156
|
const { Search } = Input;
|
|
154
|
157
|
let showIds = $store.app.showIds;
|
|
|
@@ -187,37 +190,6 @@ export default observer(function Frame(props) {
|
|
187
|
190
|
const moveLeftMenu = () => {
|
|
188
|
191
|
setisMove(true);
|
|
189
|
192
|
};
|
|
190
|
|
- const handleClick = (data) => {
|
|
191
|
|
-
|
|
192
|
|
- let { key } = data;
|
|
193
|
|
- let item = JSON.parse(key || "{}");
|
|
194
|
|
- if (item.openType === "close") {
|
|
195
|
|
- message.destroy();
|
|
196
|
|
- return message.warning("该菜单暂未开放");
|
|
197
|
|
- }
|
|
198
|
|
- modelMsgs.isShow(item.resourceId, item.resourceName,item);
|
|
199
|
|
- $store.app.setNavList({
|
|
200
|
|
- name: item.resourceName,
|
|
201
|
|
- path: item.resourceUrl,
|
|
202
|
|
- type: item.resourceType,
|
|
203
|
|
- openType: item.openType,
|
|
204
|
|
- id: item.resourceId,
|
|
205
|
|
- });
|
|
206
|
|
-
|
|
207
|
|
- $store.app.setCurNav(item.resourceUrl);
|
|
208
|
|
-
|
|
209
|
|
- sessionStorage.setItem("curNodeId", item.resourceId);
|
|
210
|
|
- // sessionStorage.setItem("jumpType", item.props.type);
|
|
211
|
|
-
|
|
212
|
|
- dealDiffSheetType(item).then((response) => {
|
|
213
|
|
- if (response.type === "sys") {
|
|
214
|
|
- history.push(response.link);
|
|
215
|
|
- } else {
|
|
216
|
|
- history.push(`/home/outer/${response.activeItem.resourceId}`);
|
|
217
|
|
- }
|
|
218
|
|
- });
|
|
219
|
|
- saveMenu(item);
|
|
220
|
|
- };
|
|
221
|
193
|
|
|
222
|
194
|
/**打开 报表目录 */
|
|
223
|
195
|
const openReportDire = (key) => {
|
|
|
@@ -260,181 +232,6 @@ export default observer(function Frame(props) {
|
|
260
|
232
|
};
|
|
261
|
233
|
}, [$store.app.refresh]);
|
|
262
|
234
|
|
|
263
|
|
- function loopMenu(list) {
|
|
264
|
|
- if(!$store.app.curNav){$store.app.curNav = ""}
|
|
265
|
|
- return list.map((menu, index) => {
|
|
266
|
|
- if (menu.resourceType !== "module_menu" && menu.resourceList.length > 0) {
|
|
267
|
|
- return (
|
|
268
|
|
- <SubMenu
|
|
269
|
|
- key={`${menu.resourceId}Sub`}
|
|
270
|
|
- title={menu.resourceName}
|
|
271
|
|
- icon={iconObj[menu.resourceIcon]}
|
|
272
|
|
- className={`normal_menu ${menu.resourceUrl === $store.app.curNav || $store.app.curNav.indexOf('/'+menu.resourceId) > -1 ? "click_active" : ""
|
|
273
|
|
- }`}
|
|
274
|
|
- onTitleClick={(val, domEvent) => {
|
|
275
|
|
- let titleKey = val.key.slice(
|
|
276
|
|
- 0,
|
|
277
|
|
- val.key.length - 3
|
|
278
|
|
- ); /**侧边父级id */
|
|
279
|
|
- let activeUrl = $store.app.activedUrl;
|
|
280
|
|
- sessionStorage.setItem("resourceName", menu.resourceName);
|
|
281
|
|
- if (
|
|
282
|
|
- activeUrl.indexOf("/home/outer") > -1 ||
|
|
283
|
|
- activeUrl === "/home/report" ||
|
|
284
|
|
- activeUrl === "/home/write"
|
|
285
|
|
- ) {
|
|
286
|
|
- openReportDire(titleKey);
|
|
287
|
|
- }
|
|
288
|
|
- }}
|
|
289
|
|
- // style={{ backgroundColor: "#031646" }}
|
|
290
|
|
- >
|
|
291
|
|
- {loopMenu(menu.resourceList)}
|
|
292
|
|
- </SubMenu>
|
|
293
|
|
- );
|
|
294
|
|
- } else {
|
|
295
|
|
- return (
|
|
296
|
|
- <>
|
|
297
|
|
- <Menu.Item
|
|
298
|
|
- key={JSON.stringify(menu)}
|
|
299
|
|
- icon={iconObj[menu.resourceIcon]}
|
|
300
|
|
- className={`${menu.resourceUrl === $store.app.curNav || $store.app.curNav.indexOf('/'+menu.resourceId) > -1
|
|
301
|
|
- ? "click_active"
|
|
302
|
|
- : "normal_menu"
|
|
303
|
|
- }`}
|
|
304
|
|
- // style={{ backgroundColor: "#031646" }}
|
|
305
|
|
- >
|
|
306
|
|
- <span>
|
|
307
|
|
- <span className="text_over" title={menu.resourceName}>
|
|
308
|
|
- {menu.resourceName}
|
|
309
|
|
- </span>
|
|
310
|
|
- {menu.resourceType.match(/fine_bi|dmpReport|report|yonghong/) && (
|
|
311
|
|
- <>
|
|
312
|
|
- {/* <span
|
|
313
|
|
- style={{ paddingLeft: 5 }}
|
|
314
|
|
- onClick={(e) => {
|
|
315
|
|
- e.stopPropagation();
|
|
316
|
|
- getMenuDesc({
|
|
317
|
|
- resourceId: menu.resourceId,
|
|
318
|
|
- }).then(({ data, resultCode }) => {
|
|
319
|
|
- if (+resultCode === 0) {
|
|
320
|
|
- $store.app.setMetaData({
|
|
321
|
|
- data,
|
|
322
|
|
- visible: true,
|
|
323
|
|
- });
|
|
324
|
|
- }
|
|
325
|
|
- });
|
|
326
|
|
- }}
|
|
327
|
|
- >
|
|
328
|
|
- <InfoCircleOutlined />
|
|
329
|
|
- </span> */}
|
|
330
|
|
-
|
|
331
|
|
- <span
|
|
332
|
|
- className={menu.isCare ? "care_color" : "emptystar"}
|
|
333
|
|
- twotonecolor ="#FFBF00"
|
|
334
|
|
- style={{ paddingLeft: 5 }}
|
|
335
|
|
- onClick={(e) => {
|
|
336
|
|
- menu.isCare = !menu.isCare;
|
|
337
|
|
- $store.sysMenu.setSubmenuList(
|
|
338
|
|
- $store.sysMenu.submenuList
|
|
339
|
|
- );
|
|
340
|
|
- sessionStorage.setItem(
|
|
341
|
|
- "subMenuList",
|
|
342
|
|
- JSON.stringify($store.sysMenu.submenuList)
|
|
343
|
|
- );
|
|
344
|
|
-
|
|
345
|
|
- const config = {
|
|
346
|
|
- isCare: menu.isCare,
|
|
347
|
|
- resourceId: menu.resourceId,
|
|
348
|
|
- };
|
|
349
|
|
- careOrCancelResource(config).then(
|
|
350
|
|
- ({ data, resultCode }) => {
|
|
351
|
|
- if (+resultCode === 0) {
|
|
352
|
|
- message.success(
|
|
353
|
|
- menu.isCare ? "关注成功" : "取消关注成功"
|
|
354
|
|
- );
|
|
355
|
|
- //重新发送请求
|
|
356
|
|
- let subMenuList = JSON.parse(
|
|
357
|
|
- sessionStorage.getItem("subMenuList")
|
|
358
|
|
- );
|
|
359
|
|
- subMenuList.filter((item) => {
|
|
360
|
|
- if (item.resourceId === menu.resourceId) {
|
|
361
|
|
- }
|
|
362
|
|
- });
|
|
363
|
|
- }
|
|
364
|
|
- }
|
|
365
|
|
- );
|
|
366
|
|
- e.stopPropagation();
|
|
367
|
|
- }}
|
|
368
|
|
- >
|
|
369
|
|
- {menu.isCare ? <StarFilled /> : <StarOutlined />}
|
|
370
|
|
- </span>
|
|
371
|
|
- </>
|
|
372
|
|
- )}
|
|
373
|
|
- </span>
|
|
374
|
|
- </Menu.Item>
|
|
375
|
|
- </>
|
|
376
|
|
- );
|
|
377
|
|
- }
|
|
378
|
|
- });
|
|
379
|
|
- }
|
|
380
|
|
-
|
|
381
|
|
- function loopMenu2(list) {
|
|
382
|
|
- // console.log("showIds==", [...showIds]);
|
|
383
|
|
- return list.map((menu, index) => {
|
|
384
|
|
- if (showIds.indexOf(menu.resourceId) === -1) {
|
|
385
|
|
- return null;
|
|
386
|
|
- }
|
|
387
|
|
- if (menu.resourceList.length > 0) {
|
|
388
|
|
- return (
|
|
389
|
|
- <SubMenu
|
|
390
|
|
- key={`${menu.resourceId}Sub`}
|
|
391
|
|
- title={menu.resourceName}
|
|
392
|
|
- icon={iconObj[menu.resourceIcon]}
|
|
393
|
|
- className={`normal_menu ${menu.resourceUrl === $store.app.curNav ? "click_active" : ""
|
|
394
|
|
- }`}
|
|
395
|
|
- onTitleClick={(val, domEvent) => {
|
|
396
|
|
- let titleKey = val.key.slice(
|
|
397
|
|
- 0,
|
|
398
|
|
- val.key.length - 3
|
|
399
|
|
- ); /**侧边父级id */
|
|
400
|
|
- let activeUrl = $store.app.activedUrl;
|
|
401
|
|
- sessionStorage.setItem("resourceName", menu.resourceName);
|
|
402
|
|
- if (
|
|
403
|
|
- activeUrl.indexOf("/home/outer") > -1 ||
|
|
404
|
|
- activeUrl === "/home/report" ||
|
|
405
|
|
- activeUrl === "/home/write"
|
|
406
|
|
- ) {
|
|
407
|
|
- openReportDire(titleKey);
|
|
408
|
|
- }
|
|
409
|
|
- }}
|
|
410
|
|
- // style={{ backgroundColor: "#031646" }}
|
|
411
|
|
- >
|
|
412
|
|
- {loopMenu2(menu.resourceList)}
|
|
413
|
|
- </SubMenu>
|
|
414
|
|
- );
|
|
415
|
|
- } else {
|
|
416
|
|
- return (
|
|
417
|
|
- <>
|
|
418
|
|
- <Menu.Item
|
|
419
|
|
- key={JSON.stringify(menu)}
|
|
420
|
|
- icon={iconObj[menu.resourceIcon]}
|
|
421
|
|
- className={`${menu.resourceUrl === $store.app.curNav
|
|
422
|
|
- ? "click_active"
|
|
423
|
|
- : "normal_menu"
|
|
424
|
|
- }`}
|
|
425
|
|
- // style={{ backgroundColor: "#031646" }}
|
|
426
|
|
- >
|
|
427
|
|
- <span>
|
|
428
|
|
- <span className="text_over" title={menu.resourceName}>
|
|
429
|
|
- {menu.resourceName}
|
|
430
|
|
- </span>
|
|
431
|
|
- </span>
|
|
432
|
|
- </Menu.Item>
|
|
433
|
|
- </>
|
|
434
|
|
- );
|
|
435
|
|
- }
|
|
436
|
|
- });
|
|
437
|
|
- }
|
|
438
|
235
|
const onRef = (ref) => {
|
|
439
|
236
|
setModelMsgs(ref);
|
|
440
|
237
|
};
|
|
|
@@ -446,13 +243,15 @@ export default observer(function Frame(props) {
|
|
446
|
243
|
};
|
|
447
|
244
|
const onRef2 = (ref) => {
|
|
448
|
245
|
setTipMsgs(ref);
|
|
449
|
|
- console.log(tipMsgs,"tipMsgs")
|
|
|
246
|
+ console.log(tipMsgs, "tipMsgs")
|
|
450
|
247
|
};
|
|
451
|
248
|
|
|
452
|
249
|
return (
|
|
453
|
250
|
<div className={styles.frame}>
|
|
454
|
|
- <Top />
|
|
455
|
|
- <ModelMsg onRef={onRef} getTips={getTips} cleatTips={cleatTips}/>
|
|
|
251
|
+ <Top names={titleName}/>
|
|
|
252
|
+ <ModelMsg onRef={onRef} getTips={getTips} cleatTips={cleatTips} changeName={(name) => {
|
|
|
253
|
+ setTitleName(name);
|
|
|
254
|
+ }} />
|
|
456
|
255
|
|
|
457
|
256
|
{/* 断网或超时显示提示 */}
|
|
458
|
257
|
{/* <div className="nowifi-tip">当前网络状态不佳</div> */}
|
|
|
@@ -475,7 +274,7 @@ export default observer(function Frame(props) {
|
|
475
|
274
|
>
|
|
476
|
275
|
<Navigator
|
|
477
|
276
|
style={{
|
|
478
|
|
- display:"none",
|
|
|
277
|
+ display: "none",
|
|
479
|
278
|
}}
|
|
480
|
279
|
/>
|
|
481
|
280
|
<TipMsg onRef={onRef2}></TipMsg>
|