Browse Source

调试上传文件

dev
刘向辉 3 years ago
parent
commit
4badb63198
  1. 4
      src/app/babylon/controller/data-manager.ts
  2. 3
      src/app/babylon/controller/serve-manager.ts
  3. 4
      src/app/babylon/view/building-window/building-window.ts
  4. 7
      src/app/service/objects.service.ts

4
src/app/babylon/controller/data-manager.ts

@ -283,10 +283,9 @@ export class DataManager {
key: string key: string
): string { ): string {
let result = let result =
institutionKey.toLocaleLowerCase() institutionKey.toLocaleLowerCase() +
'/' + '/' +
ServeManager.ngAssetsPath + ServeManager.ngAssetsPath +
'/' +
buildingKey.toLocaleLowerCase() + buildingKey.toLocaleLowerCase() +
'/' + '/' +
key + key +
@ -302,7 +301,6 @@ export class DataManager {
institutionKey.toLocaleLowerCase() + institutionKey.toLocaleLowerCase() +
'/' + '/' +
ServeManager.ngAssetsPath + ServeManager.ngAssetsPath +
'/' +
buildingKey.toLocaleLowerCase() + buildingKey.toLocaleLowerCase() +
'/' + '/' +
ConfigManager.c_reaPath_facilityProperty + ConfigManager.c_reaPath_facilityProperty +

3
src/app/babylon/controller/serve-manager.ts

@ -152,6 +152,8 @@ export class ServeManager {
//#region 文件上传 //#region 文件上传
//队列性,批量上传 //队列性,批量上传
uploadFile(index: number, files: File[], resPath_out, onOneSuccess: (name: string, path: string, file: File) => void, onEnd: () => void) { uploadFile(index: number, files: File[], resPath_out, onOneSuccess: (name: string, path: string, file: File) => void, onEnd: () => void) {
console.log("上传路径", resPath_out);
if (index < files.length) { if (index < files.length) {
ServeManager.instance.openFileSelect(files[index], resPath_out, (name: string, path: string, file: File) => { ServeManager.instance.openFileSelect(files[index], resPath_out, (name: string, path: string, file: File) => {
onOneSuccess(name, path, file); onOneSuccess(name, path, file);
@ -197,6 +199,7 @@ export class ServeManager {
let fileName = dataObj.fileName; let fileName = dataObj.fileName;
let filePath: string = dataObj.objectName;//此路径不全,前面缺少ObjectsService.baseUrl,这部分不可序列化,要在运行时拼接 let filePath: string = dataObj.objectName;//此路径不全,前面缺少ObjectsService.baseUrl,这部分不可序列化,要在运行时拼接
filePath = filePath.replace(fileName, "");//去掉结尾的文件名 filePath = filePath.replace(fileName, "");//去掉结尾的文件名
console.log("上传完成,地址为", filePath);
//filePath = ObjectsService.baseUrl + filePath; //filePath = ObjectsService.baseUrl + filePath;
ServeManager.instance.onGetPostFileResult(fileName, filePath, file); ServeManager.instance.onGetPostFileResult(fileName, filePath, file);
resolve('success') resolve('success')

4
src/app/babylon/view/building-window/building-window.ts

@ -97,9 +97,9 @@ export class BuildingWindow extends UIBase {
let resPath_out = DataManager.getResPath_building( let resPath_out = DataManager.getResPath_building(
DataManager.institutionData.normalData.key.toLowerCase(), DataManager.institutionData.normalData.key.toLowerCase(),
normalData.key.toLocaleLowerCase(), normalData.key.toLocaleLowerCase(),
buildingData.normalData.key "outDoor"
); );
// console.log("新资源路径" + resPath_out); console.log("新资源路径" + resPath_out);
let buildingWindow = this; let buildingWindow = this;
let manifestFile: File = null; let manifestFile: File = null;

7
src/app/service/objects.service.ts

@ -55,6 +55,13 @@ export class ObjectsService {
ObjectsService.baseUrl = ObjectsService.c_apiRoot + bucketName; ObjectsService.baseUrl = ObjectsService.c_apiRoot + bucketName;
} }
/**
*
*/
static getFullPath() {
}
/** /**
* *
*/ */

Loading…
Cancel
Save