[Frontend][圖資管理] 增加 size 欄位程序調整 | 下載程序調整
This commit is contained in:
parent
e4a3cc9597
commit
4ba52a8a18
@ -285,20 +285,22 @@
|
||||
})
|
||||
|
||||
onEvent("click", "a[id^=oriDwgDown]", function () {
|
||||
let dowLoaEle = YT.Alert.Tip("準備下載中...", "show", true);
|
||||
let rowData = graTable.row($(this).closest("tr")).data();
|
||||
let apiUrl = baseApiUrl + `/File/Download?type=graph&savename=${rowData.oriSavName}&oriname=${rowData.oriOrgName}`;
|
||||
let extname = rowData.oriOrgName?.split(".").slice(-1) || "dwg";
|
||||
download(token, apiUrl, rowData.name + "_原設計圖" + "." + extname, function () {
|
||||
|
||||
$(dowLoaEle.ele).YTAlert().hide();
|
||||
});
|
||||
})
|
||||
|
||||
onEvent("click", "a[id^=donDwgDown]", function () {
|
||||
let dowLoaEle = YT.Alert.Tip("準備下載中...", "show", true);
|
||||
let rowData = graTable.row($(this).closest("tr")).data();
|
||||
let apiUrl = baseApiUrl + `/File/Download?type=graph&savename=${rowData.donSavName}&oriname=${rowData.donOrgName}`;
|
||||
let extname = rowData.donOrgName?.split(".").slice(-1) || "dwg";
|
||||
download(token, apiUrl, rowData.name + "_竣工圖" + "." + extname, function () {
|
||||
|
||||
$(dowLoaEle.ele).YTAlert().hide();
|
||||
});
|
||||
})
|
||||
|
||||
@ -522,11 +524,11 @@
|
||||
$("#graPicName").val(res.data?.name);
|
||||
$("#graLayer").text(levelNameByNodeId(res.data?.layer_id));
|
||||
if (res.data?.oriSavName != null) {
|
||||
fileObj = { name: res.data?.oriOrgName, dataUrl: baseApiUrl + varGraPath + res.data?.oriSavName, savename: res.data?.oriSavName };
|
||||
fileObj = { name: res.data?.oriOrgName, dataUrl: baseApiUrl + varGraPath + res.data?.oriSavName, savename: res.data?.oriSavName, size:res.data?.oriSize };
|
||||
uploader["graMyDesignDiagram"][0].dropzone?.displayExistingFile(fileObj);
|
||||
}
|
||||
if (res.data?.donSavName != null) {
|
||||
fileObj = { name: res.data?.donOrgName, dataUrl: baseApiUrl + varGraPath + res.data?.donSavName, savename: res.data?.oriSavName };
|
||||
fileObj = { name: res.data?.donOrgName, dataUrl: baseApiUrl + varGraPath + res.data?.donSavName, savename: res.data?.donSavName, size: res.data?.donSize };
|
||||
uploader["graMyAsBuilt"][0].dropzone?.displayExistingFile(fileObj);
|
||||
}
|
||||
|
||||
|
@ -329,14 +329,17 @@ namespace FrontendWebApi.ApiControllers
|
||||
//edit file
|
||||
//原設計圖修改
|
||||
var new_guid = Guid.NewGuid();
|
||||
long? fileSize = gm.oriSize ?? null;
|
||||
//刪除原本檔案
|
||||
if (gm.oriSavName != null && gii.oriSavName != gm.oriSavName)
|
||||
{
|
||||
FolderFunction folderFunction = new FolderFunction();
|
||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.oriSavName));
|
||||
fileSize = null;
|
||||
}
|
||||
|
||||
string fileName = gii.oriSavName ?? null;
|
||||
|
||||
if (gii.oriOrgName != null && gii.oriFile != null)
|
||||
{
|
||||
fileName = new_guid + "." + gii.oriOrgName.Split('.')[1];
|
||||
@ -347,19 +350,24 @@ namespace FrontendWebApi.ApiControllers
|
||||
{
|
||||
gii.oriFile.CopyTo(stream);
|
||||
}
|
||||
fileSize = gii.oriFile.Length;
|
||||
|
||||
}
|
||||
|
||||
graph_manage.Add("@oriSize", fileSize);
|
||||
graph_manage.Add("@oriOrgName", gii.oriOrgName);
|
||||
graph_manage.Add("@oriSavName", fileName);
|
||||
|
||||
fileName = gii.donSavName ?? null;
|
||||
//竣工圖修改
|
||||
new_guid = Guid.NewGuid();
|
||||
fileSize = gm.donSize ?? null;
|
||||
//刪除原本檔案
|
||||
if (gm.donSavName != null && gii.donSavName != gm.donSavName)
|
||||
{
|
||||
var folderFunction = new FolderFunction();
|
||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.donSavName));
|
||||
fileSize = null;
|
||||
}
|
||||
|
||||
if (gii.donOrgName != null && gii.donFile != null)
|
||||
@ -372,8 +380,10 @@ namespace FrontendWebApi.ApiControllers
|
||||
{
|
||||
gii.donFile.CopyTo(stream);
|
||||
}
|
||||
|
||||
fileSize = gii.donFile.Length;
|
||||
}
|
||||
|
||||
graph_manage.Add("@donSize", fileSize);
|
||||
graph_manage.Add("@donOrgName", gii.donOrgName);
|
||||
graph_manage.Add("@donSavName", fileName);
|
||||
|
||||
@ -448,6 +458,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
gii.oriFile.CopyTo(stream);
|
||||
}
|
||||
|
||||
graph_manage.Add("@oriSize", gii.oriFile.Length);
|
||||
graph_manage.Add("@oriOrgName", gii.oriOrgName);
|
||||
graph_manage.Add("@oriSavName", fileName);
|
||||
}
|
||||
@ -465,6 +476,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
gii.donFile.CopyTo(stream);
|
||||
}
|
||||
|
||||
graph_manage.Add("@donSize", gii.donFile.Length);
|
||||
graph_manage.Add("@donOrgName", gii.donOrgName);
|
||||
graph_manage.Add("@donSavName", fileName);
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ namespace FrontendWebApi.Models
|
||||
public string oriSavName { get; set; }
|
||||
public string donOrgName { get; set; }
|
||||
public string donSavName { get; set; }
|
||||
public long? oriSize { get; set; }
|
||||
public long? donSize { get; set; }
|
||||
}
|
||||
|
||||
public class GraphInsInfo
|
||||
@ -35,6 +37,8 @@ namespace FrontendWebApi.Models
|
||||
public int priority { get; set; }
|
||||
public IFormFile oriFile { get; set; }
|
||||
public IFormFile donFile { get; set; }
|
||||
public long? oriSize{ get; set; }
|
||||
public long? donSize { get; set; }
|
||||
}
|
||||
|
||||
public class GraphInfo: Actor
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user