From f6e7d70e650536e7cafa0da24922b2dda1902f06 Mon Sep 17 00:00:00 2001 From: lihang <lihang@vci-tech.com> Date: 星期五, 26 五月 2023 18:18:47 +0800 Subject: [PATCH] 元数据页面调整完善 --- Source/UBCS-WEB/src/views/modeling/Business.vue | 148 ++++++++++++++++++++++++++----------------------- 1 files changed, 78 insertions(+), 70 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue index 87d1d21..483d1b1 100644 --- a/Source/UBCS-WEB/src/views/modeling/Business.vue +++ b/Source/UBCS-WEB/src/views/modeling/Business.vue @@ -1,14 +1,14 @@ <template> <el-container> - <el-header> - <el-button type="primary" @click="businessAdd">鏂板</el-button> - <el-button type="primary" @click="businessEdit">淇敼</el-button> - <el-button type="primary" @click="selectFromTable">浠庡凡鏈変腑鑾峰彇</el-button> + <el-header class="businessHeader" style="height: 40px;"> + <el-button type="primary" @click="businessAdd" size="small">鏂板</el-button> + <el-button type="primary" @click="businessEdit" size="small">淇敼</el-button> + <el-button type="primary" @click="selectFromTable" size="small">浠庡凡鏈変腑鑾峰彇</el-button> </el-header> <el-container> <el-aside width="240px"> - <basic-container> - <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick"> + <basic-container class="businessTreeContainer"> + <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick" class="businessTree"> <span class="el-tree-node__label" slot-scope="{ node, data }"> <span> <i class="el-icon-star-on"></i> @@ -26,31 +26,33 @@ <el-descriptions class="margin-top" :column="3" :size="size" border> <el-descriptions-item> <template slot="label"> - <i :class="icons.key"></i> + <i class="el-icon-finished"></i> 鑻辨枃鍚嶇О </template> {{ obj.id }} </el-descriptions-item> <el-descriptions-item> <template slot="label"> - <i :class="icons.name"></i> + <i class="el-icon-info"></i> 涓枃鍚嶇О </template> {{ obj.name }} </el-descriptions-item> <el-descriptions-item> <template slot="label"> - <i :class="icons.tableName"></i> + <i class="el-icon-date"></i> 鏁版嵁搴撹〃鍚� </template> {{ obj.tableName }} </el-descriptions-item> <el-descriptions-item> <template slot="label"> - <i :class="icons.domain"></i> + <i class="el-icon-folder-opened"></i> 鎵�灞為鍩� </template> - {{ obj.domain }} + <el-tag size="small"> + {{ obj.domainText }} + </el-tag> </el-descriptions-item> <!-- <el-descriptions-item> <template slot="label"> @@ -68,24 +70,26 @@ </el-descriptions-item> --> <el-descriptions-item> <template slot="label"> - <i :class="icons.revisionRule"></i> + <i class="el-icon-s-check"></i> 鐗堟湰瑙勫垯 </template> {{ obj.versionRule }} </el-descriptions-item> <el-descriptions-item> <template slot="label"> - <i :class="icons.lifeCycle"></i> + <i class="el-icon-refresh-right"></i> 鐢熷懡鍛ㄦ湡 </template> {{ obj.lifeCycleId }} </el-descriptions-item> <el-descriptions-item> <template slot="label"> - <i :class="icons.view"></i> + <i class="el-icon-view"></i> 瑙嗗浘 </template> - {{ obj.viewFlag }} + <el-tag size="small"> + {{ obj.viewText }} + </el-tag> </el-descriptions-item> <!-- <el-descriptions-item> <template slot="label"> @@ -96,7 +100,7 @@ </el-descriptions-item> --> <el-descriptions-item> <template slot="label"> - <i :class="icons.desc"></i> + <i class="el-icon-chat-line-square"></i> 鎻忚堪 </template> {{ obj.description }} @@ -106,17 +110,28 @@ <!-- 灞炴�у垪琛�--> <basic-container> <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p> - <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption"></avue-crud> + <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption"> + <template slot="attrDataType" slot-scope="{row}" > + <el-tag>{{row.attrDataType}}</el-tag> + </template> + </avue-crud> </basic-container> </el-main> <el-dialog :visible="ref.visible" title="浠庢暟鎹簱涓坊鍔�" width="700px" append-to-body @close="dialoghandelfalse"> 閫夋嫨棰嗗煙锛� - <el-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad"> - <el-option v-for="item in domainOptions" :key="item" :label="item" :value="item"> + <el-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad" size="small"> + <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> + <div class="sep" style="height:7px"> + + </div> <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> @@ -160,8 +175,6 @@ border: true, height: 466, editBtn: false, - index: true, - rowKey:'oid', addBtn: false, menu: false, highlightCurrentRow: true, @@ -169,18 +182,19 @@ columnBtn:false, column: [ { - label: '灞炴�ц嫳鏂囧悕绉�', + label: '鑻辨枃鍚嶇О', prop: 'id', align: 'center' }, { - label: '灞炴�т腑鏂囧悕绉�', + label: '涓枃鍚嶇О', prop: 'name', align: 'center' }, { - label: "灞炴�х被鍨�", + label: "绫诲瀷", prop: "attrDataType", - align: 'center' + align: 'center', + slot: true }, { label: "榛樿鍊�", @@ -216,7 +230,7 @@ headerAlign: 'center', border: true, index: true, - rowKey: 'oid', + rowKey: 'id', tabs: true, addBtn: false, menu: false, @@ -248,46 +262,37 @@ this.initDomainOption(); }, methods: { - //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗗彇娑堢偣鍑讳簨浠� - dialoghandelfalse() { - this.packageLifeBox = false - }, - //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙‘瀹氱偣鍑讳簨浠� - dialoghandeltrue() { - this.packageLifeBox = false - }, - //閫夋嫨鐢熷懡鍛ㄦ湡瀵硅瘽妗� - handelLife() { - this.packageLifeBox = true - }, - //鐗堟湰瑙勫垯鎵嬪姩杈撳叆鍜岄�夋嫨妗嗙殑鐘舵�佸彇鍙� - handelRules() { - this.rulesFalg = !this.rulesFalg - }, - //鐗堟湰瑙勫垯涓変釜鎸夐挳鐨勬樉绀洪殣钘� - radioChange(val) { - if (val.value == 0) { - this.basicOption.group[1].column[1].display = false; - this.basicOption.group[1].column[2].display = false; - this.basicOption.group[1].column[3].display = false; - } else if (val.value == 1) { - this.basicOption.group[1].column[1].display = true; - this.basicOption.group[1].column[2].display = true; - this.basicOption.group[1].column[3].display = false; - } else if (val.value == 2) { - this.basicOption.group[1].column[1].display = true; - this.basicOption.group[1].column[2].display = true; - this.basicOption.group[1].column[3].display = true; - } - }, nodeClick(data) { - if(data.oid){ - getDetail(data.oid).then(res => { - this.obj = res.data.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() + }) }, selectFromTable() { + console.log('鑾峰彇'); this.ref.visible = true; }, refOnLoad(domain) { @@ -297,7 +302,6 @@ }, initTreeOnLoad() { initTree().then(res => { - console.log('123'); this.treeData = res.data.data; }); }, @@ -308,7 +312,6 @@ }, selectionChange(list) { this.selectionList = list; - console.log(this.selectionList); }, dialoghandelfalse() { this.ref.visible = false; @@ -324,13 +327,15 @@ }, businessAdd(){ this.$refs.btmAdd.showSubmitDialog = true; - this.$refs.btmAdd.refreshAttrTable(); - console.log('娣诲姞'); + this.ifRefreshBtmAddRefresh(); }, businessEdit(){ - this.addOption.btmType = this.obj; - this.$refs.addOption.showSubmitDialog = true; - console.log('缂栬緫'); + this.$refs.btmAdd.btmType = this.obj; + this.$refs.btmAdd.showSubmitDialog = true; + this.ifRefreshBtmAddRefresh(); + }, + ifRefreshBtmAddRefresh(){ + // this.$refs.btmAdd.refreshAttrTable(); } }, } @@ -348,4 +353,7 @@ .attributeCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ display: none !important; } +.businessTreeContainer > .el-card > .el-card__body { + height: 775px; +} </style> -- Gitblit v1.9.3