From 56a17cb6a2745429dc63317d56a37aedbfa2276f Mon Sep 17 00:00:00 2001 From: lizhong Date: Thu, 30 Mar 2023 01:04:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 9 +++ .gitignore | 1 - .idea/workspace.xml | 16 +++-- api/Common.ts | 5 ++ components/Banner/Search.vue | 59 ++++++++-------- components/Header/Index.vue | 37 +++++++--- composables/useAppStore.ts | 8 ++- layouts/tabLayout.vue | 16 ++++- middleware/isSearch.ts | 21 ++++++ pages/search/[id].vue | 129 +++++++++++++++++++++++++++++++++++ pages/translate.vue | 78 +++++++++------------ 11 files changed, 288 insertions(+), 91 deletions(-) create mode 100644 .env create mode 100644 middleware/isSearch.ts create mode 100644 pages/search/[id].vue diff --git a/.env b/.env new file mode 100644 index 0000000..467dfc6 --- /dev/null +++ b/.env @@ -0,0 +1,9 @@ +# port +VITE_PORT = 3100 + +# spa-title +VITE_GLOB_APP_TITLE=湛江水产品技术性贸易措施研究评议基地 +VITE_GLOB_API_URL=/api +VITE_GLOB_ORIGIN=http://research.mcnetmart.com +# spa shortname +VITE_GLOB_APP_SHORT_NAME= diff --git a/.gitignore b/.gitignore index fc9894a..27b021f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ node_modules .nitro .cache .output -.env .env.local .env.development dist diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9e49856..61a59b3 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,12 +5,16 @@ - + + + - - + + + + + - @@ -138,7 +142,7 @@ - + 1680082088939 diff --git a/api/Common.ts b/api/Common.ts index 15f72d3..43aa617 100644 --- a/api/Common.ts +++ b/api/Common.ts @@ -5,6 +5,7 @@ export default new class Common extends Http> { private readonly upload = '/common/upload' private readonly caseList = '/cases/lists' private readonly bottomMenu = '/index/bottomMenu' + private readonly search_url = '/index/search' private readonly login_url = '/user/login' handleUpload(file: any) { const formData = new FormData(); @@ -22,5 +23,9 @@ export default new class Common extends Http> { return this.post(this.login_url,this.toFormData(data)) } + searchApi(params: PaginationVo & {category_id?: number}){ + return this.get(this.search_url, params) + } + } diff --git a/components/Banner/Search.vue b/components/Banner/Search.vue index d1ee896..1b9f4b8 100644 --- a/components/Banner/Search.vue +++ b/components/Banner/Search.vue @@ -1,32 +1,6 @@ - + diff --git a/components/Header/Index.vue b/components/Header/Index.vue index 34e1693..cc937c9 100644 --- a/components/Header/Index.vue +++ b/components/Header/Index.vue @@ -3,7 +3,7 @@ :class="[prefixCls, 'flex', 'justify-between', store.getMenuTheme === 'dark'? 'is-host' : 'is-white']">