| | |
| | | class="btnColor" |
| | | >检查资料</el-button |
| | | > |
| | | <el-popover trigger="click" popper-class="custom-popper"> |
| | | <el-popover |
| | | trigger="click" |
| | | popper-class="custom-popper" |
| | | :disabled="!hasAnyReport(row)" |
| | | > |
| | | <template #reference> |
| | | <el-button type="text" class="btnColor">查看报告</el-button> |
| | | <el-button |
| | | type="text" |
| | | class="btnColor" |
| | | :disabled="!hasAnyReport(row)" |
| | | @click="checkReportAvailability(row)" |
| | | > |
| | | 查看报告 |
| | | </el-button> |
| | | </template> |
| | | <div |
| | | class="h100 flex flex-column a-center j-between c-fff fs--16 SHSBold" |
| | | > |
| | | <div |
| | | @click="openReport('safe', row)" |
| | | class="py--12 w100 txt-center br--10 bgcolor6 cursor-pointer" |
| | | :class="{ disabled: row.containSystemRes !== 1 }" |
| | | class="py--12 w100 txt-center br--10 bgcolor6 report-btn" |
| | | :class="{ |
| | | 'report-disabled': row.containSystemRes !== 1, |
| | | 'report-enabled': row.containSystemRes === 1 |
| | | }" |
| | | > |
| | | 安全报告 |
| | | <span>安全报告</span> |
| | | <span v-if="row.containSystemRes !== 1" class="no-report-tag">(暂无)</span> |
| | | </div> |
| | | <div |
| | | @click="openReport('device', row)" |
| | | class="py--12 w100 txt-center br--10 bgcolor7 cursor-pointer" |
| | | :class="{ disabled: row.containDeviceRes !== 1 }" |
| | | class="py--12 w100 txt-center br--10 bgcolor7 report-btn" |
| | | :class="{ |
| | | 'report-disabled': row.containDeviceRes !== 1, |
| | | 'report-enabled': row.containDeviceRes === 1 |
| | | }" |
| | | > |
| | | 设备报告 |
| | | <span>设备报告</span> |
| | | <span v-if="row.containDeviceRes !== 1" class="no-report-tag">(暂无)</span> |
| | | </div> |
| | | </div> |
| | | </el-popover> |
| | |
| | | } |
| | | }, |
| | | |
| | | // 检查是否有任何报告 |
| | | hasAnyReport(row) { |
| | | return row.containSystemRes === 1 || row.containDeviceRes === 1; |
| | | }, |
| | | |
| | | // 检查报告可用性(当按钮被禁用时点击) |
| | | checkReportAvailability(row) { |
| | | if (!this.hasAnyReport(row)) { |
| | | this.$message.warning("该计划暂无可查看的报告"); |
| | | } |
| | | }, |
| | | |
| | | // 打开报告 |
| | | openReport(type, row) { |
| | | this.currentRow = row; |
| | | if (type === "safe") { |
| | | // 安全报告 |
| | | if (row.containSystemRes === 1) { |
| | | this.reportUrl = row.systemReportUrl || ""; |
| | | } else { |
| | | this.$message.warning("暂无安全报告"); |
| | | return; |
| | | } |
| | | } else if (type === "device") { |
| | | // 设备报告 |
| | | if (row.containDeviceRes === 1) { |
| | | this.reportUrl = row.deviceReportUrl || ""; |
| | | } else { |
| | | this.$message.warning("暂无设备报告"); |
| | | return; |
| | | } |
| | | // 根据类型检查是否有对应报告 |
| | | const hasReport = type === "safe" |
| | | ? row.containSystemRes === 1 |
| | | : row.containDeviceRes === 1; |
| | | |
| | | if (!hasReport) { |
| | | this.$message.warning(`暂无${type === "safe" ? "安全" : "设备"}报告`); |
| | | return; |
| | | } |
| | | |
| | | this.currentRow = row; |
| | | |
| | | // 获取报告URL |
| | | this.reportUrl = type === "safe" |
| | | ? row.systemReportUrl || "" |
| | | : row.deviceReportUrl || ""; |
| | | |
| | | if (this.reportUrl) { |
| | | this.reportVisible = true; |
| | |
| | | color: #00ebfc; |
| | | } |
| | | |
| | | .disabled { |
| | | opacity: 0.5; |
| | | .report-btn { |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | position: relative; |
| | | } |
| | | |
| | | .report-enabled { |
| | | &:hover { |
| | | opacity: 0.8; |
| | | transform: translateY(-2px); |
| | | } |
| | | } |
| | | |
| | | .report-disabled { |
| | | opacity: 0.4; |
| | | cursor: not-allowed !important; |
| | | pointer-events: none; |
| | | } |
| | | |
| | | .no-report-tag { |
| | | font-size: 12px; |
| | | margin-left: 4px; |
| | | opacity: 0.7; |
| | | } |
| | | |
| | | ::v-deep .el-descriptions { |