[Frontend][圖資管理] 圖資 CURD 程序建置 | 列表下載DWG檔程序建置 | dropzone 上傳文件程序調整
This commit is contained in:
parent
d43e0e9c5f
commit
d9d1a4d736
@ -14,8 +14,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-10">
|
<div class="col-10">
|
||||||
<div class="my-2">
|
<div class="my-2">
|
||||||
<a href="javascript:;" id="upload" class="btn btn-success" data-toggle="modal" data-target="#graModal">
|
<a href="javascript:;" id="creGraMan" class="btn btn-success">
|
||||||
+上傳
|
+新增
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -117,14 +117,17 @@
|
|||||||
data-keyboard="false">
|
data-keyboard="false">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title">
|
||||||
|
確認刪除
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body py-1">
|
||||||
|
<label>確認要刪除此筆圖資資料?</label>
|
||||||
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<h4 class="mr-auto">確定刪除?</h4>
|
<button type="button" class="btn btn-primary" id="delGraManBtn">確定</button>
|
||||||
<button type="button" class="btn btn-primary" id="confirmDelBtn" aria-label="OK" e-prevent>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||||
確定
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="No">
|
|
||||||
取消
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -135,6 +138,7 @@
|
|||||||
var curLayerId = null;
|
var curLayerId = null;
|
||||||
var uploader = {};
|
var uploader = {};
|
||||||
var uploadFiles = {};
|
var uploadFiles = {};
|
||||||
|
var curActGraid = 0;
|
||||||
$(function () {
|
$(function () {
|
||||||
initList();
|
initList();
|
||||||
initDropzone();
|
initDropzone();
|
||||||
@ -157,7 +161,7 @@
|
|||||||
{ "targets": [1], "width": "25%", "sortable": true },
|
{ "targets": [1], "width": "25%", "sortable": true },
|
||||||
{ "targets": [2], "width": "25%", "sortable": true },
|
{ "targets": [2], "width": "25%", "sortable": true },
|
||||||
{ "targets": [3], "width": "25%", "sortable": true },
|
{ "targets": [3], "width": "25%", "sortable": true },
|
||||||
{ "targets": [4], "width": "15%", "sortable": true },
|
{ "targets": [4], "width": "15%", "sortable": false },
|
||||||
];
|
];
|
||||||
|
|
||||||
let columns = [
|
let columns = [
|
||||||
@ -174,7 +178,7 @@
|
|||||||
"title": "原設計",
|
"title": "原設計",
|
||||||
"data": "oriOrgName",
|
"data": "oriOrgName",
|
||||||
"render": function (data, type, row, meta) {
|
"render": function (data, type, row, meta) {
|
||||||
return `<a href="javascript:;">${row.oriOrgName ?? ""}</a>`;
|
return `<a id="oriDwgDown${row.id}" href="javascript:;">${row.oriOrgName ?? ""}</a>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -182,7 +186,7 @@
|
|||||||
"title": "竣工圖",
|
"title": "竣工圖",
|
||||||
"data": "donOrgName",
|
"data": "donOrgName",
|
||||||
"render": function (data, type, row, meta) {
|
"render": function (data, type, row, meta) {
|
||||||
return `<a href="javascript:;">${row.donOrgName ?? ""}</a>`;
|
return `<a id="donDwgDown${row.id}" href="javascript:;">${row.donOrgName ?? ""}</a>`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -192,7 +196,7 @@
|
|||||||
"render": function (data, type, row, meta) {
|
"render": function (data, type, row, meta) {
|
||||||
let btnDiv = creDiv(["row", "m-0", "justify-content-center"], { "style": "gap:10px" });
|
let btnDiv = creDiv(["row", "m-0", "justify-content-center"], { "style": "gap:10px" });
|
||||||
btnDiv.append(creBtnHtml("修改", "graEdiBtn" + data, null, ["btn", "btn-info"]));
|
btnDiv.append(creBtnHtml("修改", "graEdiBtn" + data, null, ["btn", "btn-info"]));
|
||||||
btnDiv.append(creBtnHtml("刪除", "graDelBtn" + data, null, ["btn", "btn-danger"], { "toggle": "modal", "target": "#delModal" }));
|
btnDiv.append(creBtnHtml("刪除", "graDelBtn" + data, null, ["btn", "btn-danger"]));
|
||||||
return btnDiv.outerHtml();
|
return btnDiv.outerHtml();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -210,15 +214,32 @@
|
|||||||
dictInvalidFileType: `上傳格式錯誤`,
|
dictInvalidFileType: `上傳格式錯誤`,
|
||||||
dictCancelUploadConfirmation: `確定要取消上傳此檔案嗎?`,
|
dictCancelUploadConfirmation: `確定要取消上傳此檔案嗎?`,
|
||||||
dictCancelUpload: `<span class="material-icons mi-cancel">cancel</span>`,
|
dictCancelUpload: `<span class="material-icons mi-cancel">cancel</span>`,
|
||||||
maxFilesize: 3,
|
dictMaxFilesExceeded: "已超過上傳限制數量",
|
||||||
|
maxFilesize: 10,
|
||||||
filesizeBase: 1024,
|
filesizeBase: 1024,
|
||||||
maxFiles: 1,
|
maxFiles: 1,
|
||||||
autoProcessQueue: false,
|
autoProcessQueue: false,
|
||||||
acceptedFiles: ".dwg",
|
acceptedFiles: ".dwg",
|
||||||
init: function () {
|
init: function () {
|
||||||
this.on("addedfile", function (file) {
|
this.on("addedfile", function (file) {
|
||||||
$("#graMyDesignDiagram").find('.dz-progress').addClass('d-none');
|
$(this.previewsContainer).find('.dz-progress').addClass('d-none');
|
||||||
|
if (file.savename) {
|
||||||
|
file.accepted = true;
|
||||||
|
this.files.push(file);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
this.on("complete", function (file) {
|
||||||
|
if (file.savename) {
|
||||||
|
$(file.previewElement).find('.dz-image img').remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.on("thumbnail", function (file) {
|
||||||
|
// 若為讀取檔案時
|
||||||
|
if (file.savename) {
|
||||||
|
$(file.previewElement).removeClass("dz-image-preview").addClass("dz-file-preview");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -232,45 +253,51 @@
|
|||||||
uploader["graMyAsBuilt"][0].dropzone.on("addedfile", file => {
|
uploader["graMyAsBuilt"][0].dropzone.on("addedfile", file => {
|
||||||
uploadFiles["graMyAsBuilt"] = file;
|
uploadFiles["graMyAsBuilt"] = file;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
uploader["graMyDesignDiagram"][0].dropzone.on("removedfile", file => {
|
||||||
|
uploadFiles["graMyDesignDiagram"] = {};
|
||||||
|
file.previewElement.remove();
|
||||||
|
})
|
||||||
|
|
||||||
|
uploader["graMyAsBuilt"][0].dropzone.on("removedfile", file => {
|
||||||
|
uploadFiles["graMyAsBuilt"] = {};
|
||||||
|
file.previewElement.remove();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增資料
|
// 新增資料
|
||||||
onEvent('click', '#graSendBtn', function () {
|
onEvent('click', '#graSendBtn', function () {
|
||||||
let cookies = new YourTeam.Utility.Cookie();
|
saveGraMan();
|
||||||
|
|
||||||
let url = baseApiUrl + "/GraphManage/SaveGraMan";
|
|
||||||
let fd = new FormData();
|
|
||||||
fd.append("code", $("#graPicNum").val());
|
|
||||||
fd.append("layer_id", curLayerId);
|
|
||||||
fd.append("name", $("#graPicName").val());
|
|
||||||
fd.append("oriOrgName", uploadFiles["graMyDesignDiagram"]?.name ?? null);
|
|
||||||
fd.append("donOrgName", null);
|
|
||||||
fd.append("oriFile", uploadFiles["graMyDesignDiagram"] ?? null);
|
|
||||||
fd.append("donFile", uploadFiles["graMyAsBuilt"] ?? null);
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url: url,
|
|
||||||
type: "POST",
|
|
||||||
data: fd,
|
|
||||||
async: false,
|
|
||||||
cache: false,
|
|
||||||
contentType: false,
|
|
||||||
processData: false,
|
|
||||||
beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', "Bearer " + cookies.get("JWT-Authorization")) },
|
|
||||||
success: function (res) {
|
|
||||||
if (!res || res.code != "0000" || !res.data) {
|
|
||||||
} else {
|
|
||||||
// console.log("ERROR: ", res.data, res.code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onEvent("click", "button[id^=graEdiBtn]", function () {
|
onEvent("click", "button[id^=graEdiBtn]", function () {
|
||||||
let id = $(this).prop("id").split("graEdiBtn")[1];
|
let id = $(this).prop("id").split("graEdiBtn")[1];
|
||||||
|
curActGraid = parseInt(id);
|
||||||
readGraph(id);
|
readGraph(id);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onEvent("click", "button[id^=graDelBtn]", function () {
|
||||||
|
let id = $(this).prop("id").split("graDelBtn")[1];
|
||||||
|
curActGraid = parseInt(id);
|
||||||
|
$("#delModal").modal("show");
|
||||||
|
})
|
||||||
|
|
||||||
|
onEvent("click", "a[id^=oriDwgDown]", function () {
|
||||||
|
let cookies = new YourTeam.Utility.Cookie();
|
||||||
|
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(cookies.get("JWT-Authorization"), apiUrl, rowData.name + "_原設計圖" + "." + extname);
|
||||||
|
})
|
||||||
|
|
||||||
|
onEvent("click", "a[id^=donDwgDown]", function () {
|
||||||
|
let cookies = new YourTeam.Utility.Cookie();
|
||||||
|
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(cookies.get("JWT-Authorization"), apiUrl, rowData.name + "_竣工圖" + "." + extname);
|
||||||
|
})
|
||||||
|
|
||||||
// 上傳檔案
|
// 上傳檔案
|
||||||
var oriImg;
|
var oriImg;
|
||||||
$("#upMyDesignDiagram").on("change", function (e) {
|
$("#upMyDesignDiagram").on("change", function (e) {
|
||||||
@ -301,26 +328,27 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 刪除資料
|
// 刪除資料
|
||||||
onEvent('click', '#del', function () {
|
onEvent("click", "#delGraManBtn", function () {
|
||||||
pageAct.opeRecId = null;
|
delGraMan();
|
||||||
pageAct.opeFirmId = $(this).parent().data('id');
|
})
|
||||||
|
|
||||||
|
onEvent('click', '#creGraMan', function () {
|
||||||
|
curActGraid = 0;
|
||||||
|
$("#graModal").modal("show");
|
||||||
});
|
});
|
||||||
|
|
||||||
onEvent('click', '#del', function () {
|
onEvent('show.bs.modal', "#graModal", function (e) {
|
||||||
objSendData.Data = { id: pageAct.opeFirmId ?? pageAct.opeRecId };
|
let type = $(e.relatedTarget).data("type");
|
||||||
let url = baseApiUrl + "/operation/" + (pageAct.work_type == null ? "DelOpeFirm" : "DelOpeRecord");
|
$(this).data("type", type);
|
||||||
|
$("#graPicNum").val("");
|
||||||
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
|
$("#graPicName").val("");
|
||||||
if (!res || res.code != "0000" || !res.data) {
|
uploadFiles["graMyDesignDiagram"] = {};
|
||||||
|
uploadFiles["graMyAsBuilt"] = {};
|
||||||
} else {
|
uploader["graMyDesignDiagram"][0].dropzone.removeAllFiles(true);
|
||||||
//toast_ok(common.AddSuc);
|
$("#graMyDesignDiagram .dz-preview").remove();
|
||||||
//$("#delModal").modal("hide");
|
uploader["graMyAsBuilt"][0].dropzone.removeAllFiles(true);
|
||||||
$("#confirmDelCanBtn").click();
|
$("#graMyAsBuilt .dz-preview").remove();
|
||||||
// refTable();
|
})
|
||||||
}
|
|
||||||
}, null, "DELETE").send();
|
|
||||||
});
|
|
||||||
|
|
||||||
function getGraCatList(callback) {
|
function getGraCatList(callback) {
|
||||||
let url = baseApiUrl + "/GraphManage/VarList";
|
let url = baseApiUrl + "/GraphManage/VarList";
|
||||||
@ -482,11 +510,22 @@
|
|||||||
if (!res || res.code != "0000" || !res.data) {
|
if (!res || res.code != "0000" || !res.data) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$("#graPicNum").text(res.data?.code);
|
|
||||||
$("#graPicName").text(res.data?.name);
|
|
||||||
$("#graLayer").text(levelNameByNodeId(res.data?.layer_id));
|
|
||||||
|
|
||||||
$("#graModal").modal("show");
|
$("#graModal").modal("show");
|
||||||
|
|
||||||
|
let fileObj = {};
|
||||||
|
$("#graPicNum").val(res.data?.code);
|
||||||
|
$("#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 };
|
||||||
|
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 };
|
||||||
|
uploader["graMyAsBuilt"][0].dropzone?.displayExistingFile(fileObj);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}, null, "POST").send();
|
}, null, "POST").send();
|
||||||
}
|
}
|
||||||
@ -506,4 +545,63 @@
|
|||||||
return names.join("/");
|
return names.join("/");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function saveGraMan() {
|
||||||
|
let cookies = new YourTeam.Utility.Cookie();
|
||||||
|
let url = "";
|
||||||
|
let graMyDesDiaFile = uploader["graMyDesignDiagram"][0].dropzone.files.filter(x => x.accepted == true)[0];
|
||||||
|
let graMyAsBuiFile = uploader["graMyAsBuilt"][0].dropzone.files.filter(x => x.accepted == true)[0];
|
||||||
|
let fd = new FormData();
|
||||||
|
fd.append("code", $("#graPicNum").val());
|
||||||
|
fd.append("layer_id", curLayerId);
|
||||||
|
fd.append("name", $("#graPicName").val());
|
||||||
|
fd.append("oriOrgName", graMyDesDiaFile?.name ?? null);
|
||||||
|
fd.append("donOrgName", graMyAsBuiFile?.name ?? null);
|
||||||
|
fd.append("oriSavName", graMyDesDiaFile?.savename ?? null);
|
||||||
|
fd.append("donSavName", graMyAsBuiFile?.savename ?? null);
|
||||||
|
fd.append("oriFile", graMyDesDiaFile?.savename ? null : graMyDesDiaFile ?? null);
|
||||||
|
fd.append("donFile", graMyAsBuiFile?.savename ? null : graMyAsBuiFile ?? null);
|
||||||
|
|
||||||
|
if (curActGraid == 0) {
|
||||||
|
url = baseApiUrl + "/GraphManage/SaveGraMan";
|
||||||
|
} else {
|
||||||
|
fd.append("id", curActGraid);
|
||||||
|
url = baseApiUrl + "/GraphManage/EdtOneGraMan";
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: "POST",
|
||||||
|
data: fd,
|
||||||
|
async: false,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', "Bearer " + cookies.get("JWT-Authorization")) },
|
||||||
|
success: function (res) {
|
||||||
|
if (!res || res.code != "0000" || !res.data) {
|
||||||
|
} else {
|
||||||
|
$("#graModal").modal("hide");
|
||||||
|
toast_ok(curActGraid == 0 ? common.AddSuc : common.EditSuc);
|
||||||
|
graTable.ajax.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function delGraMan() {
|
||||||
|
if (curActGraid != 0) {
|
||||||
|
let url = baseApiUrl + "/GraphManage/DelOneGraMan";
|
||||||
|
objSendData.Data = { id: curActGraid };
|
||||||
|
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
|
||||||
|
if (!res || res.code != "0000" || !res.data) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$("#delModal").modal("hide");
|
||||||
|
toast_ok(common.DelSuc);
|
||||||
|
graTable.ajax.reload();
|
||||||
|
}
|
||||||
|
}, null, "POST").send();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
@ -37,7 +37,6 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
|||||||
<link href="lib/chart.js/Chart.min.css" rel="stylesheet" />
|
<link href="lib/chart.js/Chart.min.css" rel="stylesheet" />
|
||||||
<link href="lib/jstree-master/themes/default/style.min.css" rel="stylesheet" />
|
<link href="lib/jstree-master/themes/default/style.min.css" rel="stylesheet" />
|
||||||
<link href="lib/jstree-master/themes/default-dark/style.min.css" rel="stylesheet" />
|
<link href="lib/jstree-master/themes/default-dark/style.min.css" rel="stylesheet" />
|
||||||
<link href="lib/jstree-master/themes/proton/style.min.css" rel="stylesheet" />
|
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
<link rel="stylesheet" media="screen, print" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap.min.css">
|
<link rel="stylesheet" media="screen, print" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap.min.css">
|
||||||
<link rel="stylesheet" media="screen, print" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap4.min.css">
|
<link rel="stylesheet" media="screen, print" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap4.min.css">
|
||||||
|
@ -5,6 +5,7 @@ var varRegApiUrl = "/reg/api/"; //註冊API路徑
|
|||||||
var varApiUrl = "/api/"; //API路徑
|
var varApiUrl = "/api/"; //API路徑
|
||||||
var varPathImg = "/Upload/Images/";
|
var varPathImg = "/Upload/Images/";
|
||||||
var varPathFile = "/Upload/Files/";
|
var varPathFile = "/Upload/Files/";
|
||||||
|
var varGraPath = "/upload/graph_manage";
|
||||||
var statusArr = { 1: "啟用", 0: "未啟用", 9: "刪除" };
|
var statusArr = { 1: "啟用", 0: "未啟用", 9: "刪除" };
|
||||||
var common = {
|
var common = {
|
||||||
AddSuc: "新增成功",
|
AddSuc: "新增成功",
|
||||||
|
@ -1349,10 +1349,15 @@ function toBool(boolstr) {
|
|||||||
* @param {any} url
|
* @param {any} url
|
||||||
* @param {any} filename
|
* @param {any} filename
|
||||||
*/
|
*/
|
||||||
async function download(url, filename) {
|
async function download(token,url, filename) {
|
||||||
|
|
||||||
let toDataURL = function (url) {
|
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) {
|
if (!response.ok) {
|
||||||
throw new Error("Not 2xx response", { cause: response });
|
throw new Error("Not 2xx response", { cause: response });
|
||||||
} else {
|
} else {
|
||||||
|
@ -288,7 +288,22 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
|
|
||||||
try
|
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 sWhere = $@"deleted = 0 and id != @id and code = @code and layer_id = @layer_id";
|
||||||
var gm = await backendRepository.GetOneAsync<GraphInsInfo>("graph_manage", sWhere, new { @id = gii.id, @code = gii.code, @layer_id = gii.layer_id});
|
var gm = await backendRepository.GetOneAsync<GraphInsInfo>("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();
|
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 folderFunction = new FolderFunction();
|
||||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.oriSavName));
|
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.oriSavName));
|
||||||
}
|
}
|
||||||
|
|
||||||
string fileName = null;
|
string fileName = gii.oriSavName ?? null;
|
||||||
if (gii.oriOrgName != null && gii.oriFile != null)
|
if (gii.oriOrgName != null && gii.oriFile != null)
|
||||||
{
|
{
|
||||||
fileName = new_guid + "." + gii.oriOrgName.Split('.')[1];
|
fileName = new_guid + "." + gii.oriOrgName.Split('.')[1];
|
||||||
@ -332,15 +347,16 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
{
|
{
|
||||||
gii.oriFile.CopyTo(stream);
|
gii.oriFile.CopyTo(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
graph_manage.Add("@oriOrgName", gii.oriOrgName);
|
graph_manage.Add("@oriOrgName", gii.oriOrgName);
|
||||||
graph_manage.Add("@oriSavName", fileName);
|
graph_manage.Add("@oriSavName", fileName);
|
||||||
|
|
||||||
fileName = null;
|
fileName = gii.donSavName ?? null;
|
||||||
//竣工圖修改
|
//竣工圖修改
|
||||||
new_guid = Guid.NewGuid();
|
new_guid = Guid.NewGuid();
|
||||||
//刪除原本檔案
|
//刪除原本檔案
|
||||||
if (gm.donSavName != null && gii.donOrgName == null)
|
if (gm.donSavName != null && gii.donSavName != gm.donSavName)
|
||||||
{
|
{
|
||||||
var folderFunction = new FolderFunction();
|
var folderFunction = new FolderFunction();
|
||||||
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.donSavName));
|
folderFunction.DeleteFile(Path.Combine(graphManageFileSaveAsPath, gm.donSavName));
|
||||||
|
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
false
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
false
|
@ -0,0 +1 @@
|
|||||||
|
false
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
false
|
@ -0,0 +1 @@
|
|||||||
|
false
|
Loading…
Reference in New Issue
Block a user