Commit 53b816a1 authored by rockyl's avatar rockyl

增加updateOperators方法

parent 6b9e549e
......@@ -7,6 +7,14 @@
import { fetchApi } from "./common"
import { getCookie } from './utils'
/**
* 获取项目列表
* @param keyword
* @param currentPage
* @param pageSize
* @param onlyMine
* @return {Promise<*|any>}
*/
export async function fetchAll(keyword, currentPage, pageSize, onlyMine) {
return await fetchApi('/api/project/query', {
params: {name: keyword, currentPage, pageSize, isAll: onlyMine ? 0 : 1 },
......@@ -14,6 +22,11 @@ export async function fetchAll(keyword, currentPage, pageSize, onlyMine) {
})
}
/**
* 创建一个项目
* @param project
* @return {Promise<*|any>}
*/
export async function createOne(project) {
return await fetchApi('/api/project/create', {
params: project,
......@@ -22,6 +35,11 @@ export async function createOne(project) {
})
}
/**
* 复制一个项目
* @param project
* @return {Promise<*|any>}
*/
export async function duplicateOne(project) {
return await fetchApi('/api/project/copy', {
params: project,
......@@ -30,6 +48,11 @@ export async function duplicateOne(project) {
})
}
/**
* 删除一个项目
* @param id
* @return {Promise<*|any>}
*/
export async function deleteOne(id) {
return await fetchApi('/api/project/delete', {
params: { id },
......@@ -38,6 +61,11 @@ export async function deleteOne(id) {
})
}
/**
* 获取一个项目
* @param id
* @return {Promise<*|any>}
*/
export async function fetchOne(id) {
return await fetchApi('/api/project/query/data', {
params: { id },
......@@ -46,6 +74,11 @@ export async function fetchOne(id) {
})
}
/**
* 从历史版本打开
* @param dataUrl
* @return {Promise<*|any>}
*/
export async function fetchOneFromDataUrl(dataUrl) {
return await fetchApi(dataUrl, {
auth: false,
......@@ -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) {
return await fetchApi('/api/project/history', {
params: { 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) {
project.remark = remark
project.remark = remark;
return await fetchApi('/api/project/update', {
params: project,
method: 'post',
......@@ -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) {
return await fetchApi('/api/project/pack', {
params: { id, debug, packedAssets },
......@@ -78,3 +131,17 @@ export async function pack(id, debug, packedAssets) {
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',
})
}
......@@ -96,6 +96,8 @@ export const projectStore = {
id: '',
name: '',
creator: '',
operator: '',
operators: '',
data: {
options: {},
views: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment