From 203bf452741958a6de3f54d2ff0fb27d6cec7be0 Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Thu, 10 Apr 2025 20:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E8=B0=83=E7=85=A7=E7=89=87=EF=BC=88?= =?UTF-8?q?=E5=BB=BA=E8=AE=BE=E7=94=A8=E5=9C=B0=EF=BC=89=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/coordinatePhotoForm.js | 504 ++++++++++++++++++ .../coordinatePhoto/coordinatePhotoList.js | 341 ++++++++++++ .../child/importantMatterForm.js | 7 +- .../child/qualityInspectionForm.js | 14 +- .../safetyMeasure/child/safetyMeasureForm.js | 7 +- .../child/safetyViolationsForm.js | 14 +- .../child/coordinatePhotoForm.html | 175 ++++++ .../coordinatePhoto/coordinatePhotoList.html | 81 +++ 8 files changed, 1125 insertions(+), 18 deletions(-) create mode 100644 src/main/resources/static/js/imageUpload/coordinatePhoto/child/coordinatePhotoForm.js create mode 100644 src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js create mode 100644 src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html create mode 100644 src/main/resources/static/pages/imageUpload/coordinatePhoto/coordinatePhotoList.html diff --git a/src/main/resources/static/js/imageUpload/coordinatePhoto/child/coordinatePhotoForm.js b/src/main/resources/static/js/imageUpload/coordinatePhoto/child/coordinatePhotoForm.js new file mode 100644 index 0000000..b93127f --- /dev/null +++ b/src/main/resources/static/js/imageUpload/coordinatePhoto/child/coordinatePhotoForm.js @@ -0,0 +1,504 @@ +let form, layer, util, idParam, laydate, details; +let arr = ['background', 'web', 'mobile', 'wx']; +let background, web, mobile, wx; +let data = []; + +// 初始化下拉选 +let proList; +let majorList; +let processList; + +let buildBeforeImgList = []; // 建设前照片 +let buildUnderImgList = []; // 建设中照片 +let buildAfterImgList = []; // 恢复后照片 + +let CODE_1 = 0, CODE_2 = 0, CODE_3 = 0; + +let proId, proName, majorId, majorName, gxId, gxName; +layui.use(['laydate', 'upload'], function () { + var upload = layui.upload; + var layer = layui.layer; + var element = layui.element; + var $ = layui.$; + + var buildBeforeImg = JSON.stringify({ + uploadType: 4, // 上传类型 + sourceType: 6, // 来源类型 + sourceTypeName: "协调照片-建设前" // 来源类型名称 + }) + + var buildUnderImg = JSON.stringify({ + uploadType: 4, // 上传类型 + sourceType: 7, // 来源类型 + sourceTypeName: "协调照片-建设中" // 来源类型名称 + }) + + var buildAfterImg = JSON.stringify({ + uploadType: 4, // 上传类型 + sourceType: 8, // 来源类型 + sourceTypeName: "协调照片-恢复后" // 来源类型名称 + }) + + // 多图片上传 + var uploadcom1 = upload.render({ + elem: '#test1', + url: '/imgTool/sys/file/uploadFile?token=' + tokens, + multiple: true, + auto: false, + exts: 'jpg|png|jpeg', + field: 'files', + data: {params: buildBeforeImg}, + bindAction: '#hideUpload1', //绑定的按钮 + // 文件选择后的回调 + choose: function (obj) { + CODE_1 = 1; + uploadcom1.config.elem.next()[0].value = ''; + let files = obj.pushFile(); + obj.preview(function (index, file, result) { + var length = $('#demo1 img').length; + if (length > 8) { + delete files[index];//删除指定图片 + $(this).remove(); + return layer.msg("附件为1-9张,请勿过多上传", {icon: 5}); + } + + const uniqueId = new Date().getTime() + '-' + index; + $('#demo1').append( + '
' + + '' + file.name + '' + + '' + + '
' + ); + }); + }, + before: function (obj) { + + }, + done: function (res, index, upload) { + if (res.code === 200) { + buildBeforeImgList.push(res.data[0]); + } else { + + } + }, + allDone: function (res, index, upload) { + + }, + error: function (e) { + //请求异常回调 + console.log(e) + } + }); + + // 多图片上传 + var uploadcom2 = upload.render({ + elem: '#test2', + url: '/imgTool/sys/file/uploadFile?token=' + tokens, + multiple: true, + auto: false, + exts: 'jpg|png|jpeg', + field: 'files', + data: {params: buildUnderImg}, + bindAction: '#hideUpload2', //绑定的按钮 + // 文件选择后的回调 + choose: function (obj) { + CODE_2 = 1; + uploadcom2.config.elem.next()[0].value = ''; + let files = obj.pushFile(); + obj.preview(function (index, file, result) { + var length = $('#demo2 img').length; + if (length > 8) { + delete files[index];//删除指定图片 + $(this).remove(); + return layer.msg("附件为1-9张,请勿过多上传", {icon: 5}); + } + const uniqueId = new Date().getTime() + '-' + index; + $('#demo2').append( + '
' + + '' + file.name + '' + + '' + + '
' + ); + }); + }, + before: function (obj) { + }, + done: function (res, index, upload) { + if (res.code === 200) { + buildUnderImgList.push(res.data[0]); + } else { + + } + }, + allDone: function (res, index, upload) { + + }, + error: function (e) { + //请求异常回调 + console.log(e) + } + }); + + + // 多图片上传 + var uploadcom3 = upload.render({ + elem: '#test3', + url: '/imgTool/sys/file/uploadFile?token=' + tokens, + multiple: true, + auto: false, + exts: 'jpg|png|jpeg', + field: 'files', + data: {params: buildAfterImg}, + bindAction: '#hideUpload3', //绑定的按钮 + // 文件选择后的回调 + choose: function (obj) { + CODE_3 = 1; + uploadcom3.config.elem.next()[0].value = ''; + let files = obj.pushFile(); + obj.preview(function (index, file, result) { + var length = $('#demo3 img').length; + if (length > 8) { + delete files[index];//删除指定图片 + $(this).remove(); + return layer.msg("附件为1-9张,请勿过多上传", {icon: 5}); + } + const uniqueId = new Date().getTime() + '-' + index; + $('#demo3').append( + '
' + + '' + file.name + '' + + '' + + '
' + ); + }); + }, + before: function (obj) { + }, + done: function (res, index, upload) { + if (res.code === 200) { + buildAfterImgList.push(res.data[0]); + } else { + + } + }, + allDone: function (res, index, upload) { + + }, + error: function (e) { + //请求异常回调 + console.log(e) + } + }); + + + window.removeImage = function (uniqueId) { + $('#img-' + uniqueId).remove(); + }; + laydate = layui.laydate; +}); + + +function setParams(params) { + idParam = JSON.parse(params).id; + details = JSON.parse(params).details; + layui.use(['form', 'layer', 'util'], function () { + layer = layui.layer; + form = layui.form; + util = layui.util; + var $ = layui.jquery; + proList = getProSelected(); + majorList = getMajorSelected(); + processList = getProcessSelected(); + if (idParam) { + getUserById(); + } + + form.on('select(proId)', function (data) { + // 获取选中的 id 和 name + const selectedId = data.value; // 获取选中项的 value 值 + const selectedName = $(data.elem).find("option:selected").text(); // 获取选中项的文本 + proId = selectedId; + proName = selectedName; + }); + + form.on('select(majorId)', function (data) { + const selectedId = data.value; // 获取选中项的 value 值 + const selectedName = $(data.elem).find("option:selected").text(); // 获取选中项的文本 + majorId = selectedId; + majorName = selectedName; + + let gxs = getGxsSelect(data.value); + setSelectValueName(gxs, 'gxId', '请选择工序'); + }); + + form.on('select(gxId)', function (data) { + const selectedId = data.value; // 获取选中项的 value 值 + const selectedName = $(data.elem).find("option:selected").text(); // 获取选中项的文本 + gxId = selectedId; + gxName = selectedName; + }); + + form.render();//重新渲染页面checkbox控件 + form.on('submit(formData)', function (data) { + data.field.id = $('#id').val(); + saveData(data); + }); + }); +} + +/** + * 获取工程数据 + */ +function getProSelected() { + let url = dataUrl + '/sys/select/getProsSelect'; + let data = { + encryptedData: encryptCBC(JSON.stringify({})) + } + ajaxRequest(url, "POST", data, true, function () { + }, function (result) { + if (result.code === 200) { + setSelectValueName(result.data, 'proId', "请选择项目(可搜索)"); + } else { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); +} + +/** + * 获取专业数据 + */ +function getMajorSelected() { + let url = dataUrl + '/sys/select/getProfessionSelect'; + ajaxRequest(url, "GET", null, true, function () { + }, function (result) { + if (result.code === 200) { + setSelectValueName(result.data, 'majorId', "请选择专业"); + } else { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); +} + +/** + * 获取工序数据 + */ +function getProcessSelected() { + let url = dataUrl + '/sys/select/getProcessSelect'; + let data = { + encryptedData: encryptCBC(JSON.stringify({})) + } + ajaxRequest(url, "GET", data, true, function () { + }, function (result) { + if (result.code === 200) { + setSelectValueName(result.data, 'gxId', '请选择工序'); + } else { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); +} + + +// 根据id获取用户信息 +function getUserById() { + let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); + let url = dataUrl + "/coordinatePhoto/getCoordinatePhotoById"; + let params = { + id: idParam + } + console.log(params) + params = { + encryptedData: encryptCBC(JSON.stringify(params)) + } + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + layer.close(loadingMsg); // 关闭提示层 + if (result.code === 200) { + console.log(result) + setFormData(result.data); + } else if (result.code === 500) { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + error(xhr) + }); +} + +// 设置表单内容 +function setFormData(data) { + console.log("data:", data) + if (data) { + $('#id').val(data.id) + $('#proId option[value=' + data.proId + ']').attr('selected', true) + $('#majorId option[value=' + data.majorId + ']').attr('selected', true) + $('#gxId option[value=' + data.gxId + ']').attr('selected', true) + $('#buildPlace').val(data.buildPlace) + $('#buildBeforeDesc').val(data.buildBeforeDesc) + $('#buildUnderDesc').val(data.buildUnderDesc) + $('#buildAfterDesc').val(data.buildAfterDesc) + + var sysFileResourceList = data.sysFileResourceList; + if (sysFileResourceList && sysFileResourceList.length > 0) { + + sysFileResourceList.forEach(function(photo) { + if (photo.sourceType === "6") { + buildBeforeImgList.push(photo); // 建设前 + } else if (photo.sourceType === "7") { + buildUnderImgList.push(photo); // 建设中 + } else if (photo.sourceType === "8") { + buildAfterImgList.push(photo); // 恢复后 + } + }); + + if (buildBeforeImgList && buildBeforeImgList.length > 0) { + var html = ""; + var demo1 = $("#demo1"); + for (var i = 0; i < buildBeforeImgList.length; i++) { + let filePath = imgUrl + buildBeforeImgList[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' + buildBeforeImgList[i].fileName + '' ; + if (details != 1) { + html = html + ''; + } + html = html + '
'; + } + demo1.append(html); + } + + if (buildUnderImgList && buildUnderImgList.length > 0) { + var html = ""; + var demo2 = $("#demo2"); + for (var i = 0; i < buildUnderImgList.length; i++) { + let filePath = imgUrl + buildUnderImgList[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' + buildUnderImgList[i].fileName + '' ; + if (details != 1) { + html = html + ''; + } + html = html + '
'; + } + demo2.append(html); + } + + if (buildAfterImgList && buildAfterImgList.length > 0) { + var html = ""; + var demo3 = $("#demo3"); + for (var i = 0; i < buildAfterImgList.length; i++) { + let filePath = imgUrl + buildAfterImgList[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' + buildAfterImgList[i].fileName + '' ; + if (details != 1) { + html = html + ''; + } + html = html + '
'; + } + demo3.append(html); + } + + } + if(details == 1){ + document.querySelector('.layui-btn.save').style.display = 'none'; + document.getElementById("test1").style.display = 'none'; + document.getElementById("test2").style.display = 'none'; + document.getElementById("test3").style.display = 'none'; + } + layui.form.render(); + } +} + +function removeImageUpdate1(uniqueId) { + console.log("uniqueId:", uniqueId) + $('#imga-' + uniqueId).remove(); + uniqueId = parseInt(uniqueId, 10); // 转换为数字类型 + buildBeforeImgList = buildBeforeImgList.filter(item => item.id !== uniqueId); + console.log(buildBeforeImgList) +} + +function removeImageUpdate2(uniqueId) { + console.log("uniqueId:", uniqueId) + $('#imgb-' + uniqueId).remove(); + uniqueId = parseInt(uniqueId, 10); // 转换为数字类型 + buildUnderImgList = buildUnderImgList.filter(item => item.id !== uniqueId); + console.log(buildUnderImgList) +} + +function removeImageUpdate3(uniqueId) { + console.log("uniqueId:", uniqueId) + $('#imgc-' + uniqueId).remove(); + uniqueId = parseInt(uniqueId, 10); // 转换为数字类型 + buildAfterImgList = buildAfterImgList.filter(item => item.id !== uniqueId); + console.log(buildAfterImgList) +} + +function saveData2() { + $('#formSubmit').trigger('click') +} + +// 保存数据 +function saveData(data) { + if (CODE_1 != 0) { + $("#hideUpload1").trigger("click"); + } + if (CODE_2 != 0) { + $("#hideUpload2").trigger("click"); + } + if (CODE_3 != 0) { + $("#hideUpload3").trigger("click"); + } + + let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0}); + let url = dataUrl + "/coordinatePhoto/addCoordinatePhoto"; + data.field.uploadType = "4"; + data.field.dataSource = 1; + + data.field.sysFileResourceList = [...buildBeforeImgList, ...buildUnderImgList,...buildAfterImgList]; + + data.field.proId = proId; + data.field.proName = proName; + data.field.majorId = majorId; + data.field.majorName = majorName; + data.field.gxId = gxId; + data.field.gxName = gxName; + console.log("data:", data) + let params = data.field; + if (params.id != "") { + url = dataUrl + "/coordinatePhoto/updateCoordinatePhoto"; + } + console.log("params:", params) + params = { + encryptedData: encryptCBC(JSON.stringify(params)) + } + ajaxRequest(url, "POST", params, true, function () { + $('.save').addClass("layui-btn-disabled").attr("disabled", true); + $('.cancel').addClass("layui-btn-disabled").attr("disabled", true); + }, function (result) { + layer.close(loadingMsg); // 关闭提示层 + if (result.code === 200) { + closePage(1); + parent.layer.msg(result.msg, {icon: 1}); + } else { + layer.alert(result.msg, {icon: 2}) + $('.save').removeClass("layui-btn-disabled").attr("disabled", false); + $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); + } + }, function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + $('.save').removeClass("layui-btn-disabled").attr("disabled", false); + $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); + error(xhr) + }); +} + +// 关闭页面 +function closePage(type) { + let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 + parent.layer.close(index); //再执行关闭 + if (type === 1) { + parent.reloadData() + } +} \ No newline at end of file diff --git a/src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js b/src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js new file mode 100644 index 0000000..21da0e1 --- /dev/null +++ b/src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js @@ -0,0 +1,341 @@ +let form, layer, table, tableIns; +let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10 + +layui.use(['form', 'layer', 'table', 'laydate'], function () { + form = layui.form; + layer = layui.layer; + table = layui.table; + layui.form.render(); + getProSelected(); + getProTypeSelected(); + getProcessIdSelected(); + pages(1, 10, 1); + +}) +function pages(pageNum, pageSize, typeNum) { + let params = getReqParams(pageNum, pageSize, typeNum); + let url = dataUrl + "/coordinatePhoto/getCoordinatePhotoList" + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + console.log(result); + if (result.code === 200) { + if (result.data) { + initTable(result.data.list, result.data.pageSize, result.data.startRow) + laypages(result.data.total, result.data.startRow, result.data.pageSize) + } + } else if (result.code === 500) { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); + +} + +function laypages(total, page, limit) { + layui.use(['laypage'], function () { + let laypage = layui.laypage; + laypage.render({ + elem: 'voi-page', + count: total, + curr: page, + limit: limit, + limits: [10, 20, 50, 100, 200, 500], + layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'], + groups: 5, + jump: function (obj, first) { + if (!first) { + pageNum = obj.curr, limitSize = obj.limit; + pages(obj.curr, obj.limit, null); + } + } + }); + }) +} + +function countPhotosBySourceType(data, sourceType) { + if (!data || !data.sysFileResourceList) return 0; + return data.sysFileResourceList.filter(item => item.sourceType === sourceType).length; +} + +/*初始化表格*/ +function initTable(dataList, limit, page) { + let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); + tableIns = table.render({ + elem: "#table_data", + height: "full-130", + data: dataList, + limit: limit, + cols: [ + [ + //表头 + {title: "序号", width: 80, unresize: true, align: "center", + templet: function (d) { + return (page - 1) * limit + d.LAY_INDEX; + } + }, + {field: "proName", title: "项目名称",width: 310, unresize: true, align: "center" }, + {field: "gxName", title: "工序",width: 110, unresize: true, align: "center"}, + {field: "buildPlace", title: "违章地点",width: 230, unresize: true, align: "center"}, + {title: "建设阶段", width: 110, unresize: true, align: "center", + templet: function(d) { + return '建设前

建设中

恢复后'; + } + }, + {title: "建设照片", width: 110, unresize: true, align: "center", + templet: function (d) { + // 统计各阶段的照片数量 + let beforeCount = countPhotosBySourceType(d, "6"); + let inProgressCount = countPhotosBySourceType(d, "7"); + let afterCount = countPhotosBySourceType(d, "8"); + + let html = ''; + html += "" + beforeCount + "

"; + html += "" + inProgressCount + "

"; + html += "" + afterCount + ""; + return html; + } + }, + {title: "建设描述", width: 310, unresize: true, align: "center", + templet: function (d) { + return d.buildBeforeDesc + '

' + d.buildUnderDesc + '

' + d.buildAfterDesc; + } + }, + {field: "createUserName", title: "更新人",width: 110, unresize: true, align: "center"}, + {field: "createTime", title: "更新时间 ",width: 110, unresize: true, align: "center"}, + {title: "操作", unresize: true, width: 170, align: "center", + templet: function (d) { + let html = ''; + let updaetpwd=""; + let del="" + let edit=""; + html=updaetpwd + edit+del; + return html; + } + }, + ], + ], + done: function (res, curr, count) { + layer.close(loadingMsg); + table.resize("table_data"); + count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block"); + count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto"); + }, + }); +} + + +// 获取参数 +function getReqParams(page, limit, type) { + let obj = {}; + if (type === 2) { + $('#keyWord').val('') + $('#proId').val('') + $('#proTypeId').val('') + $('#processId').val('') + layui.form.render(); + } + obj = { + page: page + "", + limit: limit + "", + keyWord: $('#keyWord').val(), + proId: $('#proId').val(), + proType: $('#proTypeId').val(), + gxId: $('#processId').val() + + }; + console.log(obj) + obj={ + encryptedData:encryptCBC(JSON.stringify(obj)) + } + return obj; +} + +// 查询/重置 +function query(type) { + let pattern = new RegExp("[%_<>]"); + if (pattern.test($("#keyWord").val())) { + $("#keyWord").val(''); + return layer.msg('关键字查询包含特殊字符,请重新输入', { + icon: 2, + time: 2000 //2秒关闭(如果不配置,默认是3秒) + }); + } + pageNum = 1; + pages(1, limitSize,type); +} + +function reloadData() { + pages(pageNum, limitSize); +} + +//详情 +function detailsData(id) { + let title = '详情' + let param = { + 'id': id, + 'details':'1' + } + openIframe2("detailsSafetyViolations", title, "child/coordinatePhotoForm.html", '1200px', '625px', param); +} + + +// 新增/修改 +function addData(id) { + let title = '新增' + if (id) { + title = '修改'; + } + let param = { + 'id': id, + 'details':'' + } + openIframe2("addOrEditSafetyViolations", title, "child/coordinatePhotoForm.html", '1200px', '625px', param); +} + +/*删除用户*/ +function delData(id) { + layer.confirm("确定删除吗?", { + move: false + }, function () { + let loadingMsg = layer.msg('数据删除中,请稍候...', {icon: 16, scrollbar: false, time: 0}); + let url = dataUrl + "/imgUpload/safetyViolation/delSafetyViolationById"; + let params = { + 'id': id + } + params={ + encryptedData:encryptCBC(JSON.stringify(params)) + } + ajaxRequest(url, "DELETE", params, true, function () { + }, function (result) { + layer.close(loadingMsg); // 关闭提示层 + if (result.code === 200) { + parent.layer.msg(result.msg, {icon: 1}) + query() + } else if (result.code === 500) { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + error(xhr) + }); + }) +} + +/** + * 获取工程 + */ +function getProSelected() { + let url = dataUrl + '/sys/select/getProsSelect'; + let data={ + encryptedData:encryptCBC(JSON.stringify({})) + } + ajaxRequest(url, "POST", data, true, function () { + }, function (result) { + if (result.code === 200) { + setSelectValue(result.data, 'proId','请选择工程'); + } else { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); +} + +/** + * 获取工程类型 + */ +function getProTypeSelected() { + let url = dataUrl + '/sys/select/getDictSelectByType'; + + let data={ + encryptedData:encryptCBC(JSON.stringify({"code":"pro_type"})) + } + ajaxRequest(url, "GET", data, true, function () { + }, function (result) { + if (result.code === 200) { + setSelectValue(result.data, 'proTypeId','请选择工程类型'); + } else { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); +} + +/** + * 获取工序 + */ +function getProcessIdSelected() { + let url = dataUrl + '/sys/select/getProcessSelect'; + + let data={ + encryptedData:encryptCBC(JSON.stringify({})) + } + ajaxRequest(url, "GET", data, true, function () { + }, function (result) { + if (result.code === 200) { + setSelectValue(result.data, 'processId','请选择工序类型'); + } else { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); +} + +/*下拉选表单赋值*/ +function setSelectValue(list, selectName, placeholder) { + let html = ''; + $.each(list, function (index, item) { + html += ''; + }) + $('#' + selectName).empty().append(html); + layui.form.render(); +} + +/** + * 违规照片 + * @param id + */ +function violationPhoto(id){ + alert(id) +} + +/** + * 修正照片 + * @param id + */ +function correctionPhoto(id){ + alert(id) +} + +function exportExcel() { + let obj = { + keyWord: $('#keyWord').val(), + proId: $('#proId').val(), + proType: $('#proTypeId').val(), + gxId: $('#processId').val(), + }; + let loadingMsg = layer.msg("数据导出中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); + let url = dataUrl + "/imgUpload/safetyViolation/downloadExcel?token=" + tokens + "&encryptedData=" + encodeURIComponent(encryptCBC(JSON.stringify(obj))); + let xhr = new XMLHttpRequest(); + xhr.open("post", url, true); + xhr.responseType = "blob"; // 转换流 + xhr.setRequestHeader('Content-Type','application/json;charset=UTF-8') + xhr.onload = function () { + layer.close(loadingMsg); + if (this.status === 200) { + let blob = this.response; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = "安全违章列表" + ".xlsx"; // 文件名 + } else { + layer.msg("数据导出发生异常,请稍后重试", {icon: 16, scrollbar: false, time: 2000}); + } + a.click(); + window.URL.revokeObjectURL(url); + }; + xhr.send(); +} \ No newline at end of file diff --git a/src/main/resources/static/js/imageUpload/importantMatter/child/importantMatterForm.js b/src/main/resources/static/js/imageUpload/importantMatter/child/importantMatterForm.js index ffa00f0..73cb508 100644 --- a/src/main/resources/static/js/imageUpload/importantMatter/child/importantMatterForm.js +++ b/src/main/resources/static/js/imageUpload/importantMatter/child/importantMatterForm.js @@ -49,7 +49,7 @@ layui.use(['laydate', 'upload'], function () { const uniqueId = new Date().getTime() + '-' + index; $('#demo1').append( - '
' + + '
' + '' + file.name + '' + '' + '
' @@ -238,8 +238,9 @@ function setFormData(data) { var html = ""; var demo1 = $("#demo1"); for (var i = 0; i < vioPhotoListEdit.length; i++) { - html = html + '
' + - '' +vioPhotoListEdit[i].fileName + '' ; + let filePath = imgUrl + vioPhotoListEdit[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' +vioPhotoListEdit[i].fileName + '' ; if (details != 1) { html = html + ''; } diff --git a/src/main/resources/static/js/imageUpload/qualityInspection/child/qualityInspectionForm.js b/src/main/resources/static/js/imageUpload/qualityInspection/child/qualityInspectionForm.js index 2c8201b..cb49265 100644 --- a/src/main/resources/static/js/imageUpload/qualityInspection/child/qualityInspectionForm.js +++ b/src/main/resources/static/js/imageUpload/qualityInspection/child/qualityInspectionForm.js @@ -58,7 +58,7 @@ layui.use(['laydate', 'upload'], function () { const uniqueId = new Date().getTime() + '-' + index; $('#demo1').append( - '
' + + '
' + '' + file.name + '' + '' + '
' @@ -105,7 +105,7 @@ layui.use(['laydate', 'upload'], function () { } const uniqueId = new Date().getTime() + '-' + index; $('#demo2').append( - '
' + + '
' + '' + file.name + '' + '' + '
' @@ -295,8 +295,9 @@ function setFormData(data) { var html = ""; var demo1 = $("#demo1"); for (var i = 0; i < vioPhotoListEdit.length; i++) { - html = html + '
' + - '' + data.vioPhotoList[i].fileName + '' ; + let filePath = imgUrl + data.vioPhotoList[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' + data.vioPhotoList[i].fileName + '' ; if (details != 1) { html = html + ''; } @@ -310,8 +311,9 @@ function setFormData(data) { var demo2 = $("#demo2"); var html = ""; for (var i = 0; i < rectPhotoListEdit.length; i++) { - html = html + '
' + - '' + data.rectPhotoList[i].fileName + ''; + let filePath = imgUrl + data.rectPhotoList[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' + data.rectPhotoList[i].fileName + ''; if (details != 1) { html = html + ''; } diff --git a/src/main/resources/static/js/imageUpload/safetyMeasure/child/safetyMeasureForm.js b/src/main/resources/static/js/imageUpload/safetyMeasure/child/safetyMeasureForm.js index 069d4d0..e848f20 100644 --- a/src/main/resources/static/js/imageUpload/safetyMeasure/child/safetyMeasureForm.js +++ b/src/main/resources/static/js/imageUpload/safetyMeasure/child/safetyMeasureForm.js @@ -49,7 +49,7 @@ layui.use(['laydate', 'upload'], function () { const uniqueId = new Date().getTime() + '-' + index; $('#demo1').append( - '
' + + '
' + '' + file.name + '' + '' + '
' @@ -239,8 +239,9 @@ function setFormData(data) { var html = ""; var demo1 = $("#demo1"); for (var i = 0; i < vioPhotoListEdit.length; i++) { - html = html + '
' + - '' +vioPhotoListEdit[i].fileName + '' ; + let filePath = imgUrl + vioPhotoListEdit[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' +vioPhotoListEdit[i].fileName + '' ; if (details != 1) { html = html + ''; } diff --git a/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js b/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js index 26edf87..4116071 100644 --- a/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js +++ b/src/main/resources/static/js/imageUpload/safetyViolations/child/safetyViolationsForm.js @@ -58,7 +58,7 @@ layui.use(['laydate', 'upload'], function () { const uniqueId = new Date().getTime() + '-' + index; $('#demo1').append( - '
' + + '
' + '' + file.name + '' + '' + '
' @@ -108,7 +108,7 @@ layui.use(['laydate', 'upload'], function () { } const uniqueId = new Date().getTime() + '-' + index; $('#demo2').append( - '
' + + '
' + '' + file.name + '' + '' + '
' @@ -303,8 +303,9 @@ function setFormData(data) { var html = ""; var demo1 = $("#demo1"); for (var i = 0; i < vioPhotoListEdit.length; i++) { - html = html + '
' + - '' + data.vioPhotoList[i].fileName + '' ; + let filePath = imgUrl + data.vioPhotoList[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' + data.vioPhotoList[i].fileName + '' ; if (details != 1) { html = html + ''; } @@ -318,8 +319,9 @@ function setFormData(data) { var demo2 = $("#demo2"); var html = ""; for (var i = 0; i < rectPhotoListEdit.length; i++) { - html = html + '
' + - '' + data.rectPhotoList[i].fileName + ''; + let filePath = imgUrl + data.rectPhotoList[i].originalFilePath + "?token=" + tokens + html = html + '
' + + '' + data.rectPhotoList[i].fileName + ''; if (details != 1) { html = html + ''; } diff --git a/src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html b/src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html new file mode 100644 index 0000000..1a980a2 --- /dev/null +++ b/src/main/resources/static/pages/imageUpload/coordinatePhoto/child/coordinatePhotoForm.html @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + 协调照片(建设用地)-新增/修改 + + +
+
+ +
项目信息
+
+ +
+ +
+ + +
+ +
+
+
+ +
+ +
+ +
+ +
+
+ + +
建设前
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ 预览图: +
+
+
+ +
+
+ +
建设中
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ 预览图: +
+
+ +
+
+
+ + +
恢复后
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ 预览图: +
+
+ +
+
+
+ + +
+
+
+ + +
+ + + \ No newline at end of file diff --git a/src/main/resources/static/pages/imageUpload/coordinatePhoto/coordinatePhotoList.html b/src/main/resources/static/pages/imageUpload/coordinatePhoto/coordinatePhotoList.html new file mode 100644 index 0000000..74f52c5 --- /dev/null +++ b/src/main/resources/static/pages/imageUpload/coordinatePhoto/coordinatePhotoList.html @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + 协调照片(建设用地) + + +
+ +
+
+
+
+
+ + + + + \ No newline at end of file