mirror of
https://github.com/certd/certd.git
synced 2026-05-17 05:37:30 +08:00
chore: code format
This commit is contained in:
@@ -9,7 +9,7 @@ export async function GetList(query: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export async function AddObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ export async function UpdateObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export async function DelObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export async function GetObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export async function GetDetail(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/detail",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export async function DeleteBatch(ids: any[]) {
|
||||
return await request({
|
||||
url: apiPrefix + "/deleteByIds",
|
||||
method: "post",
|
||||
data: { ids }
|
||||
data: { ids },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export async function SetDefault(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/setDefault",
|
||||
method: "post",
|
||||
data: { id }
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,6 +73,6 @@ export async function SetDisabled(id: any, disabled: boolean) {
|
||||
return await request({
|
||||
url: apiPrefix + "/setDisabled",
|
||||
method: "post",
|
||||
data: { id, disabled }
|
||||
data: { id, disabled },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,330 +7,316 @@ import DurationPriceValue from "/@/views/sys/suite/product/duration-price-value.
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const { t } = useI18n();
|
||||
const emit = context.emit;
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
const { t } = useI18n();
|
||||
const emit = context.emit;
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
table: {
|
||||
onRefreshed: () => {
|
||||
emit("refreshed");
|
||||
}
|
||||
},
|
||||
search: {
|
||||
show: false
|
||||
},
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest
|
||||
},
|
||||
pagination: {
|
||||
show: false,
|
||||
pageSize: 999999
|
||||
},
|
||||
rowHandle: {
|
||||
minWidth: 200,
|
||||
fixed: "right"
|
||||
},
|
||||
form: {
|
||||
group: {
|
||||
groups: {
|
||||
base: {
|
||||
header: t('certd.basicInfo'),
|
||||
columns: [
|
||||
t('certd.titlea'),
|
||||
t('certd.type'),
|
||||
t('certd.disabled'),
|
||||
t('certd.ordera'),
|
||||
t('certd.supportBuy'),
|
||||
t('certd.intro')
|
||||
]
|
||||
},
|
||||
content: {
|
||||
header: t('certd.packageContent'),
|
||||
columns: [
|
||||
t('certd.maxDomainCount'),
|
||||
t('certd.maxPipelineCount'),
|
||||
t('certd.maxDeployCount'),
|
||||
t('certd.maxMonitorCount')
|
||||
]
|
||||
},
|
||||
price: {
|
||||
header: t('certd.price'),
|
||||
columns: [
|
||||
t('certd.durationPrices')
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
columns: {
|
||||
// id: {
|
||||
// title: "ID",
|
||||
// key: "id",
|
||||
// type: "number",
|
||||
// column: {
|
||||
// width: 100
|
||||
// },
|
||||
// form: {
|
||||
// show: false
|
||||
// }
|
||||
// },
|
||||
title: {
|
||||
title: t('certd.packageName'),
|
||||
type: "text",
|
||||
search: {
|
||||
show: true
|
||||
},
|
||||
form: {
|
||||
rules: [{ required: true, message: t('certd.requiredField') }]
|
||||
},
|
||||
column: {
|
||||
width: 200
|
||||
}
|
||||
},
|
||||
type: {
|
||||
title: t('certd.type'),
|
||||
type: "dict-select",
|
||||
editForm: {
|
||||
component: {
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t('certd.suite'), value: "suite" },
|
||||
{ label: t('certd.addon'), value: "addon" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
value: "suite",
|
||||
rules: [{ required: true, message: t('certd.requiredField') }],
|
||||
helper: t('certd.typeHelper')
|
||||
},
|
||||
column: {
|
||||
width: 80,
|
||||
align: "center"
|
||||
},
|
||||
valueBuilder: ({ row }) => {
|
||||
if (row.content) {
|
||||
row.content = JSON.parse(row.content);
|
||||
}
|
||||
if (row.durationPrices) {
|
||||
row.durationPrices = JSON.parse(row.durationPrices);
|
||||
}
|
||||
},
|
||||
valueResolve: ({ form }) => {
|
||||
if (form.content) {
|
||||
form.content = JSON.stringify(form.content);
|
||||
}
|
||||
if (form.durationPrices) {
|
||||
form.durationPrices = JSON.stringify(form.durationPrices);
|
||||
}
|
||||
}
|
||||
},
|
||||
"content.maxDomainCount": {
|
||||
title: t('certd.domainCount'),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxDomainCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitCount')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.requiredField') }]
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitCount')
|
||||
}
|
||||
}
|
||||
},
|
||||
"content.maxPipelineCount": {
|
||||
title: t('certd.pipelineCount'),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxPipelineCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitPipeline')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.requiredField') }]
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitPipeline')
|
||||
}
|
||||
}
|
||||
},
|
||||
"content.maxDeployCount": {
|
||||
title: t('certd.deployCount'),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxDeployCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitDeploy')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.requiredField') }]
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitDeploy')
|
||||
}
|
||||
}
|
||||
},
|
||||
"content.maxMonitorCount": {
|
||||
title: t('certd.monitorCount'),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxMonitorCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitCount')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.requiredField') }]
|
||||
},
|
||||
column: {
|
||||
width: 120,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unitCount')
|
||||
}
|
||||
}
|
||||
},
|
||||
durationPrices: {
|
||||
title: t('certd.durationPriceTitle'),
|
||||
type: "text",
|
||||
form: {
|
||||
title: t('certd.selectDuration'),
|
||||
component: {
|
||||
name: PriceEdit,
|
||||
vModel: "modelValue",
|
||||
edit: true,
|
||||
style: {
|
||||
minHeight: "120px"
|
||||
}
|
||||
},
|
||||
col: {
|
||||
span: 24
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.requiredField') }]
|
||||
},
|
||||
column: {
|
||||
component: {
|
||||
name: DurationPriceValue,
|
||||
vModel: "modelValue"
|
||||
},
|
||||
width: 350
|
||||
}
|
||||
},
|
||||
supportBuy: {
|
||||
title: t('certd.supportBuy'),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t('certd.supportPurchase'), value: true, color: "success" },
|
||||
{ label: t('certd.cannotPurchase'), value: false, color: "gray" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
value: true
|
||||
},
|
||||
column: {
|
||||
width: 120
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
title: t('certd.shelfStatus'),
|
||||
type: "dict-radio",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ value: false, label: t('certd.onShelf'), color: "green" },
|
||||
{ value: true, label: t('certd.offShelf'), color: "gray" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
value: false
|
||||
},
|
||||
column: {
|
||||
width: 100
|
||||
}
|
||||
},
|
||||
order: {
|
||||
title: t('certd.ordera'),
|
||||
type: "number",
|
||||
form: {
|
||||
helper: t('certd.orderHelper'),
|
||||
value: 0
|
||||
},
|
||||
column: {
|
||||
width: 100
|
||||
}
|
||||
},
|
||||
intro: {
|
||||
title: t('certd.description'),
|
||||
type: "textarea",
|
||||
column: {
|
||||
width: 200
|
||||
}
|
||||
},
|
||||
createTime: {
|
||||
title: t('certd.createTime'),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
updateTime: {
|
||||
title: t('certd.updateTime'),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
show: true,
|
||||
width: 160
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return {
|
||||
crudOptions: {
|
||||
table: {
|
||||
onRefreshed: () => {
|
||||
emit("refreshed");
|
||||
},
|
||||
},
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
pagination: {
|
||||
show: false,
|
||||
pageSize: 999999,
|
||||
},
|
||||
rowHandle: {
|
||||
minWidth: 200,
|
||||
fixed: "right",
|
||||
},
|
||||
form: {
|
||||
group: {
|
||||
groups: {
|
||||
base: {
|
||||
header: t("certd.basicInfo"),
|
||||
columns: [t("certd.titlea"), t("certd.type"), t("certd.disabled"), t("certd.ordera"), t("certd.supportBuy"), t("certd.intro")],
|
||||
},
|
||||
content: {
|
||||
header: t("certd.packageContent"),
|
||||
columns: [t("certd.maxDomainCount"), t("certd.maxPipelineCount"), t("certd.maxDeployCount"), t("certd.maxMonitorCount")],
|
||||
},
|
||||
price: {
|
||||
header: t("certd.price"),
|
||||
columns: [t("certd.durationPrices")],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
columns: {
|
||||
// id: {
|
||||
// title: "ID",
|
||||
// key: "id",
|
||||
// type: "number",
|
||||
// column: {
|
||||
// width: 100
|
||||
// },
|
||||
// form: {
|
||||
// show: false
|
||||
// }
|
||||
// },
|
||||
title: {
|
||||
title: t("certd.packageName"),
|
||||
type: "text",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
type: {
|
||||
title: t("certd.type"),
|
||||
type: "dict-select",
|
||||
editForm: {
|
||||
component: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.suite"), value: "suite" },
|
||||
{ label: t("certd.addon"), value: "addon" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: "suite",
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
helper: t("certd.typeHelper"),
|
||||
},
|
||||
column: {
|
||||
width: 80,
|
||||
align: "center",
|
||||
},
|
||||
valueBuilder: ({ row }) => {
|
||||
if (row.content) {
|
||||
row.content = JSON.parse(row.content);
|
||||
}
|
||||
if (row.durationPrices) {
|
||||
row.durationPrices = JSON.parse(row.durationPrices);
|
||||
}
|
||||
},
|
||||
valueResolve: ({ form }) => {
|
||||
if (form.content) {
|
||||
form.content = JSON.stringify(form.content);
|
||||
}
|
||||
if (form.durationPrices) {
|
||||
form.durationPrices = JSON.stringify(form.durationPrices);
|
||||
}
|
||||
},
|
||||
},
|
||||
"content.maxDomainCount": {
|
||||
title: t("certd.domainCount"),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxDomainCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitCount"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitCount"),
|
||||
},
|
||||
},
|
||||
},
|
||||
"content.maxPipelineCount": {
|
||||
title: t("certd.pipelineCount"),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxPipelineCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitPipeline"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitPipeline"),
|
||||
},
|
||||
},
|
||||
},
|
||||
"content.maxDeployCount": {
|
||||
title: t("certd.deployCount"),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxDeployCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitDeploy"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitDeploy"),
|
||||
},
|
||||
},
|
||||
},
|
||||
"content.maxMonitorCount": {
|
||||
title: t("certd.monitorCount"),
|
||||
type: "text",
|
||||
form: {
|
||||
key: ["content", "maxMonitorCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitCount"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
width: 120,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unitCount"),
|
||||
},
|
||||
},
|
||||
},
|
||||
durationPrices: {
|
||||
title: t("certd.durationPriceTitle"),
|
||||
type: "text",
|
||||
form: {
|
||||
title: t("certd.selectDuration"),
|
||||
component: {
|
||||
name: PriceEdit,
|
||||
vModel: "modelValue",
|
||||
edit: true,
|
||||
style: {
|
||||
minHeight: "120px",
|
||||
},
|
||||
},
|
||||
col: {
|
||||
span: 24,
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.requiredField") }],
|
||||
},
|
||||
column: {
|
||||
component: {
|
||||
name: DurationPriceValue,
|
||||
vModel: "modelValue",
|
||||
},
|
||||
width: 350,
|
||||
},
|
||||
},
|
||||
supportBuy: {
|
||||
title: t("certd.supportBuy"),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.supportPurchase"), value: true, color: "success" },
|
||||
{ label: t("certd.cannotPurchase"), value: false, color: "gray" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: true,
|
||||
},
|
||||
column: {
|
||||
width: 120,
|
||||
},
|
||||
},
|
||||
disabled: {
|
||||
title: t("certd.shelfStatus"),
|
||||
type: "dict-radio",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ value: false, label: t("certd.onShelf"), color: "green" },
|
||||
{ value: true, label: t("certd.offShelf"), color: "gray" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
},
|
||||
},
|
||||
order: {
|
||||
title: t("certd.ordera"),
|
||||
type: "number",
|
||||
form: {
|
||||
helper: t("certd.orderHelper"),
|
||||
value: 0,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
},
|
||||
},
|
||||
intro: {
|
||||
title: t("certd.description"),
|
||||
type: "textarea",
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: t("certd.createTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
updateTime: {
|
||||
title: t("certd.updateTime"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
show: true,
|
||||
width: 160,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import PriceInput from "./price-input.vue";
|
||||
import { durationDict } from "../../../certd/suite/api";
|
||||
|
||||
defineOptions({
|
||||
name: "DurationPriceValue"
|
||||
name: "DurationPriceValue",
|
||||
});
|
||||
|
||||
const props = withDefaults(
|
||||
@@ -23,7 +23,7 @@ const props = withDefaults(
|
||||
{
|
||||
modelValue: () => {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { durationDict } from "/@/views/certd/suite/api";
|
||||
|
||||
defineOptions({
|
||||
name: "DurationValue"
|
||||
name: "DurationValue",
|
||||
});
|
||||
const props = defineProps<{
|
||||
modelValue: number;
|
||||
|
||||
@@ -27,7 +27,7 @@ const props = withDefaults(
|
||||
{
|
||||
modelValue: () => {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
@@ -41,14 +41,14 @@ function doEmit(value: PriceItem[]) {
|
||||
}
|
||||
|
||||
function isActive(item: any) {
|
||||
return props.modelValue.some((v) => v.duration === item.value);
|
||||
return props.modelValue.some(v => v.duration === item.value);
|
||||
}
|
||||
|
||||
function onDurationClicked(item: any) {
|
||||
const has = props.modelValue.some((v) => v.duration === item.value);
|
||||
const has = props.modelValue.some(v => v.duration === item.value);
|
||||
if (has) {
|
||||
// remove
|
||||
const newValue = props.modelValue.filter((v) => v.duration !== item.value);
|
||||
const newValue = props.modelValue.filter(v => v.duration !== item.value);
|
||||
doEmit(newValue);
|
||||
} else {
|
||||
// add
|
||||
@@ -72,7 +72,7 @@ function onDurationClicked(item: any) {
|
||||
.duration-item {
|
||||
border: 1px solid #eee;
|
||||
padding: 2px;
|
||||
width: 35px;
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
|
||||
|
||||
@@ -24,13 +24,13 @@ const target = computed(() => {
|
||||
return {
|
||||
value: -1,
|
||||
label: "无限制",
|
||||
color: "green"
|
||||
color: "green",
|
||||
};
|
||||
} else if (props.modelValue === 0) {
|
||||
return {
|
||||
value: 0,
|
||||
label: "0" + (props.unit || ""),
|
||||
color: "red"
|
||||
color: "red",
|
||||
};
|
||||
} else {
|
||||
let color = "blue";
|
||||
@@ -40,7 +40,7 @@ const target = computed(() => {
|
||||
return {
|
||||
value: props.modelValue,
|
||||
label: props.modelValue + (props.unit || ""),
|
||||
color: color
|
||||
color: color,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -49,23 +49,23 @@ import ProductManager from "/@/views/sys/suite/product/index.vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
defineOptions({
|
||||
name: "SettingsSuite"
|
||||
name: "SettingsSuite",
|
||||
});
|
||||
|
||||
const api = {
|
||||
async SuiteSettingGet() {
|
||||
return await request({
|
||||
url: "/sys/settings/suite/get",
|
||||
method: "post"
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
async SuiteSettingSave(data: any) {
|
||||
return await request({
|
||||
url: "/sys/settings/suite/save",
|
||||
method: "post",
|
||||
data
|
||||
data,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const formRef = ref<any>(null);
|
||||
@@ -93,7 +93,7 @@ const onClick = async () => {
|
||||
await loadSettings();
|
||||
await settingsStore.loadSysSettings();
|
||||
notification.success({
|
||||
message: "保存成功"
|
||||
message: "保存成功",
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { dict } from "@fast-crud/fast-crud";
|
||||
import { request } from "/@/api/service";
|
||||
|
||||
defineOptions({
|
||||
name: "SuiteDurationSelector"
|
||||
name: "SuiteDurationSelector",
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -22,13 +22,13 @@ const suiteDictRef = dict({
|
||||
async getData() {
|
||||
const res = await request({
|
||||
url: "/sys/suite/product/list",
|
||||
method: "post"
|
||||
method: "post",
|
||||
});
|
||||
const options: any = [
|
||||
{
|
||||
value: "",
|
||||
label: "不赠送"
|
||||
}
|
||||
label: "不赠送",
|
||||
},
|
||||
];
|
||||
res.forEach((item: any) => {
|
||||
const durationPrices = JSON.parse(item.durationPrices);
|
||||
@@ -39,13 +39,13 @@ const suiteDictRef = dict({
|
||||
value: value,
|
||||
target: {
|
||||
productId: item.id,
|
||||
duration: dp.duration
|
||||
}
|
||||
duration: dp.duration,
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
return options;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const selectedValue = ref();
|
||||
@@ -53,7 +53,7 @@ watch(
|
||||
() => {
|
||||
return props.modelValue;
|
||||
},
|
||||
(value) => {
|
||||
value => {
|
||||
if (value && value.productId && value.duration) {
|
||||
selectedValue.value = value.productId + "_" + value.duration;
|
||||
} else {
|
||||
@@ -61,7 +61,7 @@ watch(
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -75,14 +75,14 @@ const onSelectedChange = (value: any) => {
|
||||
const arr = value.value.split("_");
|
||||
emit("update:modelValue", {
|
||||
productId: parseInt(arr[0]),
|
||||
duration: parseInt(arr[1])
|
||||
duration: parseInt(arr[1]),
|
||||
});
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
refresh() {
|
||||
suiteDictRef.reloadDict();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export async function GetList(query: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function AddObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function UpdateObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export async function DelObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function GetObj(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export async function GetDetail(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/detail",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export async function DeleteBatch(ids: any[]) {
|
||||
return await request({
|
||||
url: apiPrefix + "/deleteByIds",
|
||||
method: "post",
|
||||
data: { ids }
|
||||
data: { ids },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export async function UpdatePaid(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/updatePaid",
|
||||
method: "post",
|
||||
data: { id }
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -70,6 +70,6 @@ export async function SyncStatus(id: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/syncStatus",
|
||||
method: "post",
|
||||
data: { id }
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export const sysUserSuiteApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query
|
||||
data: query,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ export const sysUserSuiteApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ export const sysUserSuiteApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ export const sysUserSuiteApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
|
||||
@@ -38,13 +38,13 @@ export const sysUserSuiteApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
async ListAll() {
|
||||
return await request({
|
||||
url: apiPrefix + "/all",
|
||||
method: "post"
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -52,14 +52,14 @@ export const sysUserSuiteApi = {
|
||||
return await request({
|
||||
url: "/sys/authority/user/getSimpleUserByIds",
|
||||
method: "post",
|
||||
data: { ids }
|
||||
data: { ids },
|
||||
});
|
||||
},
|
||||
async PresentSuite(form: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/presentSuite",
|
||||
method: "post",
|
||||
data: form
|
||||
data: form,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -8,397 +8,396 @@ import createCrudOptionsUser from "/@/views/sys/authority/user/crud";
|
||||
import UserSuiteStatus from "/@/views/certd/suite/mine/user-suite-status.vue";
|
||||
import SuiteDurationSelector from "../setting/suite-duration-selector.vue";
|
||||
import dayjs from "dayjs";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
import { useI18n } from "/src/locales";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const { t } = useI18n();
|
||||
const api = sysUserSuiteApi;
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async (req: EditReq) => {
|
||||
const { form, row } = req;
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async (req: DelReq) => {
|
||||
const { row } = req;
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
const { t } = useI18n();
|
||||
const api = sysUserSuiteApi;
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async (req: EditReq) => {
|
||||
const { form, row } = req;
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async (req: DelReq) => {
|
||||
const { row } = req;
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
|
||||
const addRequest = async (req: AddReq) => {
|
||||
const { form } = req;
|
||||
const res = await api.PresentSuite(form);
|
||||
return res;
|
||||
};
|
||||
const addRequest = async (req: AddReq) => {
|
||||
const { form } = req;
|
||||
const res = await api.PresentSuite(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const router = useRouter();
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest
|
||||
},
|
||||
form: {
|
||||
labelCol: {
|
||||
//固定label宽度
|
||||
span: null,
|
||||
style: {
|
||||
width: "100px"
|
||||
}
|
||||
},
|
||||
col: {
|
||||
span: 22
|
||||
},
|
||||
wrapper: {
|
||||
width: 600
|
||||
}
|
||||
},
|
||||
actionbar: {
|
||||
buttons: {
|
||||
add: { text: t('certd.gift_package') }
|
||||
}
|
||||
},
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
form: {
|
||||
labelCol: {
|
||||
//固定label宽度
|
||||
span: null,
|
||||
style: {
|
||||
width: "100px",
|
||||
},
|
||||
},
|
||||
col: {
|
||||
span: 22,
|
||||
},
|
||||
wrapper: {
|
||||
width: 600,
|
||||
},
|
||||
},
|
||||
actionbar: {
|
||||
buttons: {
|
||||
add: { text: t("certd.gift_package") },
|
||||
},
|
||||
},
|
||||
|
||||
toolbar: { show: false },
|
||||
rowHandle: {
|
||||
width: 200,
|
||||
fixed: "right",
|
||||
buttons: {
|
||||
view: { show: true },
|
||||
copy: { show: false },
|
||||
edit: { show: false },
|
||||
remove: { show: true }
|
||||
// continue:{
|
||||
// text:"续期",
|
||||
// type:"link",
|
||||
// click(){
|
||||
// console.log("续期");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
title: "ID",
|
||||
key: "id",
|
||||
type: "number",
|
||||
search: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
editable: {
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
title: {
|
||||
title: t('certd.package_name'),
|
||||
type: "text",
|
||||
search: {
|
||||
show: true
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
width: 200
|
||||
}
|
||||
},
|
||||
userId: {
|
||||
title: t('certd.usera'),
|
||||
type: "table-select",
|
||||
search: {
|
||||
show: true
|
||||
},
|
||||
dict: dict({
|
||||
async getNodesByValues(ids: number[]) {
|
||||
return await api.GetSimpleUserByIds(ids);
|
||||
},
|
||||
value: "id",
|
||||
label: "nickName"
|
||||
}),
|
||||
form: {
|
||||
component: {
|
||||
crossPage: true,
|
||||
multiple: false,
|
||||
select: {
|
||||
placeholder: t('certd.click_to_select')
|
||||
},
|
||||
createCrudOptions: createCrudOptionsUser
|
||||
// crudOptionsOverride: crudOptionsOverride
|
||||
}
|
||||
}
|
||||
},
|
||||
//赠送
|
||||
presentSuiteId: {
|
||||
title: t('certd.gift_package'),
|
||||
type: "dict-select",
|
||||
column: { show: false },
|
||||
addForm: {
|
||||
show: true,
|
||||
component: {
|
||||
name: SuiteDurationSelector,
|
||||
vModel: "modelValue"
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
validator: async (rule, value) => {
|
||||
if (value && value.productId) {
|
||||
return true;
|
||||
}
|
||||
throw new Error(t('certd.please_select_package'));
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
valueResolve({ form, value }) {
|
||||
if (value && value.productId) {
|
||||
form.productId = value.productId;
|
||||
form.duration = value.duration;
|
||||
}
|
||||
},
|
||||
form: { show: false }
|
||||
},
|
||||
productType: {
|
||||
title: t('certd.type'),
|
||||
type: "dict-select",
|
||||
editForm: {
|
||||
component: {
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t('certd.package'), value: "suite", color: "green" },
|
||||
{ label: t('certd.addon_package'), value: "addon", color: "blue" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
width: 80,
|
||||
align: "center"
|
||||
},
|
||||
valueBuilder: ({ row }) => {
|
||||
if (row.content) {
|
||||
row.content = JSON.parse(row.content);
|
||||
}
|
||||
},
|
||||
valueResolve: ({ form }) => {
|
||||
if (form.content) {
|
||||
form.content = JSON.stringify(form.content);
|
||||
}
|
||||
}
|
||||
},
|
||||
"content.maxDomainCount": {
|
||||
title: t('certd.domain_count'),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxDomainCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_count')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.field_required') }]
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_count')
|
||||
},
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
"content.maxPipelineCount": {
|
||||
title: t('certd.pipeline_count'),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxPipelineCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_item')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.field_required') }]
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_item')
|
||||
},
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
"content.maxDeployCount": {
|
||||
title: t('certd.deploy_count'),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxDeployCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_times')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.field_required') }]
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_times'),
|
||||
used: compute(({ row }) => {
|
||||
return row.deployCountUsed;
|
||||
})
|
||||
},
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
"content.maxMonitorCount": {
|
||||
title: t('certd.monitor_count'),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxMonitorCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_count')
|
||||
},
|
||||
rules: [{ required: true, message: t('certd.field_required') }]
|
||||
},
|
||||
column: {
|
||||
width: 120,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t('certd.unit_count')
|
||||
},
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
duration: {
|
||||
title: t('certd.duration'),
|
||||
type: "text",
|
||||
form: { show: false },
|
||||
column: {
|
||||
component: {
|
||||
name: DurationValue,
|
||||
vModel: "modelValue"
|
||||
},
|
||||
width: 100,
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
status: {
|
||||
title: t('certd.status'),
|
||||
type: "text",
|
||||
form: { show: false },
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
component: {
|
||||
name: UserSuiteStatus,
|
||||
userSuite: compute(({ row }) => {
|
||||
return row;
|
||||
})
|
||||
},
|
||||
conditionalRender: {
|
||||
match() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
activeTime: {
|
||||
title: t('certd.active_time'),
|
||||
type: "date",
|
||||
column: {
|
||||
width: 150
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
expiresTime: {
|
||||
title: t('certd.expires_time'),
|
||||
type: "date",
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
width: 150,
|
||||
component: {
|
||||
name: "expires-time-text",
|
||||
vModel: "value",
|
||||
mode: "tag",
|
||||
title: compute(({ value }) => {
|
||||
return dayjs(value).format("YYYY-MM-DD HH:mm:ss");
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
isPresent: {
|
||||
title: t('certd.is_present'),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t('certd.is_present_yes'), value: true, color: "success" },
|
||||
{ label: t('certd.is_present_no'), value: false, color: "blue" }
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
value: true,
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
createTime: {
|
||||
title: t('certd.create_time'),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center"
|
||||
}
|
||||
},
|
||||
updateTime: {
|
||||
title: t('certd.update_time'),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
column: {
|
||||
show: true,
|
||||
width: 160
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
toolbar: { show: false },
|
||||
rowHandle: {
|
||||
width: 200,
|
||||
fixed: "right",
|
||||
buttons: {
|
||||
view: { show: true },
|
||||
copy: { show: false },
|
||||
edit: { show: false },
|
||||
remove: { show: true },
|
||||
// continue:{
|
||||
// text:"续期",
|
||||
// type:"link",
|
||||
// click(){
|
||||
// console.log("续期");
|
||||
// }
|
||||
// }
|
||||
},
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
title: "ID",
|
||||
key: "id",
|
||||
type: "number",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
editable: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
title: {
|
||||
title: t("certd.package_name"),
|
||||
type: "text",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
userId: {
|
||||
title: t("certd.usera"),
|
||||
type: "table-select",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
dict: dict({
|
||||
async getNodesByValues(ids: number[]) {
|
||||
return await api.GetSimpleUserByIds(ids);
|
||||
},
|
||||
value: "id",
|
||||
label: "nickName",
|
||||
}),
|
||||
form: {
|
||||
component: {
|
||||
crossPage: true,
|
||||
multiple: false,
|
||||
select: {
|
||||
placeholder: t("certd.click_to_select"),
|
||||
},
|
||||
createCrudOptions: createCrudOptionsUser,
|
||||
// crudOptionsOverride: crudOptionsOverride
|
||||
},
|
||||
},
|
||||
},
|
||||
//赠送
|
||||
presentSuiteId: {
|
||||
title: t("certd.gift_package"),
|
||||
type: "dict-select",
|
||||
column: { show: false },
|
||||
addForm: {
|
||||
show: true,
|
||||
component: {
|
||||
name: SuiteDurationSelector,
|
||||
vModel: "modelValue",
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
validator: async (rule, value) => {
|
||||
if (value && value.productId) {
|
||||
return true;
|
||||
}
|
||||
throw new Error(t("certd.please_select_package"));
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
valueResolve({ form, value }) {
|
||||
if (value && value.productId) {
|
||||
form.productId = value.productId;
|
||||
form.duration = value.duration;
|
||||
}
|
||||
},
|
||||
form: { show: false },
|
||||
},
|
||||
productType: {
|
||||
title: t("certd.type"),
|
||||
type: "dict-select",
|
||||
editForm: {
|
||||
component: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.package"), value: "suite", color: "green" },
|
||||
{ label: t("certd.addon_package"), value: "addon", color: "blue" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 80,
|
||||
align: "center",
|
||||
},
|
||||
valueBuilder: ({ row }) => {
|
||||
if (row.content) {
|
||||
row.content = JSON.parse(row.content);
|
||||
}
|
||||
},
|
||||
valueResolve: ({ form }) => {
|
||||
if (form.content) {
|
||||
form.content = JSON.stringify(form.content);
|
||||
}
|
||||
},
|
||||
},
|
||||
"content.maxDomainCount": {
|
||||
title: t("certd.domain_count"),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxDomainCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_count"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.field_required") }],
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_count"),
|
||||
},
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
"content.maxPipelineCount": {
|
||||
title: t("certd.pipeline_count"),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxPipelineCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_item"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.field_required") }],
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_item"),
|
||||
},
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
"content.maxDeployCount": {
|
||||
title: t("certd.deploy_count"),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxDeployCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_times"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.field_required") }],
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_times"),
|
||||
used: compute(({ row }) => {
|
||||
return row.deployCountUsed;
|
||||
}),
|
||||
},
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
"content.maxMonitorCount": {
|
||||
title: t("certd.monitor_count"),
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
key: ["content", "maxMonitorCount"],
|
||||
component: {
|
||||
name: SuiteValueEdit,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_count"),
|
||||
},
|
||||
rules: [{ required: true, message: t("certd.field_required") }],
|
||||
},
|
||||
column: {
|
||||
width: 120,
|
||||
component: {
|
||||
name: SuiteValue,
|
||||
vModel: "modelValue",
|
||||
unit: t("certd.unit_count"),
|
||||
},
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
duration: {
|
||||
title: t("certd.duration"),
|
||||
type: "text",
|
||||
form: { show: false },
|
||||
column: {
|
||||
component: {
|
||||
name: DurationValue,
|
||||
vModel: "modelValue",
|
||||
},
|
||||
width: 100,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: t("certd.status"),
|
||||
type: "text",
|
||||
form: { show: false },
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
component: {
|
||||
name: UserSuiteStatus,
|
||||
userSuite: compute(({ row }) => {
|
||||
return row;
|
||||
}),
|
||||
},
|
||||
conditionalRender: {
|
||||
match() {
|
||||
return false;
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
activeTime: {
|
||||
title: t("certd.active_time"),
|
||||
type: "date",
|
||||
column: {
|
||||
width: 150,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
expiresTime: {
|
||||
title: t("certd.expires_time"),
|
||||
type: "date",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 150,
|
||||
component: {
|
||||
name: "expires-time-text",
|
||||
vModel: "value",
|
||||
mode: "tag",
|
||||
title: compute(({ value }) => {
|
||||
return dayjs(value).format("YYYY-MM-DD HH:mm:ss");
|
||||
}),
|
||||
},
|
||||
},
|
||||
},
|
||||
isPresent: {
|
||||
title: t("certd.is_present"),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.is_present_yes"), value: true, color: "success" },
|
||||
{ label: t("certd.is_present_no"), value: false, color: "blue" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: true,
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: t("certd.create_time"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
updateTime: {
|
||||
title: t("certd.update_time"),
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
show: true,
|
||||
width: 160,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user