Files
recom-gorse/web/src/components/menus/GraphRecommend.vue
2023-05-09 17:53:58 +08:00

186 lines
5.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<div class="menu-title">
辅助维修决策
</div>
<div class="menu-content">
<div class="recommend-content">
<div class="recommend-title">装备维修信息检索主界面</div>
<div class="recommed-tab">
<label :class="active == 0?'tab-active':''" @click="selectTab(0)">信息汇聚</label>
<label :class="active == 1?'tab-active':''" @click="selectTab(1)">知识检索</label>
<label :class="active == 2?'tab-active':''" @click="selectTab(2)">故障定位</label>
<label :class="active == 3?'tab-active':''" @click="selectTab(3)">维修推荐</label>
</div>
<div style="display: flex;width: 100%;margin-bottom: 30px">
<el-input
placeholder="请输入内容"
v-model="keyword" style="flex: 1">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input>
<el-button type="primary" style="margin-left: 30px">图谱一下</el-button>
</div>
<div v-if="active == 0">
<div class="graph-box">
<graph ref="graph"></graph>
</div>
<div style="margin-top: 15px;text-align: center">信息汇聚子图</div>
</div>
<div v-if="active == 1" class="search-box">
<div class="search-box-item" style="flex: 1"></div>
<div class="search-box-item" style="width: 300px;margin-left: 20px">
{h1,r1,t1}
{h2,r2,t2}
{h3,r3,t3}
</div>
</div>
<div v-if="active == 2">
<div class="graph-table-title">故障定位描述</div>
<div class="graph-table-content">
发动机故障标志亮灯的原因有<br>
1水温曲轴位置空气流量进气温度氧传感器等这些传感器受损接触不良或信号<br>
中断时ECU就不能准确获得发动机的数据此时会引起发动机故障灯亮<br>
2发动机保养不良<br>
3没有按要求添加汽油和机油造成发动机磨损等<br>
根据查询的描
</div>
</div>
<div v-if="active == 3">
<div class="graph-table-title">维修推荐</div>
<div class="graph-table-content">
发动机故障灯亮的维修方法是<br>
1更换氧气传感器2更换三元催化器3紧固或更换油箱盖4更换恒温器5
换点火线圈6更换空气流量传感器7按期保养跟据车辆保养卡的时间周期按期
进行保养发动机的作用是将汽油柴油的热能通过在密封气缸内燃烧后膨胀气体推动
活塞做功转变为机械能发动机的保养方法是1定期更换机油及滤芯2使用合适质
量等级的润滑油3定期清理水箱4定期空气滤清器机油滤清器及汽油滤清器5
保持曲轴箱通风良好定期清洗6定期清洗燃油系统
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import request from '@/utils/request';
import graph from "@/components/graph/Graph";
var _this;
export default {
components: {
'graph': graph,
},
name: "graphRecommend",
data() {
return {
keyword: "",
active: 0
}
},
mounted() {
_this = this;
let cmd = {
path: '/noumenon/query_relation_by_ontologyid',
qo: {
ontologyId: 2
}
};
_this.$refs['graph'].initGraph({
nodes: [
{id: "1", name: "type1", label: "节点1"},
{id: "2", name: "type1", label: "节点2"}
],
edges: [
{source: "1", target: "2", name: "type2", label: "关系1"}
]
}, true);
},
methods: {
selectTab(index) {
_this.active = index;
}
}
}
</script>
<style scoped lang="scss">
.recommend-content {
width: 65%;
margin: 40px auto 0 auto;
.recommend-title {
font-size: 30px;
width: 100%;
text-align: center;
}
.recommed-tab {
margin-top: 50px;
label {
height: 35px;
line-height: 35px;
display: inline-block;
padding: 0px 20px;
margin-right: 10px;
border-left: 1px solid #dcdddf;
border-right: 1px solid #dcdddf;
border-top: 1px solid #dcdddf;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
color: #303133;
cursor: pointer;
}
.tab-active {
color: #ffffff;
border-color: #409eff;
background-color: #409eff;
}
}
.graph-box {
border: 1px solid #dcdddf;
width: 100%;
height: 500px;
background: rgba(0, 0, 0, 0.1);
border-radius: 25px;
}
.search-box {
display: flex;
align-content: space-between;
.search-box-item {
height: 450px;
border: 1px solid #dcdddf;
overflow-y: auto;
padding: 20px;
line-height: 25px;
}
}
.graph-table-title {
width: calc(100% - 42px);
background: rgba(250, 250, 250, 1);
border: 1px solid #dcdddf;
height: 40px;
line-height: 40px;
padding: 0px 20px;
}
.graph-table-content {
border-left: 1px solid #dcdddf;
border-right: 1px solid #dcdddf;
border-bottom: 1px solid #dcdddf;
padding: 20px 20px;
line-height: 25px;
max-height: 450px;
overflow-y: auto;
}
}
</style>