Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sunyihao
bkunyun
Commits
86284fa3
Commit
86284fa3
authored
Jul 04, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: tabs 页面添加缓存
parent
295684d1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
43 deletions
+48
-43
Tabs.tsx
src/components/mui/Tabs.tsx
+5
-5
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+12
-4
index.tsx
src/views/Project/ProjectWorkbench/index.tsx
+22
-32
index.tsx
src/views/Project/components/Flow/index.tsx
+0
-1
project.ts
src/views/Project/project.ts
+9
-1
No files found.
src/components/mui/Tabs.tsx
View file @
86284fa3
...
...
@@ -2,13 +2,13 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-0
6-07 20:31:40
* @LastEditTime: 2022-0
7-04 20:08:29
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
memo
}
from
"react"
;
import
{
isEqual
}
from
"lodash"
;
import
{
useState
,
useMemo
,
useEffect
}
from
"react"
;
import
{
useState
}
from
"react"
;
import
{
Box
}
from
"@mui/system"
;
import
Tab
from
"@mui/material/Tab"
;
import
{
TabContext
,
TabList
,
TabPanel
}
from
"@mui/lab"
;
...
...
@@ -25,11 +25,12 @@ interface ITabList {
interface
IProps
{
tabList
:
ITabList
[];
defaultValue
?:
string
;
}
const
Tabs
=
(
props
:
IProps
)
=>
{
const
{
tabList
}
=
props
;
const
[
value
,
setValue
]
=
useState
(
tabList
.
filter
(
e
=>
!
e
.
hide
)[
0
].
value
);
const
{
tabList
,
defaultValue
}
=
props
;
const
[
value
,
setValue
]
=
useState
(
defaultValue
||
tabList
.
filter
(
e
=>
!
e
.
hide
)[
0
].
value
);
const
onChange
=
(
val
:
string
)
=>
{
setValue
(
val
);
...
...
@@ -54,7 +55,6 @@ const Tabs = (props: IProps) => {
onChange=
{
(
e
:
any
,
val
:
string
)
=>
{
onChange
(
val
);
}
}
aria
-
label=
"lab API tabs example"
>
{
tabList
?.
map
((
item
,
key
)
=>
{
if
(
item
.
hide
)
return
""
...
...
src/views/Project/ProjectJobDetail/index.tsx
View file @
86284fa3
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-0
6-29 17:07:49
* @LastEditTime: 2022-0
7-04 20:09:00
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -102,6 +102,14 @@ const ProjectSubmitWork = observer(() => {
}
};
/** 返回事件 */
const
onBack
=
useCallback
(()
=>
{
navigate
(
'/product/cadd/projectWorkbench'
,
{
state
:
{
type
:
'workbenchList'
}
})
},[
navigate
])
const
getOutouts
=
(
outputs
:
any
)
=>
{
if
(
outputs
)
{
let
result
=
Object
.
keys
(
outputs
);
...
...
@@ -184,7 +192,7 @@ const ProjectSubmitWork = observer(() => {
if
(
errorCode
===
0
)
{
message
.
success
(
"操作成功!"
);
}
navigate
(
-
1
);
onBack
()
},
});
...
...
@@ -195,7 +203,7 @@ const ProjectSubmitWork = observer(() => {
if
(
errorCode
===
0
)
{
message
.
success
(
"操作成功!"
);
}
navigate
(
-
1
);
onBack
()
},
});
...
...
@@ -259,7 +267,7 @@ const ProjectSubmitWork = observer(() => {
<
div
className=
{
styles
.
swHeaderLeft
}
>
<
IconButton
color=
"primary"
onClick=
{
()
=>
navigate
(
-
1
)
}
onClick=
{
onBack
}
aria
-
label=
"upload picture"
component=
"span"
size=
"small"
...
...
src/views/Project/ProjectWorkbench/index.tsx
View file @
86284fa3
/*
* @Author: rocosen
* @Date: 2022-06-12 10:05:13
* @LastEditors:
rocosen
* @LastEditTime: 2022-0
6-07 20:23:02
* @LastEditors:
吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-0
7-04 19:54:00
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
memo
,
useState
,
useMemo
,
useEffect
}
from
"react"
;
import
{
memo
,
useMemo
}
from
"react"
;
import
{
Box
}
from
"@mui/system"
;
import
{
useStores
}
from
"@/store/index"
;
import
NoProject
from
"@/components/NoProject"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useLocation
}
from
"react-router-dom"
;
import
projectImg
from
"@/assets/project/projectIconSmall.svg"
;
import
WorkbenchTemplate
from
"./workbenchTemplate"
;
import
WorkbenchList
from
"./workbenchList"
;
import
Tabs
from
"@/components/mui/Tabs"
;
import
usePass
from
"@/hooks/usePass"
;
import
Template
from
"@/assets/project/workbenchTemplate.svg"
import
Template_select
from
"@/assets/project/workbenchTemplate_select.svg"
import
List
from
"@/assets/project/workbenchList.svg"
...
...
@@ -25,18 +22,11 @@ import List_select from "@/assets/project/workbenchList_select.svg"
//ui
import
ButtonDemo
from
"@/views/mui_demo/button"
import
InputDemo
from
"@/views/mui_demo/input"
const
ProjectWorkbench
=
observer
(()
=>
{
const
{
currentProjectStore
}
=
useStores
();
const
isPass
=
usePass
();
const
location
:
any
=
useLocation
()
useEffect
(()
=>
{
console
.
log
(
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
'USER'
),
"11111111111"
);
console
.
log
(
isPass
(
"PROJECT_WORKBENCH_FLOES"
),
'wwwwwwwwwww'
)
},
[])
const
tabList
=
useMemo
(()
=>
{
return
[
...
...
@@ -56,22 +46,22 @@ const ProjectWorkbench = observer(() => {
icon
:
List
,
iconed
:
List_select
},
{
label
:
"按钮组件"
,
value
:
"MUI_BUTTON"
,
component
:
<
ButtonDemo
/>,
icon
:
List
,
iconed
:
List_select
},
{
label
:
"输入框组件"
,
value
:
"MUI_INPUT"
,
component
:
<
InputDemo
/>,
icon
:
List
,
iconed
:
List_select
},
//
{
//
label: "按钮组件",
//
value: "MUI_BUTTON",
//
component: <ButtonDemo />,
//
icon: List,
//
iconed: List_select
//
},
//
{
//
label: "输入框组件",
//
value: "MUI_INPUT",
//
component: <InputDemo />,
//
icon: List,
//
iconed: List_select
//
},
];
},
[]);
},
[
isPass
]);
return
(
...
...
@@ -83,7 +73,7 @@ const ProjectWorkbench = observer(() => {
</
span
>
</
div
>
<
Box
sx=
{
{
width
:
"100%"
,
typography
:
"body1"
}
}
>
<
Tabs
tabList=
{
tabList
}
/>
<
Tabs
tabList=
{
tabList
}
defaultValue=
{
location
?.
state
?.
type
||
'workbenchTemplate'
}
/>
</
Box
>
</
div
>
);
...
...
src/views/Project/components/Flow/index.tsx
View file @
86284fa3
...
...
@@ -120,7 +120,6 @@ const FlowNode = (props: any) => {
const
Flow
=
(
props
:
IProps
)
=>
{
const
{
tasks
,
onBatchClick
}
=
props
;
console
.
log
(
tasks
,
'tasks'
)
const
[
selectedNodeId
,
setSelectedNodeId
]
=
useState
<
string
>
(
""
);
/** 自定义的节点类型 */
const
nodeTypes
=
useMemo
(()
=>
{
...
...
src/views/Project/project.ts
View file @
86284fa3
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-17 14:48:57
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-04 19:38:48
* @FilePath: /bkunyun/src/views/Project/project.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
product
,
hpczone
,
getDataFileToken
}
from
"@/api/project_api"
;
export
const
getProjectList
=
async
()
=>
{
...
...
@@ -12,7 +20,7 @@ export const setFileServerEndPointLocalStorage = async (zoneId: string) => {
if
(
Array
.
isArray
(
res
))
{
res
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
id
===
zoneId
)
{
fileServerEndPoint
=
item
.
storageConfig
.
fileServerEndPoint
;
fileServerEndPoint
=
item
.
storageConfig
?
.
fileServerEndPoint
;
}
});
localStorage
.
setItem
(
"fileServerEndPoint"
,
fileServerEndPoint
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment