From 07ff3e5cb589618a58c2f1c8b58b9f1305342532 Mon Sep 17 00:00:00 2001 From: lihang <lihang@vci-tech.com> Date: 星期四, 08 六月 2023 15:04:05 +0800 Subject: [PATCH] 修改版本规则、元数据页面查看应用范围;修正页面点击编辑时,修改了源数据的问题; --- Source/UBCS-WEB/src/views/modeling/Business.vue | 442 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 348 insertions(+), 94 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue index a9ef549..807155a 100644 --- a/Source/UBCS-WEB/src/views/modeling/Business.vue +++ b/Source/UBCS-WEB/src/views/modeling/Business.vue @@ -1,111 +1,365 @@ <template> - <div> - <avue-form :model="form" :rules="rules"> - <avue-form-item label="濮撳悕" prop="name"> - <el-input v-model="form.name"></el-input> - </avue-form-item> - <avue-form-item label="瀛﹀巻" prop="education"> - <el-select v-model="form.education" placeholder="璇烽�夋嫨"> - <el-option label="鍗氬+" value="鍗氬+"></el-option> - <el-option label="纭曞+" value="纭曞+"></el-option> - <el-option label="鏈" value="鏈"></el-option> - <el-option label="澶т笓" value="澶т笓"></el-option> - <el-option label="涓笓" value="涓笓"></el-option> - </el-select> - </avue-form-item> - <avue-form-item label="宸ヤ綔缁忓巻"> - <table class="table"> - <thead> - <tr> - <th>鍏徃</th> - <th>鑱屼綅</th> - <th>璧锋鏃堕棿</th> - </tr> - </thead> - <tbody> - <tr v-for="(item, index) in form.workExperience" :key="index"> - <td> - <el-input v-model="item.company"></el-input> - </td> - <td> - <el-input v-model="item.position"></el-input> - </td> - <td> - <el-date-picker - v-model="item.dateRange" - range-separator="鑷�" - type="daterange" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡" - format="yyyy-MM-dd" - ></el-date-picker> - </td> - </tr> - </tbody> - </table> - </avue-form-item> - </avue-form> - </div> + <el-container> + <el-header class="businessHeader" style="height: 40px;"> + <el-button-group> + <el-button type="primary" @click="businessAdd" size="small"> <i class="el-icon-plus"></i> 鏂板</el-button> + <el-button type="primary" @click="businessEdit" size="small"><i class="el-icon-edit"></i> 淇敼</el-button> + <el-button type="primary" @click="selectFromTable" size="small"><i class="el-icon-thumb"></i> 浠庡凡鏈変腑鑾峰彇</el-button> + </el-button-group> + </el-header> + <el-container> + <el-aside width="240px"> + <basic-container class="businessTreeContainer"> + <p style="margin-top: 10px;font-weight: 570;font-size: 19px">{{ treeOption.title }}</p> + <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> + {{ (node || {}).label }} + </span> + </span> + </avue-tree> + </basic-container> + </el-aside> + <el-container> + <el-main> + <!--鍩烘湰淇℃伅--> + <basic-container> + <p style="margin-top: 10px;font-weight: 570;font-size: 19px">鍩烘湰淇℃伅</p> + <el-descriptions class="margin-top" :column="3" :size="size" border> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.key"></i> + 鑻辨枃鍚嶇О + </template> + {{ obj.id }} + </el-descriptions-item> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.name"></i> + 涓枃鍚嶇О + </template> + {{ obj.name }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label" :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <i :class="icons.tableName"></i> + 鏁版嵁搴撹〃鍚� + </template> + {{ obj.tableName }} + </el-descriptions-item> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.domain"></i> + 鎵�灞為鍩� + </template> + <el-tag size="small"> + {{ obj.domainText }} + </el-tag> + </el-descriptions-item> + <!-- <el-descriptions-item> + <template slot="label"> + <i class="el-icon-s-ticket"></i> + 鏍囩 + </template> + {{obj.hashtag}} + </el-descriptions-item> --> + <!-- <el-descriptions-item> + <template slot="label"> + <i class="el-icon-arrow-up"></i> + 缁ф壙鑷� + </template> + {{ obj.sss }} + </el-descriptions-item> --> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.revisionRule"></i> + 鐗堟湰瑙勫垯 + </template> + {{ obj.versionRule }} + </el-descriptions-item> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.lifeCycle"></i> + 鐢熷懡鍛ㄦ湡 + </template> + {{ obj.lifeCycleId }} + </el-descriptions-item> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.view"></i> + 瑙嗗浘 + </template> + <el-tag size="small"> + {{ obj.viewText }} + </el-tag> + </el-descriptions-item> + <!-- <el-descriptions-item> + <template slot="label"> + <i class="el-icon-arrow-down"></i> + 瀹炵幇绫� + </template> + {{ obj.implClass }} + </el-descriptions-item> --> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.desc"></i> + 鎻忚堪 + </template> + {{ obj.description }} + </el-descriptions-item> + </el-descriptions> + </basic-container> + <!-- 灞炴�у垪琛�--> + <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"> + <template slot="attrDataTypeText" slot-scope="{row}" > + <el-tag>{{row.attrDataTypeText}}</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" 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> + <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" @refreshTable="initTreeOnLoad"> + </business-add> + </el-container> </template> - <script> - - - +import { + initTree, + refOnLoad, + getDomain, + saveFromTable, + getDetail +} from "@/api/omd/btmType" export default { name: "Business", - - data(){ + data() { return { - form: { - name: "", - education: "", - workExperience: [ - { company: "", position: "", dateRange: [] }, - { company: "", position: "", dateRange: [] }, - ], + //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙姸鎬� + packageLifeBox: false, + //鐗堟湰瑙勫垯鐘舵�� + rulesFalg: false, + obj: {}, + selectionList: [], + treeData: [], + treeOption: { + defaultExpandAll: true, + title: '涓氬姟绫诲瀷鏍�', + addBtn: false, + props: { + labelText: '', + label: 'label', + value: 'oid', + children: 'childList', + } }, - rules: { - name: [{ required: true, message: "璇疯緭鍏ュ鍚�", trigger: "blur" }], - education: [{ required: true, message: "璇烽�夋嫨瀛﹀巻", trigger: "change" }], - "workExperience.0.company": [ - { required: true, message: "璇疯緭鍏ュ叕鍙稿悕绉�", trigger: "blur" }, - ], - "workExperience.0.position": [ - { required: true, message: "璇疯緭鍏ヨ亴浣嶅悕绉�", trigger: "blur" }, - ], - "workExperience.0.dateRange": [ - { required: true, message: "璇烽�夋嫨璧锋鏃堕棿", trigger: "change" }, - ], - "workExperience.1.company": [ - { required: true, message: "璇疯緭鍏ュ叕鍙稿悕绉�", trigger: "blur" }, - ], - "workExperience.1.position": [ - { required: true, message: "璇疯緭鍏ヨ亴浣嶅悕绉�", trigger: "blur" }, - ], - "workExperience.1.dateRange": [ - { required: true, message: "璇烽�夋嫨璧锋鏃堕棿", trigger: "change" }, - ], + addOption:{ + btmType:{}, }, + loadOption: { + border: true, + height: 466, + editBtn: false, + addBtn: false, + menu: false, + highlightCurrentRow: true, + refreshBtn:false, + columnBtn:false, + column: [ + { + label: '鑻辨枃鍚嶇О', + prop: 'id', + align: 'center' + }, { + label: '涓枃鍚嶇О', + prop: 'name', + align: 'center' + }, + { + label: "绫诲瀷", + prop: "attrDataTypeText", + align: 'center', + slot: true + }, + { + label: "榛樿鍊�", + prop: "defaultValue", + align: 'center' + }, + { + label: "璇存槑", + prop: "description", + align: 'center' + } + ] + }, + descriptionOption: { + labelStyle:'text-align:center;width:120px', + contentStyle: 'width:240px;text-align:center;word-break;break-all;' + }, + domain: null, + domainOptions: [], + icons:{ + key: 'el-icon-finished', + name: 'el-icon-tickets', + 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, + form: {}, + option: { + height: "550px", + selection: true, + headerAlign: 'center', + border: true, + index: true, + rowKey: 'id', + tabs: true, + addBtn: false, + menu: false, + highlightCurrentRow: true, + column: [ + { + label: '琛ㄥ悕', + prop: 'tableName', + align: 'center', + display: false + }, + { + label: '鎻忚堪', + prop: 'description', + align: 'center', + display: false + } + ] + }, + data: [], + } } - } + }, + created() { + this.initTreeOnLoad(); + this.initDomainOption(); + }, + methods: { + 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() + }) + }, + selectFromTable() { + console.log('鑾峰彇'); + this.ref.visible = true; + }, + refOnLoad(domain) { + refOnLoad(domain).then(res => { + this.ref.data = res.data.data; + }) + }, + initTreeOnLoad() { + initTree().then(res => { + this.treeData = res.data.data; + }); + }, + initDomainOption() { + getDomain().then(res => { + this.domainOptions = res.data.data; + }) + }, + selectionChange(list) { + this.selectionList = list; + }, + dialoghandelfalse() { + this.ref.visible = false; + this.selectionList = []; + this.domain = null; + }, + dialoghandeltrue() { + saveFromTable(this.selectionList, this.domain).then(res => { + this.$message.success('淇濆瓨鎴愬姛'); + this.dialoghandelfalse(); + this.initTreeOnLoad(); + }) + }, + businessAdd(){ + this.$refs.btmAdd.showSubmitDialog = true; + this.ifRefreshBtmAddRefresh(); + }, + businessEdit(){ + var json = JSON.stringify(this.obj); + this.$refs.btmAdd.btmType = JSON.parse(json); + this.$refs.btmAdd.showSubmitDialog = true; + this.ifRefreshBtmAddRefresh(); + }, + ifRefreshBtmAddRefresh(){ + // this.$refs.btmAdd.refreshAttrTable(); + } + }, } </script> -<style scoped> -.table { - width: 100%; - border-collapse: collapse; +<style lang="scss"> +#basic { + height: 770px; + border-radius: 10px; } -.table th, -.table td { - padding: 10px; - border: 1px solid #ccc; +.businessCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ + display: none !important; } - -.table th { - background-color: #f0f0f0; - font-weight: bold; +.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