From 2ed35bd1ac97f34872cecac3f95bacfaabdbd3aa Mon Sep 17 00:00:00 2001 From: huccct <2972223145@qq.com> Date: Wed, 24 May 2023 20:58:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(trademark):=20=E9=A1=B5=E9=9D=A2=E5=88=9D?= =?UTF-8?q?=E6=AD=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto-imports.d.ts | 2 +- src/api/product/trademark/index.ts | 12 +++- src/views/product/trademark/index.vue | 90 +++++++++++++++++++++++---- tsconfig.json | 8 ++- 4 files changed, 98 insertions(+), 14 deletions(-) diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 918aad8..ccbac87 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -4,5 +4,5 @@ // Generated by unplugin-auto-import export {} declare global { - + const ElMessage: typeof import('element-plus/es')['ElMessage'] } diff --git a/src/api/product/trademark/index.ts b/src/api/product/trademark/index.ts index c0a71ec..2cb5a7e 100644 --- a/src/api/product/trademark/index.ts +++ b/src/api/product/trademark/index.ts @@ -1,10 +1,20 @@ import request from '@/utils/request' -import type { TradeMarkResponseData } from './type' +import type { TradeMark, TradeMarkResponseData } from './type' enum API { TRADEMARK_URL = '/admin/product/baseTrademark/', + ADDTRADEMARK_URL = '/admin/product/baseTrademark/save', + UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update', } export const reqHasTradeMark = (page: number, limit: number) => request.get( API.TRADEMARK_URL + `${page}/${limit}`, ) + +export const reqAddOrUpdateTrademark = (data: TradeMark) => { + if (data.id) { + return request.put(API.UPDATETRADEMARK_URL, data) + } else { + return request.post(API.ADDTRADEMARK_URL, data) + } +} diff --git a/src/views/product/trademark/index.vue b/src/views/product/trademark/index.vue index 5a1602a..3b87235 100644 --- a/src/views/product/trademark/index.vue +++ b/src/views/product/trademark/index.vue @@ -3,15 +3,20 @@ * @Author: Huccct * @Date: 2023-05-21 16:19:15 * @LastEditors: Huccct - * @LastEditTime: 2023-05-24 16:08:56 + * @LastEditTime: 2023-05-24 20:56:32 --> @@ -103,20 +161,30 @@ const confirm = () => { /> - + - + - + diff --git a/tsconfig.json b/tsconfig.json index 49319fc..ceb893e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,6 +32,12 @@ "noUnusedParameters": false, "noFallthroughCasesInSwitch": true }, - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], + "include": [ + "src/**/*.ts", + "src/**/*.d.ts", + "src/**/*.tsx", + "src/**/*.vue", + "auto-imports.d.ts" + ], "references": [{ "path": "./tsconfig.node.json" }] }