<template>
  <div>
    <sd-data-table
      ref="dataTable3"
      data-url="api/framework/v1/delegation/my-entrusted-items"
      :columns="columns3"
      :search-fields="['TITLE']"
      :process-req="processReq"
    >
    </sd-data-table>
  </div>
</template>

<script>
import { Message } from 'ant-design-vue'
import TableColumnTypes from '../../common/services/table-column-types'
import components from './_import-components/sd-my-entrust-record-list-import'

export default {
  name: 'SdMyEntrustRecordList',
  components,
  data() {
    return {
      searchform: {
        isopen: false,
      },
      columns3: [
        {
          title: '业务类型',
          dataIndex: 'flowName',
        },
        {
          title: '标题',
          dataIndex: 'title',
        },

        {
          title: '被委托人',
          dataIndex: 'user.name',
        },
        {
          title: '执行的操作',
          dataIndex: 'actionName',
        },
        {
          title: '办理时间',
          sdRender: TableColumnTypes.dateTime,
          dataIndex: 'activityFinishDate',
          sorter: true,
          defaultSortOrder: 'desc',
        },
      ],
    }
  },
  computed: {},
  created() {},
  methods: {
    // 修改查询参数
    processReq(req) {
      if (req.data?.expressions[0]) {
        const exp = req.data.expressions[0].expressionsValue
        req.data.expressions = exp
      }
      return req
    },
    // 高级搜索展开按钮事件
    superBtnClick() {
      this.searchform.isopen = !this.searchform.isopen
    },
    // 高级查询按钮
    searchSubmit(val) {
      Message.success(`搜索条件为${val}`)
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.date {
  width: 100%;
}
</style>
