perf: 用户创建证书流水线没有购买套餐或者超限时提前报错

This commit is contained in:
xiaojunnuo
2024-12-25 23:20:07 +08:00
parent f5ec9870fd
commit 472f06c2d1
13 changed files with 108 additions and 24 deletions
@@ -17,7 +17,7 @@
<div style="height: 400px">
<ProductManager @refreshed="onTableRefresh"></ProductManager>
</div>
<div class="helper">不建议设置免费套餐可以在下方配置注册赠送套餐</div>
<div class="helper">不建议设置免费套餐可以在下方配置注册赠送套餐或者在用户套餐管理中手动赠送套餐</div>
</a-form-item>
<a-form-item label="注册赠送套餐" name="registerGift">
@@ -139,17 +139,27 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
type: "dict-select",
column: { show: false },
addForm: {
show: true,
component: {
name: SuiteDurationSelector,
vModel: "modelValue"
},
rules: [{ required: true, message: "请选择套餐" }]
rules: [
{
validator: async (rule, value) => {
if (value && value.productId) {
return true;
}
throw new Error("请选择套餐");
}
}
]
},
valueResolve({ form, value }) {
if (value) {
const arr = value.splict("_");
form.productId = parseInt(arr[0]);
form.duration = parseInt(arr[1]);
debugger;
if (value && value.productId) {
form.productId = value.productId;
form.duration = value.duration;
}
},
form: { show: false }