| | |
| | | this.option.column.forEach(item => { |
| | | if (row.paramItemThree == "" && item.prop == 'paramItemThree') { |
| | | item.display = false |
| | | }else if(row.paramItemThree != "" && item.prop == 'paramItemThree'){ |
| | | item.display = true |
| | | } |
| | | if (row.paramItemTwo == "" && item.prop == 'paramItemTwo') { |
| | | item.display = false |
| | | }else if(row.paramItemTwo != "" && item.prop == 'paramItemTwo'){ |
| | | item.display = true |
| | | } |
| | | }) |
| | | console.log(row); |
| | | // let type=this.typeOptions.filter(t=>{ |
| | | // return t.label==row.paramType |
| | | // })[0] |
| | | // row.paramType=type.value |
| | | this.$refs.crud.rowEdit(row, index) |
| | | }, |
| | | showDel(row, index) { |
| | | this.$refs.crud.rowDel(row, index) |
| | | }, |
| | | updateParam(row, index, done, loading) { |
| | | // console.log(row); |
| | | // this.formDisabled = true |
| | | let data = { |
| | | dict: '', |
| | | id: 0, |
| | | id: '', |
| | | parameterFormat: '', |
| | | parameterItem: '', |
| | | type: row.paramType, |
| | | unit: row.unit, |
| | | } |
| | | row.paramType == '2' ? data.dict = row.paramFormat : data.parameterFormat = row.paramFormat |
| | | if (row.threeId) { |
| | | if (row.threeId!="null") { |
| | | data.id = row.threeId |
| | | data.parameterItem = row.paramItemThree |
| | | } else { |
| | | if (row.twoId) { |
| | | if (row.twoId!="null") { |
| | | data.id = row.twoId |
| | | data.parameterItem = row.paramItemTwo |
| | | } else { |
| | |
| | | data.parameterItem = row.paramItem |
| | | } |
| | | } |
| | | console.log(data) |
| | | if(data.type=='文本格式'){ |
| | | let type=this.typeOptions.filter(t=>{ |
| | | return t.label==row.paramType |
| | | })[0] |
| | | data.type=type.value |
| | | } |
| | | // console.log(data); |
| | | // return |
| | | putObj(data).then(res => { |
| | | if (res.data.data.code == 0) { |
| | | this.$message.success("更新成功") |
| | |
| | | }, |
| | | // 新增 / 修改 |
| | | addOrUpdateHandle(row) { |
| | | console.log("1111",row); |
| | | this.addOrUpdateVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.addOrUpdate.init(row == null ? null : row.id) |
| | |
| | | </script> |
| | | |
| | | <style> |
| | | .grid-header { |
| | | /* .grid-header { |
| | | display: none; |
| | | } |
| | | } */ |
| | | |
| | | .param-basic { |
| | | margin: 0 10px; |