From 549ecbf13b14a4deb74e42828abcd46ccb68a7c0 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期二, 09 五月 2023 17:18:07 +0800 Subject: [PATCH] 前端代码提交 --- Source/UBCS-WEB/src/views/modeling/Business.vue | 621 ++++++++++++++++++++++++------------------------------- 1 files changed, 274 insertions(+), 347 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue index 260b626..3b4b64d 100644 --- a/Source/UBCS-WEB/src/views/modeling/Business.vue +++ b/Source/UBCS-WEB/src/views/modeling/Business.vue @@ -1,74 +1,141 @@ <template> - <el-container> - <el-aside width="240px"> - <basic-container> - <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick"> - </avue-tree> - </basic-container> - </el-aside> - <el-main> - <!-- 鍩烘湰淇℃伅--> - <basic-container> - <p style="margin-top: 10px;font-weight: 570;font-size: 19px">鍩烘湰淇℃伅</p> - <avue-crud - v-model="objs" - :data="basicData" - :option="basicOption" - @row-save="basicSave" - > - <!-- 鐗堟湰瑙勫垯--> - <template slot="rulesForm" slot-scope="{disabled,size}"> - <div> - <el-input v-if="rulesFalg==false" v-model="objs.tex" :size="size" placeholder="璇疯緭鍏ョ増鏈彿瑙勫垯" - style="width: 290px"></el-input> - <el-select v-if="rulesFalg" v-model="objs.select" placeholder="璇烽�夋嫨鐗堟湰鍙疯鍒�" style="max-width: 300px"> - <el-option label="娴嬭瘯1" value="1"></el-option> - <el-option label="娴嬭瘯2" value="2"></el-option> - <el-option label="娴嬭瘯3" value="3"></el-option> - </el-select> - <el-button style="margin-bottom: 5px;margin-left: 10px" type="primary" @click="handelRules"> - {{ rulesFalg == false ? "閫夋嫨鐗堟湰鍙疯鍒�" : "鎵嬪姩杈撳叆" }} - </el-button> - </div> - </template> - <!-- 鐢熷懡鍛ㄦ湡--> - <template slot="lifeCycleForm"> - <el-select v-model="objs.select" placeholder="璇烽�夋嫨鐢熷懡鍛ㄦ湡" style="max-width: 300px"> - <el-option label="娴嬭瘯1" value="1"></el-option> - <el-option label="娴嬭瘯2" value="2"></el-option> - <el-option label="娴嬭瘯3" value="3"></el-option> - </el-select> - <el-button style="margin-bottom: 5px;display: inline-block;margin-left: 10px" type="primary" - @click="handelLife">鐢熷懡鍛ㄦ湡鍒楄〃 - </el-button> - </template> - </avue-crud> - <el-dialog :visible.sync="packageLifeBox" - append-to-body - title="鏌ョ湅浣跨敤鑼冨洿" - width="1000px"> - <Businpackage></Businpackage> + <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> + <el-container> + <el-aside width="240px"> + <basic-container> + <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick"> + <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> + <template slot="label"> + <i class="el-icon-finished"></i> + 鑻辨枃鍚嶇О + </template> + {{ obj.id }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + <i class="el-icon-info"></i> + 涓枃鍚嶇О + </template> + {{ obj.name }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + <i class="el-icon-date"></i> + 鏁版嵁搴撹〃鍚� + </template> + {{ obj.tableName }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + <i class="el-icon-folder-opened"></i> + 鎵�灞為鍩� + </template> + {{ obj.domain }} + </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> + <template slot="label"> + <i class="el-icon-s-check"></i> + 鐗堟湰瑙勫垯 + </template> + {{ obj.versionRule }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + <i class="el-icon-refresh-right"></i> + 鐢熷懡鍛ㄦ湡 + </template> + {{ obj.lifeCycleId }} + </el-descriptions-item> + <el-descriptions-item> + <template slot="label"> + <i class="el-icon-view"></i> + 瑙嗗浘 + </template> + {{ obj.viewFlag }} + </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> + <template slot="label"> + <i class="el-icon-chat-line-square"></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 v-model="obj" :data="obj.attributes" :option="loadOption" @row-save="loadSave"></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-option> + </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> + </span> </el-dialog> - </basic-container> - <!-- 灞炴�у垪琛�--> - <basic-container> - <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p> - <avue-crud - v-model="obj" - :data="loadData" - :option="loadOption" - @row-save="loadSave" - ></avue-crud> - </basic-container> - </el-main> + </el-container> + </el-container> + <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions"> + </business-add> </el-container> </template> <script> +import { + initTree, + refOnLoad, + getDomain, + saveFromTable, + getDetail +} from "@/api/omd/btmType" export default { name: "Business", data() { @@ -78,282 +145,99 @@ //鐗堟湰瑙勫垯鐘舵�� rulesFalg: false, obj: {}, - treeData: [{ - value: 0, - label: '涓氬姟绫诲瀷鏍�', - children: [ - { - value: 1, - label: 'A', - }, - { - value: 2, - label: 'B', - }, - { - value: 3, - label: 'C', - }, - { - value: 4, - label: 'D', - }, - { - value: 5, - label: 'E', - } - ] - }], + selectionList: [], + treeData: [], treeOption: { defaultExpandAll: true, + title: '涓氬姟绫诲瀷鏍�', + props: { + labelText: '', + label: 'name', + value: 'oid', + children: 'childList', + } }, - loadData: [], - loadData1: [ - { - name: '寮犱笁', - business: '娴嬭瘯', - attrType: "娴嬭瘯", - default: "娴嬭瘯", - explain: "娴嬭瘯璇存槑" - }, - { - name: '鏉庡洓', - business: '娴嬭瘯', - attrType: "娴嬭瘯", - default: "娴嬭瘯", - explain: "娴嬭瘯璇存槑" - } - ], - loadData2: [ - { - name: '鐜嬩簲', - business: '娴嬭瘯', - attrType: "娴嬭瘯", - default: "娴嬭瘯", - explain: "娴嬭瘯璇存槑" - }, - { - name: '瀹嬪叚', - business: '娴嬭瘯', - attrType: "娴嬭瘯", - default: "娴嬭瘯", - explain: "娴嬭瘯璇存槑" - } - ], + addOption:{ + btmType:{}, + }, loadOption: { border: true, - height: 422, + height: 466, editBtn: false, + addBtn: false, + menu: false, + highlightCurrentRow: true, + refreshBtn:false, + columnBtn:false, column: [ { - label: '灞炴�у悕', - prop: 'name' - }, - { - label: '涓氬姟绫诲瀷', - prop: 'business' + label: '灞炴�ц嫳鏂囧悕绉�', + prop: 'id', + align: 'center' + }, { + label: '灞炴�т腑鏂囧悕绉�', + prop: 'name', + align: 'center' }, { label: "灞炴�х被鍨�", - prop: "attrType" + prop: "attrDataType", + align: 'center' }, { label: "榛樿鍊�", - prop: "default", + prop: "defaultValue", + align: 'center' }, { label: "璇存槑", - prop: "explain" + prop: "description", + align: 'center' } ] }, - //鍩烘湰淇℃伅 - objs: { - tex: "", - select: "", - lifeTex: "" - }, - basicData: [], - basicData1: [ - { - typeName: "娴嬭瘯1", - tag: "瀹㈡埛", - inherit: "娴嬭瘯", - implement: "娴嬭瘯", - lifeCycle: "鍛ㄦ湡", - desc: "杩欐槸涓�涓弿杩�" - } - ], - basicData2: [ - { - typeName: "娴嬭瘯2", - tag: "瀹㈡埛", - inherit: "娴嬭瘯", - implement: "娴嬭瘯", - lifeCycle: "鍛ㄦ湡", - desc: "杩欐槸涓�涓弿杩�" - } - ], - basicOption: { - border: true, - height: 88, - tabs: true, - column: [ - { - label: "绫诲瀷鍚嶇О", - prop: "typeName", - display: false - }, - { - label: "鏍囩", - prop: "tag", - display: false - }, - { - label: "缁ф壙鑷�", - prop: "inherit", - display: false - }, - { - label: "瀹炵幇绫�", - prop: "implement", - display: false - }, - { - label: "鎻忚堪", - prop: "desc", - display: false - } - ], - group: [ - { - label: "鍩烘湰淇℃伅", - column: [ - { - label: "绫诲瀷鍚嶇О", - prop: "typeName" - }, - { - label: "鏍囩", - prop: "tag" - }, - { - label: "缁ф壙鑷�", - prop: "inherit" - }, - { - label: "鏄惁瀹炰緥鍖�", - prop: "case", - type: "switch", - align: "center", - hide: true, - labelWidth: 90, - dicData: [ - { - label: "鍚�", - value: 0 - }, - { - label: "鏄�", - value: 1 - } - ], - }, - { - label: "鎻忚堪", - prop: "desc", - type: "textarea" - }, - { - label: "瀹炵幇绫�", - prop: "implement" - }, - - ] - }, - { - label: "鐗堟湰瑙勫垯", - column: [ - { - label: '鐗堟湰瑙勫垯', - prop: 'radio', - type: 'radio', - button: true, - change: this.radioChange, - value: 0, - dicData: [{ - label: '涓嶅彲淇', - value: 0 - }, { - label: '閲囩敤涓�绾х増鏈鐞�', - value: 1 - }, { - label: '閲囩敤浜岀骇鐗堟湰绠$悊', - value: 2 - }] - }, - { - label: "鐗堟湰鍙疯鍒�", - prop: "rules", - display: true, - formslot: true, - }, - { - label: "鍒嗛殧绗�", - prop: "interval", - type: "select", - display: true, - dicData: [ - { - label: ".", - value: 0 - }, - { - label: "-", - value: 1 - }, - { - label: " ", - value: 2 - } - ] - }, - { - label: '鐗堟鍙疯鍒�', - prop: 'radioRules', - type: 'radio', - display: true, - dicData: [{ - label: '1.2.3...', - value: 0 - }, { - label: 'a.b.c...', - value: 1 - }, { - label: '0.1.2...', - value: 2 - }] - }, - ] - }, - { - label: "鐢熷懡鍛ㄦ湡", - column: [ - { - label: "鐢熷懡鍛ㄦ湡", - prop: "lifeCycle" - } - ] - } - ] - }, - + domain: null, + domainOptions: [], + 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: [{ + tableName: '1', + description: '2' + }] + } } }, created() { - this.loadData = this.loadData1; - this.basicData = this.basicData1 - + this.initTreeOnLoad(); + this.initDomainOption(); }, methods: { //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗗彇娑堢偣鍑讳簨浠� @@ -389,40 +273,80 @@ } }, nodeClick(data) { - if (data.value == 1) { - this.loadData = this.loadData1; - this.basicData = this.basicData1 - } else if (data.value == 2) { - this.loadData = this.loadData2; - this.basicData = this.basicData2 - } - this.$message.success(JSON.stringify(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 => { + console.log('123'); + this.treeData = res.data.data; + }); + }, + initDomainOption() { + getDomain().then(res => { + this.domainOptions = res.data.data; + }) + }, + selectionChange(list) { + this.selectionList = list; + console.log(this.selectionList); + }, + 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; + console.log('娣诲姞'); + }, + businessEdit(){ + this.addOption.btmType = this.obj; + this.$refs.addOption.showSubmitDialog = true; + console.log('缂栬緫'); } }, -// 鍩烘湰淇℃伅娣诲姞 - 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() - }) - } } </script> @@ -432,4 +356,7 @@ border-radius: 10px; } +.businessCrud > .el-card > .el-card__body > .avue-crud_menu{ + display: none!important; + } </style> -- Gitblit v1.9.3