| | |
| | | <el-card> |
| | | <el-form :model="form"> |
| | | <el-form-item label="集团分类" label-width="70px" size="small"> |
| | | <el-select clearable ref="selectTree" v-model="form.groupValue" placeholder="请选择" |
| | | <el-select clearable ref="selectTree" v-model="groupVal" placeholder="请选择" |
| | | popper-class="popperTreeSelect"> |
| | | <el-option :value="groupVal" :label="groupVal"> |
| | | <el-tree ref="groupTree" :data="groupTreeData" empty-text="暂无数据" :props="defaultProps" |
| | |
| | | @row-dblclick="handleMapingRowClick" @selection-change="selectionChange" @select="setCurrentRow" |
| | | @select-all="handleSelectAll"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" :disabled="disabledPush" @click="dialogPush = true">新 增 |
| | | <el-button icon="el-icon-plus" size="small" type="primary" :disabled="disabledPush" |
| | | @click="dialogPush = true">新 增 |
| | | </el-button> |
| | | <el-button icon="el-icon-check" size="small" type="primary" @click="handleSave">保 存 |
| | | </el-button> |
| | | <el-button icon="el-icon-connection" size="small" type="primary" @click="handleSync">同步模型 |
| | | <el-button icon="el-icon-connection" size="small" type="primary" |
| | | @click="handleSync('all')">同步主模型 |
| | | </el-button> |
| | | <el-button icon="el-icon-connection" size="small" type="primary" |
| | | @click="handleSync('one')">同步详细模型 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </el-card> |
| | | </el-main> |
| | | </el-container> |
| | | <!-- <el-dialog title="编码属性" :visible.sync="dialogPush" append-to-body="true" destroy-on-close width="30%" |
| | | :before-close="handleClose"> |
| | | <el-form :model="form"> |
| | | <el-form-item label="查询条件" label-width="70px" size="small"> |
| | | <el-input v-model="form.name" autocomplete="off" @change="handleQuery"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <p class="text_tip">*选择分类进行属性过滤, 或者输入属性的全拼或者简拼进行查询! 如: 姓名 (可输入xm或xinming )</p> |
| | | <transfer v-model="transferValue" :data="transferData" :filter-method="filterMethod" |
| | | filter-placeholder="请输入拼音全拼或者拼音缩写" :props="transferProps"></transfer> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogPush = false">取 消</el-button> |
| | | <el-button type="primary" @click="handelTransferSave">保 存</el-button> |
| | | </span> |
| | | </el-dialog> --> |
| | | <integration-transfer :visible.sync="dialogPush" :data="transferData" :props="transferProps" |
| | | @save="handelTransferSave"></integration-transfer> |
| | | <integration-transfer :visible.sync="dialogPush" :data="transferData" :disabledData="filtermapping" |
| | | :props="transferProps" @save="handelTransferSave"></integration-transfer> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | window.handleBlur = that.handleBlur |
| | | |
| | | }, |
| | | computed: { |
| | | filtermapping() { |
| | | const data = this.mappingData.filter(item => { |
| | | return !(Object.prototype.hasOwnProperty.call(item, 'targetAttrName') && (item.targetAttrName === null || item.targetAttrName === undefined || item.targetAttrName === "")) |
| | | }) |
| | | const transfer = data.map(obj => { |
| | | return obj.targetAttrName |
| | | }) |
| | | return transfer |
| | | } |
| | | }, |
| | | methods: { |
| | | // 接口左侧树 |
| | | async getReferCodeClassifyTree() { |
| | |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | | this.mappingData = response.data.data |
| | | console.log(this.filtermapping) |
| | | } |
| | | }, |
| | | // 接口获取属性映射取值范围 |
| | |
| | | message: "保存成功!" |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | // 同步数据 |
| | | async handleSync() { |
| | | const response = await syncClassifyModel({ dockingPreAttrMappingVOList: this.tableData }) |
| | | async handleSync(type = 'all') { |
| | | let param = { operationType: type } |
| | | if (type === 'one') { |
| | | param.classifyId = this.form.groupValue |
| | | } |
| | | if (this.form.groupValue === '' && type === 'one') { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "请选择一条集团分类" |
| | | }); |
| | | } else { |
| | | console.log(param) |
| | | const response = await syncClassifyModel(param) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | } |
| | | } |
| | | }, |
| | | handelTransferSave(event) { |
| | | let that = this |
| | |
| | | const findRow = that.mappingData.findIndex(item => item.metaListId === that.mappingForm.metaListId) |
| | | that.mappingData[findRow].targetAttrName = transferValue[0].name |
| | | that.mappingData[findRow].targetAttrId = transferValue[0].oid |
| | | this.dialogPush =false |
| | | this.dialogPush = false |
| | | } |
| | | |
| | | }, |
| | |
| | | }, |
| | | // 集团分类树点击 |
| | | handleNodeClick(data) { |
| | | this.form.groupValue = data.name |
| | | this.form.groupValue = data.oid |
| | | this.groupVal = data.name |
| | | this.$refs.selectTree.blur() |
| | | this.getGridAttrMapping(data.oid) |
| | |
| | | if (event === 'mapping') this.$refs.crudMapping.rowCell(this.mappingForm, this.mappingForm.$index) |
| | | }, |
| | | // 集团映射属性行选择单元格编辑(双击) |
| | | handleMapingRowClick(row, column, cell, event) { |
| | | console.log(row) |
| | | handleMapingRowClick(row, column) { |
| | | clearTimeout(this.times) |
| | | this.mappingForm = row |
| | | if (column.label === '默认值' || column.label === '属性名称') this.$refs.crudMapping.rowCell(row, row.$index) |
| | | }, |
| | | // 集团映射属性行选择(单击) |
| | | handleMapingClick(row, column, cell, event) { |
| | | handleMapingClick(row) { |
| | | clearTimeout(this.times) |
| | | this.mappingForm = row |
| | | this.times = setTimeout(() => { |
| | |
| | | }, 300) |
| | | }, |
| | | // 属性取值范围单元格编辑(双击) |
| | | handleRowClick(row, column, cell, event) { |
| | | handleRowClick(row) { |
| | | this.rangeForm = row |
| | | this.$refs.crudRange.rowCell(row, row.$index) |
| | | }, |
| | | // 属性取值范围单元格编辑后 |
| | | handleUpdate(row, index, done, loading) { |
| | | handleUpdate(row, index, done) { |
| | | console.log(row) |
| | | console.log(index) |
| | | let data = [] |
| | | const findRow = this.mappingData.findIndex(item => item.metaListId === row.metaListId) |
| | | this.rangeData[index] = row |
| | | console.log(this.rangeData) |
| | |
| | | done(); |
| | | }, |
| | | // 属性取值范围单元格编辑后 |
| | | handleMapingUpdate(row, index, done, loading) { |
| | | handleMapingUpdate(row, index, done) { |
| | | console.log(row) |
| | | console.log('修改后', row) |
| | | this.$message({ |