<template>
|
<div>
|
<el-row :gutter="5">
|
<el-col :span="5">
|
<div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
|
<product-model-tree ref="modelTree" @on-selected="onProductSelected" @on-default="onDefault" showXdy="false"
|
basic="3" :isShow="false"/>
|
</div>
|
</el-col>
|
<el-col :span="19">
|
<div class="mod-baseReliability-paramDataBasic fa-card-a" style="margin-left: 5px;">
|
<zt-table-wraper :defaultNotQuery='true' ref="tableObj" query-url="/baseReliability/ParamDataBasic/page"
|
delete-url="/baseReliability/ParamDataBasic"
|
v-slot="{ table }" :paging='false'>
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
|
<el-form-item>
|
<!--<zt-button type="query" @click="table.query()"/>
|
<zt-button type="add" perm="baseReliability:add" @click="table.editHandle()"/>
|
<zt-button type="delete" perm="baseReliability:delete" @click="table.deleteHandle()"/>-->
|
<zt-button type="primary" @click="recalculate()">重新计算</zt-button>
|
</el-form-item>
|
</el-form>
|
<el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}"
|
row-key="id"
|
:expand-row-keys="defultKey"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:header-cell-style="{'text-align':'center'}"
|
border @selection-change="table.selectionChangeHandle">
|
<!--<el-table-column type="selection" width="40"/>-->
|
<el-table-column prop="name" label="名称"/>
|
<el-table-column prop="basicMtbfRegulate" label="MTBF" align="right">
|
<template slot-scope="scope">
|
<span>{{ scope.row.basicMtbfRegulate | keepNumber }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="repairMttcr" label="MTTR" align="right">
|
<template slot-scope="scope">
|
<span>{{ scope.row.repairMttcr | keepNumber }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="basicMtbfOperatingRatio" label="运行比" align="right">
|
<template slot-scope="scope">
|
<span>{{ scope.row.basicMtbfOperatingRatio | keepNumber }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="ai" label="可用度" align="right">
|
<template slot-scope="scope">
|
<span>{{ scope.row.ai | keepNumber }}</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</zt-table-wraper>
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
</template>
|
<script>
|
import ProductModelTree from "../basicInfo/ProductModelTree";
|
|
export default {
|
data() {
|
return {
|
dataForm: {
|
shipId: '',
|
isRecal: 0,
|
basicMtbfRegulate: '',
|
repairMttcr: '',
|
basicMtbfOperatingRatio: '',
|
ai: ''
|
},
|
defultKey: []
|
}
|
},
|
components: {
|
ProductModelTree,
|
},
|
filters: {
|
keepNumber(value) { //过滤器保留4为小数
|
const numM = Number(value).toFixed(5);
|
if (numM === "NaN") {
|
return "0.0000";
|
}
|
if (numM === '0.0000' && value > 0) {
|
|
}
|
const realVal = numM.substring(0, numM.length - 1);
|
return realVal;
|
},
|
},
|
methods: {
|
onProductSelected(data) {
|
this.defultKey = []
|
this.dataForm.shipId = data.id
|
this.dataForm.productType = data.productType
|
console.log(data, 'onProductSelected(data)')
|
this.$nextTick(() => {
|
this.$refs.tableObj.query()
|
this.setDefultKey()
|
})
|
},
|
setDefultKey() {
|
this.defultKey.push(this.dataForm.shipId + "")
|
},
|
onDefault(defaultId) {
|
this.dataForm.shipId = defaultId
|
this.$nextTick(() => {
|
this.$refs.tableObj.query()
|
this.setDefultKey()
|
})
|
},
|
async recalculate() {
|
this.dataForm.isRecal = 1
|
this.$nextTick(() => {
|
this.$refs.tableObj.query()
|
})
|
},
|
}
|
}
|
</script>
|