| | |
| | | <el-table |
| | | ref="multipleTable" |
| | | v-loading="tableLoading" |
| | | element-loading-text="加载中..." |
| | | element-loading-spinner="el-icon-loading" |
| | | :border="border" |
| | | :data="tableData" |
| | | :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" |
| | |
| | | :row-class-name="rowClassName" |
| | | :row-style="rowStyle" |
| | | :row-key="rowKey" |
| | | :span-method="spanMethod" |
| | | :span-method="finalSpanMethod" |
| | | :stripe="stripe" |
| | | style="width: 100%" |
| | | tooltip-effect="dark" |
| | |
| | | }, |
| | | }, |
| | | props: { |
| | | parentSpanMethod: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | isSelection: { |
| | | type: Boolean, |
| | | default: undefined, |
| | |
| | | // this.doLayout(); |
| | | // }, |
| | | }, |
| | | updated() { |
| | | this.$nextTick(() => { |
| | | this.$refs.multipleTable.doLayout(); |
| | | }); |
| | | }, |
| | | computed: { |
| | | finalSpanMethod() { |
| | | if(this.parentSpanMethod) { |
| | | console.log('父组件的合并方法'); |
| | | return this.parentSpanMethod; |
| | | }else{ |
| | | console.log('子组件的合并方法'); |
| | | return this.spanMethod; |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.calculateSpanInfo(); |
| | | }, |
| | | methods: { |
| | | doLayout() { |
| | | this.$nextTick(() => { |
| | | this.$refs.multipleTable && this.$refs.multipleTable.doLayout(); |
| | | }); |
| | | }, |
| | | getWidth(row, row0) { |
| | | let count = 0; |
| | | row.forEach((a) => { |
| | |
| | | if (!linkEvent) { |
| | | return this.$message.warning("请配置lingk事件"); |
| | | } |
| | | console.log(linkEvent); |
| | | linkEvent.vueComponent[linkEvent.method](row); |
| | | }, |
| | | // 合并单元格 |