Quellcode durchsuchen

feat: 版权信息添加备案号展示;

liujia vor 1 Monat
Ursprung
Commit
501bac9221

+ 1 - 0
components.d.ts

@@ -63,6 +63,7 @@ declare module 'vue' {
     BaseModal: typeof import('./src/components/baseModal/index.vue')['default']
     BasePagination: typeof import('./src/components/basePagination/index.vue')['default']
     BaseWeather: typeof import('./src/components/baseWeather/index.vue')['default']
+    Copyright: typeof import('./src/components/Copyright/index.vue')['default']
     ECharts: typeof import('./src/components/baseCard/components/e-charts/index.vue')['default']
     FurnitureIcon: typeof import('./src/components/furnitureIcon/index.vue')['default']
     FurnitureItem: typeof import('./src/components/furnitureItem/index.vue')['default']

BIN
src/assets/gongan.png


+ 79 - 0
src/components/Copyright/index.vue

@@ -0,0 +1,79 @@
+<template>
+  <div class="copyright">
+    <div :style="textStyle">
+      <span>© {{ displayYear }} {{ company }}</span>
+      <span v-if="version"> - v {{ version }}</span>
+
+      <span v-if="icpLink">
+        - <a :href="icpLink" target="_blank" rel="noopener noreferrer">{{ icpText }}</a>
+      </span>
+      <span v-else-if="icp"> - {{ icp }}</span>
+
+      <span v-if="showPolice">
+        -
+        <a :href="policeLink" target="_blank" rel="noopener noreferrer">
+          <i class="police-icon" /> {{ policeText }}
+        </a>
+      </span>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { computed } from 'vue'
+
+defineOptions({ name: 'CopyrightInfo' })
+
+const props = defineProps<{
+  company: string
+  year?: number
+  version?: string
+  icp?: string
+  icpLink?: string
+  icpText?: string
+  policeLink?: string
+  policeText?: string
+  fontWeight?: 'normal' | 'bold' | 'lighter'
+  fontStyle?: 'normal' | 'italic'
+  fontColor?: string
+}>()
+
+const displayYear = props.year || new Date().getFullYear()
+
+const showPolice = computed(() => !!(props.policeLink || props.policeText))
+
+const textStyle = computed(() => ({
+  fontWeight: props.fontWeight || 'normal',
+  fontStyle: props.fontStyle || 'normal',
+  color: props.fontColor || '#666',
+  display: 'flex',
+  alignItems: 'center',
+  justifyContent: 'center',
+}))
+</script>
+
+<style lang="less" scoped>
+.copyright {
+  text-align: center;
+  font-size: 14px;
+
+  a {
+    color: inherit;
+    text-decoration: none;
+
+    &:hover {
+      text-decoration: underline;
+    }
+  }
+
+  .police-icon {
+    display: inline-block;
+    width: 16px;
+    height: 16px;
+    margin-right: 4px;
+    background-image: url('/src/assets/gongan.png');
+    background-size: contain;
+    vertical-align: middle;
+  }
+}
+</style>

+ 8 - 2
src/layout/index.vue

@@ -52,8 +52,14 @@
       </a-layout-content>
       <a-layout-footer>
         <slot name="footer">
-          <span>合肥雷能信息技术有限公司 © 2025 All Rights Reserved.</span>
-          <span>&nbsp;&nbsp;&nbsp;&nbsp;版本号:{{ version }}</span>
+          <Copyright
+            company="合肥雷能信息技术有限公司"
+            :version="version"
+            icp="皖ICP备2024060056号-3"
+            icp-link="https://beian.miit.gov.cn"
+            icp-text="皖ICP备2024060056号-3"
+            font-color="#4774a7"
+          />
         </slot>
       </a-layout-footer>
     </a-layout>

+ 9 - 1
src/views/dashboard/index.vue

@@ -121,7 +121,15 @@
         </div>
       </div>
     </div>
-    <div class="dashboard-footer">合肥雷能信息技术有限公司 © 2025 All Rights Reserved.</div>
+    <div class="dashboard-footer">
+      <Copyright
+        company="合肥雷能信息技术有限公司"
+        icp="皖ICP备2024060056号-3"
+        icp-link="https://beian.miit.gov.cn"
+        icp-text="皖ICP备2024060056号-3"
+        font-color="#4774a7"
+      />
+    </div>
   </div>
 </template>