<template>
  <a-card>
    <sd-data-table
      data-url="api/framework/v1/flows/data-edit-list"
      :columns="columns"
      :row-key="'beanId'"
      :search-fields="['title']"
    >
      <a slot="dataTitle" slot-scope="text, record" @click="openRecord(record)">{{ text }}</a>
    </sd-data-table>
  </a-card>
</template>

<script>
import TodoListService from '@/todo/todo-list-service'
import TableColumnTypes from '@/common/services/table-column-types'
import components from './_import-components/sd-data-maintain-import'
const columns = [
  {
    title: '业务类型',
    dataIndex: 'appCat',
  },
  {
    dataIndex: 'title',
    title: '标题',
    scopedSlots: { customRender: 'dataTitle' },
  },
  {
    title: '发起人',
    dataIndex: 'creatorName',
  },
  {
    title: '发起部门',
    dataIndex: 'creatorDeptName',
    sdCandidate: true,
  },
  {
    title: '创建时间',
    dataIndex: 'startDate',
    sdRender: TableColumnTypes.dateTime,
    defaultSortOrder: 'descend',
    sorter: true,
  },
  {
    title: '当前状态',
    dataIndex: 'activeStepNames',
  },
  {
    title: '当前处理人',
    dataIndex: 'activeOperatorUsers',
  },
]
export default {
  name: 'SdDataMaintain',
  metaInfo: {
    title: '数据维护',
  },
  components,
  data() {
    return {
      columns,
      visible: false,
      dataSource: [],
    }
  },
  methods: {
    openRecord(record) {
      TodoListService.openTaskItem(record)
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
