diff --git a/packages/ui/certd-client/src/style/common.less b/packages/ui/certd-client/src/style/common.less index ad1641a5..b14c3f45 100644 --- a/packages/ui/certd-client/src/style/common.less +++ b/packages/ui/certd-client/src/style/common.less @@ -96,6 +96,9 @@ h1, h2, h3, h4, h5, h6 { overflow-y: auto; } +.m-0{ + margin:0 +} .m-2{ margin:2px } diff --git a/packages/ui/certd-client/src/views/certd/cname/record/crud.tsx b/packages/ui/certd-client/src/views/certd/cname/record/crud.tsx index 798355b3..6a5cf89a 100644 --- a/packages/ui/certd-client/src/views/certd/cname/record/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/cname/record/crud.tsx @@ -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; }; diff --git a/packages/ui/certd-client/src/views/certd/history/crud.tsx b/packages/ui/certd-client/src/views/certd/history/crud.tsx index 837f6262..4c2fbb49 100644 --- a/packages/ui/certd-client/src/views/certd/history/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/history/crud.tsx @@ -22,9 +22,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; }; diff --git a/packages/ui/certd-client/src/views/certd/suite/api.ts b/packages/ui/certd-client/src/views/certd/suite/api.ts index e30340b1..f17408a1 100644 --- a/packages/ui/certd-client/src/views/certd/suite/api.ts +++ b/packages/ui/certd-client/src/views/certd/suite/api.ts @@ -17,7 +17,7 @@ export const durationDict = dict({ }); export type OrderModalOpenReq = { - productId: number; + product: any; duration: number; num?: number; }; @@ -41,6 +41,7 @@ export type TradeCreateReq = { productId: number; duration: number; num: number; + payType: string; }; export async function TradeCreate(form: TradeCreateReq) { diff --git a/packages/ui/certd-client/src/views/certd/suite/buy.vue b/packages/ui/certd-client/src/views/certd/suite/buy.vue index b013c863..756feeb9 100644 --- a/packages/ui/certd-client/src/views/certd/suite/buy.vue +++ b/packages/ui/certd-client/src/views/certd/suite/buy.vue @@ -6,10 +6,12 @@
- +
+ + @@ -17,14 +19,21 @@ import { ref } from "vue"; import * as api from "./api"; import ProductInfo from "/@/views/certd/suite/product-info.vue"; +import OrderModal from "/@/views/certd/suite/order-modal.vue"; const products = ref([]); -async function loadSuites() { +async function loadProducts() { products.value = await api.ProductList(); } -loadSuites(); +loadProducts(); +const orderModalRef = ref(null); +async function doOrder(req: any) { + await orderModalRef.value.open({ + ...req + }); +} diff --git a/packages/ui/certd-client/src/views/sys/cname/provider/crud.tsx b/packages/ui/certd-client/src/views/sys/cname/provider/crud.tsx index daa8c2db..7419bf8d 100644 --- a/packages/ui/certd-client/src/views/sys/cname/provider/crud.tsx +++ b/packages/ui/certd-client/src/views/sys/cname/provider/crud.tsx @@ -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; }; diff --git a/packages/ui/certd-client/src/views/sys/plugin/crud.tsx b/packages/ui/certd-client/src/views/sys/plugin/crud.tsx index 2ea16c9a..3d7d306e 100644 --- a/packages/ui/certd-client/src/views/sys/plugin/crud.tsx +++ b/packages/ui/certd-client/src/views/sys/plugin/crud.tsx @@ -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; }; diff --git a/packages/ui/certd-client/src/views/sys/suite/product/crud.tsx b/packages/ui/certd-client/src/views/sys/suite/product/crud.tsx index 6416ee04..d9ba0778 100644 --- a/packages/ui/certd-client/src/views/sys/suite/product/crud.tsx +++ b/packages/ui/certd-client/src/views/sys/suite/product/crud.tsx @@ -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: { diff --git a/packages/ui/certd-client/src/views/sys/suite/product/price-input.vue b/packages/ui/certd-client/src/views/sys/suite/product/price-input.vue index 2d8187d4..46b28ec2 100644 --- a/packages/ui/certd-client/src/views/sys/suite/product/price-input.vue +++ b/packages/ui/certd-client/src/views/sys/suite/product/price-input.vue @@ -1,7 +1,7 @@ @@ -33,3 +33,12 @@ const onPriceChange = (price: number) => { emit("update:modelValue", price * 100); }; + + diff --git a/packages/ui/certd-client/src/views/sys/suite/product/suite-value.vue b/packages/ui/certd-client/src/views/sys/suite/product/suite-value.vue index ffb5c701..57710ae1 100644 --- a/packages/ui/certd-client/src/views/sys/suite/product/suite-value.vue +++ b/packages/ui/certd-client/src/views/sys/suite/product/suite-value.vue @@ -1,6 +1,6 @@ @@ -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" }; } diff --git a/packages/ui/certd-client/src/views/sys/suite/trade/crud.tsx b/packages/ui/certd-client/src/views/sys/suite/trade/crud.tsx index daa8c2db..7419bf8d 100644 --- a/packages/ui/certd-client/src/views/sys/suite/trade/crud.tsx +++ b/packages/ui/certd-client/src/views/sys/suite/trade/crud.tsx @@ -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; }; diff --git a/packages/ui/certd-client/src/views/sys/suite/user-suite/crud.tsx b/packages/ui/certd-client/src/views/sys/suite/user-suite/crud.tsx index daa8c2db..7419bf8d 100644 --- a/packages/ui/certd-client/src/views/sys/suite/user-suite/crud.tsx +++ b/packages/ui/certd-client/src/views/sys/suite/user-suite/crud.tsx @@ -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; };