index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. <el-scrollbar>
  68. <PureDescriptions border :columns="columns" :column="4" />
  69. </el-scrollbar>
  70. </el-card>
  71. <el-card class="m-4 box-card" shadow="never">
  72. <template #header>
  73. <div class="card-header flex items-center">
  74. <span class="font-medium">生产环境依赖</span>
  75. <el-tag type="primary" effect="dark" size="small" round class="ml-1">
  76. {{ schema.length }}
  77. </el-tag>
  78. </div>
  79. </template>
  80. <el-scrollbar>
  81. <el-descriptions border size="small" :column="6">
  82. <el-descriptions-item
  83. v-for="(item, index) in schema"
  84. :key="index"
  85. :label="item.label"
  86. :label-class-name="getMainLabel(item.label)"
  87. class-name="pure-version"
  88. label-align="right"
  89. >
  90. <a
  91. :href="'https://www.npmjs.com/package/' + item.label"
  92. target="_blank"
  93. >
  94. <span
  95. :class="getMainLabel(item.label)"
  96. style="color: var(--el-color-primary)"
  97. >
  98. {{ item.field }}
  99. </span>
  100. </a>
  101. </el-descriptions-item>
  102. </el-descriptions>
  103. </el-scrollbar>
  104. </el-card>
  105. <el-card class="m-4 box-card" shadow="never">
  106. <template #header>
  107. <div class="card-header flex items-center">
  108. <span class="font-medium">开发环境依赖</span>
  109. <el-tag type="primary" effect="dark" size="small" round class="ml-1">
  110. {{ devSchema.length }}
  111. </el-tag>
  112. </div>
  113. </template>
  114. <el-scrollbar>
  115. <el-descriptions border size="small" :column="5">
  116. <el-descriptions-item
  117. v-for="(item, index) in devSchema"
  118. :key="index"
  119. :label="item.label"
  120. :label-class-name="getMainLabel(item.label)"
  121. class-name="pure-version"
  122. label-align="right"
  123. >
  124. <a
  125. :href="'https://www.npmjs.com/package/' + item.label"
  126. target="_blank"
  127. >
  128. <span
  129. :class="getMainLabel(item.label)"
  130. style="color: var(--el-color-primary)"
  131. >
  132. {{ item.field }}
  133. </span>
  134. </a>
  135. </el-descriptions-item>
  136. </el-descriptions>
  137. </el-scrollbar>
  138. </el-card>
  139. </div>
  140. </template>
  141. <style lang="scss" scoped>
  142. :deep(.main-label) {
  143. font-size: 16px !important;
  144. color: var(--el-color-danger) !important;
  145. }
  146. :deep(.pure-version) {
  147. font-size: 14px !important;
  148. font-weight: 600 !important;
  149. opacity: 0.6;
  150. &:hover {
  151. opacity: 1;
  152. }
  153. }
  154. .main-content {
  155. margin: 0 !important;
  156. }
  157. </style>