Newer
Older
Nanping_sponge_GCYPG / src / views / home / rationality / components / mixins / index.js
@liyingjing liyingjing on 25 Oct 2023 616 bytes 工程预评估

import {ref, computed } from 'vue'

export default function useTable(proxy) {
  const loading = ref(false)
  const formModel = computed(() => {
    return {
      list: proxy.$props.list
    }
  })

  const objectSpanMethod = ({
    row,
    column,
    rowIndex,
    columnIndex,
  }) => {
    if (columnIndex === 0) {
      if (rowIndex === 0) {
        return {
          rowspan: formModel.value.list.length,
          colspan: 1,
        }
      } else {
        return {
          rowspan: 0,
          colspan: 0,
        }
      }
    }
  }

  return {
    loading,
    formModel,
    objectSpanMethod
  }
}