From 1d384bf2b8a1884e2be1272dd2e64560d1f9266c Mon Sep 17 00:00:00 2001 From: whychdw <49690745@qq.com> Date: 星期五, 26 七月 2019 15:40:03 +0800 Subject: [PATCH] 添加故障诊断 --- src/components/MainMenu.vue | 2 src/views/testing/index.vue | 13 ++++ src/libs/common.css | 7 ++ src/router.js | 16 +++++ src/views/testing/fault.vue | 128 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+), 1 deletions(-) diff --git a/src/components/MainMenu.vue b/src/components/MainMenu.vue index 7269b75..ccd589a 100644 --- a/src/components/MainMenu.vue +++ b/src/components/MainMenu.vue @@ -98,7 +98,7 @@ childrens: [ { txt: '鏁呴殰璇婃柇', - url: '#', + url: '/testing/fault', active: false }, { diff --git a/src/libs/common.css b/src/libs/common.css index 74623ce..6f9886c 100644 --- a/src/libs/common.css +++ b/src/libs/common.css @@ -53,6 +53,13 @@ .bg-error { background-color: #ed4014; } +/* text-color */ +.text-warning { + color: #ff9900; +} +.text-error { + color: #ed4014; +} /* margin */ .mrt8 { margin-top: 8px; diff --git a/src/router.js b/src/router.js index 4bac888..43c1123 100644 --- a/src/router.js +++ b/src/router.js @@ -58,6 +58,22 @@ component: (resolve) => require(['./views/monitor/info-display.vue'], resolve) } ] + }, + { + path: '/testing', + meta: { + title: '', + }, + component: (resolve) => require(['./views/testing/index.vue'], resolve), + children: [ + { + path: 'fault', + meta: { + title: '鏁呴殰璇婃柇' + }, + component: (resolve) => require(['./views/testing/fault.vue'], resolve) + }, + ] } ]; export default routers; \ No newline at end of file diff --git a/src/views/testing/fault.vue b/src/views/testing/fault.vue new file mode 100644 index 0000000..92f39a1 --- /dev/null +++ b/src/views/testing/fault.vue @@ -0,0 +1,128 @@ +<template> + <div class="view-layout"> + <Table stripe border :columns="tbl.columns" :data="tbl.data" :height="tblHt" size="small"></Table> + </div> +</template> +<script> +import $ from 'jquery' +export default { + data() { + return { + win: 0, + tbl: { + height: 'full-171', + columns:[ + { + title: '搴忓彿', + key: 'order' + }, + { + title: '鏁呴殰鏃ユ湡', + key: 'fault_date' + }, + { + title: '鏁呴殰鏃堕棿', + key: 'fault_time' + }, + { + title: '鏁呴殰璇存槑', + key: 'fault_explain' + }, + { + title: '鏁呴殰璁惧鍚嶇О', + key: 'fault_dev_name' + }, + { + title: '鏁呴殰閮ㄤ欢鍚嶇О', + key: 'fault_parts_name' + }, + { + title: '鏁呴殰鏉垮崱鍚嶇О', + key: 'fault_card_name' + }, + { + title: '鏁呴殰鏉垮崱鍨嬪彿', + key: 'fault_card_model' + }, + { + title: '澶囨敞', + key: 'remarks' + } + ], + data:[ + { + order:1, + fault_date: '2019-06-01', + fault_time: '08:20', + fault_explain: '', + fault_dev_name: '鐢垫皵缁煎悎鐩戞帶鍙�', + fault_parts_name: '鐢垫簮绠�', + fault_card_name: '5V鐢垫簮妯″潡', + fault_card_model: 'DY-5', + remarks: '' + }, + { + order:2, + fault_date: '2019-06-01', + fault_time: '08:20', + fault_explain: '', + fault_dev_name: '鐢垫皵缁煎悎鐩戞帶鍙�', + fault_parts_name: '鐢垫簮绠�', + fault_card_name: '15V鐢垫簮妯″潡', + fault_card_model: 'DY-15', + remarks: '' + }, + { + order:3, + fault_date: '2019-06-01', + fault_time: '08:20', + fault_explain: '', + fault_dev_name: '鐢垫皵缁煎悎鐩戞帶鍙�', + fault_parts_name: '鐢垫簮绠�', + fault_card_name: '24V鐢垫簮妯″潡', + fault_card_model: 'DY-24', + remarks: '' + } + ] + } + } + }, + computed: { + tblHt: function() { + var result = 200; + if(typeof(this.tbl.height) == 'string') { + var pattern = /^full-(\d*)$/; + if(pattern.test(this.tbl.height)) { + var diff = RegExp.$1; + result = this.win-diff; + } + + }else { + result = this.tbl.height; + } + + return result; + } + }, + mounted: function() { + var _self = this; + + // 鏍规嵁灞忓箷鍙鍖哄煙鐨勯珮搴﹁缃〃鏍肩殑楂樺害 + this.win = $(window).height(); + $(window).resize(function() { + _self.win = $(window).height(); + }); + } +} +</script> +<style scoped> + .card-title { + font-size: 18px; + } + .card-title .ivu-icon { + font-size: 24px; + } + .card-title-text { + font-weight: bold; + } +</style> \ No newline at end of file diff --git a/src/views/testing/index.vue b/src/views/testing/index.vue new file mode 100644 index 0000000..9d53168 --- /dev/null +++ b/src/views/testing/index.vue @@ -0,0 +1,13 @@ +<template> + <div class="layout"> + <router-view></router-view> + </div> +</template> +<script> +export default { + +} +</script> +<style scoped> + +</style> \ No newline at end of file -- Gitblit v1.9.1