| | |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-table |
| | | <paramMergeTemplate |
| | | :key="isShowTree" |
| | | :isModel="true" |
| | | :option="paramTemplateOption" |
| | | :page="{}" |
| | | :textEllipsisWidth="60" |
| | | :handleParamDelete="deleteOperationParam" |
| | | :handleParamEdit="editSample" |
| | | :handleParamInsert="insertTechnologyOperationParam" |
| | | :handleParamSave="saveSample" |
| | | :tableTreeData="operationParams"> |
| | | </paramMergeTemplate> |
| | | <!-- <component :is="paramMergeTemplate" |
| | | :key="isShowTree" |
| | | :tableTreeData="operationParams"></component> --> |
| | | <!-- <el-table |
| | | :data="operationParams" |
| | | id="templateParamTable" |
| | | ref="operationParam" |
| | |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <!-- <el-table-column |
| | | <el-table-column |
| | | label="参数类型" |
| | | prop="type" |
| | | align="center" |
| | |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="单位" prop="unit" align="center"> |
| | | </el-table-column> --> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-table> --> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | relateOperationParamTemplate |
| | | } from '../../../api/basic/template' |
| | | import { remote } from '@/api/admin/dict' |
| | | import paramMergeTemplate from '../../common/param-mergeTemplate.vue' |
| | | export default { |
| | | data() { |
| | | return { |
| | | isShowTree: false, |
| | | paramMergeTemplate: '', |
| | | paramSelArr: [], |
| | | paramSelCol: 'code', |
| | | templateIndex: null, |
| | |
| | | minWidth: 100 |
| | | } |
| | | }, |
| | | addOrUpdateVisible: false |
| | | addOrUpdateVisible: false, |
| | | paramTemplateOption: { |
| | | height: 300, |
| | | columnBtn: false, |
| | | index: true, |
| | | indexLabel: '序号', |
| | | indexWidth: 50, |
| | | menu: true, |
| | | menuWidth: 130, |
| | | menuAlign: 'center', |
| | | editBtn: false, |
| | | delBtn: false, |
| | | addBtn: false, |
| | | border: true, |
| | | size: 'small', |
| | | refreshBtn: false, |
| | | align: 'center', |
| | | column: [ |
| | | { |
| | | label: '参数编号', |
| | | prop: 'code', |
| | | width:80, |
| | | slot: true |
| | | }, |
| | | { |
| | | label: '参数项', |
| | | prop: 'paramItem', |
| | | }, |
| | | { |
| | | label: '二级参数', |
| | | prop: 'paramItemTwo', |
| | | }, |
| | | { |
| | | label: '三级参数', |
| | | prop: 'paramItemThree', |
| | | }, |
| | | { |
| | | label: '参数类型', |
| | | prop: 'paramType', |
| | | formslot: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择参数类型", |
| | | trigger: "change" |
| | | }] |
| | | }, |
| | | { |
| | | label: '值', |
| | | prop: 'paramValue', |
| | | minWidth: 100, |
| | | slot: true, |
| | | formslot: true, |
| | | labelslot: true |
| | | }, { |
| | | label: '单位', |
| | | prop: 'unit', |
| | | rules: [{ |
| | | required: true, |
| | | message: "单位不能为空", |
| | | trigger: "blur" |
| | | }] |
| | | },] |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | ttable, |
| | | TableForm, |
| | | ParamDialog |
| | | ParamDialog, |
| | | paramMergeTemplate |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['permissions']) |
| | |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.templateId = val.id |
| | | if(this.isShowTree){ |
| | | this.isShowTree=false |
| | | }else{ |
| | | this.isShowTree=true |
| | | } |
| | | if (val != null) { |
| | | this.operationParams = [] |
| | | this.getJoinParamTemplateData() |
| | |
| | | technologyOperationTemplateId: this.templateId |
| | | }) |
| | | ).then((response) => { |
| | | this.operationParams = response.data.data.records |
| | | let data = response.data.data |
| | | data.forEach(obj=>{ |
| | | obj.templateId = this.templateId |
| | | }) |
| | | this.operationParams = data |
| | | |
| | | }) |
| | | }, |
| | | rowDrop() { |
| | |
| | | }, |
| | | // 添加 |
| | | relateOperationParam() { |
| | | console.log(11111); |
| | | if (this.templateId !== 0) { |
| | | // 筛选出当前页面已有的参数 |
| | | this.paramSelArr = [] |
| | |
| | | saveSample(index, row) { |
| | | console.log('row', row) |
| | | var obj = {} |
| | | obj.technologyOperationParamId = row.id |
| | | obj.technologyOperationTemplateId = row.technologyOperationTemplateId |
| | | obj.defaultValue = row.defaultValue |
| | | let id = null |
| | | if(row.threeId && row.threeId!='null'){ |
| | | id = row.threeId |
| | | }else{ |
| | | if(row.twoId && row.twoId!='null'){ |
| | | id = row.twoId |
| | | }else{ |
| | | id = row.oneId |
| | | } |
| | | } |
| | | obj.technologyOperationParamId = id |
| | | obj.technologyOperationTemplateId = row.templateId |
| | | obj.defaultValue = row.paramValue |
| | | console.log(obj); |
| | | putRelateOperationParamTemplate(obj).then((response) => { |
| | | this.$message.success('参数保存成功') |
| | | this.$set(row, 'isUpdate', false) |