mirror of
https://github.com/certd/certd.git
synced 2026-05-15 04:27:31 +08:00
chore: suite
This commit is contained in:
@@ -23,9 +23,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
form.content = JSON.stringify({
|
||||
title: form.title
|
||||
});
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
@@ -23,9 +23,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
form.content = JSON.stringify({
|
||||
title: form.title
|
||||
});
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
@@ -134,7 +134,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
}
|
||||
},
|
||||
valueResolve: ({ form }) => {
|
||||
debugger;
|
||||
if (form.content) {
|
||||
form.content = JSON.stringify(form.content);
|
||||
}
|
||||
@@ -145,7 +144,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
"content.maxDomainCount": {
|
||||
title: "域名数量",
|
||||
type: "number",
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxDomainCount"],
|
||||
component: {
|
||||
@@ -158,13 +157,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: "个"
|
||||
}
|
||||
}
|
||||
},
|
||||
"content.maxPipelineCount": {
|
||||
title: "流水线数量",
|
||||
type: "number",
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxPipelineCount"],
|
||||
component: {
|
||||
@@ -177,13 +178,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: "条"
|
||||
}
|
||||
}
|
||||
},
|
||||
"content.maxDeployCount": {
|
||||
title: "部署次数",
|
||||
type: "number",
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxDeployCount"],
|
||||
component: {
|
||||
@@ -196,7 +199,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: "次"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -217,6 +222,22 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
width: 120
|
||||
}
|
||||
},
|
||||
isBootstrap: {
|
||||
title: "是否初始套餐",
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "是", value: true, color: "success" },
|
||||
{ label: "否", value: false, color: "gray" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
value: false
|
||||
},
|
||||
column: {
|
||||
width: 120
|
||||
}
|
||||
},
|
||||
durationPrices: {
|
||||
title: "时长及价格",
|
||||
type: "text",
|
||||
@@ -243,29 +264,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
}
|
||||
}
|
||||
},
|
||||
isBootstrap: {
|
||||
title: "是否初始套餐",
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "是", value: true, color: "success" },
|
||||
{ label: "否", value: false, color: "error" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
value: false
|
||||
},
|
||||
column: {
|
||||
width: 120
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
title: "上下架",
|
||||
type: "dict-radio",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ value: false, label: "上架" },
|
||||
{ value: true, label: "下架" }
|
||||
{ value: false, label: "上架", color: "green" },
|
||||
{ value: true, label: "下架", color: "gray" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="flex-o">
|
||||
<div class="flex-o price-input">
|
||||
<a-input-number v-if="edit" prefix="¥" :value="priceValue" :precision="2" class="ml-5" @update:value="onPriceChange"> </a-input-number>
|
||||
<span v-else>{{ priceLabel }}</span>
|
||||
<span v-else class="price-text">{{ priceLabel }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -33,3 +33,12 @@ const onPriceChange = (price: number) => {
|
||||
emit("update:modelValue", price * 100);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.price-input {
|
||||
.price-text {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="target" class="cd-suite-value">
|
||||
<a-tag :color="target.color">{{ target.label }}</a-tag>
|
||||
<a-tag :color="target.color" class="m-0">{{ target.label }}</a-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -9,10 +9,11 @@ import { computed } from "vue";
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: number;
|
||||
unit?: string;
|
||||
}>();
|
||||
|
||||
const target = computed(() => {
|
||||
if (!props.modelValue) {
|
||||
if (props.modelValue == null) {
|
||||
return {};
|
||||
}
|
||||
if (props.modelValue === -1) {
|
||||
@@ -24,13 +25,13 @@ const target = computed(() => {
|
||||
} else if (props.modelValue === 0) {
|
||||
return {
|
||||
value: 0,
|
||||
label: "-",
|
||||
label: "0" + (props.unit || ""),
|
||||
color: "red"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
value: props.modelValue,
|
||||
label: props.modelValue,
|
||||
label: props.modelValue + (props.unit || ""),
|
||||
color: "blue"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,9 +23,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
form.content = JSON.stringify({
|
||||
title: form.title
|
||||
});
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
@@ -23,9 +23,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
form.content = JSON.stringify({
|
||||
title: form.title
|
||||
});
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user