| | |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" |
| | | v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle" |
| | | row-key="id" |
| | | row-key="iid" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | :default-expand-all="true"> |
| | | <el-table-column prop="product" label="产品节点"/> |
| | | <el-table-column prop="productName" label="产品节点"/> |
| | | <el-table-column prop="modelId" label="产品模型"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.modelId" :disabled="scope.row.isDisabled == 1" placeholder="请选择" |
| | |
| | | |
| | | <script> |
| | | import RBDEditImg from './RBD-edit-img' |
| | | import cloneDeep from 'lodash/cloneDeep' |
| | | |
| | | export default { |
| | | name: 'OperaConditModel', |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | id: '', |
| | | operatConditId: '', |
| | | productId: '', |
| | | }, |
| | | mapModelNodes: {}, |
| | | modelList: [], |
| | | dialogVisible2: false, |
| | | isChange: false, |
| | | } |
| | | }, |
| | | components: { |
| | |
| | | console.log(dataList[0].modelList[0].id, ' dataList[0].modelList[0].modelId') |
| | | dataList[0].modelId = dataList[0].modelList[0].id |
| | | console.log(dataList[0], 'dataLoaded(dataList)') |
| | | this.modelChanged(dataList[0]) |
| | | this.modelChangedProess(dataList[0]) |
| | | } |
| | | }, |
| | | async save() { |
| | | let res = await this.$http.post('/taskReliability/OperatConditModel/', this.$refs.tableObj.dataList[0]) |
| | | if (res.success) { |
| | | this.$tip.success() |
| | | this.isChange = false |
| | | this.$refs.tableObj.query() |
| | | } |
| | | }, |
| | |
| | | } |
| | | }, |
| | | modelChanged(row) { |
| | | this.isChange = true |
| | | this.modelChangedProess(row) |
| | | }, |
| | | modelChangedProess(row) { |
| | | let modelId = row.modelId |
| | | let modelNodes = this.mapModelNodes[modelId] |
| | | console.log(modelId, 'modelChanged modelId') |
| | | console.log(modelNodes, 'modelChanged modelNodes') |
| | | console.log(row.children, 'row.children') |
| | | |
| | | for (let subRow of row.children) { |
| | | if (modelNodes.indexOf(subRow.productId)) { |
| | | console.log(subRow,'subRow') |
| | | console.log(subRow.productId,'subRow.productId') |
| | | if (modelNodes.indexOf(subRow.productId) != -1) { |
| | | subRow.isDisabled = 0 |
| | | if (subRow.modelList.length == 1) { |
| | | subRow.modelId = subRow.modelList[0].id |
| | | console.log(subRow.modelId, 'subRow.modelId 111') |
| | | console.log(this.mapModelNodes[subRow.modelId], 'this.mapModelNodes[subRow.modelId] 111') |
| | | } else { |
| | | //subRow.modelId = null |
| | | } |
| | |
| | | this.dialogVisible2 = true |
| | | let param = { |
| | | id: row.modelId, |
| | | model: row.modelName, |
| | | modelName: row.modelName, |
| | | productId: row.productId |
| | | } |
| | | this.$nextTick(() => { |