mirror of https://github.com/certd/certd
Merge remote-tracking branch 'origin/v2-dev' into v2-dev
commit
cb989d7489
|
@ -12,6 +12,7 @@ import { utils } from "/@/utils";
|
||||||
import { cloneDeep, merge } from "lodash-es";
|
import { cloneDeep, merge } from "lodash-es";
|
||||||
import { useI18n } from "/src/locales";
|
import { useI18n } from "/src/locales";
|
||||||
export interface SettingState {
|
export interface SettingState {
|
||||||
|
skipReset?: boolean; // 注销登录时,不清空此store的状态
|
||||||
sysPublic?: SysPublicSetting;
|
sysPublic?: SysPublicSetting;
|
||||||
installInfo?: {
|
installInfo?: {
|
||||||
siteId: string;
|
siteId: string;
|
||||||
|
@ -64,6 +65,7 @@ const defaultSiteInfo: SiteInfo = {
|
||||||
export const useSettingStore = defineStore({
|
export const useSettingStore = defineStore({
|
||||||
id: "app.setting",
|
id: "app.setting",
|
||||||
state: (): SettingState => ({
|
state: (): SettingState => ({
|
||||||
|
skipReset: true,
|
||||||
plusInfo: {
|
plusInfo: {
|
||||||
isPlus: false,
|
isPlus: false,
|
||||||
vipType: "free",
|
vipType: "free",
|
||||||
|
|
|
@ -38,6 +38,9 @@ export function resetAllStores() {
|
||||||
}
|
}
|
||||||
const allStores = (pinia as any)._s;
|
const allStores = (pinia as any)._s;
|
||||||
for (const [_key, store] of allStores) {
|
for (const [_key, store] of allStores) {
|
||||||
|
if (store.skipReset) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
store.$reset();
|
store.$reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ export type SuiteValue = {
|
||||||
export type SuiteDetail = {
|
export type SuiteDetail = {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
suites?: any[];
|
suites?: any[];
|
||||||
|
suiteList?: any[];
|
||||||
|
addonList?: any[];
|
||||||
expiresTime?: number;
|
expiresTime?: number;
|
||||||
pipelineCount?: SuiteValue;
|
pipelineCount?: SuiteValue;
|
||||||
domainCount?: SuiteValue;
|
domainCount?: SuiteValue;
|
||||||
|
|
|
@ -3,7 +3,16 @@
|
||||||
<div class="flex-o flex-wrap">
|
<div class="flex-o flex-wrap">
|
||||||
<a-popover>
|
<a-popover>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div>
|
<div style="width: 300px">
|
||||||
|
<div v-if="detail.addonList.length > 0" class="flex flex-wrap">
|
||||||
|
<a-tag v-for="(item, index) of detail.addonList" :key="index" color="green" class="pointer flex-o m-1">
|
||||||
|
<span class="mr-5">
|
||||||
|
{{ item.title }}
|
||||||
|
</span>
|
||||||
|
<span>(<expires-time-text :value="item.expiresTime" />)</span>
|
||||||
|
</a-tag>
|
||||||
|
<a-divider class="m-5" />
|
||||||
|
</div>
|
||||||
<div class="flex-between mt-5">
|
<div class="flex-between mt-5">
|
||||||
<div class="flex-o"><fs-icon icon="ant-design:check-outlined" class="color-green mr-5" /> 流水线条数:</div>
|
<div class="flex-o"><fs-icon icon="ant-design:check-outlined" class="color-green mr-5" /> 流水线条数:</div>
|
||||||
<suite-value :model-value="detail.pipelineCount.max" :used="detail.pipelineCount.used" unit="条" />
|
<suite-value :model-value="detail.pipelineCount.max" :used="detail.pipelineCount.used" unit="条" />
|
||||||
|
@ -30,12 +39,13 @@
|
||||||
</template>
|
</template>
|
||||||
<div class="flex-o">
|
<div class="flex-o">
|
||||||
<fs-icon icon="ant-design:gift-outlined" class="color-green mr-5" />
|
<fs-icon icon="ant-design:gift-outlined" class="color-green mr-5" />
|
||||||
<a-tag v-for="(item, index) of detail.suites" :key="index" color="green" class="pointer flex-o">
|
<a-tag v-for="(item, index) of detail.suiteList" :key="index" color="green" class="pointer flex-o">
|
||||||
<span class="mr-5">
|
<span class="mr-5">
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</span>
|
</span>
|
||||||
<span>(<expires-time-text :value="item.expiresTime" />)</span>
|
<span>(<expires-time-text :value="item.expiresTime" />)</span>
|
||||||
</a-tag>
|
</a-tag>
|
||||||
|
<a-tag v-if="detail.addonList.length > 0" color="green" class="pointer flex-o">加量包+{{ detail.addonList.length }}</a-tag>
|
||||||
<div v-if="detail.suites?.length === 0" class="flex-o ml-5">暂无套餐 <a-button class="ml-5" type="primary" size="small" @click="goBuy">去购买</a-button></div>
|
<div v-if="detail.suites?.length === 0" class="flex-o ml-5">暂无套餐 <a-button class="ml-5" type="primary" size="small" @click="goBuy">去购买</a-button></div>
|
||||||
</div>
|
</div>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
|
@ -59,6 +69,10 @@ const detail = ref<SuiteDetail>({});
|
||||||
|
|
||||||
async function loadSuiteDetail() {
|
async function loadSuiteDetail() {
|
||||||
detail.value = await mySuiteApi.SuiteDetailGet();
|
detail.value = await mySuiteApi.SuiteDetailGet();
|
||||||
|
const suites = detail.value.suites.filter(item => item.productType === "suite");
|
||||||
|
const addons = detail.value.suites.filter(item => item.productType === "addon");
|
||||||
|
detail.value.suiteList = suites;
|
||||||
|
detail.value.addonList = addons;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadSuiteDetail();
|
loadSuiteDetail();
|
||||||
|
|
Loading…
Reference in New Issue