From 228cacdf2a787f8abbab850ad022d7b1323d1579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sun, 22 Sep 2024 01:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BD=91=E7=AB=99=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/api/cms/cmsArticle/index.ts | 16 +- src/api/cms/cmsArticle/model/index.ts | 6 +- src/api/cms/cmsNavigation/model/index.ts | 3 + src/utils/common.ts | 17 +- src/views/cms/article/index.vue | 2 +- .../cms/cmsArticle/components/articleEdit.vue | 512 ++++++++++++++++++ .../cmsArticle/components/cmsArticleEdit.vue | 400 -------------- .../cms/cmsArticle/components/search.vue | 128 ++++- .../cmsArticle/dictionary/source-select.vue | 51 ++ src/views/cms/cmsArticle/index.vue | 352 ++++++------ src/views/cms/cmsNavigation/index.vue | 13 +- .../cms/cmsWebsite/components/search.vue | 37 +- .../{cmsWebsiteEdit.vue => websiteEdit.vue} | 21 +- src/views/cms/cmsWebsite/index.vue | 4 +- src/views/cms/navigation/index.vue | 24 +- .../cms/website/components/websiteEdit.vue | 9 +- .../oa/website/components/websiteEdit.vue | 1 - src/views/shop/goods/index.vue | 2 +- src/views/system/domain/index.vue | 6 +- src/views/system/profile/components/field.vue | 1 - src/views/system/profile/index.vue | 89 +-- 22 files changed, 978 insertions(+), 720 deletions(-) create mode 100644 src/views/cms/cmsArticle/components/articleEdit.vue delete mode 100644 src/views/cms/cmsArticle/components/cmsArticleEdit.vue create mode 100644 src/views/cms/cmsArticle/dictionary/source-select.vue rename src/views/cms/cmsWebsite/components/{cmsWebsiteEdit.vue => websiteEdit.vue} (95%) diff --git a/.env.development b/.env.development index 9c0c795..013ec41 100644 --- a/.env.development +++ b/.env.development @@ -2,10 +2,10 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com #VITE_SERVER_URL=https://server.gxwebsoft.com/api VITE_THINK_URL=https://gxtyzx-api.websoft.top/api -VITE_API_URL=https://modules.gxwebsoft.com/api +#VITE_API_URL=https://modules.gxwebsoft.com/api VITE_SERVER_URL=http://127.0.0.1:9090/api -#VITE_API_URL=http://127.0.0.1:9001/api +VITE_API_URL=http://127.0.0.1:9001/api #VITE_THINK_URL=http://127.0.0.1:9099/api #/booking/bookingItem diff --git a/src/api/cms/cmsArticle/index.ts b/src/api/cms/cmsArticle/index.ts index b680430..20aef13 100644 --- a/src/api/cms/cmsArticle/index.ts +++ b/src/api/cms/cmsArticle/index.ts @@ -1,14 +1,14 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { CmsArticle, CmsArticleParam } from './model'; -import { MODULES_API_URL } from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询文章 */ export async function pageCmsArticle(params: CmsArticleParam) { const res = await request.get>>( - MODULES_API_URL + '/cms/cms-article/page', + SERVER_API_URL + '/cms/cms-article/page', { params } @@ -24,7 +24,7 @@ export async function pageCmsArticle(params: CmsArticleParam) { */ export async function listCmsArticle(params?: CmsArticleParam) { const res = await request.get>( - MODULES_API_URL + '/cms/cms-article', + SERVER_API_URL + '/cms/cms-article', { params } @@ -40,7 +40,7 @@ export async function listCmsArticle(params?: CmsArticleParam) { */ export async function addCmsArticle(data: CmsArticle) { const res = await request.post>( - MODULES_API_URL + '/cms/cms-article', + SERVER_API_URL + '/cms/cms-article', data ); if (res.data.code === 0) { @@ -54,7 +54,7 @@ export async function addCmsArticle(data: CmsArticle) { */ export async function updateCmsArticle(data: CmsArticle) { const res = await request.put>( - MODULES_API_URL + '/cms/cms-article', + SERVER_API_URL + '/cms/cms-article', data ); if (res.data.code === 0) { @@ -68,7 +68,7 @@ export async function updateCmsArticle(data: CmsArticle) { */ export async function removeCmsArticle(id?: number) { const res = await request.delete>( - MODULES_API_URL + '/cms/cms-article/' + id + SERVER_API_URL + '/cms/cms-article/' + id ); if (res.data.code === 0) { return res.data.message; @@ -81,7 +81,7 @@ export async function removeCmsArticle(id?: number) { */ export async function removeBatchCmsArticle(data: (number | undefined)[]) { const res = await request.delete>( - MODULES_API_URL + '/cms/cms-article/batch', + SERVER_API_URL + '/cms/cms-article/batch', { data } @@ -97,7 +97,7 @@ export async function removeBatchCmsArticle(data: (number | undefined)[]) { */ export async function getCmsArticle(id: number) { const res = await request.get>( - MODULES_API_URL + '/cms/cms-article/' + id + SERVER_API_URL + '/cms/cms-article/' + id ); if (res.data.code === 0 && res.data.data) { return res.data.data; diff --git a/src/api/cms/cmsArticle/model/index.ts b/src/api/cms/cmsArticle/model/index.ts index 7af82cf..91885c0 100644 --- a/src/api/cms/cmsArticle/model/index.ts +++ b/src/api/cms/cmsArticle/model/index.ts @@ -16,8 +16,10 @@ export interface CmsArticle { showType?: number; // 话题 topic?: string; - // 文章分类ID + // 栏目ID categoryId?: number; + // 栏目名称 + categoryName?: string; // 封面图 image?: string; // 来源 @@ -52,6 +54,8 @@ export interface CmsArticle { commentNumbers?: number; // 提醒谁看 toUsers?: string; + // 文章内容 + content?: string; // 用户ID userId?: number; // 排序(数字越小越靠前) diff --git a/src/api/cms/cmsNavigation/model/index.ts b/src/api/cms/cmsNavigation/model/index.ts index 66a514a..061984c 100644 --- a/src/api/cms/cmsNavigation/model/index.ts +++ b/src/api/cms/cmsNavigation/model/index.ts @@ -71,6 +71,9 @@ export interface CmsNavigation { // 创建时间 createTime?: string; children?: CmsNavigation[]; + disabled?: boolean; + label?: string; + value?: number; } /** diff --git a/src/utils/common.ts b/src/utils/common.ts index 4e7e170..2c48243 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -10,7 +10,7 @@ import { ChatMessage } from '@/api/system/chat/model'; import { useUserStore } from '@/store/modules/user'; import CryptoJS from 'crypto-js'; import { useRouter } from 'vue-router'; -import { getSiteDomain, getTenantId } from '@/utils/domain'; +import { getSiteDomain } from '@/utils/domain'; import { uuid } from 'ele-admin-pro'; type Events = { @@ -73,24 +73,18 @@ export function openSpmUrl(path: string, d?: any, id = 0): void { const spm = ref(''); const token = ref(); const url = ref(); - const tid = getTenantId() || 0; + const tid = d?.tenantId || 0; const pid = d?.parentId || 0; const cid = d?.categoryId || 0; const uid = localStorage.getItem('UserId') || 0; const timestamp = ref(Date.now() / 1000); token.value = `&token=${uuid()}`; - // TODO 不传data - // if (!d) { - // window.open(`${domain}${path}`); - // return; - // } - // TODO 封装租户ID和店铺ID spm.value = `?spm=c.${uid}.${tid}.${pid}.${cid}.${id}.${timestamp.value}`; // TODO 含http直接跳转 - if (path.slice(0, 4) == 'http') { + if (path.startsWith('http')) { window.open(`${path}${spm.value}`); return; } @@ -413,5 +407,8 @@ export const getIdBySpm = (index: number) => { * 提取传参中的token */ export const getTokenBySpm = () => { - return JSON.parse(router.currentRoute.value.query.token); + const token = router.currentRoute.value.query.token; + if (token) { + return JSON.parse(`${token}`); + } }; diff --git a/src/views/cms/article/index.vue b/src/views/cms/article/index.vue index 61764ce..d10aa19 100644 --- a/src/views/cms/article/index.vue +++ b/src/views/cms/article/index.vue @@ -31,7 +31,7 @@ class="cursor-pointer" @click=" openSpmUrl( - `/article/detail/${record.articleId}.html`, + `/article/detail/${record.articleId}`, record, record.articleId ) diff --git a/src/views/cms/cmsArticle/components/articleEdit.vue b/src/views/cms/cmsArticle/components/articleEdit.vue new file mode 100644 index 0000000..aa4d9ac --- /dev/null +++ b/src/views/cms/cmsArticle/components/articleEdit.vue @@ -0,0 +1,512 @@ + + + + diff --git a/src/views/cms/cmsArticle/components/cmsArticleEdit.vue b/src/views/cms/cmsArticle/components/cmsArticleEdit.vue deleted file mode 100644 index 6165feb..0000000 --- a/src/views/cms/cmsArticle/components/cmsArticleEdit.vue +++ /dev/null @@ -1,400 +0,0 @@ - - - - diff --git a/src/views/cms/cmsArticle/components/search.vue b/src/views/cms/cmsArticle/components/search.vue index 82fea9d..e04b709 100644 --- a/src/views/cms/cmsArticle/components/search.vue +++ b/src/views/cms/cmsArticle/components/search.vue @@ -7,24 +7,87 @@ 添加 + + 已发布({{ articleCount?.totalNum }}) + 待审核({{ articleCount?.totalNum2 }}) + 已驳回({{ articleCount?.totalNum3 }}) + + + + + 重置 diff --git a/src/views/cms/cmsArticle/dictionary/source-select.vue b/src/views/cms/cmsArticle/dictionary/source-select.vue new file mode 100644 index 0000000..6b79072 --- /dev/null +++ b/src/views/cms/cmsArticle/dictionary/source-select.vue @@ -0,0 +1,51 @@ + + + + diff --git a/src/views/cms/cmsArticle/index.vue b/src/views/cms/cmsArticle/index.vue index e18b27d..075bd3c 100644 --- a/src/views/cms/cmsArticle/index.vue +++ b/src/views/cms/cmsArticle/index.vue @@ -4,10 +4,11 @@ @@ -15,18 +16,64 @@