import { formatMoney } from '@/utils/index'
export default {
  data() {
    return {
      loading: false,
      tableOptions: {
        sortTable: true,
        maxHeight: 'calc(100vh - 340px)',
        height: 'calc(100vh - 340px)'
      },
      columns: [
        {
          label: '序号',
          index: true,
          width: 200
        },
        {
          label: '流程定义名称',
          prop: 'name',
          showTooltip: true
        },
        {
          label: '版本',
          showTooltip: true,
          prop: 'version'
        },
        {
          label: '操作',
          show: true,
          render: (h, row) => {
            const btnList = [
              {
                msg: '查看流程图',
                icon: 'iconfont icon-Magnifier',
                power: '',
                category: 'see'
              },
              {
                msg: '流程节点',
                icon: 'iconfont icon-xiugai',
                power: '',
                category: 'edit'
              }
            ]
            const options = btnList.map(item => {
              return (
                <el-tooltip class='item' effect='dark' content={item.msg} placement='top' >
                  <span class='table-icon-box'>
                    <i class={item.icon} onClick={() => { this.handlerOperate(item.category, row) }}></i>
                  </span>
                </el-tooltip>
              )
            })
            return <div>{ options }</div>
          },
          width: 200
        }
      ]
    }
  },
  computed: {
    formatMoney() {
      return (val) => {
        return formatMoney(val)
      }
    }
  }
}
