From 859a64b36d107b147f44eccd0c0a76471c5e49ea Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期四, 15 六月 2023 18:20:39 +0800 Subject: [PATCH] 优化bug --- Source/UBCS-WEB/src/components/Crud/Crud.vue | 52 +++++++++++++++++++++++++++++++++------------------- 1 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Crud/Crud.vue b/Source/UBCS-WEB/src/components/Crud/Crud.vue index c0be479..2f90814 100644 --- a/Source/UBCS-WEB/src/components/Crud/Crud.vue +++ b/Source/UBCS-WEB/src/components/Crud/Crud.vue @@ -6,7 +6,7 @@ <FormTemplateDialog :visible.sync="addvisible" :type="add" - :templateOid="this.templateOid" + :templateOid="templateOid" :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" @@ -16,7 +16,7 @@ <FormTemplateDialog :visible.sync="editvisible" :type="edit" - :templateOid="this.templateOids" + :templateOid="templateOid" :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" @@ -30,20 +30,20 @@ <el-button size="small" type="primary" plain>鍒犻櫎</el-button> <el-button size="small" type="primary" plain>鍙戝竷</el-button> <el-button size="small" type="primary" plain>鏁版嵁鏇存敼</el-button> - <el-button size="small" type="primary" plain>鍥炴敹</el-button> + <el-button size="small" type="primary" plain @click="huishouHandler">鍥炴敹</el-button> <el-button size="small" type="primary" plain @click="openD">瀵煎嚭 <integration-transfer :visible.sync="dialogPush" :data="transferData" :props="transferProps" @save="handelTransferSave"></integration-transfer> </el-button> <el-button size="small" type="primary" plain @click="findvisible=true">鏌ヨ - <advancedQuery :visible.sync="findvisible" :options="this.options"></advancedQuery> + <advanced-query :visible.sync="findvisible" :options="this.options"></advanced-query> </el-button> <el-button size="small" type="primary" plain>鐩镐技椤规煡璇�</el-button> <el-button size="small" type="primary" plain style="margin-left: 1px;margin-top:10px">鍒锋柊</el-button> <el-input placeholder="璇疯緭鍏ュ叧閿瓧鎸夊洖杞︽煡璇�" style="width: 180px;margin-left: 5px;margin-top:10px" size="small"></el-input> </div> <el-row style="height: 700px;width: 100%"> - <el-table :data="tableData" style="" @cell-click="handleCellClick" max-height="700" @selection-change="handleSelectionChange" @sort-change="sortChange"> + <el-table :data="tableData" style="" @cell-click="handleCellClick" max-height="700" v-loading="isLoading" @selection-change="handleSelectionChange" @sort-change="sortChange"> <el-table-column type="selection" fixed @@ -113,15 +113,20 @@ }, tableDataArray:{ type:Array, - default:[] }, total:{ type:String, default:"" }, + templateOid:{ + type:String, + }, tableHeadDataFateher:{ type:Array, - default:[] + }, + isLoading:{ + type:Boolean, + default:false } }, data() { @@ -141,7 +146,6 @@ editingRow:null, editShow: "", editAttr:"", - loading: false, data: [], options:{}, option: { @@ -157,7 +161,6 @@ }, tableData:[], tableHeadData:[], - tableHeadDataFateher:[], items:{}, seniorQueryColumns:[] } @@ -193,13 +196,30 @@ this.page.total=newval; } }, - tableHeadData:{ + tableHeadDataFateher:{ handler(newval,oldval){ - this.tableHeadDataFateher=newval + let List=newval.tableDefineVO.cols[0]; + List.forEach(item=>{ + let columnItem = { + label: item.title, + prop: item.field, + type: this.columnType[item.type], + sortable: item.sort, + width: item.minWidth + }; + this.option.column.push(columnItem); + this.option.column=this.tableHeadData; + }) } } }, methods: { + huishouHandler(){ + console.log('tem',this.templateOid) + console.log('table',this.tableData) + console.log('tabheadle',this.tableHeadData) + console.log('tableFather',this.tableHeadDataFateher) + }, openD(){ this.dialogPush=true; this.getListCodeByClassId() @@ -219,25 +239,20 @@ this.page.pageSize=val this.$emit('pageSize',val) this.CrudRend() - console.log(this.tableData) }, handleCurrentChange(val){ this.page.currentPage=val this.$emit('currentPage',val) this.CrudRend() - console.log(val) - console.log(this.tableData) }, // 鐩戝惉鍗曞厓鏍肩偣鍑讳簨浠跺苟瀛樺偍姝e湪缂栬緫鐨勮 handleCellClick(row, column) { this.editingRow = row; this.editShow = column.property; - console.log(row) this.rowOid=row.oid }, //鍒犻櫎 enumDeleteRow(row) { - console.log(row) this.tableData.splice(row, 1) }, // 灏嗘鍦ㄧ紪杈戠殑琛岀殑鐘舵�佸彉涓� null 锛屽嵆閫�鍑虹紪杈戠姸鎬� @@ -285,7 +300,6 @@ this.option.column=this.tableHeadData; this.templateOid=res.data.tableDefineVO.oid this.$emit('templateOid',this.templateOid) - console.log(this.templateOid) }) }) } @@ -305,7 +319,7 @@ }, // 鎺掑簭 sortChange(val) { - this.loading = true; + this.isLoading = true; let order = "" if (val.order == "ascending") { order = "asc"; @@ -322,7 +336,7 @@ }).then(res => { setTimeout(() => { this.data = res.data.data; - this.loading = false; + this.isLoading = false; }, 100); }) }, -- Gitblit v1.9.3