From a1c3902eb0b6ce330fec4738e33d2419e870de08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A5=8F?= <1978476055@qq.com>
Date: Mon, 29 Jul 2024 14:00:55 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E7=AE=A1=E7=90=86,=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
admin/src/router/index.js | 23 +
admin/src/styles/element-ui.scss | 10 +-
admin/src/utils/storage.js | 74 ++
admin/src/views/announcements/list.vue | 189 +++++
admin/src/views/dashboard/admin/index.vue | 75 +-
.../home/components/overflow_concealment.vue | 13 +-
admin/src/views/home/line_on_sale.vue | 4 +-
admin/src/views/order/abandoned.vue | 675 +++++++++++-----
admin/src/views/order/index.vue | 746 ++++++++++++------
admin/src/views/order/used.vue | 688 +++++++++++-----
admin/vue.config.js | 2 +-
11 files changed, 1788 insertions(+), 711 deletions(-)
create mode 100644 admin/src/utils/storage.js
create mode 100644 admin/src/views/announcements/list.vue
diff --git a/admin/src/router/index.js b/admin/src/router/index.js
index 39e5c2b9..fead9425 100644
--- a/admin/src/router/index.js
+++ b/admin/src/router/index.js
@@ -322,6 +322,29 @@ export const asyncRoutes = [
}
]
},
+ {
+ path: '/announcements',
+ component: Layout,
+ redirect: '/announcements/index',
+ alwaysShow: true,
+ name: 'announcements',
+ meta: {
+ title: '公告管理',
+ icon: 'el-icon-s-promotion',
+ roles: ['follow_index', 'log_index', 'editor']
+ },
+ children: [
+ {
+ path: 'list',
+ component: () => import('@/views/announcements/list'),
+ name: 'list',
+ meta: {
+ title: '公告列表',
+ roles: ['follow_index', 'editor']
+ }
+ }
+ ]
+ },
{
path: '/icon',
component: Layout,
diff --git a/admin/src/styles/element-ui.scss b/admin/src/styles/element-ui.scss
index 49474de3..5a29fc90 100644
--- a/admin/src/styles/element-ui.scss
+++ b/admin/src/styles/element-ui.scss
@@ -4,7 +4,13 @@
.el-breadcrumb__inner a {
font-weight: 400 !important;
}
-
+.opening-announcement {
+ .el-message-box__header {
+ .el-message-box__title {
+ color: red;
+ }
+ }
+}
.el-upload {
input[type="file"] {
display: none !important;
@@ -69,7 +75,7 @@
// dropdown
.el-dropdown-menu {
a {
- display: block
+ display: block;
}
}
diff --git a/admin/src/utils/storage.js b/admin/src/utils/storage.js
new file mode 100644
index 00000000..d6290053
--- /dev/null
+++ b/admin/src/utils/storage.js
@@ -0,0 +1,74 @@
+
+import config from '../../package.json';
+
+// 1、window.localStorage 浏览器永久缓存
+export const Local = {
+ // 查看 v2.4.3版本更新日志
+ setKey(key) {
+ // @ts-ignore
+ return `${config.name}:${key}`;
+ },
+ // 存储数据到本地缓存,设置过期时间
+ setCache(key, value, expireTime) {
+ const now = new Date().getTime();
+ const item = {
+ value: value,
+ expire: now + expireTime * 1000 // 过期时间,单位是毫秒
+ };
+ localStorage.setItem(Local.setKey(key), JSON.stringify(item));
+ },
+
+ // 从本地缓存读取数据,检查是否过期
+ getCache(key) {
+ const itemStr = localStorage.getItem(Local.setKey(key));
+ if (itemStr) {
+ const item = JSON.parse(itemStr);
+ const now = new Date().getTime();
+ if (now < item.expire) {
+ return item.value;
+ } else {
+ // 数据已过期,清除缓存
+ localStorage.removeItem(key);
+ }
+ }
+ return null;
+ },
+ // 设置永久缓存
+ set(key, val) {
+ window.localStorage.setItem(Local.setKey(key), JSON.stringify(val));
+ },
+ // 获取永久缓存
+ get(key) {
+ let json = window.localStorage.getItem(Local.setKey(key));
+ return JSON.parse(json);
+ },
+ // 移除永久缓存
+ remove(key) {
+ window.localStorage.removeItem(Local.setKey(key));
+ },
+ // 移除全部永久缓存
+ clear() {
+ window.localStorage.clear();
+ },
+};
+
+// 2、window.sessionStorage 浏览器临时缓存
+export const Session = {
+ // 设置临时缓存
+ set(key, val) {
+ window.sessionStorage.setItem(Local.setKey(key), JSON.stringify(val));
+ },
+ // 获取临时缓存
+ get(key) {
+ let json = window.sessionStorage.getItem(Local.setKey(key));
+ return JSON.parse(json);
+ },
+ // 移除临时缓存
+ remove(key) {
+ window.sessionStorage.removeItem(Local.setKey(key));
+ },
+ // 移除全部临时缓存
+ clear() {
+ window.sessionStorage.clear();
+ },
+};
diff --git a/admin/src/views/announcements/list.vue b/admin/src/views/announcements/list.vue
new file mode 100644
index 00000000..12c227c8
--- /dev/null
+++ b/admin/src/views/announcements/list.vue
@@ -0,0 +1,189 @@
+
+
+
+ 添加
+
+
+
+
+ 编辑
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/admin/src/views/dashboard/admin/index.vue b/admin/src/views/dashboard/admin/index.vue
index 67762086..454808fb 100644
--- a/admin/src/views/dashboard/admin/index.vue
+++ b/admin/src/views/dashboard/admin/index.vue
@@ -1,9 +1,11 @@
-
-
+
@@ -37,36 +39,36 @@