From aa85c133e374d925fca08f7bd4aa9742b14631b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Tue, 3 Sep 2024 01:13:18 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=AF=BC=E8=88=AA?=
=?UTF-8?q?=E6=A0=8F=E7=9B=AE=E8=AE=BE=E8=AE=A1=E6=8B=86=E5=88=86=E7=AE=80?=
=?UTF-8?q?=E5=8D=95=E5=92=8C=E9=AB=98=E7=BA=A7=E5=B1=95=E7=A4=BA=E6=96=B9?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 4 +-
src/api/cms/design/model/index.ts | 6 +
src/layout/index.vue | 8 +-
src/utils/domain.ts | 4 +
.../cms/article/components/articleEdit.vue | 109 +------
src/views/cms/article/components/search.vue | 21 +-
src/views/cms/article/index.vue | 48 ++-
.../cms/design/components/design-edit.vue | 136 ++++++---
src/views/cms/design/components/search.vue | 21 +-
src/views/cms/design/index.vue | 80 ++---
.../record/components/designRecordEdit.vue | 250 ++++++++++++++++
.../cms/design/record/components/search.vue | 42 +++
src/views/cms/design/record/index.vue | 276 ++++++++++++++++++
.../cms/domain/components/domain-edit.vue | 4 +-
src/views/cms/domain/index.vue | 24 +-
.../field/components/website-field-edit.vue | 19 +-
src/views/cms/field/index.vue | 22 +-
.../cms/navigation/components/design-edit.vue | 220 ++++++++++----
.../navigation/components/navigation-edit.vue | 38 ++-
src/views/cms/navigation/index.vue | 74 +++--
src/views/cms/website/components/search.vue | 5 +-
.../cms/website/components/websiteEdit.vue | 31 +-
src/views/cms/website/index.vue | 12 +-
src/views/system/profile/index.vue | 20 +-
24 files changed, 1121 insertions(+), 353 deletions(-)
create mode 100644 src/views/cms/design/record/components/designRecordEdit.vue
create mode 100644 src/views/cms/design/record/components/search.vue
create mode 100644 src/views/cms/design/record/index.vue
diff --git a/.env.development b/.env.development
index 013ec41..aa39b41 100644
--- a/.env.development
+++ b/.env.development
@@ -1,11 +1,11 @@
VITE_APP_NAME=后台管理系统
VITE_SOCKET_URL=wss://server.gxwebsoft.com
-#VITE_SERVER_URL=https://server.gxwebsoft.com/api
+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_SERVER_URL=http://127.0.0.1:9090/api
+#VITE_SERVER_URL=http://127.0.0.1:9090/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/design/model/index.ts b/src/api/cms/design/model/index.ts
index e8e6cdc..4bd18bc 100644
--- a/src/api/cms/design/model/index.ts
+++ b/src/api/cms/design/model/index.ts
@@ -42,7 +42,13 @@ export interface Design {
backgroundColor?: string;
// 关联网站导航ID
navigationId?: number;
+ showLayout?: boolean;
+ btn?: any[];
+ showBanner?: boolean;
buyUrl?: string;
+ demoUrl?: string;
+ account?: string;
+ docUrl?: string;
}
/**
diff --git a/src/layout/index.vue b/src/layout/index.vue
index fde902a..ff0f785 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -50,10 +50,11 @@
@@ -117,6 +118,7 @@
setHomeComponents
} from '@/utils/page-tab-util';
import type { TabCtxMenuOption } from 'ele-admin-pro/es/ele-pro-layout/types';
+ import { openUrl } from '@/utils/common';
const { push } = useRouter();
const { t, locale } = useI18n();
@@ -126,7 +128,9 @@
// 租户信息
const { company } = storeToRefs(tenantStore);
// 网站名称
- const projectName = company.value?.shortName;
+ const projectName = !company.value?.companyLogo
+ ? company.value?.shortName
+ : '';
// 网站LOGO
const logoPath =
company.value?.companyLogo || 'https://www.gxwebsoft.com/ws-logo.svg';
diff --git a/src/utils/domain.ts b/src/utils/domain.ts
index 6e0af3b..1fdb318 100644
--- a/src/utils/domain.ts
+++ b/src/utils/domain.ts
@@ -118,6 +118,10 @@ export function getSiteDomain(): string {
}
});
}
+ // 开发环境调试域名
+ if (localStorage.getItem('DevDomain')) {
+ return `${localStorage.getItem('DevDomain')}`;
+ }
return `${localStorage.getItem('Domain')}`;
}
diff --git a/src/views/cms/article/components/articleEdit.vue b/src/views/cms/article/components/articleEdit.vue
index fd13177..8fb2fee 100644
--- a/src/views/cms/article/components/articleEdit.vue
+++ b/src/views/cms/article/components/articleEdit.vue
@@ -21,7 +21,7 @@
>
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
();
@@ -204,8 +176,6 @@
const spec = ref([]);
const showSpecForm = ref(false);
- const name = ref();
- const value = ref();
const files = ref([]);
const category = ref([]);
const takeaway = ref([]);
@@ -264,14 +234,14 @@
trigger: 'blur'
}
],
- image: [
- {
- required: true,
- message: '请上传图片',
- type: 'string',
- trigger: 'blur'
- }
- ],
+ // image: [
+ // {
+ // required: true,
+ // message: '请上传图片',
+ // type: 'string',
+ // trigger: 'blur'
+ // }
+ // ],
// files: [
// {
// required: true,
@@ -316,27 +286,6 @@
],
});
- const onType = (index: number) => {
- form.type = index;
- };
-
- // /* 搜索 */
- // const chooseMerchantId = (item: Merchant) => {
- // form.merchantName = item.merchantName;
- // form.merchantId = item.merchantId;
- // };
- //
- // const chooseArticleCategory = (item: ArticleCategory,value: any) => {
- // form.categoryId = value[1].value;
- // form.categoryParent = value[0].label;
- // form.categoryChildren = value[1].label;
- // }
- // const chooseTakeawayCategory = (item: ArticleCategory, value: any) => {
- // form.categoryParent = '店铺分类';
- // form.categoryChildren = value[0].label;
- // form.categoryId = item[0];
- // }
-
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
@@ -360,14 +309,6 @@
form.image = '';
};
- const onClose = (index) => {
- spec.value.splice(index, 1);
- };
-
- const openSpecForm = () => {
- showSpecForm.value = !showSpecForm.value;
- };
-
const onComments = () => {
if (form.comments == undefined) {
form.comments = htmlToText(content.value)
@@ -375,33 +316,6 @@
}
}
- const onSpec = (row: Spec) => {
- // form.specName = row.specName;
- if(row.specValue){
- spec.value = JSON.parse(row?.specValue);
- }
- }
-
- // 新增规格
- const addSpecValue = () => {
- if (!name.value || !value.value) {
- message.error(`请输入规格和规格值`);
- return false;
- }
- const findIndex = spec.value.findIndex((d) => d.value == name.value);
- if (findIndex == 0) {
- message.error(`${name.value}已存在)`);
- return false;
- }
- spec.value.push({
- value: name.value,
- detail: [value.value]
- });
- name.value = '';
- value.value = '';
- openSpecForm();
- };
-
const chooseFile = (data: FileRecord) => {
files.value.push({
uid: data.id,
@@ -531,6 +445,9 @@
watch(
() => props.visible,
(visible) => {
+ if(props.categoryId){
+ form.categoryId = props.categoryId;
+ }
if (visible) {
images.value = [];
category.value = [];
diff --git a/src/views/cms/article/components/search.vue b/src/views/cms/article/components/search.vue
index 3cdeee0..e04b709 100644
--- a/src/views/cms/article/components/search.vue
+++ b/src/views/cms/article/components/search.vue
@@ -63,6 +63,7 @@
selection?: [];
merchantId?: number;
navigationList?: Navigation[];
+ categoryId?: number;
model?: string;
}>(),
{}
@@ -99,7 +100,6 @@
const handleSearch = (e) => {
const text = e.target.value;
- resetFields();
if (text === '已发布') {
where.status = 0;
}
@@ -113,6 +113,7 @@
};
const reload = () => {
+ console.log(where);
getCount(where).then((data: any) => {
articleCount.value = data;
});
@@ -141,14 +142,18 @@
watch(
() => props.merchantId,
- (id) => {
- if (Number(id) > 0) {
- where.merchantId = id;
- reload();
- } else {
- where.merchantId = undefined;
- reload();
+ () => {
+ if (props.categoryId) {
+ where.categoryId = props.categoryId;
}
+ reload();
+ // if (Number(id) > 0) {
+ // where.merchantId = id;
+ // reload();
+ // } else {
+ // where.merchantId = undefined;
+ // reload();
+ // }
},
{ immediate: true }
);
diff --git a/src/views/cms/article/index.vue b/src/views/cms/article/index.vue
index 1e1e8eb..8db0a22 100644
--- a/src/views/cms/article/index.vue
+++ b/src/views/cms/article/index.vue
@@ -18,6 +18,7 @@
:selection="selection"
:navigationList="navigationList"
:merchantId="merchantId"
+ :categoryId="categoryId"
:model="model"
@add="openEdit"
@remove="removeBatch"
@@ -26,7 +27,8 @@
- {{ record.title }}{{ record.title }}
+
+
+ {{ record.categoryName }}
@@ -75,6 +90,7 @@
@@ -103,7 +119,6 @@
import router from '@/router';
import { toTreeData } from 'ele-admin-pro';
import { openSpmUrl } from '@/utils/common';
- import { getSiteDomain } from '@/utils/domain';
import { listNavigation } from '@/api/cms/navigation';
import { Navigation } from '@/api/cms/navigation/model';
@@ -124,10 +139,6 @@
const categoryId = ref();
// 当前模型
const model = ref();
- // 网站域名
- const domain = getSiteDomain();
- // 随机数
- const token = ref('');
// 栏目数据
const navigationList = ref();
@@ -153,15 +164,22 @@
align: 'center',
width: 90
},
+ {
+ title: '封面图',
+ dataIndex: 'image',
+ key: 'image',
+ width: 120,
+ align: 'center'
+ },
{
title: '文章标题',
dataIndex: 'title',
key: 'title'
},
{
- title: '封面图',
- dataIndex: 'image',
- key: 'image',
+ title: '栏目名称',
+ dataIndex: 'categoryName',
+ key: 'categoryName',
width: 120,
align: 'center'
},
@@ -231,6 +249,9 @@
/* 搜索 */
const reload = (where?: ArticleParam) => {
+ if (where?.categoryId) {
+ categoryId.value = where.categoryId;
+ }
selection.value = [];
tableRef?.value?.reload({ where: where });
};
@@ -317,7 +338,7 @@
data: res?.map((d) => {
d.value = d.navigationId;
d.label = d.title;
- if (d.model == 'links' || d.model == 'product' || d.path == '/') {
+ if (d.model != 'article') {
d.disabled = true;
}
return d;
@@ -331,8 +352,9 @@
watch(
() => router.currentRoute.value.query,
(query) => {
+ console.log(query);
if (query) {
- categoryId.value = Number(query.categoryId);
+ categoryId.value = Number(query.id);
model.value = Number(query.type);
reload();
}
@@ -346,5 +368,3 @@
name: 'ArticleV2'
};
-
-
diff --git a/src/views/cms/design/components/design-edit.vue b/src/views/cms/design/components/design-edit.vue
index 8fd444a..f7326f5 100644
--- a/src/views/cms/design/components/design-edit.vue
+++ b/src/views/cms/design/components/design-edit.vue
@@ -5,7 +5,7 @@
:visible="visible"
:maskClosable="false"
:maxable="true"
- :title="isUpdate ? '编辑页面' : '添加页面'"
+ :title="isUpdate ? '编辑内容' : '添加内容'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
@@ -19,30 +19,6 @@
styleResponsive ? { md: 21, sm: 19, xs: 24 } : { flex: '1' }
"
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -71,15 +115,6 @@
/>
-
-
-
开启
@@ -89,24 +124,20 @@
-
diff --git a/src/views/cms/design/index.vue b/src/views/cms/design/index.vue
index ba6678b..eb9921d 100644
--- a/src/views/cms/design/index.vue
+++ b/src/views/cms/design/index.vue
@@ -9,12 +9,12 @@
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
- class="sys-org-table"
>
- 设计
+
+ 布局
+
+
+
修改
@@ -61,12 +67,19 @@
+
+
+
-
-
diff --git a/src/views/cms/design/record/components/designRecordEdit.vue b/src/views/cms/design/record/components/designRecordEdit.vue
new file mode 100644
index 0000000..043c45f
--- /dev/null
+++ b/src/views/cms/design/record/components/designRecordEdit.vue
@@ -0,0 +1,250 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 显示
+ 隐藏
+
+
+
+
+
+
+
diff --git a/src/views/cms/design/record/components/search.vue b/src/views/cms/design/record/components/search.vue
new file mode 100644
index 0000000..7e6a37b
--- /dev/null
+++ b/src/views/cms/design/record/components/search.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ 添加组件
+
+
+
+
+
diff --git a/src/views/cms/design/record/index.vue b/src/views/cms/design/record/index.vue
new file mode 100644
index 0000000..5250896
--- /dev/null
+++ b/src/views/cms/design/record/index.vue
@@ -0,0 +1,276 @@
+
+
+
+
+
+
+
+
+ 开启
+ 关闭
+
+
+ 免费
+ 收费
+
+
+
+ 上移
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/cms/domain/components/domain-edit.vue b/src/views/cms/domain/components/domain-edit.vue
index 3a0df56..6601e2b 100644
--- a/src/views/cms/domain/components/domain-edit.vue
+++ b/src/views/cms/domain/components/domain-edit.vue
@@ -96,6 +96,7 @@
visible: boolean;
// 修改回显的数据
data?: Domain | null;
+ websiteId?: number;
}>();
const emit = defineEmits<{
@@ -173,7 +174,8 @@
}
}
const formData = {
- ...form
+ ...form,
+ websiteId: props.websiteId
};
if (isUpdate.value) {
setTimeout(() => {
diff --git a/src/views/cms/domain/index.vue b/src/views/cms/domain/index.vue
index 51d56cf..d489439 100644
--- a/src/views/cms/domain/index.vue
+++ b/src/views/cms/domain/index.vue
@@ -14,6 +14,7 @@
-
+
@@ -86,6 +92,8 @@
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
+ import { useRouter } from 'vue-router';
+ import { useRoute } from 'vue-router';
import type {
DatasourceFunction,
ColumnItem
@@ -95,11 +103,13 @@
import {
pageDomain,
removeDomain,
- removeBatchDomain,
- updateDomain
+ removeBatchDomain
} from '@/api/cms/domain';
import type { Domain, DomainParam } from '@/api/cms/domain/model';
- import { openPreview, openUrl } from "@/utils/common";
+ import { openUrl } from '@/utils/common';
+
+ const route = useRoute();
+ const { push } = useRouter();
// 表格实例
const tableRef = ref | null>(null);
@@ -112,6 +122,11 @@
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
+ const websiteId = ref();
+
+ if (route.params.id) {
+ websiteId.value = route.params.id;
+ }
// 表格数据源
const datasource: DatasourceFunction = ({
@@ -124,6 +139,7 @@
if (filters) {
where.status = filters.status;
}
+ where.websiteId = route.params.id;
return pageDomain({
...where,
...orders,
diff --git a/src/views/cms/field/components/website-field-edit.vue b/src/views/cms/field/components/website-field-edit.vue
index b7614e2..f8afe47 100644
--- a/src/views/cms/field/components/website-field-edit.vue
+++ b/src/views/cms/field/components/website-field-edit.vue
@@ -16,7 +16,16 @@
:label-col="{ md: { span: 3 }, sm: { span: 4 }, xs: { span: 24 } }"
:wrapper-col="{ md: { span: 21 }, sm: { span: 22 }, xs: { span: 24 } }"
>
-
+
+
+
+
-
-
-
{{ record.comments }}
-
+ {{ record.comments }}
+
@@ -127,32 +128,17 @@
const columns = ref([
{
title: '参数名',
- dataIndex: 'name',
- width: 180,
- key: 'name'
- },
- {
- title: '描述',
dataIndex: 'comments',
key: 'comments',
- width: 120,
- align: 'center'
+ width: 250,
+ ellipsis: true
},
{
title: '配置值',
dataIndex: 'value',
key: 'value',
- width: 400,
ellipsis: true
},
- {
- title: '默认值',
- dataIndex: 'defaultValue'
- },
- {
- title: '可设置范围',
- dataIndex: 'modifyRange'
- },
{
title: '排序',
dataIndex: 'sortNumber',
diff --git a/src/views/cms/navigation/components/design-edit.vue b/src/views/cms/navigation/components/design-edit.vue
index c36bc23..28a779b 100644
--- a/src/views/cms/navigation/components/design-edit.vue
+++ b/src/views/cms/navigation/components/design-edit.vue
@@ -1,15 +1,21 @@
-
+
+ 保存
+ 预览
+
-
-
-
@@ -51,48 +48,107 @@
/>
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 图片广告
+ 幻灯片
+ 视频广告
+
+
+
+
+
+ 添加组件
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- 开启
- 关闭
-
-
+
+
+
+
+
+
-
+
-
diff --git a/src/views/cms/navigation/components/navigation-edit.vue b/src/views/cms/navigation/components/navigation-edit.vue
index 6bcdcca..0aee61e 100644
--- a/src/views/cms/navigation/components/navigation-edit.vue
+++ b/src/views/cms/navigation/components/navigation-edit.vue
@@ -55,18 +55,15 @@
@pressEnter="save"
/>
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
{
+ const chooseModel = (item: any) => {
console.log(item);
form.model = `${item.value}`;
form.modelName = `${item.label}`;
- form.componentPath = `${item.component}`;
+ if (item.value == 'custom') {
+ form.path = `/custom-${form.navigationId}`;
+ form.component = `/pages/[${item.value}]/index.vue`;
+ return;
+ }
+ if (item.value == 'links') {
+ form.path = `https://`;
+ form.component = `/pages/${item.value}/index.vue`;
+ return;
+ }
+ form.path = `/${item.value}/${form.navigationId}`;
+ form.component = `/pages/${item.value}/index.vue`;
};
const chooseFile = (data: FileRecord) => {
diff --git a/src/views/cms/navigation/index.vue b/src/views/cms/navigation/index.vue
index 0646943..f36a051 100644
--- a/src/views/cms/navigation/index.vue
+++ b/src/views/cms/navigation/index.vue
@@ -35,6 +35,7 @@
顶部
底部
+ 不限
@@ -49,7 +50,18 @@
- {{ record.path }}
+
+ {{ record.path }}
+
+
+
+
+
@@ -114,12 +126,8 @@
-
- 布局
-
-
-
- 内容
+
+ 设计
@@ -193,6 +201,7 @@
import { openSpmUrl } from '@/utils/common';
import { getSiteInfo } from '@/api/layout';
import { Design } from '@/api/cms/design/model';
+ import router from '@/router';
// 表格实例
const tableRef = ref | null>(null);
@@ -312,6 +321,10 @@
where.top = undefined;
where.bottom = 0;
}
+ if (position.value == 0) {
+ where.top = undefined;
+ where.bottom = undefined;
+ }
where.isMpWeixin = false;
return listNavigation({ ...where });
};
@@ -344,22 +357,49 @@
showEdit.value = true;
};
+ // 跳转模型内容列表
const openDesign = (row?: Navigation) => {
categoryId.value = row?.navigationId;
showDesignEdit.value = true;
- // // TODO 通用模型
- // if (row?.model == 'custom') {
+ return;
+
+ // if (row && isDirectory(row)) {
+ // categoryId.value = row?.navigationId;
// showDesignEdit.value = true;
// return;
// }
- //
- // // TODO 文章列表
- // if (row?.model === 'article') {
- // router.push({
- // path: '/cms/article',
- // query: { categoryId: row.navigationId, type: row.type }
- // });
- // }
+ // TODO 单页模型
+ if (row?.model == 'custom') {
+ router.push({
+ path: `/cms/design`,
+ query: {
+ id: row.navigationId,
+ type: row.model
+ }
+ });
+ return;
+ }
+
+ // TODO 文章列表
+ if (row?.model === 'article') {
+ router.push({
+ path: `/cms/article`,
+ query: {
+ id: row.navigationId,
+ type: row.model
+ }
+ });
+ return;
+ }
+
+ // TODO 产品列表
+ if (row?.model === 'product') {
+ router.push({
+ path: '/goods/index',
+ query: { categoryId: row.navigationId, type: row.type }
+ });
+ return;
+ }
};
const openLayout = (row?: Navigation) => {
diff --git a/src/views/cms/website/components/search.vue b/src/views/cms/website/components/search.vue
index a0a2637..5786c2a 100644
--- a/src/views/cms/website/components/search.vue
+++ b/src/views/cms/website/components/search.vue
@@ -19,8 +19,8 @@
-
-
+
+
@@ -28,7 +28,6 @@