import { formatMoney } from '@/utils/index'
export default {
  data() {
    return {
      loading: false,
      tableOptions: {
        sortTable: true,
        maxHeight: 'calc(100vh - 406px)',
        height: 'calc(100vh - 406px)'
      },
      columns: [
        {
          label: '序号',
          index: true
        },
        {
          label: '流程定义Id',
          prop: 'processDefinitionId',
          showTooltip: true
        },
        {
          label: '任务KEY',
          showTooltip: true,
          prop: 'activityKey'
        },
        {
          label: '任务名称',
          showTooltip: true,
          prop: 'activityName'
        },
        {
          label: '时限',
          showTooltip: true,
          prop: 'timeLimit',
          render: (h, row) => {
            return <div>{ row.timeLimit === null ? '' : row.timeLimit === 0 ? '无时限' : row.workingDay ? row.timeLimit + '个工作日' : row.timeLimit + '个自然日' }</div>
          }
        },
        {
          label: '操作',
          show: true,
          render: (h, row) => {
            const btnList = [
              {
                msg: '流程节点',
                icon: 'iconfont icon-xiugai',
                power: 'projectNumber:delete',
                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)
      }
    }
  }
}
