|
|
@ -56,6 +56,14 @@ export default class LCCScript implements LCC { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getLock(): { lock: Promise<void>, release: () => void } { |
|
|
|
|
|
const obj = Promise.withResolvers<void>() |
|
|
|
|
|
return { |
|
|
|
|
|
lock: obj.promise, |
|
|
|
|
|
release: obj.resolve |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 从后台读取所有库存
|
|
|
// 从后台读取所有库存
|
|
|
async queryInv(option: InvQueryCondition = {}): Promise<ServerResponse<InvVo[]>> { |
|
|
async queryInv(option: InvQueryCondition = {}): Promise<ServerResponse<InvVo[]>> { |
|
|
return Request.request.post('/api/workbench/InvController@queryInv', { |
|
|
return Request.request.post('/api/workbench/InvController@queryInv', { |
|
|
@ -96,7 +104,7 @@ export default class LCCScript implements LCC { |
|
|
* 保存当前项目所有脚本 |
|
|
* 保存当前项目所有脚本 |
|
|
* @param scriptList |
|
|
* @param scriptList |
|
|
*/ |
|
|
*/ |
|
|
saveScripts(scriptList: { name: string, content: string }[]): Promise<ServerResponse<void>>{ |
|
|
saveScripts(scriptList: { name: string, content: string }[]): Promise<ServerResponse<void>> { |
|
|
if (!worldModel.state.project_uuid) { |
|
|
if (!worldModel.state.project_uuid) { |
|
|
return Promise.reject(new Error('Project UUID is not set.')) |
|
|
return Promise.reject(new Error('Project UUID is not set.')) |
|
|
} |
|
|
} |
|
|
@ -110,13 +118,13 @@ export default class LCCScript implements LCC { |
|
|
/** |
|
|
/** |
|
|
* 同步当前项目所有脚本 |
|
|
* 同步当前项目所有脚本 |
|
|
*/ |
|
|
*/ |
|
|
syncScripts(): Promise<ServerResponse<{ name: string, content: string }[]>>{ |
|
|
syncScripts(): Promise<ServerResponse<{ name: string, content: string }[]>> { |
|
|
if (!worldModel.state.project_uuid) { |
|
|
if (!worldModel.state.project_uuid) { |
|
|
return Promise.reject(new Error('Project UUID is not set.')) |
|
|
return Promise.reject(new Error('Project UUID is not set.')) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return Request.request.post('/api/workbench/LccController@syncScripts', { |
|
|
return Request.request.post('/api/workbench/LccController@syncScripts', { |
|
|
projectUUID: worldModel.state.project_uuid, |
|
|
projectUUID: worldModel.state.project_uuid |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|