Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
ff634b9a
提交
ff634b9a
authored
7月 01, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
eaa31506
18e30af0
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
61 行增加
和
106 行删除
+61
-106
index.tsx
components/uploader/index.tsx
+4
-0
index.page.tsx
pages/JoinPolicy/index.page.tsx
+29
-19
index.tsx
...quipmentLeasing/detail/components/orderForGoods/index.tsx
+1
-1
index.tsx
pages/forum/components/publishMessage/index.tsx
+24
-71
index.page.tsx
pages/forum/index.page.tsx
+1
-14
index.tsx
pages/jobServices/api/index.tsx
+1
-0
index.page.tsx
pages/jobServices/index.page.tsx
+1
-1
没有找到文件。
components/uploader/index.tsx
浏览文件 @
ff634b9a
...
...
@@ -9,6 +9,7 @@ interface PropsType {
fileUpload
:
boolean
;
// 是否上传到服务器(返回文件流还是返回上传后的地址)
fileLength
?:
number
;
// 最大上传文件数量
children
:
React
.
ReactNode
;
// 上传按钮
showUploadList
?:
boolean
;
//是否隐藏上传文件列表
onChange
?:
(
fileList
:
{
id
:
number
;
...
...
@@ -27,6 +28,7 @@ export const Uploader: React.FC<PropsType> = (props) => {
fileType
:
[
'image/png'
,
'image/jpeg'
,
'image/jpg'
,
'image/gif'
],
onChange
:
()
=>
{},
defaultFileList
:
[],
showUploadList
:
true
,
};
const
{
fileType
=
[
'image/png'
,
'image/jpeg'
,
'image/jpg'
,
'image/gif'
,
'image/bmp'
],
...
...
@@ -37,12 +39,14 @@ export const Uploader: React.FC<PropsType> = (props) => {
fileLength
,
onChange
,
defaultFileList
,
showUploadList
,
}
=
props
;
const
[
fileList
,
setFileList
]
=
useState
<
any
[]
>
([]);
// 上传文件配置
const
uploadProps
:
UploadProps
=
{
listType
,
fileList
,
showUploadList
,
beforeUpload
:
(
res
)
=>
{
const
isType
=
fileType
?.
includes
(
res
.
type
);
const
isSize
=
res
.
size
/
1024
/
1024
<
(
fileSize
||
2
);
...
...
pages/JoinPolicy/index.page.tsx
浏览文件 @
ff634b9a
import
{
Button
,
Col
,
Divider
,
Form
,
Input
,
Row
}
from
'antd'
;
import
{
Button
,
Col
,
Divider
,
Form
,
Input
,
message
,
Row
}
from
'antd'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
LayoutView
from
'~/components/layout'
;
...
...
@@ -26,22 +26,27 @@ export default function JoinPolicy() {
},
[
router
.
query
.
tagId
]);
//提交
const
submitApply
=
()
=>
{
form
.
validateFields
().
then
((
valid
)
=>
{
api
.
cooperationApply
({
...
valid
,
cooperationTagId
:
tagId
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
'200'
)
{
window
.
messageApi
.
success
(
'提交成功'
);
form
.
resetFields
();
setTimeout
(()
=>
{
router
.
push
(
'/'
);
},
1500
);
}
});
});
form
.
validateFields
()
.
then
((
valid
)
=>
{
api
.
cooperationApply
({
...
valid
,
cooperationTagId
:
tagId
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
'200'
)
{
window
.
messageApi
.
success
(
'提交成功'
);
form
.
resetFields
();
setTimeout
(()
=>
{
router
.
push
(
'/'
);
},
1500
);
}
});
})
.
catch
((
err
:
any
)
=>
{
message
.
warning
(
err
.
errorFields
[
0
].
errors
[
0
]);
});
};
//上传变更
const
uploadChange
=
(
value
:
any
)
=>
{
...
...
@@ -96,7 +101,9 @@ export default function JoinPolicy() {
</
Form
.
Item
>
<
Row
>
<
Col
span=
{
2
}
>
<
div
>
上传资料:
</
div
>
<
div
>
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
上传资料:
</
div
>
</
Col
>
<
Col
span=
{
10
}
>
<
div
className=
{
styles
.
uploadTip
}
>
...
...
@@ -105,7 +112,10 @@ export default function JoinPolicy() {
<
div
>
3. 文件大小不超过10M
</
div
>
</
div
>
<
div
className=
{
styles
.
uploadOperate
}
>
<
Form
.
Item
name=
'attachmentList'
>
<
Form
.
Item
name=
'attachmentList'
rules=
{
[{
required
:
true
,
message
:
'请上传资料'
}]
}
>
<
Uploader
fileUpload
listType=
'text'
...
...
pages/equipmentLeasing/detail/components/orderForGoods/index.tsx
浏览文件 @
ff634b9a
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
{
OrderForGoodsBox
}
from
'./styled'
;
import
type
{
FormInstance
,
RadioChangeEvent
}
from
'antd'
;
import
type
{
RadioChangeEvent
}
from
'antd'
;
import
{
Button
,
Radio
,
Space
,
Input
,
message
,
Modal
,
Image
}
from
'antd'
;
import
api
,
{
UserAddress
,
GetOrderForGoods
}
from
'./api'
;
import
moment
from
'moment'
;
...
...
pages/forum/components/publishMessage/index.tsx
浏览文件 @
ff634b9a
import
{
Form
,
Input
,
Modal
,
Upload
,
Image
,
Button
,
Row
,
Col
}
from
'antd'
;
import
type
{
UploadProps
}
from
'antd/es/upload'
;
import
{
Form
,
Input
,
Modal
,
Image
,
Button
,
Row
,
Col
}
from
'antd'
;
import
type
{
UploadFile
}
from
'antd/es/upload/interface'
;
import
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
gApi
from
'~/api'
;
import
{
useContext
,
useState
}
from
'react'
;
import
NImage
from
'next/image'
;
import
api
from
'./api'
;
import
{
useGeolocation
}
from
'~/lib/hooks'
;
...
...
@@ -10,6 +8,7 @@ import { UserContext } from '~/lib/userProvider';
import
uploadImg
from
'~/assets/images/upload.png'
;
import
deleteIcon
from
'~/assets/images/delete-icon.png'
;
import
styles
from
'./index.module.scss'
;
import
{
Uploader
}
from
'~/components/uploader'
;
type
Props
=
{
open
:
boolean
;
...
...
@@ -18,7 +17,6 @@ type Props = {
};
const
normFile
=
(
e
:
any
)
=>
{
console
.
log
(
'Upload event:'
,
e
);
if
(
Array
.
isArray
(
e
))
{
return
e
;
}
...
...
@@ -29,63 +27,12 @@ export default function PublishMessage(props: Props) {
const
[
fileList
,
setFileList
]
=
useState
<
UploadFile
[]
>
([]);
const
[
showLoading
,
setShowLoad
]
=
useState
(
false
);
const
[
form
]
=
Form
.
useForm
();
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
{
userInfo
}
=
useContext
(
UserContext
);
const
position
=
useGeolocation
();
const
[
token
,
setToken
]
=
useState
(
''
);
useEffect
(()
=>
{
setToken
(
window
.
localStorage
.
getItem
(
'token'
)
||
''
);
},
[]);
//图片上传
const
handleChange
:
UploadProps
[
'onChange'
]
=
(
info
)
=>
{
const
isSize
=
(
info
.
file
as
any
).
size
/
1024
/
1024
<
5
;
if
(
!
isSize
)
{
window
.
messageApi
.
error
(
'上传文件最大5M'
);
return
;
}
const
isType
=
[
'video/mp4'
,
'video/avi'
,
'video/wmv'
,
'video/rmvb'
,
'image/png'
,
'image/jpeg'
,
'image/jpg'
,
'image/gif'
,
'image/bmp'
,
].
includes
(
info
.
file
.
type
as
string
);
if
(
!
isType
)
{
window
.
messageApi
.
error
(
'上传文件类型错误'
);
return
;
}
if
(
info
.
file
.
status
===
'uploading'
)
{
let
find
=
fileList
.
find
((
item
)
=>
{
return
item
.
uid
===
info
.
file
.
uid
;
});
if
(
!
find
)
{
setFileList
([...
fileList
,
info
.
file
]);
}
return
;
}
else
if
(
info
.
file
.
status
===
'done'
)
{
if
(
info
.
file
.
response
.
code
===
'200'
&&
info
.
file
.
response
.
result
)
{
let
fileList1
=
fileList
.
map
((
item
)
=>
{
if
(
item
.
uid
===
info
.
file
.
uid
)
{
info
.
file
.
url
=
info
.
file
.
response
.
result
;
return
info
.
file
;
}
return
item
;
});
setFileList
([...
fileList1
]);
}
else
{
window
.
messageApi
.
error
(
info
.
file
.
response
?.
message
||
'上传失败'
);
info
.
fileList
=
fileList
.
filter
((
item
)
=>
{
return
item
.
uid
!==
info
.
file
.
uid
;
});
setFileList
([...
info
.
fileList
]);
}
}
else
{
setFileList
([...
info
.
fileList
]);
}
const
fileUploadChange
=
(
value
:
any
)
=>
{
setFileList
([...
fileList
,
...
value
]);
};
//删除媒体
const
deleteMedia
=
(
file
:
UploadFile
)
=>
{
...
...
@@ -95,7 +42,6 @@ export default function PublishMessage(props: Props) {
//提交
const
onFinish
=
(
values
:
any
)
=>
{
setShowLoad
(
true
);
if
(
userInfo
)
{
api
.
publish
({
...
...
@@ -186,19 +132,26 @@ export default function PublishMessage(props: Props) {
<
Col
>
<
Form
.
Item
valuePropName=
'picture'
getValueFromEvent=
{
normFile
}
>
<
Upload
name=
'uploadFile'
action=
{
gApi
.
fileUpload
}
listType=
'picture-card'
onChange=
{
handleChange
}
<
Uploader
fileUpload
showUploadList=
{
false
}
maxCount=
{
1
}
headers=
{
{
token
:
token
}
}
fileSize=
{
5
}
fileLength=
{
9
}
fileType=
{
[
'video/mp4'
,
'video/avi'
,
'video/wmv'
,
'video/rmvb'
,
'image/png'
,
'image/jpeg'
,
'image/jpg'
,
'image/gif'
,
'image/bmp'
,
]
}
onChange=
{
fileUploadChange
}
>
{
fileList
.
length
>=
9
?
null
:
(
<
NImage
src=
{
uploadImg
}
alt=
''
width=
{
100
}
height=
{
100
}
/>
)
}
</
Upload
>
<
NImage
src=
{
uploadImg
}
alt=
''
width=
{
100
}
height=
{
100
}
/>
</
Uploader
>
</
Form
.
Item
>
</
Col
>
</
Row
>
...
...
pages/forum/index.page.tsx
浏览文件 @
ff634b9a
import
{
Button
,
Image
,
Space
,
Input
,
Modal
,
Form
,
List
,
Divider
,
Skeleton
}
from
'antd'
;
import
{
Button
,
Image
,
Space
,
Input
,
Form
,
Divider
,
Skeleton
}
from
'antd'
;
import
Layout
from
'~/components/layout'
;
import
styles
from
'./index.module.scss'
;
import
errImg
from
'~/assets/errImg'
;
...
...
@@ -192,19 +192,6 @@ export default function Forum() {
),
)
}
</
Space
>
{
/*<Image.PreviewGroup*/
}
{
/*>*/
}
{
/* <Space size={6} wrap>*/
}
{
/* {item?.mediaVO*/
}
{
/* ?.filter((v) => v.type === 0)*/
}
{
/* ?.map((img, index: number) => {*/
}
{
/* return (*/
}
{
/* );*/
}
{
/* })}*/
}
{
/* </Space>*/
}
{
/*</Image.PreviewGroup>*/
}
</
div
>
<
div
className=
{
styles
.
ctrls
}
>
<
div
className=
{
styles
.
ctrlsItem
}
onClick=
{
()
=>
openComment
(
item
)
}
>
...
...
pages/jobServices/api/index.tsx
浏览文件 @
ff634b9a
...
...
@@ -15,6 +15,7 @@ export interface Job {
serviceName
:
string
;
teamName
:
string
;
price
:
number
;
inspComtAmount
:
number
;
}
export
interface
ListPageJobInfoResp
{
...
...
pages/jobServices/index.page.tsx
浏览文件 @
ff634b9a
...
...
@@ -41,7 +41,7 @@ export default function JobServices() {
</
div
>
</
div
>
<
div
className=
'item-bottom'
>
<
div
className=
'bottom-left'
>
{
Math
.
round
(
Math
.
random
()
*
(
150
-
100
)
+
100
)
}
条评价
</
div
>
<
div
className=
'bottom-left'
>
{
item
.
inspComtAmount
}
条评价
</
div
>
{
/* <div className="bottom-right">专业飞手团队,精通巡航业务</div> */
}
<
div
className=
'com'
>
{
item
.
teamName
}
</
div
>
</
div
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论