From 00716a2f63cf9712f9ba97ee57c60a83f88147bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=8F=E6=9E=97?= <320730042@qq.com> Date: Fri, 24 May 2024 14:27:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20TR069=E7=BB=91=E5=AE=9A=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E4=BF=A1=E6=81=AF=E5=92=8C=E8=A7=A3=E7=BB=91=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/service/index.ts | 44 ++++++++ src/api/service/types.ts | 10 ++ src/components/WangEditor/index.vue | 7 -- src/router/index.ts | 28 ++++- src/views/login/index.vue | 4 +- .../tr069/components/BindingService.vue | 103 +++++++++++++++++ .../tr069/components/Tr069Service.vue | 106 ++++++++++++++++++ src/views/resources/tr069/index.vue | 21 +++- 8 files changed, 304 insertions(+), 19 deletions(-) create mode 100644 src/api/service/index.ts create mode 100644 src/api/service/types.ts create mode 100644 src/views/resources/tr069/components/BindingService.vue create mode 100644 src/views/resources/tr069/components/Tr069Service.vue diff --git a/src/api/service/index.ts b/src/api/service/index.ts new file mode 100644 index 0000000..3378172 --- /dev/null +++ b/src/api/service/index.ts @@ -0,0 +1,44 @@ +import { AxiosPromise } from "axios"; +import { ServicePageResult } from "@/api/service/types"; +import request from "@/utils/request"; + +export function tr069ServiceList( + data: PageQuery, + tr069VerId: number +): AxiosPromise { + return request({ + url: `/api/service/v1/tr069-service-list/${tr069VerId}`, + method: "POST", + data, + }); +} +export function noBindingServiceList( + data: PageQuery, + tr069VerId: number +): AxiosPromise { + return request({ + url: `/api/service/v1/no-binding-service/${tr069VerId}`, + method: "POST", + data, + }); +} + +export function bindingTr069Service( + data: number[], + tr069VerId: number +): AxiosPromise { + return request({ + url: `/api/service/v1/binding-service/${tr069VerId}`, + method: "POST", + data, + }); +} +export function removeBindingTr069Service( + servId: number, + tr069VerId: number +): AxiosPromise { + return request({ + url: `/api/service/v1/remove-binding-service/${servId}/${tr069VerId}`, + method: "DELETE", + }); +} diff --git a/src/api/service/types.ts b/src/api/service/types.ts new file mode 100644 index 0000000..265285e --- /dev/null +++ b/src/api/service/types.ts @@ -0,0 +1,10 @@ +import { DeviceServiceVO } from "@/api/device-type-ver/types"; + +export interface ServiceVO { + servId?: number; + servName?: string; + servVerName?: string; + servDisplayName?: string; + servDesc?: string; +} +export type ServicePageResult = PageResult; diff --git a/src/components/WangEditor/index.vue b/src/components/WangEditor/index.vue index 2f4c678..a2b98ad 100644 --- a/src/components/WangEditor/index.vue +++ b/src/components/WangEditor/index.vue @@ -23,7 +23,6 @@ import { Editor, Toolbar } from "@wangeditor/editor-for-vue"; // API 引用 -import { uploadFileApi } from "@/api/file"; const props = defineProps({ modelValue: { @@ -45,12 +44,6 @@ const editorConfig = ref({ MENU_CONF: { uploadImage: { // 自定义图片上传 - async customUpload(file: any, insertFn: any) { - uploadFileApi(file).then((response) => { - const url = response.data.url; - insertFn(url); - }); - }, }, }, }); diff --git a/src/router/index.ts b/src/router/index.ts index b7a6e9a..6a631f2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,12 +21,6 @@ export const constantRoutes: RouteRecordRaw[] = [ component: () => import("@/views/login/index.vue"), meta: { hidden: true }, }, - { - path: "/table", - component: () => import("@/views/table/index.vue"), - meta: { hidden: true }, - }, - { path: "/", name: "/", @@ -111,6 +105,28 @@ export const constantRoutes: RouteRecordRaw[] = [ title: "绑定设备类型", }, }, + { + path: "/resources/tr069-service/:tr069VerId", + name: "Tr069Service", + component: () => + import("@/views/resources/tr069/components/Tr069Service.vue"), + meta: { + hidden: true, + keepAlive: true, + title: "业务版本列表", + }, + }, + { + path: "/resources/binding-service/:tr069VerId", + name: "BindingService", + component: () => + import("@/views/resources/tr069/components/BindingService.vue"), + meta: { + hidden: true, + keepAlive: true, + title: "绑定业务版本", + }, + }, ], }, ]; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 7550599..4f1deae 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -124,8 +124,8 @@ const loginFormRef = ref(ElForm); // 登录表单ref const { height } = useWindowSize(); const loginData = ref({ - username: "admin", - password: "123456", + username: "", + password: "", }); const loginRules = computed(() => { diff --git a/src/views/resources/tr069/components/BindingService.vue b/src/views/resources/tr069/components/BindingService.vue new file mode 100644 index 0000000..ad0f1af --- /dev/null +++ b/src/views/resources/tr069/components/BindingService.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/views/resources/tr069/components/Tr069Service.vue b/src/views/resources/tr069/components/Tr069Service.vue new file mode 100644 index 0000000..2490691 --- /dev/null +++ b/src/views/resources/tr069/components/Tr069Service.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/src/views/resources/tr069/index.vue b/src/views/resources/tr069/index.vue index f1e40db..895e9ce 100644 --- a/src/views/resources/tr069/index.vue +++ b/src/views/resources/tr069/index.vue @@ -58,7 +58,11 @@ content="设备类型及软件版本列表" placement="top" > - + @@ -68,8 +72,12 @@ content="业务版本列表" placement="top" > - - + + @@ -94,7 +102,7 @@ import { getTr069Page } from "@/api/tr069"; import { downloadFileApi } from "@/api/file"; import { downloadHook } from "@/utils"; import AddTr069File from "@/views/resources/tr069/components/AddTr069File.vue"; -import { Pointer } from "@element-plus/icons-vue"; +import { Pointer, View } from "@element-plus/icons-vue"; defineOptions({ name: "Tr069", inheritAttrs: false, @@ -137,6 +145,11 @@ const skipDevTypeSoftVerList = (tr069VerId?: number) => { path: `/resources/tr069-dev-type-soft-ver/${tr069VerId}`, }); }; +const skipService = (tr069VerId?: number) => { + router.push({ + path: `/resources/tr069-service/${tr069VerId}`, + }); +}; onMounted(() => { loadTr069Page(); });