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
d3ab1d6c
Commit
d3ab1d6c
authored
Jun 16, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
d9facce0
d046de74
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
64 deletions
+58
-64
MyPopover.tsx
src/components/mui/MyPopover.tsx
+1
-1
fileList.ts
src/store/modules/fileList.ts
+2
-1
tusUpload.ts
src/utils/Upload/tusUpload.ts
+3
-2
index.tsx
src/views/ConsoleLayout/components/FileItem/index.tsx
+10
-8
index.tsx
src/views/Project/ProjectData/UpLoaderFile/index.tsx
+29
-48
index.tsx
src/views/Project/ProjectData/index.tsx
+9
-1
index.tsx
src/views/Project/ProjectSetting/ProjectMembers/index.tsx
+4
-3
No files found.
src/components/mui/MyPopover.tsx
View file @
d3ab1d6c
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-11 09:33:46
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-1
1 11:33:17
* @LastEditTime: 2022-06-1
6 11:50:31
* @FilePath: /bkunyun/src/components/mui/MyPopover.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
src/store/modules/fileList.ts
View file @
d3ab1d6c
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-13 17:00:19
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-16 0
2:15:55
* @LastEditTime: 2022-06-16 0
9:43:42
* @FilePath: /bkunyun/src/store/modules/upload.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -13,6 +13,7 @@ export interface IUploadInfo {
id
:
string
,
file
:
File
,
info
:
any
,
path
:
string
;
}
/** 存储地图派单websocket推送数据状态的store */
...
...
src/utils/Upload/tusUpload.ts
View file @
d3ab1d6c
import
useGlobalStore
from
"@/hooks/useGlobalStore"
;
import
{
toJS
}
from
"mobx"
;
import
*
as
tus
from
"tus-js-client"
;
import
{
verifyLettersNumbersCertainChars4
,
}
from
"../helper"
;
import
useGlobalStore
from
"@/hooks/useGlobalStore"
;
import
{
getTokenInfo
}
from
"../util"
;
const
UseTusUpload
=
(
uploadInfoStore
:
any
)
=>
{
...
...
@@ -19,7 +19,7 @@ const UseTusUpload = (uploadInfoStore: any) => {
url
:
string
,
fileToken
:
string
,
filepath
:
any
,
callBack
:
any
callBack
?
:
any
)
=>
{
if
(
!
verifyLettersNumbersCertainChars4
(
file
.
name
))
{
let
json
=
{
...
...
@@ -50,6 +50,7 @@ const UseTusUpload = (uploadInfoStore: any) => {
token
:
tokenInfo
?.
access_token
||
""
,
filetoken
:
fileToken
,
share
:
false
,
project
:
true
,
};
let
upload
=
new
tus
.
Upload
(
file
,
{
endpoint
:
url
,
...
...
src/views/ConsoleLayout/components/FileItem/index.tsx
View file @
d3ab1d6c
import
{
toJS
}
from
"mobx"
;
import
{
useNavigate
}
from
"react-router-dom"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useMemo
}
from
"react"
;
import
{
LinearProgress
}
from
"@mui/material"
;
import
styles
from
"./index.module.css"
;
import
{
useMemo
}
from
"react"
;
import
{
formatTime
,
storageUnitFromB
}
from
"@/utils/util"
;
import
useGlobalStore
from
"@/hooks/useGlobalStore"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
IUploadInfo
}
from
"@/store/modules/fileList"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
styles
from
"./index.module.css"
;
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-11 15:46:42
...
...
@@ -28,7 +29,7 @@ const FileItem = observer((props: IProps) => {
const
{
statusMsg
=
""
}
=
itemInfo
||
{};
const
uploadInfoStore
=
toJS
(
useGlobalStore
(
"fileListStore"
));
const
Message
=
useMessage
();
cons
ole
.
log
(
toJS
(
fileItemInfo
),
"11111"
);
cons
t
navigate
=
useNavigate
(
);
/** 时间 */
const
TimeText
=
useMemo
(()
=>
{
...
...
@@ -71,10 +72,11 @@ const FileItem = observer((props: IProps) => {
});
}
if
(
text
===
"查看文件"
)
{
console
.
log
(
"跳转"
);
navigate
(
`/product/cadd/projectData`
,
{
state
:
{
pathName
:
fileItemInfo
?.
path
},
});
}
};
return
(
<
div
className=
{
styles
.
itemBox
}
>
<
div
className=
{
styles
.
leftBox
}
>
...
...
@@ -105,7 +107,7 @@ const FileItem = observer((props: IProps) => {
<>
<
span
style=
{
{
color
:
"#8A9099"
}
}
>
已上传至
</
span
>
<
span
style=
{
{
color
:
"#565C66"
,
marginLeft
:
12
}
}
>
{
itemInfo
?.
dir
}
{
fileItemInfo
?.
path
}
</
span
>
</>
)
:
(
...
...
src/views/Project/ProjectData/UpLoaderFile/index.tsx
View file @
d3ab1d6c
...
...
@@ -8,7 +8,7 @@ import React, {
import
style
from
"./index.module.css"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
{
Button
}
from
"@mui/material"
;
import
{
getTokenInfo
,
uuid
}
from
"@/utils/util"
;
import
{
uuid
}
from
"@/utils/util"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useDropzone
}
from
"react-dropzone"
;
import
Table
from
"@/components/Material.Ui/Table"
;
...
...
@@ -20,7 +20,6 @@ import { storageUnitFromB } from "@/utils/util";
import
{
observer
}
from
"mobx-react"
;
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
{
IResponse
,
useHttp
}
from
"@/api/http"
;
import
useGlobalStore
from
"@/hooks/useGlobalStore"
;
import
{
APIOPTION
,
urlToken
}
from
"@/api/fileserver/raysyncApi"
;
import
UseTusUpload
from
"@/utils/Upload/tusUpload"
;
...
...
@@ -28,7 +27,6 @@ import UseTusUpload from "@/utils/Upload/tusUpload";
const
UpLoaderFile
=
observer
((
props
:
any
)
=>
{
const
{
fileListStore
}
=
useStores
();
const
message
=
useMessage
();
const
http
=
useHttp
();
const
[
fileList
,
setFileList
]
=
useState
<
any
>
([]);
// list 是项目数据table的数据
...
...
@@ -89,18 +87,6 @@ const UpLoaderFile = observer((props: any) => {
[
fileList
,
message
,
nowNameList
]
);
// const getRepeatName = (fList: Array<any>, Alist: Array<any>) => {
// let repeatName = "";
// Alist.forEach((aItem) => {
// fList.forEach((fItem: any) => {
// if (fItem.name === aItem.name) {
// repeatName = fItem.name;
// }
// });
// });
// return repeatName;
// };
const
{
getRootProps
,
getInputProps
,
isDragActive
}
=
useDropzone
({
onDrop
});
const
submitloading
=
false
;
...
...
@@ -109,34 +95,30 @@ const UpLoaderFile = observer((props: any) => {
const
getFileToken
=
useCallback
(
(
newFileList
:
any
)
=>
{
http
.
get
<
IResponse
<
any
>
>
(
`/cpp/data/filetoken?id=$
{
currentProjectStore
?.
currentProjectInfo
.
id
||
""
}
`
)
.then((res: any) =
>
{
let
url
=
APIOPTION
()
+
"/parallelupload/"
+
urlToken
(
res
?.
data
||
""
,
currentProjectStore
?.
currentProjectInfo
?.
id
as
string
);
newFileList
?.
forEach
((
item
:
any
)
=>
{
uploadFile
(
item
,
item
?.
file
,
url
,
res
.
data
,
"/"
,
(
upload
:
any
,
filepath
:
string
)
=>
console
.
log
(
upload
,
filepath
,
1111
)
);
});
}
);
let
url
=
APIOPTION
()
+
"/parallelupload/"
+
urlToken
(
currentProjectStore
?.
currentProjectInfo
?.
filetoken
||
""
,
currentProjectStore
?.
currentProjectInfo
?.
id
as
string
);
newFileList
?.
forEach
((
item
:
any
)
=>
{
uploadFile
(
item
,
item
?.
file
,
url
,
currentProjectStore
?.
currentProjectInfo
?.
filetoken
||
""
,
`
${
path
}
/
${
item
?.
file
?.
name
}
`
);
});
},
[currentProjectStore?.currentProjectInfo.id, http, uploadFile]
[
currentProjectStore?.currentProjectInfo?.filetoken,
currentProjectStore?.currentProjectInfo?.id,
path,
uploadFile,
]
);
const handleSubmit = () => {
...
...
@@ -144,10 +126,9 @@ const UpLoaderFile = observer((props: any) => {
fileList?.map((item: any) => {
return {
id: uuid(),
open
:
false
,
path
,
list: [],
file: item,
isPermanence
:
true
,
};
}) || [];
toJS(fileListStore?.setNewFileList)(newFileList);
...
...
@@ -159,12 +140,12 @@ const UpLoaderFile = observer((props: any) => {
const showDialog = () => {
dialogRef.current.handleClickOpen();
initData
()
initData()
;
};
const initData = ()
=
>
{
setFileList
([])
}
const initData = ()
=>
{
setFileList([])
;
}
;
useImperativeHandle(props.onRef, () => {
return {
...
...
src/views/Project/ProjectData/index.tsx
View file @
d3ab1d6c
...
...
@@ -24,6 +24,7 @@ import moment from "moment";
import
NoProject
from
"@/components/NoProject"
;
import
usePass
from
"@/hooks/usePass"
;
import
{
storageUnitFromB
}
from
"@/utils/util"
;
import
{
useLocation
}
from
"react-router-dom"
;
import
{
getDataFind
,
getDataFileSearch
}
from
"@/api/project_api"
;
const
theme
=
createTheme
({
...
...
@@ -58,8 +59,10 @@ const ProjectData = observer(() => {
if
(
!
projectId
||
!
fileToken
)
{
return
<
NoProject
/>;
}
/** 路由信息 */
const
location
=
useLocation
();
// 当前文件路径
const
[
path
,
setPath
]
=
useState
(
"/"
);
const
[
path
,
setPath
]
=
useState
<
String
>
(
"/"
);
const
[
tableLoadding
,
setTableLoadding
]
=
useState
(
false
);
// 防止用户连续点击文件夹造成路径显示错误
const
[
debounce
,
setDebounce
]
=
useState
(
false
);
...
...
@@ -85,6 +88,11 @@ const ProjectData = observer(() => {
}
};
useEffect
(()
=>
{
const
locationInfo
:
any
=
location
?.
state
;
setPath
(
locationInfo
?.
pathName
||
""
);
},
[
location
]);
// 列表展示的数据
const
showList
=
useMemo
(()
=>
{
if
(
activeTab
===
1
)
{
...
...
src/views/Project/ProjectSetting/ProjectMembers/index.tsx
View file @
d3ab1d6c
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-1
5 18:53:01
* @LastEditTime: 2022-06-1
6 11:30:25
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -25,8 +25,9 @@ import { IDialogInfo } from "./interface";
import
{
toJS
}
from
"mobx"
;
import
{
useStores
}
from
"@/store"
;
import
{
isProjectOwner
}
from
"@/utils/util"
;
import
{
observer
}
from
"mobx-react"
;
const
ProjectMembers
=
()
=>
{
const
ProjectMembers
=
observer
(
()
=>
{
const
http
=
useHttp
();
const
{
currentProjectStore
}
=
useStores
();
...
...
@@ -194,6 +195,6 @@ const ProjectMembers = () => {
/>
</>
);
};
}
)
;
export default memo(ProjectMembers);
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