From f003a0c4be0e2c4d60f6500e7a541af0d8246fb1 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Thu, 27 Feb 2025 11:22:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../outsourcerEvaluation/evaluationForm.html | 65 +++++++++---------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html index 54c943b..e392bbc 100644 --- a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html +++ b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html @@ -216,22 +216,8 @@ delete item.dataset.edit let fileDom = ''; - // 只要有文件列表,并且文件列表数量大于0,添加文件信息 - // if (item1.fileList && item1.fileList.length > 0) { - // // 根据文件列表的索引判断将哪个文件添加到相应的列 - // fileDom = `${item1.fileList[index - 3]}`; - // } - - // console.log('fileDomfileDomfileDomfileDom', fileDom) - - // // 将fileDom添加到当前单元格 - // $(this).append(fileDom); let dataId = $(this).data('field') - - console.log(dataId) - console.log(item1[`${dataId}-file`]) - if (item1[`${dataId}-file`] && item1[`${dataId}-file`]['fileName']) { $(this).find('.layui-table-cell').append(` `) } @@ -310,33 +296,36 @@ multiple: false, done: function (res) { // 上传完毕回调 - console.log('文件上传成功'); - console.log(res); - var dataId = $(this.elem).data('id'); - var dataIndex = $(this.elem).data('index'); - tableRowList[rowIndex][`${dataId}-file`] = { - fileName: res.message, - filePath: res.obj, + if (res.res === 1) { + var dataId = $(this.elem).data('id'); + var dataIndex = $(this.elem).data('index'); + tableRowList[rowIndex][`${dataId}-file`] = { + fileName: res.message, + filePath: res.obj, + } + // 隐藏当前上传按钮 + $(`#uploadBtn${dataIndex}`).hide() + $(`#upload-success_${dataIndex}`).show() + $(`#upload-success_${dataIndex}`).prepend(`${res.message}`) + + let hasIcon = tableView.find('tr[data-index=' + rowIndex + ']').find('td[data-field=' + dataId + ']').find('.layui-icon') > 0 + + if (!hasIcon) { + tableView.find('tr[data-index=' + rowIndex + ']').find('td[data-field=' + dataId + ']').find('.layui-table-cell').append(` `) + } + } else { + layer.msg(res.resMsg) } - // 隐藏当前上传按钮 - $(`#uploadBtn${dataIndex}`).hide() - $(`#upload-success_${dataIndex}`).show() - $(`#upload-success_${dataIndex}`).prepend(`${res.message}`) - // 插入新的 DOM 元素, - // var newDom = $(`