From a0b12dcbdcfce932760803fd8143b72eaacc26f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com>
Date: Fri, 8 Dec 2023 22:12:37 +0800
Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.drone.yml | 2 +-
src/assets/styles/index.scss | 8 ++++-
src/components/HelloWorld.vue | 40 ------------------------
src/components/manageBtn/index.vue | 50 ++++++++++++++++++++++++++++++
src/utils/date.js | 24 ++++++++++++++
src/views/home/index.vue | 17 ++++++++--
src/views/tunnel/index.vue | 50 ++++++++++--------------------
7 files changed, 114 insertions(+), 77 deletions(-)
delete mode 100644 src/components/HelloWorld.vue
create mode 100644 src/components/manageBtn/index.vue
create mode 100644 src/utils/date.js
diff --git a/.drone.yml b/.drone.yml
index 7cc4390..b193984 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -16,7 +16,7 @@ steps:
- export NODE_MODULES_PATH=`pwd`/node_modules
- npm config set registry https://registry.npm.taobao.org
- set NODE_OPTIONS=--openssl-legacy-provider
- - npm install
+# - npm install
- npm run build
- echo $NODE_MODULES_PATH
- cp -r dist /app/build/$DRONE_REPO_NAME
diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss
index 4401722..c091ca8 100644
--- a/src/assets/styles/index.scss
+++ b/src/assets/styles/index.scss
@@ -20,12 +20,13 @@ html, body, #app, .el-container, .el-aside, .el-main {
.box-top {
.manage-btn {
display: flex;
- z-index: 2;
+ z-index: 3;
position: absolute;
top: 85px;
left: 30px;
.btn-box {
+ cursor: pointer;
margin-left: 37px;
display: flex;
align-items: center;
@@ -41,6 +42,9 @@ html, body, #app, .el-container, .el-aside, .el-main {
width: 60px;
height: 60px;
}
+ .select-active{
+ color: #11EAF2!important;
+ }
}
}
@@ -73,6 +77,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
}
.toggle {
+ cursor: pointer;
width: 50px;
height: 50px;
background-image: url('../images/topAndDown/sp_icon_zdqh.png');
@@ -90,6 +95,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
}
.logout {
+ cursor: pointer;
margin-left: 27px;
width: 50px;
height: 50px;
diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue
deleted file mode 100644
index f5e4f53..0000000
--- a/src/components/HelloWorld.vue
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- {{ msg }}
-
-
-
-
- Edit
- components/HelloWorld.vue to test HMR
-
-
-
-
- Check out
- create-vue, the official Vue + Vite starter
-
-
- Install
- Volar
- in your IDE for a better DX
-
- Click on the Vite and Vue logos to learn more
-
-
-
diff --git a/src/components/manageBtn/index.vue b/src/components/manageBtn/index.vue
new file mode 100644
index 0000000..2173478
--- /dev/null
+++ b/src/components/manageBtn/index.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
diff --git a/src/utils/date.js b/src/utils/date.js
new file mode 100644
index 0000000..70aae99
--- /dev/null
+++ b/src/utils/date.js
@@ -0,0 +1,24 @@
+export const dateFormat = (time = new Date().getTime()) => { //YYYY年MM月DD日 星期d
+ const _time = time.toString().length > 10 ? time : time * 1000
+ const weekList = ["一", "二", "三", "四", "五", "六", "日"];
+ const date = new Date(_time);
+ const Y = date.getFullYear();
+ const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
+ const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
+ const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
+ const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
+ const s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+ let weekDay = new Date().getDay();
+ const week= weekList[weekDay - 1]
+ // const strDate = `${Y}/${M}/${D} ${h}:${m}:${s}`
+ return `${Y}年${M}月${D}日 星期${week}`;
+}
+
+export default {
+ dateFormat
+}
+
+
+
+
+
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 689481f..532f716 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -7,6 +7,7 @@
确认连接
关闭连接
+ 清除
- 清除
+
+
+ 发送
+
退出登录
@@ -35,6 +39,7 @@ import {useAuthStore} from '@/store/userstore.js'
const router = useRouter()
const authStore = useAuthStore()
const serialNumber = ref('')
+const number = ref('')
let send = {
type: "ping"
}
@@ -54,8 +59,16 @@ watch(
}
);
let socket = reactive('')
+const handleSend=()=>{
+ console.log('JSON.stringify(number.value))',JSON.stringify(number.value))
+ let data = {
+ type: 1,
+ cmd : number.value
+ }
+ socket.send(JSON.stringify(data))
+}
const initWebSocket = () => {
- // let wsUrl = `ws://192.168.31.175:8000/wstunnel/debug/${token}/${serialNumber.value}`
+ // let wsUrl = `ws://192.168.31.175:9000/debug/${token}/${serialNumber.value}`
let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/debug/${token}/${serialNumber.value}`
console.log(wsUrl)
socket = new WebSocket(wsUrl)
diff --git a/src/views/tunnel/index.vue b/src/views/tunnel/index.vue
index 506b82f..b8dba13 100644
--- a/src/views/tunnel/index.vue
+++ b/src/views/tunnel/index.vue
@@ -1,12 +1,7 @@
-
+
@@ -15,8 +10,8 @@
上午好:
{{ currentUser }}
-
今天是: 2023年12月12日 星期三
-
+
今天是:{{ currentDate }}
+
@@ -75,43 +70,32 @@ import UsedEle from "@/components/content/usedEle/UsedEle.vue";
import WindPressureList from "@/components/content/windPressure/WindPressureList.vue";
import AirInfo from "@/components/content/airInfo/AirInfo.vue";
import BadGasInfo from "@/components/content/badGasInfo/BadGasInfo.vue";
+import ManageBtn from "@/components/manageBtn/index.vue";
+import {dateFormat} from "@/utils/date.js";
+import {useAuthStore} from '@/store/userstore.js'
+const authStore = useAuthStore()
+const router = useRouter()
+const selectIndex=ref(1)
const drawerLeft = ref(true)
const drawerRight = ref(true)
const currentSite = ref('松江站')
const currentUser = ref('admin')
-const btnList = ref([
- {
- icon: 'sp_icon_zdgl.png',
- name: '站点管理'
- },
- {
- icon: 'sp_icon_sdgl.png',
- name: '隧道管理'
- },
- {
- icon: 'sp_icon_yhgl.png',
- name: '用户管理'
- },
- {
- icon: 'sp_icon_xtgl.png',
- name: '系统管理'
- },
- {
- icon: 'sp_icon_mngl.png',
- name: '模拟仿真'
- },
-])
+const currentDate = ref(dateFormat())
-const getImageUrl = (name) => {
- return new URL(`../../assets/images/topAndDown/${name}`, import.meta.url).href
-}
+const manageSelect = () => {
+ // getInfo();
+};
const closeLeft = () => {
drawerLeft.value = !drawerLeft.value
}
const closeRight = () => {
drawerRight.value = !drawerRight.value
}
+const handleLogout = () => {
+ authStore.userLogout()
+ router.push('/login')
+}