| | |
| | | data: [] |
| | | }, |
| | | exportArr:{}, |
| | | exportArrTwo:{}, |
| | | ids:"" |
| | | }; |
| | | }, |
| | |
| | | //表头数据 用来渲染穿梭框 |
| | | tableHeadData: { |
| | | handler(newval, oldval) { |
| | | console.log(newval) |
| | | if (newval) { |
| | | // 清空data数组 |
| | | this.data = []; |
| | |
| | | key: index, |
| | | }); |
| | | }); |
| | | console.log(this.data) |
| | | // excel表格数据转换 |
| | | this.option.column[0].children = newval.map(obj => { |
| | | return { |
| | |
| | | codeClassifyOid:{ |
| | | handler(newval,oldval){ |
| | | } |
| | | }, |
| | | value:{ |
| | | handler(newval,oldval){ |
| | | console.log('value',newval) |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | this.$emit('update:visible', false); |
| | | }, |
| | | handleExcel(){ |
| | | if(this.value <= 0){ |
| | | this.$message.warning('请选择属性') |
| | | }else { |
| | | this.value.map(index => this.tableHeadData[index].prop).forEach((item, index) => { |
| | | this.exportArr[`attrIdIndexMap[${index}]`] = item |
| | | }) |
| | | if(this.radio === 0){ |
| | | if(this.selectRow.length<=0){ |
| | | this.ids=this.tableData.map(item => item.oid).join(',') |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{ |
| | | this.$message.warning('请选择要导出的模板') |
| | | }else { |
| | | //已选择多选 |
| | | const selectList=[] |
| | | //已选择属性 |
| | | let exportArr={} |
| | | this.ids = this.selectRow.map(item => item.oid).join(',') |
| | | this.selectRow.forEach(item=>{ |
| | | selectList.push( |
| | | item.oid |
| | | ) |
| | | }) |
| | | if(this.value <= 0){ |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArrTwo,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | }else { |
| | | |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }else if(this.radio === 1){ |
| | | if(this.value <= 0){ |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | |
| | | } |
| | | }) |
| | | }else { |
| | | //已选择多选 |
| | | const selectList=[] |
| | | //已选择属性 |
| | | let exportArr={} |
| | | const ids = this.selectRow.map(item => item.oid).join(',') |
| | | this.selectRow.forEach(item=>{ |
| | | selectList.push( |
| | | item.oid |
| | | ) |
| | | }) |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{ |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }else if(this.radio === 1){ |
| | | this.ids=this.tableData.map(item => item.oid).join(',') |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | }else if(this.radio === 2){ |
| | | const input = this.pageExport.trim(); |
| | | let start, end; |
| | |
| | | return; |
| | | } |
| | | } |
| | | exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }); |
| | | if(this.value >=1 ){ |
| | | exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }); |
| | | }else { |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:this.limit,page: start, endPage: end}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }, |
| | | } |
| | | } |