wanshenmean
2026-03-27 dcbd4934d063f471c01cbcf93574c2e2ac5f16b5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<template>
  <el-container class="admin-layout">
    <el-aside class="admin-aside" width="220px">
      <div class="brand-area">
        <el-icon :size="24" class="brand-icon"><Cpu /></el-icon>
        <div class="brand-text">
          <div class="brand-title">WCS 模拟平台</div>
          <div class="brand-subtitle">S7 Simulator</div>
        </div>
      </div>
 
      <el-menu
        class="aside-menu"
        :default-active="activeMenu"
        background-color="#1f2a37"
        text-color="#c7d2fe"
        active-text-color="#ffffff"
        router
      >
        <el-menu-item index="/">
          <el-icon><House /></el-icon>
          <span>实例管理</span>
        </el-menu-item>
        <el-menu-item index="/protocol-templates">
          <el-icon><Files /></el-icon>
          <span>协议模板</span>
        </el-menu-item>
        <el-menu-item index="/robot-clients">
          <el-icon><Connection /></el-icon>
          <span>机械手客户端</span>
        </el-menu-item>
      </el-menu>
    </el-aside>
 
    <el-container>
      <el-header class="admin-header">
        <div class="header-left">
          <div class="page-title">{{ pageTitle }}</div>
          <div class="page-path">{{ route.path }}</div>
        </div>
      </el-header>
 
      <el-main class="admin-main">
        <div class="content-shell">
          <router-view />
        </div>
      </el-main>
    </el-container>
  </el-container>
</template>
 
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { Connection, Cpu, Files, House } from '@element-plus/icons-vue'
 
const route = useRoute()
 
const activeMenu = computed(() => {
  if (route.path.startsWith('/protocol-templates')) return '/protocol-templates'
  if (route.path.startsWith('/robot-clients')) return '/robot-clients'
  return '/'
})
 
const pageTitle = computed(() => {
  if (route.path.startsWith('/create')) return '创建实例'
  if (route.path.startsWith('/edit')) return '编辑实例'
  if (route.path.startsWith('/details')) return '实例详情'
  if (route.path.startsWith('/protocol-templates')) return '协议模板'
  if (route.path.startsWith('/robot-clients')) return '机械手客户端'
  return '实例管理'
})
</script>
 
<style scoped>
.admin-layout {
  height: 100vh;
}
 
.admin-aside {
  background: linear-gradient(180deg, #1f2a37 0%, #111827 100%);
  border-right: 1px solid #263445;
  display: flex;
  flex-direction: column;
}
 
.brand-area {
  height: 64px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #2b3a4f;
  color: #e5e7eb;
}
 
.brand-icon {
  margin-right: 10px;
}
 
.brand-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
 
.brand-subtitle {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.2;
}
 
.aside-menu {
  border-right: none;
  flex: 1;
}
 
.admin-header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
 
.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
 
.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}
 
.page-path {
  font-size: 12px;
  color: #64748b;
}
 
.admin-main {
  background: #f1f5f9;
  padding: 14px;
}
 
.content-shell {
  min-height: calc(100vh - 64px - 28px);
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 2px;
}
 
@media (max-width: 960px) {
  .admin-aside {
    width: 64px !important;
  }
 
  .brand-text {
    display: none;
  }
 
  .admin-header {
    padding: 0 12px;
  }
}
</style>