| | |
| | | </div> |
| | | </el-form> |
| | | <div class="bottomForm"> |
| | | <h3 style="margin-bottom: 10px;">属性池列表</h3> |
| | | <avue-crud |
| | | size="mini" |
| | | :data="dialogAttrData" |
| | | :option="dialogAttrOption" |
| | | @row-del="dialogBottomAttrDel"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addDialogClickHandler">创建</el-button> |
| | | <h3 style="display: inline-block;margin-right: 20px;margin-bottom: 10px;">属性池列表</h3> |
| | | <el-button icon="el-icon-plus" size="mini" type="primary" @click="addDialogClickHandler">创建</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer avue-dialog__footer"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="addDialogSavaHandler">确 定</el-button> |
| | | <el-button @click="addDialogClose">取 消</el-button> |
| | | </span> |
| | |
| | | > |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogAttrClose">取 消</el-button> |
| | | <el-button type="primary" @click="dialogAttrAddClickHandler">确 定</el-button> |
| | | <el-button @click="dialogAttrClose">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | |
| | | index: false, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | header:false, |
| | | column: [ |
| | | { |
| | | label: '类型名', |
| | |
| | | height: 450, |
| | | searchMenuSpan: 8, |
| | | header: false, |
| | | selectable:function(row){ |
| | | return row.selectable; |
| | | }, |
| | | column: [ |
| | | { |
| | | label: '属性名', |
| | | prop: 'id', |
| | | sortable: true, |
| | | search: true, |
| | | width:260 |
| | | }, |
| | | { |
| | | label: '属性类型', |
| | |
| | | label: '初始值', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: '说明', |
| | |
| | | editBtn: false, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | height: 210, |
| | | height: 220, |
| | | addBtn: false, |
| | | gridBtn:false, |
| | | columnBtn:false, |
| | | menuWidth:100, |
| | | // index:false, |
| | | column: [ |
| | |
| | | label: '属性名', |
| | | prop: 'id', |
| | | sortable: true, |
| | | width:260, |
| | | }, |
| | | { |
| | | |
| | | prop: 'btmTypeId', |
| | | label: '业务类型', |
| | | sortable: true |
| | | sortable: true, |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: '属性类型', |
| | |
| | | label: '初始值', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | width:150, |
| | | width:200, |
| | | }, |
| | | { |
| | | label: '说明', |
| | |
| | | { |
| | | prop: 'id', |
| | | label: '属性名', |
| | | sortable: true |
| | | sortable: true, |
| | | width:260 |
| | | }, |
| | | { |
| | | prop: 'btmTypeId', |
| | | label: '业务类型', |
| | | sortable: true |
| | | sortable: true, |
| | | width:200 |
| | | }, |
| | | { |
| | | prop: 'attributeDataType', |
| | | label: '属性类型', |
| | | sortable: true |
| | | sortable: true, |
| | | width:150 |
| | | }, |
| | | { |
| | | prop: 'defaultValue', |
| | | label: '默认值', |
| | | sortable: true |
| | | sortable: true, |
| | | width: 200 |
| | | }, |
| | | { |
| | | prop: 'description', |
| | |
| | | // 查询属性池列表数据 |
| | | getAttrDialogDta() { |
| | | gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => { |
| | | const data = res.data.data; |
| | | this.dialogAttrSaveData = data; |
| | | const data = res.data.data.map(item=>{ |
| | | item.selectable=!this.dialogAttrData.some(existingItem => existingItem.id === item.id); |
| | | return item; |
| | | }); |
| | | this.dialogAttrSaveData=data; |
| | | this.attrPage.total = res.data.total; |
| | | this.dialogAttrLoading = false; |
| | | }).catch(err => { |
| | |
| | | |
| | | // 添加属性池 行点击 |
| | | dialogAttrRowClickHandler(row) { |
| | | |
| | | if(!row.selectable){ |
| | | return; |
| | | } |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.dialogAttrCrud, |
| | |
| | | |
| | | // 添加属性池 保存 |
| | | dialogAttrAddClickHandler() { |
| | | let hasDuplicate = false; |
| | | |
| | | // 先创建一个临时数组来存储不重复的项 |
| | | const newItems = []; |
| | | |
| | | this.dialogAttrSelectList.forEach(item => { |
| | | const exists = this.dialogAttrData.some(existingItem => existingItem.id === item.id); |
| | | |
| | | if (exists) { |
| | | hasDuplicate = true; |
| | | return; |
| | | } |
| | | |
| | | // 如果没有重复项,则将该项添加到临时数组中 |
| | | newItems.push({ |
| | | this.dialogAttrData.push({ |
| | | id: item.id, |
| | | attributeDataType: item.attributeDataType, |
| | | defaultValue: item.defaultValue, |
| | | description: item.description |
| | | }); |
| | | }); |
| | | |
| | | if (hasDuplicate) { |
| | | this.$message.error('请检查是否有添加重复项!'); |
| | | } else { |
| | | // 如果没有重复项,将新项添加到 dialogAttrData |
| | | this.dialogAttrData.push(...newItems); |
| | | this.attrPollDialogVisible = false; |
| | | } |
| | | this.attrPollDialogVisible = false; |
| | | }, |
| | | |
| | | // 属性池删除 |