|
@@ -0,0 +1,94 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <a-space :size="50">
|
|
|
+ <div class="filter-icon" v-for="(component,i) in components" :key="component.name" :class="current===i?'active':''" @click="handleFilter(i)">
|
|
|
+ <my-icon :type="component.icon"></my-icon>
|
|
|
+ <div>{{ component.name }}</div>
|
|
|
+ </div>
|
|
|
+ </a-space>
|
|
|
+ <keep-alive>
|
|
|
+ <component :is="components[current].component" />
|
|
|
+ </keep-alive>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import OpcPosition from './OpcPosition.vue'
|
|
|
+import OpcPositionForAh from './OpcPositionForAh.vue'
|
|
|
+import OpcPositionForProducer from './OpcPositionForProducer.vue'
|
|
|
+import OpcPositionNot from './OpcPositionNot.vue'
|
|
|
+import RemoteOpcNotCreated from './RemoteOpcNotCreated.vue'
|
|
|
+import RemoteOpc from './RemoteOpc.vue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ OpcPosition,
|
|
|
+ RemoteOpc,
|
|
|
+ RemoteOpcNotCreated,
|
|
|
+ OpcPositionNot,
|
|
|
+ OpcPositionForProducer,
|
|
|
+ OpcPositionForAh
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ current: 0,
|
|
|
+ components: [
|
|
|
+ {
|
|
|
+ name: 'OPC对应表',
|
|
|
+ icon: 'icon-shebeiguanli',
|
|
|
+ component: 'RemoteOpc'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'OPC对应表未配置',
|
|
|
+ icon: 'icon-shebeiguanli',
|
|
|
+ component: 'RemoteOpcNotCreated'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'OPC车间',
|
|
|
+ icon: 'icon-shebeiguanli',
|
|
|
+ component: 'OpcPositionNot'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'OPC车间台账',
|
|
|
+ icon: 'icon-shebeiguanli',
|
|
|
+ component: 'OpcPosition'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'OPC车间生产',
|
|
|
+ icon: 'icon-shebeiguanli',
|
|
|
+ component: 'OpcPositionForProducer'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'OPC安环',
|
|
|
+ icon: 'icon-shebeiguanli',
|
|
|
+ component: 'OpcPositionForAh'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleFilter (index) {
|
|
|
+ this.current = index
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.filter-icon{
|
|
|
+ font-size: 18px;
|
|
|
+ text-align: center;
|
|
|
+ color: #666;
|
|
|
+ cursor: pointer;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ &>:first-child{
|
|
|
+ font-size: 30px;
|
|
|
+}
|
|
|
+&:hover{
|
|
|
+ color: #1890ff;
|
|
|
+}
|
|
|
+}
|
|
|
+.active{
|
|
|
+ color:#1890ff;
|
|
|
+}
|
|
|
+</style>
|