Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
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
劳工
zeroing-editor
Commits
53b816a1
Commit
53b816a1
authored
Apr 14, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加updateOperators方法
parent
6b9e549e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
1 deletion
+70
-1
project.js
src/api/project.js
+68
-1
project.js
src/store/modules/project.js
+2
-0
No files found.
src/api/project.js
View file @
53b816a1
...
@@ -7,6 +7,14 @@
...
@@ -7,6 +7,14 @@
import
{
fetchApi
}
from
"./common"
import
{
fetchApi
}
from
"./common"
import
{
getCookie
}
from
'./utils'
import
{
getCookie
}
from
'./utils'
/**
* 获取项目列表
* @param keyword
* @param currentPage
* @param pageSize
* @param onlyMine
* @return {Promise<*|any>}
*/
export
async
function
fetchAll
(
keyword
,
currentPage
,
pageSize
,
onlyMine
)
{
export
async
function
fetchAll
(
keyword
,
currentPage
,
pageSize
,
onlyMine
)
{
return
await
fetchApi
(
'/api/project/query'
,
{
return
await
fetchApi
(
'/api/project/query'
,
{
params
:
{
name
:
keyword
,
currentPage
,
pageSize
,
isAll
:
onlyMine
?
0
:
1
},
params
:
{
name
:
keyword
,
currentPage
,
pageSize
,
isAll
:
onlyMine
?
0
:
1
},
...
@@ -14,6 +22,11 @@ export async function fetchAll(keyword, currentPage, pageSize, onlyMine) {
...
@@ -14,6 +22,11 @@ export async function fetchAll(keyword, currentPage, pageSize, onlyMine) {
})
})
}
}
/**
* 创建一个项目
* @param project
* @return {Promise<*|any>}
*/
export
async
function
createOne
(
project
)
{
export
async
function
createOne
(
project
)
{
return
await
fetchApi
(
'/api/project/create'
,
{
return
await
fetchApi
(
'/api/project/create'
,
{
params
:
project
,
params
:
project
,
...
@@ -22,6 +35,11 @@ export async function createOne(project) {
...
@@ -22,6 +35,11 @@ export async function createOne(project) {
})
})
}
}
/**
* 复制一个项目
* @param project
* @return {Promise<*|any>}
*/
export
async
function
duplicateOne
(
project
)
{
export
async
function
duplicateOne
(
project
)
{
return
await
fetchApi
(
'/api/project/copy'
,
{
return
await
fetchApi
(
'/api/project/copy'
,
{
params
:
project
,
params
:
project
,
...
@@ -30,6 +48,11 @@ export async function duplicateOne(project) {
...
@@ -30,6 +48,11 @@ export async function duplicateOne(project) {
})
})
}
}
/**
* 删除一个项目
* @param id
* @return {Promise<*|any>}
*/
export
async
function
deleteOne
(
id
)
{
export
async
function
deleteOne
(
id
)
{
return
await
fetchApi
(
'/api/project/delete'
,
{
return
await
fetchApi
(
'/api/project/delete'
,
{
params
:
{
id
},
params
:
{
id
},
...
@@ -38,6 +61,11 @@ export async function deleteOne(id) {
...
@@ -38,6 +61,11 @@ export async function deleteOne(id) {
})
})
}
}
/**
* 获取一个项目
* @param id
* @return {Promise<*|any>}
*/
export
async
function
fetchOne
(
id
)
{
export
async
function
fetchOne
(
id
)
{
return
await
fetchApi
(
'/api/project/query/data'
,
{
return
await
fetchApi
(
'/api/project/query/data'
,
{
params
:
{
id
},
params
:
{
id
},
...
@@ -46,6 +74,11 @@ export async function fetchOne(id) {
...
@@ -46,6 +74,11 @@ export async function fetchOne(id) {
})
})
}
}
/**
* 从历史版本打开
* @param dataUrl
* @return {Promise<*|any>}
*/
export
async
function
fetchOneFromDataUrl
(
dataUrl
)
{
export
async
function
fetchOneFromDataUrl
(
dataUrl
)
{
return
await
fetchApi
(
dataUrl
,
{
return
await
fetchApi
(
dataUrl
,
{
auth
:
false
,
auth
:
false
,
...
@@ -54,6 +87,13 @@ export async function fetchOneFromDataUrl(dataUrl) {
...
@@ -54,6 +87,13 @@ export async function fetchOneFromDataUrl(dataUrl) {
})
})
}
}
/**
* 获取历史保存列表
* @param id
* @param currentPage
* @param pageSize
* @return {Promise<*|any>}
*/
export
async
function
fetchHistory
(
id
,
currentPage
,
pageSize
)
{
export
async
function
fetchHistory
(
id
,
currentPage
,
pageSize
)
{
return
await
fetchApi
(
'/api/project/history'
,
{
return
await
fetchApi
(
'/api/project/history'
,
{
params
:
{
id
,
currentPage
,
pageSize
},
params
:
{
id
,
currentPage
,
pageSize
},
...
@@ -62,8 +102,14 @@ export async function fetchHistory(id, currentPage, pageSize) {
...
@@ -62,8 +102,14 @@ export async function fetchHistory(id, currentPage, pageSize) {
})
})
}
}
/**
* 保存项目
* @param project
* @param remark
* @return {Promise<*|any>}
*/
export
async
function
saveOne
(
project
,
remark
)
{
export
async
function
saveOne
(
project
,
remark
)
{
project
.
remark
=
remark
project
.
remark
=
remark
;
return
await
fetchApi
(
'/api/project/update'
,
{
return
await
fetchApi
(
'/api/project/update'
,
{
params
:
project
,
params
:
project
,
method
:
'post'
,
method
:
'post'
,
...
@@ -71,6 +117,13 @@ export async function saveOne(project, remark) {
...
@@ -71,6 +117,13 @@ export async function saveOne(project, remark) {
})
})
}
}
/**
* 打包项目
* @param id
* @param debug
* @param packedAssets
* @return {Promise<*|any>}
*/
export
async
function
pack
(
id
,
debug
,
packedAssets
)
{
export
async
function
pack
(
id
,
debug
,
packedAssets
)
{
return
await
fetchApi
(
'/api/project/pack'
,
{
return
await
fetchApi
(
'/api/project/pack'
,
{
params
:
{
id
,
debug
,
packedAssets
},
params
:
{
id
,
debug
,
packedAssets
},
...
@@ -78,3 +131,17 @@ export async function pack(id, debug, packedAssets) {
...
@@ -78,3 +131,17 @@ export async function pack(id, debug, packedAssets) {
errMessage
:
'Failed to pack project'
,
errMessage
:
'Failed to pack project'
,
})
})
}
}
/**
* 修改开发人员名单
* @param id
* @param operators
* @return {Promise<*|any|>}
*/
export
async
function
updateOperators
(
id
,
operators
)
{
return
await
fetchApi
(
'/api/project/updateOperators'
,
{
params
:
{
id
,
operators
},
method
:
'post'
,
errMessage
:
'Failed to update operator'
,
})
}
src/store/modules/project.js
View file @
53b816a1
...
@@ -96,6 +96,8 @@ export const projectStore = {
...
@@ -96,6 +96,8 @@ export const projectStore = {
id
:
''
,
id
:
''
,
name
:
''
,
name
:
''
,
creator
:
''
,
creator
:
''
,
operator
:
''
,
operators
:
''
,
data
:
{
data
:
{
options
:
{},
options
:
{},
views
:
[],
views
:
[],
...
...
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