AutoSync.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div>
  3. <a-form-item :label="$t('cloudenv.text_83')" v-bind="formLayout" v-show="false">
  4. <a-switch :checkedChildren="$t('cloudenv.text_84')" :unCheckedChildren="$t('cloudenv.text_85')" v-decorator="decorators.enable_auto_sync" @change="change" />
  5. </a-form-item>
  6. <a-form-item :label="$t('cloudenv.text_86')" v-bind="formLayout" v-if="showSecond">
  7. <a-input-number style="width: 180px" :min="30" v-decorator="decorators.sync_interval_seconds" /><span class="ml-1">{{ $t('cloudenv.text_87') }}</span>
  8. <div v-if="!fc.getFieldError('sync_interval_seconds')" slot="extra">{{$t('cloudenv.text_88')}}</div>
  9. </a-form-item>
  10. <!-- <a-form-item :label="$t('cloudenv.text_89')" v-bind="formLayout">
  11. <a-switch v-decorator="decorators.is_public" />
  12. </a-form-item> -->
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. fc: {
  19. type: Object,
  20. required: true,
  21. },
  22. formLayout: {
  23. type: Object,
  24. },
  25. },
  26. data () {
  27. return {
  28. showSecond: false,
  29. decorators: {
  30. enable_auto_sync: [
  31. 'enable_auto_sync',
  32. {
  33. valuePropName: 'checked',
  34. initialValue: false,
  35. },
  36. ],
  37. sync_interval_seconds: [
  38. 'sync_interval_seconds',
  39. {
  40. initialValue: 60,
  41. normalize: v => Number(v),
  42. rules: [
  43. { type: 'integer', min: 30, message: this.$t('cloudenv.text_88'), trigger: 'blur' },
  44. ],
  45. },
  46. ],
  47. // is_public: [
  48. // 'is_public',
  49. // {
  50. // valuePropName: 'checked',
  51. // initialValue: false,
  52. // },
  53. // ],
  54. },
  55. }
  56. },
  57. methods: {
  58. change (val) {
  59. this.showSecond = val
  60. },
  61. },
  62. }
  63. </script>