index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <script setup lang="ts">
  2. import { computed } from "vue";
  3. import { useColumns } from "./columns";
  4. export interface schemaItem {
  5. field: string;
  6. label: string;
  7. }
  8. defineOptions({
  9. name: "About"
  10. });
  11. const { pkg } = __APP_INFO__;
  12. const { dependencies, devDependencies } = pkg;
  13. const schema: schemaItem[] = [];
  14. const devSchema: schemaItem[] = [];
  15. const { columns } = useColumns();
  16. const words = [
  17. "@pureadmin/descriptions",
  18. "@pureadmin/table",
  19. "@pureadmin/utils",
  20. "@vueuse/core",
  21. "axios",
  22. "dayjs",
  23. "echarts",
  24. "vue",
  25. "element-plus",
  26. "pinia",
  27. "vue-i18n",
  28. "vue-router",
  29. "@iconify/vue",
  30. "@vitejs/plugin-vue",
  31. "@vitejs/plugin-vue-jsx",
  32. "eslint",
  33. "prettier",
  34. "sass",
  35. "stylelint",
  36. "tailwindcss",
  37. "typescript",
  38. "vite",
  39. "vue-tsc"
  40. ];
  41. const getMainLabel = computed(
  42. () => (label: string) => words.find(w => w === label) && "main-label"
  43. );
  44. Object.keys(dependencies).forEach(key => {
  45. schema.push({ field: dependencies[key], label: key });
  46. });
  47. Object.keys(devDependencies).forEach(key => {
  48. devSchema.push({ field: devDependencies[key], label: key });
  49. });
  50. </script>
  51. <template>
  52. <div>
  53. <el-card class="mb-4 box-card" shadow="never">
  54. <span>
  55. vue-pure-admin 是一款开源免费且开箱即用的中后台管理系统模版。完全采用
  56. ECMAScript 模块(ESM)规范来编写和组织代码,使用了最新的
  57. Vue3、Vite、Element-Plus、TypeScript、Pinia、Tailwindcss
  58. 等主流技术开发。
  59. </span>
  60. </el-card>
  61. <el-card class="m-4 box-card" shadow="never">
  62. <template #header>
  63. <div class="card-header">
  64. <span class="font-medium">平台信息</span>
  65. </div>
  66. </template>
  67. <PureDescriptions border :columns="columns" :column="4" />
  68. </el-card>
  69. <el-card class="m-4 box-card" shadow="never">
  70. <template #header>
  71. <div class="card-header">
  72. <span class="font-medium">生产环境依赖</span>
  73. </div>
  74. </template>
  75. <el-descriptions border size="small" :column="6">
  76. <el-descriptions-item
  77. v-for="(item, index) in schema"
  78. :key="index"
  79. :label="item.label"
  80. :label-class-name="getMainLabel(item.label)"
  81. class-name="pure-version"
  82. label-align="right"
  83. >
  84. <a
  85. :href="'https://www.npmjs.com/package/' + item.label"
  86. target="_blank"
  87. >
  88. <span
  89. :class="getMainLabel(item.label)"
  90. style="color: var(--el-color-primary)"
  91. >
  92. {{ item.field }}
  93. </span>
  94. </a>
  95. </el-descriptions-item>
  96. </el-descriptions>
  97. </el-card>
  98. <el-card class="m-4 box-card" shadow="never">
  99. <template #header>
  100. <div class="card-header">
  101. <span class="font-medium">开发环境依赖</span>
  102. </div>
  103. </template>
  104. <el-descriptions border size="small" :column="5">
  105. <el-descriptions-item
  106. v-for="(item, index) in devSchema"
  107. :key="index"
  108. :label="item.label"
  109. :label-class-name="getMainLabel(item.label)"
  110. class-name="pure-version"
  111. label-align="right"
  112. >
  113. <a
  114. :href="'https://www.npmjs.com/package/' + item.label"
  115. target="_blank"
  116. >
  117. <span
  118. :class="getMainLabel(item.label)"
  119. style="color: var(--el-color-primary)"
  120. >
  121. {{ item.field }}
  122. </span>
  123. </a>
  124. </el-descriptions-item>
  125. </el-descriptions>
  126. </el-card>
  127. </div>
  128. </template>
  129. <style lang="scss" scoped>
  130. :deep(.main-label) {
  131. font-size: 16px !important;
  132. color: var(--el-color-danger) !important;
  133. }
  134. :deep(.pure-version) {
  135. font-size: 14px !important;
  136. font-weight: 600 !important;
  137. opacity: 0.6;
  138. &:hover {
  139. opacity: 1;
  140. }
  141. }
  142. .main-content {
  143. margin: 0 !important;
  144. }
  145. </style>