ソースを参照

修复以前的bug

lusa 3 年 前
コミット
1534d00528

+ 0 - 0
output.js → output_back.js


+ 2 - 12
package.json

@@ -27,22 +27,12 @@
     "babel-eslint": "^10.0.3",
     "babel-plugin-import": "^1.13.0",
     "eslint": "^5.16.0",
-    "eslint-plugin-vue": "^5.0.0",
     "less-loader": "^5.0.0",
     "vue-template-compiler": "^2.6.10"
   },
   "eslintConfig": {
-    "root": true,
-    "env": {
-      "node": true
-    },
-    "extends": [
-      "plugin:vue/recommended",
-      "eslint:recommended"
-    ],
-    "parserOptions": {
-      "parser": "babel-eslint"
-    }
+
+
   },
   "browserslist": [
     "> 1%",

+ 2 - 4
public/index.html

@@ -5,12 +5,10 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title>bmcui</title>
+    <title>领存技术BMC管理系统</title>
   </head>
   <body>
-    <noscript>
-      <strong>We're sorry but bmcui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
+
     <div id="app"></div>
     <!-- built files will be auto injected -->
   </body>

+ 7 - 8
src/api/index.js

@@ -7,7 +7,7 @@ axios.defaults.timeout = 100000
 Vue.prototype.Ajax = axios
 // Add a request interceptor 请求
 axios.interceptors.request.use(function (config) {
-  
+    config.params.index =  sessionStorage.getItem('currentIndex') || 0
     config.headers = {Pragma: 'no-cache'}
     return config
 }, function (error) {
@@ -25,19 +25,18 @@ axios.interceptors.response.use(
         return Promise.reject(error)
     }
 )
-
 export default {
-    Get(url, params, fn, errorFn) {
-        axios.get(URL + url, {params: params}).then(fn).catch(errorFn)
+    Get(url, params) {
+       return axios.get(url, {params: params})
     },
     Post(url, params, fn) {
-        axios.post(URL + url, params).then(fn).catch(err => console.error(err))
+        return axios.post(url, params)
     },
     Delete(url, params, fn) {
-        axios.delete(URL + url, {params: params}).then(fn).catch(err => console.error(err))
+        axios.delete( url, {params: params}).then(fn).catch(err => console.error(err))
     },
-    uploadImg: URL + '/file/upload_pic',    //上传图片接口
-    uploadFile: URL + '/file/upload_file',    //上传文件接口,不用登录的
+    uploadImg: '/file/upload_pic',    //上传图片接口
+    uploadFile: '/file/upload_file',    //上传文件接口,不用登录的
 
     Down(url, name, type="application/pdf") {
         axios({

+ 14 - 0
src/assets/css/app.scss

@@ -596,3 +596,17 @@ p.error {
         white-space:normal;
     }
 }
+
+.dashboard_box{
+  -webkit-box-sizing: border-box!important;
+  box-sizing: border-box!important;
+  width: 1180px;
+  margin: 10px auto auto auto;
+  padding: 20px 0;
+}
+.title-info-content>h3{
+  color:#fff;
+  margin-bottom:0;
+  padding-bottom:10px;
+  border-bottom:1px solid #000
+}

BIN
src/assets/img/active.png


BIN
src/assets/img/bg1.png


BIN
src/assets/img/cart.png


BIN
src/assets/img/cart_active.png


BIN
src/assets/img/checked-card.png


BIN
src/assets/img/icon_right.png


ファイルの差分が大きいため隠しています
+ 24 - 0
src/assets/img/ionicons.svg


BIN
src/assets/img/logout_1.png


BIN
src/assets/img/refresh.png


BIN
src/assets/img/status_critical.png


BIN
src/assets/img/status_ok.png


BIN
src/assets/img/status_warning.png


BIN
src/assets/img/user.png


BIN
src/assets/img/view.png


+ 20 - 3
src/components/header.vue

@@ -13,15 +13,16 @@
         <div v-if="isShowMenu" class="userDetails">
             <img src="../assets/user.png" border="0" title="Name and privileges of currently logged user">
             <span id="username">admin</span><small id="priv"> (Administrator)</small>
-            <a href="javascript://" id="refreshBtn" title="Reloads the current page"><img src="../assets/refresh.png" border="0"> 刷新</a>
+            <a href="javascript://" @click="refreshBtn" title="Reloads the current page"><img src="../assets/refresh.png" border="0"> 刷新</a>
             <a href="javascript://" id="printBtn" title="Prints the current page"><img src="../assets/print_1.png" border="0"> 打印</a>
-            <a href="javascript://" id="logoutBtn" title="Logout"><img src="../assets/logout_1.png" border="0"> 登出</a>
+            <a href="javascript://" @click="logoutBtn" id="logoutBtn" title="Logout"><img src="../assets/logout_1.png" border="0"> 登出</a>
         </div>
       </div>
   </div>
 </template>
 
 <script>
+    import api from '../api/'
 export default {
   name: 'headers',
   props: {
@@ -31,7 +32,23 @@ export default {
     }
   },
   created(){
-  }
+  },
+    methods: {
+        refreshBtn(){
+            this.$emit('reload')
+        },
+        logoutBtn(){
+
+            api.Get("/action/logout",{}).then(res =>{
+                sessionStorage.clear();
+                this.$router.push('/login')
+            })
+
+
+        }
+    },
+
+
 }
 </script>
 

+ 88 - 134
src/components/menu.vue

@@ -1,148 +1,102 @@
 <template>
-  <div class="menu-contente">
-   <Menu  mode="horizontal" active-name="总览">
+    <div class="menu-contente">
+        <Menu mode="horizontal" :active-name="activeName">
 
-          <template v-for='(item, index) in menuList'>
-            <template v-if='!!!item.children'>
-              <MenuItem :name="item.name" :to='item.link'>
-                {{item.name}}
-              </MenuItem>
-            </template>
-            <template v-else>
-               <Submenu :name="item.name">
-                <template slot="title">
-                    {{item.name}}
+            <template v-for='(item, index) in menulist'>
+                <template v-if='!!!item.children'>
+                    <MenuItem :name="item.link" :to='item.link'>
+                        <Icon v-if="item.icon" :type="item.icon" color="#1874ff" />
+                        {{item.name}}
+                    </MenuItem>
                 </template>
-                <template v-for='i in item.children'>
-                  <MenuItem :to='i.link'  :name="i.name">{{i.name}}</MenuItem>
+                <template v-else>
+                    <submenu :name="item.name">
+                        <template slot="title">
+                            {{item.name}}
+                        </template>
+                        <template v-for='i in item.children'>
+                            <MenuItem :to='i.link' :name="i.name">{{i.name}}</MenuItem>
+                        </template>
+                    </submenu>
                 </template>
-              </Submenu>
             </template>
-          </template>
-           
-           
         </Menu>
-  </div>
+    </div>
 </template>
 
 <script>
-export default {
-  name: 'allmenu',
-  data(){
-    return {
-      theme:'',
-        menuList:[
-          {
-            name:"总览",
-            link:'dashbord',
-            isDisabel: false
-          },
-          {
-            name:"风扇控制",
-            link:'fan',
-            isDisabel: false
-          },
-          {
-            name:"FRU信息",
-            link:'fru_info',
-            isDisabel: false
-          },
-          {
-            name:"健康",
-            // link:'index/',
-            isDisabel: false,
-            children:[
-              {name:"传感器读值", link:'sensor_history', isDisabel: false},
-              {name:"事件日志", isDisabel: false},
-              {name:"系统日志", isDisabel: false},
-              {name:"BSOD屏幕", isDisabel: false},
-            ]
-          },
-           {
-            name:"配置",
-            link:'index/',
-            isDisabel: false,
-            children:[
-              {name:"Active Directory", link:'index/', isDisabel: false},
-              {name:"DNS", link:'index/', isDisabel: false},
-              {name:"事件日志", link:'index/', isDisabel: false},
-              {name:"Images重定向", link:'index/', isDisabel: false},
-              {name:"LDAP/E-Directory", link:'index/', isDisabel: false},
-              {name:"证书", link:'index/', isDisabel: false},
-              {name:"鼠标的模式", link:'index/', isDisabel: false},
-              {name:"NCSI", link:'index/', isDisabel: false},
-              {name:"网络", link:'index/', isDisabel: false},
-              {name:"网络绑定", link:'index/', isDisabel: false},
-              {name:"网络连接", link:'index/', isDisabel: false},
-              {name:"NTP", link:'index/', isDisabel: false},
-              {name:"PAM 指令", link:'index/', isDisabel: false},
-              {name:"PEF", link:'index/', isDisabel: false},
-              {name:"RADIUS", link:'index/', isDisabel: false},
-              {name:"远程会话", link:'index/', isDisabel: false},
-              {name:"服务", link:'index/', isDisabel: false},
-              {name:"SMTP", link:'index/', isDisabel: false},
-              {name:"SSL", link:'index/', isDisabel: false},
-              {name:"系统日志", link:'index/', isDisabel: false},
-              {name:"系统防火墙", link:'index/', isDisabel: false},
-              {name:"用户", link:'index/', isDisabel: false},
-              {name:"虚拟媒体", link:'index/', isDisabel: false},
-            ]
-          },
-          {
-            name:"运动控制",
-            isDisabel: false,
-            link:'index/',
-            children:[
-              {name:"终端重定向", link:'index/', isDisabel: false},
-              {name:"电源控制", link:'index/', isDisabel: false},
-            
-            ]
-          },
-          {
-            name:"自动视频录制",
-            isDisabel: false,
-            link:'index/',
-            children:[
-              {name:"触发配置", link:'index/', isDisabel: false},
-              {name:"视频录制", link:'index/', isDisabel: false},
-            
-            ]
-          },
-          {
-            name:"维护",
-            isDisabel: false,
-            link:'index/',
-            children:[
-              {name:"保留配置", link:'index/', isDisabel: false},
-              {name:"恢复配置", link:'index/', isDisabel: false},
-              {name:"系统管理员", link:'index/', isDisabel: false},
-            
-            ]
-          },
-          {
-            name:"固件更新",
-            isDisabel: false,
-            link:'index/',
-            children:[
-              {name:"固件更新", link:'index/', isDisabel: false},
-              {name:"协议配置", link:'index/', isDisabel: false},
-            
-            ]
-          },
-        ]
+    export default {
+        name: 'allmenu',
+        data() {
+            return {
+                theme: '',
+                activeName: this.$route.name,
+                menulist: [
+                    {
+                        name: "总览",
+                        link: 'dashbord',
+                        icon: 'ios-home',
+                        isdisabel: false
+                    },
+                    {
+                        name: "风扇控制",
+                        link: 'fan',
+                        icon: 'md-aperture',
+                        isdisabel: false
+                    },
+                    {
+                        name: "FRU信息",
+                        link: 'fru_info',
+                        icon: 'ios-grid',
+                        isdisabel: false
+                    },
+                    {
+                        name: "传感器设置",
+                        link:'sensor_history',
+                        icon: 'md-analytics',
+                        isdisabel: false,
+                    },
+
+                    {
+                        name: "日志",
+                        isdisabel: false,
+                        icon: 'ios-list-box-outline',
+                        link: 'event_logs'
+                    },
+
+                    {
+                        name: "电源控制",
+                        isdisabel: false,
+                        icon: 'md-power',
+                        link: 'RemotPwrCtrl',
+                    },
+                    {
+                        name: "设置",
+                        link: "setting",
+                        isDisabel: false,
+                        icon: 'ios-cog-outline',
+                    }
+                ]
+            }
+        },
+        watch: {
+            $route: function () {
+                console.log( this.$route)
+                this.activeName = this.$route.name
+            }
+        }
+
     }
-  }
-}
 </script>
 
 <style lang='scss' scoped>
-  .menu-contente{
-    /*position: fixed;*/
-    width: 1180px;
-    /*top: 0px;
-    left: 0px;
-    right: 0px;*/
-    margin-left:auto;
-    margin-right:auto;
-  }
+    .menu-contente {
+        /*position: fixed;*/
+        width: 1180px;
+        /*top: 0px;
+        left: 0px;
+        right: 0px;*/
+        margin-left: auto;
+        margin-right: auto;
+    }
 </style>

+ 43 - 2
src/main.js

@@ -1,14 +1,55 @@
 import Vue from 'vue'
 import App from './App.vue'
-
+import 'babel-polyfill'
 import router from './router'
-
+import echarts from 'echarts'
+import $ from 'jquery'
+Vue.prototype.$echarts = echarts
 Vue.config.productionTip = false
 import "./assets/css/app.scss"
 import ViewUI from 'view-design'
 import 'view-design/dist/styles/iview.css';
 
 import "./assets/css/iview_style_reset.scss"
+//
+// require('./utils/sensor_specific_event_str.js')
+// require('./utils/common_str.js')
+// require('./utils/sensortype_str.js')
+// require('./utils/event_str.js')
 Vue.use(ViewUI);
+Vue.prototype.mainColor = '#1874ff'
+Vue.prototype.getTimeStamp = function(timeInSeconds) {
+    var evtTimeStamp = "";
+    var eventDate = new Date(timeInSeconds * 1000);
+
+    var evtMonth=eventDate.getUTCMonth() + 1;
+    evtMonth =((evtMonth < 10)?"0":"") + evtMonth;
+    var evtDate = eventDate.getUTCDate();
+    evtDate=((evtDate < 10)?"0":"") + evtDate;
+    evtTimeStamp = evtMonth+'/'+evtDate+'/'+eventDate.getUTCFullYear();
+
+    var evtHours =eventDate.getUTCHours();
+    evtHours =((evtHours < 10)?"0":"") + evtHours;
+    var evtMins = eventDate.getUTCMinutes();
+    evtMins =((evtMins < 10)?"0":"") + evtMins;
+    var evtSecs = eventDate.getUTCSeconds();
+    evtSecs =((evtSecs < 10)?"0":"") + evtSecs;
+    evtTimeStamp += '  '+evtHours+':'+evtMins+':'+evtSecs;
+    return (evtTimeStamp);
+}
+//气泡提示
+const popTip = function (el, title, icon, fn, type = 'ghost') {
+    return el('Poptip', {
+        props: {confirm: true, width: 240, placement: 'top-end', title: `确定${title}?`},
+        on: {
+            'on-ok': () => {
+                fn()
+            }
+        }
+    }, [el('Button', {
+        props: {icon: icon, type: type, size: 'small'},
+    }, title)])
+}
+window.popTip = popTip
 
 new Vue({ router, render: h => h(App), }).$mount('#app')

+ 44 - 66
src/router/index.js

@@ -1,8 +1,7 @@
 /* eslint-disable */
 import Vue from 'vue'
 import Router from 'vue-router'
-// import HelloWorld from '@/components/HelloWorld.vue'
-
+import api from '../api'
 Vue.use(Router)
 
 
@@ -31,98 +30,77 @@ const router = new Router({
                     path: 'fru_info',  component: r => require.ensure([], () => r(require('../views/FRUInfo')), 'fan'),
                 },
                 {
-                    path: 'active_directory',
-                    meta: {
-                        title: 'Active Directory'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/ActiveDirectory')), 'configuration'),
-                },
-                {
-                    path: 'dns',
-                    meta: {
-                        title: 'DNS'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/DNS')), 'configuration'),
+                    path: "sensor_history",
+                    component: r => require.ensure([], () => r(require('@/views/SensorHistory')), 'sensor_history'),
                 },
                 {
-                    path: 'event_log',
-                    meta: {
-                        title: '事件日志'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/EventLog')), 'configuration'),
+                    path: "set_proctrol",
+                    component: r => require.ensure([], () => r(require('@/views/SetProctrol.vue')), 'set_proctrol'),
                 },
                 {
-                    path: 'images_redirection',
-                    meta: {
-                        title: 'Images重定向'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/ImagesRedirection')), 'configuration'),
+                    path: "event_logs",
+                    component: r => require.ensure([], () => r(require('@/views/EventLogs.vue')), 'event_logs'),
                 },
                 {
-                    path: 'ldap',
-                    meta: {
-                        title: 'LDAP/E-Directory'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/LDAP')), 'configuration'),
+                    path: "system_logs",
+                    component: r => require.ensure([], () => r(require('@/views/SystemLogs.vue')), 'system_logs'),
                 },
                 {
-                    path: 'license',
-                    meta: {
-                        title: '证书'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/License')), 'configuration'),
+                    path: "BSODScreen",
+                    component: r => require.ensure([], () => r(require('@/views/BSODScreen.vue')), 'BSODScreen'),
                 },
                 {
-                    path: 'mouse_mode',
-                    meta: {
-                        title: '证书'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/MouseMode')), 'configuration'),
+                    path: "RemotPwrCtrl",
+                    component: r => require.ensure([], () => r(require('@/views/RemotPwrCtrl.vue')), 'RemotPwrCtrl'),
                 },
                 {
-                    path: 'ncsi',
-                    meta: {
-                        title: 'NCSI'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/NCSI')), 'configuration'),
+                    path: "SelList",
+                    component: r => require.ensure([], () => r(require('@/views/SelList.vue')), 'SelList'),
                 },
                 {
-                    path: 'network',
-                    meta: {
-                        title: '网络'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/Network')), 'configuration'),
+                    path: "UserManage",
+                    component: r => require.ensure([], () => r(require('@/views/UserManage.vue')), 'UserManage'),
                 },
                 {
-                    path: 'network_bond',
-                    meta: {
-                        title: '网络绑定'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/NetworkBond')), 'configuration'),
+                    path: "UploadProgre",
+                    component: r => require.ensure([], () => r(require('@/views/UploadProgre.vue')), 'UploadProgre'),
                 },
                 {
-                    path: 'network_link',
-                    meta: {
-                        title: '网络链接'
-                    },
-                    component: r => require.ensure([], () => r(require('../views/configuration/NetworkLink')), 'configuration'),
-                },
-            ]
+                    path: "setting",
+                    component: r => require.ensure([], () => r(require('@/views/setting.vue')), 'setting'),
+                }]
         },
         {
             path: '/login',
             name: '登录',
-            component: r => require.ensure([], () => r(require('../views/login')), 'login')
+            component: r => require.ensure([], () => r(require('@/views/login')), 'login')
         },
 
     ]
 })
 
-// router.beforeEach((to, from, next) => {
+router.beforeEach(async (to, from, next) => {
 
-//     let title = to.name ? to.name : '领存企业'
-//     next()
-// })
+
+    let title = to.name ? to.name : '领存BMC'
+    console.log("/login" == to.path)
+    // if("/login" == to.path) {
+    //     next()
+    //     return
+    // }
+    // let res = await api.Get('/action/checkLoginStatus',{})
+    // if(res.code == 200 && res.data.loginStatus == 'ok'){
+    //     next()
+    //     return
+    // }
+    // next({
+    //     path:'/login',
+    //     query:{
+    //         redirect: to.path
+    //     }
+    // })
+    next();
+})
 // // 跳转后返回顶部
 // router.afterEach((to, from, next) => {
 //     window.scrollTo(0, 0)

+ 112 - 223
src/views/FRUInfo.vue

@@ -1,255 +1,144 @@
 <template>
 	<div class="dashboard_box" style="width: 1180px;margin: auto;">
-		<div class="dashboard_box">
-        <h3>
-           Field Replaceable Unit(FRU)
 
-        </h3>
-        <p style="display:none">
-           This page gives detailed information for the various FRU devices present in this system.
-
-        </p>
-
-        <h4 style="display:none">
-           Basic Information:
-
-        </h4>
-        <div style="display:none" class="subSection">
-            <table cellspacing="0" cellpadding="6" border="0" width="700">
-                <tbody><tr><td width="40%"><strong>
-                  FRU Device ID
-
-                </strong></td>
-                    <td><select id="_FRUDeviceID" class="classicTxtBox"></select></td></tr>
-                <tr><td><strong>
-                   FRU Device Name
-
-                </strong></td>
-                    <td><label id="_FRUDeviceName" class="classicTxtBox"></label></td></tr>
-            </tbody></table>
-        </div>
-        
-        <h4>
-         Chassis Information:
-
-        </h4>
+        <div class="dashboard_box"></div>
         <div class="subSection">
-            <table cellspacing="0" cellpadding="6" border="0" width="700">
-                <tbody><tr><td width="40%"><strong>
-                  Chassis Information Area Format Version
-
-                </strong></td>
-                    <td><label id="_CI_ChassisInfoAreaFormatVersion" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                Chassis Type
-
-                </strong></td>
-                    <td><label id="_CI_ChassisType" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Chassis Part Number
-
-                </strong></td>
-                    <td><label id="_CI_ChassisPartNum" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Chassis Serial Number
-
-                </strong></td>
-                    <td><label id="_CI_ChassisSerialNum" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Chassis Extra
-
-                </strong></td>
-                    <td><label id="_CI_CustomFields" class="classicTxtBox"></label></td></tr>
-            </tbody></table>
+            <Row :gutter="10"  class="row-contanier">
+                <Col :span="8">
+                    <Card>
+                        <p slot="title">
+                            <Icon type="ios-easel"  :color="mainColor"/>
+                            机箱信息
+                        </p>
+                        <p>机箱类型:{{data.type}}</p>
+                        <p>机箱编号:{{data.PN}}</p>
+                        <p>机箱序号:{{data.SN}}</p>
+                        <p>其它信息:{{data.OEM}}</p>
+                    </Card>
+                </Col>
+                <Col :span="8">
+                    <Card>
+                        <p slot="title">
+                            <Icon type="ios-list-box-outline" :color="mainColor"></Icon>
+                            板卡信息
+                        </p>
+
+                        <p>制造日期时间:{{bdata.Date}}</p>
+                        <p>板卡制造商:{{bdata.Mfr}}</p>
+                        <p>板卡名称:{{bdata.Name}}</p>
+                        <p>板卡序列号:{{bdata.PN}}</p>
+                        <p>板卡料号:{{bdata.SN}}</p>
+                        <p>其它信息:{{bdata.OEM}}</p>
+                    </Card>
+                </Col>
+                <Col :span="8">
+                    <Card>
+                        <p slot="title">
+                            <Icon type="ios-desktop" :color="mainColor"></Icon>
+                            产品信息
+                        </p>
+                        <p>产品制造商:{{pdata.Mfr}}</p>
+                        <p>产品名称:{{pdata.Name}}</p>
+                        <p>产品序列号:{{pdata.PN}}</p>
+                        <p>产品版本号:{{pdata.Ver}}</p>
+                        <p>产品料号:{{pdata.SN}}</p>
+                        <p>其它信息:{{pdata.OEM}}</p>
+                    </Card>
+                </Col>
+            </Row>
         </div>
-
-        <h4>
-          Board Information:
-
-        </h4>
-        <div class="subSection">
-            <table cellspacing="0" cellpadding="6" border="0" width="700">
-                <tbody><tr><td width="40%"><strong>
-                  Board Information Area Format Version
-
-                </strong></td>
-                    <td><label id="_BI_BoardInfoAreaFormatVersion" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                  Language
-
-                </strong></td>
-                    <td><label id="_BI_Language" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                    Manufacture Date Time
-
-                </strong></td>
-                    <td><label id="_BI_MfgDateTime" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                  Board Manufacturer
-
-                </strong></td>
-                    <td><label id="_BI_BoardMfr" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Board Product Name
-
-                </strong></td>
-                    <td><label id="_BI_BoardProductName" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Board Serial Number
-
-                </strong></td>
-                    <td><label id="_BI_BoardSerialNum" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                    Board Part Number
-
-                </strong></td>
-                    <td><label id="_BI_BoardPartNum" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                    FRU File ID
-
-                </strong></td>
-                    <td><label id="_BI_FRUFileID" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Board Extra
-
-                </strong></td>
-                    <td><label id="_BI_CustomFields" class="classicTxtBox"></label></td></tr>
-            </tbody></table>
-        </div>
-
-        <h4>
-          Product Information:
-
-        </h4>
-        <div class="subSection">
-            <table cellspacing="0" cellpadding="6" border="0" width="700">
-                <tbody><tr><td width="40%"><strong>
-                   Product Information Area Format Version
-
-                </strong></td>
-                    <td><label id="_PI_ProductInfoAreaFormatVersion" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   </script>Language
-
-                </strong></td>
-                    <td><label id="_PI_Language" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                    Manufacturer Name
-
-                </strong></td>
-                    <td><label id="_PI_MfrName" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                  Product Name
-
-                </strong></td>
-                    <td><label id="_PI_ProductName" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Product Part Number
-
-                </strong></td>
-                    <td><label id="_PI_ProductPartNum" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Product Version
-
-                </strong></td>
-                    <td><label id="_PI_ProductVersion" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                  Product Serial Number
-
-                </strong></td>
-                    <td><label id="_PI_ProductSerialNum" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                  Asset Tag
-
-                </strong></td>
-                    <td><label id="_PI_AssetTag" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                 FRU File ID
-
-                </strong></td>
-                    <td><label id="_PI_FRUFileID" class="classicTxtBox"></label></td></tr>
-                <tr><td><strong>
-                   Product Extra
-
-                </strong></td>
-                    <td><label id="_PI_CustomFields" class="classicTxtBox"></label></td></tr>
-            </tbody></table>
-        </div>
-    </div>
-		
 	</div>
 </template>
 <script>
+    import api from '../api'
 export default {
 	name: 'dashbord1',
 	data(){
 		return{
-			fanList:[
-				{name:'fan1', speed: 1000, model: 1, duty:56.3},
-				{name:'fan2', speed: 1000, model: 1, duty:56.3},
-				{name:'fan3', speed: 1000, model: 2, duty:56.3},
-				{name:'fan4', speed: 1000, model: 2, duty:56.3},
-				{name:'fan5', speed: 1000, model: 1, duty:56.3}
-			]
+            data: {
+            },
+            bdata: {
+            },
+            pdata: {
+            }
 		}
 	},
 	created() {
-		console.log("111111111111111111")
+	    console.log(this.mainColor)
+        this.getFruInfo()
 	},
 	methods:{
-		set(item){
-			console.log(item)
-		}
+        getFruInfo:function() {
+            let t = this;
+            api.Get("/action/getFruChassisInfo", {
+            }).then((function(a) {
+                    t.data = a.data
+                }
+            )).catch((function(t) {
+                    console.log(t),console.log(t.isSuccess)
+                }
+            ))
+
+            api.Get("/action/getFruBoardInfo", {}).then((function(a) {
+                    t.bdata = a.data
+                }
+            )).catch((function(t) {
+                    console.log(t),console.log(t.isSuccess)
+                }
+            ))
+            api.Get("/action/getFruProductInfo", {
+            }).then((function(a) {
+                    t.pdata = a.data
+                }
+            )).catch((function(t) {
+                console.log(t),console.log(t.isSuccess)
+            }))
+        }
 	}
 }
 </script>
 <style lang="scss" scoped>
-* {
-	box-sizing: border-box;
-}
-
-input {
-	margin: 0;
-}
-
-table {
-    font-size: 12px;
+.row-contanier{
+    margin-left: -5px;
+    margin-right: -5px;
+    background: linear-gradient(to top, rgb(255, 255, 255), rgb(209, 227, 255));
+    padding: 20px;
+    color: rgb(51, 51, 51);
 }
 
-tr {
-    height: 26px;
-}
-td{
-    width: 40%;
-}
 .dashboard_box {
-	width: 1180px;
-    margin: auto;
-    margin-top: 10px;
-    /* background: #040C19; */
-    padding: 10px 0;
-    color: #fff;
-    h3 {
-	    color: #fff;
-	    margin-bottom: 0;
-	    padding-bottom: 5px;
-	}
+    width:1180px;
+    margin:auto;
+    margin-top:10px;
+    padding:10px 0;
+    color:#fff
+}
+.dashboard_box h3 {
+    color:#fff;
+    margin-bottom:0;
+    padding-bottom:5px
 }
 h4 {
-    font-size: 15px;
-    width: auto;
-    margin: 3px;
-    padding: 2px;
+    font-size:15px;
+    width:auto;
+    margin:3px;
+    padding:2px
 }
 h3 {
-    color: #fff;
-    font-size: 20px;
-    padding-bottom: 0px;
-    /*margin-top: 5px;*/
-    border-bottom: 1px solid #000;
+    color:#fff;
+    font-size:20px;
+    padding-bottom:0;
+    border-bottom:1px solid #000
 }
 .subSection {
-    padding: 20px;
-    padding-top: 0px;
+    padding-top:0
 }
+.subSection p {
+    height:25px;
+    line-height:25px
+}
+.subSection p.title {
+    font-size:24px
+}
+
 </style>

+ 585 - 100
src/views/SensorHistory.vue

@@ -1,119 +1,604 @@
 <template>
 	<div class="dashboard_box" style="width: 1180px;margin: auto;">
-		<div class="dashboard_box">
-			<h3>
-				传感器读值
-			</h3>
-			<p>
-				所有传感器相关的信息都在这里显示。在一条记录上双击去触发特定传感器的开和关。
-			</p>
-			<Row>
-				<Col :span='12'>
-				<select id="_sensorType">
-					<option value="0">All Sensors</option>
-					<option value="1">Temperature Sensors</option>
-					<option value="2">Voltage Sensors</option>
-					<option value="3">Current Sensors</option>
-				</select>
-				</Col>
-				<Col style='font-size:12px;text-align: right;' :span='12'>
-					<strong> Sensor Count:  </strong>14 sensors
-				</Col>
-			</Row>
-		</div>
+        <spin fix v-if="isLoading">加载中...</spin>
+        <div  data-v-47401793="" class="dashboard_box" style="width: 1180px; margin: auto;">
+            <div  class="dashboard_box">
+                <div  class="sesors-list">
+                    <div  class="left-list">
+                        <div  class="SENSOR_HISTORY">
+                            传感器读值
+                        </div>
+                        <table  cellspacing="0" cellpadding="0" class="listgrid"
+                               style="width: 467px;">
+                            <thead >
+                            <tr  class="head">
+                                <th  class="head">
+                                    名称
+                                    <img  src="../assets/img/sortup.gif" title="Ascending"
+                                         alt="Ascending">
+                                </th>
+                                <th  class="head">
+                                    状态
+                                    <img  src="../assets/img/sortup.gif" title="Ascending"
+                                         alt="Ascending">
+                                </th>
+                                <th  class="head">
+                                    当前读值
+                                    <img  src="../assets/img/sortup.gif" title="Ascending"
+                                         alt="Ascending">
+                                </th>
+                            </tr>
+                            </thead>
+                            <tbody >
+                                <template v-for="item in sensorsList">
+                                    <tr  @click="checkItem(item)" :class=" [item.sensorNum == selectItem.sensorNum ? 'selected': 'normal']">
+                                        <td >
+                                          {{item.sensorName}}
+                                        </td>
+                                        <td >
+                                            {{item.state}}
+                                        </td>
+                                        <td >
+                                            {{item.reading}}
+                                            <img v-if="selectItem.sensorNum == item.sensorNum" src="../assets/img/icon_right.png" style="">
+                                        </td>
+                                    </tr>
+                                </template>
+                            </tbody>
+                        </table>
+                    </div>
+                    <div  class="right-info">
+                        <h4 >
+                        </h4>
+                        <div  class="right-info-title ivu-row">
+                            <div  class="ivu-col ivu-col-span-12">
+                                <strong  id="_sensorName" class="padding-top: 5px; display: block;">
+                                    {{selectItem.sensorName}}
+                                    <font  class="normal">
+                                       {{selectItem.reading}}
+                                    </font>
+                                </strong>
+                            </div>
+                            <div  class="ivu-col ivu-col-span-12" style="text-align: right;">
+                                <div  style="color: rgb(255, 255, 255);">
+                                    <input  type="button" @click="setModal = true" id="_btnThresholdSettings" value="阈值设定"
+                                           class="visibleRow">
+                                </div>
+                            </div>
+                        </div>
+                        <div  class="ivu-row" style="padding: 20px 0px; font-size: 12px;">
+                            <div  class="ivu-col ivu-col-span-12">
+						<span  class="sensor_orange">
+							传感器阈值
+						</span>
+                            </div>
+                            <div  class="ivu-col ivu-col-span-12" style="text-align: right;">
+                            </div>
+                        </div>
+                        <div  class="info_table ivu-row">
+                            <div  class="ivu-col ivu-col-span-6">
+                                低严重错误:
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6">
+                               {{selectItem.lownr}}{{selectItem.unit}}
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6">
+                                高严重错误:
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6" style="text-align: right;">
+                                {{selectItem.highnr}}{{selectItem.unit}}
+                            </div>
+                        </div>
+                        <div  class="info_table ivu-row">
+                            <div  class="ivu-col ivu-col-span-6">
+                                低错误:
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6">
+                                {{selectItem.lowct}}{{selectItem.unit}}
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6">
+                                高错误:
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6" style="text-align: right;">
+                                {{selectItem.highct}}{{selectItem.unit}}
+                            </div>
+                        </div>
+                        <div  class="info_table ivu-row">
+                            <div  class="ivu-col ivu-col-span-6">
+                                低警告:
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6">
+                                {{selectItem.lownc}}{{selectItem.unit}}
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6">
+                                高警告:
+                            </div>
+                            <div  class="ivu-col ivu-col-span-6" style="text-align: right;">
+                                {{selectItem.highnc}}{{selectItem.unit}}
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div  class="sensors-history-graph">
+                    <div  class="ivu-tabs ivu-tabs-card">
+                        <div class="ivu-tabs-bar">
+                            <!---->
+                            <div tabindex="0" class="ivu-tabs-nav-container">
+                                <div class="ivu-tabs-nav-wrap" style="position: relative;">
+							<span class="ivu-tabs-nav-prev ivu-tabs-nav-scroll-disabled">
+								<i class="ivu-icon ivu-icon-ios-arrow-back">
+								</i>
+							</span>
+                                    <span class="ivu-tabs-nav-next ivu-tabs-nav-scroll-disabled">
+								<i class="ivu-icon ivu-icon-ios-arrow-forward">
+								</i>
+							</span>
+                                    <div class="ivu-tabs-nav-scroll">
+                                        <div class="ivu-tabs-nav">
+                                            <div class="ivu-tabs-ink-bar ivu-tabs-ink-bar-animated" style="visibility: hidden; width: 90px; transform: translate3d(0px, 0px, 0px);">
+                                            </div>
+                                            <div class="ivu-tabs-tab ivu-tabs-tab-active ivu-tabs-tab-focused">
+                                                <!---->
+                                                图形视图
+                                                <!---->
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <object tabindex="-1" type="text/html" data="about:blank" style="display: block; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; border: none; padding: 0px; margin: 0px; opacity: 0; z-index: -1000; pointer-events: none;">
+                                    </object>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="ivu-tabs-content ivu-tabs-content-animated" style="transform: translateX(0%) translateZ(0px);">
+                            <div  class="ivu-tabs-tabpane" style="visibility: visible;">
+                                <div  id="myChart1" _echarts_instance_="ec_1619172800096"
+                                     style="width: 100%; min-height: 560px; margin: 0px auto; -webkit-tap-highlight-color: transparent; user-select: none; position: relative;">
+                                    <div style="position: relative; width: 1180px; height: 560px; padding: 0px; margin: 0px; border-width: 0px;">
+                                        <canvas data-zr-dom-id="zr_0" width="1180" height="560" style="position: absolute; left: 0px; top: 0px; width: 1180px; height: 560px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0px; margin: 0px; border-width: 0px;">
+                                        </canvas>
+                                    </div>
+                                    <div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <Modal title="阈值设定" v-model="setModal" >
+            <Form ref="setForm" :model="formItem" label-position="right" :label-width="120" :rules="formItemRules">
+
+                <FormItem  prop="lowGraveErr" label="低严重错误:">
+                    <Input v-model="formItem.lowGraveErr"> </Input>
+                </FormItem>
+                <FormItem  prop="lowErr" label="低错误:">
+                    <Input v-model="formItem.lowErr"> </Input>
+                </FormItem>
+                <FormItem  prop="lowWarning" label="低警告:">
+                    <Input v-model="formItem.lowWarning"> </Input>
+                </FormItem>
+                <FormItem  prop="hightGraveErr" label="高严重错误:">
+                    <Input v-model="formItem.hightGraveErr"> </Input>
+                </FormItem>
+                <FormItem  prop="hightWarning" label="高错误:">
+                    <Input v-model="formItem.hightWarning"> </Input>
+                </FormItem>
+                <FormItem  prop="hightErro" label="高警告:">
+                    <Input v-model="formItem.hightErro"> </Input>
+                </FormItem>
+
+            </Form>
+            <div slot="footer">
+                <Button @click="setModal = false" type="primary">取消</Button>
+                <Button @click="setThreshold" :loading="setting" type="primary">提交</Button>
+            </div>
+        </Modal>
+
 	</div>
 </template>
 <script>
+    import echarts from 'echarts'
+    import api from '../api/index'
 export default {
 	name: 'dashbord1',
 	data() {
 		return {
-			fanList: [
-				{ name: 'fan1', speed: 1000, model: 1, duty: 56.3 },
-				{ name: 'fan2', speed: 1000, model: 1, duty: 56.3 },
-				{ name: 'fan3', speed: 1000, model: 2, duty: 56.3 },
-				{ name: 'fan4', speed: 1000, model: 2, duty: 56.3 },
-				{ name: 'fan5', speed: 1000, model: 1, duty: 56.3 }
-			]
+            setModal: false,
+            setting: false,
+            sensorsList: [{
+                id: 1,
+                name: "fan1",
+                status: "Upper Non-Recoverable ",
+                value: "56.3 Volts"
+            }],
+            selectItem: {
+                sensorNum: 1,
+                name: "fan1",
+                status: "Upper Non-Recoverable ",
+                value: "56.3 Volts"
+            },
+            formItem: {
+                lowGraveErr: "",
+                lowErr: "",
+                lowWarning: "",
+                hightGraveErr: "",
+                hightWarning: "",
+                hightErro: ""
+            },
+            isLoading: false,
+            formItemRules:{
+                lowGraveErr: [{required:true, message:'请输入低严重错误!', trigger:'blur'}],
+                lowErr: [{required:true, message:'请输入低错误!', trigger:'blur'}],
+                lowWarning: [{required:true, message:'请输入低警告!', trigger:'blur'}],
+                hightGraveErr: [{required:true, message:'请输入高严重错误!', trigger:'blur'}],
+                hightWarning: [{required:true, message:'请输入高错误!', trigger:'blur'}],
+                hightErro: [{required:true, message:'请输入高警告!', trigger:'blur'}],
+            },
+            myChart: null,
+            myChart2: null,
+            routerSensorNum: null,
+            timer: null
+
 		}
 	},
 	created() {
-		console.log("111111111111111111")
-	},
+        this.routerSensorNum = this.$route.query.sensorNum
+        this.getSensorList()
+    },
 	methods: {
-		set(item) {
-			console.log(item)
-		}
-	}
-}
-</script>
-<style lang="scss" scoped>
-* {
-	box-sizing: border-box;
-}
-
-input {
-	margin: 0;
-}
+        ok() {
+            this.setThreshold()
+        },
+        cancel() {},
+        setThreshold() {
+            this.setting = true
+            var t = this
+            let param = {
+                SensorNumber: this.selectItem.sensorNum,
+                UNR: this.formItem.hightGraveErr,
+                UC: this.formItem.hightErro,
+                UNC: this.formItem.hightWarning,
+                LNR: this.formItem.lowGraveErr,
+                LC: this.formItem.lowErr,
+                LNC: this.formItem.lowWarning
+            }
+            api.Get("/action/setThreshold", param).then((e) => {
+                200 == e.code && (
+                    this.$Message.success("操作成功!"),
+                    this.setting = false,
+                    this.setModal = false,
+                    setTimeout(() => {
+                        this.routerSensorNum = t.selectItem.sensorNum,
+                        this.getSensorList()
+                    }, 500)
+                    )
+                200 != e.code && (this.$Message.error('操作失败'))
 
-table {
-	font-size: 12px;
-}
-
-tr {
-	height: 26px;
-}
-
-td {
-	width: 40%;
-}
-
-.dashboard_box {
-	width: 1180px;
-	margin: auto;
-	margin-top: 10px;
-	/* background: #040C19; */
-	padding: 10px 0;
-	color: #fff;
-
-	h3 {
-		color: #fff;
-		margin-bottom: 0;
-		padding-bottom: 5px;
-	}
+            })
+        },
+        checkItem(t) {
+            this.selectItem = t,
+                this.formItem = {
+                    lowGraveErr: t.lownr,
+                    lowErr: t.lowct,
+                    lowWarning: t.lownc,
+                    hightGraveErr: t.highnr,
+                    hightWarning: t.highnc,
+                    hightErro: t.highct
+                },
+                this.getPie()
+        },
+        set(t) {},
+        getSensorList() {
+            this.isLoading = true
+            var t = this;
+            api.Get("/action/getSensorInfo", {}).then((e) =>{
+                if (e.data && e.data.length > 0) if (t.routerSensorNum) {
+                    var r = e.data.filter((function(e) {
+                        return e.sensorNum == t.routerSensorNum
+                    }));
+                    t.checkItem(r[0])
+                } else t.checkItem(e.data[0]);
+                t.sensorsList = e.data
+                this.isLoading = false
+            })
+        },
+        getPie() {
+            for (var t = [], e = [0], r = 480; r >= 0; r--) if (0 == r) t.push("00:00(现在)");
+            else {
+                var n = 3 * r,
+                    a = parseInt(n / 60),
+                    o = n % 60,
+                    l = (a < 10 ? "0" + a: a) + ":" + (o < 10 ? "0" + o: o);
+                t.push("-" + l)
+            }
+            var c = {
+                    backgroundColor: "#FFFFFF",
+                    tooltip: {
+                        trigger: "axis",
+                        triggerOn: "mousemove",
+                        confine: !0
+                    },
+                    title: {
+                        left: "center",
+                        text: this.selectItem.sensorName + "(以下为过去24小时记录)"
+                    },
+                    xAxis: [{
+                        show: !0,
+                        type: "category",
+                        boundaryGap: !1,
+                        data: t,
+                        position: "bottom",
+                        axisLabel: {
+                            interval: 29,
+                            textStyle: {
+                                color: "#333"
+                            }
+                        },
+                        splitLine: {
+                            show: !0,
+                            lineStyle: {
+                                color: "#ccc"
+                            }
+                        }
+                    }],
+                    yAxis: [{
+                        type: "value",
+                        boundaryGap: ["20%", "20%"]
+                    },
+                        {
+                            type: "value",
+                            boundaryGap: [0, "100%"],
+                            axisLine: {
+                                lineStyle: {
+                                    type: "solid",
+                                    color: "#ccc",
+                                    width: 1
+                                }
+                            },
+                            axisLabel: {
+                                interval: 5,
+                                textStyle: {
+                                    color: "#000"
+                                },
+                                formatter: function(t, e) {
+                                    return ((t - openValue) / openValue).toFixed(2) + "%"
+                                }
+                            }
+                        }],
+                    series: [{
+                        name: "",
+                        type: "line",
+                        smooth: !0,
+                        symbol: "none",
+                        sampling: "average",
+                        yAxisIndex: 0,
+                        itemStyle: {
+                            color: "#cf6a32",
+                            width: 1
+                        },
+                        data: e
+                    }]
+                },
+                u = echarts.init(document.getElementById("myChart1"));
+                u.setOption(c),
+                api.Get("/action/webGetSensorHistory", {
+                    SensorNumber: this.selectItem.sensorNum
+                }).then((function(t) {
+                    for (var r = t.history.split(","), n = r.map(Number), a = 0; a < n.length; a++) e[a] = n[a];
+                    u.setOption(c)
+                }));
+                this.timer = window.setInterval((() =>{
 
-	p {
-		padding: 10px 0;
-		font-size: 12px;
-	}
-}
-
-h4 {
-	font-size: 15px;
-	width: auto;
-	margin: 3px;
-	padding: 2px;
+                    api.Get("/action/webGetSensorHistory", {
+                        SensorNumber: this.selectItem.sensorNum
+                    }).then((function(t) {
+                        for (var r = t.history.split(","), n = r.map(Number), a = 0; a < n.length; a++) e[a] = n[a];
+                        u.setOption(c)
+                    }))
+                }), 1000 * 180)
+        },
+        randomfn(t, e) {
+            var r = Math.floor(Math.random() * (t - e) + e);
+            return r
+        },
+        getData: function() {}
+    },
+    beforeDestroy() {
+        clearInterval(this.timer)
+        this.timer = null
+    }
 }
+</script>
+<style lang="scss" scoped>
+    input[type=button] {
+        border-radius:3px;
+        display:inline-block;
+        padding:4px 20px;
+        margin-bottom:0;
+        font-size:13px;
+        font-weight:400;
+        line-height:1.42857143;
+        text-align:center;
+        white-space:nowrap;
+        vertical-align:middle;
+        -ms-touch-action:manipulation;
+        touch-action:manipulation;
+        cursor:pointer;
+        -webkit-user-select:none;
+        -moz-user-select:none;
+        -ms-user-select:none;
+        user-select:none;
+        background-image:none;
+        border:1px solid transparent;
+        background:#1873ff;
+        color:#fff
+    }
+    table {
+        font-size:12px
+    }
+    tr {
+        height:26px
+    }
+    td {
+        width:40%
+    }
+    .dashboard_box {
+        width:1180px;
+        margin:auto;
+        margin-top:10px;
+        padding:10px 0;
+        color:#fff;
+        position: relative;
 
-h3 {
-	color: #fff;
-	font-size: 20px;
-	padding-bottom: 0px;
-	/*margin-top: 5px;*/
-	border-bottom: 1px solid #000;
-}
+    }
+    .dashboard_box h3 {
+        color:#fff;
+        margin-bottom:0;
+        padding-bottom:5px
+    }
+    .dashboard_box p {
+        padding:10px 0;
+        font-size:12px
+    }
+    .dashboard_box th img {
+        width:8px
+    }
+    .dashboard_box .SENSOR_HISTORY {
+        color:#156be9;
+        font-size:18px;
+        height:64px;
+        padding-top:28px;
+        padding-left:15px;
+        border-bottom:1px solid #01060e
+    }
+    .dashboard_box .sesors-list {
+        margin-top:15px;
+        display:-webkit-inline-box;
+        display:-ms-inline-flexbox;
+        display:inline-flex;
+        width:100%
+    }
+    .dashboard_box .sesors-list .left-list {
+        background:#05172f;
+        width:467px
+    }
+    .dashboard_box .sesors-list .left-list table {
+        width:100%;
+        text-align:left;
+        color:#d7d7dc
+    }
+    .dashboard_box .sesors-list .left-list table th {
+        width:33%;
+        background:transparent;
+        color:#fff;
+        font-weight:400;
+        padding:12px 15px
+    }
+    .dashboard_box .sesors-list .left-list table td {
+        padding:12px 0 12px 15px;
+        width:33%
+    }
+    .dashboard_box .sesors-list .left-list table tr {
+        height:38px
+    }
+    .dashboard_box .sesors-list .left-list .selected {
+        background-color:#0b3370!important
+    }
+    .dashboard_box .sesors-list .left-list table tr.selected td:last-child {
+        position:relative
+    }
+    .dashboard_box .sesors-list .left-list table tr.selected td:last-child img {
+        width:12px;
+        position:absolute;
+        right:5px
+    }
+    .dashboard_box .sesors-list .left-list table tr.normal td:last-child {
+        background:none
+    }
+    .dashboard_box .sesors-list .left-list tbody tr:nth-child(2n) {
+        background:#051c3c
+    }
+    .dashboard_box .sesors-list .right-info {
+        width:100%;
+        padding:20px;
+        background:#0b3370;
+        color:#f6f8fe
+    }
+    .dashboard_box .sesors-list .right-info .right-info-title {
+        border-bottom:1px solid #0e4496;
+        padding-bottom:20px
+    }
+    .dashboard_box .sesors-list .right-info .sensor_orange {
+        color:#ea9517;
+        font-weight:400
+    }
+    .dashboard_box .sesors-list .right-info .toggleWidget {
+        color:#ea9517;
+        text-decoration:none
+    }
+    .dashboard_box .sesors-list .right-info .widgetStatus {
+        color:#fff;
+        padding-left:5px
+    }
+    .dashboard_box .sesors-list .right-info .sensor_gray {
+        color:#fff
+    }
+    .dashboard_box .sesors-list .right-info .info_table {
+        font-size:12px;
+        padding:10px 0
+    }
+    .dashboard_box .sensors-history-graph {
+        padding-top:20px
+    }
+    .dashboard_box .sensors-history-graph .title-menu {
+        padding:10px;
+        display:-webkit-box;
+        display:-ms-flexbox;
+        display:flex;
+        display:-webkit-flex;
+        -webkit-box-pack:center;
+        -ms-flex-pack:center;
+        justify-content:center;
+        color:#77adff
+    }
+    .dashboard_box .sensors-history-graph .title-menu .active {
+        color:#77adff;
+        font-size:14px;
+        font-weight:400;
+        text-decoration:none;
+        color:#fff
+    }
+    .dashboard_box .sensors-history-graph .title-menu{
+        border-right:1px solid #f6f8fe
+    }
+    h4 {
+        font-size:15px;
+        width:auto;
+        margin:3px;
+        padding:2px
+    }
+    h3 {
+        color:#fff;
+        font-size:20px;
+        padding-bottom:0;
+        border-bottom:1px solid #000
+    }
+    select{
+        border-radius:3px;
+        height:34px;
+        padding:0 10px;
+        background:#fff;
+        border:1px solid #1874ff;
+        color:#003c97;
+        -webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);
+        box-shadow:inset 0 1px 1px rgba(0,0,0,.075);
+        -webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;
+        transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;
+        transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;
+        transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out
+    }
 
-select {
-	border-radius: 3px;
-	height: 34px;
-	padding: 0 10px;
-	background: #fff;
-	border: 1px solid #1874FF;
-	color: #003C97;
-	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-	box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-	-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-	-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-	transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
 </style>

+ 285 - 126
src/views/dashbord.vue

@@ -10,16 +10,15 @@
 				<Row>
 					<Col span="24">
 					<div class="dashboard_chat">
-						<div class='dashboard_item_title' style='padding-left: 20px;'>
-							<span>使能机箱管理</span>
-							<i-switch class='switch' v-model="serMode" @on-change="change" />
+						<div class='dashboard_item_title' style='padding-left: 20px;margin-bottom: 10px'>
+							<Strong>使能机箱管理</Strong>
+<!--							<i-switch class='switch' v-model="serMode" @on-change="change" />-->
 						</div>
 						<div class='model-contect'>
 							<ul>
-								<template v-for='item in serverList'>
-									<li :class="item.cardIndex == activeIndex ? 'active' : 'off'">
+								<template v-for='(item, index) in serverList'>
+									<li :class="item.cardIndex == chassisInfo.curIndex ? 'active' : 'off'" @click="checkIndex(index)">
 										<img class="svg checked-card" id="svg1" src="../assets/checked-card.png">
-										<span class="tab_span">BMC1</span>
 										<template v-if='item.status == 0'>
 											<span class="active_span off_span">Status</span>
 										</template>
@@ -29,6 +28,10 @@
 										<template v-else>
 											<span class="active_span error_span">Status</span>
 										</template>
+                                        <div  class="tab_span">
+                                            <p :class="['p-top', item.status == 1 ? 'active-p' : '']"> {{item.name}} </p>
+                                            <p :class="['p-bottom', item.status == 1 ? 'active-p' : '']"> {{item.slot}}h </p>
+                                        </div>
 										<span :class="['power_span', item.power == 0 ? 'power_off_span' : '']">Power</span>
 									</li>
 								</template>
@@ -37,99 +40,77 @@
 					</div>
 					</Col>
 					<Col span="24">
-					<div class="dashboard_item">
-						<div class="dashboard_item_title">
-							设备信息
-						</div>
-						<div class='info_detail'>
-							<Row class='margin_btm'>
-								<Col span="8">固件版本:</Col>
-								<Col span="14">3.20.3.3</Col>
-							</Row>
-							<Row class='margin_btm'>
-								<Col span="8">固件编译时间:</Col>
-								<Col span="14">Jul 19 2019 13:49:00 CST</Col>
-							</Row>
-						</div>
-					</div>
-					</Col>
-					<Col span="24">
-					<div class="dashboard_item">
-						<div class="dashboard_item_title">
-							息网络信
-						</div>
-						<div class='info_detail'>
-							<Row class='margin_btm'>
-								<Col span="8">MAC地址:</Col>
-								<Col span="14">02:04:06:08:0A:8E</Col>
-							</Row>
-							<Row class='margin_btm'>
-								<Col span="8">V4网络模式:</Col>
-								<Col span="14">Static</Col>
-							</Row>
-							<Row class='margin_btm'>
-								<Col span="8">IPv4地址:</Col>
-								<Col span="14">192.168.0.203</Col>
-							</Row>
-							<Row class='margin_btm'>
-								<Col span="8">V6网络模式:</Col>
-								<Col span="14">Disable</Col>
-							</Row>
-						</div>
-					</div>
+                        <div class="dashboard_item">
+                            <div class="dashboard_item_title">
+                                BMC设备信息
+                            </div>
+                            <div class='info_detail'>
+                                <Row class='margin_btm'>
+                                    <Col span="8">固件版本:</Col>
+                                    <Col span="14">{{deviceInfo.fwVersion}}</Col>
+                                </Row>
+                                <Row class='margin_btm'>
+                                    <Col span="8">固件编译时间:</Col>
+                                    <Col span="14">{{deviceInfo.buildTime}}</Col>
+                                </Row>
+                                <Row class='margin_btm'>
+                                    <Col span="8">MAC地址:</Col>
+                                    <Col span="14">{{deviceInfo.macAddr}}</Col>
+                                </Row>
+                                <Row class='margin_btm'>
+                                    <Col span="8">V4网络模式:</Col>
+                                    <Col span="14">{{deviceInfo.netMode}}</Col>
+                                </Row>
+                                <Row class='margin_btm'>
+                                    <Col span="8">IPv4地址:</Col>
+                                    <Col span="14">{{deviceInfo.ipAddr}}</Col>
+                                </Row>
+
+                            </div>
+                        </div>
 					</Col>
+
 				</Row>
 			</div>
 			<div class="sub_center">
 				<Row>
 					<Col span="24">
-					<div class="dashboard_SensorBox" style='margin-top:0px;'>
-						<div class="dashboard_item_title">
-							传感器状态
-						</div>
-						<div class='info_detail2'>
-							<Row class='margin_btm' type="flex" justify="center">
-								<Col span="4"><strong>状态</strong></Col>
-								<Col span="8"><strong>Sensor</strong></Col>
-								<Col span="8"><strong>Reading</strong></Col>
-								<Col span="4"><strong></strong></Col>
-							</Row>
-							<Row class='line-class on' type="flex" justify="center">
-								<Col span="4">
-								<img src="../assets/status_critical.png" title="Critical" style="width: 12px" border="0">
-								</Col>
-								<Col span="8">VCC12</Col>
-								<Col span="8">22.36 Volts</Col>
-								<Col span="4"><a href="sensor_readings.html?id=0"><img src="../assets/view.png" border="0" style="width: 12px" class="my_view"></a></Col>
-							</Row>
-							<Row class='line-class off' type="flex" justify="center">
-								<Col span="4">
-								<img src="../assets/status_critical.png" title="Critical" style="width: 12px" border="0">
-								</Col>
-								<Col span="8">VCC12</Col>
-								<Col span="8">22.36 Volts</Col>
-								<Col span="4"><a href="sensor_readings.html?id=0"><img src="../assets/view.png" border="0" style="width: 12px" class="my_view"></a></Col>
-							</Row>
-							<!-- <Row class='margin_btm'><Col span="8">固件编译时间:</Col><Col span="14">Jul 19 2019 13:49:00 CST</Col></Row> -->
-						</div>
-					</div>
-					</Col>
-					<Col span="24">
-					<div class="dashboard_SensorBox">
-						<div class="dashboard_item_title">
-							KVM
-						</div>
-						<!-- <div class='info_detail'>
-                    			<Row class='margin_btm'><Col span="8">固件版本:</Col><Col span="14">3.20.3.3</Col></Row>
-                    			<Row class='margin_btm'><Col span="8">固件编译时间:</Col><Col span="14">Jul 19 2019 13:49:00 CST</Col></Row>
-                    		</div> -->
-					</div>
+                        <div class="dashboard_SensorBox" style='margin-top:0px;'>
+                            <div class="dashboard_item_title">
+                                传感器状态
+                            </div>
+                            <div class='info_detail2'>
+                                <Row class='margin_btm' type="flex" justify="center">
+                                    <Col span="4"><strong>状态</strong></Col>
+                                    <Col span="8"><strong>传感器</strong></Col>
+                                    <Col span="8"><strong>读值</strong></Col>
+                                    <Col span="4"><strong>详情</strong></Col>
+                                </Row>
+                                <Row class='line-class on' v-for="item in sensorsList" type="flex" justify="center">
+                                    <Col span="4">
+                                        <img :src="getImg(item.status)" title="OK" style="width: 12px" border="0">
+<!--                                        <img :src="item.state=='ok' ? okImg : errorImg" title="error" style="width: 12px" border="0">-->
+<!--                                        <img :src="item.state=='ok' ? okImg : errorImg" title="worring" style="width: 12px" border="0">-->
+                                    </Col>
+                                    <Col span="8">{{item.sensorName}}</Col>
+                                    <Col span="8">{{item.reading}} {{item.unit}}</Col>
+                                    <Col span="4">
+                                            <router-link :to="'index/sensor_history?sensorNum=' + item.sensorNum">
+                                                <img src="../assets/view.png" border="0" style="width: 12px" class="my_view">
+                                            </router-link>
+                                    </Col>
+                                </Row>
+
+                                <!-- <Row class='margin_btm'><Col span="8">固件编译时间:</Col><Col span="14">Jul 19 2019 13:49:00 CST</Col></Row> -->
+                            </div>
+                        </div>
 					</Col>
+
 				</Row>
 			</div>
 			<div class="sub_right">
 				<Row>
-					<Col span="24">
+					<!--<Col span="24">
 					<div class="dashboard_SensorBox" style='margin-top:0px;padding:0;'>
 						<div class="dashboard_item_title" style='padding: 25px 20px;'>
 							日志
@@ -138,31 +119,20 @@
 							<div id="myChart" style="width: 250px; min-height:400px;"></div>
 						</div>
 					</div>
-					</Col>
+					</Col>-->
 					<Col span="24">
-					<div class="dashboard_SensorBox">
-						<div class="dashboard_item_title">
-							CPU 信息
-						</div>
-						<div class='info_detail'>
-							<Row class='margin_btm'>
-								<Col span="8">系统:</Col>
-								<Col span="16">Neokylin</Col>
-							</Row>
-							<Row class='margin_btm'>
-								<Col span="8">版本:</Col>
-								<Col span="16">dev 4.0</Col>
-							</Row>
-							<Row class='margin_btm'>
-								<Col span="8">系统:</Col>
-								<Col span="16">20%</Col>
-							</Row>
-							<Row class='margin_btm'>
-								<Col span="8">版本:</Col>
-								<Col span="16">49%</Col>
-							</Row>
-						</div>
-					</div>
+                        <div class="dashboard_SensorBox">
+                            <div class="dashboard_item_title">
+                                {{sysInfo.title}}
+                            </div>
+                            <div class='info_detail'>
+                                <Row class='margin_btm' v-for="(item, index) in sysInfo.testArry" :key="index">
+                                    <Col span="8">{{item.name}}:</Col>
+                                    <Col span="16">{{item.value}}</Col>
+                                </Row>
+
+                            </div>
+                        </div>
 					</Col>
 				</Row>
 			</div>
@@ -171,11 +141,16 @@
 </template>
 <script>
 	import echarts from 'echarts'
+	import api from '../api/index'
 export default {
 	name: 'dashbord1',
-	data() {
+	data () {
 		return {
-			serverList: [{
+		    okImg: require('../assets/status_ok.png'),
+            errorImg: require('../assets/status_critical.png'),
+            statusWarning: require('../assets/status_warning.png'),
+			serverList: [
+			    {
 					cardIndex: 1,
 					senserName: 'aa',
 					status: 1,
@@ -203,21 +178,181 @@ export default {
 					isMainCard: false,
 				},
 			],
-			activeIndex: 1,
-			serMode: false,
+            activeIndex: 1,
+            serMode: !1,
+            deviceInfo: {},
+            sysInfo: {},
+            chassisInfo: {},
+            bladeInfo: {},
+            sensorsList: []
 		}
 	},
-	created() {
-		console.log("3333333333333")
-	},
-	mounted(){
-		this.getPie()
-	},
+    created() {},
+    mounted()  {
+        this.init();
+    },
 	methods: {
+        getImg(status){
+            if(status == 1) {
+                return this.okImg
+            } else if(status == 3) {
+                return this.errorImg
+            } else {
+                return this.statusWarning
+            }
+
+        },
+	    async init(){
+            this.getDeviceInfo()
+            this.getSysInfo()
+            await this.getChassisInfo()
+            this.getAllBladeInfo()
+            this.getAllSensorInfo()
+        },
+
+        getDeviceInfo() {
+            var t = this;
+            api.Get("/action/getDeviceInfo", {index: 3}).then((e)=>{
+                200 == e.code && (t.deviceInfo = e.data)
+            })
+        },
+        checkIndex(index){
+            sessionStorage.setItem('currentIndex', index)
+            this.init();
+        },
+        getSysInfo() {
+            let a = []
+            api.Get("/action/getSysInfo", {}).then(res => {
+                if ( 200 == res.code) {
+                    this.sysInfo = res.data;
+                    var s = res.data.text;
+                    for (var n = s.split(";"), a = [], i = 0; i < n.length; i++) {
+                        var o = n[i].split(":");
+                        a.push({
+                            name: o[0],
+                            value: o[1]
+                        })
+                    }
+                    this.sysInfo.testArry = a
+                }
+            })
+        },
+        async getChassisInfo() {
+            var e = this;
+           await api.Get("/action/getChassisInfo", {}).then((function(s) {
+                200 == s.code && (e.chassisInfo = s.data)
+            }))
+
+        },
+        getAllBladeInfo: function() {
+            var t = this;
+            api.Get("/action/getAllBladeInfo", {}).then(res => {
+                if(200 == res.code){
+                    t.serverList = res.data
+                } else {
+                    this.$Message.error(res.msg)
+                }
+
+            })
+        },
+        getAllSensorInfo: function() {
+            var t = this;
+            api.Get("/action/getSensorInfo", {}).then((function(e) {
+                e.data && (t.sensorsList = e.data)
+            })).
+            catch((function(t) {
+                console.log(t),
+                    console.log(t.isSuccess)
+            }))
+        },
+        setBladeManage: function() {
+            var t = this;
+            r["a"].Get("/action/setBladeManage", {
+                enable: 1
+            }).then((function(e) {
+                console.log(e),
+                200 == e.code && (t.serverList = e.data)
+            })).
+            catch((function(t) {
+                console.log(t),
+                    console.log(t.isSuccess)
+            }))
+        },
+        getBladeManage: function() {},
+        change: function() {},
+
+        getPie: function() {
+            var t = o.a.init(document.getElementById("myChart"));
+            t.setOption({
+                series: [{
+                    name: "访问来源",
+                    type: "pie",
+                    radius: "55%",
+                    center: ["50%", "20%"],
+                    hoverAnimation: !0,
+                    itemStyle: {
+                        normal: {
+                            label: {
+                                show: !1
+                            },
+                            labelLine: {
+                                show: !1
+                            }
+                        }
+                    },
+                    data: [{
+                        name: "a",
+                        value: Math.round(1e5 * Math.random())
+                    },
+                        {
+                            name: "b",
+                            value: Math.round(1e5 * Math.random())
+                        },
+                        {
+                            name: "c",
+                            value: Math.round(1e5 * Math.random())
+                        },
+                        {
+                            name: "d",
+                            value: Math.round(1e5 * Math.random())
+                        },
+                        {
+                            name: "e",
+                            value: Math.round(1e5 * Math.random())
+                        },
+                        {
+                            name: "f",
+                            value: Math.round(1e5 * Math.random())
+                        },
+                        {
+                            name: "g",
+                            value: Math.round(1e5 * Math.random())
+                        },
+                        {
+                            name: "h",
+                            value: Math.round(1e5 * Math.random())
+                        },
+                        {
+                            name: "i",
+                            value: Math.round(1e5 * Math.random())
+                        }]
+                }],
+                tooltip: {
+                    formatter: "{b} : {c}"
+                },
+                legend: {
+                    orient: "vertical",
+                    top: 200,
+                    left: 20,
+                    data: ["a", "b", "c", "d", "e", "f", "g", "h", "i"]
+                }
+            })
+        },
+
 		change() {
 
 		},
-		getPie() {
+		getPie2() {
 			// 基于准备好的dom,初始化echarts实例
 			let myChart = echarts.init(document.getElementById('myChart'));
 			// 绘制图表,this.echarts1_option是数据
@@ -360,7 +495,12 @@ export default {
 		padding-top: 25px;
 		padding-right: 20px;
 
-		span {}
+		span {
+
+        }
+        strong{
+            font-size: 18px;
+        }
 
 		.switch {
 			/*padding-left: 20px;*/
@@ -437,6 +577,26 @@ export default {
 					text-overflow: ellipsis;
 					white-space: nowrap;
 					font-weight: bold;
+
+                    .p-top {
+                        height:16px;
+                        line-height:16px;
+                        font-size:14px;
+                        margin-top:5px;
+                        &.active-p {
+                            color:#29c093
+                        }
+
+                    }
+                    .p-bottom{
+                        height:12px;
+                        line-height:12px;
+                        font-size:12px;
+                        margin-top:5px;
+                        &.active-p {
+                            color:#29c093
+                        }
+                    }
 				}
 
 				.active_span {
@@ -572,9 +732,8 @@ export default {
 		padding: 25px 20px;
 		width: 100%;
 		border-radius: 3px;
-		margin-top: 20px;
+		/*margin-top: 20px;*/
 
-		/*margin-top:0;*/
 		.dashboard_item_title {
 			padding-top: 0;
 		}

+ 52 - 40
src/views/index.vue

@@ -1,50 +1,62 @@
 <template>
-  <div class="index">
-      <Header></Header>
-      <div class='dashbord-contanier'>
-          <Menu></Menu>
-          <div style="width:1180px;overflow:hidden">
-            <div class="content">
-                <router-view></router-view>
+    <div class="index">
+        <Header @reload="reload"></Header>
+        <div class='dashbord-contanier'>
+            <Menu></Menu>
+            <div style="width:1180px;overflow:hidden">
+                <div class="content">
+                    <router-view v-if="refreshNowPage===false"></router-view>
+                </div>
             </div>
-          </div>
-      </div>
-  </div>
+        </div>
+    </div>
 </template>
 
 <script>
-  import Header from '@/components/header'
-  import Menu from '@/components/menu'
-export default {
-  name: 'index',
-  components:{Header, Menu},
-  props: {
-    msg: String
-  },
-  created(){
-     console.log(">>>>>>>>>>>>>>>>>")
-  }
-}
+    import Header from '@/components/header'
+    import Menu from '@/components/menu'
+
+    export default {
+        name: 'index',
+        components: {Header, Menu},
+        data() {
+            return {
+                refreshNowPage: false,
+            }
+        },
+        created() {
+        },
+        methods: {
+            reload() { //监听路由是否变化
+                this.refreshNowPage = true
+                setTimeout(() => {
+                    this.refreshNowPage = false
+                }, 10)
+
+            }
+        }
+    }
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style lang="scss" scoped>
-.index{
-  
-}
-.dashbord-contanier{
-  
-  margin: 10 auto;
-
-}
-.content{
-  width: 1200px;
-  margin: 10px auto;
-  height: 800px;
-  overflow-y: scroll;
-  overflow-x: hidden;
-}
-.content::-webkit-scrollbar {
-    /*display: none;*/
-}
+    .index {
+
+    }
+
+    .dashbord-contanier {
+        /*margin: 10px auto;*/
+    }
+
+    .content {
+        width: 1200px;
+        margin: 10px auto;
+        min-height: 800px;
+        /*overflow-y: scroll;*/
+        /*overflow-x: hidden;*/
+    }
+
+    .content::-webkit-scrollbar {
+        /*display: none;*/
+    }
 </style>

+ 23 - 29
src/views/login.vue

@@ -4,37 +4,24 @@
       <div class='login-context'>
            <Form ref="formInline" class='formLogin' :model="formInline" :rules="ruleInline" :label-width="80">
 
-              <FormItem prop="userName" label="账号:" style='color:#fff'>
-                  <Input type="text" v-model="formInline.userName" placeholder="用户名">  </Input>
+              <FormItem prop="username" label="账号:" style='color:#fff'>
+                  <Input type="text" v-model="formInline.username"   placeholder="用户名">  </Input>
               </FormItem>
 
               <FormItem prop="password" label="密 码:">
-                  <Input type="password" v-model="formInline.password" placeholder="密码">
+                  <Input type="password" v-model="formInline.password"  @keyup.enter.native="handleSubmit('formInline')" placeholder="密码">
                   </Input>
               </FormItem>
 
               <FormItem style='text-align: left;margin-left:0;width: 100%'>
                   <Button type="primary" style='width:100%;' @click="handleSubmit('formInline')">登录</Button>
               </FormItem>
-              <FormItem style='text-align: center;'>
-                  <a href="#" style='color:#EB980E'>忘记密码?</a>
-              </FormItem>
+<!--              <FormItem style='text-align: center;'>-->
+<!--                  <a href="#" style='color:#EB980E'>忘记密码?</a>-->
+<!--              </FormItem>-->
                <FormItem style='text-align: left;'>
-              <div class='tips-attion'> 
-                <h3>所需的浏览器设置</h3>
-                <ul>  
-                  <li>1、允许来自此网站的弹出窗口 <span id="enablePopupBlock"><img v-if='enableScript' src="../assets/ok.png" alt="">
-                                              <img v-else src="../assets/crit.png" alt=""></span></li>
-                  <li>2、允许从此网站下载文件.  <span id="popupBlock">(help<img src="../assets/helpicon.png" alt=""></span>)</li>
-                  <li>3、为此网站启用javascript <span id="popupBlock"><img v-if='enableScript' src="../assets/ok.png" alt="">
-                                              <img v-else src="../assets/crit.png" alt=""></span></li>
-                  <li>4、为此网站启用Cookie <span id="enableCookie"><img v-if='enableScript' src="../assets/ok.png" alt="">
-                                              <img v-else src="../assets/crit.png" alt=""></span></li>
-                  
-                </ul>
-                  <strong>建议不要使用浏览器的刷新、后退和前进选项。</strong>
-              </div>
-            </FormItem>
+
+                </FormItem>
               
           </Form>
       </div>
@@ -43,6 +30,7 @@
 
 <script>
   import Header from '@/components/header'
+  import api from '../api'
 export default {
   name: 'index',
   data(){
@@ -51,11 +39,11 @@ export default {
         enablePopupBlock: true, //是否启用弹窗
         enableCookie:navigator.cookieEnabled, //是否启用cookie
        formInline: {
-            userName: '',
-            password: '',
+           username: 'admin',
+            password: 'admin',
         },
         ruleInline: {
-            userName: [
+            username: [
                 { required: true, message: '请输入用户名', trigger: 'blur' }
             ],
             password: [
@@ -72,13 +60,19 @@ export default {
 
   },
   methods: {
-      handleSubmit (name) {
-          this.$refs[name].validate((valid) => {
+       handleSubmit (name) {
+           console.log(name)
+          this.$refs[name].validate(async(valid) => {
               if (valid) {
-                  this.$Message.success('登录成功!');
-                  this.$router.push("/index")
+                  let res = await api.Get('/action/login', this.formInline)
+                  if(res.code == 200) {
+                      this.$Message.success('登录成功!');
+                      this.$router.push({path: this.$route.query.redirect || '/index'}).catch((e) => {console.log(e)});
+                  } else {
+                      this.$Message.error('账号或密码错误!');
+                  }
               } else {
-                  this.$Message.error('Fail!');
+                  this.$Message.error('请输入账号密码');
               }
 
           })

ファイルの差分が大きいため隠しています
+ 175 - 193
src/views/setting.vue


+ 11 - 3
vue.config.js

@@ -1,13 +1,17 @@
+var path = require('path')
+function resolve (dir) {
+   return  path.join(__dirname, dir)
+}
 module.exports = {
     // 输出文件目录
-    outputDir: '../../linuxproject/src/web/',
+    outputDir: '../../bmclinxupro/app/goahead-3.6.5/src/web',
 
     devServer: {
         host: '127.0.0.1',
         port: 9999,
         proxy: {
             '/action': {
-                target: 'http://192.168.1.149/',
+                target: 'http://192.168.1.121/',
                 ws: true,
                 changeOrigin: true,
             },
@@ -18,7 +22,11 @@ module.exports = {
     productionSourceMap: false,
     assetsDir:'static',
 
-    chainWebpack: config => {
+    chainWebpack: (config) => {
+        config.resolve.alias
+            .set('@', resolve('src'))
+            .set('assets', resolve('src/assets'))
+            .set('components', resolve('src/components'))
         if (process.env.NODE_ENV === 'production') {
             // 清除css,js版本号
             config.output.filename('static/js/[name].js').end();

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません