| | |
| | | <el-descriptions class="margin-top" :column="3" :size="size" border> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-finished"></i> |
| | | <i :class="icons.key"></i> |
| | | è±æåç§° |
| | | </template> |
| | | {{ obj.id }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-info"></i> |
| | | <i :class="icons.name"></i> |
| | | 䏿åç§° |
| | | </template> |
| | | {{ obj.name }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-date"></i> |
| | | <i :class="icons.tableName"></i> |
| | | æ°æ®åºè¡¨å |
| | | </template> |
| | | {{ obj.tableName }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-folder-opened"></i> |
| | | <i :class="icons.domain"></i> |
| | | æå±é¢å |
| | | </template> |
| | | {{ obj.domain }} |
| | |
| | | </el-descriptions-item> --> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-s-check"></i> |
| | | <i :class="icons.revisionRule"></i> |
| | | çæ¬è§å |
| | | </template> |
| | | {{ obj.versionRule }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-refresh-right"></i> |
| | | <i :class="icons.lifeCycle"></i> |
| | | çå½å¨æ |
| | | </template> |
| | | {{ obj.lifeCycleId }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-view"></i> |
| | | <i :class="icons.view"></i> |
| | | è§å¾ |
| | | </template> |
| | | {{ obj.viewFlag }} |
| | |
| | | </el-descriptions-item> --> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-chat-line-square"></i> |
| | | <i :class="icons.desc"></i> |
| | | æè¿° |
| | | </template> |
| | | {{ obj.description }} |
| | |
| | | <!-- 屿§å表--> |
| | | <basic-container> |
| | | <p style="margin-top: 10px;font-weight: 570;font-size: 19px">屿§å表</p> |
| | | <avue-crud v-model="obj" :data="obj.attributes" :option="loadOption" @row-save="loadSave"></avue-crud> |
| | | <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption"></avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-dialog :visible="ref.visible" title="仿°æ®åºä¸æ·»å " width="700px" append-to-body @close="dialoghandelfalse"> |
| | |
| | | </el-select> |
| | | <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" @selection-change="selectionChange"> |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialoghandelfalse">å æ¶</el-button> |
| | | <el-button type="primary" @click="dialoghandeltrue">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </el-container> |
| | | </el-container> |
| | | <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions"> |
| | | <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" @refreshTable="initTreeOnLoad"> |
| | | </business-add> |
| | | </el-container> |
| | | </template> |
| | |
| | | border: true, |
| | | height: 466, |
| | | editBtn: false, |
| | | index: true, |
| | | rowKey:'oid', |
| | | addBtn: false, |
| | | menu: false, |
| | | highlightCurrentRow: true, |
| | |
| | | }, |
| | | domain: null, |
| | | domainOptions: [], |
| | | icons:{ |
| | | key: 'el-icon-finished', |
| | | name: 'el-icon-info', |
| | | tableName: 'el-icon-date', |
| | | domain: 'el-icon-folder-opened', |
| | | revisionRule: 'el-icon-s-check', |
| | | lifeCycle: 'el-icon-refresh-right', |
| | | view: 'el-icon-view', |
| | | desc: 'el-icon-chat-line-square' |
| | | }, |
| | | ref: { |
| | | // ä»è¡¨ä¸éæ©dialogç¶æ |
| | | visible: false, |
| | |
| | | headerAlign: 'center', |
| | | border: true, |
| | | index: true, |
| | | rowKey: 'id', |
| | | rowKey: 'oid', |
| | | tabs: true, |
| | | addBtn: false, |
| | | menu: false, |
| | |
| | | } |
| | | }, |
| | | nodeClick(data) { |
| | | getDetail(data.oid).then(res => { |
| | | this.obj = res.data.data; |
| | | }) |
| | | }, |
| | | // åºæ¬ä¿¡æ¯æ·»å |
| | | basicSave(row, done, loading) { |
| | | add(Object.assign({ |
| | | createUser: this.userInfo.name |
| | | }, row)).then(() => { |
| | | this.$message.success('æ°å¢æå') |
| | | done(); |
| | | this.getList(); |
| | | }).catch(() => { |
| | | loading() |
| | | }) |
| | | }, |
| | | //屿§æ·»å |
| | | loadSave(row, done, loading) { |
| | | add(Object.assign({ |
| | | createUser: this.userInfo.name |
| | | }, row)).then(() => { |
| | | this.$message.success('æ°å¢æå') |
| | | done(); |
| | | this.getList(); |
| | | }).catch(() => { |
| | | loading() |
| | | }) |
| | | if(data.oid){ |
| | | getDetail(data.oid).then(res => { |
| | | this.obj = res.data.data; |
| | | }) |
| | | } |
| | | }, |
| | | selectFromTable() { |
| | | console.log('è·å'); |
| | | this.ref.visible = true; |
| | | }, |
| | | refOnLoad(domain) { |
| | |
| | | }, |
| | | businessAdd(){ |
| | | this.$refs.btmAdd.showSubmitDialog = true; |
| | | this.$refs.btmAdd.refreshAttrTable(); |
| | | console.log('æ·»å '); |
| | | }, |
| | | businessEdit(){ |
| | |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | .businessCrud > .el-card > .el-card__body > .avue-crud_menu{ |
| | | display: none!important; |
| | | .businessCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ |
| | | display: none !important; |
| | | } |
| | | |
| | | .attributeCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ |
| | | display: none !important; |
| | | } |
| | | </style> |
| | |
| | | :visible.sync="showSubmitDialog" |
| | | append-to-body |
| | | @close="closeSubmitDialog" |
| | | width="70%" |
| | | width="74%" |
| | | > |
| | | <el-form ref="form" :model="btmType" show-message="true" inline> |
| | | <el-form-item label="è±æåç§°:" label-width="100px"> |
| | | <el-input v-model="btmType.id" prefix-icon="el-icon-finished"></el-input> |
| | | <el-input v-model="btmType.id" :prefix-icon="icons.key"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="䏿åç§°:" label-width="100px"> |
| | | <el-input v-model="btmType.name" prefix-icon="el-icon-info"></el-input> |
| | | <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ°æ®åºè¡¨å:" label-width="100px"> |
| | | <el-input v-model="btmType.tableName" prefix-icon="el-icon-date"></el-input> |
| | | <el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æå±é¢å:" label-width="100px"> |
| | | <el-select v-model="btmType.domain" prefix-icon="el-icon-folder-opened"> |
| | | <el-select v-model="btmType.domain" :prefix-icon="icons.domain"> |
| | | <el-option v-for="item in domainOption" |
| | | :label="item"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="çæ¬è§å:" label-width="100px"> |
| | | <el-input v-model="btmType.revisionRuleId" prefix-icon="el-icon-s-check"></el-input> |
| | | <el-input v-model="btmType.revisionRuleId" :prefix-icon="icons.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-input v-model="btmType.lifeCycleId" prefix-icon="el-icon-refresh-right"></el-input> |
| | | <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="el-icon-view"></el-input> |
| | | <el-input v-model="btmType.view" :prefix-icon="icons.view"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°:" label-width="100px"> |
| | | <el-input v-model="btmType.description" |
| | | prefix-icon="el-icon-chat-line-square" |
| | | style="width:254%;"></el-input> |
| | | :prefix-icon="icons.desc" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <avue-crud :option="option" :data="btmType.attributes"></avue-crud> |
| | | <avue-crud :option="option" :data="btmType.attributes" :page.sync="page" ref="attrTable"> |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <el-button type="danger" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | @click="rowAdd()">屿§éæ©</el-button> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | <el-button @click="submitBtmType">ç¡®å®</el-button> |
| | | <el-button @click="cancleSubmitBtmType">åæ¶</el-button> |
| | | |
| | | |
| | | <el-dialog title="屿§æ± " |
| | | :visible="attrRef.visible" |
| | | append-to-body |
| | | @close="closeAttrDialog" |
| | | width="80%" |
| | | > |
| | | <avue-crud class="attrRef" |
| | | :option="attrRef.option" |
| | | :data="attrRef.data" |
| | | :page.sync="attrRef.page" |
| | | ref="attrRef" |
| | | @on-load="attrRefOnLoad" |
| | | @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> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import { } from '@/api/omd/btmType'; |
| | | import { } from '@/api/omd/OmdAttribute'; |
| | | |
| | | import { } from '@/api/omd/btmType'; |
| | | import { getPage } from '@/api/omd/OmdAttribute'; |
| | | export default { |
| | | name: 'BusinessAdd', |
| | | props: { |
| | |
| | | }, |
| | | domainOption:{ |
| | | type: Array |
| | | }, |
| | | icons: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | showSubmitDialog : false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize:10 |
| | | }, |
| | | option: { |
| | | height: "330px", |
| | | selection: true, |
| | | headerAlign: 'center', |
| | | border: true, |
| | | index: true, |
| | | rowKey: 'id', |
| | | rowKey: 'oid', |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn:false, |
| | | tabs: true, |
| | | menu: false, |
| | | highlightCurrentRow: true, |
| | |
| | | { |
| | | label: '屿§è±æåç§°', |
| | | prop: 'id', |
| | | align: 'center' |
| | | align: 'left' |
| | | }, { |
| | | label: '屿§ä¸æåç§°', |
| | | prop: 'name', |
| | |
| | | }, |
| | | { |
| | | label: "屿§ç±»å", |
| | | prop: "attrDataType", |
| | | prop: "typeValue", |
| | | align: 'center', |
| | | slot: true |
| | | }, |
| | | { |
| | | label: "é»è®¤å¼", |
| | | prop: "defaultValue", |
| | | cell: 'true', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: "说æ", |
| | | prop: "description", |
| | | cell: 'true', |
| | | align: 'center' |
| | | } |
| | | ] |
| | | }, |
| | | attrRef:{ |
| | | visible:false, |
| | | page: { |
| | | currentPage:1, |
| | | pageSize:10, |
| | | key:'' |
| | | }, |
| | | option:{ |
| | | height: 360, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | border: true, |
| | | column: [ |
| | | { |
| | | label: '屿§è±æåç§°', |
| | | prop: 'key', |
| | | align: 'left', |
| | | width: 230 |
| | | }, { |
| | | label: '屿§ä¸æåç§°', |
| | | prop: 'label', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: "屿§ç±»å", |
| | | prop: "typeValue", |
| | | align: 'center' |
| | | }, |
| | | { |
| | |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: 'å
许为空', |
| | | prop: 'nullable', |
| | | type: 'switch', |
| | | display: false, |
| | | hide: true, |
| | | labelWidth: 132, |
| | | dicData: [{ |
| | | label: 'å¦', |
| | | value: 1 |
| | | }, { |
| | | label: 'æ¯', |
| | | value: 0 |
| | | }] |
| | | }, |
| | | { |
| | | label: "说æ", |
| | | prop: "description", |
| | | align: 'center' |
| | | } |
| | | ] |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | queryNotIn: [] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | console.log('123'); |
| | | |
| | | }, |
| | | methods: { |
| | | closeSubmitDialog(){ |
| | | this.showSubmitDialog = false; |
| | | this.btmType = {}; |
| | | }, |
| | | 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 => { |
| | | const data = res.data.data; |
| | | this.attrRef.page.total = data.total; |
| | | this.attrRef.data = data.records; |
| | | }) |
| | | }, |
| | | selectionChange(list){ |
| | | this.attrRef.selectData = list; |
| | | }, |
| | | confirmSelectAttr(){ |
| | | this.btmType.attributes = []; |
| | | this.attrRef.selectData.forEach(item => { |
| | | this.btmType.attributes.push({ |
| | | id: item.key, |
| | | name: item.label, |
| | | typeValue: item.typeValue, |
| | | defaultValue: item.defaultValue, |
| | | description: item.description |
| | | }); |
| | | this.attrRef.queryNotIn.push(item.key); |
| | | }); |
| | | this.closeAttrDialog(); |
| | | }, |
| | | cancleSelectAttr(){ |
| | | this.attrRef.selectData = []; |
| | | this.closeAttrDialog(); |
| | | }, |
| | | submitBtmType(){ |
| | | // æ·»å 宿ï¼åè°ç¶ç»ä»¶çå·æ° |
| | | console.log(this.btmType); |
| | | this.$emit('refreshTable'); |
| | | }, |
| | | cancleSubmitBtmType(){ |
| | | this.btmType = {}; |
| | | this.btmType.attributes = []; |
| | | console.log(this.btmType); |
| | | }, |
| | | refreshAttrTable(){ |
| | | this.$refs.attrTable.refreshTable(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style></style> |
| | | <style> |
| | | /* 屿§æ± åç
§å表 */ |
| | | .attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ |
| | | display: none !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Description:ä¸å¡ç±»åå
³è屿§ Feignæ¥å£ç±» |
| | | * |
| | | * @author LiHang |
| | | * @date 2023/5/10 |
| | | */ |
| | | @FeignClient( |
| | | value = AppConstant.APPLICATION_NAME_OMD, |
| | | fallback = IBtmAttributeFallback.class |
| | | ) |
| | | public interface IBtmAttributeClient { |
| | | |
| | | String API_PREFIX = "/client"; |
| | | String LIST_BY_BTM_OID = API_PREFIX + "/btm-attribute/list-by-btm-oid"; |
| | | |
| | | @GetMapping(LIST_BY_BTM_OID) |
| | | R<List<BtmTypeAttributeVO>> listByBtmOid(@RequestParam("oid") String oid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Description:ä¸å¡ç±»åå
³è屿§Feign失败 |
| | | * |
| | | * @author LiHang |
| | | * @date 2023/5/10 |
| | | */ |
| | | @Component |
| | | public class IBtmAttributeFallback implements IBtmAttributeClient{ |
| | | |
| | | @Override |
| | | public R<List<BtmTypeAttributeVO>> listByBtmOid(String oid) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | import com.vci.ubcs.omd.service.IBtmTypeAttributeService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeAttributeWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Description: ä¸å¡ç±»åå
³è屿§æå¡Feignå®ç°ç±» |
| | | * |
| | | * @author LiHang |
| | | * @date 2023/5/10 |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class BtmAttributeClient implements IBtmAttributeClient{ |
| | | |
| | | private final IBtmTypeAttributeService btmTypeAttributeService; |
| | | |
| | | @GetMapping(LIST_BY_BTM_OID) |
| | | @Override |
| | | public R<List<BtmTypeAttributeVO>> listByBtmOid(String oid) { |
| | | return R.data(BtmTypeAttributeWrapper.build().listEntityVO( |
| | | btmTypeAttributeService.list(Wrappers.<BtmTypeAttribute>query().lambda().eq(BtmTypeAttribute::getPkBtmType,oid)) |
| | | )); |
| | | } |
| | | } |
| | |
| | | domainMap.forEach((k,v)-> { |
| | | if (domain.contains(k)){ |
| | | BtmTypeTreeVO parent = new BtmTypeTreeVO(); |
| | | parent.setOid(k); |
| | | parent.setName(k); |
| | | parent.setChildList(v.stream().map(s -> { |
| | | BtmTypeTreeVO child = new BtmTypeTreeVO(); |
| | |
| | | attribute.setReferToName(attr.getReferBtmTypeName()); |
| | | attribute.setTs(now); |
| | | attribute.setCreateTime(now); |
| | | attribute.setIsDeleted(0); |
| | | attribute.setCreateUser(AuthUtil.getUserId()); |
| | | idAttrMap.put(attribute.getKey(),attribute); |
| | | // å¨è¿éç»ä¸å¡ç±»åè®¾ç½®çæ¬æ§å¶ãçå½å¨ææ§å¶ãå¯çº§æ§å¶ç¸å
³çä¿¡æ¯ |