| | |
| | | :visible.sync="showSubmitDialog" |
| | | append-to-body |
| | | @close="closeSubmitDialog" |
| | | width="74%" |
| | | width="70%" |
| | | > |
| | | <el-form ref="form" :model="btmType" show-message="true" inline> |
| | | <el-form-item label="英文名称:" label-width="100px"> |
| | | <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm"> |
| | | |
| | | <el-form-item label="英文名称" label-width="100px" required="true"> |
| | | <el-input v-model="btmType.id" :prefix-icon="icons.key"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="中文名称:" label-width="100px"> |
| | | <el-form-item label="中文名称" label-width="100px"> |
| | | <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="数据库表名:" label-width="100px"> |
| | | <el-form-item label="数据库表名" label-width="100px"> |
| | | <el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属领域:" label-width="100px"> |
| | | <el-form-item label="所属领域" label-width="100px"> |
| | | <el-select v-model="btmType.domain" :prefix-icon="icons.domain"> |
| | | <el-option v-for="item in domainOption" |
| | | :label="item"></el-option> |
| | | :label="item.label" :value="item.value" :key="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="版本规则:" label-width="100px"> |
| | | <el-input v-model="btmType.revisionRuleId" :prefix-icon="icons.revisionRule"> |
| | | <el-form-item label="版本规则" label-width="100px"> |
| | | <el-input v-model="btmType.revisionRuleId" :prefix-icon="icons.revisionRule" class="revisionRule"> |
| | | <i slot="suffix" class="el-input__icon el-icon-search"></i> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="生命周期:" label-width="100px"> |
| | | <el-form-item label="生命周期" label-width="100px"> |
| | | <el-input v-model="btmType.lifeCycleId" :prefix-icon="icons.lifeCycle"> |
| | | <i slot="suffix" class="el-input__icon el-icon-search"></i> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="视图:" label-width="100px"> |
| | | <el-input v-model="btmType.view" :prefix-icon="icons.view"></el-input> |
| | | <div> |
| | | <el-form-item label="开启视图" label-width="100px" class="viewFlag"> |
| | | <el-switch v-model="btmType.viewFlag" active-color="#13ce66" @change="viewChange"></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="描述:" label-width="100px"> |
| | | <el-form-item label="视图语句" label-width="100px"> |
| | | <el-input v-model="btmType.view" :prefix-icon="icons.view" :disabled="!btmType.viewFlag"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <el-form-item label="描述" label-width="100px" class="description"> |
| | | <el-input v-model="btmType.description" |
| | | :prefix-icon="icons.desc" |
| | | class="descClass" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <avue-crud :option="option" :data="btmType.attributes" :page.sync="page" ref="attrTable"> |
| | | <avue-crud :option="option" |
| | | :data="btmType.attributes" |
| | | :page.sync="page" |
| | | ref="attrTable" |
| | | @cell-mouse-enter="cellEditClick" |
| | | @cell-mouse-leave="cellEditSave"> |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <el-button type="danger" |
| | | icon="el-icon-plus" |
| | |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | <el-button @click="submitBtmType">确定</el-button> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="submitBtmType">确定</el-button> |
| | | <el-button @click="cancleSubmitBtmType">取消</el-button> |
| | | </div> |
| | | |
| | | |
| | | <el-dialog title="属性池" |
| | |
| | | :page.sync="attrRef.page" |
| | | ref="attrRef" |
| | | @on-load="attrRefOnLoad" |
| | | @search-change="attrRefSearch" |
| | | @selection-change="selectionChange"> |
| | | <template slot="name" slot-scope="scope" > |
| | | <el-tag>{{scope}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-button @click="confirmSelectAttr">确定</el-button> |
| | | <el-button @click="cancleSelectAttr">取消</el-button> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="confirmSelectAttr">确定</el-button> |
| | | <el-button @click="cancleSelectAttr">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | |
| | | <script> |
| | | |
| | | import { } from '@/api/omd/btmType'; |
| | | import { getPage } from '@/api/omd/OmdAttribute'; |
| | | import { add,update } from '@/api/omd/btmType'; |
| | | import { queryPage } from '@/api/omd/OmdAttribute'; |
| | | export default { |
| | | name: 'BusinessAdd', |
| | | props: { |
| | |
| | | return { |
| | | form: {}, |
| | | showSubmitDialog : false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize:10 |
| | | }, |
| | | option: { |
| | | height: "330px", |
| | | selection: true, |
| | | headerAlign: 'center', |
| | | border: true, |
| | | index: true, |
| | | rowKey: 'oid', |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn:false, |
| | | rowKey: 'id', |
| | | tabs: true, |
| | | menu: false, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '属性英文名称', |
| | | label: '英文名称', |
| | | prop: 'id', |
| | | align: 'left' |
| | | }, { |
| | | label: '属性中文名称', |
| | | prop: 'name', |
| | | align: 'center' |
| | | }, { |
| | | label: '中文名称', |
| | | prop: 'name', |
| | | align: 'center', |
| | | cell: true |
| | | }, |
| | | { |
| | | label: "属性类型", |
| | | prop: "typeValue", |
| | | label: "类型", |
| | | prop: "attrDataType", |
| | | align: 'center', |
| | | slot: true |
| | | }, |
| | |
| | | label: "默认值", |
| | | prop: "defaultValue", |
| | | cell: 'true', |
| | | align: 'center' |
| | | align: 'center', |
| | | cell: true |
| | | }, |
| | | { |
| | | label: "说明", |
| | | prop: "description", |
| | | cell: 'true', |
| | | align: 'center' |
| | | align: 'center', |
| | | cell:true |
| | | } |
| | | ] |
| | | }, |
| | |
| | | page: { |
| | | currentPage:1, |
| | | pageSize:10, |
| | | key:'' |
| | | }, |
| | | key: null, |
| | | option:{ |
| | | height: 360, |
| | | addBtn: false, |
| | |
| | | selection: true, |
| | | menu: false, |
| | | border: true, |
| | | reserveSelection: true, |
| | | searchMenuSpan:8, |
| | | column: [ |
| | | { |
| | | label: '属性英文名称', |
| | | label: '英文名称', |
| | | prop: 'key', |
| | | align: 'left', |
| | | search: true, |
| | | width: 230 |
| | | }, { |
| | | label: '属性中文名称', |
| | | label: '中文名称', |
| | | prop: 'label', |
| | | align: 'center' |
| | | align: 'center', |
| | | }, |
| | | { |
| | | label: "属性类型", |
| | | label: "类型", |
| | | prop: "typeValue", |
| | | align: 'center' |
| | | }, |
| | |
| | | { |
| | | label: "说明", |
| | | prop: "description", |
| | | cell:true, |
| | | align: 'center' |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | queryNotIn: [] |
| | | queryNotIn: null |
| | | } |
| | | } |
| | | }, |
| | |
| | | methods: { |
| | | closeSubmitDialog(){ |
| | | this.showSubmitDialog = false; |
| | | this.btmType.attributes = []; |
| | | this.btmType = {}; |
| | | this.attrRef.selectData = []; |
| | | this.attrRef.queryNotIn = null; |
| | | }, |
| | | closeAttrDialog(){ |
| | | this.attrRef.visible = false; |
| | | }, |
| | | rowAdd(){ |
| | | this.attrRef.visible = true; |
| | | this.$refs.attrRef.refreshTable(); |
| | | this.attrRefOnLoad(); |
| | | |
| | | }, |
| | | attrRefOnLoad(){ |
| | | var str = ''; |
| | | this.attrRef.queryNotIn.forEach(item => { |
| | | str = str + item + ',' |
| | | }); |
| | | getPage(this.attrRef.page.currentPage, this.attrRef.page.pageSize,{'condition["key_like"]':this.attrRef.page.key}).then(res => { |
| | | 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; |
| | | }) |
| | | }); |
| | | this.$nextTick(() => { |
| | | this.$refs.attrRef.refreshTable(); |
| | | }); |
| | | }, |
| | | attrRefSearch(form,done){ |
| | | this.attrRef.key = form.key; |
| | | this.attrRefOnLoad(); |
| | | done(); |
| | | this.attrRef.key = null; |
| | | }, |
| | | selectionChange(list){ |
| | | this.attrRef.selectData = list; |
| | | }, |
| | | confirmSelectAttr(){ |
| | | this.btmType.attributes = []; |
| | | this.attrRef.queryNotIn = ""; |
| | | this.attrRef.selectData.forEach(item => { |
| | | this.btmType.attributes.push({ |
| | | id: item.key, |
| | | name: item.label, |
| | | typeValue: item.typeValue, |
| | | typeKey: item.typeValue, |
| | | attrDataType : item.typeValue, |
| | | defaultValue: item.defaultValue, |
| | | description: item.description |
| | | description: item.description, |
| | | attributeLength: item.maxLength |
| | | }); |
| | | this.attrRef.queryNotIn.push(item.key); |
| | | this.attrRef.queryNotIn += (item.key + ",") |
| | | }); |
| | | this.closeAttrDialog(); |
| | | }, |
| | |
| | | this.closeAttrDialog(); |
| | | }, |
| | | submitBtmType(){ |
| | | // 添加完成,回调父组件的刷新 |
| | | console.log(this.btmType); |
| | | this.$emit('refreshTable'); |
| | | add(this.btmType,true).then(res => { |
| | | // 添加完成,回调父组件的刷新 |
| | | this.$message.success('保存成功'); |
| | | this.cancleSubmitBtmType(); |
| | | this.$emit('refreshTable'); |
| | | }) |
| | | }, |
| | | cancleSubmitBtmType(){ |
| | | this.btmType = {}; |
| | | this.btmType.attributes = []; |
| | | console.log(this.btmType); |
| | | this.showSubmitDialog = false; |
| | | }, |
| | | refreshAttrTable(){ |
| | | this.$refs.attrTable.refreshTable(); |
| | | this.$nextTick( () => { |
| | | this.$refs.attrTable.refreshTable(); |
| | | }) |
| | | }, |
| | | viewChange(){ |
| | | |
| | | }, |
| | | cellEditClick(cell){ |
| | | cell.$cellEdit = true; |
| | | }, |
| | | cellEditSave(row){ |
| | | this.btmType.attributes[row.$index].name = row.name |
| | | this.btmType.attributes[row.$index].defaultValue = row.defaultValue; |
| | | this.btmType.attributes[row.$index].description = row.description; |
| | | row.$cellEdit = false; |
| | | } |
| | | } |
| | | } |
| | |
| | | <style> |
| | | /* 属性池参照列表 */ |
| | | .attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ |
| | | display: none !important; |
| | | display: none !important; |
| | | } |
| | | </style> |
| | | |
| | | .btmTypeForm > .el-form-item > .el-form-item__content > .el-input > .el-input__inner { |
| | | width: 200px; |
| | | } |
| | | |
| | | .viewFlag { |
| | | width: 305px; |
| | | } |
| | | |
| | | .descClass > .el-input__inner { |
| | | width: 57vw |
| | | } |
| | | </style> |