Article.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <script setup lang="ts">
  2. import { ref } from "vue";
  3. import { useMainStore } from "@/stores/main";
  4. import { required } from "@/utils";
  5. import { useI18n } from "vue-i18n";
  6. const mainStore = useMainStore();
  7. const { t } = useI18n();
  8. const valid = ref(true);
  9. const dialog = ref(false);
  10. const title = ref("");
  11. const Form = ref();
  12. async function Submit() {
  13. setTimeout(() => {
  14. dialog.value = true;
  15. }, 2000);
  16. await (Form as any).value.validate();
  17. if (valid.value) {
  18. valid.value = false;
  19. }
  20. }
  21. </script>
  22. <template>
  23. <v-container fluid>
  24. <v-card class="ma-3 pa-3">
  25. <v-card-title primary-title>
  26. <h3 class="card-title mb-3">{{ t("makeArticle") }}</h3>
  27. </v-card-title>
  28. <v-card-text>
  29. <v-form v-model="valid" ref="Form">
  30. <v-text-field
  31. :label="$t('articleTitle')"
  32. v-model="title"
  33. :rules="required()"
  34. prepend-icon="title"
  35. >
  36. </v-text-field>
  37. <v-text-field :label="$t('articleLink')" prepend-icon="link">
  38. </v-text-field>
  39. <v-textarea
  40. :label="$t('articleContent')"
  41. prepend-icon="edit_document"
  42. ></v-textarea>
  43. </v-form>
  44. </v-card-text>
  45. <v-card-actions>
  46. <v-spacer></v-spacer>
  47. <v-btn @click="Submit" :disabled="!valid">
  48. {{ t("send") }}
  49. </v-btn>
  50. </v-card-actions>
  51. </v-card>
  52. <template>
  53. <div class="text-center">
  54. <v-dialog v-model="dialog" width="auto">
  55. <v-card>
  56. <v-card-text>
  57. <section class="d-flex flex-column align-center">
  58. <v-icon
  59. style="font-size: 70px"
  60. icon="info"
  61. color="orange-darken-3"
  62. />
  63. <p class="mt-3">文章處理需要約 5-10 分鐘,敬請耐心等候</p>
  64. </section>
  65. </v-card-text>
  66. <v-card-actions>
  67. <v-btn color="primary" block @click="dialog = false">
  68. {{ t("close") }}</v-btn>
  69. </v-card-actions>
  70. </v-card>
  71. </v-dialog>
  72. </div>
  73. </template>
  74. </v-container>
  75. </template>
  76. <style lang="scss">
  77. </style>