Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
9bfdfdcc
提交
9bfdfdcc
authored
7月 03, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:招标快讯文件回显
上级
a528149d
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
41 行增加
和
3 行删除
+41
-3
.env.development
env/.env.development
+1
-0
resourceManageType.ts
src/api/interface/resourceManageType.ts
+1
-0
index.tsx
...s/resourceManage/tenderManage/comp/addEditModal/index.tsx
+17
-3
uploadFile.ts
src/utils/uploadFile.ts
+20
-0
vite.config.ts
vite.config.ts
+2
-0
没有找到文件。
env/.env.development
浏览文件 @
9bfdfdcc
...
@@ -10,6 +10,7 @@ VITE_REQUEST_BASE_URL='/api'
...
@@ -10,6 +10,7 @@ VITE_REQUEST_BASE_URL='/api'
#VITE_REQUEST_BASE_URL='http://192.168.3.22:10001'
#VITE_REQUEST_BASE_URL='http://192.168.3.22:10001'
#VITE_REQUEST_BASE_URL='http://192.168.3.17:8099'
#VITE_REQUEST_BASE_URL='http://192.168.3.17:8099'
#VITE_REQUEST_BASE_URL='http://192.168.3.23:35150'
#VITE_REQUEST_BASE_URL='http://192.168.3.23:35150'
#VITE_REQUEST_BASE_URL='http://192.168.3.111:10001'
#版本
#版本
NODE_ENV='development'
NODE_ENV='development'
VERSION='2.2.4.230217.Release'
VERSION='2.2.4.230217.Release'
src/api/interface/resourceManageType.ts
浏览文件 @
9bfdfdcc
...
@@ -31,6 +31,7 @@ export type releaseTenderNews = InterListFunction<
...
@@ -31,6 +31,7 @@ export type releaseTenderNews = InterListFunction<
port
:
number
;
port
:
number
;
tenderName
:
string
;
tenderName
:
string
;
using
:
number
;
using
:
number
;
url
:
string
;
}
}
>
;
>
;
// 新增招标快讯
// 新增招标快讯
...
...
src/pages/resourceManage/tenderManage/comp/addEditModal/index.tsx
浏览文件 @
9bfdfdcc
...
@@ -5,6 +5,7 @@ import { releaseTenderNewsUpdate, releaseTenderNews } from '~/api/interface/reso
...
@@ -5,6 +5,7 @@ import { releaseTenderNewsUpdate, releaseTenderNews } from '~/api/interface/reso
import
{
ResourceManageAPI
}
from
'~/api'
;
import
{
ResourceManageAPI
}
from
'~/api'
;
import
{
Uploader
}
from
'~/components/uploader'
;
import
{
Uploader
}
from
'~/components/uploader'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
uploadFile
}
from
'~/utils/uploadFile'
;
// 列表的类型
// 列表的类型
type
TableType
=
InterListType
<
releaseTenderNews
>
;
type
TableType
=
InterListType
<
releaseTenderNews
>
;
...
@@ -48,11 +49,23 @@ const AddEditModal: React.FC<propType> = (props) => {
...
@@ -48,11 +49,23 @@ const AddEditModal: React.FC<propType> = (props) => {
};
};
// 提交事件
// 提交事件
const
handleSubmit
=
async
(
values
:
ReqType
&
{
file
:
any
[]
})
=>
{
const
handleSubmit
=
async
(
values
:
ReqType
&
{
file
:
any
[]
})
=>
{
// 上传文件
const
filePath
=
await
uploadFile
(
values
?.
file
?.
at
(
-
1
));
// 新建formData
const
formData
=
new
FormData
();
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
values
?.
file
?.
at
(
-
1
));
formData
.
append
(
'file'
,
values
?.
file
?.
at
(
-
1
));
const
blob
=
new
Blob
([
JSON
.
stringify
({
...
values
,
id
:
data
?.
id
?
data
?.
id
:
null
})],
{
const
blob
=
new
Blob
(
type
:
'application/json'
,
[
});
JSON
.
stringify
({
...
values
,
id
:
data
?.
id
?
data
?.
id
:
null
,
url
:
filePath
?
filePath
:
null
,
}),
],
{
type
:
'application/json'
,
},
);
formData
.
append
(
'tenderNewsVO'
,
blob
);
formData
.
append
(
'tenderNewsVO'
,
blob
);
const
res
=
await
ResourceManageAPI
[
const
res
=
await
ResourceManageAPI
[
data
?.
id
?
'releaseTenderNewsUpdate'
:
'releaseTenderNewsAdd'
data
?.
id
?
'releaseTenderNewsUpdate'
:
'releaseTenderNewsAdd'
...
@@ -115,6 +128,7 @@ const AddEditModal: React.FC<propType> = (props) => {
...
@@ -115,6 +128,7 @@ const AddEditModal: React.FC<propType> = (props) => {
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
form
.
setFieldValue
(
'file'
,
e
);
form
.
setFieldValue
(
'file'
,
e
);
}
}
}
}
defaultFileList=
{
data
?.
url
?
[{
url
:
data
?.
url
}]
:
[]
}
>
>
<
Button
icon=
{
<
UploadOutlined
/>
}
type=
{
'primary'
}
>
<
Button
icon=
{
<
UploadOutlined
/>
}
type=
{
'primary'
}
>
上传
上传
...
...
src/utils/uploadFile.ts
0 → 100644
浏览文件 @
9bfdfdcc
import
{
CommonAPI
}
from
'~/api'
;
import
{
message
}
from
'antd'
;
// 上传文件
export
const
uploadFile
=
(
file
:
any
):
Promise
<
string
>
=>
new
Promise
((
resolve
,
reject
)
=>
{
// 上传到服务器
const
formData
=
new
FormData
();
formData
.
append
(
'uploadFile'
,
file
);
CommonAPI
.
uploadOssBP
(
formData
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
'200'
)
{
resolve
(
res
.
result
);
return
;
}
else
{
reject
(
res
);
message
.
error
(
'文件上传失败'
).
then
();
return
;
}
});
});
vite.config.ts
浏览文件 @
9bfdfdcc
...
@@ -13,6 +13,8 @@ export default defineConfig({
...
@@ -13,6 +13,8 @@ export default defineConfig({
'/api'
:
{
'/api'
:
{
// target: 'http://192.168.3.111:8099', // 后端女pms
// target: 'http://192.168.3.111:8099', // 后端女pms
// target: 'http://192.168.3.111:8077', // 后端女oms
// target: 'http://192.168.3.111:8077', // 后端女oms
// target: 'http://192.168.3.111:10001', // 后端女release
// target: 'http://192.168.3.111:35150', // 后端女user
// target: 'http://192.168.3.17:8099', // 狗旺
// target: 'http://192.168.3.17:8099', // 狗旺
target
:
'https://test.iuav.shop'
,
target
:
'https://test.iuav.shop'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论