Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
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
紫光云
web-project
Commits
fc6b2c94
Commit
fc6b2c94
authored
Jul 05, 2024
by
小费同学阿
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
f0be57b8
8e0179fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
project.ts
src/api/project/project.ts
+16
-1
index.vue
src/views/project/index.vue
+20
-1
No files found.
src/api/project/project.ts
View file @
fc6b2c94
...
@@ -20,6 +20,8 @@ enum Api {
...
@@ -20,6 +20,8 @@ enum Api {
annexAdd
=
'/pro/annex/add'
,
annexAdd
=
'/pro/annex/add'
,
deleteAnnex
=
'/pro/annex/del'
,
deleteAnnex
=
'/pro/annex/del'
,
changeRecord
=
'/pro/project/select/changeRecord'
,
changeRecord
=
'/pro/project/select/changeRecord'
,
downloadTemplat
=
'/pro/export/getImportProject'
,
importDetails
=
'/pro/export/importProjectDetail'
,
}
}
export
const
getListByPage
=
(
params
?:
ProjectParams
)
=>
export
const
getListByPage
=
(
params
?:
ProjectParams
)
=>
defHttp
.
post
<
ProjectListGetResultModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
defHttp
.
post
<
ProjectListGetResultModel
>
({
url
:
Api
.
GetList
,
data
:
params
});
...
@@ -43,7 +45,7 @@ export const getAnnexList = (params?: any) =>
...
@@ -43,7 +45,7 @@ export const getAnnexList = (params?: any) =>
defHttp
.
get
<
AnnexListItem
>
({
url
:
Api
.
annexList
,
params
});
defHttp
.
get
<
AnnexListItem
>
({
url
:
Api
.
annexList
,
params
});
export
const
getProjectAnnexList
=
(
params
?:
any
)
=>
export
const
getProjectAnnexList
=
(
params
?:
any
)
=>
defHttp
.
get
<
AnnexListItem
>
({
url
:
Api
.
projectAnnexList
,
params
});
defHttp
.
get
<
AnnexListItem
>
({
url
:
Api
.
projectAnnexList
,
params
});
export
const
AnnexAdd
=
(
params
?:
any
)
=>
export
const
AnnexAdd
=
(
params
?:
any
)
=>
defHttp
.
post
<
AnnexListItem
>
({
defHttp
.
post
<
AnnexListItem
>
({
...
@@ -58,3 +60,16 @@ export const deleteAnnex = (params?: any) =>
...
@@ -58,3 +60,16 @@ export const deleteAnnex = (params?: any) =>
export
const
changeRecord
=
(
params
?:
any
)
=>
export
const
changeRecord
=
(
params
?:
any
)
=>
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
changeRecord
,
params
});
defHttp
.
post
<
ProjectModel
>
({
url
:
Api
.
changeRecord
,
params
});
export
const
downImportT
=
(
params
?:
any
)
=>
defHttp
.
get
<
any
>
(
{
url
:
Api
.
downloadTemplat
,
data
:
params
,
headers
:
{
'Content-Type'
:
'application/form-data;charset=UTF-8'
,
},
responseType
:
'blob'
,
},
{
errorMessageMode
:
'none'
,
isTransformResponse
:
false
},
);
src/views/project/index.vue
View file @
fc6b2c94
...
@@ -52,6 +52,8 @@
...
@@ -52,6 +52,8 @@
<BasicTable
@
register=
"registerTable"
>
<BasicTable
@
register=
"registerTable"
>
<template
#
toolbar
>
<template
#
toolbar
>
<a-button
type=
"primary"
preIcon=
"mdi:plus"
@
click=
"handleCreate"
>
新增项目
</a-button>
<a-button
type=
"primary"
preIcon=
"mdi:plus"
@
click=
"handleCreate"
>
新增项目
</a-button>
<a-button
type=
"primary"
@
click=
"downloadTemplate"
>
下载模板
</a-button>
<a-button
type=
"primary"
@
click=
"exportProjectData"
>
导入数据
</a-button>
</
template
>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'projectName'"
>
<template
v-if=
"column.key === 'projectName'"
>
...
@@ -89,19 +91,23 @@
...
@@ -89,19 +91,23 @@
</template>
</template>
</BasicTable>
</BasicTable>
<projectDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
<projectDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
<uploadModal
@
register=
"registerModal"
/>
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
Tag
}
from
'ant-design-vue'
;
import
{
Tag
}
from
'ant-design-vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getListByPage
,
deleteItem
,
getProjectCount
}
from
'@/api/project/project'
;
import
{
getListByPage
,
deleteItem
,
getProjectCount
,
downImportT
}
from
'@/api/project/project'
;
import
{
columns
,
searchFormSchema
}
from
'./project.data'
;
import
{
columns
,
searchFormSchema
}
from
'./project.data'
;
import
{
Row
,
Col
}
from
'ant-design-vue'
;
import
{
Row
,
Col
}
from
'ant-design-vue'
;
import
projectDrawer
from
'./projectDrawer.vue'
;
import
projectDrawer
from
'./projectDrawer.vue'
;
import
{
useDrawer
}
from
'@/components/Drawer'
;
import
{
useDrawer
}
from
'@/components/Drawer'
;
import
{
useModal
}
from
"@/components/Modal"
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useRouter
}
from
'vue-router'
;
const
{
push
}
=
useRouter
();
const
{
push
}
=
useRouter
();
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
downloadByData
}
from
"@/utils/file/download"
;
const
[
registerModal
,
{
openModal
:
openModal
}]
=
useModal
();
const
countData
=
ref
({});
const
countData
=
ref
({});
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
prefixCls
=
'list-basic'
;
const
prefixCls
=
'list-basic'
;
...
@@ -125,6 +131,18 @@
...
@@ -125,6 +131,18 @@
},
},
});
});
function
downloadTemplate
(){
downImportT
().
then
((
data
)
=>
{
downloadByData
(
data
,
"项目库导入模板.xlsx"
);
})
}
function
exportProjectData
(){
openModal
(
true
)
}
function
handleChange
(
file
){
console
.
log
(
'112'
,
file
)
}
function
handleCreate
()
{
function
handleCreate
()
{
openDrawer
(
true
,
{
openDrawer
(
true
,
{
isUpdate
:
false
,
isUpdate
:
false
,
...
@@ -164,6 +182,7 @@
...
@@ -164,6 +182,7 @@
console
.
log
(
res
);
console
.
log
(
res
);
countData
.
value
=
res
;
countData
.
value
=
res
;
});
});
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.list-basic {
.list-basic {
...
...
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