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