From 5fa57eb9f24e7d19812a0ee5e44fa3bc35ea9f6d Mon Sep 17 00:00:00 2001 From: "DESKTOP-VMMLSOQ\\wangzg" <1161909281@qq.com> Date: Sun, 21 Jul 2024 08:23:30 +0800 Subject: [PATCH 1/9] 11111 --- README.md | 10 +- pages/{wuzuzhi => video}/list.vue | 2 +- .../index.vue => wuzuzhi/huanjingzhili.vue} | 32 +++---- pages/wuzuzhi/huanweixunhang.vue | 13 +++ pages/wuzuzhi/paifang.vue | 39 ++++++++ pages/wuzuzhi/xichejiguanli.vue | 13 +++ pages/youzuzhi/paifang.vue | 94 +++++++++++++++++++ pages/youzuzhi/paifangtongji.vue | 43 +++++++++ 8 files changed, 227 insertions(+), 19 deletions(-) rename pages/{wuzuzhi => video}/list.vue (80%) rename pages/{web3/index.vue => wuzuzhi/huanjingzhili.vue} (96%) create mode 100644 pages/wuzuzhi/huanweixunhang.vue create mode 100644 pages/wuzuzhi/paifang.vue create mode 100644 pages/wuzuzhi/xichejiguanli.vue create mode 100644 pages/youzuzhi/paifang.vue create mode 100644 pages/youzuzhi/paifangtongji.vue diff --git a/README.md b/README.md index a11d1ed..9a2c116 100644 --- a/README.md +++ b/README.md @@ -53,16 +53,22 @@ https://1x.antdv.com/components/icon/ 首页 /home #### 有组织 -有组织 +有组织排放 /youzuzhi/paifang 待联调 +有组织排放统计 /youzuzhi/paifangtongji 待联调 #### 无组织 +无组织排放 /wuzuzhi/paifang 待联调 +洗车机管理 /wuzuzhi/xichejiguanli 未做 +环境治理 /wuzuzhi/huanjingzhili 待联调 +环卫巡航 /wuzuzhi/huanweixunhang 未做 #### 清洁运输 清洁运输 /cleanTravel/home 厂区车辆台账 /cleanTravel/ledger 清洁运输趋势 /cleanTravel/trend -磅秤台账 /cleanTravel/bangcheng +磅秤台账 /cleanTravel/bangcheng 未做 #### 视频广场 +视频广场 /video/list 未做 diff --git a/pages/wuzuzhi/list.vue b/pages/video/list.vue similarity index 80% rename from pages/wuzuzhi/list.vue rename to pages/video/list.vue index fde1b4f..e5a049a 100644 --- a/pages/wuzuzhi/list.vue +++ b/pages/video/list.vue @@ -5,7 +5,7 @@ export default { diff --git a/pages/wuzuzhi/paifang.vue b/pages/wuzuzhi/paifang.vue new file mode 100644 index 0000000..7e1923d --- /dev/null +++ b/pages/wuzuzhi/paifang.vue @@ -0,0 +1,39 @@ + + + + + + + diff --git a/pages/wuzuzhi/xichejiguanli.vue b/pages/wuzuzhi/xichejiguanli.vue new file mode 100644 index 0000000..430d3f5 --- /dev/null +++ b/pages/wuzuzhi/xichejiguanli.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/pages/youzuzhi/paifang.vue b/pages/youzuzhi/paifang.vue new file mode 100644 index 0000000..2e6a0e4 --- /dev/null +++ b/pages/youzuzhi/paifang.vue @@ -0,0 +1,94 @@ + + + + + + + diff --git a/pages/youzuzhi/paifangtongji.vue b/pages/youzuzhi/paifangtongji.vue new file mode 100644 index 0000000..82bd5ff --- /dev/null +++ b/pages/youzuzhi/paifangtongji.vue @@ -0,0 +1,43 @@ + + + + + + + From 6db583171832e83cfd95a9c794a1248601babbe3 Mon Sep 17 00:00:00 2001 From: "DESKTOP-VMMLSOQ\\wangzg" <1161909281@qq.com> Date: Tue, 30 Jul 2024 23:55:13 +0800 Subject: [PATCH 2/9] 1111 --- components/smallCommon/CusButton.vue | 3 ++ middleware/auth.js | 46 +++++++++++++++++++ nuxt.config.js | 4 ++ pages/cleanTravel/home.vue | 13 ++++-- pages/home/index.vue | 17 +++++-- pages/manager/login.vue | 6 ++- .../PeakCoalMonitoring.vue | 1 - pages/visual/PeakCoalView.vue | 1 - pages/wuzuzhi/huanjingzhili.vue | 1 - plugins/setup.js | 1 - store/user.js | 20 ++++++++ 11 files changed, 98 insertions(+), 15 deletions(-) create mode 100644 middleware/auth.js create mode 100644 store/user.js diff --git a/components/smallCommon/CusButton.vue b/components/smallCommon/CusButton.vue index de6252b..6fe6da5 100644 --- a/components/smallCommon/CusButton.vue +++ b/components/smallCommon/CusButton.vue @@ -39,6 +39,9 @@ export default { color: rgba(255, 255, 255, 1); text-align: left; vertical-align: top; + a { + color: rgba(255, 255, 255, 1) !important; + } &.small { padding: 2px 10px; background: linear-gradient(180deg, rgba(188, 216, 247, 0.4) 0%, rgba(152, 217, 237, 0.15) 48.61%, rgba(156, 255, 248, 0.4) 100%); diff --git a/middleware/auth.js b/middleware/auth.js new file mode 100644 index 0000000..f909bd5 --- /dev/null +++ b/middleware/auth.js @@ -0,0 +1,46 @@ +// 在某个适当的时间点检查登录状态是否过期 +function isLoginExpired(loginTimestamp, expirationDuration) { + // 获取登录时间戳 + // 如果没有登录时间戳,说明用户未登录或状态已过期 + if (!loginTimestamp) { + return true; + } + + // 计算登录时间和现在的时间差 + const currentTimestamp = Date.now(); + const duration = currentTimestamp - loginTimestamp; + + // 如果时间差大于3小时的毫秒数,则登录状态过期 + return duration > expirationDuration; +} + + +export default function ({ route, redirect, store }) { + if (route.name === 'manager-login') { + return + } + if (localStorage.getItem('userInfo')) { + const cache = JSON.parse(localStorage.getItem('userInfo')) + const { expire, loginTime } = cache + // 在页面加载时检查登录状态 + if (isLoginExpired(loginTime, expire)) { + // 用户登录已过期,执行登录过期的逻辑 + console.log('登录已过期'); + return redirect('/manager/login') + } else { + // 用户登录有效,执行登录有效的逻辑 + store.dispatch('user/setUserInfo', cache) + if (route.path === '/') { + return redirect('/home') + } + } + } else { + // 假设用户信息存储在 Vuex store 中 + const user = store.state.user + // 检查路由是否需要认证 + if (!user.isLogin) { + return redirect('/manager/login') + } + } + +} diff --git a/nuxt.config.js b/nuxt.config.js index 6e46e09..a9e5073 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -39,6 +39,10 @@ export default { '@/assets/styles/mixin.less' ], + router: { + middleware: 'auth' // 应用全局中间件 + }, + // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: [ '@/plugins/antd-ui', diff --git a/pages/cleanTravel/home.vue b/pages/cleanTravel/home.vue index 985e7a3..942f3c0 100644 --- a/pages/cleanTravel/home.vue +++ b/pages/cleanTravel/home.vue @@ -87,9 +87,15 @@ - 厂区车辆台账 - 清洁运输趋势 - 磅秤台账 + + 厂区车辆台账 + + + 清洁运输趋势 + + + 磅秤台账 + 门禁监控 @@ -346,7 +352,6 @@ body, html, #__nuxt, #__layout { width: 100%; height: 100%; overflow: hidden; - background: #09151F; } .list-enter-active, .list-leave-active { diff --git a/pages/home/index.vue b/pages/home/index.vue index 80e0c0a..64a40bf 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -80,10 +80,18 @@ - 有组织 - 无组织 - 清洁运输 - 视频广场 + + 有组织 + + + 无组织 + + + 清洁运输 + + + 视频广场 + @@ -355,7 +363,6 @@ body, html, #__nuxt, #__layout { width: 100%; height: 100%; overflow: hidden; - background: #09151F; } .list-enter-active, .list-leave-active { diff --git a/pages/manager/login.vue b/pages/manager/login.vue index aa12265..2a10971 100644 --- a/pages/manager/login.vue +++ b/pages/manager/login.vue @@ -37,6 +37,7 @@ diff --git a/pages/wuzuzhi/huanweixunhang.vue b/pages/wuzuzhi/huanweixunhang.vue index 9ec54dd..0b35553 100644 --- a/pages/wuzuzhi/huanweixunhang.vue +++ b/pages/wuzuzhi/huanweixunhang.vue @@ -1,13 +1,38 @@ + + - - diff --git a/pages/wuzuzhi/xichejiguanli.vue b/pages/wuzuzhi/xichejiguanli.vue index 430d3f5..294bc73 100644 --- a/pages/wuzuzhi/xichejiguanli.vue +++ b/pages/wuzuzhi/xichejiguanli.vue @@ -1,13 +1,282 @@ + - - - From b11b73b2e657c7e1c99dc26e8414f7029350328d Mon Sep 17 00:00:00 2001 From: "DESKTOP-VMMLSOQ\\wangzg" <1161909281@qq.com> Date: Wed, 31 Jul 2024 22:26:14 +0800 Subject: [PATCH 4/9] 111 --- plugins/axios.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/axios.js b/plugins/axios.js index 1651afd..d015726 100644 --- a/plugins/axios.js +++ b/plugins/axios.js @@ -4,7 +4,7 @@ import Vue from 'vue' axios.defaults.withcredentials =true // create an axios instance const service = axios.create({ - baseURL: process.env.NODE_ENV === 'development' ? '' : 'http://101.43.201.20', // 所有异步请求都加上/api,nginx转发到后端Springboot + baseURL: process.env.NODE_ENV === 'development' ? '' : 'http://101.43.201.20:5000', // 所有异步请求都加上/api,nginx转发到后端Springboot timeout: 5000 // request timeout }) From 790e9a7ef05dcc7f130f0f9324f78e27408746cf Mon Sep 17 00:00:00 2001 From: "DESKTOP-VMMLSOQ\\wangzg" <1161909281@qq.com> Date: Tue, 6 Aug 2024 00:17:35 +0800 Subject: [PATCH 5/9] 111 --- README.md | 8 +- components/NewBg.vue | 2 +- components/smallCommon/Curd.vue | 20 ++- components/smallCommon/CusDesc.vue | 8 +- components/smallCommon/CustomTable.vue | 17 ++- components/smallCommon/SystemTitle.vue | 57 +++++++- pages/cleanTravel/home.vue | 77 +++++++--- pages/cleanTravel/ledger.vue | 64 ++++++++- pages/home/index.vue | 5 + pages/test.vue | 15 ++ pages/wuzuzhi/xichejiguanli.vue | 1 + pages/youzuzhi/paifang.vue | 188 ++++++++++++++++--------- pages/youzuzhi/paifangtongji.vue | 21 +-- plugins/axios.js | 5 +- 14 files changed, 369 insertions(+), 119 deletions(-) create mode 100644 pages/test.vue diff --git a/README.md b/README.md index e1fcade..c6ee696 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ https://1x.antdv.com/components/icon/ 首页 /home #### 有组织 - + 有组织排放 /youzuzhi/paifang 待联调 有组织排放统计 /youzuzhi/paifangtongji 待联调 @@ -69,9 +69,9 @@ https://1x.antdv.com/components/icon/ #### 清洁运输 -清洁运输 /cleanTravel/home -厂区车辆台账 /cleanTravel/ledger -清洁运输趋势 /cleanTravel/trend +清洁运输 /cleanTravel/home 联调完成 +厂区车辆台账 /cleanTravel/ledger 联调完成 +清洁运输趋势 /cleanTravel/trend 磅秤台账 /cleanTravel/bangcheng (已做)待联调 #### 视频广场 diff --git a/components/NewBg.vue b/components/NewBg.vue index 81507ad..785e04e 100644 --- a/components/NewBg.vue +++ b/components/NewBg.vue @@ -21,7 +21,7 @@ .bg { width: 100%; box-sizing: border-box; - height: 100%; + height: 100vh; box-sizing: border-box; background: url('~/assets/images/new/大背景.png') center no-repeat; background-size: 100% 100%; diff --git a/components/smallCommon/Curd.vue b/components/smallCommon/Curd.vue index 941a263..8a0e624 100644 --- a/components/smallCommon/Curd.vue +++ b/components/smallCommon/Curd.vue @@ -90,6 +90,9 @@ + + @@ -100,6 +103,7 @@ export default { name: "user", data() { return { + cacheData: [], isValidate: false, tableDataSource: [], form: this.$form.createForm(this, {name: `form_${new Date().valueOf()}`}), @@ -155,6 +159,11 @@ export default { type: Object, default: () => ({}) }, + customSearch: { + type: Function, + default: () => null + + } }, computed: { searchItems() { @@ -179,8 +188,8 @@ export default { this.handleSearch() }, methods: { - viewDetails(data){ - this.$emit('viewDetails',data) + viewDetails(data) { + this.$emit('viewDetails', data) }, gtDecorator(menuItem) { if (menuItem.rules) { @@ -252,6 +261,11 @@ export default { reset() { this.form.resetFields(); }, + doSearch () { + if (this.customSearch) { + this.tableDataSource = this.customSearch(JSON.parse(JSON.stringify(this.cacheData))) + } + }, async handleSearch(e) { e && e.preventDefault(); const values = this.form.getFieldsValue() @@ -263,9 +277,11 @@ export default { }) if (noPage) { this.page = false + this.cacheData = data this.tableDataSource = data } else { this.page.total = data.total || 0 + this.cacheData = data.items this.tableDataSource = data.items } }, diff --git a/components/smallCommon/CusDesc.vue b/components/smallCommon/CusDesc.vue index 260c587..e358bc5 100644 --- a/components/smallCommon/CusDesc.vue +++ b/components/smallCommon/CusDesc.vue @@ -1,9 +1,9 @@ @@ -37,7 +37,11 @@ export default { text-align: left; vertical-align: top; .desc { + width: 100%; margin-top: 16px; + display: flex; + justify-content: flex-start; + align-items: center; &:first-child { margin-top: 0; } diff --git a/components/smallCommon/CustomTable.vue b/components/smallCommon/CustomTable.vue index 66b7f82..7126181 100644 --- a/components/smallCommon/CustomTable.vue +++ b/components/smallCommon/CustomTable.vue @@ -2,7 +2,7 @@ diff --git a/pages/wuzuzhi/xichejiguanli.vue b/pages/wuzuzhi/xichejiguanli.vue index 294bc73..a441bb9 100644 --- a/pages/wuzuzhi/xichejiguanli.vue +++ b/pages/wuzuzhi/xichejiguanli.vue @@ -15,6 +15,7 @@
西门洗车
正常 +
diff --git a/pages/youzuzhi/paifang.vue b/pages/youzuzhi/paifang.vue index 2e6a0e4..5197f0c 100644 --- a/pages/youzuzhi/paifang.vue +++ b/pages/youzuzhi/paifang.vue @@ -1,94 +1,142 @@ - - diff --git a/pages/youzuzhi/paifangtongji.vue b/pages/youzuzhi/paifangtongji.vue index 82bd5ff..345a36f 100644 --- a/pages/youzuzhi/paifangtongji.vue +++ b/pages/youzuzhi/paifangtongji.vue @@ -1,15 +1,11 @@ diff --git a/pages/wuzuzhi/paifang.vue b/pages/wuzuzhi/paifang.vue index 7e1923d..761bc8c 100644 --- a/pages/wuzuzhi/paifang.vue +++ b/pages/wuzuzhi/paifang.vue @@ -1,34 +1,90 @@ - diff --git a/pages/wuzuzhi/xichejiguanli.vue b/pages/wuzuzhi/xichejiguanli.vue index a441bb9..259c4ba 100644 --- a/pages/wuzuzhi/xichejiguanli.vue +++ b/pages/wuzuzhi/xichejiguanli.vue @@ -1,105 +1,93 @@ diff --git a/components/ModuleContent.vue b/components/ModuleContent.vue index e76b587..5b4b66c 100644 --- a/components/ModuleContent.vue +++ b/components/ModuleContent.vue @@ -79,6 +79,7 @@ import {getSize} from "@/utils/tools"; overflow: hidden; position: relative; pointer-events: none; + z-index: 111; .content-border { } diff --git a/components/smallCommon/CusButton5.vue b/components/smallCommon/CusButton5.vue new file mode 100644 index 0000000..76369c0 --- /dev/null +++ b/components/smallCommon/CusButton5.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/components/smallCommon/CusDesc2.vue b/components/smallCommon/CusDesc2.vue new file mode 100644 index 0000000..ddc922e --- /dev/null +++ b/components/smallCommon/CusDesc2.vue @@ -0,0 +1,61 @@ + + + + + + + diff --git a/components/smallCommon/Faguang.vue b/components/smallCommon/Faguang.vue new file mode 100644 index 0000000..600fa73 --- /dev/null +++ b/components/smallCommon/Faguang.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/components/smallCommon/SystemTitle.vue b/components/smallCommon/SystemTitle.vue index 7f8abc3..48195f2 100644 --- a/components/smallCommon/SystemTitle.vue +++ b/components/smallCommon/SystemTitle.vue @@ -7,7 +7,9 @@
{{ tq }}

{{ customTitle }}

{{ customTitle || title }}一体化平台

-
返回
+
+ 返回
+
{{ btn.title }} @@ -105,10 +107,13 @@ export default { position: absolute; right: 10px; top: 40px; - border-radius: 10px; - padding: 5px 20px; - color: #fff; - background-color: #1890ff; + opacity: 1; + font-size: 20px; + font-weight: 400; + letter-spacing: 0px; + line-height: 28.96px; + color: rgba(35, 209, 232, 1); + vertical-align: top; cursor: pointer; } .time { diff --git a/components/smallCommon/Web5Title.vue b/components/smallCommon/Web5Title.vue new file mode 100644 index 0000000..90ba0a7 --- /dev/null +++ b/components/smallCommon/Web5Title.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/pages/cleanTravel/ledger.vue b/pages/cleanTravel/ledger.vue index 2d55630..38fdd29 100644 --- a/pages/cleanTravel/ledger.vue +++ b/pages/cleanTravel/ledger.vue @@ -3,9 +3,10 @@