<template>
  <div :class="$style.security">
    <a-card>
      <sd-detail-form
        v-if="secId"
        ref="form"
        :record-id="secId"
        page-id="securitySetting/oaAutoLogout"
        @saved="securitySave"
      >
        <template v-slot="{ model }">
          <sd-form-item name="autoLogout" />
          <sd-form-item name="autoLogoutTime" :hidden="model.autoLogout === '0'" />
          <sd-form-item name="passwordSame" />
          <sd-form-item name="id" :hidden="true" />
          <sd-form-item name="belongedOrgId" :hidden="true" />
        </template>
      </sd-detail-form> </a-card
  ></div>
</template>

<script>
import { Message } from 'ant-design-vue'
import components from './_import-components/sd-security-settings-import'
import SecurityService from './security-service'

export default {
  name: 'SdSecuritySettings',
  metaInfo: {
    title: '安全设置',
  },
  components,
  data() {
    return {
      secId: null,
      defauleForm: {},
    }
  },
  created() {
    this.getInitData()
  },
  methods: {
    getInitData() {
      SecurityService.getSecurityInfo().then((res) => {
        this.secId = res?.data?.id
      })
    },
    securitySave() {
      Message.success('保存成功')
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.security {
  :global(.sd-form-btns-close) {
    display: none;
  }
}
</style>
