| | |
| | | <el-form-item class="btn-group"> |
| | | <el-button type="" @click="onSearch">查询</el-button> |
| | | <el-button type="primary" @click="addOrUpdateHandle">新增</el-button> |
| | | <el-button @click="showImportDialog">导入</el-button> |
| | | <el-button type="primary" @click="showImportDialog">导入</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | ...mapGetters(['permissions']) |
| | | }, |
| | | created() { |
| | | this.loading = true |
| | | this.getData() |
| | | this.getParamType() |
| | | }, |
| | | beforeUpdate() { |
| | | console.log("updated"); |
| | | this.rowSort() |
| | | this.rowCalc() |
| | | this.loading = false |
| | | }, |
| | | watch: {}, |
| | | // beforeUpdate() { |
| | | // console.log("updated"); |
| | | // this.rowSort() |
| | | // this.rowCalc() |
| | | // this.loading = false |
| | | // }, |
| | | watch: { |
| | | tableData:{ |
| | | handler(old,newval){ |
| | | this.loading = true |
| | | // this.tableData=JSON.parse(JSON.stringify(this.tableTreeData)) |
| | | this.rowSort() |
| | | this.rowCalc() |
| | | this.loading = false |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | | //下载模板 |
| | | downloadTemplate() { |
| | |
| | | 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; |