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
b7535d40
Commit
b7535d40
authored
Feb 18, 2025
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
333
parent
0bec7ba6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
358 additions
and
22 deletions
+358
-22
file.vue
src/views/manager/project/components/file.vue
+99
-0
index.vue
src/views/manager/project/index.vue
+6
-1
projectView.vue
src/views/report/project/components/projectView.vue
+40
-19
taskView.vue
src/views/report/project/components/taskView.vue
+210
-0
tmp-task.html
src/views/report/project/components/tmp-task.html
+0
-0
taskView.vue
src/views/report/task/components/taskView.vue
+3
-2
tmp-task.html
src/views/report/task/components/tmp-task.html
+0
-0
No files found.
src/views/manager/project/components/file.vue
0 → 100644
View file @
b7535d40
<
template
>
<div
class=
"upload-container"
>
<el-button
type=
"primary"
@
click=
"handleClick"
>
选择文件
</el-button>
<input
type=
"file"
ref=
"fileInput"
multiple
style=
"display: none"
@
change=
"handleFileChange"
/>
<div
class=
"file-list"
v-if=
"fileList.length"
>
<div
v-for=
"(file, index) in fileList"
:key=
"index"
class=
"file-item"
>
<span>
{{
file
.
name
}}
</span>
<span>
{{
(
file
.
size
/
1024
/
1024
).
toFixed
(
2
)
}}
MB
</span>
<el-progress
:percentage=
"file.progress || 0"
/>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'FileUpload'
,
data
()
{
return
{
fileList
:
[]
}
},
methods
:
{
handleClick
()
{
this
.
$refs
.
fileInput
.
click
()
},
handleFileChange
(
e
)
{
const
files
=
Array
.
from
(
e
.
target
.
files
)
this
.
fileList
=
files
.
map
(
file
=>
({
file
,
name
:
file
.
name
,
size
:
file
.
size
,
progress
:
0
}))
this
.
uploadFiles
()
},
async
uploadFiles
()
{
for
(
let
i
=
0
;
i
<
this
.
fileList
.
length
;
i
++
)
{
const
fileItem
=
this
.
fileList
[
i
]
try
{
await
this
.
uploadFile
(
fileItem
,
i
)
// 添加2秒延时,除非是最后一个文件
if
(
i
<
this
.
fileList
.
length
-
1
)
{
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
2000
))
}
}
catch
(
error
)
{
console
.
error
(
'上传失败:'
,
error
)
}
}
},
uploadFile
(
fileItem
,
index
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
formData
=
new
FormData
()
formData
.
append
(
'file'
,
fileItem
.
file
)
// 这里替换成您的实际上传API
const
xhr
=
new
XMLHttpRequest
()
xhr
.
upload
.
onprogress
=
(
event
)
=>
{
if
(
event
.
lengthComputable
)
{
this
.
$set
(
this
.
fileList
[
index
],
'progress'
,
Math
.
round
((
event
.
loaded
/
event
.
total
)
*
100
))
}
}
xhr
.
onload
=
()
=>
{
if
(
xhr
.
status
===
200
)
{
resolve
()
}
else
{
reject
(
new
Error
(
'上传失败'
))
}
}
xhr
.
onerror
=
()
=>
reject
(
new
Error
(
'上传失败'
))
// 替换成实际的上传地址
xhr
.
open
(
'POST'
,
'/api/upload'
)
xhr
.
send
(
formData
)
})
}
}
}
</
script
>
<
style
scoped
>
.upload-container
{
padding
:
20px
;
}
.file-list
{
margin-top
:
20px
;
}
.file-item
{
margin-bottom
:
10px
;
padding
:
10px
;
border
:
1px
solid
#eee
;
border-radius
:
4px
;
}
</
style
>
src/views/manager/project/index.vue
View file @
b7535d40
...
@@ -58,6 +58,9 @@
...
@@ -58,6 +58,9 @@
<a-modal
v-model=
"visibleRecord"
title=
"审核记录"
width=
"80%"
:dialog-style=
"{ top: '8%' }"
:footer=
"null"
destroyOnClose
>
<a-modal
v-model=
"visibleRecord"
title=
"审核记录"
width=
"80%"
:dialog-style=
"{ top: '8%' }"
:footer=
"null"
destroyOnClose
>
<audit-record
v-model=
"id"
@
close=
"() => this.visibleRecord = false"
/>
<audit-record
v-model=
"id"
@
close=
"() => this.visibleRecord = false"
/>
</a-modal>
</a-modal>
<a-modal
v-model=
"visibleFile"
title=
"文件上传"
width=
"80%"
:dialog-style=
"{ top: '8%' }"
:footer=
"null"
destroyOnClose
>
<file-edit
v-model=
"id"
@
close=
"() => this.visibleFile = false"
/>
</a-modal>
</div>
</div>
</template>
</template>
...
@@ -70,10 +73,11 @@ import paraSelect from '@/views/components/common/paraSelect'
...
@@ -70,10 +73,11 @@ import paraSelect from '@/views/components/common/paraSelect'
import
baseSelect
from
'@/views/components/common/baseSelect'
import
baseSelect
from
'@/views/components/common/baseSelect'
import
projectImport
from
'@/views/manager/project/components/projectImport'
;
import
projectImport
from
'@/views/manager/project/components/projectImport'
;
import
auditRecord
from
'@/views/manager/project/components/auditRecord'
;
import
auditRecord
from
'@/views/manager/project/components/auditRecord'
;
import
fileEdit
from
'@/views/manager/project/components/file'
;
export
default
{
export
default
{
name
:
'managerProject'
,
name
:
'managerProject'
,
components
:
{
components
:
{
projectView
,
projectCreate
,
paraSelect
,
baseSelect
,
projectImport
,
auditRecord
projectView
,
projectCreate
,
paraSelect
,
baseSelect
,
projectImport
,
auditRecord
,
fileEdit
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -99,6 +103,7 @@ export default {
...
@@ -99,6 +103,7 @@ export default {
id
:
null
,
id
:
null
,
visibleImport
:
false
,
visibleImport
:
false
,
visibleRecord
:
false
,
visibleRecord
:
false
,
visibleFile
:
false
,
loadState
:
false
,
loadState
:
false
,
selectedRowKeys
:
[],
selectedRowKeys
:
[],
}
}
...
...
src/views/report/project/components/projectView.vue
View file @
b7535d40
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</div>
</div>
<div
class=
"page-footer"
>
<div
class=
"page-footer"
>
<!-- 申报项目详情 -->
<!-- 申报项目详情 -->
<a-button
type=
"primary"
@
click=
"on
Project
Export"
>
导出
</a-button>
<a-button
type=
"primary"
@
click=
"onExport"
>
导出
</a-button>
<project-info
v-model=
"formData"
:tabsData
.
sync=
"tabsData"
v-if=
"projType=='1'"
/>
<project-info
v-model=
"formData"
:tabsData
.
sync=
"tabsData"
v-if=
"projType=='1'"
/>
<project-info-Key
v-model=
"formData"
:tabsData
.
sync=
"tabsData"
v-if=
"projType=='2'"
/>
<project-info-Key
v-model=
"formData"
:tabsData
.
sync=
"tabsData"
v-if=
"projType=='2'"
/>
</div>
</div>
...
@@ -54,8 +54,9 @@ const projectKPI = {
...
@@ -54,8 +54,9 @@ const projectKPI = {
kpiList
:
[],
kpiList
:
[],
};
};
import
axios
from
'axios'
import
{
getType
,
getToken
}
from
'@/views/utils/auth'
import
{
budgetList
}
from
'@/views/report/project/config'
import
{
budgetList
}
from
'@/views/report/project/config'
import
{
getType
}
from
'@/views/utils/auth'
import
projectInfo
from
'@/views/report/project/components/projectInfo'
import
projectInfo
from
'@/views/report/project/components/projectInfo'
import
projectInfoKey
from
"@/views/report/project/components/keyProject/projectInfo"
import
projectInfoKey
from
"@/views/report/project/components/keyProject/projectInfo"
export
default
{
export
default
{
...
@@ -149,25 +150,45 @@ export default {
...
@@ -149,25 +150,45 @@ export default {
}
}
},
},
onExport
()
{
onExport
()
{
this
.
$api
.
project
.
export
({
id
:
this
.
value
}).
then
((
res
)
=>
{
let
headers
=
{
let
blob
=
new
Blob
([
res
],
{
Authorization
:
'Bearer '
+
getToken
()
type
:
"application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=utf-8"
,
}
});
axios
({
const
fileName
=
this
.
formData
.
projName
+
'.doc'
;
url
:
"/v1/science-admin/com-project/export/"
+
this
.
value
,
// 替换为实际文件的URL
let
downloadElement
=
document
.
createElement
(
'a'
)
method
:
'GET'
,
let
href
=
window
.
URL
.
createObjectURL
(
blob
);
//创建下载的链接
responseType
:
"arraybuffer"
,
// 告诉axios返回的数据类型为Blob
downloadElement
.
href
=
href
;
headers
:
headers
downloadElement
.
download
=
fileName
;
//下载后文件名
}).
then
(
response
=>
{
document
.
body
.
appendChild
(
downloadElement
);
console
.
log
(
response
.
data
)
downloadElement
.
click
();
//点击下载
const
url
=
window
.
URL
.
createObjectURL
(
new
Blob
([
response
.
data
]))
document
.
body
.
removeChild
(
downloadElement
);
//下载完成移除元素
const
link
=
document
.
createElement
(
'a'
)
window
.
URL
.
revokeObjectURL
(
href
);
//释放blob
link
.
href
=
url
link
.
setAttribute
(
"download"
,
"11111.pdf"
);
// 下载文件的名称
document
.
body
.
appendChild
(
link
)
link
.
click
()
})
})
},
},
onProjectExport
()
{
onExport1
()
{
this
.
$api
.
project
.
projectExport
({
id
:
this
.
value
}).
then
((
res
)
=>
{
var
xhr
=
new
XMLHttpRequest
();
// 用这种原生请求下载后端返回的二进制流打开就不会出现空白
this
.
$message
.
success
(
data
.
msg
)
xhr
.
open
(
"get"
,
"/v1/science-admin/com-project/export/"
+
this
.
value
,
true
);
})
xhr
.
setRequestHeader
(
"Authorization"
,
'Bearer '
+
getToken
())
xhr
.
responseType
=
"blob"
;
xhr
.
onload
=
function
()
{
console
.
log
(
this
)
if
(
this
.
status
==
200
)
{
const
url
=
window
.
URL
.
createObjectURL
(
this
.
response
);
const
link
=
document
.
createElement
(
"a"
);
link
.
style
.
display
=
"none"
;
link
.
href
=
url
;
link
.
setAttribute
(
"download"
,
"结题审核页.pdf"
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
document
.
body
.
removeChild
(
link
);
}
else
{
}
};
xhr
.
send
();
},
},
callback
(
key
)
{
callback
(
key
)
{
var
index
=
parseInt
(
key
)
var
index
=
parseInt
(
key
)
...
...
src/views/report/project/components/taskView.vue
0 → 100644
View file @
b7535d40
<
template
>
<div
class=
"app-content layoutEmbedded"
style=
"height: 76vh;overflow: auto;"
>
<a-spin
:spinning=
"loading"
style=
"width: 100%;height: 100%;"
>
<div
class=
"page-content"
>
<a-tabs
type=
"card"
hideAdd
size=
"small"
@
change=
"callback"
>
<a-tab-pane
:key=
"item.key"
:tab=
"item.title"
v-for=
"(item) in tabsData"
>
</a-tab-pane>
</a-tabs>
</div>
<div
class=
"page-footer"
>
<!-- 申报项目详情 -->
<a-button
type=
"primary"
@
click=
"onExport"
>
导出
</a-button>
<task-info
v-model=
"formData"
:tabsData
.
sync=
"tabsData"
/>
</div>
</a-spin>
</div>
</
template
>
<
script
>
const
projectKPI
=
{
reportYear
:
""
,
projName
:
""
,
appUnitName
:
""
,
managerDept
:
""
,
projAttribute
:
""
,
projDeadline
:
""
,
startDate
:
""
,
endData
:
""
,
yearTarget
:
""
,
year1Goal
:
""
,
year2Goal
:
""
,
year3Goal
:
""
,
totalBudget
:
0.00
,
applyFunds
:
0.00
,
selfFunds
:
0.00
,
yearTotal
:
0.00
,
yearApply
:
0.00
,
yearSelf
:
0.00
,
totalRowSpan
:
0
,
//总合并行数
outTarget
:
0
,
//一级指标(产出指标)
benefitTarget
:
0
,
//一级指标(效益指标)
satisfactionDegree
:
0
,
//一级指标(满意度指标)
quantityTarget
:
0
,
//二级指标(数量指标)
qualityTarget
:
0
,
//二级指标(质量指标)
validityTarget
:
0
,
//二级指标(时效指标)
costTarget
:
0
,
//二级指标(成本指标)
economicTarget
:
0
,
//二级指标(经济效益指标)
socialTarget
:
0
,
//二级指标(社会效益指标)
ecologicalTarget
:
0
,
//二级指标(生态效益指标)
sustainableTarget
:
0
,
//二级指标(可持续影响指标)
serviceTarget
:
0
,
//二级指标(服务对象满意度指标)
threeLevel
:
[],
kpiList
:
[],
};
import
axios
from
'axios'
import
{
getToken
,
removeToken
,
getType
}
from
'@/views/utils/auth'
import
{
budgetList
}
from
'@/views/report/project/config'
import
taskInfo
from
"@/views/report/task/components/taskInfo"
export
default
{
name
:
"projectView"
,
components
:
{
taskInfo
},
data
()
{
return
{
tabsData
:
[
{
title
:
'全部'
,
key
:
'0'
,
isShow
:
true
},
{
title
:
'项目基本信息'
,
key
:
'1'
,
isShow
:
true
},
{
title
:
'项目人员情况'
,
key
:
'2'
,
isShow
:
true
},
{
title
:
'项目主要实施内容和目标'
,
key
:
'3'
,
isShow
:
true
},
{
title
:
'申请书正文'
,
key
:
'4'
,
isShow
:
true
},
{
title
:
'经费预算及设备明细'
,
key
:
'5'
,
isShow
:
true
},
{
title
:
'项目实施阶段及任务'
,
key
:
'6'
,
isShow
:
true
},
{
title
:
'项目课题设置'
,
key
:
'7'
,
isShow
:
true
},
{
title
:
'绩效目标表'
,
key
:
'8'
,
isShow
:
true
},
{
title
:
'附件信息'
,
key
:
'9'
,
isShow
:
true
},
{
title
:
'审核记录'
,
key
:
'10'
,
isShow
:
true
},
],
formData
:
{
id
:
null
,
appPersonName
:
null
,
sex
:
null
,
birthday
:
null
,
nationName
:
null
,
degreeName
:
null
,
titleName
:
null
,
mobile
:
null
,
email
:
null
,
jobTime
:
null
,
address
:
null
,
appUnitName
:
null
,
mainResearchAreas
:
null
,
unitLinkName
:
null
,
unitLinkMobile
:
null
,
unitLinkEmail
:
null
,
unitLinkFax
:
null
,
projName
:
null
,
knowledgeId
:
null
,
subjectScope
:
null
,
projClass
:
null
,
remark
:
null
,
startDate
:
null
,
endDate
:
null
,
totalFunding
:
null
,
govFunding
:
null
,
projAbstract
:
null
,
projKeywords
:
null
,
yearTarget
:
null
,
year1Goal
:
null
,
year2Goal
:
null
,
year3Goal
:
null
,
projectKPI
:
projectKPI
,
cooperativeUnits
:
[],
members
:
[],
budget
:
[],
fundPlan
:
[],
fileList
:
[],
auditList
:
[],
managerDept
:
""
,
},
loading
:
false
,
projType
:
getType
()
};
},
props
:
{
value
:
{
type
:
String
,
default
:
()
=>
{
return
null
}
},
},
created
()
{
this
.
getTaskByProjId
()
},
methods
:
{
getTaskByProjId
()
{
if
(
this
.
value
!=
null
)
{
this
.
loading
=
true
this
.
$api
.
task
.
getTaskByProjId
({
id
:
this
.
value
}).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
this
.
formData
=
data
this
.
loading
=
false
}
else
this
.
$emit
(
'close'
,
'error'
)
}).
catch
(()
=>
{
this
.
$emit
(
'close'
,
'error'
)
})
}
},
onExport
()
{
axios
({
url
:
"/v1/science-admin/com-project-task/export/"
+
this
.
value
,
method
:
'GET'
,
responseType
:
"blob"
,
headers
:
{
Authorization
:
'Bearer '
+
getToken
(),
'Content-Type'
:
'application/pdf;charset=utf-8'
}
}).
then
(
response
=>
{
console
.
log
(
response
)
const
blob
=
new
Blob
([
response
.
data
],
{
type
:
'application/pdf'
});
const
url
=
window
.
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
'a'
);
link
.
href
=
url
;
const
filename
=
response
.
headers
[
'content-disposition'
]
?
decodeURIComponent
(
response
.
headers
[
'content-disposition'
].
split
(
'filename='
)[
1
])
:
'项目报告.pdf'
;
link
.
setAttribute
(
"download"
,
filename
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
document
.
body
.
removeChild
(
link
);
window
.
URL
.
revokeObjectURL
(
url
);
}).
catch
(
error
=>
{
console
.
error
(
'下载文件出错:'
,
error
);
this
.
$message
.
error
(
'下载文件失败'
);
});
},
callback
(
key
)
{
var
index
=
parseInt
(
key
)
this
.
tabsData
.
forEach
(
e
=>
{
if
(
key
==
'0'
)
e
.
isShow
=
true
else
e
.
isShow
=
false
})
this
.
tabsData
[
0
].
isShow
=
true
;
this
.
tabsData
[
index
].
isShow
=
true
;
},
},
}
</
script
>
<
style
scoped
lang=
"less"
>
::v-deep .ant-spin-container {
width: 100%;
height: 100%;
}
::-webkit-scrollbar {
width: 8px;
height: 6px;
}
.page-content {
width: 100%;
height: 50px;
}
.page-footer {
width: 100%;
height: calc(100% - 50px);
overflow: auto;
}
</
style
>
src/views/report/project/components/tmp-task.html
View file @
b7535d40
This diff is collapsed.
Click to expand it.
src/views/report/task/components/taskView.vue
View file @
b7535d40
...
@@ -53,8 +53,9 @@ const projectKPI = {
...
@@ -53,8 +53,9 @@ const projectKPI = {
kpiList
:
[],
kpiList
:
[],
};
};
import
axios
from
'axios'
import
{
getToken
,
removeToken
,
getType
}
from
'@/views/utils/auth'
import
{
budgetList
}
from
'@/views/report/project/config'
import
{
budgetList
}
from
'@/views/report/project/config'
import
{
getType
}
from
'@/views/utils/auth'
import
taskInfo
from
"@/views/report/task/components/taskInfo"
import
taskInfo
from
"@/views/report/task/components/taskInfo"
export
default
{
export
default
{
name
:
"projectView"
,
name
:
"projectView"
,
...
@@ -148,7 +149,7 @@ export default {
...
@@ -148,7 +149,7 @@ export default {
},
},
onExport
()
{
onExport
()
{
axios
({
axios
({
url
:
"/v1/science-admin/com-project
/export1
/"
+
this
.
value
,
url
:
"/v1/science-admin/com-project
-task/export
/"
+
this
.
value
,
method
:
'GET'
,
method
:
'GET'
,
responseType
:
"blob"
,
responseType
:
"blob"
,
headers
:
{
headers
:
{
...
...
src/views/report/task/components/tmp-task.html
0 → 100644
View file @
b7535d40
This diff is collapsed.
Click to expand it.
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