<template>
|
<zt-dialog ref="dialog" column="2" title="选择系统模型" append-to-body :editAble="false" :hasConfirm="false">
|
<el-card shadow="never" class="aui-card--fill">
|
<div class="mod-taskReliability-modelRbd}">
|
<zt-table-wraper ref="tableObj" query-url="/taskReliability/ModelRbd/page"
|
:paging='false'
|
v-slot="{ table }">
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
|
</el-form>
|
<el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}"
|
border @row-dblclick="selectModel"
|
@selection-change="table.selectionChangeHandle">
|
<el-table-column prop="modelName" label="模型名称"/>
|
</el-table>
|
<!-- 弹窗, 新增 / 修改 -->
|
</zt-table-wraper>
|
</div>
|
</el-card>
|
</zt-dialog>
|
</template>
|
|
<script>
|
|
export default {
|
name: 'SelectModelRbd',
|
data() {
|
return {
|
dataForm: {
|
id: '',
|
modelName: '',
|
modelState: '',
|
productId: '',
|
phaseId: '',
|
modelId: '',
|
}
|
}
|
},
|
mounted() {
|
|
},
|
components: {},
|
methods: {
|
init(param) {
|
this.dataForm.productId = param.row.productId
|
this.dataForm.phaseId = param.phaseId
|
this.dataForm.id = param.row.id
|
},
|
async selectModel(row) {
|
console.log(this.dataForm)
|
this.dataForm.modelId = row.id
|
this.dataForm.productId = row.productId
|
let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/TaskPhaseModel/', this.dataForm)
|
if (res.success) {
|
await this.$tip.success()
|
this.$refs.dialog.close()
|
this.$emit('setModel')
|
}
|
}
|
}
|
}
|
</script>
|