<template>
  <a-card>
    <sd-oa-table
      form-id="weThirdSyncConfig"
      page-id="third/config/weThirdSyncConfig"
      :columns="columns"
      :actions="actions"
      show-selection
      :search-fields="[]"
    >
      <template v-slot:form>
        <sd-form-item name="id" :hidden="true" />
        <!-- 应用名称 -->
        <sd-form-item name="applicationName" />
        <!-- 应用ID -->
        <sd-form-item name="applicationId" />
        <!-- 是否鉴权 -->
        <sd-form-item name="authenIs" />
        <!-- 获取token -->
        <sd-form-item name="tokenUrl" />
        <!-- 接口类型 -->
        <sd-form-item name="interfaceType" />
        <!-- url前缀 -->
        <sd-form-item name="urlPrefix" />
        <!-- 状态 -->
        <sd-form-item name="status" />
        <!-- 扩展字段1 -->
        <sd-form-item name="param1" />
        <!-- 扩展字段2 -->
        <sd-form-item name="param2" />
        <!-- 扩展字段3 -->
        <sd-form-item name="param3" />
        <!-- 扩展字段4 -->
        <sd-form-item name="param4" />
        <!-- 扩展字段5 -->
        <sd-form-item name="param5" />
        <sd-form-item-td name="weThirdSyncChildConfigEntitys" :colspan="4" :label="null">
          <!-- input-form 表示这部分是子表组件的form插槽 -->
          <template v-slot:input-form>
            <!-- 接口名称 -->
            <sd-form-item name="interfaceName" />
            <!-- 接口url -->
            <sd-form-item name="interfaceUrl" />
            <!-- 接口方式 -->
            <sd-form-item name="interfaceForm" />
            <!-- 接口类型 -->
            <sd-form-item name="interfaceType" />
            <!-- 状态 -->
            <sd-form-item name="status" />
          </template>
        </sd-form-item-td>
      </template>
      <span slot="AppointmentTime" slot-scope="appointmentTime">
        {{ appointmentTime | sdDateFormat('YYYY-MM-DD HH:mm') }}
      </span>
    </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/sd-third-sync-config-import'

export default {
  name: 'SdThirdSyncConfig',
  metaInfo: {
    title: '同步配置',
  },
  components,
  data() {
    return {
      columns: [
        {
          title: '应用名称',
          dataIndex: 'applicationName',
          sdClickable: true,
        },
        {
          title: '应用ID',
          dataIndex: 'applicationId',
        },
        {
          title: '状态',
          dataIndex: 'status',
          sdRender: TableColumnTypes.oa.switch,
        },
      ],
      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>
