rt-sim-training-client/src/api/script.js
2020-11-06 13:15:18 +08:00

137 lines
3.2 KiB
JavaScript

import request from '@/utils/request';
/** 分页查找上线的剧本(新版)*/
export function getScriptPageListOnlineNew(params) {
return request({
url: `/api/script/v1/paging/online`,
method: 'get',
params: params
});
}
/** 通过ID查询发布的剧本的详细信息(新版) */
export function getScriptByIdNew(id) {
return request({
url: `/api/script/v1/${id}/detail`,
method: 'get'
});
}
/** 通过group查询未发布剧本的详细信息(新版) */
export function getDraftScriptByGroupNew(group) {
return request({
url: `/api/scriptSimulation/${group}/scriptDetail`,
method: 'get'
});
}
/** 剧本撤销发布 */
export function retractScript(id) {
return request({
url: `/api/script/draft/${id}/retract`,
method: 'put'
});
}
/** 剧本发布 */
export function publishScript(id, data) {
return request({
url: `/api/script/draft/${id}/publish`,
method: 'put',
data
});
}
/** 更新剧本基本信息 */
export function updateScript(id, data) {
return request({
url: `/api/script/draft/${id}`,
method: 'put',
data
});
}
/** 根据剧本id删除剧本 */
export function deleteScript(id) {
return request({
url: `/api/script/draft/${id}`,
method: 'delete'
});
}
/** 分页查找个人录制的仿真剧本*/
export function getScriptPageList(mapId, params) {
return request({
url: `/api/script/draft/${mapId}/list`,
method: 'get',
params: params
});
}
/** 创建剧本 */
export function createScript(data) {
return request({
url: `/api/script/draft`,
method: 'post',
data
});
}
/** 根据id查询任务基础信息 */
export function getScriptByIdBasic(id) {
return request({
url: `/api/script/draft/${id}`,
method: 'get'
});
}
/** 切换剧本的仿真成员 */
export function changeScriptRole(group, memberId) {
return request({
url: `/api/scriptSimulation/${group}/${memberId}/switch`,
method: 'put'
});
}
/** 获取所有选取过的成员 接口(剧本录制) */
export function getAllSelectedScriptRole(group) {
return request({
url: `/api/scriptSimulation/${group}/allSelectedMembers`,
method: 'get'
});
}
/** 草稿剧本数据导入*/
export function postScriptImport(mapId, name, data) {
return request({
url: `/api/script/draft/${mapId}/import?name=${name}`,
method: 'post',
data: data,
time: 60000
});
}
/** 草稿剧本数据导出 */
export function getScriptExport(id) {
return request({
url: `/api/script/draft/${id}/export`,
method: 'get'
});
}
/** 删除会话动作(新版)*/
export function deleteScriptAction(group, actionId) {
return request({
url: `/api/scriptSimulation/${group}/${actionId}/delete`,
method: 'delete'
});
}
/** 修改剧本活动条件 */
export function updateActionCondition(group, actionId, data) {
return request({
url: `/api/scriptSimulation/${group}/${actionId}/updateCondition`,
method: 'put',
data
});
}