| | |
| | | return {} |
| | | } |
| | | }, |
| | | templateOid:{ |
| | | type:String, |
| | | default:"" |
| | | }, |
| | | codeClassifyOid:{ |
| | | type:String, |
| | | default:"" |
| | | }, |
| | | coderuleoid:{ |
| | | type:String, |
| | | default:"" |
| | | }, |
| | | tableDataArray:{ |
| | | type:Array, |
| | | default:[] |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | templateOid:"", |
| | | addvisible:false, |
| | | editvisible:false, |
| | | findvisible:false, |
| | |
| | | }, |
| | | tableData:[], |
| | | tableHeadData:[], |
| | | items:{} |
| | | items:{}, |
| | | aaa:"" |
| | | } |
| | | }, |
| | | computed:{ |
| | | |
| | | }, |
| | | created() { |
| | | this.CrudHeaderRend(); |
| | | this.CrudRend() |
| | | this.$emit('tableData',this.tableData) |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | activated() { |
| | | this.doLayout() |
| | | }, |
| | | watch:{ |
| | | codeClassifyOid:{ |
| | | handler(newval,oldval){ |
| | | this.codeClassifyOid=newval; |
| | | this.CrudHeaderRend() |
| | | }, |
| | | deep:true |
| | | }, |
| | | tableDataArray:{ |
| | | handler(newval,oldval){ |
| | | this.tableData=newval; |
| | | this.CrudRend() |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | rend(){ |
| | | this.tableData=this.tableHeadData |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.page.pageSize=val |
| | | this.$emit('pageSize',val) |
| | | this.CrudRend() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.page.currentPage=val |
| | | this.$emit('currentPage',val) |
| | | this.CrudRend() |
| | | }, |
| | | // 监听单元格点击事件并存储正在编辑的行 |
| | |
| | | }, |
| | | //表格头渲染 |
| | | 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) |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | //表格数据 |
| | | 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) { |