Skip to content
项目
群组
代码片段
帮助
正在加载...
登录/注册
切换导航
广
广东建设用地-前端
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
广东建设用地
广东建设用地-前端
Commits
528f9792
提交
528f9792
authored
5月 22, 2025
作者:
jinrongbin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
复核评审上传材料限制一张,报错后不能显示文件列表,修改为a-upload原生形式
上级
d3452188
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
98 行增加
和
42 行删除
+98
-42
ConfirmedModal.vue
src/components/customComponent/ConfirmedModal.vue
+93
-37
PointInfor.vue
src/components/customComponent/PointInfor.vue
+5
-5
没有找到文件。
src/components/customComponent/ConfirmedModal.vue
浏览文件 @
528f9792
<
template
>
<BasicModal
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"title"
@
ok=
"handleSubmit"
width=
"50%"
>
<BasicForm
@
register=
"registerForm"
>
</BasicForm>
<BasicForm
@
register=
"registerForm"
>
<template
#
upload=
"
{ model, field }">
<a-upload
:beforeUpload=
"beforeUpload"
:showDownloadBtn=
"true"
:headers=
"headers"
:multiple=
"multiple"
:action=
"uploadUrl"
:showUploadList=
"false"
fileName=
"相关材料"
:maxCount=
"1"
@
change=
"onFileChange"
accept=
".pdf,.zip,.doc,.docx"
>
<a-button>
<upload-outlined></upload-outlined>
上传
</a-button>
</a-upload>
<a-button
size=
"small"
type=
"primary"
v-show=
"fileList"
@
click=
"down(fileList, '相关材料')"
style=
"height:32px;padding:4px 15px;margin-left:10px;"
>
<DownloadOutlined></DownloadOutlined>
下载
</a-button>
</
template
>
</BasicForm>
<a-table
:dataSource=
"dataSource"
:columns=
"columns"
/>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
unref
}
from
'vue'
;
import
{
ref
,
unref
,
reactive
}
from
'vue'
;
import
{
FormSchema
}
from
'/@/components/Table'
;
import
{
BasicModal
,
useModalInner
}
from
'/@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
submiDqr
,
fhHis
}
from
'@/api/common/api'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
uploadUrl
,
downloadFile
}
from
'/@/api/common/api'
;
import
{
getToken
}
from
'/@/utils/auth'
;
import
{
UploadOutlined
,
DownloadOutlined
}
from
'@ant-design/icons-vue'
;
const
emit
=
defineEmits
([
'register'
,
'success'
]);
const
fjcllj
=
ref
(
''
);
const
ishow
=
ref
(
false
);
const
isUpdate
=
ref
(
true
);
const
uploadRef
=
ref
();
const
{
createMessage
}
=
useMessage
();
const
fileList
=
ref
(
''
);
const
headers
=
reactive
({
'X-Access-Token'
:
getToken
(),
});
function
down
(
url
,
name
)
{
let
fileExtension
=
url
.
split
(
'.'
).
pop
();
downloadFile
(
'/sys/common/static'
+
url
,
`
${
name
}
.
${
fileExtension
}
`
);
}
const
AdviceFormSchema
:
FormSchema
[]
=
[
{
label
:
'污染地块ID'
,
field
:
'wrdkid'
,
required
:
true
,
component
:
'Input'
,
show
:
false
},
{
label
:
'所处阶段编码'
,
field
:
'scjdbm'
,
component
:
'Input'
,
show
:
false
},
...
...
@@ -59,23 +93,25 @@
field
:
'clyjfj'
,
component
:
'JUpload'
,
show
:
true
,
componentProps
:
{
showUploadList
:
false
,
fileName
:
'相关材料'
,
accept
:
'.pdf,.zip,.rar,.doc,.docx'
,
beforeUpload
:
(
file
)
=>
{
let
isshow
=
false
;
const
isFile
=
file
.
name
.
split
(
'.'
)[
file
.
name
.
split
(
'.'
).
length
-
1
];
console
.
log
(
file
,
'file'
);
if
(
isFile
==
'pdf'
||
isFile
==
'zip'
||
isFile
==
'PDF'
||
isFile
==
'rar'
||
isFile
==
'doc'
||
isFile
==
'docx'
)
{
isshow
=
true
;
}
else
{
createMessage
.
error
(
'只能上传.pdf/.zip/.rar/word格式的文件'
);
isshow
=
false
;
}
return
isshow
;
},
},
slot
:
'upload'
,
// componentProps: {
// showUploadList: false,
// maxCount: 1,
// fileName: '相关材料',
// accept: '.pdf,.zip,.rar,.doc,.docx',
// beforeUpload: (file) => {
// let isshow = false;
// const isFile = file.name.split('.')[file.name.split('.').length - 1];
// console.log(file, 'file');
// if (isFile == 'pdf' || isFile == 'zip' || isFile == 'PDF' || isFile == 'rar' || isFile == 'doc' || isFile == 'docx') {
// isshow = true;
// } else {
// createMessage.error('只能上传.pdf/.zip/.rar/word格式的文件');
// isshow = false;
// }
// return isshow;
// },
// },
});
}
},
...
...
@@ -106,23 +142,14 @@
field
:
'clyjfj'
,
component
:
'JUpload'
,
show
:
true
,
componentProps
:
{
showUploadList
:
false
,
fileName
:
'相关材料'
,
accept
:
'.pdf,.zip,.doc,.docx'
,
beforeUpload
:
(
file
)
=>
{
let
isshow
=
false
;
const
isFile
=
file
.
name
.
split
(
'.'
)[
file
.
name
.
split
(
'.'
).
length
-
1
];
console
.
log
(
file
,
'file'
);
if
(
isFile
==
'pdf'
||
isFile
==
'zip'
||
isFile
==
'PDF'
||
isFile
==
'doc'
||
isFile
==
'docx'
)
{
isshow
=
true
;
}
else
{
createMessage
.
error
(
'只能上传.pdf/.zip/word格式的文件'
);
isshow
=
false
;
}
return
isshow
;
},
},
slot
:
'upload'
,
// componentProps: {
// showUploadList: false,
// fileName: '相关材料',
// maxCount: 1,
// accept: '.pdf,.zip,.doc,.docx',
// },
},
];
//表单配置
...
...
@@ -177,11 +204,40 @@
console
.
log
(
v
,
'v'
);
dataSource
.
value
=
await
fhHis
(
v
);
}
function
beforeUpload
(
file
)
{
// console.log(file, 'file');
let
isshow
=
false
;
const
isFile
=
file
.
name
.
split
(
'.'
)[
file
.
name
.
split
(
'.'
).
length
-
1
];
if
(
isFile
==
'pdf'
||
isFile
==
'zip'
||
isFile
==
'PDF'
||
isFile
==
'rar'
||
isFile
==
'doc'
||
isFile
==
'docx'
)
{
isshow
=
true
;
}
else
{
createMessage
.
error
(
'只能上传.pdf/.zip/.rar/word格式的文件'
);
isshow
=
false
;
}
return
isshow
;
}
// upload组件change事件
async
function
onFileChange
(
info
)
{
console
.
log
(
info
,
'info'
);
if
(
info
.
file
.
status
===
'done'
)
{
if
(
info
.
file
.
response
.
success
)
{
fileList
.
value
=
info
.
file
.
response
.
message
;
}
else
{
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
}
`
);
}
}
else
if
(
info
.
file
.
status
===
'error'
)
{
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
}
`
);
}
if
(
info
.
file
.
status
===
'removed'
)
{
fileList
.
value
=
''
;
}
}
//表单提交事件
async
function
handleSubmit
()
{
try
{
let
values
=
await
validate
();
setModalProps
({
confirmLoading
:
true
});
values
.
clyjfj
=
fileList
.
value
;
if
(
values
.
nodeType
==
1
)
{
values
.
clyj
=
'复核通过'
;
}
...
...
src/components/customComponent/PointInfor.vue
浏览文件 @
528f9792
...
...
@@ -193,14 +193,14 @@
// 上传图片的限制
function
beforeUpload
(
file
)
{
console
.
log
(
file
,
'file'
);
if
(
file
.
type
!=
'image/jpg'
)
{
createMessage
.
error
(
'只能上传jpg,png格式的图片'
);
return
false
;
}
if
(
file
.
type
!=
'image/png'
)
{
if
(
file
.
type
!=
'image/jpg'
&&
file
.
type
!=
'image/png'
)
{
createMessage
.
error
(
'只能上传jpg,png格式的图片'
);
return
false
;
}
// if (file.type != 'image/png') {
// createMessage.error('只能上传jpg,png格式的图片');
// return false;
// }
return
true
;
}
// 上传图片
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论