From 40b60ccb89d6d50b0ccc577937f462360c7c2d4d Mon Sep 17 00:00:00 2001 From: wente <329538422@qq.com> Date: 星期三, 13 十一月 2024 15:12:01 +0800 Subject: [PATCH] 修改 --- web/src/views/modules/taskReliability/OperatConditModel.vue | 44 ++++++++++++++++++++++++++------------------ 1 files changed, 26 insertions(+), 18 deletions(-) diff --git a/web/src/views/modules/taskReliability/OperatConditModel.vue b/web/src/views/modules/taskReliability/OperatConditModel.vue index a14565b..81f7506 100644 --- a/web/src/views/modules/taskReliability/OperatConditModel.vue +++ b/web/src/views/modules/taskReliability/OperatConditModel.vue @@ -9,16 +9,16 @@ </el-form-item> </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" + v-adaptive="{bottomOffset:30}" border @selection-change="table.selectionChangeHandle" + 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="璇烽�夋嫨" style="width:100%" @change="modelChanged(scope.row)"> - <el-option on + <el-option v-for="item in scope.row.modelList" :key="item.id" :label="item.modelName" @@ -27,37 +27,41 @@ </el-select> </template> </el-table-column> - <el-table-column label="鎿嶄綔" width="100px"> + <el-table-column label="鎿嶄綔" width="105px"> <template v-slot="{ row }"> <el-button v-if="row.modelId" type="primary" size="small" @click="drawRBD(row)">鏌ョ湅妯″瀷</el-button> </template> </el-table-column> </el-table> - <el-dialog v-dialogDrag title="妯″瀷璁捐" top="1vh" width='95%' :visible.sync="dialogVisible2" v-if="dialogVisible2"> - <RBDEditImg ref="rbdEditImg"></RBDEditImg> - </el-dialog> +<!-- <el-dialog v-dialogDrag :title="title" top="1vh" width='95%' :visible.sync="dialogVisible2" v-if="dialogVisible2">--> +<!-- <model-view ref="modelView"></model-view>--> +<!-- </el-dialog>--> </zt-table-wraper> </div> </template> <script> - import RBDEditImg from './RBD-edit-img' + import ModelView from "./ModelView"; + import cloneDeep from 'lodash/cloneDeep' export default { name: 'OperaConditModel', data() { return { dataForm: { + id: '', operatConditId: '', productId: '', }, mapModelNodes: {}, + modelList: [], dialogVisible2: false, isChange: false, + title: '' } }, components: { - RBDEditImg + ModelView }, mounted() { this.getModelNodes() @@ -81,6 +85,7 @@ 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() } @@ -94,7 +99,7 @@ } }, - modelChanged(row){ + modelChanged(row) { this.isChange = true this.modelChangedProess(row) }, @@ -103,12 +108,17 @@ 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 } @@ -134,15 +144,13 @@ } }, drawRBD(row) { - this.dialogVisible2 = true let param = { id: row.modelId, - model: row.modelName, - productId: row.productId + modelName: row.modelName, + collapseTransition:0, + title:row.modelName + '妯″瀷璁捐' } - this.$nextTick(() => { - this.$refs.rbdEditImg.init(param) - }) + this.$emit('collapseTransitionChange', param) } } } -- Gitblit v1.9.1