mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
perf: 支持ftp上传
This commit is contained in:
@@ -1,20 +1,13 @@
|
||||
<template>
|
||||
<div class="layout-vip isPlus">
|
||||
<div class="layout-vip isPlus" @click="openUpgrade">
|
||||
<contextHolder />
|
||||
<fs-icon icon="mingcute:vip-1-line"></fs-icon>
|
||||
<div class="text">
|
||||
<template v-if="userStore.isPlus">
|
||||
<a-tooltip>
|
||||
<template #title> 到期时间:{{ expireTime }} </template>
|
||||
<span @click="openUpgrade">{{ texts.plus }}</span>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-tooltip>
|
||||
<template #title> 升级专业版,享受更多VIP特权 </template>
|
||||
<span @click="openUpgrade"> {{ texts.free }} {{ expiredDays }} </span>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<fs-icon icon="mingcute:vip-1-line" :title="text.title" />
|
||||
|
||||
<div v-if="mode !== 'icon'" class="text">
|
||||
<a-tooltip>
|
||||
<template #title> {{ text.title }}</template>
|
||||
<span>{{ text.name }}</span>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -26,24 +19,53 @@ import { message, Modal } from "ant-design-vue";
|
||||
import * as api from "./api";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
|
||||
const props = defineProps<{
|
||||
mode?: "button" | "nav";
|
||||
}>();
|
||||
type Texts = {
|
||||
plus: string;
|
||||
free: string;
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
mode?: "button" | "nav" | "icon";
|
||||
}>(),
|
||||
{
|
||||
mode: "button"
|
||||
}
|
||||
);
|
||||
type Text = {
|
||||
name: string;
|
||||
title?: string;
|
||||
};
|
||||
const texts = computed<Texts>(() => {
|
||||
if (props.mode === "button") {
|
||||
return {
|
||||
plus: "专业版已开通",
|
||||
free: "此为专业版功能"
|
||||
};
|
||||
const text = computed<Text>(() => {
|
||||
const map = {
|
||||
isPlus: {
|
||||
button: {
|
||||
name: "专业版已开通",
|
||||
title: "到期时间:" + expireTime.value
|
||||
},
|
||||
icon: {
|
||||
name: "",
|
||||
title: "专业版已开通"
|
||||
},
|
||||
nav: {
|
||||
name: "专业版",
|
||||
title: "到期时间:" + expireTime.value
|
||||
}
|
||||
},
|
||||
free: {
|
||||
button: {
|
||||
name: "此为专业版功能",
|
||||
title: "升级专业版,享受更多VIP特权"
|
||||
},
|
||||
icon: {
|
||||
name: "",
|
||||
title: "此为专业版功能"
|
||||
},
|
||||
nav: {
|
||||
name: "免费版",
|
||||
title: "升级专业版,享受更多VIP特权"
|
||||
}
|
||||
}
|
||||
};
|
||||
if (userStore.isPlus) {
|
||||
return map.isPlus[props.mode];
|
||||
} else {
|
||||
return {
|
||||
plus: "专业版",
|
||||
free: "免费版"
|
||||
};
|
||||
return map.free[props.mode];
|
||||
}
|
||||
});
|
||||
|
||||
@@ -86,6 +108,7 @@ async function doActive() {
|
||||
const settingStore = useSettingStore();
|
||||
const computedSiteId = computed(() => settingStore.installInfo?.siteId);
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
|
||||
function openUpgrade() {
|
||||
const placeholder = "请输入激活码";
|
||||
modal.confirm({
|
||||
@@ -137,6 +160,7 @@ function openUpgrade() {
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
|
||||
&.isPlus {
|
||||
color: #c5913f;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<MenuFoldOutlined v-else />
|
||||
</div>
|
||||
<fs-menu class="header-menu" mode="horizontal" :expand-selected="false" :selectable="false" :menus="frameworkMenus" />
|
||||
<vip-button class="flex-center header-btn"></vip-button>
|
||||
<vip-button class="flex-center header-btn" mode="nav" />
|
||||
</div>
|
||||
<div class="header-right header-buttons">
|
||||
<!-- <button-->
|
||||
|
||||
@@ -16,7 +16,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any) {
|
||||
}
|
||||
};
|
||||
|
||||
function buildDefineFields(define: any) {
|
||||
function buildDefineFields(define: any, form: any) {
|
||||
const formWrapperRef = crudExpose.getFormWrapperRef();
|
||||
const columnsRef = toRef(formWrapperRef.formOptions, "columns");
|
||||
|
||||
@@ -32,7 +32,12 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any) {
|
||||
...value,
|
||||
key
|
||||
};
|
||||
columnsRef.value[key] = _.merge({ title: key }, defaultPluginConfig, field);
|
||||
const column = _.merge({ title: key }, defaultPluginConfig, field);
|
||||
if (column.value != null && _.get(form, key) == null) {
|
||||
//设置默认值
|
||||
_.set(form, key, column.value);
|
||||
}
|
||||
columnsRef.value[key] = column;
|
||||
console.log("form", columnsRef.value);
|
||||
});
|
||||
}
|
||||
@@ -55,13 +60,16 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any) {
|
||||
rules: [{ required: true, message: "请选择类型" }],
|
||||
valueChange: {
|
||||
immediate: true,
|
||||
async handle({ value, mode, form }) {
|
||||
async handle({ value, mode, form, immediate }) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
const define = await api.GetProviderDefine(value);
|
||||
console.log("define", define);
|
||||
buildDefineFields(define);
|
||||
if (!immediate) {
|
||||
form.access = {};
|
||||
}
|
||||
buildDefineFields(define, form);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+9
-1
@@ -25,6 +25,7 @@
|
||||
<template #title>
|
||||
<a-avatar :src="item.icon || '/images/plugin.png'" />
|
||||
<span class="title">{{ item.title }}</span>
|
||||
<vip-button v-if="item.needPlus" mode="icon" />
|
||||
</template>
|
||||
<template #description>
|
||||
<span :title="item.desc">{{ item.desc }}</span>
|
||||
@@ -81,6 +82,7 @@ import _ from "lodash-es";
|
||||
import { nanoid } from "nanoid";
|
||||
import { CopyOutlined } from "@ant-design/icons-vue";
|
||||
import { PluginGroups } from "/@/views/certd/pipeline/pipeline/type";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
|
||||
export default {
|
||||
name: "PiStepForm",
|
||||
@@ -98,6 +100,7 @@ export default {
|
||||
* @returns
|
||||
*/
|
||||
function useStepForm() {
|
||||
const useStore = useUserStore();
|
||||
const getPluginGroups: any = inject("getPluginGroups");
|
||||
const pluginGroups: PluginGroups = getPluginGroups();
|
||||
const mode: Ref = ref("add");
|
||||
@@ -117,6 +120,10 @@ export default {
|
||||
});
|
||||
|
||||
const stepTypeSelected = (item: any) => {
|
||||
if (item.needPlus && !useStore.isPlus) {
|
||||
message.warn("此插件需要开通专业版才能使用");
|
||||
throw new Error("此插件需要开通专业版才能使用");
|
||||
}
|
||||
currentStep.value.type = item.name;
|
||||
currentStep.value.title = item.title;
|
||||
console.log("currentStepTypeChanged:", currentStep.value);
|
||||
@@ -128,6 +135,7 @@ export default {
|
||||
message.warn("请先选择类型");
|
||||
return;
|
||||
}
|
||||
|
||||
// 给step的input设置默认值
|
||||
changeCurrentPlugin(currentStep.value);
|
||||
|
||||
@@ -347,7 +355,7 @@ export default {
|
||||
overflow-y: hidden;
|
||||
|
||||
.ant-card-meta-description {
|
||||
font-size: 10px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
height: 40px;
|
||||
color: #7f7f7f;
|
||||
|
||||
Reference in New Issue
Block a user