| | |
| | | data() { |
| | | return { |
| | | spanList: [], |
| | | btnWidth: "120px", |
| | | uploadRefs: [], |
| | | currentFiles: {}, // 用于存储每行的当前文件 |
| | | uploadKeys: {} // 用于动态重置组件 |
| | | }; |
| | | }, |
| | | computed: { |
| | | btnWidth() { |
| | | let width = 120; |
| | | this.column.filter(item => item.dataType === 'action').forEach(item => { |
| | | this.tableData.forEach(row => { |
| | | width = Math.max(width, parseInt(this.getWidth(item.operation, row), 10)); |
| | | }); |
| | | }); |
| | | return `${width}px`; |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.calculateSpanInfo(); |
| | |
| | | count += a.name.length; |
| | | } |
| | | }); |
| | | this.btnWidth = count * 15 + 60 + "px"; |
| | | return count * 15 + 60 + "px"; |
| | | }, |
| | | getTitleWidth(row) { |
| | |
| | | } |
| | | }, |
| | | iconFn(row) { |
| | | if (Object.prototype.hasOwnProperty.call(row, 'icon')) { |
| | | return row.icon; |
| | | } |
| | | if (row.name === "编辑" || row.name === "修改") { |
| | | return "el-icon-edit"; |
| | | } else if (row.name === "查看") { |