vue 根据数字显示状态

 

<s-table
  size="default"
  ref="table"
  rowKey="id"
  :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  :columns="columns"
  :data="loadData"
>
  <span slot="status" slot-scope="text">
    <a-badge :status="text | statusTypeFilter" :text="text | statusFilter" />
  </span>
  <span slot="action" slot-scope="text, record">
    <a  @click="handleEdit(record)">详情</a>
  </span>
</s-table>

 

<script>
import { STable } from '@/components'
import { getJobRecruitmentInfoList, delJobRecruitmentInfo } from '@/api/job/jobRecruitmentInfo'
import JobRecruitmentInfoModal from './modules/JobRecruitmentInfoPostModal.vue'
import { checkPermission } from '@/utils/permissions'

const statusMap = {
  0: {
    status: 'default',
    text: '未知'
  },
  1: {
    status: 'processing',
    text: '实习'
  },
  2: {
    status: 'success',
    text: '正式'
  }
}

 

 

 form: this.$form.createForm(this),
    mdl: {},
    // 高级搜索 展开/关闭
    advanced: false,
    // 查询参数
    queryParam: {},
    // 表头
    columns: [
      {
        title: '岗位名称',
        dataIndex: 'postName'
      },
      {
        title: '岗位要求',
        dataIndex: 'postFunction'
      },
      {
        title: '岗位类型',
        dataIndex: 'postType',
         scopedSlots: { customRender: 'status' }
      },
      {
        title: '学历',
        dataIndex: 'minimumEducation'
      },
      {
        title: '最低薪资',
        dataIndex: 'minSalary'
      },
      {
        title: '最高薪资',
        dataIndex: 'maxSalary'
      },
      {
        title: '招聘人数',
        dataIndex: 'recruitNum'
      },
      {
        title: '工作地点',
        dataIndex: 'workAreaId'
      },
       {
        title: '发布日期',
        dataIndex: 'createTime'
      },
      {
        title: '操作',
        width: '200px',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
      }
    ],
    // 加载数据方法 必须为 Promise 对象
    loadData: parameter => {
      return getJobRecruitmentInfoList(Object.assign(parameter, this.queryParam))
    },
    selectedRowKeys: [],
    selectedRows: [],
    addEnable: checkPermission('job:jobRecruitmentInfo:add'),
    editEnabel: checkPermission('job:jobRecruitmentInfo:edit'),
    removeEnable: checkPermission('job:jobRecruitmentInfo:remove')
  }
},
filters: {
   statusFilter (type) {
    return statusMap[type].text
  },
  statusTypeFilter (type) {
    return statusMap[type].status
  }
},
created () {
},
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值