feat: 站点个性化设置

This commit is contained in:
xiaojunnuo
2024-10-05 01:46:25 +08:00
parent ce9a9862f1
commit 11a9fe9014
57 changed files with 710 additions and 763 deletions
@@ -2,11 +2,11 @@
<div class="d2-page-cover">
<div class="d2-page-cover__title" @click="$open('https://github.com/certd/certd')">
<div class="title-line">
<span>Certd v{{ version }}</span>
<span>{{ siteInfo.title }} v{{ version }}</span>
</div>
</div>
<p class="d2-page-cover__sub-title">让你的证书永不过期</p>
<div class="warnning">
<p class="d2-page-cover__sub-title">{{ siteInfo.slogan }}</p>
<div v-if="siteInfo.warningOff !== false" class="warning">
<a-alert type="warning" show-icon>
<template #description>
<div class="flex">
@@ -27,17 +27,14 @@
</div>
</div>
</template>
<script>
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "PageContent",
setup() {
const version = ref(import.meta.env.VITE_APP_VERSION);
<script lang="ts" setup>
import { computed, ref, Ref } from "vue";
import { SiteInfo, useSettingStore } from "/@/store/modules/settings";
return {
version
};
}
const version = ref(import.meta.env.VITE_APP_VERSION);
const settingStore = useSettingStore();
const siteInfo: Ref<SiteInfo> = computed(() => {
return settingStore.siteInfo;
});
</script>
<style lang="less" scoped>
@@ -1,31 +0,0 @@
export default {
crud: ` columns: {
date:{
title: '姓名', //字段名称
type: 'text', //字段类型,添加、修改、查询将自动生成相应表单组件
},
province: {
title: '城市',
type: 'dict-select', //选择框
form: { //表单组件自定义配置,此处配置选择框为多选
component: { //支持任何v-model组件
filterable: true, multiple: true, clearable: true
}
},
dict: dict({
data: [ //本地数据字典
{ value: 'sz', label: '深圳' },
{ value: 'gz', label: '广州' },
{ value: 'wh', label: '武汉' },
{ value: 'sh', label: '上海' }
]
})
},
status: {
title: '状态',
type: 'dict-select', //选择框,默认单选
dict: dict({ url: '/dicts/OpenStatusEnum' })//远程数据字典
},
}
`
};
Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

@@ -1,178 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="210mm"
viewBox="0 0 210 210"
version="1.1"
id="svg8"
inkscape:version="1.0.2-2 (e86c870879, 2021-01-15)"
sodipodi:docname="logo.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.45420139"
inkscape:cx="628.76623"
inkscape:cy="688.02672"
inkscape:document-units="mm"
inkscape:current-layer="svg8"
inkscape:document-rotation="0"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:snap-bbox="true"
inkscape:snap-nodes="false"
inkscape:snap-bbox-edge-midpoints="false"
inkscape:bbox-nodes="true"
inkscape:bbox-paths="false"
inkscape:snap-global="true"
showguides="true"
inkscape:guide-bbox="true">
<sodipodi:guide
position="-128.15534,201.26213"
orientation="1,0"
id="guide1012" />
<sodipodi:guide
position="333.7864,165.14563"
orientation="1,0"
id="guide1014" />
<sodipodi:guide
position="242.91262,73.689318"
orientation="1,0"
id="guide1016" />
<sodipodi:guide
position="105.83717,102.82499"
orientation="1,0"
id="guide1022" />
<sodipodi:guide
position="138.0814,102.82499"
orientation="0,-1"
id="guide1024" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1"
style="display:inline">
<path
style="fill:#002255;stroke:none;stroke-width:0.625348"
d="M 35.587501,69.766667 V 59.766664 h 70.000109 69.99991 v 10.000003 9.999997 H 105.58761 35.587501 Z"
id="path12" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2"
width="32.244232"
height="20"
x="71.506088"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-8"
width="32.244232"
height="20"
x="107.42467"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-5-8"
width="32.244232"
height="20"
x="143.34325"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-4"
width="32.244232"
height="20"
x="71.506088"
y="129.82079" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-8-3"
width="32.244232"
height="20"
x="107.42467"
y="129.82079" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-5-8-2"
width="32.244232"
height="20"
x="143.34325"
y="129.82079" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-7"
width="32.244232"
height="20"
x="35.587502"
y="106.64581" />
<rect
style="fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-4-0"
width="32.244232"
height="20"
x="35.587502"
y="129.82079" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-9"
width="32.244232"
height="20"
x="71.506088"
y="82.941666" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-8-37"
width="32.244232"
height="20"
x="107.42467"
y="82.941666" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-8-5-8-4"
width="32.244232"
height="20"
x="143.34325"
y="82.941666" />
<rect
style="display:inline;fill:#2a7fff;fill-rule:evenodd;stroke-width:0.214311"
id="rect22-2-7-1"
width="32.244232"
height="20"
x="35.587502"
y="82.941666" />
</g>
<polygon
points="75.3,174.4 103.1,103.6 79.8,103.6 112.6,41.3 156.4,41.3 129.9,90.5 148.1,90.5 "
fill="#f6cc00"
id="polygon276"
transform="matrix(1.0930933,0,0,0.99853202,-17.517362,-0.52287941)" />
</svg>

Before

Width:  |  Height:  |  Size: 5.1 KiB

@@ -1,136 +0,0 @@
<template>
<div class="d2-page-cover">
<div class="d2-page-cover__title">
<div class="title-line">
<img width="50" :src="envRef.LOGO" />
{{ envRef.TITLE }} v{{ version }}
</div>
</div>
<p class="d2-page-cover__sub-title">{{ envRef.SLOGAN }}</p>
<div class="exampleBox">
<div class="left">
<fs-highlight :code="helperRef.crud" lang="javascript" />
</div>
<div class="icon">
<fs-icon :icon="ui.icons.arrowRight" />
</div>
<div class="right">
<img style="border: 1px solid #eee" src="./image/crud.png" />
</div>
</div>
<div class="footer_box">
<div class="left"></div>
<div class="right">
<div>如果觉得好用请不要吝啬你的star哟</div>
<a href="https://gitee.com/fast-crud/fast-crud" target="_blank"><img src="https://gitee.com/fast-crud/fast-crud/badge/star.svg?theme=dark" alt="star" /></a>
<a href="https://github.com/fast-crud/fast-crud" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/fast-crud/fast-crud?logo=github" /></a>
</div>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";
import { useUi } from "@fast-crud/fast-crud";
import helper from "./helper";
import { env } from "../../../../utils/util.env";
export default defineComponent({
name: "PageCover",
setup() {
const version = ref(import.meta.env.VITE_APP_VERSION);
const helperRef = ref(helper);
const { ui } = useUi();
const envRef = ref(env);
return {
ui,
version,
helperRef,
envRef
};
}
});
</script>
<style lang="less" scoped>
.d2-page-cover {
.logo {
width: 40px;
height: 40px;
}
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: center;
.d2-page-cover__logo {
img {
width: 200px;
}
}
.d2-page-cover__title {
margin: 20px;
font-weight: bold;
display: -webkit-flex; /* Safari */
display: flex;
justify-content: flex-end;
.title-line {
display: flex;
align-items: center;
flex-direction: row;
justify-content: center;
cursor: pointer;
font-size: 20px;
}
}
.d2-page-cover__sub-title {
margin: 0px;
margin-bottom: 10px;
}
.d2-page-cover__build-time {
margin: 0px;
margin-bottom: 0px;
margin-top: 10px;
font-size: 12px;
}
.exampleBox {
display: flex;
align-items: center;
height: 390px;
width: 96%;
padding: 5px;
margin: auto;
justify-content: center;
.left {
height: 100%;
overflow-y: hidden;
border: 1px solid #aaa;
}
.icon {
padding: 10px;
font-size: 20px;
}
.right {
height: 100%;
img {
height: 100%;
}
}
.d2-highlight {
font-size: 8px;
}
}
.footer_box {
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
.right {
display: flex;
justify-items: center;
align-items: center;
& > * {
display: flex;
}
}
}
}
</style>
@@ -64,13 +64,9 @@
</a-input>
</a-col>
<a-col class="gutter-row" :span="8">
<a-button
class="getCaptcha"
tabindex="-1"
:disabled="smsSendBtnDisabled"
@click="sendSmsCode"
v-text="smsTime <= 0 ? '发送' : smsTime + ' s'"
></a-button>
<a-button class="getCaptcha" tabindex="-1" :disabled="smsSendBtnDisabled" @click="sendSmsCode">
{{ smsTime <= 0 ? "发送" : smsTime + " s" }}
</a-button>
</a-col>
</a-row>
</a-form-item>