From 5ed86f3c0d0e3ae76ed4498b421b48da95f6c6e5 Mon Sep 17 00:00:00 2001 From: fujunling <2984387807@qq.com> Date: 星期一, 19 六月 2023 10:18:54 +0800 Subject: [PATCH] 导入 --- Source/UBCS-WEB/src/components/Crud/Crud.vue | 123 +++++++++++++++++++++++++++++++++-------- 1 files changed, 99 insertions(+), 24 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Crud/Crud.vue b/Source/UBCS-WEB/src/components/Crud/Crud.vue index 6d66a84..7d7b595 100644 --- a/Source/UBCS-WEB/src/components/Crud/Crud.vue +++ b/Source/UBCS-WEB/src/components/Crud/Crud.vue @@ -6,19 +6,18 @@ <FormTemplateDialog :visible.sync="addvisible" :type="add" - :templateOid="this.templateOids" - :codeClassifyOid="this.codeClassifyOids" + :templateOid="templateOid" + :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" - :rowOid="rowOid" > </FormTemplateDialog></el-button> <el-button size="small" type="primary" plain @click="editvisible=true">缂栬緫 <FormTemplateDialog :visible.sync="editvisible" :type="edit" - :templateOid="this.templateOids" - :codeClassifyOid="this.codeClassifyOids" + :templateOid="templateOid" + :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" :rowOid="rowOid" @@ -31,19 +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>瀵煎嚭 - <transfer filter-placeholder="璇疯緭鍏ユ嫾闊冲叏鎷兼垨鑰呮嫾闊崇缉鍐�" ></transfer> + <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 @@ -88,7 +88,13 @@ </template> <script> import {MasterTable, TableData} from "@/api/GetItem"; +import {listCodeAttributeByClassId} from '@/api/integration/integration.js' +import integrationTransfer from '@/views/integration/integrationTransfer' +import pinyin from "js-pinyin"; export default { + components: { + integrationTransfer + }, name: "Crud.vue", props:{ page:{ @@ -107,26 +113,41 @@ }, tableDataArray:{ type:Array, - default:[] + }, + total:{ + type:String, + default:"" + }, + templateOid:{ + type:String, + }, + tableHeadDataFateher:{ + type:Array, + }, + isLoading:{ + type:Boolean, + default:false } }, data() { return { + transferData:[], + transferProps: { + key: 'oid', + label: 'name' + }, templateOid:"", addvisible:false, editvisible:false, findvisible:false, - templateOids: "78B8C7C5-A042-0B96-FE6D-65421451782A", - codeClassifyOids: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96", - codeRuleOid: "B95872A6-9CEA-D490-8F1B-9D26548CAF96", + dialogPush:false, rowOid: '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9', disabledProp: ["id"], editingRow:null, editShow: "", editAttr:"", - loading: false, data: [], - options:{}, + options:[], option: { column: [] }, @@ -141,14 +162,14 @@ tableData:[], tableHeadData:[], items:{}, - aaa:"" + seniorQueryColumns:[] } }, computed:{ }, created() { - this.CrudHeaderRend(); - this.$emit('tableData',this.tableData) + // this.CrudHeaderRend(); + // this.tableHeadHandle() }, mounted() { @@ -167,11 +188,50 @@ tableDataArray:{ handler(newval,oldval){ this.tableData=newval; - this.CrudRend() + // + } + }, + total:{ + handler(newval,oldval){ + this.page.total=newval; + } + }, + tableHeadDataFateher:{ + handler(newval,oldval){ + 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() + }, + async getListCodeByClassId() { + this.transferData = [] + const response = await listCodeAttributeByClassId({ codeClassifyId: this.codeClassifyOid }) + if (response.status === 200) { + const data = response.data.data + this.transferData = data + } + }, rend(){ this.tableData=this.tableHeadData }, @@ -189,10 +249,10 @@ handleCellClick(row, column) { this.editingRow = row; this.editShow = column.property; + this.rowOid=row.oid }, //鍒犻櫎 enumDeleteRow(row) { - console.log(row) this.tableData.splice(row, 1) }, // 灏嗘鍦ㄧ紪杈戠殑琛岀殑鐘舵�佸彉涓� null 锛屽嵆閫�鍑虹紪杈戠姸鎬� @@ -203,6 +263,21 @@ this.$nextTick(() => { this.$refs.crud.doLayout(); }); + }, + tableHeadHandle(){ + this.options=this.tableHeadDataFateher.tableDefineVO.seniorQueryColumns + this.List = this.tableHeadDataFateher.tableDefineVO.cols[0]; + this.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; + }) }, //琛ㄦ牸澶存覆鏌� CrudHeaderRend() { @@ -235,7 +310,7 @@ templateOid: this.templateOid, codeClassifyOid: this.codeClassifyOid, page: this.page.currentPage, - limit:this.page.pageSize, + limit: this.page.pageSize, }).then(res => { this.page.total = res.data.total; this.data = res.data.data; @@ -244,7 +319,7 @@ }, // 鎺掑簭 sortChange(val) { - this.loading = true; + this.isLoading = true; let order = "" if (val.order == "ascending") { order = "asc"; @@ -261,7 +336,7 @@ }).then(res => { setTimeout(() => { this.data = res.data.data; - this.loading = false; + this.isLoading = false; }, 100); }) }, -- Gitblit v1.9.3