rsbi 4 년 전
부모
커밋
a24e4bc003
5개의 변경된 파일123개의 추가작업 그리고 20개의 파일을 삭제
  1. 6 2
      src/view/NoFind.vue
  2. 1 1
      src/view/bireport/ReportChart.vue
  3. 8 12
      src/view/bireport/ReportDesign.vue
  4. 5 5
      src/view/bireport/ReportTable.vue
  5. 103 0
      src/view/bireport/TableDetailLink.vue

+ 6 - 2
src/view/NoFind.vue

@@ -1,6 +1,8 @@
 <template>
   	<div class="fillcontain">
-		404 not find
+		<h3>404 页面不存在</h3>
+		<button class="btn btn-sm btn-primary" @click="goback()">返回首页</button>
+
   	</div>
 </template>
 
@@ -18,7 +20,9 @@
 		computed: {
 		},
 		methods: {
-			
+			goback(){
+				this.$router.push("/Welcome");
+			}
 		},
 		watch: {
 

+ 1 - 1
src/view/bireport/ReportChart.vue

@@ -598,7 +598,7 @@ span.charttip {
 }
 .chartctx {
 	border:1px solid #CACACA;
-	height:320px;
+	min-height:320px;
 	margin-left:170px;
 }
 span.charttxt {

+ 8 - 12
src/view/bireport/ReportDesign.vue

@@ -164,7 +164,8 @@
 					this.pageInfo.comps[0] = {"name":"表格组件","id":1, "type":"table"};
 					this.$refs['tableForm'].datas = null;
 					this.$refs['tableForm'].$forceUpdate();
-				}else if( this.pageInfo.showtype==="chart" || isall === true){ //清除图形
+				}
+				if( this.pageInfo.showtype==="chart" || isall === true){ //清除图形
 					this.pageInfo.comps[1] = {"name":"","id":2, "type":"chart",chartJson:{type:"line",params:[]},kpiJson:[]};
 					var echarts = require('echarts');
 					var myChart = echarts.getInstanceByDom(document.getElementById('chart2'));
@@ -253,20 +254,15 @@
 				$("#expff #json").val(JSON.stringify(info));
 				//把图形转换成图片
 				var strs = "";
-				if(tp == "pdf" || tp == "excel" || tp == "word"){
-					$("div.chartUStyle").each(function(index, element) {
-						var id = $(this).attr("id");
-						id = id.substring(1, id.length);
-						var chart = echarts.getInstanceByDom(document.getElementById(id));
+				if((tp == "pdf" || tp == "excel" || tp == "word") && comp.type ==='chart'){
+					var echarts = require('echarts');
+					var chart = echarts.getInstanceByDom(document.getElementById("chart2"));
+					if(chart){
 						var str = chart.getDataURL({type:'png', pixelRatio:1, backgroundColor: '#fff'});
 						str = str.split(",")[1]; //去除base64标记
-						str = $(this).attr("label") + "," + str; //加上label标记
+						str = comp.chartJson.label + "," + str; //加上label标记
 						strs = strs  +  str;
-						if(index != $("div.chartUStyle").size() - 1){
-							strs = strs + "@";
-						}
-						
-					});
+					}
 				}
 				$("#expff #picinfo").val(strs);
 				$("#expff").submit().remove();

+ 5 - 5
src/view/bireport/ReportTable.vue

@@ -6,7 +6,7 @@ import * as tools from '@/view/bireport/bireportUtils'
 import * as tableUtils from '@/view/bireport/tableUtils'
 import { Loading } from "element-ui";
 import reportTableDailog from '@/view/bireport/ReportTableDailog'
-
+import detailLink from '@/view/bireport/TableDetailLink'
 
 export default {
   name:"reportTable",
@@ -23,7 +23,7 @@ export default {
     },
   },
   components:{
-	reportTableDailog
+	reportTableDailog,detailLink
   },
   render(h){
 	  let tdborder = "1px solid #dee5e7";
@@ -35,7 +35,7 @@ export default {
 	  let tr = [h('tr', [trtd1, trtd2])];
 	  let tr2 = [h('tr', [tr2td1, tr2td2])];
 	  let table = h('table', {class:"d_table"}, [h('tbody', [tr, tr2])]);
-	  return h('div', {attrs:{tp:"table", class:"comp_table", id:"T"+this.tableId}}, [table, h('reportTableDailog',{ref:"tableDailog"}, '')]);
+	  return h('div', {attrs:{tp:"table", class:"comp_table", id:"T"+this.tableId}}, [table, h('reportTableDailog',{ref:"tableDailog"}, ''), h('detailLink', {ref:"detailLinkForm"})]);
   },
   mounted() {
 	  this.bindDropEvent(this.tableId);
@@ -190,8 +190,8 @@ export default {
 		   return [h("div", {attrs:{id:"d_kpi"}}, ret)];
 	   },
 	   linkDetail(dt){
-		   console.log(dt);
-		   alert(dt.value);
+		   let comp = tools.findCompById(this.tableId, this.pageInfo);
+		   this.$refs['detailLinkForm'].linkDetail(comp, dt.pms);
 	   },
 	 bindDropEvent(id){
 		var ischg = false;

+ 103 - 0
src/view/bireport/TableDetailLink.vue

@@ -0,0 +1,103 @@
+<!-- 表格明细数据提取 -->
+<template>
+  	<el-dialog fullscreen :append-to-body="true" title="明细数据提取" :visible.sync="show" :close-on-click-modal="false" custom-class="nopadding">
+			<div>
+				<button class="btn btn-sm btn-primary" @click="exportXls()">导出到Excel</button>
+				<button class="btn btn-sm btn-danger" @click="show=false">关闭</button>
+			</div>
+			<el-table :data="tableData" :height="height" border style="width: 100%" header-row-class-name="tableHeadbg">
+				<template v-for="(item, index) in cols">
+					<el-table-column :key="item.name" align="center" :prop="'c'+index" :label="item.name"></el-table-column>
+				</template>
+			</el-table>
+			<el-pagination
+				background
+				@size-change="handleSizeChange"
+				@current-change="handleCurrentChange"
+				:page-sizes="[10, 20, 50, 100]"
+				:current-page="page"
+				:page-size="rows"
+				layout="total, sizes, prev, pager, next, jumper"
+				:total="total">
+			</el-pagination>
+  </el-dialog>
+</template>
+
+<script>
+	import {ajax,baseUrl} from '@/common/biConfig'
+	import $ from 'jquery'
+
+	export default {
+	    data(){
+			return {
+				show :false,
+				cols:[],
+				tableData:[],
+				height:500,
+				total:null,
+				rows:20,
+				page:1,
+				header:[],
+				comp:null,
+				pms: null
+			}
+		},
+		mounted(){
+			this.height = $(window).height() - 150;
+		},
+		computed: {
+		},
+		methods: {	
+			linkDetail(comp, pms){
+				pms = eval("({" + pms + "})");
+				this.pms = pms;
+				this.comp = comp;
+				let ts = this;
+				this.show = true;
+				ajax({
+					type: "POST",
+					url: "bireport/header.action",
+					dataType:"JSON",
+					data: {dsetId:comp.dsetId,dsid:comp.dsid},
+					success: function(resp){
+						ts.cols = resp.rows;
+						ts.loadDatas(comp, pms);
+					}
+				}, this);
+			},
+			loadDatas(){
+				let ts = this;
+				let comp = this.comp;
+				let pms = this.pms;
+				var json = {pms:pms, dsetId:comp.dsetId,dsid:comp.dsid, page:ts.page, rows:ts.rows};
+				ajax({
+					type: "POST",
+					url: "bireport/detail.action",
+					data: JSON.stringify(json),
+					postJSON:true,
+					success: function(resp){
+						ts.tableData = resp.rows;
+						ts.total = resp.total;
+					}
+				},ts);
+			},
+			handleSizeChange(v){
+				this.rows = v;
+				this.loadDatas();
+			},
+			handleCurrentChange(v){
+				this.page = v;
+				this.loadDatas();
+			},
+			exportXls(){
+				location.href = baseUrl + 'bireport/exportDetail.action';
+			}
+		},
+		watch: {
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+
+</style>