Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yn-science-front
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
徐俊
yn-science-front
Commits
171a1a43
Commit
171a1a43
authored
Dec 19, 2024
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
444
parent
9fc6e92c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
117 deletions
+50
-117
fileLoad.vue
src/views/components/common/fileLoad.vue
+29
-31
upLoad.vue
src/views/components/common/upLoad.vue
+2
-2
scoreEdit.vue
src/views/evaluation/components/scoreEdit.vue
+0
-0
Index.vue
src/views/query/project/Index.vue
+1
-1
fileEdit.vue
src/views/report/project/components/fileEdit.vue
+18
-83
No files found.
src/views/components/common/fileLoad.vue
View file @
171a1a43
...
...
@@ -4,10 +4,10 @@
<div>
<document-view
:fileUrl=
"file.downloadUrl"
:fileName=
"file.fileName"
:imageArray=
"[file.downloadUrl]"
></document-view>
</div>
<a-icon
type=
"delete"
class=
"hover-pointer d-icon"
@
click=
"deletefile(file)"
style=
"margin: 0px
2
px;"
/>
<a-icon
type=
"delete"
class=
"hover-pointer d-icon"
@
click=
"deletefile(file)"
style=
"margin: 0px
4
px;"
/>
</div>
<div
v-else
>
<a-form-model-item
:prop=
"name +'.'+ index + '.downloadUrl'"
:rules=
"
{required:
true
, message: '请上传附件',trigger: 'blur',}">
<a-form-model-item
:prop=
"name +'.'+ index + '.downloadUrl'"
:rules=
"
{required:
file.isRequired
, message: '请上传附件',trigger: 'blur',}">
<input
type=
"file"
:ref=
"name +'fileElem' + index"
class=
"visually-hidden"
@
change=
"handleFiles(file, index)"
/>
<a-button
@
click=
"fileSelect(index)"
><a-icon
type=
"upload"
/>
选择文件
</a-button>
</a-form-model-item>
...
...
@@ -26,12 +26,6 @@ export default {
};
},
props
:
{
value
:
{
type
:
Object
,
default
:
()
=>
{
return
null
}
},
file
:
{
type
:
Object
,
default
:
()
=>
{
...
...
@@ -50,23 +44,29 @@ export default {
return
0
},
},
format
:
{
type
:
Array
,
default
()
{
return
[]
}
},
},
created
()
{
},
methods
:
{
deletefile
(
item
)
{
this
.
$api
.
base
.
deletefile
({
id
:
item
.
downloadId
}).
then
(({
data
=
{}
})
=>
{
deletefile
(
obj
)
{
this
.
$api
.
base
.
deletefile
({
id
:
obj
.
downloadId
}).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
item
.
fileName
=
''
item
.
downloadUrl
=
''
item
.
downloadId
=
''
obj
.
fileName
=
null
obj
.
downloadUrl
=
null
obj
.
downloadId
=
null
}
}).
catch
(()
=>
{
this
.
$message
.
error
(
'删除失败'
)
})
},
handleFiles
(
item
,
index
)
{
handleFiles
(
obj
,
index
)
{
let
fileElem
=
this
.
$refs
[
this
.
name
+
'fileElem'
+
index
]
let
files
=
fileElem
.
files
if
(
files
.
length
<=
0
)
{
...
...
@@ -77,9 +77,9 @@ export default {
return
this
.
$api
.
base
.
asyncUpload
(
this
.
uploadHandle
(
files
[
0
],
files
[
0
].
name
)).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
item
.
fileName
=
files
[
0
].
name
item
.
downloadUrl
=
data
.
downloadUrl
item
.
downloadId
=
data
.
id
obj
.
fileName
=
files
[
0
].
name
obj
.
downloadUrl
=
data
.
downloadUrl
obj
.
downloadId
=
data
.
id
}
else
this
.
$message
.
error
(
'上传失败'
)
}).
catch
(()
=>
{
...
...
@@ -93,13 +93,15 @@ export default {
this
.
$message
.
error
(
'文件大小不能超过15M!'
);
return
false
}
// var fileNames = file.name.split('.')
// var fileType = fileNames[fileNames.length - 1].toLocaleLowerCase()
// var extList = ['doc', 'docx', 'pdf']
// if (!extList.find((item) => item == fileType)) {
// this.$message.error('文件格式错误!')
// return false
// }
if
(
!!
this
.
format
&&
this
.
format
.
length
>
0
)
{
var
fileNames
=
file
.
name
.
split
(
'.'
)
var
fileType
=
fileNames
[
fileNames
.
length
-
1
].
toLocaleLowerCase
()
var
extList
=
this
.
format
if
(
!
extList
.
find
((
e
)
=>
e
==
fileType
))
{
this
.
$message
.
error
(
'文件格式错误!'
)
return
false
}
}
return
true
},
uploadHandle
(
file
,
fileName
)
{
...
...
@@ -114,14 +116,10 @@ export default {
fileElem
.
click
()
}
},
},
watch
:
{
value
:
{
handler
(
value
)
{
downloadfile
()
{
},
}
}
},
},
};
</
script
>
<
style
scoped
lang=
"less"
>
...
...
src/views/components/common/upLoad.vue
View file @
171a1a43
...
...
@@ -110,9 +110,9 @@ export default {
this
.
$message
.
error
(
'文件大小不能超过15M!'
);
return
false
}
var
fileNames
=
file
.
name
.
split
(
'.'
)
var
fileType
=
fileNames
[
fileNames
.
length
-
1
].
toLocaleLowerCase
()
if
(
!!
this
.
format
&&
this
.
format
.
length
>
0
)
{
var
fileNames
=
file
.
name
.
split
(
'.'
)
var
fileType
=
fileNames
[
fileNames
.
length
-
1
].
toLocaleLowerCase
()
var
extList
=
this
.
format
if
(
!
extList
.
find
((
item
)
=>
item
==
fileType
))
{
this
.
$message
.
error
(
'文件格式错误!'
)
...
...
src/views/evaluation/components/scoreEdit.vue
View file @
171a1a43
This diff is collapsed.
Click to expand it.
src/views/query/project/Index.vue
View file @
171a1a43
...
...
@@ -21,7 +21,7 @@
<a-divider
style=
"height: 1px; background-color: #e8e8e8;"
/>
<div
class=
"submit-btn"
>
<a-button
type=
"primary"
@
click=
"exportData"
icon=
"download"
>
Excel
</a-button>
<
!--
<a-button
type=
"primary"
@
click=
"scoreClick"
icon=
"download"
>
评分
</a-button>
--
>
<
a-button
type=
"primary"
@
click=
"scoreClick"
icon=
"download"
>
评分
</a-button
>
</div>
<a-table
:dataSource=
"tableData"
:columns=
"columns"
:scroll=
"
{ x: 'max-content' }" rowKey="id" :pagination="false" :loading="loading">
<template
slot=
"projName"
slot-scope=
"record"
>
...
...
src/views/report/project/components/fileEdit.vue
View file @
171a1a43
...
...
@@ -10,16 +10,16 @@
<a-row
type=
"flex"
>
<a-col
:span=
"24"
class=
"bg-gray"
>
<div
class=
"special-middle"
>
<a
href=
"/downloadFile/202412130901.docx"
download=
"临床医学中心承诺书模版.docx"
style=
"margin-right: 20px;"
>
<a-icon
type=
"download"
></a-icon>
<span
style=
"color:green;text-decoration:underline;"
>
临床医学中心承诺书模版
</span>
</a>
<a
href=
"/downloadFile/202412130902.docx"
download=
"个人承诺书模版.docx"
style=
"margin-right: 20px;"
>
<a-icon
type=
"download"
></a-icon>
<span
style=
"color:green;text-decoration:underline;"
>
个人承诺书模版
</span>
</a>
<a
href=
"/downloadFile/202412130903.docx"
download=
"项目资金预算编制说明.docx"
style=
"margin-right: 20px;"
>
<a-icon
type=
"download"
></a-icon>
<span
style=
"color:green;text-decoration:underline;"
>
项目资金预算编制说明
</span>
</a>
</div>
<a
href=
"/downloadFile/202412130901.docx"
download=
"临床医学中心承诺书模版.docx"
style=
"margin-right: 20px;"
>
<a-icon
type=
"download"
></a-icon>
<span
style=
"color:green;text-decoration:underline;"
>
临床医学中心承诺书模版
</span>
</a>
<a
href=
"/downloadFile/202412130902.docx"
download=
"个人承诺书模版.docx"
style=
"margin-right: 20px;"
>
<a-icon
type=
"download"
></a-icon>
<span
style=
"color:green;text-decoration:underline;"
>
个人承诺书模版
</span>
</a>
<a
href=
"/downloadFile/202412130903.docx"
download=
"项目资金预算编制说明.docx"
style=
"margin-right: 20px;"
>
<a-icon
type=
"download"
></a-icon>
<span
style=
"color:green;text-decoration:underline;"
>
项目资金预算编制说明
</span>
</a>
</div>
</a-col>
</a-row>
<a-row
type=
"flex"
class=
"row_center"
>
...
...
@@ -60,23 +60,13 @@
</a-form-model-item>
</a-col>
<a-col
:span=
"2"
>
<div
class=
"special-middle"
style=
"text-align: center;"
><div>
{{
item
.
isRequired
==
true
?
"是"
:
"否"
}}
</div></div>
<div
class=
"special-middle"
style=
"text-align: center;"
>
<div>
{{
item
.
isRequired
==
true
?
"是"
:
"否"
}}
</div>
</div>
</a-col>
<a-col
:span=
"10"
>
<div
class=
"special-middle"
>
<div
v-if=
"item.downloadUrl"
class=
"file-box"
>
<div>
<a-icon
type=
"file"
style=
"margin-right: 8px"
/>
<span
class=
"hover-pointer"
@
click=
"downloadfile(item)"
>
{{
item
.
fileName
}}
</span>
</div>
<a-icon
type=
"delete"
class=
"hover-pointer d-icon"
@
click=
"deletefile(item, index)"
/>
</div>
<div
v-else
>
<a-form-model-item
:prop=
"'fileList.' + index + '.downloadUrl'"
:rules=
"
{required: item.isRequired, message: '请上传附件',trigger: 'blur',}">
<input
type=
"file"
:ref=
"'fileElem' + index"
class=
"visually-hidden"
@
change=
"handleFiles(item, index)"
/>
<a-button
@
click=
"fileSelect(item, index)"
><a-icon
type=
"upload"
/>
选择文件
</a-button>
</a-form-model-item>
</div>
<file-load
:file
.
sync=
"fileList[index]"
:index=
"index"
:name=
"'fileList'"
/>
</div>
</a-col>
<a-col
:span=
"4"
>
...
...
@@ -104,7 +94,7 @@
</
template
>
<
script
>
const
File
=
{
fileName
:
""
,
downloadUrl
:
""
,
fileExplain
:
""
,
downloadId
:
""
,
isRequired
:
false
,
required
:
false
};
const
File
=
{
fileName
:
null
,
downloadUrl
:
null
,
fileExplain
:
null
,
downloadId
:
null
,
isRequired
:
false
,
required
:
false
};
export
default
{
name
:
"fileEdit"
,
...
...
@@ -116,68 +106,13 @@ export default {
},
},
},
created
()
{
},
data
()
{
created
()
{
},
data
()
{
return
{
mustAttachment
:
[
0
,
1
],
mustAttachment
:
[
0
,
1
],
};
},
methods
:
{
downloadfile
()
{
},
deletefile
(
item
,
index
)
{
this
.
$api
.
base
.
deletefile
({
id
:
item
.
downloadId
}).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
item
.
fileName
=
''
item
.
downloadUrl
=
''
item
.
downloadId
=
''
}
}).
catch
(()
=>
{
this
.
$message
.
error
(
'删除失败'
)
})
},
uploadHandle
(
file
,
fileName
)
{
let
formData
=
new
FormData
()
formData
.
append
(
'file'
,
file
)
formData
.
append
(
'fileName'
,
fileName
)
return
formData
},
handleFiles
(
item
,
index
)
{
let
fileElem
=
this
.
$refs
[
'fileElem'
+
index
][
0
]
let
files
=
fileElem
.
files
if
(
files
.
length
<=
0
)
{
this
.
$message
.
error
(
'未选中文件,请尝试重新选择'
)
return
}
if
(
!
this
.
fileCheck
(
files
[
0
]))
return
this
.
$api
.
base
.
asyncUpload
(
this
.
uploadHandle
(
files
[
0
],
files
[
0
].
name
)).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
item
.
fileName
=
files
[
0
].
name
item
.
downloadUrl
=
'/'
+
files
[
0
].
name
item
.
downloadId
=
data
.
id
}
else
this
.
$message
.
error
(
'上传失败'
)
}).
catch
(()
=>
{
this
.
$message
.
error
(
'上传失败'
)
})
},
fileSelect
(
item
,
index
)
{
let
fileElem
=
this
.
$refs
[
'fileElem'
+
index
][
0
]
if
(
fileElem
)
{
fileElem
.
click
()
}
},
fileCheck
(
file
)
{
//判断是否小于1M
let
isLtSize
=
file
.
size
<
1024
*
1024
*
15
;
if
(
!
isLtSize
)
{
this
.
$message
.
error
(
'文件大小不能超过15M!'
);
return
false
}
return
true
},
// 添加附件
addfileList
()
{
this
.
fileList
.
push
(
Object
.
assign
({
...
File
},
{
fileExplain
:
''
}))
...
...
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