From b4902c47c0ffd80276ffd9cb0ea6bf6908b0420c Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期四, 30 七月 2020 11:15:40 +0800
Subject: [PATCH] 添加数据推送, 日志管理
---
src/pages/desktop/index/components/Tools.vue | 171 +++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 125 insertions(+), 46 deletions(-)
diff --git a/src/pages/desktop/index/components/Tools.vue b/src/pages/desktop/index/components/Tools.vue
index ea2a2b0..72b59ef 100644
--- a/src/pages/desktop/index/components/Tools.vue
+++ b/src/pages/desktop/index/components/Tools.vue
@@ -2,77 +2,120 @@
<div class="tools">
<div class="tools-left">
<div
- :class="['tools-icon', {clicked:this.$store.state.desktop.preferenceVisiable}]"
+ :class="['tools-icon','tools-show-desktop', {clicked:this.$store.state.desktop.preferenceVisiable}]"
@click="togglePreference()"
>
- <span class="fa fa-apple"></span>
+ <img class="system" :src="`${publicPath}images/header-icon/system.png`" />
+ <!-- <span class="fa fa-apple"></span> -->
</div>
- <div class="tools-icon" @click="openSafari()">
- <span class="fa fa-safari"></span>
+ <div class="tools-icon">
+ <!-- <span class="fa fa-safari"></span> -->
+ <img class="smart-ai" :src="`${publicPath}images/header-icon/SmartAI.png`" alt />
</div>
</div>
- <div class="tools-middle"></div>
+ <div class="tools-middle">
+ <div v-for="dock in this.$store.state.desktop.minDocks" :key="dock.id" class="dock-item-wrap">
+ <a @click="dockClick(dock)">
+ <img class="dock-item" :src="dock.src" :alt="dock.alt" />
+ </a>
+ </div>
+ </div>
<div class="tools-right">
<div class="tools-icon">
- <span class="fa fa-battery-full"></span>
+ <!-- <span class="fa fa-battery-full"></span> -->
+ <img :src="`${publicPath}images/header-icon/search.png`" alt />
</div>
- <timer></timer>
- <div class="tools-icon tools-notification-center" @click="notificationCenterClick()">
- <span
- :class="['fa', {'fa-list-ul':notificationCenterNoMessage()}, {'fa-comment-o on-new-msg':!notificationCenterNoMessage()},{'fa-commenting-o':notificationCenterMessageFlicker()}]"
- ></span>
+ <div class="tools-icon">
+ <!-- <span class="fa fa-battery-full"></span> -->
+ <img :src="`${publicPath}images/header-icon/help.png`" alt />
</div>
- <div class="tools-icon tools-show-desktop">
- <span> </span>
+ <div class="tools-icon" @click="notificationCenterClick()">
+ <!-- <span class="fa fa-battery-full"></span> -->
+ <img :src="`${publicPath}images/header-icon/notice.png`" alt />
</div>
+ <div class="tools-icon">
+ <!-- <span class="fa fa-battery-full"></span> -->
+ <img :src="`${publicPath}images/header-icon/user.png`" alt />
+ </div>
+ <!-- <timer></timer> -->
+ <!-- <div class="tools-icon tools-notification-center" @click="notificationCenterClick()">
+ <span
+ :class="['fa', {'fa-list-ul':notificationCenterNoMessage()}, {'fa-comment-o on-new-msg':!notificationCenterNoMessage()},{'fa-commenting-o':notificationCenterMessageFlicker()}]"
+ ></span>
+ </div>-->
</div>
</div>
</template>
<script>
-import Timer from './Timer';
export default {
name: "Tools",
- components: {
- Timer
- },
data() {
return {
+ publicPath: process.env.BASE_URL,
notificationCenterVisible: false,
- notificationCenterMessageCount: 0,
- }
+ notificationCenterMessageCount: 0
+ };
},
created() {
let _that = this;
if (window.toolIntervalArr) {
window.toolIntervalArr.forEach(item => clearInterval(item));
}
- window.toolIntervalArr = [setInterval(function () {
- _that.notificationCenterMessageCount += 1;
- }, 600)];
+ window.toolIntervalArr = [
+ setInterval(function () {
+ _that.notificationCenterMessageCount += 1;
+ }, 600)
+ ];
},
methods: {
notificationCenterClick: function () {
this.notificationCenterVisible = !this.notificationCenterVisible;
- this.$store.commit('desktop/changeNotificationCenterVisible',
- this.notificationCenterVisible);
+ this.$store.commit(
+ "desktop/changeNotificationCenterVisible",
+ this.notificationCenterVisible
+ );
},
notificationCenterNoMessage: function () {
return this.$store.state.desktop.messageNotices.length === 0;
},
notificationCenterMessageFlicker: function () {
- return ((this.notificationCenterMessageCount % 2) === 0)
- && !this.notificationCenterNoMessage();
+ return (
+ this.notificationCenterMessageCount % 2 === 0 &&
+ !this.notificationCenterNoMessage()
+ );
},
- openSafari: function () {
- this.$store.commit("desktop/openSafari");
+
+ togglePreference() {
+ //this.$store.commit("desktop/togglePreference");
+ //鏄剧ず妗岄潰,鏈�灏忓寲宸叉墦寮�鐨勫簲鐢�
+ debugger;
+ this.$store.state.desktop.frames.forEach(frame => {
+ this.$store.commit('desktop/addMinDock', {
+ id: frame.id,
+ src: frame.icon,
+ alt: frame.title,
+ type: "3"
+ });
+ })
},
- togglePreference: function () {
- this.$store.commit("desktop/togglePreference");
+ dockClick(dock) {
+ if (dock.type === "1") {
+ window.open(dock.url);
+ } else if (dock.type === "2") {
+ this.$store.dispatch("desktop/addFrame", {
+ id: dock.id,
+ icon: dock.src,
+ title: dock.name,
+ url: dock.url
+ });
+ } else if (dock.type === "3") {
+ this.$store.commit("desktop/resetMinFrame", dock.id);
+ }
}
}
-}
+};
</script>
<style scoped>
@@ -80,42 +123,78 @@
width: 100%;
position: fixed;
top: 0;
- height: 30px;
- line-height: 30px;
- background-color: rgba(15, 15, 0, 0.4);
+ height: 40px;
+ line-height: 40px;
+ background-color: #d9e5f1;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
z-index: 120;
- color: #fff;
+ color: #000;
}
-
+.tools .center {
+ width: 1300px;
+ height: 40px;
+ margin: auto;
+}
.tools .tools-left {
width: 200px;
height: 100%;
float: left;
- margin-left: 8px;
+ margin-left: 14px;
}
-
+.tools .tools-middle {
+ float: left;
+ position: relative;
+}
+.tools .tools-middle::before {
+ width: 1px;
+ height: 20px;
+ content: "";
+ position: absolute;
+ top: 10px;
+ left: 0;
+ background: rgba(0, 0, 0, 0.2);
+}
+.tools .tools-middle .dock-item-wrap {
+ display: inline-block;
+ padding: 0 10px;
+ height: 38px;
+ line-height: 54px;
+ margin-right: 1px;
+ border-bottom: 2px solid transparent;
+}
+.tools .tools-middle .dock-item-wrap:hover,
+.tools .tools-middle .dock-item-wrap.clicked {
+ color: white;
+ background-color: #98aabe;
+ border-color: #40c3ff;
+ cursor: pointer;
+}
+.dock-item-wrap a {
+ height: 100%;
+}
+.dock-item-wrap img {
+ width: auto;
+ height: 70%;
+}
.tools-icon {
text-align: center;
- width: 30px;
height: 100%;
display: inline-block;
+ vertical-align: top;
+ line-height: 56px;
+ padding: 0 15px;
}
.tools .tools-icon:hover,
.tools .tools-icon.clicked {
color: white;
- background-color: rgba(49, 156, 241, 0.71);
+ background-color: #98aabe;
cursor: pointer;
}
.tools .tools-right {
float: right;
height: 100%;
-}
-
-.tools .tools-right .tools-show-desktop {
- border-left: grey 1px solid;
- width: 5px;
- margin-left: 3px;
+ margin-right: 14px;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0