diff --git a/Frontend/_graphManagement.html b/Frontend/_graphManagement.html index 43dbeaa..5038f0e 100644 --- a/Frontend/_graphManagement.html +++ b/Frontend/_graphManagement.html @@ -14,8 +14,8 @@
- - +上傳 + + +新增
@@ -117,17 +117,20 @@ data-keyboard="false"> -
\ No newline at end of file diff --git a/Frontend/index.html b/Frontend/index.html index 986e9b1..346e909 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -37,7 +37,6 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li - diff --git a/Frontend/js/init.js b/Frontend/js/init.js index 7411dfa..091034f 100644 --- a/Frontend/js/init.js +++ b/Frontend/js/init.js @@ -5,6 +5,7 @@ var varRegApiUrl = "/reg/api/"; //註冊API路徑 var varApiUrl = "/api/"; //API路徑 var varPathImg = "/Upload/Images/"; var varPathFile = "/Upload/Files/"; +var varGraPath = "/upload/graph_manage"; var statusArr = { 1: "啟用", 0: "未啟用", 9: "刪除" }; var common = { AddSuc: "新增成功", diff --git a/Frontend/js/style.js b/Frontend/js/style.js index aea62e5..1422590 100644 --- a/Frontend/js/style.js +++ b/Frontend/js/style.js @@ -1349,10 +1349,15 @@ function toBool(boolstr) { * @param {any} url * @param {any} filename */ -async function download(url, filename) { +async function download(token,url, filename) { let toDataURL = function (url) { - return fetch(url).then((response) => { + return fetch(url, { + headers: { + 'Content-Type': 'application/octet-stream', + "Authorization": "Bearer " + token, + }, + }).then((response) => { if (!response.ok) { throw new Error("Not 2xx response", { cause: response }); } else { diff --git a/FrontendWebApi/ApiControllers/GraphManageController.cs b/FrontendWebApi/ApiControllers/GraphManageController.cs index 852bdaf..fda52a8 100644 --- a/FrontendWebApi/ApiControllers/GraphManageController.cs +++ b/FrontendWebApi/ApiControllers/GraphManageController.cs @@ -288,7 +288,22 @@ namespace FrontendWebApi.ApiControllers try { - + if (gii.oriOrgName == "null") + { + gii.oriOrgName = null; + } + if (gii.donOrgName == "null") + { + gii.donOrgName = null; + } + if (gii.oriSavName == "null") + { + gii.oriSavName = null; + } + if (gii.donSavName == "null") + { + gii.donSavName = null; + } var sWhere = $@"deleted = 0 and id != @id and code = @code and layer_id = @layer_id"; var gm = await backendRepository.GetOneAsync("graph_manage", sWhere, new { @id = gii.id, @code = gii.code, @layer_id = gii.layer_id}); @@ -315,13 +330,13 @@ namespace FrontendWebApi.ApiControllers //原設計圖修改 var new_guid = Guid.NewGuid(); //刪除原本檔案 - if (gm.oriSavName != null && gii.oriOrgName == null) + if (gm.oriSavName != null && gii.oriSavName != gm.oriSavName) { FolderFunction folderFunction = new FolderFunction(); folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.oriSavName)); } - string fileName = null; + string fileName = gii.oriSavName ?? null; if (gii.oriOrgName != null && gii.oriFile != null) { fileName = new_guid + "." + gii.oriOrgName.Split('.')[1]; @@ -332,15 +347,16 @@ namespace FrontendWebApi.ApiControllers { gii.oriFile.CopyTo(stream); } + } graph_manage.Add("@oriOrgName", gii.oriOrgName); graph_manage.Add("@oriSavName", fileName); - fileName = null; + fileName = gii.donSavName ?? null; //竣工圖修改 new_guid = Guid.NewGuid(); //刪除原本檔案 - if (gm.donSavName != null && gii.donOrgName == null) + if (gm.donSavName != null && gii.donSavName != gm.donSavName) { var folderFunction = new FolderFunction(); folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.donSavName)); diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/072b74e4-a418-4e98-9d90-c8d48cfb7e4b.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/072b74e4-a418-4e98-9d90-c8d48cfb7e4b.dwg new file mode 100644 index 0000000..0bf7d4d Binary files /dev/null and b/FrontendWebApi/wwwroot/upload/graph_manage/072b74e4-a418-4e98-9d90-c8d48cfb7e4b.dwg differ diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/352efaf2-d205-4d2a-b2c4-a8245e285bad.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/352efaf2-d205-4d2a-b2c4-a8245e285bad.dwg new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/FrontendWebApi/wwwroot/upload/graph_manage/352efaf2-d205-4d2a-b2c4-a8245e285bad.dwg @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/56f192c7-1ce5-4e3f-83d6-cd8227a484dd.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/56f192c7-1ce5-4e3f-83d6-cd8227a484dd.dwg new file mode 100644 index 0000000..0bf7d4d Binary files /dev/null and b/FrontendWebApi/wwwroot/upload/graph_manage/56f192c7-1ce5-4e3f-83d6-cd8227a484dd.dwg differ diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/59ef4b28-e1a9-4edf-80de-d1ba3c7ee7fc.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/59ef4b28-e1a9-4edf-80de-d1ba3c7ee7fc.dwg new file mode 100644 index 0000000..2a352a6 Binary files /dev/null and b/FrontendWebApi/wwwroot/upload/graph_manage/59ef4b28-e1a9-4edf-80de-d1ba3c7ee7fc.dwg differ diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/a5c2c64f-51d3-4e1c-8878-ca41e043170e.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/a5c2c64f-51d3-4e1c-8878-ca41e043170e.dwg new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/FrontendWebApi/wwwroot/upload/graph_manage/a5c2c64f-51d3-4e1c-8878-ca41e043170e.dwg @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/ad67c510-e658-474b-8d6f-5f6c4b7b7c4d.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/ad67c510-e658-474b-8d6f-5f6c4b7b7c4d.dwg new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/FrontendWebApi/wwwroot/upload/graph_manage/ad67c510-e658-474b-8d6f-5f6c4b7b7c4d.dwg @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/af620d4c-9f63-441b-bf06-4de11907dd4a.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/af620d4c-9f63-441b-bf06-4de11907dd4a.dwg new file mode 100644 index 0000000..2a352a6 Binary files /dev/null and b/FrontendWebApi/wwwroot/upload/graph_manage/af620d4c-9f63-441b-bf06-4de11907dd4a.dwg differ diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/bddbf316-2e56-43f5-8e97-e701595ed1a2.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/bddbf316-2e56-43f5-8e97-e701595ed1a2.dwg new file mode 100644 index 0000000..2a352a6 Binary files /dev/null and b/FrontendWebApi/wwwroot/upload/graph_manage/bddbf316-2e56-43f5-8e97-e701595ed1a2.dwg differ diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/d2f203c5-e150-4554-9a83-c48bd38cba34.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/d2f203c5-e150-4554-9a83-c48bd38cba34.dwg new file mode 100644 index 0000000..2a352a6 Binary files /dev/null and b/FrontendWebApi/wwwroot/upload/graph_manage/d2f203c5-e150-4554-9a83-c48bd38cba34.dwg differ diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/d64e5fdd-2f92-4ebe-a822-936ffb662a34.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/d64e5fdd-2f92-4ebe-a822-936ffb662a34.dwg new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/FrontendWebApi/wwwroot/upload/graph_manage/d64e5fdd-2f92-4ebe-a822-936ffb662a34.dwg @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/FrontendWebApi/wwwroot/upload/graph_manage/f4165ac6-75bf-472f-9200-75c02e770cc0.dwg b/FrontendWebApi/wwwroot/upload/graph_manage/f4165ac6-75bf-472f-9200-75c02e770cc0.dwg new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/FrontendWebApi/wwwroot/upload/graph_manage/f4165ac6-75bf-472f-9200-75c02e770cc0.dwg @@ -0,0 +1 @@ +false \ No newline at end of file