样式修改

This commit is contained in:
lSun 2025-04-27 18:00:11 +08:00
parent 5c9b283235
commit 69af96be15
1 changed files with 61 additions and 57 deletions

View File

@ -14,7 +14,7 @@ let buildAfterImgList = []; // 恢复后照片
let CODE_1 = 0, CODE_2 = 0, CODE_3 = 0; let CODE_1 = 0, CODE_2 = 0, CODE_3 = 0;
let files1,files2,files3; let files1, files2, files3;
let proId, proName, majorId, majorName, gxId, gxName; let proId, proName, majorId, majorName, gxId, gxName;
layui.use(['laydate', 'upload'], function () { layui.use(['laydate', 'upload'], function () {
@ -195,17 +195,17 @@ layui.use(['laydate', 'upload'], function () {
}); });
window.removeImage1 = function (uniqueId,index) { window.removeImage1 = function (uniqueId, index) {
delete files1[index];//删除指定图片 delete files1[index];//删除指定图片
$('#img-' + uniqueId).remove(); $('#img-' + uniqueId).remove();
}; };
window.removeImage2 = function (uniqueId,index) { window.removeImage2 = function (uniqueId, index) {
delete files2[index];//删除指定图片 delete files2[index];//删除指定图片
$('#img-' + uniqueId).remove(); $('#img-' + uniqueId).remove();
}; };
window.removeImage3 = function (uniqueId,index) { window.removeImage3 = function (uniqueId, index) {
delete files3[index];//删除指定图片 delete files3[index];//删除指定图片
$('#img-' + uniqueId).remove(); $('#img-' + uniqueId).remove();
}; };
@ -242,7 +242,7 @@ function setParams(params) {
if (selectedId === '' || selectedId == '') { if (selectedId === '' || selectedId == '') {
majorId = ''; majorId = '';
majorName = ''; majorName = '';
}else { } else {
majorId = selectedId; majorId = selectedId;
majorName = selectedName; majorName = selectedName;
} }
@ -258,7 +258,7 @@ function setParams(params) {
if (selectedId === '' || selectedId == '') { if (selectedId === '' || selectedId == '') {
gxId = ''; gxId = '';
gxName = ''; gxName = '';
}else{ } else {
gxId = selectedId; gxId = selectedId;
gxName = selectedName; gxName = selectedName;
} }
@ -379,7 +379,7 @@ function setFormData(data) {
var sysFileResourceList = data.sysFileResourceList; var sysFileResourceList = data.sysFileResourceList;
if (sysFileResourceList && sysFileResourceList.length > 0) { if (sysFileResourceList && sysFileResourceList.length > 0) {
sysFileResourceList.forEach(function(photo) { sysFileResourceList.forEach(function (photo) {
if (photo.sourceType === "6") { if (photo.sourceType === "6") {
buildBeforeImgList.push(photo); // 建设前 buildBeforeImgList.push(photo); // 建设前
} else if (photo.sourceType === "7") { } else if (photo.sourceType === "7") {
@ -395,7 +395,7 @@ function setFormData(data) {
for (var i = 0; i < buildBeforeImgList.length; i++) { for (var i = 0; i < buildBeforeImgList.length; i++) {
let filePath = imgUrl + buildBeforeImgList[i].originalFilePath + "?token=" + tokens let filePath = imgUrl + buildBeforeImgList[i].originalFilePath + "?token=" + tokens
html = html + '<div id="imga-' + buildBeforeImgList[i].id + '" style="display: inline-block; position: relative; margin: 5px 5px">' + html = html + '<div id="imga-' + buildBeforeImgList[i].id + '" style="display: inline-block; position: relative; margin: 5px 5px">' +
'<img src="' + filePath + '" alt="' + buildBeforeImgList[i].fileName + '" style="width: 90px; height: 90px;">' ; '<img src="' + filePath + '" alt="' + buildBeforeImgList[i].fileName + '" style="width: 90px; height: 90px;">';
if (details != 1) { if (details != 1) {
html = html + '<button class="layui-btn layui-btn-xs layui-btn-danger" style="position: absolute; top: 0; right: 0;" onclick="removeImageUpdate1(\'' + buildBeforeImgList[i].id + '\')">删除</button>'; html = html + '<button class="layui-btn layui-btn-xs layui-btn-danger" style="position: absolute; top: 0; right: 0;" onclick="removeImageUpdate1(\'' + buildBeforeImgList[i].id + '\')">删除</button>';
} }
@ -410,7 +410,7 @@ function setFormData(data) {
for (var i = 0; i < buildUnderImgList.length; i++) { for (var i = 0; i < buildUnderImgList.length; i++) {
let filePath = imgUrl + buildUnderImgList[i].originalFilePath + "?token=" + tokens let filePath = imgUrl + buildUnderImgList[i].originalFilePath + "?token=" + tokens
html = html + '<div id="imgb-' + buildUnderImgList[i].id + '" style="display: inline-block; position: relative; margin: 5px 5px">' + html = html + '<div id="imgb-' + buildUnderImgList[i].id + '" style="display: inline-block; position: relative; margin: 5px 5px">' +
'<img src="' + filePath + '" alt="' + buildUnderImgList[i].fileName + '" style="width: 90px; height: 90px;">' ; '<img src="' + filePath + '" alt="' + buildUnderImgList[i].fileName + '" style="width: 90px; height: 90px;">';
if (details != 1) { if (details != 1) {
html = html + '<button class="layui-btn layui-btn-xs layui-btn-danger" style="position: absolute; top: 0; right: 0;" onclick="removeImageUpdate2(\'' + buildUnderImgList[i].id + '\')">删除</button>'; html = html + '<button class="layui-btn layui-btn-xs layui-btn-danger" style="position: absolute; top: 0; right: 0;" onclick="removeImageUpdate2(\'' + buildUnderImgList[i].id + '\')">删除</button>';
} }
@ -425,7 +425,7 @@ function setFormData(data) {
for (var i = 0; i < buildAfterImgList.length; i++) { for (var i = 0; i < buildAfterImgList.length; i++) {
let filePath = imgUrl + buildAfterImgList[i].originalFilePath + "?token=" + tokens let filePath = imgUrl + buildAfterImgList[i].originalFilePath + "?token=" + tokens
html = html + '<div id="imgc-' + buildAfterImgList[i].id + '" style="display: inline-block; position: relative; margin: 5px 5px">' + html = html + '<div id="imgc-' + buildAfterImgList[i].id + '" style="display: inline-block; position: relative; margin: 5px 5px">' +
'<img src="' + filePath + '" alt="' + buildAfterImgList[i].fileName + '" style="width: 90px; height: 90px;">' ; '<img src="' + filePath + '" alt="' + buildAfterImgList[i].fileName + '" style="width: 90px; height: 90px;">';
if (details != 1) { if (details != 1) {
html = html + '<button class="layui-btn layui-btn-xs layui-btn-danger" style="position: absolute; top: 0; right: 0;" onclick="removeImageUpdate3(\'' + buildAfterImgList[i].id + '\')">删除</button>'; html = html + '<button class="layui-btn layui-btn-xs layui-btn-danger" style="position: absolute; top: 0; right: 0;" onclick="removeImageUpdate3(\'' + buildAfterImgList[i].id + '\')">删除</button>';
} }
@ -435,7 +435,7 @@ function setFormData(data) {
} }
} }
if(details == 1){ if (details == 1) {
document.querySelector('.layui-btn.save').style.display = 'none'; document.querySelector('.layui-btn.save').style.display = 'none';
document.getElementById("test1").style.display = 'none'; document.getElementById("test1").style.display = 'none';
document.getElementById("test2").style.display = 'none'; document.getElementById("test2").style.display = 'none';
@ -475,6 +475,8 @@ function saveData2() {
// 保存数据 // 保存数据
function saveData(data) { function saveData(data) {
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
setTimeout(() => {
if (CODE_1 != 0) { if (CODE_1 != 0) {
$("#hideUpload1").trigger("click"); $("#hideUpload1").trigger("click");
} }
@ -485,12 +487,11 @@ function saveData(data) {
$("#hideUpload3").trigger("click"); $("#hideUpload3").trigger("click");
} }
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
let url = dataUrl + "/coordinatePhoto/addCoordinatePhoto"; let url = dataUrl + "/coordinatePhoto/addCoordinatePhoto";
data.field.uploadType = "4"; data.field.uploadType = "4";
data.field.dataSource = 1; data.field.dataSource = 1;
data.field.sysFileResourceList = [...buildBeforeImgList, ...buildUnderImgList,...buildAfterImgList]; data.field.sysFileResourceList = [...buildBeforeImgList, ...buildUnderImgList, ...buildAfterImgList];
data.field.proId = proId; data.field.proId = proId;
data.field.proName = proName; data.field.proName = proName;
@ -526,6 +527,9 @@ function saveData(data) {
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
error(xhr) error(xhr)
}); });
}, 100)
} }
// 关闭页面 // 关闭页面