From 6cb25621128a60c142a237d29cdceccce6aef36a Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 12 Mar 2024 18:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=88=B0?= =?UTF-8?q?=E8=A1=8C=E4=B8=8A=E6=98=BE=E7=A4=BA=E6=B0=94=E6=B3=A1=E8=A1=8C?= =?UTF-8?q?=E4=B8=8A=E5=8A=A0=E6=97=97=E8=A2=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/list.vue | 52 +++++++++++++++++- .../components/listEm.vue | 55 ++++++++++++++++++- .../components/list.vue | 54 +++++++++++++++++- .../components/listEm.vue | 54 +++++++++++++++++- .../components/list.vue | 54 +++++++++++++++++- .../components/listEm.vue | 54 +++++++++++++++++- 6 files changed, 306 insertions(+), 17 deletions(-) diff --git a/src/views/threeSystems/safetyOperationRegulations/components/list.vue b/src/views/threeSystems/safetyOperationRegulations/components/list.vue index 5ce47c2..4568d09 100644 --- a/src/views/threeSystems/safetyOperationRegulations/components/list.vue +++ b/src/views/threeSystems/safetyOperationRegulations/components/list.vue @@ -37,8 +37,9 @@ tooltip-effect="dark" border fit - highlight-current-row> - > + highlight-current-row + @cell-mouse-enter="enterSelectionRows" + @cell-mouse-leave="leaveSelectionRows"> { this.$message.success('添加失败') }) + }, + enterSelectionRows(row, column, cell, event) { + console.log(row, 'row') + if (row.ISTOPTIME) { + this.createTips(event, row, '数据已置顶') + } + }, + leaveSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.removeTips(row) + } + }, + createTips(el, row, value) { + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDom = document.createElement('div') + tooltipDom.style.cssText = ` + display: inline-block; + max-width: 400px; + max-height: 400px; + position: absolute; + top: ${el.clientY + 5}px; + left: ${el.clientX}px; + padding:5px 10px; + overflow: auto; + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #595959; + background: #fff; + border-radius: 5px; + z-index: 19999; + box-shadow: 0 4px 12px 1px #ccc; + ` + tooltipDom.innerHTML = value + tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`) + // 将浮层插入到body中 + document.body.appendChild(tooltipDom) + }, + removeTips(row) { + console.log(row, 'row') + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`) + if (tooltipDomLeave.length) { + tooltipDomLeave.forEach(dom => { + document.body.removeChild(dom) + }) + } } } } diff --git a/src/views/threeSystems/safetyOperationRegulations/components/listEm.vue b/src/views/threeSystems/safetyOperationRegulations/components/listEm.vue index d0d28da..b349535 100644 --- a/src/views/threeSystems/safetyOperationRegulations/components/listEm.vue +++ b/src/views/threeSystems/safetyOperationRegulations/components/listEm.vue @@ -37,13 +37,15 @@ tooltip-effect="dark" border fit - highlight-current-row> - > + highlight-current-row + @cell-mouse-enter="enterSelectionRows" + @cell-mouse-leave="leaveSelectionRows"> + align="center" + /> @@ -449,6 +451,53 @@ export default { }) this.listLoading = false }) + }, + enterSelectionRows(row, column, cell, event) { + console.log('row', row) + if (row.ISTOPTIME) { + this.createTips(event, row, '数据已置顶') + } + }, + leaveSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.removeTips(row) + } + }, + createTips(el, row, value) { + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDom = document.createElement('div') + tooltipDom.style.cssText = ` + display: inline-block; + max-width: 400px; + max-height: 400px; + position: absolute; + top: ${el.clientY + 5}px; + left: ${el.clientX}px; + padding:5px 10px; + overflow: auto; + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #595959; + background: #fff; + border-radius: 5px; + z-index: 19999; + box-shadow: 0 4px 12px 1px #ccc; + ` + tooltipDom.innerHTML = value + tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`) + // 将浮层插入到body中 + document.body.appendChild(tooltipDom) + }, + removeTips(row) { + console.log(row, 'row') + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`) + if (tooltipDomLeave.length) { + tooltipDomLeave.forEach(dom => { + document.body.removeChild(dom) + }) + } } } } diff --git a/src/views/threeSystems/safetyProductionManagementSystem/components/list.vue b/src/views/threeSystems/safetyProductionManagementSystem/components/list.vue index f7d117e..16360fd 100644 --- a/src/views/threeSystems/safetyProductionManagementSystem/components/list.vue +++ b/src/views/threeSystems/safetyProductionManagementSystem/components/list.vue @@ -37,13 +37,15 @@ tooltip-effect="dark" border fit - highlight-current-row> - > + highlight-current-row + @cell-mouse-enter="enterSelectionRows" + @cell-mouse-leave="leaveSelectionRows"> + align="center" + /> @@ -472,6 +474,52 @@ export default { }).catch((e) => { this.$message.success('添加失败') }) + }, + enterSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.createTips(event, row, '数据已置顶') + } + }, + leaveSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.removeTips(row) + } + }, + createTips(el, row, value) { + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDom = document.createElement('div') + tooltipDom.style.cssText = ` + display: inline-block; + max-width: 400px; + max-height: 400px; + position: absolute; + top: ${el.clientY + 5}px; + left: ${el.clientX}px; + padding:5px 10px; + overflow: auto; + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #595959; + background: #fff; + border-radius: 5px; + z-index: 19999; + box-shadow: 0 4px 12px 1px #ccc; + ` + tooltipDom.innerHTML = value + tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`) + // 将浮层插入到body中 + document.body.appendChild(tooltipDom) + }, + removeTips(row) { + console.log(row, 'row') + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`) + if (tooltipDomLeave.length) { + tooltipDomLeave.forEach(dom => { + document.body.removeChild(dom) + }) + } } } } diff --git a/src/views/threeSystems/safetyProductionManagementSystem/components/listEm.vue b/src/views/threeSystems/safetyProductionManagementSystem/components/listEm.vue index 8792f05..14dfcfc 100644 --- a/src/views/threeSystems/safetyProductionManagementSystem/components/listEm.vue +++ b/src/views/threeSystems/safetyProductionManagementSystem/components/listEm.vue @@ -37,13 +37,15 @@ tooltip-effect="dark" border fit - highlight-current-row> - > + highlight-current-row + @cell-mouse-enter="enterSelectionRows" + @cell-mouse-leave="leaveSelectionRows"> + align="center" + /> @@ -449,6 +451,52 @@ export default { }) this.listLoading = false }) + }, + enterSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.createTips(event, row, '数据已置顶') + } + }, + leaveSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.removeTips(row) + } + }, + createTips(el, row, value) { + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDom = document.createElement('div') + tooltipDom.style.cssText = ` + display: inline-block; + max-width: 400px; + max-height: 400px; + position: absolute; + top: ${el.clientY + 5}px; + left: ${el.clientX}px; + padding:5px 10px; + overflow: auto; + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #595959; + background: #fff; + border-radius: 5px; + z-index: 19999; + box-shadow: 0 4px 12px 1px #ccc; + ` + tooltipDom.innerHTML = value + tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`) + // 将浮层插入到body中 + document.body.appendChild(tooltipDom) + }, + removeTips(row) { + console.log(row, 'row') + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`) + if (tooltipDomLeave.length) { + tooltipDomLeave.forEach(dom => { + document.body.removeChild(dom) + }) + } } } } diff --git a/src/views/threeSystems/safetyProductionResponsibilitySystem/components/list.vue b/src/views/threeSystems/safetyProductionResponsibilitySystem/components/list.vue index 781d1fb..37a18c3 100644 --- a/src/views/threeSystems/safetyProductionResponsibilitySystem/components/list.vue +++ b/src/views/threeSystems/safetyProductionResponsibilitySystem/components/list.vue @@ -37,13 +37,15 @@ tooltip-effect="dark" border fit - highlight-current-row> - > + highlight-current-row + @cell-mouse-enter="enterSelectionRows" + @cell-mouse-leave="leaveSelectionRows"> + align="center" + /> @@ -472,6 +474,52 @@ export default { }).catch((e) => { this.$message.success('添加失败') }) + }, + enterSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.createTips(event, row, '数据已置顶') + } + }, + leaveSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.removeTips(row) + } + }, + createTips(el, row, value) { + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDom = document.createElement('div') + tooltipDom.style.cssText = ` + display: inline-block; + max-width: 400px; + max-height: 400px; + position: absolute; + top: ${el.clientY + 5}px; + left: ${el.clientX}px; + padding:5px 10px; + overflow: auto; + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #595959; + background: #fff; + border-radius: 5px; + z-index: 19999; + box-shadow: 0 4px 12px 1px #ccc; + ` + tooltipDom.innerHTML = value + tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`) + // 将浮层插入到body中 + document.body.appendChild(tooltipDom) + }, + removeTips(row) { + console.log(row, 'row') + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`) + if (tooltipDomLeave.length) { + tooltipDomLeave.forEach(dom => { + document.body.removeChild(dom) + }) + } } } } diff --git a/src/views/threeSystems/safetyProductionResponsibilitySystem/components/listEm.vue b/src/views/threeSystems/safetyProductionResponsibilitySystem/components/listEm.vue index b5531d2..234e626 100644 --- a/src/views/threeSystems/safetyProductionResponsibilitySystem/components/listEm.vue +++ b/src/views/threeSystems/safetyProductionResponsibilitySystem/components/listEm.vue @@ -37,13 +37,15 @@ tooltip-effect="dark" border fit - highlight-current-row> - > + highlight-current-row + @cell-mouse-enter="enterSelectionRows" + @cell-mouse-leave="leaveSelectionRows"> + align="center" + /> @@ -449,6 +451,52 @@ export default { }) this.listLoading = false }) + }, + enterSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.createTips(event, row, '数据已置顶') + } + }, + leaveSelectionRows(row, column, cell, event) { + if (row.ISTOPTIME) { + this.removeTips(row) + } + }, + createTips(el, row, value) { + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDom = document.createElement('div') + tooltipDom.style.cssText = ` + display: inline-block; + max-width: 400px; + max-height: 400px; + position: absolute; + top: ${el.clientY + 5}px; + left: ${el.clientX}px; + padding:5px 10px; + overflow: auto; + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #595959; + background: #fff; + border-radius: 5px; + z-index: 19999; + box-shadow: 0 4px 12px 1px #ccc; + ` + tooltipDom.innerHTML = value + tooltipDom.setAttribute('id', `tooltip-${BUS_TEXT_LIBRARY_ID}`) + // 将浮层插入到body中 + document.body.appendChild(tooltipDom) + }, + removeTips(row) { + console.log(row, 'row') + const { BUS_TEXT_LIBRARY_ID } = row + const tooltipDomLeave = document.querySelectorAll(`#tooltip-${BUS_TEXT_LIBRARY_ID}`) + if (tooltipDomLeave.length) { + tooltipDomLeave.forEach(dom => { + document.body.removeChild(dom) + }) + } } } }