| | |
| | | <avue-crud :option="option" |
| | | :data="btmType.attributes" |
| | | :page.sync="page" |
| | | ref="attrTable" |
| | | @cell-mouse-enter="cellEditClick" |
| | | @cell-mouse-leave="cellEditSave"> |
| | | ref="attrTable"> |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <el-button type="danger" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | @click="rowAdd()">属性选择</el-button> |
| | | </template> |
| | | |
| | | <template slot="menu" slot-scope="{row,index}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row)">编辑</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" v-if="!row.$cellEdit" @click="removeFormAttrTable(row,index)">移除</el-button> |
| | | <el-button icon="el-icon-check" size="small" type="text" v-if="row.$cellEdit" @click="cellEditSave(row,index)">保存</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitBtmType">确定</el-button> |
| | |
| | | ref="attrRef" |
| | | @on-load="attrRefOnLoad" |
| | | @search-change="attrRefSearch" |
| | | @selection-change="selectionChange"> |
| | | @selection-change="selectionChange" |
| | | v-loading="attrRef.loading"> |
| | | <template slot="typeValue" slot-scope="scope" > |
| | | <el-tag>{{scope.row.typeValue}}</el-tag> |
| | | </template> |
| | |
| | | showSubmitDialog : false, |
| | | option: { |
| | | height: "330px", |
| | | selection: true, |
| | | selection: false, |
| | | headerAlign: 'center', |
| | | border: true, |
| | | index: true, |
| | | rowKey: 'id', |
| | | tabs: true, |
| | | menu: false, |
| | | menu: true, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | menuWidth: 150, |
| | | addBtn:false, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | |
| | | currentPage:1, |
| | | pageSize:10, |
| | | }, |
| | | loading: false, |
| | | key: null, |
| | | option:{ |
| | | height: 360, |
| | |
| | | ] |
| | | }, |
| | | data: [], |
| | | queryNotIn: null |
| | | queryNotIn: '' |
| | | }, |
| | | revisionRef: { |
| | | visible: false, |
| | |
| | | closeAttrDialog(){ |
| | | this.attrRef.visible = false; |
| | | }, |
| | | // 添加 |
| | | rowAdd(){ |
| | | // 属性选择添加 |
| | | async rowAdd() { |
| | | await this.attrRefOnLoad(); |
| | | this.attrRef.visible = true; |
| | | this.attrRefOnLoad(); |
| | | }, |
| | | // 属性池加载 |
| | | attrRefOnLoad(){ |
| | | this.attrRef.loading = true; |
| | | queryPage(this.attrRef.key,this.attrRef.queryNotIn,this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.attrRef.page.total = data.total; |
| | | this.attrRef.data = data.records; |
| | | }); |
| | | setTimeout(() => { |
| | | this.attrRef.loading = false; |
| | | },600) |
| | | this.$nextTick(() => { |
| | | this.$refs.attrRef.refreshTable(); |
| | | }); |
| | |
| | | done(); |
| | | this.attrRef.key = null; |
| | | }, |
| | | // 从属性池中移除 |
| | | removeFormAttrTable(row,index){ |
| | | this.btmType.attributes.splice(index,1); |
| | | this.attrRef.queryNotIn = ""; |
| | | this.btmType.attributes.forEach(item => { |
| | | this.attrRef.queryNotIn += (item.id + ",") |
| | | }) |
| | | }, |
| | | // 属性池勾选事件 |
| | | selectionChange(list){ |
| | | this.attrRef.selectData = list; |
| | |
| | | if(!this.btmType.attributes){ |
| | | this.btmType.attributes = []; |
| | | } |
| | | this.attrRef.queryNotIn = ""; |
| | | this.attrRef.selectData.forEach(item => { |
| | | this.btmType.attributes.push({ |
| | | id: item.id, |
| | |
| | | }); |
| | | this.attrRef.queryNotIn += (item.id + ",") |
| | | }); |
| | | this.attrRef.data = []; |
| | | this.closeAttrDialog(); |
| | | }, |
| | | // 取消属性池勾选 |
| | |
| | | }, |
| | | // 列表编辑 |
| | | cellEditClick(cell){ |
| | | console.log(cell); |
| | | cell.$cellEdit = true; |
| | | }, |
| | | // 列表编辑保存 |
| | |
| | | { |
| | | label:'英文名称', |
| | | prop: 'id', |
| | | editDisabled: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | </el-button> |
| | | <el-button size="small" plain type="primary" icon="el-icon-zoom-in" @click="applyRangeOpen">查看使用范围 |
| | | </el-button> |
| | | <el-input placeholder="按属性英文名称查询" v-model="searchId" clearable prefix-icon="el-icon-search" class="attrSearch" |
| | | <el-input placeholder="按属性编号查询" v-model="searchId" clearable prefix-icon="el-icon-search" class="attrSearch" |
| | | size="small" @change="doSearch" type="text"></el-input> |
| | | <el-button size="small" plain type="primary" icon="el-icon-search" @click="doSearch"> 搜索</el-button> |
| | | </template> |
| | |
| | | this.$refs.originalAdd.activeName = this.itemForm.activeName; |
| | | this.$refs.originalAdd.enumInitFlag = this.itemForm.enumInitFlag; |
| | | this.$refs.originalAdd.referInitFlag = this.itemForm.referInitFlag; |
| | | this.refreshChange() |
| | | // this.refreshChange() |
| | | }, |
| | | deleteSave(row,index) { |
| | | console.log(row); |
| | | remove(row.oid).then(res => { |
| | | this.$message.success("删除成功"); |
| | | }); |
| | | this.refreshChange(); |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |