index.vue 3.28 KB
<template>
  <div class="system-container">
    <div class="container">
      <search-form
        class="searchTop border-shadow"
        :formModel="searchForm"
        :formList="todoFormList"
      >
        <slot name="form-slot">
          <el-button
            type="primary"
            :size="btn_size"
            icon="el-icon-search"
            :id="todoTableParams.btnId"
          >搜索</el-button>
          <el-button
            type="primary"
            :size="btn_size"
            icon="el-icon-refresh"
          >重置</el-button>
        </slot>
      </search-form>
      <basic-table
        ref="roleTable"
        :tableParams="todoTableParams"
        :getListApi="getListApi"
        :searchForm="searchForm"
        :hasNum="false"
      >
        <span
          slot="status"
          slot-scope="scope"
        >
          <span
            class="dot"
            :class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
          ></span>
          <span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
        </span>
        <span
          slot="table-button"
          slot-scope="scope"
        >
          <el-button
            v-for="(j, idx) in todoTableParams.tableOption.btnList"
            :key="idx"
            :type="j.type"
            size="mini"
            plain
            @click="btnClick(j.pType, scope.scope)"
          >{{j.name}}</el-button>
        </span>
      </basic-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchForm: {},
      todoFormList: [
        {
          label: '处理状态:',
          type: 'select',
          prop: 'status',
          placeholder: '请选择',
          options: [{
            label: '全部待办',
            value: 0
          }, {
            label: '未处理',
            value: 1
          }, {
            label: '已处理',
            value: 2
          }]
        },
        {
          label: '事项类型:',
          type: 'select',
          prop: 'status',
          placeholder: '请选择',
          options: [{
            label: '全部类型',
            value: 0
          }, {
            label: '试驾围栏修改审核',
            value: 1
          }, {
            label: '上牌资料审核',
            value: 2
          }]
        }
      ],
      todoTableParams: {
        btnId: new Date().getTime() + parseInt(Math.random() * 1000),
        listName: 'list',
        tableColumns: [
          {
            label: '事项类型',
            prop: 'roleName'
          }, {
            label: '创建人',
            prop: 'remark'
          }, {
            label: '车辆类型',
            prop: 'enableStatus'
          }, {
            label: '创建时间',
            prop: 'createdDate'
          }
        ],
        tableOption: {
          width: 300,
          btnList: [
            {
              type: 'primary',
              name: '编辑',
              pType: 'edit'
            },
            {
              type: 'danger',
              name: '删除',
              pType: 'delete'
            }
          ]
        }
      }
    }
  },
  methods: {
    btnClick(type, scope) {

    }
  },
}
</script>

<style>
</style>