<template>
  <a-card>
    <sd-oa-table
      ref="autobhTable"
      form-id="kmTag"
      page-id="km/admin/kmTag"
      :columns="columns"
      show-selection
      :actions="actions"
      :search-fields="['name']"
    >
      <template v-slot:form>
        <sd-form-item name="name" />
      </template>
    </sd-oa-table>
  </a-card>
</template>

<script>
import TableColumnTypes from '@/common/services/table-column-types'
import TableActionTypes from '@/common/services/table-action-types'
import components from './_import-components/km-tag-manage-import'

const columns = [
  {
    title: '序号',
    align: 'center',
    width: '100px',
    customRender: (text, record, index) => `${index + 1}`,
  },
  {
    title: '标签名称',
    dataIndex: 'name',
    sdClickable: true,
  },

  {
    title: '创建时间',
    dataIndex: 'creationTime',
    defaultSortOrder: 'desc',
    sdRender: TableColumnTypes.dateTime,
    sorter: true,
  },
]

export default {
  name: 'KmTagManage',
  metaInfo: {
    title: '标签维护',
  },
  components,
  data() {
    return {
      columns,
      actions: [
        {
          label: '新建',
          id: 'new',
          type: TableActionTypes.oa.create,
        },
        {
          label: '删除',
          id: 'delete',
          type: TableActionTypes.oa.delete,
        },
      ],
    }
  },
  methods: {},
}
</script>

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