diff --git a/apps/web-antd/src/api/license/license/index.ts b/apps/web-antd/src/api/license/license/index.ts
index 806f4fa..03af844 100644
--- a/apps/web-antd/src/api/license/license/index.ts
+++ b/apps/web-antd/src/api/license/license/index.ts
@@ -12,7 +12,7 @@ export namespace LicenseApi {
projectId?: number; // 项目ID
serialNo?: string; // sn
expiryDate: Dayjs | string; // 到期时间
- neList: number[]; // 网元开关
+ neList: number[]; // 网元
userNumber: number; // 用户数
ranNumber: number; // 基站数
activationCode: string; // 激活码
@@ -24,6 +24,12 @@ export namespace LicenseApi {
status: number; // 状态
remark: string; // 备注
action: number; // 操作
+ neCodeList: NeCode[]; // 操作
+ }
+ export interface NeCode {
+ id: number; // 主键
+ neList: number[]; // 网元开关
+ activationCode: string; // 激活码
}
}
diff --git a/apps/web-antd/src/locales/langs/en-US/license.json b/apps/web-antd/src/locales/langs/en-US/license.json
index e4cb681..d2273e0 100644
--- a/apps/web-antd/src/locales/langs/en-US/license.json
+++ b/apps/web-antd/src/locales/langs/en-US/license.json
@@ -26,5 +26,9 @@
"download": "Download",
"downloadFailed": "Download failed, please try again later",
"licenseFile": "License File",
- "applySuccess": "Application successful, email reminder sent, please wait for approval"
+ "applySuccess": "Application successful, email reminder sent, please wait for approval",
+ "addNe": "Add Network Elements",
+ "enterCode": "Please enter Activation Code",
+ "selectNe": "Please select Network Element",
+ "detail": "detail"
}
diff --git a/apps/web-antd/src/locales/langs/zh-CN/license.json b/apps/web-antd/src/locales/langs/zh-CN/license.json
index 9b83d41..43e4a81 100644
--- a/apps/web-antd/src/locales/langs/zh-CN/license.json
+++ b/apps/web-antd/src/locales/langs/zh-CN/license.json
@@ -26,5 +26,9 @@
"download": "下载",
"downloadFailed": "下载失败,请稍后重试",
"licenseFile": "License文件",
- "applySuccess": "申请成功,已发送邮件提醒,请等待审核"
+ "applySuccess": "申请成功,已发送邮件提醒,请等待审核",
+ "addNe": "添加网元",
+ "enterCode": "请输入激活码",
+ "selectNe": "请选择网元",
+ "detail": "详情"
}
diff --git a/apps/web-antd/src/views/license/license/components/detail.vue b/apps/web-antd/src/views/license/license/components/detail.vue
new file mode 100644
index 0000000..a104b0a
--- /dev/null
+++ b/apps/web-antd/src/views/license/license/components/detail.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
diff --git a/apps/web-antd/src/views/license/license/components/ne-code.vue b/apps/web-antd/src/views/license/license/components/ne-code.vue
new file mode 100644
index 0000000..f26c17f
--- /dev/null
+++ b/apps/web-antd/src/views/license/license/components/ne-code.vue
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+ {{ $t('license.addNe') }}
+
+
+
+
diff --git a/apps/web-antd/src/views/license/license/data.ts b/apps/web-antd/src/views/license/license/data.ts
index a99d906..cd41a04 100644
--- a/apps/web-antd/src/views/license/license/data.ts
+++ b/apps/web-antd/src/views/license/license/data.ts
@@ -8,16 +8,14 @@ import type { DescriptionItemSchema } from '#/components/description';
import { h, ref } from 'vue';
import { useAccess } from '@vben/access';
-import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils';
-
-import { Button, message } from 'ant-design-vue';
+import { formatDateTime } from '@vben/utils';
import { z } from '#/adapter/form';
import { getCustomerList } from '#/api/license/customer';
import { isLicenseSnUnique } from '#/api/license/license';
import { getProjectList } from '#/api/license/project';
import { getLicenseAdminList, getSimpleUserList } from '#/api/system/user';
-import { DictTag, DictTagGroup } from '#/components/dict-tag';
+import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
@@ -128,18 +126,26 @@ export function useFormSchema(): VbenFormSchema[] {
valueFormat: 'x',
},
},
+ // {
+ // fieldName: 'neList',
+ // label: $t('license.neList'),
+ // component: 'CheckboxGroup',
+ // formItemClass: 'col-span-2',
+ // modelPropName: 'modelValue',
+ // },
+ // {
+ // fieldName: 'activationCode',
+ // label: $t('license.activationCode'),
+ // component: 'Textarea',
+ // formItemClass: 'col-span-2',
+ // },
{
- fieldName: 'neList',
+ fieldName: 'neCodeList',
label: $t('license.neList'),
- component: 'CheckboxGroup',
+ component: '',
formItemClass: 'col-span-2',
modelPropName: 'modelValue',
- },
- {
- fieldName: 'activationCode',
- label: $t('license.activationCode'),
- component: 'Textarea',
- formItemClass: 'col-span-2',
+ rules: z.string(),
},
// {
// fieldName: 'licenseContent',
@@ -408,7 +414,15 @@ export function useGridColumns(
minWidth: 120,
cellRender: {
name: 'CellDictGroup',
- props: { type: DICT_TYPE.LIC_NE_LIST },
+ props: {
+ type: [
+ DICT_TYPE.LIC_NE_ALL,
+ DICT_TYPE.LIC_NE_5G,
+ DICT_TYPE.LIC_NE_4G,
+ DICT_TYPE.LIC_NE_23G,
+ DICT_TYPE.LIC_NE_ADD,
+ ],
+ },
},
},
{
@@ -487,10 +501,14 @@ export function useGridColumns(
},
name: 'CellOperation',
options: [
- // {
- // code: 'edit',
- // show: hasAccessByCodes(['license:license:update']),
- // },
+ {
+ code: 'detail',
+ text: $t('license.detail'),
+ },
+ {
+ code: 'edit',
+ show: hasAccessByCodes(['license:license:update']),
+ },
{
code: 'apply',
text: $t('license.apply'),
@@ -550,16 +568,16 @@ export function useDetailSchema(): DescriptionItemSchema[] {
return formatDateTime(data?.expiryDate) as string;
},
},
- {
- field: 'neList',
- label: $t('license.neList'),
- content: (data) => {
- return h(DictTagGroup, {
- type: DICT_TYPE.LIC_NE_LIST,
- value: data.neList,
- });
- },
- },
+ // {
+ // field: 'neList',
+ // label: $t('license.neList'),
+ // content: (data) => {
+ // return h(DictTagGroup, {
+ // type: DICT_TYPE.LIC_NE_LIST,
+ // value: data.neList,
+ // });
+ // },
+ // },
{
field: 'userNumber',
label: $t('license.userNumber'),
@@ -592,58 +610,59 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'remark',
label: $t('license.remark'),
+ hidden: (data) => data,
},
- {
- field: 'fileUrl',
- label: $t('license.licenseFile'),
- hidden: (data) => data.status !== 2,
- content: (data) => {
- const fileName = `${data.fileUrl?.slice(
- Math.max(0, data.fileUrl.lastIndexOf('/') + 1),
- data.fileUrl.lastIndexOf('_'),
- )}.ini`;
- // 创建下载链接
- const link = h(
- 'span',
- {
- style: {
- marginRight: '15px',
- },
- },
- fileName,
- );
+ // {
+ // field: 'fileUrl',
+ // label: $t('license.licenseFile'),
+ // hidden: (data) => data.status !== 2,
+ // content: (data) => {
+ // const fileName = `${data.fileUrl?.slice(
+ // Math.max(0, data.fileUrl.lastIndexOf('/') + 1),
+ // data.fileUrl.lastIndexOf('_'),
+ // )}.ini`;
+ // // 创建下载链接
+ // const link = h(
+ // 'span',
+ // {
+ // style: {
+ // marginRight: '15px',
+ // },
+ // },
+ // fileName,
+ // );
- // 创建下载按钮
- const button = h(
- Button,
- {
- onClick: async () => {
- const res = await fetch(data.fileUrl);
- if (!res.ok) {
- message.error($t('license.downloadFailed'));
- return;
- }
- const blob = await res.blob();
+ // // 创建下载按钮
+ // const button = h(
+ // Button,
+ // {
+ // onClick: async () => {
+ // const res = await fetch(data.fileUrl);
+ // if (!res.ok) {
+ // message.error($t('license.downloadFailed'));
+ // return;
+ // }
+ // const blob = await res.blob();
- downloadFileFromBlobPart({ fileName, source: blob });
- },
- type: 'primary',
- },
- $t('license.download'),
- );
+ // downloadFileFromBlobPart({ fileName, source: blob });
+ // },
+ // type: 'primary',
+ // },
+ // $t('license.download'),
+ // );
- // 包裹容器
- return h(
- 'div',
- {
- style: {
- display: 'flex',
- alignItems: 'center',
- },
- },
- [link, button],
- );
- },
- },
+ // // 包裹容器
+ // return h(
+ // 'div',
+ // {
+ // style: {
+ // display: 'flex',
+ // alignItems: 'center',
+ // },
+ // },
+ // [link, button],
+ // );
+ // },
+ // },
];
}
diff --git a/apps/web-antd/src/views/license/license/generate/index.vue b/apps/web-antd/src/views/license/license/generate/index.vue
index c4c1f09..9c8eb33 100644
--- a/apps/web-antd/src/views/license/license/generate/index.vue
+++ b/apps/web-antd/src/views/license/license/generate/index.vue
@@ -11,10 +11,9 @@ import { useTabs } from '@vben/hooks';
import { Button, message } from 'ant-design-vue';
import { generateLicense, getLicense } from '#/api/license/license';
-import { useDescription } from '#/components/description';
import { $t } from '#/locales';
-import { useDetailSchema } from '../data';
+import Detail from '../components/detail.vue';
const { hasAccessByCodes } = useAccess();
@@ -23,15 +22,6 @@ const router = useRouter();
const loading = ref(false);
const formData = ref();
-const [Description] = useDescription({
- componentProps: {
- bordered: true,
- column: 1,
- class: 'mx-4',
- },
- schema: useDetailSchema(),
-});
-
/** 获取详情数据 */
async function getDetail(id: any) {
if (!id) {
@@ -39,7 +29,8 @@ async function getDetail(id: any) {
}
loading.value = true;
try {
- formData.value = await getLicense(id);
+ const details = await getLicense(id);
+ formData.value = details;
} finally {
loading.value = false;
}
@@ -96,9 +87,7 @@ getDetail(route.query.id);
-
-
-
+