- 已选择 {{ selectedRowKeys.length }} 项
-
-
+ {{ t("certd.selectedCount", { count: selectedRowKeys.length }) }}
+
+
@@ -16,12 +16,13 @@
- 申请证书
+ {{ t("certd.applyCertificate") }}
+
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue
index 63320a85..ae0fd926 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue
+++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue
@@ -1,36 +1,37 @@
-
-
+
+
-
- 还没有配置邮件服务器?现在就去
-
-
+
+ 还没有配置邮件服务器?现在就去
+
+
+
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue
index ed97f8e0..0f57b080 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue
+++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue
@@ -1,70 +1,66 @@
-
-
-
-
-
-
-
-
+
+
+
+ {{ t("certd.editTrigger") }}
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
- 确定
-
-
-
-
-
+
+
+
+
+
+ 确定
+
+
+
+
+
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/crud.tsx
index f9fcf072..36aa6ed3 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/crud.tsx
+++ b/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/crud.tsx
@@ -1,137 +1,139 @@
import * as api from "./api";
import { Ref, ref } from "vue";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
+import { useI18n } from "vue-i18n";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const pageRequest = async (query: UserPageQuery): Promise
=> {
- 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 pageRequest = async (query: UserPageQuery): Promise => {
+ 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;
+ };
- const selectedRowKeys: Ref = ref([]);
- context.selectedRowKeys = selectedRowKeys;
+ const selectedRowKeys: Ref = ref([]);
+ context.selectedRowKeys = selectedRowKeys;
- return {
- crudOptions: {
- settings: {
- plugins: {
- //这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
- rowSelection: {
- enabled: true,
- order: -2,
- before: true,
- // handle: (pluginProps,useCrudProps)=>CrudOptions,
- props: {
- multiple: true,
- crossPage: true,
- selectedRowKeys,
- },
- },
- },
- },
- request: {
- pageRequest,
- addRequest,
- editRequest,
- delRequest,
- },
- // tabs: {
- // name: "status",
- // show: true,
- // },
- rowHandle: {
- minWidth: 200,
- fixed: "right",
- },
- columns: {
- id: {
- title: "ID",
- key: "id",
- type: "number",
- column: {
- width: 80,
- },
- form: {
- show: false,
- },
- },
- domain: {
- title: "托管的子域名",
- type: "text",
- search: {
- show: true,
- },
- form: {
- helper: {
- render() {
- return (
-
- );
- },
- },
- },
- editForm: {
- component: {
- disabled: true,
- },
- },
- },
- disabled: {
- title: "是否禁用",
- type: "dict-switch",
- dict: dict({
- data: [
- { value: false, label: "启用", color: "green" },
- { value: true, label: "禁用", color: "gray" },
- ],
- }),
- search: {
- show: true,
- },
- form: {
- value: false,
- },
- },
- createTime: {
- title: "创建时间",
- type: "datetime",
- form: {
- show: false,
- },
- column: {
- sorter: true,
- width: 160,
- align: "center",
- },
- },
- updateTime: {
- title: "更新时间",
- type: "datetime",
- form: {
- show: false,
- },
- column: {
- show: true,
- },
- },
- },
- },
- };
+ return {
+ crudOptions: {
+ settings: {
+ plugins: {
+ //这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
+ rowSelection: {
+ enabled: true,
+ order: -2,
+ before: true,
+ // handle: (pluginProps,useCrudProps)=>CrudOptions,
+ props: {
+ multiple: true,
+ crossPage: true,
+ selectedRowKeys,
+ },
+ },
+ },
+ },
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest,
+ },
+ // tabs: {
+ // name: "status",
+ // show: true,
+ // },
+ rowHandle: {
+ minWidth: 200,
+ fixed: "right",
+ },
+ columns: {
+ id: {
+ title: "ID",
+ key: "id",
+ type: "number",
+ column: {
+ width: 80,
+ },
+ form: {
+ show: false,
+ },
+ },
+ domain: {
+ title: t('certd.subdomainHosted'),
+ type: "text",
+ search: {
+ show: true,
+ },
+ form: {
+ helper: {
+ render() {
+ return (
+
+ );
+ },
+ },
+ },
+ editForm: {
+ component: {
+ disabled: true,
+ },
+ },
+ },
+ disabled: {
+ title: t('certd.isDisabled'),
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { value: false, label: t('certd.enabled'), color: "green" },
+ { value: true, label: t('certd.disabled'), color: "gray" },
+ ],
+ }),
+ search: {
+ show: true,
+ },
+ form: {
+ value: false,
+ },
+ },
+ 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,
+ },
+ },
+ },
+ },
+ };
}
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/index.vue
index d7eeb7a9..bd2cf6ed 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/index.vue
+++ b/packages/ui/certd-client/src/views/certd/pipeline/sub-domain/index.vue
@@ -1,19 +1,19 @@
-
-
-
- 子域名托管
- 当你的域名设置了子域名托管,需要在此处创建记录,否则申请证书将失败
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ t('certd.subdomainHosting') }}
+ {{ t('certd.subdomainHostingHint') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/ui/certd-client/src/views/certd/suite/mine/crud.tsx b/packages/ui/certd-client/src/views/certd/suite/mine/crud.tsx
index a2948e00..295ff2fc 100644
--- a/packages/ui/certd-client/src/views/certd/suite/mine/crud.tsx
+++ b/packages/ui/certd-client/src/views/certd/suite/mine/crud.tsx
@@ -7,310 +7,310 @@ import DurationValue from "/@/views/sys/suite/product/duration-value.vue";
import UserSuiteStatus from "/@/views/certd/suite/mine/user-suite-status.vue";
import dayjs from "dayjs";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const pageRequest = async (query: UserPageQuery): Promise => {
- 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 pageRequest = async (query: UserPageQuery): Promise => {
+ 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.AddObj(form);
- return res;
- };
+ const addRequest = async (req: AddReq) => {
+ const { form } = req;
+ const res = await api.AddObj(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: { show: false },
- buy: {
- text: "购买",
- type: "primary",
- click() {
- router.push({
- path: "/certd/suite/buy"
- });
- }
- }
- }
- },
- rowHandle: {
- width: 200,
- fixed: "right",
- buttons: {
- view: { show: false },
- copy: { show: false },
- edit: { show: false },
- remove: { show: false }
- // 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: "套餐名称",
- type: "text",
- search: {
- show: true
- },
- form: {
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 200
- }
- },
- productType: {
- title: "类型",
- type: "dict-select",
- editForm: {
- component: {
- disabled: true
- }
- },
- dict: dict({
- data: [
- { label: "套餐", value: "suite", color: "green" },
- { label: "加量包", value: "addon", color: "blue" }
- ]
- }),
- form: {
- rules: [{ required: true, message: "此项必填" }]
- },
- 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: "域名数量",
- type: "text",
- form: {
- key: ["content", "maxDomainCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "个"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "个"
- },
- align: "center"
- }
- },
- "content.maxPipelineCount": {
- title: "流水线数量",
- type: "text",
- form: {
- key: ["content", "maxPipelineCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "条"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "条"
- },
- align: "center"
- }
- },
- "content.maxDeployCount": {
- title: "部署次数",
- type: "text",
- form: {
- key: ["content", "maxDeployCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "次"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "次",
- used: compute(({ row }) => {
- return row.deployCountUsed;
- })
- },
- align: "center"
- }
- },
- "content.maxMonitorCount": {
- title: "证书监控数量",
- type: "text",
- form: {
- key: ["content", "maxMonitorCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "个"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 120,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "个"
- },
- align: "center"
- }
- },
- duration: {
- title: "时长",
- type: "text",
- form: {},
- column: {
- component: {
- name: DurationValue,
- vModel: "modelValue"
- },
- width: 100,
- align: "center"
- }
- },
- status: {
- title: "状态",
- type: "text",
- form: { show: false },
- column: {
- width: 100,
- align: "center",
- component: {
- name: UserSuiteStatus,
- userSuite: compute(({ row }) => {
- return row;
- }),
- currentSuite: context.currentSuite
- },
- conditionalRender: {
- match() {
- return false;
- }
- }
- }
- },
- activeTime: {
- title: "激活时间",
- type: "date",
- column: {
- width: 150
- }
- },
- expiresTime: {
- title: "过期时间",
- type: "date",
- 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: "是否赠送",
- type: "dict-switch",
- dict: dict({
- data: [
- { label: "是", value: true, color: "success" },
- { label: "否", value: false, color: "blue" }
- ]
- }),
- form: {
- value: true
- },
- column: {
- width: 100,
- align: "center"
- }
- }
- }
- }
- };
+ return {
+ crudOptions: {
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest
+ },
+ form: {
+ labelCol: {
+ //固定label宽度
+ span: null,
+ style: {
+ width: "100px"
+ }
+ },
+ col: {
+ span: 22
+ },
+ wrapper: {
+ width: 600
+ }
+ },
+ actionbar: {
+ buttons: {
+ add: { show: false },
+ buy: {
+ text: "购买",
+ type: "primary",
+ click() {
+ router.push({
+ path: "/certd/suite/buy"
+ });
+ }
+ }
+ }
+ },
+ rowHandle: {
+ width: 200,
+ fixed: "right",
+ buttons: {
+ view: { show: false },
+ copy: { show: false },
+ edit: { show: false },
+ remove: { show: false }
+ // 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: "套餐名称",
+ type: "text",
+ search: {
+ show: true
+ },
+ form: {
+ rules: [{ required: true, message: "此项必填" }]
+ },
+ column: {
+ width: 200
+ }
+ },
+ productType: {
+ title: "类型",
+ type: "dict-select",
+ editForm: {
+ component: {
+ disabled: true
+ }
+ },
+ dict: dict({
+ data: [
+ { label: "套餐", value: "suite", color: "green" },
+ { label: "加量包", value: "addon", color: "blue" }
+ ]
+ }),
+ form: {
+ rules: [{ required: true, message: "此项必填" }]
+ },
+ 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: "域名数量",
+ type: "text",
+ form: {
+ key: ["content", "maxDomainCount"],
+ component: {
+ name: SuiteValueEdit,
+ vModel: "modelValue",
+ unit: "个"
+ },
+ rules: [{ required: true, message: "此项必填" }]
+ },
+ column: {
+ width: 100,
+ component: {
+ name: SuiteValue,
+ vModel: "modelValue",
+ unit: "个"
+ },
+ align: "center"
+ }
+ },
+ "content.maxPipelineCount": {
+ title: "流水线数量",
+ type: "text",
+ form: {
+ key: ["content", "maxPipelineCount"],
+ component: {
+ name: SuiteValueEdit,
+ vModel: "modelValue",
+ unit: "条"
+ },
+ rules: [{ required: true, message: "此项必填" }]
+ },
+ column: {
+ width: 100,
+ component: {
+ name: SuiteValue,
+ vModel: "modelValue",
+ unit: "条"
+ },
+ align: "center"
+ }
+ },
+ "content.maxDeployCount": {
+ title: "部署次数",
+ type: "text",
+ form: {
+ key: ["content", "maxDeployCount"],
+ component: {
+ name: SuiteValueEdit,
+ vModel: "modelValue",
+ unit: "次"
+ },
+ rules: [{ required: true, message: "此项必填" }]
+ },
+ column: {
+ width: 100,
+ component: {
+ name: SuiteValue,
+ vModel: "modelValue",
+ unit: "次",
+ used: compute(({ row }) => {
+ return row.deployCountUsed;
+ })
+ },
+ align: "center"
+ }
+ },
+ "content.maxMonitorCount": {
+ title: "证书监控数量",
+ type: "text",
+ form: {
+ key: ["content", "maxMonitorCount"],
+ component: {
+ name: SuiteValueEdit,
+ vModel: "modelValue",
+ unit: "个"
+ },
+ rules: [{ required: true, message: "此项必填" }]
+ },
+ column: {
+ width: 120,
+ component: {
+ name: SuiteValue,
+ vModel: "modelValue",
+ unit: "个"
+ },
+ align: "center"
+ }
+ },
+ duration: {
+ title: "时长",
+ type: "text",
+ form: {},
+ column: {
+ component: {
+ name: DurationValue,
+ vModel: "modelValue"
+ },
+ width: 100,
+ align: "center"
+ }
+ },
+ status: {
+ title: "状态",
+ type: "text",
+ form: { show: false },
+ column: {
+ width: 100,
+ align: "center",
+ component: {
+ name: UserSuiteStatus,
+ userSuite: compute(({ row }) => {
+ return row;
+ }),
+ currentSuite: context.currentSuite
+ },
+ conditionalRender: {
+ match() {
+ return false;
+ }
+ }
+ }
+ },
+ activeTime: {
+ title: "激活时间",
+ type: "date",
+ column: {
+ width: 150
+ }
+ },
+ expiresTime: {
+ title: "过期时间",
+ type: "date",
+ 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: "是否赠送",
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { label: "是", value: true, color: "success" },
+ { label: "否", value: false, color: "blue" }
+ ]
+ }),
+ form: {
+ value: true
+ },
+ column: {
+ width: 100,
+ align: "center"
+ }
+ }
+ }
+ }
+ };
}
diff --git a/packages/ui/certd-client/src/views/certd/suite/order-modal.vue b/packages/ui/certd-client/src/views/certd/suite/order-modal.vue
index 42ca0c78..98fd7d4a 100644
--- a/packages/ui/certd-client/src/views/certd/suite/order-modal.vue
+++ b/packages/ui/certd-client/src/views/certd/suite/order-modal.vue
@@ -1,32 +1,46 @@
-
+
-
套餐:{{ product.title }}
-
说明:{{ product.intro }}
- 规格:
+ {{$t('order.package')}}:{{ product.title }}
+
+
+ {{$t('order.description')}}:{{ product.intro }}
+
+
+ {{$t('order.specifications')}}:
- 流水线;
- 域名;
- 部署次数;
+
+ {{$t('order.pipeline')}};
+
+
+ {{$t('order.domain')}};
+
+
+ {{$t('order.deployTimes')}};
+
- 时长:
+ {{$t('order.duration')}}:
-
+
+
{{$t('order.price')}}:
+
+
-
支付方式:
-
免费
+
{{$t('order.paymentMethod')}}:
+
{{$t('order.free')}}
+
diff --git a/packages/ui/certd-client/src/views/sys/authority/permission/crud.tsx b/packages/ui/certd-client/src/views/sys/authority/permission/crud.tsx
index 58cebc70..e6ae5127 100644
--- a/packages/ui/certd-client/src/views/sys/authority/permission/crud.tsx
+++ b/packages/ui/certd-client/src/views/sys/authority/permission/crud.tsx
@@ -1,150 +1,152 @@
import * as api from "./api.js";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
+import { useI18n } from "vue-i18n";
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const pageRequest = async (query: UserPageQuery): Promise => {
- const list = await api.GetTree();
+ const { t } = useI18n();
+ const pageRequest = async (query: UserPageQuery): Promise => {
+ const list = await api.GetTree();
- return {
- offset: 0,
- records: list,
- total: 10000,
- limit: 10000
- };
- };
+ return {
+ offset: 0,
+ records: list,
+ total: 10000,
+ limit: 10000
+ };
+ };
- async function afterChange() {
- await permissionTreeDict.reloadDict();
- }
- const editRequest = async ({ form, row }: EditReq) => {
- form.id = row.id;
- const ret = await api.UpdateObj(form);
- await afterChange();
- return ret;
- };
- const delRequest = async ({ row }: DelReq) => {
- const ret = await api.DelObj(row.id);
- await afterChange();
- return ret;
- };
+ async function afterChange() {
+ await permissionTreeDict.reloadDict();
+ }
+ const editRequest = async ({ form, row }: EditReq) => {
+ form.id = row.id;
+ const ret = await api.UpdateObj(form);
+ await afterChange();
+ return ret;
+ };
+ const delRequest = async ({ row }: DelReq) => {
+ const ret = await api.DelObj(row.id);
+ await afterChange();
+ return ret;
+ };
- const addRequest = async ({ form }: AddReq) => {
- const ret = await api.AddObj(form);
- await afterChange();
- return ret;
- };
- const permissionTreeDict = dict({
- url: "/sys/authority/permission/tree",
- isTree: true,
- value: "id",
- label: "title",
- async onReady({ dict }: any) {
- dict.setData([{ id: -1, title: "根节点", children: dict.data }]);
- }
- });
- return {
- crudOptions: {
- request: {
- pageRequest,
- addRequest,
- editRequest,
- delRequest
- },
- actionbar: {
- show: false
- },
- toolbar: {
- show: false
- },
- table: {
- show: false
- // scroll: { fixed: true }
- },
- rowHandle: {
- fixed: "right"
- },
- search: {
- show: false
- },
- pagination: {
- show: false,
- pageSize: 100000
- },
- columns: {
- id: {
- title: "id",
- type: "number",
- form: { show: false }, // 表单配置
- column: {
- width: 120,
- sortable: "custom"
- }
- },
- title: {
- title: "权限名称",
- type: "text",
- form: {
- rules: [
- { required: true, message: "请输入权限名称" },
- { max: 50, message: "最大50个字符" }
- ],
- component: {
- placeholder: "权限名称"
- }
- },
- column: {
- width: 200
- }
- },
+ const addRequest = async ({ form }: AddReq) => {
+ const ret = await api.AddObj(form);
+ await afterChange();
+ return ret;
+ };
+ const permissionTreeDict = dict({
+ url: "/sys/authority/permission/tree",
+ isTree: true,
+ value: "id",
+ label: "title",
+ async onReady({ dict }: any) {
+ dict.setData([{ id: -1, title: t("certd.rootNode"), children: dict.data }]);
+ }
+ });
+ return {
+ crudOptions: {
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest
+ },
+ actionbar: {
+ show: false
+ },
+ toolbar: {
+ show: false
+ },
+ table: {
+ show: false
+ // scroll: { fixed: true }
+ },
+ rowHandle: {
+ fixed: "right"
+ },
+ search: {
+ show: false
+ },
+ pagination: {
+ show: false,
+ pageSize: 100000
+ },
+ columns: {
+ id: {
+ title: "id",
+ type: "number",
+ form: { show: false }, // 表单配置
+ column: {
+ width: 120,
+ sortable: "custom"
+ }
+ },
+ title: {
+ title: t("certd.permissionName"),
+ type: "text",
+ form: {
+ rules: [
+ { required: true, message: t("certd.enterPermissionName") },
+ { max: 50, message: t("certd.max50Chars") }
+ ],
+ component: {
+ placeholder: t("certd.permissionName")
+ }
+ },
+ column: {
+ width: 200
+ }
+ },
+ permission: {
+ title: t("certd.permissionCode"),
+ type: "text",
+ column: {
+ width: 170
+ },
+ form: {
+ rules: [
+ { required: true, message: t("certd.enterPermissionCode") },
+ { max: 100, message: t("certd.max100Chars") }
+ ],
+ component: {
+ placeholder: t("certd.examplePermissionCode")
+ }
+ }
+ },
+ sort: {
+ title: t("certd.sortOrder"),
+ type: "number",
+ column: {
+ width: 100
+ },
+ form: {
+ value: 100,
+ rules: [{ required: true, type: "number", message: t("certd.sortRequired") }]
+ }
+ },
+ parentId: {
+ title: t("certd.parentNode"),
+ type: "dict-tree",
+ column: {
+ width: 100
+ },
+ dict: permissionTreeDict,
+ form: {
+ value: -1,
+ component: {
+ multiple: false,
+ defaultExpandAll: true,
+ dict: { cache: false },
+ fieldNames: {
+ value: "id",
+ label: "title"
+ }
+ }
+ }
+ }
- permission: {
- title: "权限代码",
- type: "text",
- column: {
- width: 170
- },
- form: {
- rules: [
- { required: true, message: "请输入权限代码" },
- { max: 100, message: "最大100个字符" }
- ],
- component: {
- placeholder: "例如:sys:user:view"
- }
- }
- },
- sort: {
- title: "排序",
- type: "number",
- column: {
- width: 100
- },
- form: {
- value: 100,
- rules: [{ required: true, type: "number", message: "排序号必填" }]
- }
- },
- parentId: {
- title: "父节点",
- type: "dict-tree",
- column: {
- width: 100
- },
- dict: permissionTreeDict,
- form: {
- value: -1,
- component: {
- multiple: false,
- defaultExpandAll: true,
- dict: { cache: false },
- fieldNames: {
- value: "id",
- label: "title"
- }
- }
- }
- }
- }
- }
- };
+ }
+ }
+ };
}
diff --git a/packages/ui/certd-client/src/views/sys/authority/permission/fs-permission-tree.vue b/packages/ui/certd-client/src/views/sys/authority/permission/fs-permission-tree.vue
index d7c34d8d..207319bf 100644
--- a/packages/ui/certd-client/src/views/sys/authority/permission/fs-permission-tree.vue
+++ b/packages/ui/certd-client/src/views/sys/authority/permission/fs-permission-tree.vue
@@ -1,193 +1,194 @@
-
-
-
-
{{ scope.title }}
-
-
-
-
-
-
-
-
+
+
+
+
{{ scope.title }}
+
+
+
+
+
+
+
+
diff --git a/packages/ui/certd-client/src/views/sys/authority/permission/index.vue b/packages/ui/certd-client/src/views/sys/authority/permission/index.vue
index 9e07ade2..1d5be571 100644
--- a/packages/ui/certd-client/src/views/sys/authority/permission/index.vue
+++ b/packages/ui/certd-client/src/views/sys/authority/permission/index.vue
@@ -1,76 +1,81 @@
-
-
- 权限管理
-
-
-
-
- 添加
-
-
-
-
+
+
+ {{ t("certd.permissionManagement") }}
+
+
+
+
+ {{ t("certd.adda") }}
+
+
+
+
+
diff --git a/packages/ui/certd-client/src/views/sys/authority/role/crud.tsx b/packages/ui/certd-client/src/views/sys/authority/role/crud.tsx
index 026746c6..22535080 100644
--- a/packages/ui/certd-client/src/views/sys/authority/role/crud.tsx
+++ b/packages/ui/certd-client/src/views/sys/authority/role/crud.tsx
@@ -1,84 +1,86 @@
import * as api from "./api";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
+import { useI18n } from "vue-i18n";
export default function ({ crudExpose, context: { authz } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const pageRequest = async (query: UserPageQuery): Promise => {
- return await api.GetList(query);
- };
- const editRequest = async ({ form, row }: EditReq) => {
- form.id = row.id;
- return await api.UpdateObj(form);
- };
- const delRequest = async ({ row }: DelReq) => {
- return await api.DelObj(row.id);
- };
+ const { t } = useI18n();
+ const pageRequest = async (query: UserPageQuery): Promise => {
+ return await api.GetList(query);
+ };
+ const editRequest = async ({ form, row }: EditReq) => {
+ form.id = row.id;
+ return await api.UpdateObj(form);
+ };
+ const delRequest = async ({ row }: DelReq) => {
+ return await api.DelObj(row.id);
+ };
- const addRequest = async ({ form }: AddReq) => {
- return await api.AddObj(form);
- };
- return {
- crudOptions: {
- request: {
- pageRequest,
- addRequest,
- editRequest,
- delRequest
- },
- rowHandle: {
- width: 300,
- buttons: {
- authz: {
- type: "link",
- text: "授权",
- async click(context) {
- await authz.authzOpen(context.record.id);
- }
- }
- }
- },
- columns: {
- id: {
- title: "id",
- type: "text",
- form: { show: false }, // 表单配置
- column: {
- width: 70,
- sorter: true
- }
- },
- name: {
- title: "角色名称",
- type: "text",
- search: { show: true },
- form: {
- rules: [
- { required: true, message: "请输入角色名称" },
- { max: 50, message: "最大50个字符" }
- ]
- }, // 表单配置
- column: {
- sorter: true
- }
- },
- createTime: {
- title: "创建时间",
- type: "datetime",
- column: {
- sorter: true
- },
- form: {
- show: false
- }
- },
- updateTime: {
- title: "更新时间",
- type: "datetime",
- column: {
- sorter: true
- },
- form: { show: false } // 表单配置
- }
- }
- }
- };
+ const addRequest = async ({ form }: AddReq) => {
+ return await api.AddObj(form);
+ };
+ return {
+ crudOptions: {
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest
+ },
+ rowHandle: {
+ width: 300,
+ buttons: {
+ authz: {
+ type: "link",
+ text: "授权",
+ async click(context) {
+ await authz.authzOpen(context.record.id);
+ }
+ }
+ }
+ },
+ columns: {
+ id: {
+ title: "id",
+ type: "text",
+ form: { show: false }, // 表单配置
+ column: {
+ width: 70,
+ sorter: true
+ }
+ },
+ name: {
+ title: t("certd.roleName"),
+ type: "text",
+ search: { show: true },
+ form: {
+ rules: [
+ { required: true, message: t("certd.enterRoleName") },
+ { max: 50, message: t("certd.max50Chars") }
+ ]
+ }, // 表单配置
+ column: {
+ sorter: true
+ }
+ },
+ createTime: {
+ title: t("certd.createTime"),
+ type: "datetime",
+ column: {
+ sorter: true
+ },
+ form: {
+ show: false
+ }
+ },
+ updateTime: {
+ title: t("certd.updateTime"),
+ type: "datetime",
+ column: {
+ sorter: true
+ },
+ form: { show: false } // 表单配置
+ }
+ }
+ }
+ };
}
diff --git a/packages/ui/certd-client/src/views/sys/authority/role/index.vue b/packages/ui/certd-client/src/views/sys/authority/role/index.vue
index 487b8ff4..4b868295 100644
--- a/packages/ui/certd-client/src/views/sys/authority/role/index.vue
+++ b/packages/ui/certd-client/src/views/sys/authority/role/index.vue
@@ -1,15 +1,18 @@
-
-
- 角色管理
-
-
-
-
-
-
+
+
+ {{ t("certd.roleManagement") }}
+
+
+
+
+
+
+
diff --git a/packages/ui/certd-client/src/views/sys/authority/user/crud.tsx b/packages/ui/certd-client/src/views/sys/authority/user/crud.tsx
index 25ff879d..0bc8ff66 100644
--- a/packages/ui/certd-client/src/views/sys/authority/user/crud.tsx
+++ b/packages/ui/certd-client/src/views/sys/authority/user/crud.tsx
@@ -4,282 +4,284 @@ import { useUserStore } from "/@/store/user";
import { Modal, notification } from "ant-design-vue";
import dayjs from "dayjs";
import { useSettingStore } from "/@/store/settings";
+import { useI18n } from "vue-i18n";
+
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const pageRequest = async (query: UserPageQuery): Promise => {
- return await api.GetList(query);
- };
- const editRequest = async ({ form, row }: EditReq) => {
- form.id = row.id;
- return await api.UpdateObj(form);
- };
- const delRequest = async ({ row }: DelReq) => {
- return await api.DelObj(row.id);
- };
+ const { t } = useI18n();
+ const pageRequest = async (query: UserPageQuery): Promise => {
+ return await api.GetList(query);
+ };
+ const editRequest = async ({ form, row }: EditReq) => {
+ form.id = row.id;
+ return await api.UpdateObj(form);
+ };
+ const delRequest = async ({ row }: DelReq) => {
+ return await api.DelObj(row.id);
+ };
- const addRequest = async ({ form }: AddReq) => {
- return await api.AddObj(form);
- };
+ const addRequest = async ({ form }: AddReq) => {
+ return await api.AddObj(form);
+ };
- const userStore = useUserStore();
+ const userStore = useUserStore();
- const settingStore = useSettingStore();
- const userValidTimeEnabled = compute(() => {
- return settingStore.sysPublic.userValidTimeEnabled === true;
- });
- return {
- crudOptions: {
- request: {
- pageRequest,
- addRequest,
- editRequest,
- delRequest,
- },
- rowHandle: {
- fixed: "right",
- buttons: {
- unlock: {
- title: "解除登录锁定",
- text: null,
- type: "link",
- icon: "ion:lock-open-outline",
- click: async ({ row }) => {
- Modal.confirm({
- title: "提示",
- content: "确定要解除该用户的登录锁定吗?",
- onOk: async () => {
- await api.Unlock(row.id);
- notification.success({
- message: "解除成功",
- });
- },
- });
- },
- },
- },
- },
- table: {
- scroll: {
- //使用固定列时需要设置此值,并且大于等于列宽度之和的值
- x: 1400,
- },
- },
- columns: {
- id: {
- title: "id",
- type: "text",
- form: { show: false }, // 表单配置
- column: {
- width: 100,
- sorter: true,
- },
- },
- createTime: {
- title: "创建时间",
- type: "datetime",
- form: { show: false }, // 表单配置
- column: {
- width: 180,
- sorter: true,
- },
- },
- // updateTime: {
- // title: "修改时间",
- // type: "datetime",
- // form: { show: false }, // 表单配置
- // column: {
- // sortable: "update_time",
- // width: 180
- // }
- // },
- username: {
- title: "用户名",
- type: "text",
- search: { show: true }, // 开启查询
- form: {
- rules: [
- { required: true, message: "请输入用户名" },
- { max: 50, message: "最大50个字符" },
- ],
- },
- editForm: { component: { disabled: false } },
- column: {
- sorter: true,
- width: 200,
- },
- },
- password: {
- title: "密码",
- type: "text",
- key: "password",
- column: {
- show: false,
- },
- form: {
- rules: [{ max: 50, message: "最大50个字符" }],
- component: {
- showPassword: true,
- },
- helper: "填写则修改密码",
- },
- },
- nickName: {
- title: "昵称",
- type: "text",
- search: { show: true }, // 开启查询
- form: {
- rules: [{ max: 50, message: "最大50个字符" }],
- },
- column: {
- sorter: true,
- },
- },
- email: {
- title: "邮箱",
- type: "text",
- search: { show: true }, // 开启查询
- form: {
- rules: [{ max: 50, message: "最大50个字符" }],
- },
- column: {
- sorter: true,
- width: 160,
- },
- },
- mobile: {
- title: "手机号",
- type: "text",
- search: { show: true }, // 开启查询
- form: {
- rules: [{ max: 50, message: "最大50个字符" }],
- },
- column: {
- sorter: true,
- width: 130,
- },
- },
- avatar: {
- title: "头像",
- type: "cropper-uploader",
- column: {
- width: 70,
- component: {
- //设置高度,修复操作列错位的问题
- style: {
- height: "30px",
- width: "auto",
- },
- buildUrl(key: string) {
- return `api/basic/file/download?&key=` + key;
- },
- },
- },
- form: {
- component: {
- vModel: "modelValue",
- valueType: "key",
- cropper: {
- aspectRatio: 1,
- autoCropArea: 1,
- viewMode: 0,
- },
- onReady: null,
- uploader: {
- type: "form",
- action: "/basic/file/upload",
- name: "file",
- headers: {
- Authorization: "Bearer " + userStore.getToken,
- },
- successHandle(res: any) {
- return res;
- },
- },
- buildUrl(key: string) {
- return `api/basic/file/download?&key=` + key;
- },
- },
- },
- },
- status: {
- title: "状态",
- type: "dict-switch",
- dict: dict({
- data: [
- { label: "启用", value: 1, color: "green" },
- { label: "禁用", value: 0, color: "red" },
- ],
- }),
- column: {
- align: "center",
- sorter: true,
- width: 100,
- },
- },
- validTime: {
- title: "有效期",
- type: "date",
- form: {
- show: userValidTimeEnabled,
- },
- column: {
- align: "center",
- sorter: true,
- width: 100,
- show: userValidTimeEnabled,
- cellRender({ value }) {
- if (value == null || value === 0) {
- return "";
- }
- if (value < dayjs().valueOf()) {
- return 已过期;
- }
- const date = dayjs(value).format("YYYY-MM-DD");
- return (
-
-
-
- );
- },
- },
- valueBuilder({ value, row, key }) {
- if (value != null) {
- row[key] = dayjs(value);
- }
- },
- valueResolve({ value, row, key }) {
- if (value != null) {
- row[key] = value.valueOf();
- }
- },
- },
- remark: {
- title: "备注",
- type: "text",
- column: {
- sorter: true,
- },
- form: {
- rules: [{ max: 100, message: "最大100个字符" }],
- },
- },
- roles: {
- title: "角色",
- type: "dict-select",
- dict: dict({
- url: "/sys/authority/role/list",
- value: "id",
- label: "name",
- }), // 数据字典
- form: {
- component: { mode: "multiple" },
- },
- column: {
- width: 250,
- sortable: true,
- },
- },
- },
- },
- };
+ const settingStore = useSettingStore();
+ const userValidTimeEnabled = compute(() => {
+ return settingStore.sysPublic.userValidTimeEnabled === true;
+ });
+ return {
+ crudOptions: {
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest,
+ },
+ rowHandle: {
+ fixed: "right",
+ buttons: {
+ unlock: {
+ title: t("certd.unlockLogin"),
+ text: null,
+ type: "link",
+ icon: "ion:lock-open-outline",
+ click: async ({ row }) => {
+ Modal.confirm({
+ title: t("certd.notice"),
+ content: t("certd.confirmUnlock"),
+ onOk: async () => {
+ await api.Unlock(row.id);
+ notification.success({
+ message: t("certd.unlockSuccess"),
+ });
+ },
+ });
+ },
+ },
+ },
+ },
+ table: {
+ scroll: {
+ //使用固定列时需要设置此值,并且大于等于列宽度之和的值
+ x: 1400,
+ },
+ },
+ columns: {
+ id: {
+ title: "id",
+ type: "text",
+ form: { show: false }, // 表单配置
+ column: {
+ width: 100,
+ sorter: true,
+ },
+ },
+ createTime: {
+ title: t("certd.createTime"),
+ type: "datetime",
+ form: { show: false }, // 表单配置
+ column: {
+ width: 180,
+ sorter: true,
+ },
+ },
+ // updateTime: {
+ // title: "修改时间",
+ // type: "datetime",
+ // form: { show: false }, // 表单配置
+ // column: {
+ // sortable: "update_time",
+ // width: 180
+ // }
+ // },
+ username: {
+ title: t("certd.username"),
+ type: "text",
+ search: { show: true }, // 开启查询
+ form: {
+ rules: [
+ { required: true, message: t("certd.enterUsername") },
+ { max: 50, message: t("certd.max50Chars") },
+ ],
+ },
+ editForm: { component: { disabled: false } },
+ column: {
+ sorter: true,
+ width: 200,
+ },
+ },
+ password: {
+ title: t("certd.password"),
+ type: "text",
+ key: "password",
+ column: {
+ show: false,
+ },
+ form: {
+ rules: [{ max: 50, message: t("certd.max50Chars") }],
+ component: {
+ showPassword: true,
+ },
+ helper: t("certd.modifyPasswordIfFilled"),
+ },
+ },
+ nickName: {
+ title: t("certd.nickName"),
+ type: "text",
+ search: { show: true }, // 开启查询
+ form: {
+ rules: [{ max: 50, message: t("certd.max50Chars") }],
+ },
+ column: {
+ sorter: true,
+ },
+ },
+ email: {
+ title: t("certd.emaila"),
+ type: "text",
+ search: { show: true }, // 开启查询
+ form: {
+ rules: [{ max: 50, message: t("certd.max50Chars") }],
+ },
+ column: {
+ sorter: true,
+ width: 160,
+ },
+ },
+ mobile: {
+ title: t("certd.mobile"),
+ type: "text",
+ search: { show: true }, // 开启查询
+ form: {
+ rules: [{ max: 50, message: t("certd.max50Chars") }],
+ },
+ column: {
+ sorter: true,
+ width: 130,
+ },
+ },
+ avatar: {
+ title: t("certd.avatar"),
+ type: "cropper-uploader",
+ column: {
+ width: 70,
+ component: {
+ style: {
+ height: "30px",
+ width: "auto",
+ },
+ buildUrl(key: string) {
+ return `api/basic/file/download?&key=` + key;
+ },
+ },
+ },
+ form: {
+ component: {
+ vModel: "modelValue",
+ valueType: "key",
+ cropper: {
+ aspectRatio: 1,
+ autoCropArea: 1,
+ viewMode: 0,
+ },
+ onReady: null,
+ uploader: {
+ type: "form",
+ action: "/basic/file/upload",
+ name: "file",
+ headers: {
+ Authorization: "Bearer " + userStore.getToken,
+ },
+ successHandle(res: any) {
+ return res;
+ },
+ },
+ buildUrl(key: string) {
+ return `api/basic/file/download?&key=` + key;
+ },
+ },
+ },
+ },
+ status: {
+ title: t("certd.status"),
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { label: t("certd.enabled"), value: 1, color: "green" },
+ { label: t("certd.disabled"), value: 0, color: "red" },
+ ],
+ }),
+ column: {
+ align: "center",
+ sorter: true,
+ width: 100,
+ },
+ },
+ validTime: {
+ title: t("certd.validTime"),
+ type: "date",
+ form: {
+ show: userValidTimeEnabled,
+ },
+ column: {
+ align: "center",
+ sorter: true,
+ width: 100,
+ show: userValidTimeEnabled,
+ cellRender({ value }) {
+ if (value == null || value === 0) {
+ return "";
+ }
+ if (value < dayjs().valueOf()) {
+ return {t("certd.expired")};
+ }
+ const date = dayjs(value).format("YYYY-MM-DD");
+ return (
+
+
+
+ );
+ },
+ },
+ valueBuilder({ value, row, key }) {
+ if (value != null) {
+ row[key] = dayjs(value);
+ }
+ },
+ valueResolve({ value, row, key }) {
+ if (value != null) {
+ row[key] = value.valueOf();
+ }
+ },
+ },
+ remark: {
+ title: t("certd.remark"),
+ type: "text",
+ column: {
+ sorter: true,
+ },
+ form: {
+ rules: [{ max: 100, message: t("certd.max100Chars") }],
+ },
+ },
+ roles: {
+ title: t("certd.roles"),
+ type: "dict-select",
+ dict: dict({
+ url: "/sys/authority/role/list",
+ value: "id",
+ label: "name",
+ }), // 数据字典
+ form: {
+ component: { mode: "multiple" },
+ },
+ column: {
+ width: 250,
+ sortable: true,
+ },
+ },
+ },
+ },
+ };
}
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 269f819c..dda10e7c 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
@@ -8,244 +8,244 @@ import { useSettingStore } from "/@/store/settings";
import { Modal } from "ant-design-vue";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const router = useRouter();
- const { t } = useI18n();
- const pageRequest = async (query: UserPageQuery): Promise => {
- 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 router = useRouter();
+ const { t } = useI18n();
+ const pageRequest = async (query: UserPageQuery): Promise => {
+ 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;
+ };
- const userStore = useUserStore();
- const settingStore = useSettingStore();
- const selectedRowKeys: Ref = ref([]);
- context.selectedRowKeys = selectedRowKeys;
+ const userStore = useUserStore();
+ const settingStore = useSettingStore();
+ const selectedRowKeys: Ref = ref([]);
+ context.selectedRowKeys = selectedRowKeys;
- return {
- crudOptions: {
- settings: {
- plugins: {
- //这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
- rowSelection: {
- enabled: true,
- order: -2,
- before: true,
- // handle: (pluginProps,useCrudProps)=>CrudOptions,
- props: {
- multiple: true,
- crossPage: true,
- selectedRowKeys
- }
- }
- }
- },
- request: {
- pageRequest,
- addRequest,
- editRequest,
- delRequest
- },
- rowHandle: {
- minWidth: 200,
- fixed: "right"
- },
- columns: {
- id: {
- title: "ID",
- key: "id",
- type: "number",
- column: {
- width: 100
- },
- form: {
- show: false
- }
- },
- domain: {
- title: "CNAME域名",
- type: "text",
- editForm: {
- component: {
- disabled: true
- }
- },
- search: {
- show: true
- },
- form: {
- component: {
- placeholder: "cname.handsfree.work"
- },
- helper: "需要一个右边DNS提供商注册的域名(也可以将其他域名的dns服务器转移到这几家来)。\nCNAME域名一旦确定不可修改,建议使用一级子域名",
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 200
- }
- },
- dnsProviderType: {
- title: "DNS提供商",
- type: "dict-select",
- search: {
- show: true
- },
- dict: dict({
- url: "pi/dnsProvider/list",
- value: "key",
- label: "title"
- }),
- form: {
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 150,
- component: {
- color: "auto"
- }
- }
- },
- accessId: {
- title: "DNS提供商授权",
- type: "dict-select",
- dict: dict({
- url: "/pi/access/list",
- value: "id",
- label: "name"
- }),
- form: {
- component: {
- name: "access-selector",
- vModel: "modelValue",
- type: compute(({ form }) => {
- return form.dnsProviderType;
- })
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 150,
- component: {
- color: "auto"
- }
- }
- },
- isDefault: {
- title: "是否默认",
- type: "dict-switch",
- dict: dict({
- data: [
- { label: "是", value: true, color: "success" },
- { label: "否", value: false, color: "default" }
- ]
- }),
- form: {
- value: false,
- rules: [{ required: true, message: "请选择是否默认" }]
- },
- column: {
- align: "center",
- width: 100
- }
- },
- setDefault: {
- title: "设置默认",
- type: "text",
- form: {
- show: false
- },
- column: {
- width: 100,
- align: "center",
- conditionalRenderDisabled: true,
- cellRender: ({ row }) => {
- if (row.isDefault) {
- return;
- }
- const onClick = async () => {
- Modal.confirm({
- title: "提示",
- content: `确定要设置为默认吗?`,
- onOk: async () => {
- await api.SetDefault(row.id);
- await crudExpose.doRefresh();
- }
- });
- };
+ return {
+ crudOptions: {
+ settings: {
+ plugins: {
+ //这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
+ rowSelection: {
+ enabled: true,
+ order: -2,
+ before: true,
+ // handle: (pluginProps,useCrudProps)=>CrudOptions,
+ props: {
+ multiple: true,
+ crossPage: true,
+ selectedRowKeys
+ }
+ }
+ }
+ },
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest
+ },
+ rowHandle: {
+ minWidth: 200,
+ fixed: "right"
+ },
+ columns: {
+ id: {
+ title: "ID",
+ key: "id",
+ type: "number",
+ column: {
+ width: 100
+ },
+ form: {
+ show: false
+ }
+ },
+ domain: {
+ title: t("certd.cnameDomain"),
+ type: "text",
+ editForm: {
+ component: {
+ disabled: true,
+ },
+ },
+ search: {
+ show: true,
+ },
+ form: {
+ component: {
+ placeholder: t("certd.cnameDomainPlaceholder"),
+ },
+ helper: t("certd.cnameDomainHelper"),
+ rules: [{ required: true, message: t("certd.requiredField") }],
+ },
+ column: {
+ width: 200,
+ },
+ },
+ dnsProviderType: {
+ title: t("certd.dnsProvider"),
+ type: "dict-select",
+ search: {
+ show: true,
+ },
+ dict: dict({
+ url: "pi/dnsProvider/list",
+ value: "key",
+ label: "title",
+ }),
+ form: {
+ rules: [{ required: true, message: t("certd.requiredField") }],
+ },
+ column: {
+ width: 150,
+ component: {
+ color: "auto",
+ },
+ },
+ },
+ accessId: {
+ title: t("certd.dnsProviderAuthorization"),
+ type: "dict-select",
+ dict: dict({
+ url: "/pi/access/list",
+ value: "id",
+ label: "name",
+ }),
+ form: {
+ component: {
+ name: "access-selector",
+ vModel: "modelValue",
+ type: compute(({ form }) => {
+ return form.dnsProviderType;
+ }),
+ },
+ rules: [{ required: true, message: t("certd.requiredField") }],
+ },
+ column: {
+ width: 150,
+ component: {
+ color: "auto",
+ },
+ },
+ },
+ isDefault: {
+ title: t("certd.isDefault"),
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { label: t("certd.yes"), value: true, color: "success" },
+ { label: t("certd.no"), value: false, color: "default" },
+ ],
+ }),
+ form: {
+ value: false,
+ rules: [{ required: true, message: t("certd.selectIsDefault") }],
+ },
+ column: {
+ align: "center",
+ width: 100,
+ },
+ },
+ setDefault: {
+ title: t("certd.setDefault"),
+ type: "text",
+ form: {
+ show: false,
+ },
+ column: {
+ width: 100,
+ align: "center",
+ conditionalRenderDisabled: true,
+ cellRender: ({ row }) => {
+ if (row.isDefault) {
+ return;
+ }
+ const onClick = async () => {
+ Modal.confirm({
+ title: t("certd.prompt"),
+ content: t("certd.confirmSetDefault"),
+ onOk: async () => {
+ await api.SetDefault(row.id);
+ await crudExpose.doRefresh();
+ },
+ });
+ };
- return (
-
- 设为默认
-
- );
- }
- }
- },
- disabled: {
- title: "禁用/启用",
- type: "dict-switch",
- dict: dict({
- data: [
- { label: "启用", value: false, color: "success" },
- { label: "禁用", value: true, color: "error" }
- ]
- }),
- form: {
- value: false
- },
- column: {
- width: 100,
- component: {
- title: "点击可禁用/启用",
- on: {
- async click({ value, row }) {
- Modal.confirm({
- title: "提示",
- content: `确定要${!value ? "禁用" : "启用"}吗?`,
- onOk: async () => {
- await api.SetDisabled(row.id, !value);
- await crudExpose.doRefresh();
- }
- });
- }
- }
- }
- }
- },
- createTime: {
- title: "创建时间",
- type: "datetime",
- form: {
- show: false
- },
- column: {
- sorter: true,
- width: 160,
- align: "center"
- }
- },
- updateTime: {
- title: "更新时间",
- type: "datetime",
- form: {
- show: false
- },
- column: {
- show: true,
- width: 160
- }
- }
- }
- }
- };
+ return (
+
+ {t("certd.setAsDefault")}
+
+ );
+ },
+ },
+ },
+ disabled: {
+ title: t("certd.disabled"),
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { label: t("certd.enabled"), value: false, color: "success" },
+ { label: t("certd.disabledLabel"), value: true, color: "error" },
+ ],
+ }),
+ form: {
+ value: false,
+ },
+ column: {
+ width: 100,
+ component: {
+ title: t("certd.clickToToggle"),
+ on: {
+ async click({ value, row }) {
+ Modal.confirm({
+ title: t("certd.prompt"),
+ content: t("certd.confirmToggleStatus", { action: !value ? t("certd.disable") : t("certd.enable") }),
+ onOk: async () => {
+ await api.SetDisabled(row.id, !value);
+ await crudExpose.doRefresh();
+ },
+ });
+ },
+ },
+ },
+ },
+ },
+ 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,
+ },
+ },
+ }
+ }
+ };
}
diff --git a/packages/ui/certd-client/src/views/sys/cname/provider/index.vue b/packages/ui/certd-client/src/views/sys/cname/provider/index.vue
index 15ef5aa6..858da32d 100644
--- a/packages/ui/certd-client/src/views/sys/cname/provider/index.vue
+++ b/packages/ui/certd-client/src/views/sys/cname/provider/index.vue
@@ -1,60 +1,67 @@
-
-
-
- CNAME服务配置
-
- 此处配置的域名作为其他域名校验的代理,当别的域名需要申请证书时,通过CNAME映射到此域名上来验证所有权。好处是任何域名都可以通过此方式申请证书,也无需填写AccessSecret。
- CNAME功能原理及使用说明
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
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 938a9dd4..01d33229 100644
--- a/packages/ui/certd-client/src/views/sys/plugin/crud.tsx
+++ b/packages/ui/certd-client/src/views/sys/plugin/crud.tsx
@@ -8,559 +8,527 @@ import { Modal, notification } from "ant-design-vue";
import yaml from "js-yaml";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const router = useRouter();
- const { t } = useI18n();
+ const router = useRouter();
+ const { t } = useI18n();
- let lastType = "";
- const pageRequest = async (query: UserPageQuery): Promise => {
- if (lastType && lastType != query?.query?.type) {
- //lastType有变化
- query.page.offset = 0;
- }
- lastType = query?.query?.type;
- 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);
- };
+ let lastType = "";
+ const pageRequest = async (query: UserPageQuery): Promise => {
+ if (lastType && lastType != query?.query?.type) {
+ query.page.offset = 0;
+ }
+ lastType = query?.query?.type;
+ 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;
+ };
- const selectedRowKeys: Ref = ref([]);
- context.selectedRowKeys = selectedRowKeys;
- const { openCrudFormDialog } = useFormWrapper();
+ const selectedRowKeys: Ref = ref([]);
+ context.selectedRowKeys = selectedRowKeys;
+ const { openCrudFormDialog } = useFormWrapper();
- async function openImportDialog() {
- function createCrudOptions() {
- return {
- crudOptions: {
- columns: {
- content: {
- title: "插件文件",
- type: "text",
- form: {
- component: {
- name: "pem-input",
- vModel: "modelValue",
- textarea: {
- rows: 8,
- },
- },
- col: {
- span: 24,
- },
- helper: "选择插件文件",
- },
- },
- override: {
- title: "同名覆盖",
- type: "dict-switch",
- dict: dict({
- data: [
- {
- value: true,
- label: "覆盖",
- },
- {
- value: false,
- label: "不覆盖",
- },
- ],
- }),
- form: {
- value: false,
- col: {
- span: 24,
- },
- helper: "如果已有相同名称插件,直接覆盖",
- },
- },
- },
- form: {
- wrapper: {
- title: "导入插件",
- saveRemind: false,
- },
- afterSubmit() {
- notification.success({ message: "操作成功" });
- crudExpose.doRefresh();
- },
- async doSubmit({ form }: any) {
- return await api.ImportPlugin({
- ...form,
- });
- },
- },
- },
- };
- }
- const { crudOptions } = createCrudOptions();
- await openCrudFormDialog({ crudOptions });
- }
- return {
- crudOptions: {
- settings: {
- plugins: {
- //这里使用行选择插件,生成行选择crudOptions配置,最终会与crudOptions合并
- rowSelection: {
- enabled: true,
- order: -2,
- before: true,
- // handle: (pluginProps,useCrudProps)=>CrudOptions,
- props: {
- multiple: true,
- crossPage: true,
- selectedRowKeys,
- },
- },
- },
- },
- request: {
- pageRequest,
- addRequest,
- editRequest,
- delRequest,
- },
- actionbar: {
- buttons: {
- add: {
- show: true,
- icon: "ion:ios-add-circle-outline",
- text: "自定义插件",
- },
- import: {
- show: true,
- icon: "ion:cloud-upload-outline",
- text: "导入",
- type: "primary",
- async click() {
- await openImportDialog();
- },
- },
- },
- },
- rowHandle: {
- show: true,
- minWidth: 200,
- fixed: "right",
- buttons: {
- edit: {
- show: compute(({ row }) => {
- return row.type === "custom";
- }),
- },
- copy: {
- show: compute(({ row }) => {
- return row.type === "custom";
- }),
- },
- remove: {
- order: 999,
- show: compute(({ row }) => {
- return row.type === "custom";
- }),
- },
- export: {
- text: null,
- icon: "ion:cloud-download-outline",
- title: "导出",
- type: "link",
- show: compute(({ row }) => {
- return row.type === "custom";
- }),
- async click({ row }) {
- //将文本内容,作为文件下载
- const content = await api.ExportPlugin(row.id);
- if (content) {
- const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
- const url = URL.createObjectURL(blob);
- const link = document.createElement("a");
- link.href = url;
- link.download = `${row.name}.yaml`;
- link.click();
- URL.revokeObjectURL(url);
- }
- },
- },
- },
- },
- table: {
- rowKey: "name",
- },
- tabs: {
- name: "type",
- show: true,
- defaultOption: {
- show: false,
- },
- },
- form: {
- onSuccess(opts: any) {
- if (opts.res?.id) {
- router.push({
- name: "SysPluginEdit",
- query: {
- id: opts.res.id,
- },
- });
- }
- },
- },
- columns: {
- // id: {
- // title: "ID",
- // key: "id",
- // type: "number",
- // column: {
- // width: 100
- // },
- // form: {
- // show: false
- // }
- // },
- pluginType: {
- title: "插件类型",
- type: "dict-select",
- search: {
- show: true,
- },
- form: {
- order: 0,
- rules: [{ required: true }],
- component: {
- disabled: true,
- },
- },
- addForm: {
- component: {
- disabled: false,
- },
- },
- dict: dict({
- data: [
- { label: "授权", value: "access" },
- { label: "DNS", value: "dnsProvider" },
- { label: "部署插件", value: "deploy" },
- ],
- }),
- column: {
- width: 100,
- align: "center",
- component: {
- color: "auto",
- },
- },
- },
- icon: {
- title: "图标",
- type: "icon",
- form: {
- rules: [{ required: true }],
- },
- column: {
- width: 70,
- align: "center",
- component: {
- name: "fs-icon",
- vModel: "icon",
- style: {
- fontSize: "22px",
- },
- },
- },
- },
- name: {
- title: "插件名称",
- type: "text",
- search: {
- show: true,
- },
- form: {
- show: true,
- helper: "必须为英文或数字,驼峰命名,类型作为前缀\n例如AliyunDeployToCDN\n插件一旦被使用,不要修改名称",
- rules: [
- { required: true },
- {
- type: "regexp",
- pattern: /^[a-zA-Z][a-zA-Z0-9]+$/,
- message: "必须为英文或数字,驼峰命名,类型作为前缀",
- },
- ],
- },
- column: {
- width: 250,
- cellRender({ row }) {
- if (row.author) {
- return ;
- } else {
- return ;
- }
- },
- },
- },
- author: {
- title: "作者",
- type: "text",
- search: {
- show: true,
- },
- form: {
- show: true,
- helper: "上传到插件商店时,将作为插件名称前缀,例如:greper/pluginName",
- rules: [
- { required: true },
- {
- type: "regexp",
- pattern: /^[a-zA-Z][a-zA-Z0-9]+$/,
- message: "必须为英文字母或数字",
- },
- ],
- },
- column: {
- width: 200,
- show: false,
- },
- },
- title: {
- title: "标题",
- type: "text",
- form: {
- helper: "插件中文名称",
- rules: [{ required: true }],
- },
- column: {
- width: 300,
- cellRender({ row }) {
- if (row.type === "custom") {
- return {row.title};
- }
- return {row.title}
;
- },
- },
- },
- desc: {
- title: "描述",
- type: "textarea",
- helper: "插件的描述",
- column: {
- width: 300,
- show: false,
- },
- },
-
- type: {
- title: "来源",
- type: "dict-select",
- search: {
- show: true,
- },
- form: {
- value: "custom",
- component: {
- disabled: true,
- },
- },
- dict: dict({
- data: [
- { label: "内置", value: "builtIn" },
- { label: "自建", value: "custom" },
- { label: "商店", value: "store" },
- ],
- }),
- column: {
- width: 70,
- align: "center",
- component: {
- color: "auto",
- },
- },
- },
- version: {
- title: "版本",
- type: "text",
- column: {
- width: 100,
- align: "center",
- },
- },
- // "extra.dependLibs": {
- // title: "第三方依赖",
- // type: "text",
- // form: {
- // helper: "依赖的第三方库,package.dependencies的格式:name[:^version]",
- // component: {
- // name: "a-select",
- // mode: "tags",
- // allowClear: true,
- // open: false,
- // },
- // },
- // column: {
- // show: false,
- // },
- // },
- "extra.dependPlugins": {
- title: "插件依赖",
- type: "text",
- form: {
- component: {
- name: "a-select",
- mode: "tags",
- open: false,
- allowClear: true,
- },
- helper: "安装时会先安装依赖的插件,格式:[author/]pluginName[:version]",
- },
- column: {
- show: false,
- },
- },
- "extra.showRunStrategy": {
- title: "可修改运行策略",
- type: "dict-switch",
- dict: dict({
- data: [
- { value: true, label: "可修改" },
- { value: false, label: "不可修改" },
- ],
- }),
- form: {
- value: false,
- rules: [{ required: true }],
- },
- column: {
- width: 100,
- align: "left",
- show: false,
- },
- },
- "extra.default.strategy.runStrategy": {
- title: "运行策略",
- type: "dict-select",
- dict: dict({
- data: [
- { value: 0, label: "正常运行" },
- { value: 1, label: "成功后跳过(部署任务)" },
- ],
- }),
- form: {
- value: 1,
- rules: [{ required: true }],
- helper: "默认运行策略",
- show: compute(({ form }) => {
- return form.extra.showRunStrategy;
- }),
- },
- column: {
- width: 100,
- align: "left",
- component: {
- color: "auto",
- },
- show: false,
- },
- valueBuilder({ row }) {
- if (row.extra) {
- row.extra = yaml.load(row.extra);
- }
- },
- valueResolve({ row }) {
- if (row.extra) {
- row.extra = yaml.dump(row.extra);
- }
- },
- },
- disabled: {
- title: "点击禁用/启用",
- type: "dict-switch",
- dict: dict({
- data: [
- { label: "启用", value: false, color: "success" },
- { label: "禁用", value: true, color: "error" },
- ],
- }),
- form: {
- title: "禁用/启用",
- value: false,
- },
- column: {
- width: 120,
- align: "center",
- component: {
- title: "点击可禁用/启用",
- on: {
- async click({ value, row }) {
- Modal.confirm({
- title: "提示",
- content: `确定要${!value ? "禁用" : "启用"}吗?`,
- onOk: async () => {
- await api.SetDisabled({
- id: row.id,
- name: row.name,
- type: row.type,
- disabled: !value,
- });
- await crudExpose.doRefresh();
- },
- });
- },
- },
- },
- },
- },
- group: {
- title: "插件分组",
- type: "dict-select",
- dict: dict({
- url: "/pi/plugin/groupsList",
- label: "title",
- value: "key",
- }),
- form: {
- rules: [{ required: true }],
- show: compute(({ form }) => {
- return form.pluginType === "deploy";
- }),
- },
- column: {
- width: 100,
- align: "left",
- component: {
- color: "auto",
- },
- },
- },
- createTime: {
- title: "创建时间",
- type: "datetime",
- form: {
- show: false,
- },
- column: {
- sorter: true,
- width: 160,
- align: "center",
- },
- },
- updateTime: {
- title: "更新时间",
- type: "datetime",
- form: {
- show: false,
- },
- column: {
- show: true,
- },
- },
- },
- },
- };
+ async function openImportDialog() {
+ function createCrudOptions() {
+ return {
+ crudOptions: {
+ columns: {
+ content: {
+ title: t("certd.pluginFile"),
+ type: "text",
+ form: {
+ component: {
+ name: "pem-input",
+ vModel: "modelValue",
+ textarea: {
+ rows: 8,
+ },
+ },
+ col: {
+ span: 24,
+ },
+ helper: t("certd.selectPluginFile"),
+ },
+ },
+ override: {
+ title: t("certd.overrideSameName"),
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ {
+ value: true,
+ label: t("certd.override"),
+ },
+ {
+ value: false,
+ label: t("certd.noOverride"),
+ },
+ ],
+ }),
+ form: {
+ value: false,
+ col: {
+ span: 24,
+ },
+ helper: t("certd.overrideHelper"),
+ },
+ },
+ },
+ form: {
+ wrapper: {
+ title: t("certd.importPlugin"),
+ saveRemind: false,
+ },
+ afterSubmit() {
+ notification.success({ message: t("certd.operationSuccess") });
+ crudExpose.doRefresh();
+ },
+ async doSubmit({ form }: any) {
+ return await api.ImportPlugin({
+ ...form,
+ });
+ },
+ },
+ },
+ };
+ }
+ const { crudOptions } = createCrudOptions();
+ await openCrudFormDialog({ crudOptions });
+ }
+ return {
+ crudOptions: {
+ settings: {
+ plugins: {
+ rowSelection: {
+ enabled: true,
+ order: -2,
+ before: true,
+ props: {
+ multiple: true,
+ crossPage: true,
+ selectedRowKeys,
+ },
+ },
+ },
+ },
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest,
+ },
+ actionbar: {
+ buttons: {
+ add: {
+ show: true,
+ icon: "ion:ios-add-circle-outline",
+ text: t("certd.customPlugin"),
+ },
+ import: {
+ show: true,
+ icon: "ion:cloud-upload-outline",
+ text: t("certd.import"),
+ type: "primary",
+ async click() {
+ await openImportDialog();
+ },
+ },
+ },
+ },
+ rowHandle: {
+ show: true,
+ minWidth: 200,
+ fixed: "right",
+ buttons: {
+ edit: {
+ show: compute(({ row }) => {
+ return row.type === "custom";
+ }),
+ },
+ copy: {
+ show: compute(({ row }) => {
+ return row.type === "custom";
+ }),
+ },
+ remove: {
+ order: 999,
+ show: compute(({ row }) => {
+ return row.type === "custom";
+ }),
+ },
+ export: {
+ text: null,
+ icon: "ion:cloud-download-outline",
+ title: t("certd.export"),
+ type: "link",
+ show: compute(({ row }) => {
+ return row.type === "custom";
+ }),
+ async click({ row }) {
+ const content = await api.ExportPlugin(row.id);
+ if (content) {
+ const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `${row.name}.yaml`;
+ link.click();
+ URL.revokeObjectURL(url);
+ }
+ },
+ },
+ },
+ },
+ table: {
+ rowKey: "name",
+ },
+ tabs: {
+ name: "type",
+ show: true,
+ defaultOption: {
+ show: false,
+ },
+ },
+ form: {
+ onSuccess(opts: any) {
+ if (opts.res?.id) {
+ router.push({
+ name: "SysPluginEdit",
+ query: {
+ id: opts.res.id,
+ },
+ });
+ }
+ },
+ },
+ columns: {
+ pluginType: {
+ title: t("certd.pluginType"),
+ type: "dict-select",
+ search: {
+ show: true,
+ },
+ form: {
+ order: 0,
+ rules: [{ required: true }],
+ component: {
+ disabled: true,
+ },
+ },
+ addForm: {
+ component: {
+ disabled: false,
+ },
+ },
+ dict: dict({
+ data: [
+ { label: t("certd.auth"), value: "access" },
+ { label: t("certd.dns"), value: "dnsProvider" },
+ { label: t("certd.deployPlugin"), value: "deploy" },
+ ],
+ }),
+ column: {
+ width: 100,
+ align: "center",
+ component: {
+ color: "auto",
+ },
+ },
+ },
+ icon: {
+ title: t("certd.icon"),
+ type: "icon",
+ form: {
+ rules: [{ required: true }],
+ },
+ column: {
+ width: 70,
+ align: "center",
+ component: {
+ name: "fs-icon",
+ vModel: "icon",
+ style: {
+ fontSize: "22px",
+ },
+ },
+ },
+ },
+ name: {
+ title: t("certd.pluginName"),
+ type: "text",
+ search: {
+ show: true,
+ },
+ form: {
+ show: true,
+ helper: t("certd.pluginNameHelper"),
+ rules: [
+ { required: true },
+ {
+ type: "regexp",
+ pattern: /^[a-zA-Z][a-zA-Z0-9]+$/,
+ message: t("certd.pluginNameRuleMsg"),
+ },
+ ],
+ },
+ column: {
+ width: 250,
+ cellRender({ row }) {
+ if (row.author) {
+ return ;
+ } else {
+ return ;
+ }
+ },
+ },
+ },
+ author: {
+ title: t("certd.author"),
+ type: "text",
+ search: {
+ show: true,
+ },
+ form: {
+ show: true,
+ helper: t("certd.authorHelper"),
+ rules: [
+ { required: true },
+ {
+ type: "regexp",
+ pattern: /^[a-zA-Z][a-zA-Z0-9]+$/,
+ message: t("certd.authorRuleMsg"),
+ },
+ ],
+ },
+ column: {
+ width: 200,
+ show: false,
+ },
+ },
+ title: {
+ title: t("certd.titlea"),
+ type: "text",
+ form: {
+ helper: t("certd.titleHelper"),
+ rules: [{ required: true }],
+ },
+ column: {
+ width: 300,
+ cellRender({ row }) {
+ if (row.type === "custom") {
+ return {row.title};
+ }
+ return {row.title}
;
+ },
+ },
+ },
+ desc: {
+ title: t("certd.description"),
+ type: "textarea",
+ helper: t("certd.descriptionHelper"),
+ column: {
+ width: 300,
+ show: false,
+ },
+ },
+ type: {
+ title: t("certd.sourcee"),
+ type: "dict-select",
+ search: {
+ show: true,
+ },
+ form: {
+ value: "custom",
+ component: {
+ disabled: true,
+ },
+ },
+ dict: dict({
+ data: [
+ { label: t("certd.builtIn"), value: "builtIn" },
+ { label: t("certd.custom"), value: "custom" },
+ { label: t("certd.store"), value: "store" },
+ ],
+ }),
+ column: {
+ width: 70,
+ align: "center",
+ component: {
+ color: "auto",
+ },
+ },
+ },
+ version: {
+ title: t("certd.version"),
+ type: "text",
+ column: {
+ width: 100,
+ align: "center",
+ },
+ },
+ "extra.dependPlugins": {
+ title: t("certd.pluginDependencies"),
+ type: "text",
+ form: {
+ component: {
+ name: "a-select",
+ mode: "tags",
+ open: false,
+ allowClear: true,
+ },
+ helper: t("certd.pluginDependenciesHelper"),
+ },
+ column: {
+ show: false,
+ },
+ },
+ "extra.showRunStrategy": {
+ title: t("certd.editableRunStrategy"),
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { value: true, label: t("certd.editable") },
+ { value: false, label: t("certd.notEditable") },
+ ],
+ }),
+ form: {
+ value: false,
+ rules: [{ required: true }],
+ },
+ column: {
+ width: 100,
+ align: "left",
+ show: false,
+ },
+ },
+ "extra.default.strategy.runStrategy": {
+ title: t("certd.runStrategy"),
+ type: "dict-select",
+ dict: dict({
+ data: [
+ { value: 0, label: t("certd.normalRun") },
+ { value: 1, label: t("certd.skipOnSuccess") },
+ ],
+ }),
+ form: {
+ value: 1,
+ rules: [{ required: true }],
+ helper: t("certd.defaultRunStrategyHelper"),
+ show: compute(({ form }) => {
+ return form.extra.showRunStrategy;
+ }),
+ },
+ column: {
+ width: 100,
+ align: "left",
+ component: {
+ color: "auto",
+ },
+ show: false,
+ },
+ valueBuilder({ row }) {
+ if (row.extra) {
+ row.extra = yaml.load(row.extra);
+ }
+ },
+ valueResolve({ row }) {
+ if (row.extra) {
+ row.extra = yaml.dump(row.extra);
+ }
+ },
+ },
+ disabled: {
+ title: t("certd.enableDisable"),
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { label: t("certd.enabled"), value: false, color: "success" },
+ { label: t("certd.disabled"), value: true, color: "error" },
+ ],
+ }),
+ form: {
+ title: t("certd.enableDisable"),
+ value: false,
+ },
+ column: {
+ width: 120,
+ align: "center",
+ component: {
+ title: t("certd.clickToToggle"),
+ on: {
+ async click({ value, row }) {
+ Modal.confirm({
+ title: t("certd.confirm"),
+ content: `${t("certd.confirmToggle")} ${!value ? t("certd.disable") : t("certd.enable")}?`,
+ onOk: async () => {
+ await api.SetDisabled({
+ id: row.id,
+ name: row.name,
+ type: row.type,
+ disabled: !value,
+ });
+ await crudExpose.doRefresh();
+ },
+ });
+ },
+ },
+ },
+ },
+ },
+ group: {
+ title: t("certd.pluginGroup"),
+ type: "dict-select",
+ dict: dict({
+ url: "/pi/plugin/groupsList",
+ label: "title",
+ value: "key",
+ }),
+ form: {
+ rules: [{ required: true }],
+ show: compute(({ form }) => {
+ return form.pluginType === "deploy";
+ }),
+ },
+ column: {
+ width: 100,
+ align: "left",
+ component: {
+ color: "auto",
+ },
+ },
+ },
+ 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,
+ },
+ },
+ },
+ },
+ };
}
diff --git a/packages/ui/certd-client/src/views/sys/plugin/index.vue b/packages/ui/certd-client/src/views/sys/plugin/index.vue
index 80e0c21c..c16ab966 100644
--- a/packages/ui/certd-client/src/views/sys/plugin/index.vue
+++ b/packages/ui/certd-client/src/views/sys/plugin/index.vue
@@ -1,58 +1,63 @@
-
-
-
- 插件管理
- 自定义插件处于BETA测试版,后续可能会有破坏性变更
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ t("certd.pluginManagement") }}
+ {{ t("certd.pluginBetaWarning") }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/ui/certd-client/src/views/sys/settings/email/index.vue b/packages/ui/certd-client/src/views/sys/settings/email/index.vue
index df834df8..9c6843d1 100644
--- a/packages/ui/certd-client/src/views/sys/settings/email/index.vue
+++ b/packages/ui/certd-client/src/views/sys/settings/email/index.vue
@@ -1,73 +1,86 @@
-
-
-
- 邮件服务器设置
- 设置邮件发送服务器
-
-
+
+
+
+ {{ t('certd.emailServerSettings') }}
+ {{ t('certd.setEmailSendingServer') }}
+
+
-
+
+
+
diff --git a/packages/ui/certd-client/src/views/sys/settings/tabs/base.vue b/packages/ui/certd-client/src/views/sys/settings/tabs/base.vue
index 1b6ec753..e1982e61 100644
--- a/packages/ui/certd-client/src/views/sys/settings/tabs/base.vue
+++ b/packages/ui/certd-client/src/views/sys/settings/tabs/base.vue
@@ -1,54 +1,59 @@
-
+
diff --git a/packages/ui/certd-client/src/views/sys/settings/tabs/register.vue b/packages/ui/certd-client/src/views/sys/settings/tabs/register.vue
index 8f395eaa..a0464054 100644
--- a/packages/ui/certd-client/src/views/sys/settings/tabs/register.vue
+++ b/packages/ui/certd-client/src/views/sys/settings/tabs/register.vue
@@ -1,67 +1,78 @@
-
diff --git a/packages/ui/certd-client/src/views/sys/settings/tabs/safe.vue b/packages/ui/certd-client/src/views/sys/settings/tabs/safe.vue
index f850c9c9..5e3966f7 100644
--- a/packages/ui/certd-client/src/views/sys/settings/tabs/safe.vue
+++ b/packages/ui/certd-client/src/views/sys/settings/tabs/safe.vue
@@ -1,54 +1,63 @@
-
+
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 97e6a73c..1b8bb1e1 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
@@ -4,317 +4,333 @@ import SuiteValue from "./suite-value.vue";
import SuiteValueEdit from "./suite-value-edit.vue";
import PriceEdit from "./price-edit.vue";
import DurationPriceValue from "/@/views/sys/suite/product/duration-price-value.vue";
+import { useI18n } from "vue-i18n";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const emit = context.emit;
- const pageRequest = async (query: UserPageQuery): Promise => {
- 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 => {
+ 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: "基础信息",
- columns: ["title", "type", "disabled", "order", "supportBuy", "intro"]
- },
- content: {
- header: "套餐内容",
- columns: ["content.maxDomainCount", "content.maxPipelineCount", "content.maxDeployCount", "content.maxMonitorCount"]
- },
- price: {
- header: "价格",
- columns: ["durationPrices"]
- }
- }
- }
- },
- columns: {
- // id: {
- // title: "ID",
- // key: "id",
- // type: "number",
- // column: {
- // width: 100
- // },
- // form: {
- // show: false
- // }
- // },
- title: {
- title: "套餐名称",
- type: "text",
- search: {
- show: true
- },
- form: {
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 200
- }
- },
- type: {
- title: "类型",
- type: "dict-select",
- editForm: {
- component: {
- disabled: true
- }
- },
- dict: dict({
- data: [
- { label: "套餐", value: "suite" },
- { label: "加量包", value: "addon" }
- ]
- }),
- form: {
- value: "suite",
- rules: [{ required: true, message: "此项必填" }],
- helper: "套餐:同一时间只有最新购买的一个生效\n加量包:可购买多个,购买后立即生效,不影响套餐\n套餐和加量包数量可叠加"
- },
- 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: "域名数量",
- type: "text",
- form: {
- key: ["content", "maxDomainCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "个"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "个"
- }
- }
- },
- "content.maxPipelineCount": {
- title: "流水线数量",
- type: "text",
- form: {
- key: ["content", "maxPipelineCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "条"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "条"
- }
- }
- },
- "content.maxDeployCount": {
- title: "部署次数",
- type: "text",
- form: {
- key: ["content", "maxDeployCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "次"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "次"
- }
- }
- },
- "content.maxMonitorCount": {
- title: "证书监控数量",
- type: "text",
- form: {
- key: ["content", "maxMonitorCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "个"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 120,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "个"
- }
- }
- },
- durationPrices: {
- title: "时长及价格",
- type: "text",
- form: {
- title: "选择时长",
- component: {
- name: PriceEdit,
- vModel: "modelValue",
- edit: true,
- style: {
- minHeight: "120px"
- }
- },
- col: {
- span: 24
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- component: {
- name: DurationPriceValue,
- vModel: "modelValue"
- },
- width: 350
- }
- },
- supportBuy: {
- title: "支持购买",
- type: "dict-switch",
- dict: dict({
- data: [
- { label: "支持购买", value: true, color: "success" },
- { label: "不能购买", value: false, color: "gray" }
- ]
- }),
- form: {
- value: true
- },
- column: {
- width: 120
- }
- },
- disabled: {
- title: "上下架",
- type: "dict-radio",
- dict: dict({
- data: [
- { value: false, label: "上架", color: "green" },
- { value: true, label: "下架", color: "gray" }
- ]
- }),
- form: {
- value: false
- },
- column: {
- width: 100
- }
- },
- order: {
- title: "排序",
- type: "number",
- form: {
- helper: "越小越靠前",
- value: 0
- },
- column: {
- width: 100
- }
- },
- intro: {
- title: "说明",
- type: "textarea",
- column: {
- width: 200
- }
- },
- createTime: {
- title: "创建时间",
- type: "datetime",
- form: {
- show: false
- },
- column: {
- sorter: true,
- width: 160,
- align: "center"
- }
- },
- updateTime: {
- title: "更新时间",
- 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
+ }
+ }
+ }
+ }
+ };
}
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 0ea1a77a..c5b7058c 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
@@ -8,392 +8,397 @@ 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";
+
+
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
- const api = sysUserSuiteApi;
- const pageRequest = async (query: UserPageQuery): Promise => {
- 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 => {
+ 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: "赠送套餐" }
- }
- },
- 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: "套餐名称",
- type: "text",
- search: {
- show: true
- },
- form: {
- show: false
- },
- column: {
- width: 200
- }
- },
- userId: {
- title: "用户",
- 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: "点击选择"
- },
- createCrudOptions: createCrudOptionsUser
- // crudOptionsOverride: crudOptionsOverride
- }
- }
- },
- //赠送
- presentSuiteId: {
- title: "赠送套餐",
- 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("请选择套餐");
- }
- }
- ]
- },
- valueResolve({ form, value }) {
- if (value && value.productId) {
- form.productId = value.productId;
- form.duration = value.duration;
- }
- },
- form: { show: false }
- },
- productType: {
- title: "类型",
- type: "dict-select",
- editForm: {
- component: {
- disabled: true
- }
- },
- dict: dict({
- data: [
- { label: "套餐", value: "suite", color: "green" },
- { label: "加量包", 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: "域名数量",
- type: "text",
- form: {
- show: false,
- key: ["content", "maxDomainCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "个"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "个"
- },
- align: "center"
- }
- },
- "content.maxPipelineCount": {
- title: "流水线数量",
- type: "text",
- form: {
- show: false,
- key: ["content", "maxPipelineCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "条"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "条"
- },
- align: "center"
- }
- },
- "content.maxDeployCount": {
- title: "部署次数",
- type: "text",
- form: {
- show: false,
- key: ["content", "maxDeployCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "次"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 100,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "次",
- used: compute(({ row }) => {
- return row.deployCountUsed;
- })
- },
- align: "center"
- }
- },
- "content.maxMonitorCount": {
- title: "证书监控数量",
- type: "text",
- form: {
- show: false,
- key: ["content", "maxMonitorCount"],
- component: {
- name: SuiteValueEdit,
- vModel: "modelValue",
- unit: "个"
- },
- rules: [{ required: true, message: "此项必填" }]
- },
- column: {
- width: 120,
- component: {
- name: SuiteValue,
- vModel: "modelValue",
- unit: "个"
- },
- align: "center"
- }
- },
- duration: {
- title: "时长",
- type: "text",
- form: { show: false },
- column: {
- component: {
- name: DurationValue,
- vModel: "modelValue"
- },
- width: 100,
- align: "center"
- }
- },
- status: {
- title: "状态",
- type: "text",
- form: { show: false },
- column: {
- width: 100,
- align: "center",
- component: {
- name: UserSuiteStatus,
- userSuite: compute(({ row }) => {
- return row;
- })
- },
- conditionalRender: {
- match() {
- return false;
- }
- }
- }
- },
- activeTime: {
- title: "激活时间",
- type: "date",
- column: {
- width: 150
- },
- form: {
- show: false
- }
- },
- expiresTime: {
- title: "过期时间",
- 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: "是否赠送",
- type: "dict-switch",
- dict: dict({
- data: [
- { label: "是", value: true, color: "success" },
- { label: "否", value: false, color: "blue" }
- ]
- }),
- form: {
- value: true,
- show: false
- },
- column: {
- width: 100,
- align: "center"
- }
- },
- createTime: {
- title: "创建时间",
- type: "datetime",
- form: {
- show: false
- },
- column: {
- sorter: true,
- width: 160,
- align: "center"
- }
- },
- updateTime: {
- title: "更新时间",
- type: "datetime",
- form: {
- show: false
- },
- column: {
- show: true,
- width: 160
- }
- }
- }
- }
- };
+ 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
+ }
+ }
+ }
+ }
+ };
}