From 2e117fe7bbe994e501bb0b677e94ece6ccdb62ab Mon Sep 17 00:00:00 2001 From: weidy <lastanimals@163.com> Date: 星期二, 20 六月 2023 17:07:03 +0800 Subject: [PATCH] 关闭驼峰命名转下划线 --- Source/UBCS-WEB/src/components/Crud/Crud.vue | 182 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 137 insertions(+), 45 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Crud/Crud.vue b/Source/UBCS-WEB/src/components/Crud/Crud.vue index 49edc24..c0be479 100644 --- a/Source/UBCS-WEB/src/components/Crud/Crud.vue +++ b/Source/UBCS-WEB/src/components/Crud/Crud.vue @@ -6,11 +6,10 @@ <FormTemplateDialog :visible.sync="addvisible" :type="add" - :templateOid="this.templateOids" - :codeClassifyOid="this.codeClassifyOids" + :templateOid="this.templateOid" + :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" - :rowOid="rowOid" > </FormTemplateDialog></el-button> <el-button size="small" type="primary" plain @click="editvisible=true">缂栬緫 @@ -18,7 +17,7 @@ :visible.sync="editvisible" :type="edit" :templateOid="this.templateOids" - :codeClassifyOid="this.codeClassifyOids" + :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" :rowOid="rowOid" @@ -32,8 +31,9 @@ <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="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> @@ -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:{ @@ -97,23 +103,39 @@ return {} } }, - templateOid:{ - type:String, - default:"" - }, codeClassifyOid:{ type:String, default:"" + }, + coderuleoid:{ + type:String, + default:"" + }, + tableDataArray:{ + type:Array, + default:[] + }, + total:{ + type:String, + default:"" + }, + tableHeadDataFateher:{ + type:Array, + default:[] } }, 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, @@ -135,32 +157,83 @@ }, tableData:[], tableHeadData:[], - items:{} + tableHeadDataFateher:[], + items:{}, + seniorQueryColumns:[] } }, computed:{ - }, created() { - this.CrudHeaderRend(); - this.CrudRend() + // this.CrudHeaderRend(); + // this.tableHeadHandle() + }, + mounted() { + }, activated() { this.doLayout() }, + watch:{ + codeClassifyOid:{ + handler(newval,oldval){ + this.codeClassifyOid=newval; + this.CrudHeaderRend() + }, + deep:true + }, + tableDataArray:{ + handler(newval,oldval){ + this.tableData=newval; + // + } + }, + total:{ + handler(newval,oldval){ + this.page.total=newval; + } + }, + tableHeadData:{ + handler(newval,oldval){ + this.tableHeadDataFateher=newval + } + } + }, methods: { + 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 + }, handleSizeChange(val){ 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) { @@ -176,40 +249,59 @@ 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() { - MasterTable({ - codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", - functionId: 5, - _: 1685067339479 - }).then(res => { - this.options=res.data.tableDefineVO.seniorQueryColumns - this.List = res.data.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; + if(this.codeClassifyOid != ""){ + MasterTable({ + codeClassifyOid:this.codeClassifyOid, + functionId: 5, + }).then(res => { + this.options=res.data.tableDefineVO.seniorQueryColumns + this.List = res.data.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; + this.templateOid=res.data.tableDefineVO.oid + this.$emit('templateOid',this.templateOid) + console.log(this.templateOid) + }) }) - }) + } }, //琛ㄦ牸鏁版嵁 CrudRend() { - TableData({ - templateOid: this.templateOid, - codeClassifyOid: this.codeClassifyOid, - page: this.page.currentPage, - limit:this.page.pageSize, - }).then(res => { - this.page.total = res.data.total; - this.data = res.data.data; - this.tableData=res.data.data; - }) + TableData({ + templateOid: this.templateOid, + codeClassifyOid: this.codeClassifyOid, + page: this.page.currentPage, + limit: this.page.pageSize, + }).then(res => { + this.page.total = res.data.total; + this.data = res.data.data; + this.tableData=res.data.data; + }) }, // 鎺掑簭 sortChange(val) { -- Gitblit v1.9.3