Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | export const TableData =(params)=>{ |
| | | return request({ |
| | | url: 'api/ubcs-code/ubcs-code//mdmEngineController/gridTableDataByClassifyOid', |
| | | url: 'api/ubcs-code/ubcs-code/mdmEngineController/gridTableDataByClassifyOid', |
| | | method: 'get', |
| | | params:{ |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | <template> |
| | | <basic-container style="height: 750px"> |
| | | <avue-crud ref="crud" :data="data" :option="option" style="height: 750px" @sort-change="sortChange"></avue-crud> |
| | | <basic-container> |
| | | <avue-crud ref="crud" |
| | | :data="data" |
| | | :option="option" |
| | | @sort-change="sortChange" |
| | | v-loading="loading" |
| | | :page="page" |
| | | @selection-change="selectionChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menu"> |
| | | <el-button type="text">文字按钮</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | name: "Crud.vue", |
| | | data(){ |
| | | return{ |
| | | data:[ |
| | | { |
| | | zhiliangbz:"111", |
| | | }, |
| | | { |
| | | xinghaoguige:"1121", |
| | | }, |
| | | ], |
| | | loading:false, |
| | | data:[], |
| | | option:{ |
| | | //默认高度, |
| | | align:'center', |
| | | menuAlign:'center', |
| | | addBtn:false, |
| | | editBtn:false, |
| | | selection:true, |
| | | selectionFixed:false, |
| | | index:true, |
| | | column:[] |
| | | }, |
| | | List:[], |
| | |
| | | combox: "select", |
| | | truefalse: "switch", |
| | | number: "number", |
| | | datetime: "datetime", |
| | | datetime:"datetime", |
| | | }, |
| | | page:{ |
| | | total: 0, |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | pageSizes: [10, 30, 50, 100, 200], |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.CrudHeaderRend(); |
| | | this.CrudRend() |
| | | this.CrudHeaderRend(); |
| | | this.CrudRend() |
| | | }, |
| | | activated() { |
| | | this.doLayout() |
| | |
| | | this.$refs.crud.doLayout(); |
| | | }); |
| | | }, |
| | | //表格头渲染 |
| | | CrudHeaderRend(){ |
| | | MasterTable({codeClassifyOid:"D9CF223F-317D-71EB-BD11-433A94CAD9F3",functionId: 5,_: 1685067339479}).then(res=>{ |
| | | this.List=res.data.tableDefineVO.cols[0]; |
| | | this.List.forEach(item=>{ |
| | | console.log(item) |
| | | let columnItem={ |
| | | label:item.title, |
| | | prop:item.field, |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | //表格数据 |
| | | CrudRend(){ |
| | | TableData({templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F", |
| | | codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", |
| | | page: 1, |
| | | limit: 9, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | _: 1685089123575 |
| | | }).then(res=>{ |
| | | console.log(res) |
| | | this.data=res.data.data |
| | | this.page.total=res.data.total; |
| | | this.data=res.data.data; |
| | | }) |
| | | }, |
| | | // 排序 |
| | | sortChange(val){ |
| | | console.log(val) |
| | | |
| | | // TableData( { |
| | | // templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F", |
| | | // codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", |
| | | // order:"desc", |
| | | // sort:val.prop |
| | | // }).then(res=>{ |
| | | // console.log(res.data.data) |
| | | // this.data=res.data.data |
| | | // }) |
| | | this.loading=true; |
| | | let order="" |
| | | if(val.order == "ascending"){ |
| | | order="asc"; |
| | | }else { |
| | | order="desc"; |
| | | } |
| | | TableData( { |
| | | templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F", |
| | | codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", |
| | | order:order, |
| | | sort:val.prop, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | }).then(res=>{ |
| | | setTimeout(() => { |
| | | this.data=res.data.data; |
| | | this.loading=false; |
| | | }, 100); |
| | | }) |
| | | }, |
| | | //分页刷新 |
| | | async onLoad(val){ |
| | | console.log(val) |
| | | await TableData({templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F", |
| | | codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", |
| | | page: val.currentPage, |
| | | limit: val.pageSize, |
| | | _: 1685089123575 |
| | | }).then(res=>{ |
| | | this.data=res.data.data; |
| | | }) |
| | | }, |
| | | //多选 |
| | | selectionChange(row){ |
| | | console.log(row) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | proxy: { |
| | | '/api': { |
| | | //本地服务接口地址 |
| | | <<<<<<< HEAD |
| | | // target: 'http://localhost:37000', |
| | | //target: 'http://192.168.3.7:37000', |
| | | target: 'http://dev.vci-tech.com:37000', |
| | | // target: 'http://192.168.1.51:37000/', |
| | | ======= |
| | | target: 'http://localhost:37000', |
| | | // target: 'http://192.168.3.7:37000', |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | | //target: 'http://192.168.1.51:37000/', |
| | | >>>>>>> 1a5351f560e5833cc10127f8188c627b54146478 |
| | | //远程演示服务地址,可用于直接启动项目 |
| | | // target: 'https://saber.bladex.vip/api', |
| | | ws: true, |