From 4b2c4bd9e668467f28ba7676cccfb9d569b65ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 4 Sep 2024 00:25:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E6=8A=8A=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E8=AE=BE=E7=BD=AE=E3=80=81=E5=8F=82=E6=95=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E3=80=81=E5=9F=9F=E5=90=8D=E7=AE=A1=E7=90=86=E6=94=BE?= =?UTF-8?q?=E5=88=B0=E6=A6=82=E8=A7=88=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cms/link/model/index.ts | 2 + src/utils/common.ts | 8 ++- src/views/cms/link/components/link-edit.vue | 29 +++++--- src/views/cms/link/components/link-search.vue | 41 +++++++---- src/views/cms/link/index.vue | 72 ++++++++++++++++--- .../cms/navigation/components/design-edit.vue | 3 +- .../navigation/components/navigation-edit.vue | 11 ++- src/views/cms/website/components/search.vue | 48 ++++++------- src/views/cms/website/index.vue | 51 ++++++------- 9 files changed, 176 insertions(+), 89 deletions(-) diff --git a/src/api/cms/link/model/index.ts b/src/api/cms/link/model/index.ts index 7d7f821..40f5988 100644 --- a/src/api/cms/link/model/index.ts +++ b/src/api/cms/link/model/index.ts @@ -10,6 +10,7 @@ export interface Link { url?: string; linkType?: string; appId?: number; + categoryId?: number; userId?: number; comments?: string; recommend?: number; @@ -25,5 +26,6 @@ export interface Link { export interface LinkParam extends PageParam { id?: number; linkType?: string; + categoryId?: number; name?: string; } diff --git a/src/utils/common.ts b/src/utils/common.ts index 1f98f3a..f28e695 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -70,6 +70,7 @@ export function openUrl(url: string, params?: any): void { */ export function openSpmUrl(path: string, d?: any, id = 0): void { const domain = getSiteDomain(); + console.log(domain); const spm = ref(''); const token = ref(); const url = ref(); @@ -97,8 +98,7 @@ export function openSpmUrl(path: string, d?: any, id = 0): void { // 跳转页面 url.value = `${domain}${path}${spm.value}${token.value}`; - console.log(url.value); - window.open(url.value); + window.open(`https://${url.value}`); } /** @@ -152,6 +152,10 @@ export function navTo(url: string): void { window.location.href = url; } +export function push(path: string) { + router.push(path); +} + // 手机号脱敏 export function getMobile(tel: string) { const reg = /^(\d{3})\d{4}(\d{4})$/; diff --git a/src/views/cms/link/components/link-edit.vue b/src/views/cms/link/components/link-edit.vue index 05cb118..9587638 100644 --- a/src/views/cms/link/components/link-edit.vue +++ b/src/views/cms/link/components/link-edit.vue @@ -34,8 +34,21 @@ v-model:value="form.url" /> + + + (); // @@ -128,6 +142,7 @@ url: '', sortNumber: 100, linkType: undefined, + categoryId: undefined, comments: undefined }); @@ -140,13 +155,6 @@ trigger: 'blur' } ], - linkType: [ - { - required: true, - type: 'string', - trigger: 'blur' - } - ], url: [ { required: true, @@ -203,6 +211,11 @@ form.icon = ''; }; + // 选择栏目 + const onCategoryId = (id: number) => { + form.categoryId = id; + }; + /* 保存编辑 */ const save = () => { if (!formRef.value) { diff --git a/src/views/cms/link/components/link-search.vue b/src/views/cms/link/components/link-search.vue index ee4debb..cf41cfa 100644 --- a/src/views/cms/link/components/link-search.vue +++ b/src/views/cms/link/components/link-search.vue @@ -8,13 +8,24 @@ 添加网址 - + + + + + + + 重置 - 设置分类 + + + + + (), {} ); @@ -88,6 +97,12 @@ emit('add'); }; + // 按分类查询 + const onCategoryId = (id: number) => { + where.categoryId = id; + emit('search', where); + }; + // 批量删除 const removeBatch = () => { emit('remove'); diff --git a/src/views/cms/link/index.vue b/src/views/cms/link/index.vue index 0825357..81f4991 100644 --- a/src/views/cms/link/index.vue +++ b/src/views/cms/link/index.vue @@ -12,17 +12,34 @@ cache-key="proSystemLinkTable" >