+
+
+ {{ scope.row.maNum }}
+
+
+
+ {{ scope.row.toolNum }}
+
+
+
+ {{ scope.row[column.prop] }}
+
+
+
@@ -195,6 +222,37 @@ export default {
},
methods: {
+ // 1. 判断数值是否有效(非0/非null/非undefined/非空字符串)
+ isEffectiveValue(val) {
+ if (val === null || val === undefined || val === '') return false;
+ const numVal = Number(val);
+ return !isNaN(numVal) && numVal !== 0;
+ },
+ // 2. 表格单元格跳转方法(携带整行数据)
+ handleTableJump(type, rowData) {
+ // 仅当对应数值有效时才执行跳转
+ const targetVal = type === 'equip' ? rowData.maNum : rowData.toolNum;
+ if (!this.isEffectiveValue(targetVal)) {
+ return; // 无效数值不触发跳转
+ }
+ if (type === 'equip') {
+ console.log('跳转至装备详情页', {
+ equipTotal: rowData.maNum
+ });
+ this.$router.push({
+ path: '/equipment/equipment-ledger',
+ query: { company: rowData.companyName, total: rowData.maNum }
+ });
+ } else if (type === 'tool') {
+ console.log('跳转至工具详情页', {
+ toolTotal: rowData.toolNum
+ });
+ this.$router.push({
+ path: '/toolsManage/toolsLedger',
+ query: { company: rowData.companyName, total: rowData.toolNum }
+ });
+ }
+ },
async getDataAll() {
try {
const res = await getDeviceNumAll()
@@ -358,15 +416,15 @@ export default {
const initShowEquip = equipTotals.some(v => v > 0);
const initShowTool = toolTotals.some(v => v > 0);
const initShowBoth = initShowEquip && initShowTool;
-
+
barChart.setOption({
tooltip: {
trigger: 'axis',
formatter: (params) => {
let res = `${params[0].name}