| | |
| | | <el-form-item label="描述" label-width="100px"> |
| | | <el-input v-model="attribute.description" type="text"></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-tabs v-model="activeName" @tab-click="handleClick" stretch="true"> |
| | | <el-tab-pane label="参照" name="referTab"> |
| | | <el-form-item label="参照类型" label-width="100px"> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="枚举项" label-width="100px"> |
| | | |
| | | <el-tag v-for="eItem in dictEnums" :key="eItem.itemName" type="info"> |
| | | {{eItem.itemName}} |
| | | </el-tag> |
| | | </el-form-item> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitAttribute">确定</el-button> |
| | | <el-button @click="cancleSubmit">取消</el-button> |
| | | <el-button @click="cancelSubmit">取消</el-button> |
| | | </div> |
| | | <!-- 选择参照时的弹窗 --> |
| | | <el-dialog title="参照列表" :visible.sync="btmRefer.show" append-to-body @close="closeReferDialog" width="80%" |
| | |
| | | </el-container> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="confirmBtm" size="small">确定</el-button> |
| | | <el-button @click="cancleBtm" size="small">取消</el-button> |
| | | <el-button @click="cancelBtm" size="small">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 选择枚举时的弹窗 --> |
| | |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="confirmEnum" size="small">确定</el-button> |
| | | <el-button @click="cancleEnum" size="small">取消</el-button> |
| | | <el-button @click="cancelEnum" size="small">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </el-dialog> |
| | |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | selection: true, |
| | | // selection: true, |
| | | menu: false, |
| | | border: true, |
| | | reserveSelection: true, |
| | |
| | | value: 'oid', |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | dictEnums: [], |
| | | enumEditFlag: false, |
| | | enumInitFlag: false, |
| | | referInitFlag: false, |
| | | referEditFlag: false, |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }; |
| | | this.referToFlag = true; |
| | | this.$refs.form.resetFields(); |
| | | this.dictEnums = []; |
| | | }, |
| | | submitAttribute() { |
| | | const that = this; |
| | | if (that.referInitFlag && that.referEditFlag){ |
| | | this.$delete(this.attribute,'dictCode'); |
| | | this.$delete(this.attribute,'dictKey'); |
| | | this.$delete(this.attribute,'dictValue'); |
| | | this.$delete(this.attribute,'usingDict'); |
| | | } |
| | | if (that.enumInitFlag && that.enumEditFlag){ |
| | | this.$delete(this.attribute,'referTypeCode'); |
| | | this.$delete(this.attribute,'referTypeKey'); |
| | | this.$delete(this.attribute,'referTypeValue'); |
| | | this.$delete(this.attribute,'referToId'); |
| | | this.$delete(this.attribute,'referToName'); |
| | | } |
| | | this.$refs.form.validate(function (pass, field) { |
| | | if (pass) { |
| | | add(that.attribute).then(res => { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | cancleSubmit() { |
| | | cancelSubmit() { |
| | | this.closeSubmitDialog(); |
| | | }, |
| | | closeEnumDialog() { |
| | | this.cancleEnum(); |
| | | this.cancelEnum(); |
| | | }, |
| | | closeReferDialog() { |
| | | this.cancleBtm(); |
| | | this.cancelBtm(); |
| | | }, |
| | | confirmBtm() { |
| | | this.attribute.referToId = this.btmRefer.selectItem.oid; |
| | | this.attribute.referToName = this.btmRefer.selectItem.name; |
| | | this.btmRefer.show = false; |
| | | this.referEditFlag = true; |
| | | this.enumEditFlag = false; |
| | | }, |
| | | cancleBtm() { |
| | | cancelBtm() { |
| | | this.btmRefer.selectItem = {}; |
| | | this.btmRefer.show = false; |
| | | this.btmRefer.selectRow = ''; |
| | |
| | | this.attribute.dictCode = this.enumRefer.selectItem.name; |
| | | this.attribute.dictValue = this.enumRefer.selectItem.label; |
| | | this.enumRefer.show = false; |
| | | getDictionary({code :this.enumRefer.selectItem.name}).then(res => { |
| | | this.dictEnums = res.data.data; |
| | | }); |
| | | this.referEditFlag = false; |
| | | this.enumEditFlag = true; |
| | | }, |
| | | cancleEnum() { |
| | | cancelEnum() { |
| | | this.enumRefer.selectItem = {}; |
| | | this.enumRefer.show = false; |
| | | this.enumRefer.selectRow = ''; |
| | |
| | | this.domain.data = res.data.data; |
| | | }) |
| | | this.btmRefer.show = true; |
| | | |
| | | }, |
| | | // 参照类型树的点击事件 |
| | | nodeClick(data) { |
| | | // 区分业务类型的查询和链接类型的查询 |
| | | if (this.attribute.referTypeKey == 'btmType') { |
| | | btmPage(this.btmRefer.btmPage.currentPage, this.btmRefer.btmPage.pageSize, { domain: data.id }).then(res => { |
| | | btmPage(this.btmRefer.btmPage.currentPage, this.btmRefer.btmPage.pageSize, { bizDomain: data.id }).then(res => { |
| | | this.btmRefer.data = res.data.data.records; |
| | | this.btmRefer.btmPage.total = res.data.data.total; |
| | | }) |
| | |
| | | this.btmRefer.selectItem = {}; |
| | | this.btmRefer.selectRow = ''; |
| | | }, |
| | | // handleClick(tab){ |
| | | // // 因为只能参照和枚举二选一。所以在切换的时候把属性给清空。 |
| | | // this.$delete(this.attribute,'referTypeCode'); |
| | | // this.$delete(this.attribute,'referTypeKey'); |
| | | // this.$delete(this.attribute,'referTypeValue'); |
| | | // this.$delete(this.attribute,'referToId'); |
| | | // this.$delete(this.attribute,'referToName'); |
| | | // this.$delete(this.attribute,'dictCode'); |
| | | // this.$delete(this.attribute,'dictKey'); |
| | | // this.$delete(this.attribute,'dictValue'); |
| | | // this.$delete(this.attribute,'usingDict'); |
| | | // } |
| | | handleClick(tab){ |
| | | // 因为只能参照和枚举二选一。所以在切换的时候把属性给清空。 |
| | | if (tab.name === 'enumTab'){ |
| | | this.enumInitFlag = true; |
| | | this.referInitFlag = false; |
| | | }else { |
| | | this.enumInitFlag = false; |
| | | this.referInitFlag = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | |
| | | .attributeForm>.el-form-item>.el-form-item__content>.el-select>.el-input>.el-input__inner { |
| | | width: 200px; |
| | | }</style> |
| | | }</style> |