lusa 3 年 前
コミット
dcd4eae758

+ 6 - 1
src/App.vue

@@ -11,5 +11,10 @@
 </script>
 
 <style>
-
+    .ivu-input-number-controls-outside-btn i{
+        font-size: 17px !important;
+    }
+    .ivu-input-number-controls-outside-btn i{
+        font-size: 17px!important;
+    }
 </style>

+ 1 - 1
src/router/index.js

@@ -99,7 +99,7 @@ const router = new Router({
 
 router.beforeEach(async (to, from, next) => {
 
-
+    //
     let title = to.name ? to.name : '领存BMC'
     console.log("/login" == to.path)
     if("/login" == to.path) {

+ 4 - 0
src/views/EventLogs.vue

@@ -435,6 +435,10 @@ export default {
             this.spinShow = true
         	api.Get("/action/GetAllSELEntriesSorted", {}).then((res)=>{
                 // this.data = res.data
+                if(res.data){
+                    res.data.reverse();
+                }
+
                 this.filterByData(res.data)
                 this.spinShow = false
 			

+ 17 - 1
src/views/FRUInfo.vue

@@ -30,7 +30,7 @@
                         <p>板卡名称:{{bdata.Name}}</p>
                         <p>板卡序列号:{{bdata.PN}}</p>
                         <p>板卡料号:{{bdata.SN}}</p>
-                        <p>其它信息:{{bdata.OEM}}</p>
+                        <p>其它信息:{{bdata.OEM || 'N/A'}}</p>
                     </Card>
                 </Col>
                 <Col :span="8">
@@ -75,10 +75,24 @@ export default {
         this.getFruInfo()
 	},
 	methods:{
+	    dealData(obj){
+            var reg = /^\s*$/;
+	        if(typeof(obj) === 'object'){
+                var keys= Object.keys(obj);
+                keys.forEach(item =>{
+                    if(!!!obj[item] || reg.test(obj[item])) {
+                        obj[item] = 'N/A'
+                    }
+                })
+                return obj
+            }
+
+        },
         getFruInfo:function() {
             let t = this;
             api.Get("/action/getFruChassisInfo", {
             }).then((function(a) {
+                t.dealData(a.data)
                     t.data = a.data
                     t.loadData = false
                 }
@@ -90,6 +104,7 @@ export default {
             ))
 
             api.Get("/action/getFruBoardInfo", {}).then((function(a) {
+                    t.dealData(a.data)
                     t.bdata = a.data
                     t.loadpdata = false
 
@@ -100,6 +115,7 @@ export default {
             ))
             api.Get("/action/getFruProductInfo", {
             }).then((function(a) {
+                    t.dealData(a.data)
                     t.pdata = a.data
                     t.loadbdata = false
                 }

+ 19 - 17
src/views/RemotPwrCtrl.vue

@@ -12,30 +12,32 @@
         v-model="vertical"
         vertical
       >
-        <p>当前状态:{{ data.powerStatus == 'on' ? '开机' :'关机' }}</p>
-        <Radio label="reset">
+        <p>当前状态:<i style="font-size: 18px;font-weight: 700">{{ data.powerStatus == 'on' ? '开机' :'关机' }}</i></p>
+          <Radio
+                  label="on"
+                  :disabled="data.powerStatus == 'on'"
+          >
+              <span class="ivu-radio-color">开启电源</span>
+          </Radio>
+          <Radio
+                  label="off"
+                  :disabled="data.powerStatus == 'off'"
+          >
+              <span class="ivu-radio-color">关闭电源(立即)</span>
+          </Radio>
+          <Radio label="reset" :disabled="data.powerStatus == 'off'">
           <span class="ivu-radio-color">复位</span>
-        </Radio>
-        <Radio
-          label="off"
-          :disabled="data.powerStatus == 'off'"
-        >
-          <span class="ivu-radio-color">关闭电源(立即)</span>
-        </Radio>
+            </Radio>
+
         <Radio
           label="soft"
           :disabled="data.powerStatus == 'off'"
         >
           <span class="ivu-radio-color">关闭电源(顺序掉电)</span>
         </Radio>
-        <Radio
-          label="on"
-          :disabled="data.powerStatus == 'on'"
-        >
-          <span class="ivu-radio-color">开启电源</span>
-        </Radio>
-        <Radio label="cycle">
-          <span class="ivu-radio-color">电源循环</span>
+
+        <Radio label="cycle" :disabled="data.powerStatus == 'off'">
+          <span class="ivu-radio-color">电源循环(先关机再开机)</span>
         </Radio>
       </RadioGroup>
 		    

+ 6 - 1
src/views/SensorHistory.vue

@@ -396,7 +396,7 @@ export default {
                         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)
+                }), 1000 * 3)
         },
         randomfn(t, e) {
             var r = Math.floor(Math.random() * (t - e) + e);
@@ -407,6 +407,11 @@ export default {
     beforeDestroy() {
         clearInterval(this.timer)
         this.timer = null
+    },
+    beforeRouteLeave(to, from, next){
+        clearInterval(this.timer)
+        this.timer = null
+	    next()
     }
 }
 </script>

+ 24 - 9
src/views/UploadProgre.vue

@@ -446,15 +446,30 @@
                 }
                 // this.uploadModel=false
             },
-            beforeUpload(file) {
-                console.log(file)
-                this.fileData = {
-                    fileName: file.name,
-                    fileSize: file.size,
-                    uploadPer: 0
-                }
-                this.uploadModel = true
-                return this.prepareDevice()
+            async beforeUpload(file) {
+               return new Promise( (resolve, reject) =>{
+                   this.$Modal.confirm({
+                       title:'更新提示',
+                       content:`<p>固件名称:${file.name}</p><p>固件大小:${file.size}个字节</p><p>是否确定更新?</p>`,
+                       onCancel:()=>{
+                           reject()
+                       },
+                       onOk:async ()=>{
+                           console.log(file)
+                           this.fileData = {
+                               fileName: file.name,
+                               fileSize: file.size,
+                               uploadPer: 0
+                           }
+                           this.uploadModel = true
+                           resolve(this.prepareDevice())
+                       },
+
+                   })
+                });
+
+
+
             },
             upErrorFn(error) {
                 this.upError = true

+ 1 - 1
src/views/dashbord.vue

@@ -69,7 +69,7 @@
                                     <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">
+                                            <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>

+ 2 - 2
src/views/fan.vue

@@ -22,10 +22,10 @@
 	                </td>
 	                <td>
 <!--	                    <input type="text" v-model='item.level' >-->
-                        <InputNumber :max="100" :min="0" :step="5"  v-model="item.level" controls-outside></InputNumber>
+                        <InputNumber :max="100" :min="0" :step="5"  :disabled="!item.mode" v-model="item.level" controls-outside></InputNumber>
 	                </td>
 	                <td>
-	                   <Button type="primary" @click='set(item)'>设置</Button>
+	                   <Button type="primary"  @click='set(item)'>设置</Button>
 	                </td>
             	</tr>
         

+ 15 - 11
src/views/setting.vue

@@ -113,10 +113,11 @@
                     </div>
                 </Col>
                 <Col span="6">
-<!--                    <div class="col-sub" @click="getRunTime">-->
-                    <div class="col-sub" style="cursor: not-allowed;">
+                    <div class="col-sub" @click="getRunTime">
+<!--                    <div class="col-sub" style="cursor: not-allowed;">-->
                         <Icon
                                 type="ios-alarm"
+                                color="#1874ff"
                                 size="36"
                         />
                         <span>运行时间</span>
@@ -200,7 +201,7 @@
             </Form>
             <div slot="footer">
                 <Button type="primary" v-show="starting" :loading="stoping" @click="stop">停止识别</Button>
-                <Button type="primary"  :loading="starting" @click="start">{{defaultTitle}}开始识别</Button>
+                <Button type="primary"  :loading="starting" @click="start">{{defaultTitle}}</Button>
             </div>
         </Modal>
 
@@ -225,10 +226,10 @@
 
 
             </Form>
-            <div slot="footer">
+           <!-- <div slot="footer">
                 <Button type="primary" v-show="starting" :loading="stoping" @click="stop">停止识别</Button>
                 <Button type="primary"  :loading="starting" @click="start">{{defaultTitle}}开始识别</Button>
-            </div>
+            </div>-->
         </Modal>
     </div>
 </template>
@@ -244,7 +245,7 @@
         data() {
             return {
                 timeModal:false,
-                defaultTitle:'',
+                defaultTitle:'开始识别',
                 sTime:['15', '30', '60', '120', '永远'],
                 distinguishTime: "0",
                 reloadModal: false,
@@ -451,18 +452,21 @@
             start(){
                 this.starting = true
                 let num = this.sTime[this.distinguishTime]
-                api.Get("/action/web_SetModIdentifyOn", {}).then((res) => {
+                api.Get("/action/web_SetModIdentifyOn", {timeSelect: this.distinguishTime}).then((res) => {
                     if (res.code == 200) {
                         if(this.distinguishTime != 4){
                             this.timer = window.setInterval((() =>{
                                 num -- ;
                                 if(num >= 0) {
-                                    this.defaultTitle = num
+                                    this.defaultTitle = '识别时间剩余:' + num
                                 } else {
+                                    this.defaultTitle = '开始识别'
                                     this.starting = false
                                     this.clearTimer();
                                 }
                             }), 1000 )
+                        } else {
+                            this.defaultTitle = '正在识别'
                         }
 
                     }
@@ -479,7 +483,7 @@
                     if (res.code == 200) {
 
                     }
-                    this.defaultTitle = ''
+                    this.defaultTitle = '开始识别'
                     this.clearTimer();
                     this.stoping = false
                     this.starting = false
@@ -545,9 +549,9 @@
                 }
                 api.Get("/action/SetTime", param).then((res) => {
                     if (res.code == 200) {
-
+                        this.$Message.success("操作成功。")
                     }
-                    this.getSysTime()
+                    // this.getSysTime()
                     console.log(res)
                 }).catch((err) => {
                     console.log(err)