From a2e6ac2c87faff0b6e6127742d3d96f1e3d4d756 Mon Sep 17 00:00:00 2001 From: zhouhetao <1678771336@qq.com> Date: Wed, 31 May 2023 10:37:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E5=92=8C=20=E5=B9=BF=E5=91=8A=E4=BD=8D?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=20=E5=B9=B6=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/site/adv.ts | 81 ++++ src/api/site/advPromotion.ts | 69 ++++ src/router/modules/site.ts | 18 + .../rushPurchase/rushPurchaseOrder.vue | 1 + .../site/advertisingList/advertisingList.vue | 384 ++++++++++++++++++ src/views/site/advertisingList/columns.ts | 63 +++ src/views/site/advpromotion/advpromotion.vue | 230 +++++++++++ src/views/site/advpromotion/columns.ts | 34 ++ src/views/site/article/articleCreate.vue | 1 + 9 files changed, 881 insertions(+) create mode 100644 src/api/site/adv.ts create mode 100644 src/api/site/advPromotion.ts create mode 100644 src/views/site/advertisingList/advertisingList.vue create mode 100644 src/views/site/advertisingList/columns.ts create mode 100644 src/views/site/advpromotion/advpromotion.vue create mode 100644 src/views/site/advpromotion/columns.ts diff --git a/src/api/site/adv.ts b/src/api/site/adv.ts new file mode 100644 index 0000000..522de3c --- /dev/null +++ b/src/api/site/adv.ts @@ -0,0 +1,81 @@ +import { http } from '@/utils/http/axios'; + +export interface BasicResponseModel { + code: number; + message: string; + result: T; +} + +/** + * @description: 广告表列表 + */ +export function getAdvPage(params?) { + return http.request({ + url: '/site/adv/page', + method: 'GET', + params, + }); +} +//isTransformResponse true不进行任何处理直接返回, false会进行处理后返回 例如权限不够都会处理 +/** + * 保存广告表 + * @param params + */ +export function saveAdv(params?) { + return http.request( + { + url: `/site/adv`, + method: 'POST', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 编辑广告表 + * @param params + */ +export function updateAdv(params?) { + return http.request( + { + url: `/site/adv/${params.id}`, + method: 'PUT', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 删除广告表 + * @param params + */ +export function deleteAdv(params?) { + return http.request( + { + url: `/site/adv/${params.id}`, + method: 'DELETE', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * @description: 广告位类别 + */ +export function getPromotionList(params?) { + return http.request({ + url: '/site/promotion/list', + method: 'GET', + params, + }); +} + diff --git a/src/api/site/advPromotion.ts b/src/api/site/advPromotion.ts new file mode 100644 index 0000000..c48b0dc --- /dev/null +++ b/src/api/site/advPromotion.ts @@ -0,0 +1,69 @@ +import { http } from '@/utils/http/axios'; + +export interface BasicResponseModel { + code: number; + message: string; + result: T; +} + +/** + * @description: 广告位列表 + */ +export function getAdvPromotionPage(params?) { + return http.request({ + url: '/site/promotion/page', + method: 'GET', + params, + }); +} +//isTransformResponse true不进行任何处理直接返回, false会进行处理后返回 例如权限不够都会处理 +/** + * 保存广告位 + * @param params + */ +export function saveAdvPromotion(params?) { + return http.request( + { + url: `/site/promotion`, + method: 'POST', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 编辑广告位 + * @param params + */ +export function updateAdvPromotion(params?) { + return http.request( + { + url: `/site/promotion/${params.id}`, + method: 'PUT', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 删除广告位 + * @param params + */ +export function deleteAdvPromotion(params?) { + return http.request( + { + url: `/site/promotion/${params.id}`, + method: 'DELETE', + params, + }, + { + isTransformResponse: false, + } + ); +} diff --git a/src/router/modules/site.ts b/src/router/modules/site.ts index c4d81fc..a1458ba 100755 --- a/src/router/modules/site.ts +++ b/src/router/modules/site.ts @@ -37,6 +37,24 @@ const routes: Array = [ }, component: () => import('@/views/site/articleList/articleList.vue'), }, + { + path: 'advertising-list', + name: 'advertisingList', + meta: { + title: '广告管理', + permissions: ['adv_list'], + }, + component: () => import('@/views/site/advertisingList/advertisingList.vue'), + }, + { + path: 'advertising-space-list', + name: 'advertisingSpaceList', + meta: { + title: '广告位管理', + permissions: ['adv_promotion'], + }, + component: () => import('@/views/site/advpromotion/advpromotion.vue'), + }, { path: 'article-create/:id?', name: 'articleCreate', diff --git a/src/views/promotion/rushPurchase/rushPurchaseOrder.vue b/src/views/promotion/rushPurchase/rushPurchaseOrder.vue index 4c98a7d..5bb84d0 100644 --- a/src/views/promotion/rushPurchase/rushPurchaseOrder.vue +++ b/src/views/promotion/rushPurchase/rushPurchaseOrder.vue @@ -203,6 +203,7 @@ }; function handSwitchStatus(status) { + console.log(status) params.value = { ...params.value, status }; reloadTable(); } diff --git a/src/views/site/advertisingList/advertisingList.vue b/src/views/site/advertisingList/advertisingList.vue new file mode 100644 index 0000000..4d04c2e --- /dev/null +++ b/src/views/site/advertisingList/advertisingList.vue @@ -0,0 +1,384 @@ + + + + + + \ No newline at end of file diff --git a/src/views/site/advertisingList/columns.ts b/src/views/site/advertisingList/columns.ts new file mode 100644 index 0000000..74876d4 --- /dev/null +++ b/src/views/site/advertisingList/columns.ts @@ -0,0 +1,63 @@ +import { formatToDateTime } from '@/utils/dateUtil'; +import { h } from 'vue'; +import { NImage } from 'naive-ui'; +import { getPromotionList } from '@/api/site/adv'; + +export const columns = [ + { + title: 'id', + key: 'id', + width: 60, + }, + { + title: '广告名称', + key: 'advName', + width: 120, + }, + { + title: '广告图片地址', + key: 'advImg', + width: 140, + render: (data) => { + return h(NImage, { + src: data.advImg, + width: 50, + }); + }, + }, + { + title: '广告地址', + key: 'url', + width: 160, + }, + { + title: '所属广告位', + key: 'promotionName', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 100, + render: (data) => { + try { + const createTime = data.createTime * 1000; + return formatToDateTime(createTime); + } catch (error) { + console.log(error); + return data.createTime; + } + }, + }, + ]; + + + const response = await getPromotionList(); + export let dataoptopns = [] + dataoptopns= response.map((item:any)=>{ + return { + ...item, + label:item.promotionName, + value:item.id + } + }) \ No newline at end of file diff --git a/src/views/site/advpromotion/advpromotion.vue b/src/views/site/advpromotion/advpromotion.vue new file mode 100644 index 0000000..4ddce42 --- /dev/null +++ b/src/views/site/advpromotion/advpromotion.vue @@ -0,0 +1,230 @@ + + + + + + \ No newline at end of file diff --git a/src/views/site/advpromotion/columns.ts b/src/views/site/advpromotion/columns.ts new file mode 100644 index 0000000..78f7d11 --- /dev/null +++ b/src/views/site/advpromotion/columns.ts @@ -0,0 +1,34 @@ +import { formatToDateTime } from '@/utils/dateUtil'; + +export const columns = [ + { + title: 'id', + key: 'id', + width: 100, + }, + { + title: '广告位名称', + key: 'promotionName', + width: 100, + }, + { + title: '广告位模块编码', + key: 'promotionCode', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 100, + render: (data) => { + try { + const createTime = data.createTime * 1000; + return formatToDateTime(createTime); + } catch (error) { + console.log(error); + return data.createTime; + } + }, + }, + ]; + \ No newline at end of file diff --git a/src/views/site/article/articleCreate.vue b/src/views/site/article/articleCreate.vue index ad9c262..4adaec9 100644 --- a/src/views/site/article/articleCreate.vue +++ b/src/views/site/article/articleCreate.vue @@ -128,6 +128,7 @@ const containerRef = ref(undefined); const toolsRef = ref(undefined); const uploadList = ref([]); + console.log(uploadList); const formBtnLoading = ref(false); const formRef: any = ref(null); const message = useMessage(); -- Gitee