1048 lines
27 KiB
Vue
Executable File
1048 lines
27 KiB
Vue
Executable File
<template>
|
|
<view>
|
|
<!-- <div :style="styleObj1">
|
|
</div> -->
|
|
<!-- <table class='table'>
|
|
<tbody v-if="rowcounts>0">
|
|
<tr v-for="(row,i) in rowcounts" :key="i">
|
|
<template v-for="(column,j) in columncounts">
|
|
<th :key="j" :rowspan="getRowSpan(i,j)" :colspan="getColSpan(i,j)" v-if="getIsShow(i,j)">
|
|
|
|
</th>
|
|
</template>
|
|
</tr>
|
|
</tbody>
|
|
</table> -->
|
|
<!-- <table class='table'>
|
|
<tbody>
|
|
<tr>
|
|
<th rowspan='1' colspan='2'></th>
|
|
|
|
<th rowspan='1' colspan='1'></th>
|
|
|
|
</tr>
|
|
<tr>
|
|
<th rowspan='1' colspan='1'></th>
|
|
|
|
<th rowspan='1' colspan='2'></th>
|
|
</tr>
|
|
<tr>
|
|
<th rowspan='1' colspan='3'></th>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table> -->
|
|
<view :style="gridStyle">
|
|
<view v-for="(itemStyle,i) in itemStyleList" :key="i" :style="itemStyle">
|
|
<div v-if="itemStyle.fMappintType==1">
|
|
|
|
<view :style="itemStyle.contentStyle">
|
|
<canvas :canvas-id="itemStyle.fEntryID" id="canvasColumn" style="width:100%; height:100%" @touchstart="touchColumn"></canvas>
|
|
</view>
|
|
|
|
</div>
|
|
<div v-if="itemStyle.fMappintType==3">
|
|
|
|
<view :style="itemStyle.contentStyle">
|
|
<canvas :canvas-id="itemStyle.fEntryID" id="canvasLineA" style="width:100%; height:100%" @touchstart="touchLineA"></canvas>
|
|
</view>
|
|
|
|
</div>
|
|
<div v-if="itemStyle.fMappintType==8">
|
|
|
|
<view :style="itemStyle.contentStyle">
|
|
<canvas :canvas-id="itemStyle.fEntryID" id="canvasRing" style="width:100%; height:100%" @touchstart="touchRing"></canvas>
|
|
</view>
|
|
|
|
</div>
|
|
<div v-if="itemStyle.fMappintType==9">
|
|
<view :style="itemStyle.contentStyle">
|
|
<canvas :canvas-id="itemStyle.fEntryID" id="canvasPie" style="width:100%; height:100%" @touchstart="touchPie"></canvas>
|
|
</view>
|
|
</div>
|
|
<div v-if="itemStyle.fMappintType==20">
|
|
<!-- <view class="tab-view" :style="tabviewStyle">
|
|
<view class="tab-main" :style="tabmainStyle">
|
|
<view class="tab-tr">
|
|
|
|
|
|
<view class="tab-td" v-for="(itemTitle,i) in titleList" :key="i">
|
|
{{itemTitle}}
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
<view class="tab-tr" v-for="(rowitem,j) in listSourceData" :key="j">
|
|
|
|
<view class="tab-td" v-for="(itemCol,i) in rowitem" :key="i">
|
|
{{itemCol}}
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view> -->
|
|
<z-table :tableData='itemStyle.baseTableData' :columns='itemStyle.baseColumns' :style="itemStyle.contentStyle"></z-table>
|
|
</div>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import uCharts from '@/js_sdk/u-charts/u-charts/u-charts.js';
|
|
import zTable from '@/components/z-table/z-table.vue';
|
|
var _self;
|
|
var canvaColumn = null;
|
|
var canvaLineA=null;
|
|
var canvaPie = null;
|
|
var canvaRing=null;
|
|
export default {
|
|
data() {
|
|
return {
|
|
billNO :'',
|
|
baseTableData: [{
|
|
name: "张三",
|
|
age: 18,
|
|
gender: ''
|
|
},
|
|
{
|
|
name: "赵四",
|
|
age: 16,
|
|
gender: "女"
|
|
},
|
|
{
|
|
name: "王五",
|
|
age: 20,
|
|
gender: "男"
|
|
},
|
|
{
|
|
name: "李六",
|
|
age: 18,
|
|
gender: "女"
|
|
}
|
|
],
|
|
baseColumns: [{
|
|
title: "姓名",
|
|
key: "name",
|
|
width: 400
|
|
},
|
|
{
|
|
title: "性别",
|
|
key: "gender",
|
|
width: 400
|
|
},
|
|
{
|
|
title: "年龄",
|
|
key: "age",
|
|
width: 400
|
|
}
|
|
],
|
|
cWidth: '',
|
|
cHeight: '',
|
|
pixelRatio: 1,
|
|
serverData: '',
|
|
screenWidth: 0,
|
|
screenHeight: 0,
|
|
// unitWidth:0,
|
|
// unitHeight:0,
|
|
// rowcounts:0,
|
|
// columncounts: 0,
|
|
// styleObj1:{
|
|
|
|
// left:'0px',
|
|
// top:'0px',
|
|
// width:'100px',
|
|
// height:'100px'
|
|
// },
|
|
// styleObjList:[{
|
|
// left:'0px',
|
|
// top:'0px',
|
|
// width:'100px',
|
|
// height:'100px'},{
|
|
// left:'0px',
|
|
// top:'0px',
|
|
// width:'100px',
|
|
// height:'100px'},{
|
|
// left:'0px',
|
|
// top:'0px',
|
|
// width:'100px',
|
|
// height:'100px'}],
|
|
// videoBox:{
|
|
// width:800,
|
|
// height:500,
|
|
// left:0,
|
|
// top:0
|
|
// },
|
|
gridStyle: {
|
|
display: 'grid',
|
|
'grid-gap': '2px',
|
|
|
|
'grid-template-columns': 'repeat(3, 1fr)',
|
|
'grid-template-rows': 'repeat(3,150upx)'
|
|
},
|
|
canvasid:'canvasColumn',
|
|
tabviewStyle: {},
|
|
tabmainStyle: {},
|
|
itemStyleList: [
|
|
// {'text-align': 'center','background-color': '#d94a6a','grid-column-start': '1',
|
|
// 'grid-column-end': 3,
|
|
// 'grid-row-start': 1,
|
|
// 'grid-row-end': 3},
|
|
|
|
|
|
// {'text-align': 'center','background-color': '#d94a6a','grid-column-start': '3',
|
|
// 'grid-column-end': 4,
|
|
// 'grid-row-start': 1,
|
|
// 'grid-row-end': 3},
|
|
|
|
// {'text-align': 'center','background-color': '#d94a6a','grid-column-start': '1',
|
|
// 'grid-column-end': 4,
|
|
// 'grid-row-start': 3,
|
|
// 'grid-row-end': 4},
|
|
],
|
|
items: [
|
|
// {
|
|
// rowindex: 0,
|
|
// colindex: 0,
|
|
// isshow: true,
|
|
// colspan: 2,
|
|
// rowspan: 2
|
|
// },
|
|
// {
|
|
// rowindex: 0,
|
|
// colindex: 1,
|
|
// isshow: false,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// },
|
|
// {
|
|
// rowindex: 0,
|
|
// colindex: 2,
|
|
// isshow: true,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// },
|
|
// {
|
|
// rowindex: 1,
|
|
// colindex: 0,
|
|
// isshow: false,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// },
|
|
// {
|
|
// rowindex: 1,
|
|
// colindex: 1,
|
|
// isshow: false,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// },
|
|
// {
|
|
// rowindex: 1,
|
|
// colindex: 2,
|
|
// isshow: true,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// },
|
|
// {
|
|
// rowindex: 2,
|
|
// colindex: 0,
|
|
// isshow: true,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// },
|
|
// {
|
|
// rowindex: 2,
|
|
// colindex: 1,
|
|
// isshow: true,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// },
|
|
// {
|
|
// rowindex: 2,
|
|
// colindex: 2,
|
|
// isshow: true,
|
|
// colspan: 1,
|
|
// rowspan: 1
|
|
// }
|
|
],
|
|
titleList: [], //['字段一', '字段二', '字段三'],
|
|
listRowCounts: 0,
|
|
listSourceData: [
|
|
// {
|
|
// FSeq: 1,
|
|
// FWO: 'A0001',
|
|
// FQty: 200
|
|
// }, {
|
|
// FSeq: 2,
|
|
// FWO: 'A0002',
|
|
// FQty: 300
|
|
// }, {
|
|
// FSeq: 3,
|
|
// FWO: 'A0003',
|
|
// FQty: 400
|
|
// },
|
|
]
|
|
}
|
|
},
|
|
onLoad:function(option){
|
|
console.log("%%%%%%%%%%%%%%%%%%%%%%%%%%");
|
|
console.log(option.pageNumber);
|
|
this.billNO=option.pageNumber;
|
|
},
|
|
created() {
|
|
//this.init();
|
|
},
|
|
mounted() {
|
|
// document.addEventListener('webkitfullscreenchange', function() {
|
|
// var el = document.webkitFullscreenElement; //获取全屏元素
|
|
// if(el) {
|
|
// plus.screen.lockOrientation('landscape'); //锁死屏幕方向为横屏
|
|
// } else {
|
|
// plus.screen.unlockOrientation(); //解除屏幕方向的锁定
|
|
// }
|
|
// });
|
|
plus.screen.lockOrientation('landscape');
|
|
this.init(this);
|
|
console.log("12345");
|
|
},
|
|
destroyed() {
|
|
plus.screen.lockOrientation('portrait-primary');
|
|
},
|
|
methods: {
|
|
async init(_this) {
|
|
|
|
uni.getSystemInfo({
|
|
success(res) {
|
|
console.log(res.brand) //手机牌子
|
|
console.log(res.model) //手机型号
|
|
console.log(res.screenWidth) //屏幕宽度
|
|
console.log(res.screenHeight) //屏幕高度
|
|
this.screenWidth = res.screenWidth;
|
|
this.screenHeight = res.screenHeight;
|
|
this.unitWidth = this.screenWidth / 3;
|
|
this.unitHeight = this.screenHeight / 3;
|
|
|
|
_this.screenWidth = res.windowWidth;
|
|
_this.screenHeight = res.windowHeight;
|
|
|
|
console.log(this.unitWidth);
|
|
console.log(this.unitHeight);
|
|
console.log(this.screenWidth / 3 * 2);
|
|
// this.styleObj1.width=this.screenWidth/3*2 +'px';
|
|
// this.styleObj1.height.this.screenHeight/3*2 +'px';
|
|
// console.log(this.styleObj1.width);
|
|
// console.log(this.styleObj1.height);
|
|
// console.log(_this.styleObj1);
|
|
// _this.styleObj1.width = (this.screenWidth / 3 * 2) + 'px';
|
|
// _this.styleObj1.height = (this.screenHeight / 3 * 2) + 'px';
|
|
|
|
|
|
}
|
|
});
|
|
// console.log(this.screenWidth);
|
|
// console.log(this.screenHeight);
|
|
|
|
// console.log(this.screenWidth/3*2);
|
|
// console.log(this.screenHeight/3*2);
|
|
// this.styleObj1.width=(this.screenWidth/3*2) +'px';
|
|
// this.styleObj1.height=(this.screenHeight/3*2) +'px';
|
|
// console.log(this.styleObj1.width);
|
|
// console.log(this.styleObj1.height);
|
|
console.log("VVVVVVVVVVV");
|
|
console.log(this.screenHeight);
|
|
console.log(this.screenWidth);
|
|
|
|
await this.$request.post({
|
|
data: {
|
|
action: 'getLayout',
|
|
params: {
|
|
"wUserID": "OPSOFT",
|
|
"DBAias": "DEV_O3",
|
|
"FBillNO": this.billNO,//202003040001,"201912160001",202003050002,202003060001
|
|
"screenWidth": this.screenWidth,
|
|
"screenHeight": this.screenHeight
|
|
}
|
|
}
|
|
}).then(res => {
|
|
var resData = JSON.parse(res);
|
|
console.log("++++++++++++++");
|
|
console.log(resData);
|
|
|
|
this.gridStyle['display'] = resData.gridStyleInfo.display;
|
|
this.gridStyle['grid-gap'] = resData.gridStyleInfo.gridgap;
|
|
this.gridStyle['grid-template-columns'] = resData.gridStyleInfo.gridtemplatecolumns;
|
|
this.gridStyle['grid-template-rows'] = resData.gridStyleInfo.gridtemplaterows;
|
|
|
|
console.log(this.gridStyle);
|
|
|
|
|
|
|
|
for (let i = 0; i < resData.itemList.length; i++) {
|
|
|
|
let colulmnspan = resData.itemList[i]["gridcolumnend"] - resData.itemList[i]["gridcolumnstart"];
|
|
let rowsspan = resData.itemList[i]["gridrowend"] - resData.itemList[i]["gridrowstart"];
|
|
let columcount = resData.gridStyleInfo.colums;
|
|
let rowcount = resData.gridStyleInfo.rows;
|
|
|
|
console.log("<<><><><><><><><><><><>");
|
|
console.log(colulmnspan);
|
|
console.log(rowsspan);
|
|
console.log(columcount);
|
|
console.log(rowcount);
|
|
|
|
let contentwidth = (this.screenHeight / columcount * colulmnspan) + 'px';
|
|
let contentheight = (this.screenWidth / rowcount * rowsspan) + 'px';
|
|
console.log(contentwidth);
|
|
|
|
let ctwidth = (this.screenHeight / columcount * colulmnspan);
|
|
let ctheight = (this.screenWidth / rowcount * rowsspan);
|
|
|
|
this.itemStyleList.push({
|
|
'text-align': resData.itemList[i]["textalign"],
|
|
'background-color': resData.itemList[i]["backgroundcolor"],
|
|
'grid-column-start': resData.itemList[i]["gridcolumnstart"],
|
|
'grid-column-end': resData.itemList[i]["gridcolumnend"],
|
|
'grid-row-start': resData.itemList[i]["gridrowstart"],
|
|
'grid-row-end': resData.itemList[i]["gridrowend"],
|
|
'fMappintType': resData.itemList[i]["fMappintType"],
|
|
'dataSource': resData.itemList[i]["dataSource"],
|
|
'entry3Source': resData.itemList[i]["entry3Source"],
|
|
'contentwidth': ctwidth,
|
|
'contentheight': ctheight,
|
|
'fEntryID':resData.itemList[i]["fEntryID"],
|
|
'baseTableData':[],
|
|
'baseColumns':[],
|
|
'contentStyle': 'width:' + contentwidth + '; height:' + contentheight + ';background-color: #FFFFFF'
|
|
})
|
|
|
|
if (resData.itemList[i]["fMappintType"] == 20) {
|
|
this.tabviewStyle = {
|
|
'border-bottom': '2upx solid #F2F2F2',
|
|
'border-top': '2upx solid #F2F2F2',
|
|
'width': contentwidth,
|
|
'height': contentheight
|
|
};
|
|
this.tabmainStyle = {
|
|
'display': 'flex',
|
|
'width': contentwidth,
|
|
'height': contentheight,
|
|
'flex-direction': 'column',
|
|
'border-top': '2upx solid #E9E9E9',
|
|
'border-bottom': '1upx solid #E9E9E9',
|
|
'margin': '4upx 0upx'
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
console.log(this.itemStyleList);
|
|
// console.log(resData);
|
|
// this.rowcounts = resData[0].rowcounts;
|
|
// this.columncounts = resData[0].columncounts;
|
|
// //debugger;
|
|
// resData.map(val=>{
|
|
// this.items.push(val);
|
|
// });
|
|
// console.log(this.items);
|
|
|
|
});
|
|
_self = this;
|
|
this.cWidth = uni.upx2px(250);
|
|
this.cHeight = uni.upx2px(150);
|
|
console.log("KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK");
|
|
console.log(this.itemStyleList);
|
|
this.getServerData(this.itemStyleList);
|
|
},
|
|
getRowSpan(rowindex1, colindex1) {
|
|
let a;
|
|
this.items.map(val => {
|
|
if (val.rowindex == rowindex1 && val.colindex == colindex1) {
|
|
console.log(val.rowspan);
|
|
a = val.rowspan;
|
|
|
|
}
|
|
});
|
|
return a;
|
|
},
|
|
getColSpan(rowindex1, colindex1) {
|
|
let a;
|
|
this.items.map(val => {
|
|
if (val.rowindex == rowindex1 && val.colindex == colindex1) {
|
|
a = val.colspan;
|
|
}
|
|
});
|
|
return a;
|
|
},
|
|
getIsShow: function(rowindex1, colindex1) {
|
|
let a;
|
|
this.items.map(val => {
|
|
if (val.rowindex == rowindex1 && val.colindex == colindex1) {
|
|
console.log(val.isshow)
|
|
a = val.isshow;
|
|
}
|
|
});
|
|
return a;
|
|
},
|
|
getServerData(itemList) {
|
|
// uni.request({
|
|
// url: 'https://www.ucharts.cn/data.json',
|
|
// data:{
|
|
// },
|
|
// success: function(res) {
|
|
//console.log(res.data.data)
|
|
//下面这个根据需要保存后台数据,我是为了模拟更新柱状图,所以存下来了
|
|
//_self.serverData=res.data.data;
|
|
let Column = {
|
|
categories: [],
|
|
series: []
|
|
};
|
|
//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
|
|
let cateArray = [];
|
|
|
|
let serArray = [];
|
|
|
|
let qtyArray = [];
|
|
|
|
let qty1Array = [];
|
|
|
|
let columnconvascount=0;
|
|
for (let n = 0; n < itemList.length; n++) {
|
|
|
|
if (itemList[n]["fMappintType"] == 1) {
|
|
// let canvascountid=columnconvascount++;
|
|
// _self.canvasid='canvasColumn'+canvascountid;
|
|
let datasource = itemList[n]["dataSource"];
|
|
datasource = JSON.parse(datasource);
|
|
|
|
|
|
let entry3source = itemList[n]["entry3Source"];
|
|
entry3source = JSON.parse(entry3source);
|
|
|
|
|
|
let coltypeList = [];
|
|
|
|
for (let i = 0; i < datasource.length; i++) {
|
|
cateArray.push(datasource[i][entry3source[0]["FXCategory"]]);
|
|
}
|
|
|
|
let ser = [];
|
|
|
|
for (let i = 0; i < entry3source.length; i++) {
|
|
|
|
for (let j = 0; j < datasource.length; j++) {
|
|
|
|
qtyArray.push(datasource[j][entry3source[i]["FYValue"]]);
|
|
|
|
}
|
|
|
|
let seritem = {
|
|
name: entry3source[i]["FCaption"],
|
|
data: qtyArray
|
|
};
|
|
ser.push(seritem);
|
|
qtyArray = [];
|
|
}
|
|
|
|
|
|
// console.log(datasource);
|
|
// console.log(datasource.length);
|
|
// //debugger;
|
|
// for (let i = 0; i < datasource.length; i++) {
|
|
// cateArray.push(datasource[i]["FWO"]);
|
|
// qtyArray.push(datasource[i]["FQty"]);
|
|
// qty1Array.push(datasource[i]["FQty1"]);
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
Column.categories = cateArray;
|
|
Column.series = ser;
|
|
_self.showColumn(itemList[n]["fEntryID"], Column, itemList[n]["contentwidth"], itemList[n]["contentheight"]);
|
|
console.log(_self.canvasid);
|
|
|
|
cateArray=[];
|
|
|
|
}
|
|
|
|
if(itemList[n]["fMappintType"]==3){
|
|
let datasource = itemList[n]["dataSource"];
|
|
datasource = JSON.parse(datasource);
|
|
|
|
|
|
let entry3source = itemList[n]["entry3Source"];
|
|
entry3source = JSON.parse(entry3source);
|
|
|
|
for (let i = 0; i < datasource.length; i++) {
|
|
cateArray.push(datasource[i][entry3source[0]["FXCategory"]]);
|
|
}
|
|
|
|
let ser = [];
|
|
for (let i = 0; i < entry3source.length; i++) {
|
|
|
|
for (let j = 0; j < datasource.length; j++) {
|
|
|
|
qtyArray.push(datasource[j][entry3source[i]["FYValue"]]);
|
|
|
|
}
|
|
|
|
let seritem = {
|
|
name: entry3source[i]["FCaption"],
|
|
data: qtyArray
|
|
};
|
|
ser.push(seritem);
|
|
qtyArray = [];
|
|
}
|
|
|
|
let LineA={categories:[],series:[]};
|
|
//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
|
|
LineA.categories=cateArray;
|
|
LineA.series=ser;
|
|
_self.showLineA(itemList[n]["fEntryID"],LineA, itemList[n]["contentwidth"], itemList[n]["contentheight"]);
|
|
|
|
}
|
|
|
|
if(itemList[n]["fMappintType"]==8){
|
|
let Ring={series:[]};
|
|
|
|
let datasource = itemList[n]["dataSource"];
|
|
datasource = JSON.parse(datasource);
|
|
|
|
|
|
let entry3source = itemList[n]["entry3Source"];
|
|
entry3source = JSON.parse(entry3source);
|
|
|
|
let ringsourceArray = [];
|
|
for (let i = 0; i < datasource.length; i++) {
|
|
|
|
ringsourceArray.push({
|
|
name: datasource[i][entry3source[0]["FXCategory"]],
|
|
data: datasource[i][entry3source[0]["FYValue"]]
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
|
|
Ring.series=ringsourceArray;
|
|
_self.showRing(itemList[n]["fEntryID"],Ring, itemList[n]["contentwidth"], itemList[n]["contentheight"]);
|
|
}
|
|
|
|
if (itemList[n]["fMappintType"] == 9) {
|
|
let pieDataSource = itemList[n]["dataSource"];
|
|
pieDataSource = JSON.parse(pieDataSource);
|
|
|
|
let pieentry3source = itemList[n]["entry3Source"];
|
|
pieentry3source = JSON.parse(pieentry3source);
|
|
|
|
console.log("?????????????????????");
|
|
console.log(pieentry3source[0]);
|
|
|
|
let piesourceArray = [];
|
|
for (let i = 0; i < pieDataSource.length; i++) {
|
|
|
|
piesourceArray.push({
|
|
name: pieDataSource[i][pieentry3source[0]["FXCategory"]],
|
|
data: pieDataSource[i][pieentry3source[0]["FYValue"]]
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
let Pie = {
|
|
series: [{
|
|
"name": "一班",
|
|
"data": 50
|
|
}, {
|
|
"name": "二班",
|
|
"data": 30
|
|
}, {
|
|
"name": "三班",
|
|
"data": 20
|
|
}, {
|
|
"name": "四班",
|
|
"data": 18
|
|
}, {
|
|
"name": "五班",
|
|
"data": 8
|
|
}]
|
|
};
|
|
//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
|
|
Pie.series = piesourceArray;
|
|
_self.showPie(itemList[n]["fEntryID"], Pie, itemList[n]["contentwidth"], itemList[n]["contentheight"]);
|
|
}
|
|
|
|
if (itemList[n]["fMappintType"] == 20) {
|
|
console.log("TTTTTTTTTT");
|
|
let listDataSource = itemList[n]["dataSource"];
|
|
listDataSource = JSON.parse(listDataSource);
|
|
|
|
|
|
console.log(listDataSource[0]);
|
|
|
|
console.log(listDataSource);
|
|
|
|
let listsourceArray = [];
|
|
for (let i = 0; i < listDataSource.length; i++) {
|
|
|
|
listsourceArray.push(listDataSource[i]["FSeq"]);
|
|
listsourceArray.push(listDataSource[i]["FWO"]);
|
|
listsourceArray.push(listDataSource[i]["FQty"]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let listentry3source = itemList[n]["entry3Source"];
|
|
listentry3source = JSON.parse(listentry3source);
|
|
|
|
let temptitleList = [];
|
|
for (let i = 0; i < listentry3source.length; i++) {
|
|
|
|
temptitleList.push(listentry3source[i]["FCaption"]);
|
|
}
|
|
|
|
let tempwid=this.screenHeight/this.screenWidth*750/listentry3source.length;
|
|
console.log("&&&&&&");
|
|
console.log(tempwid)
|
|
|
|
|
|
let tempbaseColumns=[];
|
|
for (let i = 0; i < listentry3source.length; i++) {
|
|
var tempentry3data={title:listentry3source[i]["FCaption"],key:listentry3source[i]["FXCategory"],width:tempwid};
|
|
tempbaseColumns.push(tempentry3data);
|
|
}
|
|
|
|
|
|
this.titleList = temptitleList;
|
|
this.listRowCounts = listDataSource.length;
|
|
this.listSourceData = listDataSource;
|
|
|
|
|
|
itemList[n]["baseTableData"]=listDataSource;
|
|
itemList[n]["baseColumns"]=tempbaseColumns;
|
|
|
|
this.baseTableData=listDataSource;
|
|
this.baseColumns=tempbaseColumns;
|
|
}
|
|
|
|
}
|
|
columnconvascount=0;
|
|
|
|
this.itemStyleList=itemList;
|
|
//this.colList=listsourceArray;
|
|
|
|
// },
|
|
// fail: () => {
|
|
// _self.tips="网络错误,小程序端请检查合法域名";
|
|
// },
|
|
// });
|
|
},
|
|
showColumn(canvasId, chartData, ctwidth, ctheight) {
|
|
|
|
let contentwidth = ctwidth;
|
|
let contentheight = ctheight;
|
|
|
|
canvaColumn = new uCharts({
|
|
$this: _self,
|
|
canvasId: canvasId,
|
|
type: 'column',
|
|
legend: {
|
|
show: true
|
|
},
|
|
fontSize: 11,
|
|
background: '#FFFFFF',
|
|
pixelRatio: _self.pixelRatio,
|
|
animation: true,
|
|
categories: chartData.categories,
|
|
series: chartData.series,
|
|
xAxis: {
|
|
disableGrid: true,
|
|
},
|
|
yAxis: {
|
|
//disabled:true
|
|
},
|
|
dataLabel: true,
|
|
width: contentwidth, //_self.cWidth*_self.pixelRatio,
|
|
height: contentheight, //_self.cHeight*_self.pixelRatio,
|
|
extra: {
|
|
column: {
|
|
type: 'group',
|
|
width: 20 //_self.cWidth*_self.pixelRatio*0.45/chartData.categories.length
|
|
}
|
|
}
|
|
});
|
|
|
|
},
|
|
touchColumn(e) {
|
|
canvaColumn.showToolTip(e, {
|
|
format: function(item, category) {
|
|
if (typeof item.data === 'object') {
|
|
return category + ' ' + item.name + ':' + item.data.value
|
|
} else {
|
|
return category + ' ' + item.name + ':' + item.data
|
|
}
|
|
}
|
|
});
|
|
},
|
|
showLineA(canvasId,chartData, ctwidth, ctheight){
|
|
let contentwidth = ctwidth;
|
|
let contentheight = ctheight;
|
|
|
|
canvaLineA=new uCharts({
|
|
$this:_self,
|
|
canvasId: canvasId,
|
|
type: 'line',
|
|
fontSize:11,
|
|
legend:{show:true},
|
|
dataLabel:false,
|
|
dataPointShape:true,
|
|
background:'#FFFFFF',
|
|
pixelRatio:_self.pixelRatio,
|
|
categories: chartData.categories,
|
|
series: chartData.series,
|
|
animation: true,
|
|
xAxis: {
|
|
type:'grid',
|
|
gridColor:'#CCCCCC',
|
|
gridType:'dash',
|
|
dashLength:8
|
|
},
|
|
yAxis: {
|
|
gridType:'dash',
|
|
gridColor:'#CCCCCC',
|
|
dashLength:8,
|
|
splitNumber:5,
|
|
min:0,
|
|
max:150,
|
|
format:(val)=>{return val.toFixed(0)}
|
|
},
|
|
width: contentwidth,
|
|
height: contentheight,
|
|
extra: {
|
|
line:{
|
|
type: 'straight'
|
|
}
|
|
}
|
|
});
|
|
|
|
},
|
|
touchLineA(e) {
|
|
canvaLineA.showToolTip(e, {
|
|
format: function (item, category) {
|
|
return category + ' ' + item.name + ':' + item.data
|
|
}
|
|
});
|
|
},
|
|
|
|
showRing(canvasId,chartData, ctwidth, ctheight){
|
|
let contentwidth = ctwidth;
|
|
let contentheight = ctheight;
|
|
canvaRing=new uCharts({
|
|
$this:_self,
|
|
canvasId: canvasId,
|
|
type: 'ring',
|
|
fontSize:11,
|
|
legend:true,
|
|
title: {
|
|
name: '',
|
|
color: '#7cb5ec',
|
|
fontSize: 25*_self.pixelRatio,
|
|
offsetY:-20*_self.pixelRatio,
|
|
},
|
|
subtitle: {
|
|
name: '',
|
|
color: '#666666',
|
|
fontSize: 15*_self.pixelRatio,
|
|
offsetY:30*_self.pixelRatio,
|
|
},
|
|
extra: {
|
|
pie: {
|
|
offsetAngle: -15,
|
|
ringWidth: 15*_self.pixelRatio,
|
|
labelWidth:10
|
|
}
|
|
},
|
|
background:'#FFFFFF',
|
|
pixelRatio:_self.pixelRatio,
|
|
series: chartData.series,
|
|
animation: true,
|
|
width: contentwidth,
|
|
height: contentheight,
|
|
disablePieStroke: true,
|
|
dataLabel: true,
|
|
});
|
|
},
|
|
touchRing(e){
|
|
canvaRing.showToolTip(e, {
|
|
format: function (item) {
|
|
return item.name + ':' + item.data
|
|
}
|
|
});
|
|
},
|
|
showPie(canvasId, chartData, ctwidth, ctheight) {
|
|
let contentwidth = ctwidth;
|
|
let contentheight = ctheight;
|
|
canvaPie = new uCharts({
|
|
$this: _self,
|
|
canvasId: canvasId,
|
|
type: 'pie',
|
|
fontSize: 11,
|
|
legend: {
|
|
show: true
|
|
},
|
|
background: '#FFFFFF',
|
|
pixelRatio: _self.pixelRatio,
|
|
series: chartData.series,
|
|
animation: true,
|
|
width: contentwidth,
|
|
height: contentheight,
|
|
dataLabel: true,
|
|
extra: {
|
|
pie: {
|
|
lableWidth: 15
|
|
}
|
|
},
|
|
});
|
|
},
|
|
touchPie(e) {
|
|
canvaPie.showToolTip(e, {
|
|
format: function(item) {
|
|
return item.name + ':' + item.data
|
|
}
|
|
});
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang='less' scoped>
|
|
.table {
|
|
width: 90%;
|
|
height: 370upx;
|
|
border-collapse: collapse;
|
|
font-size: 12px;
|
|
color: #515a6e;
|
|
border: 1px solid #515a6e;
|
|
}
|
|
|
|
.table thead tr th {
|
|
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
background-color: #f8f8f9;
|
|
}
|
|
|
|
td,
|
|
th {
|
|
text-align: center;
|
|
border: 1px solid #e8eaec;
|
|
}
|
|
|
|
.table thead tr th,
|
|
.table tbody tr td {
|
|
padding: 0 10px;
|
|
}
|
|
|
|
.table tbody tr td {}
|
|
|
|
div {
|
|
position: absolute;
|
|
background-color: #f8f8f9;
|
|
border: 1px solid #e8eaec;
|
|
}
|
|
|
|
.grid {
|
|
/* padding: 1%; */
|
|
display: grid;
|
|
grid-gap: 1px;
|
|
|
|
grid-template-columns: repeat(3, 1fr);
|
|
grid-template-rows: repeat(3, 200px);
|
|
}
|
|
|
|
.item1 {
|
|
grid-column-start: 1;
|
|
grid-column-end: 3;
|
|
grid-row-start: 1;
|
|
grid-row-end: 3;
|
|
}
|
|
|
|
.item {
|
|
text-align: center;
|
|
background-color: #d94a6a;
|
|
}
|
|
|
|
.item1 {
|
|
text-align: center;
|
|
/* line-height: 300px; */
|
|
background-color: #1aa034;
|
|
}
|
|
|
|
.qiun-charts {
|
|
width: 500upx;
|
|
height: 294upx;
|
|
background-color: #FFFFFF;
|
|
}
|
|
|
|
.charts {
|
|
width: 500upx;
|
|
height: 294upx;
|
|
background-color: #FFFFFF;
|
|
}
|
|
|
|
/* .tab-view {
|
|
border-bottom: 2upx solid #F2F2F2;
|
|
border-top: 2upx solid #F2F2F2;
|
|
width: 1600rpx;
|
|
} */
|
|
|
|
/* .tab-main {
|
|
display: flex;
|
|
width: 1300upx;
|
|
flex-direction: column;
|
|
border-top: 2upx solid #E9E9E9;
|
|
border-bottom: 1upx solid #E9E9E9;
|
|
margin: 4upx 0upx;
|
|
} */
|
|
|
|
.tab-main view {
|
|
display: flex;
|
|
flex-direction: row;
|
|
}
|
|
|
|
.tab-td {
|
|
display: flex;
|
|
flex: 1;
|
|
justify-content: center;
|
|
align-items: center;
|
|
color: #404040;
|
|
line-height: 70upx;
|
|
font-size: 25upx;
|
|
}
|
|
|
|
.tab-tr:nth-child(even) {
|
|
background-color: #E9E9E9;
|
|
color: #404040;
|
|
}
|
|
|
|
.tab-tr:nth-child(odd) {
|
|
background-color: #FFFFFF;
|
|
color: #555555;
|
|
}
|
|
|
|
.div001 {}
|
|
</style>
|