From 4b9193e6ce1df7bae67b2a1ae006bc6989338545 Mon Sep 17 00:00:00 2001 From: yuxc <653031404@qq.com> Date: 星期二, 23 五月 2023 17:58:59 +0800 Subject: [PATCH] 克隆上传 --- Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue | 288 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 258 insertions(+), 30 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue index 5a75644..909692e 100644 --- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue +++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue @@ -6,45 +6,99 @@ @close="closeSubmitDialog" width="70%" > - <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-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-input v-model="btmType.name" prefix-icon="el-icon-info"></el-input> + <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-input v-model="btmType.tableName" prefix-icon="el-icon-date"></el-input> + <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-select v-model="btmType.domain" prefix-icon="el-icon-folder-opened"> + <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="el-icon-s-check"></el-input> + <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-input v-model="btmType.lifeCycleId" prefix-icon="el-icon-refresh-right"></el-input> + <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="el-icon-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="el-icon-chat-line-square" - style="width:254%;"></el-input> + :prefix-icon="icons.desc" + class="descClass" + ></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" + @cell-mouse-enter="cellEditClick" + @cell-mouse-leave="cellEditSave"> + <template slot-scope="scope" slot="menuLeft"> + <el-button type="danger" + icon="el-icon-plus" + size="small" + @click="rowAdd()">灞炴�ч�夋嫨</el-button> + </template> + + </avue-crud> + <div slot="footer" class="dialog-footer"> + <el-button @click="submitBtmType">纭畾</el-button> + <el-button @click="cancleSubmitBtmType">鍙栨秷</el-button> + </div> + + + <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" + @search-change="attrRefSearch" + @selection-change="selectionChange"> + <template slot="name" slot-scope="scope" > + <el-tag>{{scope}}</el-tag> + </template> + </avue-crud> + <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 { } from '@/api/omd/OmdAttribute'; + +import { add,update } from '@/api/omd/btmType'; +import { queryPage } from '@/api/omd/OmdAttribute'; export default { name: 'BusinessAdd', props: { @@ -52,6 +106,9 @@ type: Object }, domainOption:{ + type: Array + }, + icons: { type: Array } }, @@ -71,17 +128,69 @@ highlightCurrentRow: true, column: [ { - label: '灞炴�ц嫳鏂囧悕绉�', + label: '鑻辨枃鍚嶇О', prop: 'id', align: 'center' }, { - label: '灞炴�т腑鏂囧悕绉�', + label: '涓枃鍚嶇О', prop: 'name', - align: 'center' + align: 'center', + cell: true }, { - label: "灞炴�х被鍨�", + label: "绫诲瀷", prop: "attrDataType", + align: 'center', + slot: true + }, + { + label: "榛樿鍊�", + prop: "defaultValue", + cell: 'true', + align: 'center', + cell: true + }, + { + label: "璇存槑", + prop: "description", + cell: 'true', + align: 'center', + cell:true + } + ] + }, + attrRef:{ + visible:false, + page: { + currentPage:1, + pageSize:10, + }, + key: null, + option:{ + height: 360, + addBtn: false, + refreshBtn: false, + columnBtn: false, + selection: true, + menu: false, + border: true, + reserveSelection: true, + searchMenuSpan:8, + column: [ + { + label: '鑻辨枃鍚嶇О', + prop: 'key', + align: 'left', + search: true, + width: 230 + }, { + label: '涓枃鍚嶇О', + prop: 'label', + align: 'center', + }, + { + label: "绫诲瀷", + prop: "typeValue", align: 'center' }, { @@ -90,23 +199,142 @@ align: 'center' }, { + label: '鍏佽涓虹┖', + prop: 'nullable', + type: 'switch', + display: false, + hide: true, + labelWidth: 132, + dicData: [{ + label: '鍚�', + value: 1 + }, { + label: '鏄�', + value: 0 + }] + }, + { label: "璇存槑", prop: "description", + cell:true, align: 'center' } - ] - }, + ] + }, + data: [], + queryNotIn: null + } } }, created() { - console.log('123'); + }, 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.attrRefOnLoad(); + }, + attrRefOnLoad(){ + 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, + attributeLength: item.maxLength + }); + this.attrRef.queryNotIn += (item.key + ",") + }); + this.closeAttrDialog(); + }, + cancleSelectAttr(){ + this.attrRef.selectData = []; + this.closeAttrDialog(); + }, + submitBtmType(){ + console.log(this.btmType); + add(this.btmType,true).then(res => { + // 娣诲姞瀹屾垚锛屽洖璋冪埗缁勪欢鐨勫埛鏂� + this.$message.success('淇濆瓨鎴愬姛'); + this.cancleSubmitBtmType(); + this.$emit('refreshTable'); + }) + }, + cancleSubmitBtmType(){ + this.btmType = {}; + this.btmType.attributes = []; + this.showSubmitDialog = false; + }, + refreshAttrTable(){ + 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; } } } </script> -<style></style> \ No newline at end of file +<style> +/* 灞炴�ф睜鍙傜収鍒楄〃 */ +.attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ + display: none !important; +} + +.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> -- Gitblit v1.9.3