Commit 66735bd1 authored by 李翠鸿's avatar 李翠鸿

第二轮测试

parent 7c625929
......@@ -23,10 +23,11 @@
/*每个页面公共css */
page {
background-color: #f2f2f2;
font-family: PingFang TC;
font-family: 'PingFang TC';
/* padding:0 24rpx; */
}
// .uni-tabbar{
// box-shadow: 0px -8px 8px 0px rgba(220, 220, 220, 0.24);
......
......@@ -22,3 +22,65 @@
white-space: nowrap;
text-overflow: ellipsis;
}
@font-face {
font-family: "KaiTi";
src: url("fonts/KaiTi.ttf");
// font-weight: bold;
}
@font-face {
font-family: "PingFangSC";
src: url("fonts/PingFangMedium.ttf");
// font-weight: bold;
}
@font-face {
font-family: "SourceHanSansCN";
src: url("fonts/SourceHanSansCN-Medium.otf");
// font-weight: bold;
}
@font-face {
font-family:"FangSong";
src: url("fonts/FangSong.TTF");
// font-weight: bold;
}
@font-face {
font-family: "YouYuan";
src: url("fonts/YouYuan.TTF");
// font-weight: bold;
}
@font-face {
font-family: "FZShuTi";
src: url("fonts/FZShuTi.TTF");
// font-weight: bold;
}
@font-face {
font-family: "LiSu";
src: url("fonts/LiSu.TTF");
// font-weight: bold;
}
@font-face {
font-family: "FZYaoti";
src: url("fonts/FZYaoti.ttf");
// font-weight: bold;
}
@font-face {
font-family: "SimHei";
src: url("fonts/SimHei.TTF");
// font-weight: bold;
}
@font-face {
font-family: "Microsoft YaHei";
src: url("fonts/MicrosoftYaHei.ttf");
// font-weight: bold;
}
@font-face {
font-family: "SimSun";
src: url("fonts/SimSun.TTF");
// font-weight: bold;
}
......@@ -32,3 +32,34 @@ export const historyApiData = (startTime,date,variables,level,skipTime) => {
}
return getData
}
//统计数据源 startTime-开始时间,date-结束时间,variables-变量集合,level-时间层级,skipTime-是否分层,timeSetting-时间表类型
export const statisticApiData = (startTime,date,variables,level,skipTime,timeSetting) => {
let getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
"variables": variables,
"layoutSettings": level,
"skipTime":skipTime,
"sourceType": "Statistic",
"statisticsSettings": {
"shiftName": "AAA",
"valueMethod": "Origin",
"xAxisSetting": "Time",
"timeSetting":timeSetting,
"shiftsType": "All"
}
}
return getData
}
//8位hex颜色转rgba
export const getRgbaFun = (sHex,a) => {
export const getRgbaFun = (sHex, a) => {
// 十六进制颜色值的正则表达式
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/
/* 16进制颜色转为RGB格式 */
......@@ -63,6 +63,17 @@ export const colorRgba = (sHex, a) => {
}
}
//判断字符串是否是数字
export const isNumber = (val) => {
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
if (regPos.test(val) || regNeg.test(val)) {
return true;
} else {
return false;
}
}
export const unique = (arr) => {
var newArr = [];
for (var i = 0; i < arr.length; i++) {
......@@ -197,7 +208,7 @@ export const getTimeType = (str) => {
type = 'Quarter'
} else if (str == '年') {
type = 'Year'
}else if(str == '最新'){
} else if (str == '最新') {
type = 'Second'
}
return type
......@@ -264,9 +275,13 @@ export const heavyCount = (list) => {
return list2
}
export const getBoxShadow = (boxShadow) => {
let str = boxShadow.horizontal + ' ' + boxShadow.vertical + ' ' + boxShadow.size + ' ' + boxShadow.color + ' ' +
boxShadow.location
export const getBoxShadow = (boxShadow,location) => {
let str = boxShadow.horizontal + ' ' + boxShadow.vertical + ' ' + boxShadow.size + ' ' + boxShadow.color
if(location){
str = str + ' ' + location
}else{
str += boxShadow.location?' '+boxShadow.location:''
}
return str
}
......
......@@ -6,6 +6,7 @@ import interceptor from './js/interceptor.js'
import api from './request/api.js'
import uView from "uview-ui"
import MyTooltip from './pages/common/tooltip.vue'
import TipsPage from './pages/common/tips-page.vue'
// import VConsole from 'vconsole'
// const vConsole = new VConsole()
......@@ -18,6 +19,7 @@ Vue.prototype.$toast = $
App.mpType = 'app'
Vue.component("my-tooltip", MyTooltip);
Vue.component("tips-page", TipsPage);
const app = new Vue({
...App,
......
......@@ -940,7 +940,7 @@
var Runsymbol
var ArrValue
var resValueNumber = data[j].Value
resValue = data[j].Value.toLowerCase()
resValue = data[j].Value
ArrValue = TextAnimation.Compare == null ?
TextAnimation.Compare : TextAnimation.Compare.toLowerCase()
Runsymbol = TextAnimation.Condition
......@@ -1541,7 +1541,7 @@
var Runsymbol
var ArrValue
var resValueNumber = Value
resValue = Value.toLowerCase()
resValue = Value
ArrValue = textColorListArr.Compare == null ? textColorListArr.Compare : textColorListArr.Compare
.toLowerCase()
Runsymbol = textColorListArr.Condition
......
......@@ -630,12 +630,16 @@
var wantnum;
var end = {};
setTimeout(() => {
// console.log(this.cavantable)
for (let i = 0; i < this.cavantable.length; i++) {
this.page[i] = {
pageIndex: 0,
pageNum: [1]
}
var z = 0;
if(!this.cavantable[i].ParameterReportItemtList) break
if(!this.cavantable[i].ParameterReportItemtList.dd) break
if (parseInt(this.cavantable[i].ParameterReportItemtList.dd.startpoy)) {
z = parseInt(this.cavantable[i].ParameterReportItemtList.dd.startpoy)
} else {
......
......@@ -63,7 +63,7 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = item.componentConfig
item.layout = item.componentConfig.layout
this.styleConfigList.push(styleConfig)
......
......@@ -7,8 +7,10 @@
:style="';width:'+(100/Number(layout.column))+'%'">
<view @click="jumpView(item1,index1)"
:style="'background:'+item1.color+';min-height: 30px;margin:6px;text-align: center;border-radius: 4px;'"
style="display: flex;justify-content: center;align-items: center;line-height: 20px;padding: 5px;">
<view>{{item1.title}}</view>
style="display: flex;justify-content: center;align-items: center;line-height: 20px;padding: 5px;height: calc(100% - 22px)">
<view style="height: 100%;display: flex;justify-content: center;align-items: center;">
<view> {{item1.title}}</view>
</view>
</view>
</view>
</view>
......@@ -56,10 +58,12 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = item.componentConfig
this.layout = componentConfig.layout
this.cardListData = componentConfig.list
// this.cardListData = componentConfig.list
this.cardListData = JSON.parse(JSON.stringify(componentConfig.list))
this.getTextHeightFun() //获取列表高度
item.layout = item.componentConfig.layout
this.styleConfigList.push(styleConfig)
this.componentList.push(item)
......@@ -73,6 +77,20 @@
url: '/pages/data/jump-view/index?viewName=' + item.pageName + '&viewId=' + item.pageId
});
// console.log(JSON.stringify(item.pageId))
},
getTextHeightFun() {
let cardListData = this.cardListData
let _this = this
// async cardListData.forEach((item,index1) => {
// this.$nextTick(function(){
// await uni.createSelectorQuery().in(this).select('.cardListText'+_this.index+'-'+index1).boundingClientRect((data) => {
// console.log(data)
// }) .exec();
// })
// })
},
getHistoryExternalData() {}
......
......@@ -57,7 +57,7 @@
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
// let boxShadow = styleConfig.boxShadow
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = this.componentsData.componentConfig
this.imgName = componentConfig.imgName
this.styleConfigList.push(styleConfig)
......
......@@ -26,7 +26,8 @@
<view :style="componentsData.componentConfig.numericalFormat" style="margin-bottom: 8px;">
<text>{{item1.value != null?item1.value:'--'}}</text>
</view>
<view :style="componentsData.componentConfig.nameFormat" v-if="theme !== 'theme6'" class="text-style33">
<view :style="componentsData.componentConfig.nameFormat" v-if="theme !== 'theme6'"
class="text-style33">
<text>{{item1.name}}</text>
</view>
</view>
......@@ -55,7 +56,8 @@
getBoxShadow
} from '../../js/tool.js'
import {
historyApiData
historyApiData,
statisticApiData
} from '../../js/data.js'
export default {
name: 'Kpi',
......@@ -120,7 +122,7 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
this.numerical = this.componentsData.componentConfig.numerical
let componentConfig = item.componentConfig
componentConfig.nameFormat.textAlign = componentConfig.nameFormat.alignHorizontal
......@@ -160,10 +162,11 @@
//历史、统计、外部
async getHistoryExternalData() {
if (!this.componentConfig) return
if(this.variables.length <= 0) return //无选择变量不请求
if (this.variables.length <= 0) return //无选择变量不请求
let dataset = this.componentConfig.dataset
// let variables = []
let getData = null
let getData1 = null
if (dataset.dataType === this.$store.state.dataType[1]) { //历史数据
let filterConfig = this.componentsData.filterConfig
// let listData = filterConfig.list[0]
......@@ -177,8 +180,8 @@
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -186,50 +189,17 @@
}).catch(err => {
console.log(err)
})
if(content.substr(content.indexOf(",") + 1) == '最新'){
console.log(content.substr(content.indexOf(",") + 1))
getData = {
if (content.substr(content.indexOf(",") + 1) == '最新') {
// console.log(content.substr(content.indexOf(",") + 1))
getData1 = {
"variables": this.variables,
"sourceType": "Realy",
// "layoutSettings":true,
"skipTime":true,
"relaySettings": {
"timeType": "Now",
"valueMethod": "Origin",
"xAxisSetting": "Variable",
}
"sourceType": "History",
}
}else{
} else {
//历史请求参数
getData = historyApiData(startTime,date,this.variables,'Second',true)
// getData = {
// "filterControls": [{
// "value1": startTime,
// "controlType": "AssociateDateTimePicker",
// "pickerType": "BeginTime",
// "name": "a1"
// },
// {
// "value1": date,
// "controlType": "AssociateDateTimePicker",
// "pickerType": "EndTime",
// "name": "a2"
// }
// ],
// "variables": this.variables,
// "sourceType": "History",
// "layoutSettings": 'Second',
// "skipTime": true,
// "historySettings": {
// "timeType": "Recent",
// "valueMethod": "Origin",
// "xAxisSetting": "Time",
// // "recent": timeType.recent,
// // "timeSetting": timeType.timeSetting
// }
// }
getData = historyApiData(startTime, date, this.variables, 'Second', true)
}
......@@ -247,8 +217,8 @@
let timeType = getTimeType(content1.substr(content1.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -256,32 +226,45 @@
}).catch(err => {
console.log(err)
})
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content1.substr(content1.indexOf(",") + 1) == '最新') {
getData1 = {
"variables": this.variables,
"layoutSettings": "Second",
"skipTime": true,
"sourceType": "Statistic",
"statisticsSettings": {
"shiftName": "AAA",
"valueMethod": "Origin",
"xAxisSetting": "Time",
"timeSetting":"Hour",
"shiftsType": "All"
"timeSetting": "Hour",
}
}
} else {
getData = statisticApiData(startTime, date, this.variables, 'Second', true, 'Hour')
// getData = {
// "filterControls": [{
// "value1": startTime,
// "controlType": "AssociateDateTimePicker",
// "pickerType": "BeginTime",
// "name": "a1"
// },
// {
// "value1": date,
// "controlType": "AssociateDateTimePicker",
// "pickerType": "EndTime",
// "name": "a2"
// }
// ],
// "variables": this.variables,
// "layoutSettings": "Second",
// "skipTime": true,
// "sourceType": "Statistic",
// "statisticsSettings": {
// "shiftName": "AAA",
// "valueMethod": "Origin",
// "xAxisSetting": "Time",
// "timeSetting":"Hour",
// "shiftsType": "All"
// }
// }
}
} else if (dataset.dataType === this.$store.state.dataType[3]) { //外部数据
let filterConfig = this.componentsData.filterConfig
......@@ -289,15 +272,21 @@
if (this.tabContent) {
contentList = this.tabContent
}
let newDataType = 0
let newDataValue = null
// console.log(this.tabContent)
let filterControls = [] //过滤控件组合
let filterItems = []
for (let i = 0; i < contentList.length; i++) {
let item = contentList[i]
let content = item.content
if (item.type == '时间日期') {
if (item.type == '时间日期' && item.variable != '') {
let recent = Number(content.substr(0, content.indexOf(",")))
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
if (content.substr(content.indexOf(",") + 1) == '最新') {
newDataType += 1
newDataValue = item
}
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let startTime = date
await this.$api.getStartTime(date, recent, timeType).then(res => {
......@@ -310,7 +299,6 @@
"controlType": 'AssociateDateTimePicker',
"pickerType": "BeginTime",
"value1": startTime,
}
let filterData2 = {
"name": item.variable + '2_' + i,
......@@ -358,11 +346,27 @@
}
let dataSetId = dataset.externalDataId
// console.log(newDataType)
// JSON.stringify()
if (newDataType > 0) {
let variables = JSON.parse(JSON.stringify(this.variables))
variables.push({
"name": newDataValue.variable,
"layoutSettings": "Day"
})
getData1 = {
"variables": variables,
"sourceType": "External",
"externalSettings": {
"dataSetId": dataSetId
}
}
} else {
getData = {
"filterControls": filterControls,
"variables": this.variables,
"layoutSettings": "Second",
"skipTime": true,
"skipTime": false,
"sourceType": "External",
"externalSettings": {
"valueMethod": "Sum",
......@@ -371,12 +375,14 @@
"filterItems": filterItems
}
}
}
}
if (!getData) return
if (getData) {
this.$api.getQueryMulitySource(getData).then(res => {
let data = res.data
if (!data) return
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data)
} else if (dataset.dataType === this.$store.state.dataType[2]) {
......@@ -386,27 +392,61 @@
}
}).catch(err => {})
}
if (getData1) {
this.$api.getNewest(getData1).then(res => {
let data = res.data
// console.log(res.data)
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[2]) {
this.calculateStatisticData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data, 'newData')
}
})
}
},
//集合外部数据
calculateExternalData(data) {
calculateExternalData(data, type) {
if (this.numerical) {
this.variables1.forEach((item2, index) => {
this.$set(this.numerical[index], 'value', data[item2][0])
if (type == 'newData') {
// for(let key in data[0]){
// if(key == this.numerical[index].variable){
// this.$set(this.numerical[index], 'value', data[0][key])
// }
// }
this.$set(this.numerical[index], 'value', data[index][this.numerical[index].variable])
} else {
this.$set(this.numerical[index], 'value', data[item2][0])
}
})
}
},
//统计历史数据
calculateHistoryData(data) {
calculateHistoryData(data, type) {
if (this.numerical) {
if (type == 'newData') {
this.numerical.forEach((item, index) => {
if (data[index]) {
this.$set(this.numerical[index], 'value', data[index].Value)
}
})
} else {
this.variables1.forEach((item2, index) => {
this.$set(this.numerical[index], 'value', data[item2][0])
})
}
}
},
//聚合统计数据
calculateStatisticData(data) {
calculateStatisticData(data, type) {
let filterConfig = this.componentsData.filterConfig
let content = filterConfig.list[1].content
if (this.tabContent) {
......@@ -424,6 +464,11 @@
let item = this.numerical[index]
let dataList = []
let value = null
if (type == 'newData') {
value = data[index].Value
} else {
value = data[item2][0]
}
// if (contentList.length > 0 && timeType != "Hour" && timeType != "Second") {
// contentList.forEach((item1, index1) => {
// let refName = '$' + item2 + '@' + item1
......@@ -450,7 +495,7 @@
// }
// }
value = data[item2][0]
this.$set(this.numerical[index], 'value', value)
......
......@@ -7,7 +7,7 @@
</view>
<view style="height:300px !important;z-index: 2;">
<qiun-data-charts :echartsApp="true" :echartsH5="true" type="column" :chartData="chartData"
:eopts="option" />
:eopts="option"/>
</view>
</view>
</template>
......@@ -23,10 +23,12 @@
avgNumber,
getMaxOrMin,
getSameStrName,
getBoxShadow
getBoxShadow,
isNumber
} from '../../js/tool.js'
import {
historyApiData
historyApiData,
statisticApiData
} from '../../js/data.js'
export default {
name: 'LineBarChart',
......@@ -50,22 +52,22 @@
name: 'chartLineBar',
componentList: [], //组件列表
styleConfigList: [], //样式列表
chartData: {
categories: [],
series: []
chartData: { //图表数据
categories: [],//x轴数据
series: [] //x轴数据
},
localdata: [],
option: {},
numerical: [],
RealTimeDataList: [],
chartOption: {},
componentConfig: null,
variables: [],
variables1: [],
tabContent: null,
dimension: [],
decimal: 0,
yAxisIndex: 0
option: {},//图表样式设置
numerical: [],//配置变量列表
RealTimeDataList: [],//实时请求变量列表
chartOption: {},//图表配置数据
componentConfig: null,//组件配置
variables: [],//变量列表
variables1: [],//有重复变量列表
tabContent: null,//点击选项卡数据
dimension: [],//维度配置
decimal: 0,//小数点
yAxisIndex: 0//y轴位置
}
},
created() {
......@@ -73,12 +75,69 @@
this.getComponentList()
},
methods: {
//获取组件数据
getComponentList() {
if (!this.componentsData || this.componentsData == {}) return
// console.log(this.componentsData)
let item = this.componentsData
if (item.type !== this.name) return
let styleConfig = item.styleConfig
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = item.componentConfig
this.dimension = componentConfig.dimension
this.chartOption.title = componentConfig.chartTitle
this.numerical = componentConfig.numerical
this.RealTimeDataList = []
this.decimal = Number(componentConfig.numericalFormat.decimal)
this.numerical.forEach(item => {
this.RealTimeDataList.push(null)
})
this.componentConfig = componentConfig
this.variables = []
// if (this.numerical) {
// this.numerical.forEach(item => {
for (let i = 0; i < this.numerical.length; i++) {
let item1 = this.numerical[i]
// console.log(item1)
if (Number(item1.yAxis) > this.yAxisIndex) {
this.yAxisIndex = Number(item1.yAxis)
}
if (!item1.variable) break
this.variables.push({
"name": item1.variable,
"digit": this.decimal,
"valueMethod": getCalculateData(item1.statistical)
})
let num = getSameStrName(item1.variable, this.variables1)
if (this.dimension.length > 0 && item1.variable == this.dimension[0].variable) {
num += 1
}
if (num) {
this.variables1.push(item1.variable + '_' + num)
} else {
this.variables1.push(item1.variable)
}
}
// })
// }
item.layout = item.componentConfig.layout
this.styleConfigList.push(styleConfig)
this.componentList.push(item)
this.setOptionStyle()
},
//历史、统计、外部
async getHistoryExternalData() {
if (!this.componentConfig) return
if (this.variables.length <= 0) return //无选择变量不请求
let dataset = this.componentConfig.dataset
let getData = null
let getData1 = null
if (dataset.dataType === this.$store.state.dataType[1]) {
let filterConfig = this.componentsData.filterConfig
let dimension = this.componentConfig.dimension[0]
......@@ -96,8 +155,8 @@
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date1
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -106,33 +165,15 @@
console.log(err)
})
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
// console.log('startTime=>'+startTime)
// console.log('startTime=>'+date)
getData = historyApiData(startTime,date,this.variables,getTimeType(level),false)
// getData = {
// "filterControls": [{
// "value1": startTime,
// "controlType": "AssociateDateTimePicker",
// "pickerType": "BeginTime",
// "name": "a1"
// },
// {
// "value1": date,
// "controlType": "AssociateDateTimePicker",
// "pickerType": "EndTime",
// "name": "a2"
// }
// ],
// "variables": this.variables,
// "sourceType": "History",
// "layoutSettings": getTimeType(level),
// "skipTime": false,
// "historySettings": {
// "timeType": "Recent",
// "valueMethod": "Origin",
// "xAxisSetting": "Time",
// }
// }
if (content.substr(content.indexOf(",") + 1) == '最新') {
getData1 = {
"variables": this.variables,
"sourceType": "History",
"layoutSettings": getTimeType(level),
}
} else {
getData = historyApiData(startTime, date, this.variables, getTimeType(level), false)
}
} else if (dataset.dataType === this.$store.state.dataType[2]) {
let dimension = this.componentConfig.dimension[0]
......@@ -151,36 +192,25 @@
}).catch(err => {
console.log(err)
})
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content1.substr(content1.indexOf(",") + 1) == '最新') {
getData1 = {
"variables": this.variables,
"layoutSettings": getTimeType(level),
"skipTime": false,
"sourceType": "Statistic",
"layoutSettings": getTimeType(level),
"statisticsSettings": {
"shiftName": "AAA",
"valueMethod": "Origin",
"xAxisSetting": "Time",
"timeSetting": getTimeType(level),
"shiftsType": "All"
}
}
} else {
getData = statisticApiData(startTime, date, this.variables, getTimeType(level), false,
getTimeType(level))
}
} else if (dataset.dataType === this.$store.state.dataType[3]) {
let dimension = this.dimension
let variablesList = JSON.parse(JSON.stringify(this.variables))
let layoutSettings = "Second"
for (let i = 0; i < dimension.length; i++) {
let item = dimension[i]
if (!item.variable) break
......@@ -190,6 +220,7 @@
name: item.variable,
layoutSettings: getTimeType(item.level),
}
layoutSettings = getTimeType(item.level)
variablesList.unshift(tagData)
} else {
tagData = {
......@@ -206,11 +237,17 @@
}
let filterControls = [] //过滤控件组合
let filterItems = []
let newDataType = 0
let newDataValue = null
for (let i = 0; i < contentList.length; i++) {
let item = contentList[i]
let content = item.content
if (item.type == '时间日期') {
if (item.type == '时间日期' && item.variable != '') {
if (content.substr(content.indexOf(",") + 1) == '最新') {
newDataType += 1
newDataValue = item
}
let recent = Number(content.substr(0, content.indexOf(",")))
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
......@@ -273,6 +310,50 @@
}
let dataSetId = dataset.externalDataId
if (newDataType > 0) {
let variables = JSON.parse(JSON.stringify(this.variables))
let dataNum = 0
if (dimension.length > 0) {
dimension.forEach((item, index) => {
let tagData = null
if (item.variableType.indexOf('DateTime') > 1) {
tagData = {
name: item.variable,
layoutSettings: layoutSettings,
}
dataNum += 1
} else {
tagData = {
name: item.variable,
valueMethod: "Sum"
}
}
// variables.splice(index,0,tagData)
variables.push(tagData)
})
if (dataNum <= 0) {
variables.push({
"name": newDataValue.variable,
"layoutSettings": layoutSettings
})
}
} else {
variables.push({
"name": newDataValue.variable,
"layoutSettings": layoutSettings
})
}
getData1 = {
"variables": variables,
"sourceType": "External",
"layoutSettings": layoutSettings,
"externalSettings": {
"dataSetId": dataSetId
}
}
} else {
getData = {
"filterControls": filterControls,
"variables": variablesList,
......@@ -287,7 +368,8 @@
}
}
}
if (!getData) return
}
if (getData) {
this.$api.getQueryMulitySource(getData).then(res => {
let data = res.data
if (data.code == 1) {
......@@ -297,6 +379,7 @@
}
return
}
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data)
} else if (dataset.dataType === this.$store.state.dataType[2]) {
......@@ -305,47 +388,77 @@
this.calculateExternalData(data)
}
}).catch(err => {})
}
if (getData1) {//筛选条件时间为最新
this.$api.getNewest(getData1).then(res => {
let data = res.data
// console.log(res.data)
if (data.code == 1) {
this.chartData = {
series: [{}],
categories: []
}
return
}
if (!data || !Object.keys(data).length) {
this.chartData = {
series: [{}],
categories: []
}
return
}
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[2]) {
this.calculateStatisticData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data, 'newData')
}
})
}
}).catch(err => {})
},
//聚合外部数据
calculateExternalData(data) {
let dimension = this.dimension[0]
let len = data[dimension.variable].length
this.$nextTick(function() {
calculateExternalData(data, type) {
this.chartData = {
categories: [],
series: []
}
let dimension = this.dimension[0]
let numerical = this.numerical
this.variables1.forEach((item2, index) => {
if (type == 'newData') {//筛选时间为最新
let item1 = data[this.variables1.length]
this.variables.forEach((item2, index) => {
let item = numerical[index]
let seriesData = {
name: item.name,
type: item.chartType,
yAxisIndex: item.yAxis,
data: data[item2],
smooth: true,
barMaxWidth: 30,
itemStyle: this.getItemStyle(item),
markLine: this.getMarkLine(item)
let item3 = data[index]
if (item3[item.variable]) {
let item = numerical[index]
let seriesData = this.initData(item)//初始化图形数据
seriesData.data.push(item3[item2.name])
seriesData.data = this.setBarItemStyle(seriesData.data)
this.chartData.series.push(seriesData)
}
})
this.chartData.categories.push(item1[dimension.variable])
} else {
let len = data[dimension.variable].length
// this.$nextTick(function() {
this.variables1.forEach((item2, index) => {
let item = numerical[index]
let seriesData = this.initData(item)//初始化图形数据
seriesData.data = data[item2]
seriesData.data = this.setBarItemStyle(seriesData.data)
this.chartData.series.push(seriesData)
})
this.chartData.categories = data[dimension.variable]
// })
}
})
},
//聚合统计数据
calculateStatisticData(data) {
calculateStatisticData(data, type) {
let len = data.RecordXValue ? data.RecordXValue.length : 0
let filterConfig = this.componentsData.filterConfig
let content = filterConfig.list[1].content
......@@ -353,7 +466,11 @@
content = this.tabContent[1].content
}
let dimension = this.componentConfig.dimension[0]
let level = dimension.level //展示层级
let content1 = filterConfig.list[0].content
if (this.tabContent) {
content1 = this.tabContent[0].content
}
let timeType = getTimeType(content1.substr(content1.indexOf(",") + 1))
let contentList = []
if (content != "" && content != null) {
contentList = content.split(",")
......@@ -363,22 +480,42 @@
categories: [],
series: []
}
this.chartData.categories = []
// this.chartData.categories = []
if (type == 'newData') {
this.chartData.categories.push(data[0].Time)
} else {
this.chartData.categories = data.RecordXValue
}
let numerical = this.numerical
this.variables1.forEach((item2, index) => {
let item = numerical[index]
let seriesData = {
name: item.name,
type: item.chartType,
yAxisIndex: item.yAxis,
data: [],
smooth: true,
itemStyle: this.getItemStyle(item),
barMaxWidth: 30,
markLine: this.getMarkLine(item)
let seriesData = this.initData(item)//初始化图形数据
// console.log(seriesData)
if (type == 'newData') {
if (contentList.length > 0 && timeType != 'Hour') { //有筛选班次并时间层级不为小时,小时没有班次
let dataList = []
let value = null
let item3 = data[index]
// console.log(contentList)
// let keyList = []
contentList.forEach((item1, index1) => {
if (item3[item1]) {
dataList.push(item3[item1])
}
})
value = this.getStatisticalData(item.statistical, dataList, this.decimal)
seriesData.data.push(value)
} else {
let item3 = data[index]
if (item3.Variable == item2) {
seriesData.data.push(item3.Value)
}
}
console.log(seriesData)
if (contentList.length > 0 && getTimeType(level) != 'Hour') {
// this.chartData.series.push(seriesData)
} else {
if (contentList.length > 0 && timeType != 'Hour') {
let keyList = []
for (let i = 0; i < len; i++) {
let dataList = []
......@@ -393,71 +530,93 @@
}
})
if (item.statistical === '合计') {
value = sumNumber(dataList)
}
if (item.statistical === '平均') {
value = avgNumber(dataList) ? avgNumber(dataList).toFixed(this
.decimal) : avgNumber(dataList)
}
if (item.statistical === '最大') {
value = getMaxOrMin(dataList, 'max')
}
if (item.statistical === '最小') {
value = getMaxOrMin(dataList, 'min')
}
value = this.getStatisticalData(item.statistical, dataList, this
.decimal)
keyList.push(value)
}
this.$set(this.numerical[index], 'value', keyList)
seriesData.data = keyList
this.chartData.series.push(seriesData)
// this.chartData.series.push(seriesData)
} else {
if (data[item2]) {
seriesData.data = data[item2]
this.chartData.series.push(seriesData)
// this.chartData.series.push(seriesData)
}
}
}
seriesData.data = this.setBarItemStyle(seriesData.data)
this.chartData.series.push(seriesData)
})
this.chartData.categories = data.RecordXValue
// console.log(this.chartData)
})
},
//聚合班次数据
getStatisticalData(statistical, dataList, decimal) {
let value = null
if (statistical === '合计') {
value = sumNumber(dataList)
}
if (statistical === '平均') {
value = avgNumber(dataList) ? avgNumber(dataList).toFixed() : avgNumber(dataList)
}
if (statistical === '最大') {
value = getMaxOrMin(dataList, 'max')
}
if (statistical === '最小') {
value = getMaxOrMin(dataList, 'min')
}
return value
},
//统计历史数据
calculateHistoryData(data) {
calculateHistoryData(data, type) {
this.$nextTick(function() {
this.chartData = {
categories: [],
series: []
}
if (type == 'newData') {
this.chartData.categories.push(data[0].Time)
} else {
this.chartData.categories = data.RecordXValue
}
let numerical = this.numerical
numerical.forEach((item, index) => {
let seriesData = {
name: item.name,
type: item.chartType,
yAxisIndex: item.yAxis,
itemStyle: this.getItemStyle(item),
data: [],
smooth: true,
barMaxWidth: 30,
markLine: this.getMarkLine(item)
this.variables1.forEach((item1, index) => {
let item = numerical[index]
let seriesData = this.initData(item)
if (type == 'newData') {
let item2 = data[index]
if (item2.Variable == item.variable) {
seriesData.data.push(item2.Value)
}
if (data[item.variable + '_' + index]) {
this.$set(this.numerical[index], 'value', data[item.variable + '_' + index])
seriesData.data = data[item.variable + '_' + index]
} else {
if (data[item.variable]) {
this.$set(this.numerical[index], 'value', data[item.variable])
seriesData.data = data[item.variable]
if (data[item1]) {
this.$set(this.numerical[index], 'value', data[item1])
// let seriesDataList = JSON.parse(JSON.)
seriesData.data = data[item1]
}
}
seriesData.data = this.setBarItemStyle(seriesData.data)
// console.log(seriesData)
this.chartData.series.push(seriesData)
})
this.chartData.categories = data.RecordXValue
})
},
//设置柱状图柱形图形
setBarItemStyle(list) {
let list1 = list.map(function(item) {
return {
value: item,
itemStyle: {
barBorderRadius: isNumber(item) && Number(item) >= 0 ? [15, 15, 0, 0] : [0, 0, 15, 15]
}
}
})
return list1
},
//实时数据刷新
getRealTimeData(newTagDataArr) {
if (newTagDataArr) {
......@@ -479,21 +638,8 @@
this.$set(this.numerical[j], 'value', newTagDataArr[i].Value)
this.chartData.categories.push(item.name)
RealTimeDataList[j] = newTagDataArr[i].Value
// let list = RealTimeDataList.slice(0,j+1)
// let RealTimeDataList = newTagDataArr[i].Value
// this.chartData.series.push(seriesData)
let seriesData = {
name: item.name,
type: item.chartType,
data: RealTimeDataList,
yAxisIndex: item.yAxis,
itemStyle: this.getItemStyle(item),
smooth: true,
stack: 1,
barMaxWidth: 30,
// lineStyle: this.getLineStyle(item),
markLine: this.getMarkLine(item)
}
let seriesData = this.initData(item,1)
seriesData.data = this.setBarItemStyle(RealTimeDataList)
this.chartData.series.push(seriesData)
......@@ -511,69 +657,96 @@
})
}
},
//初始化饼图
init() {
this.chartData = {
series: [],
categories: []
//初始化图形配置数据
initData(item,stack) {
let seriesData = {
name: item.name,
type: item.chartType,
data: [],
yAxisIndex: item.yAxis,
itemStyle: this.getItemStyle(item),
smooth: true,
stack:stack,
barMaxWidth: 30,
// lineStyle: this.getLineStyle(item),
markLine: this.getMarkLine(item)
}
return seriesData
},
//获取组件数据
getComponentList() {
if (!this.componentsData || this.componentsData == {}) return
console.log(this.componentsData)
let item = this.componentsData
if (item.type !== this.name) return
let styleConfig = item.styleConfig
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = item.componentConfig
this.dimension = componentConfig.dimension
this.chartOption.title = componentConfig.chartTitle
this.numerical = componentConfig.numerical
this.RealTimeDataList = []
this.decimal = Number(componentConfig.numericalFormat.decimal)
this.numerical.forEach(item => {
this.RealTimeDataList.push(null)
})
this.componentConfig = componentConfig
this.variables = []
// if (this.numerical) {
// this.numerical.forEach(item => {
for (let i = 0; i < this.numerical.length; i++) {
let item1 = this.numerical[i]
// console.log(item1)
if (Number(item1.yAxis) > this.yAxisIndex) {
this.yAxisIndex = Number(item1.yAxis)
//添加辅助线
getMarkLine(item) {
let markLine = {}
let markLineData = this.componentConfig.markLine
let list = markLineData.list
markLine.data = []
markLine.symbol = 'none' //去掉箭头
markLine.label = {
show: true,
// position:'middle'
}
if (!item1.variable) break
this.variables.push({
"name": item1.variable,
"digit": this.decimal,
"valueMethod": getCalculateData(item1.statistical)
})
let num = getSameStrName(item1.variable, this.variables1)
if (this.dimension.length > 0 && item1.variable == this.dimension[0].variable) {
num += 1
for (let i = 0; i < list.length; i++) {
let item1 = list[i]
let data = null
if (item1.statistical == '固定值') {
data = {
name: item1.name,
yAxis: item1.number,
lineStyle: {
color: item1.color,
type: 'solid'
}
if (num) {
this.variables1.push(item1.variable + '_' + num)
}
markLine.data.push(data)
} else {
this.variables1.push(item1.variable)
if (item1.numerical == item.name) {
if (item1.statistical == '平均值') {
data = {
name: item1.name,
type: 'average',
lineStyle: {
color: item1.color,
type: 'solid'
}
}
} else if (item1.statistical == '最大值') {
data = {
name: item1.name,
type: 'max',
lineStyle: {
color: item1.color,
type: 'solid'
}
}
} else if (item1.statistical == '最小值') {
data = {
name: item1.name,
type: 'min',
lineStyle: {
color: item1.color,
type: 'solid'
}
}
}
markLine.data.push(data)
}
}
// })
// }
item.layout = item.componentConfig.layout
this.styleConfigList.push(styleConfig)
this.componentList.push(item)
this.setOptionStyle()
}
return markLine
},
//设置图形样式
getItemStyle(item, data) {
let itemStyle = {}
itemStyle.color = item.color
if (item.chartType === "bar") {
itemStyle.barBorderRadius = [15, 15, 0, 0]
}
return itemStyle
},
//设置折线柱状图样式
setOptionStyle() {
let nameFormat = this.componentConfig.nameFormat
......@@ -581,24 +754,7 @@
let xAxisFormat = this.componentConfig.xAxisFormat
let numericalFormat = this.componentConfig.numericalFormat
this.option = {
// title: {
// text: this.chartOption.title,
// textStyle: {
// fontSize: parseInt(nameFormat.fontSize),
// fontFamily: nameFormat.fontFamily,
// fontWeight: nameFormat.fontWeight,
// color: nameFormat.color,
// fontStyle: nameFormat.fontStyle,
// textDecoration: nameFormat.textDecoration,
// lineHeight: 13,
// },
// top: '5px',
// left: '10px',
// },
tooltip: {
//confine:true
// trigger:'item',
},
legend: {
show: true,
......@@ -667,89 +823,13 @@
],
grid: {
left: '3%',
right: markLineData.list.length > 0 && this.yAxisIndex == 0 ? '10%' : '4%',
right: markLineData.list.length > 0 && this.yAxisIndex == 0 ? '12%' : '4%',
bottom: '3%',
top: '45px',
containLabel: true
},
}
},
//添加辅助线
getMarkLine(item) {
let markLine = {}
let markLineData = this.componentConfig.markLine
let list = markLineData.list
markLine.data = []
markLine.symbol = 'none' //去掉箭头
markLine.label = {
show: true,
// position:'middle'
}
for (let i = 0; i < list.length; i++) {
let item1 = list[i]
let data = null
if (item1.statistical == '固定值') {
data = {
name: item1.name,
yAxis: item1.number,
lineStyle: {
color: item1.color,
type: 'solid'
}
}
markLine.data.push(data)
} else {
if (item1.numerical == item.name) {
if (item1.statistical == '平均值') {
data = {
name: item1.name,
type: 'average',
lineStyle: {
color: item1.color,
type: 'solid'
}
}
} else if (item1.statistical == '最大值') {
data = {
name: item1.name,
type: 'max',
lineStyle: {
color: item1.color,
type: 'solid'
}
}
} else if (item1.statistical == '最小值') {
data = {
name: item1.name,
type: 'min',
lineStyle: {
color: item1.color,
type: 'solid'
}
}
}
markLine.data.push(data)
}
}
}
return markLine
},
//设置图形样式
getItemStyle(item) {
// console.log(item)
let itemStyle = {}
itemStyle.color = item.color
if (item.chartType === "bar") {
itemStyle.barBorderRadius = [15, 15, 0, 0]
}
return itemStyle
},
}
}
......
<!-- 这是表格控件 -->
<template>
<view class="data-conponent-style" :class="'list'+index">
<scroll-view scroll-x="true" :class="'list-style-'+theme" style="max-height: 300px;" scroll-y="true" >
<uni-table stripe emptyText="暂无更多数据" >
<scroll-view scroll-x="true" :class="'list-style-'+theme" style="max-height: 300px;" scroll-y="true">
<uni-table stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<!-- <u-sticky offset-top="0"> -->
<uni-tr>
......@@ -45,8 +45,13 @@
getTimeType,
dateFtt,
getSameStrName,
getBoxShadow
getBoxShadow,
isNumber
} from '../../js/tool.js'
import {
historyApiData,
statisticApiData
} from '../../js/data.js'
export default {
name: 'List',
// props: ['componentsData', 'index'],
......@@ -70,7 +75,8 @@
rowSummary: {
show: false, //是否显示行总汇
},
tableData: [],
tableDataList:[],//总的列表数据
tableData: [],//当前页面数据
columnData: [],
columnSummary: {
show: false, //是否显示列总汇
......@@ -84,8 +90,8 @@
componentConfig: '',
tabContent: null, //选项卡历史数据
dimension: [],
theme: 'theme1' ,//主题
tableLoading:false
theme: 'theme1', //主题
tableLoading: false
}
},
methods: {
......@@ -96,7 +102,8 @@
let tableData1 = []
let dataSum = null
this.tableData = []
if(this.variables.length <= 0) return
this.tableDataList = []
if (this.variables.length <= 0) return
numerical.forEach((item, index) => {
this.numerical[index].value = null
for (let i = 0; i < newTagDataArr.length; i++) {
......@@ -132,7 +139,7 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = item.componentConfig
this.nameTextAlign = componentConfig.nameFormat.alignHorizontal
componentConfig.numericalFormat.textAlign = componentConfig.numericalFormat
......@@ -191,9 +198,10 @@
async getHistoryExternalData() {
// console.log(444)
if (!this.componentConfig) return
if(this.variables.length <= 0) return //无选择变量不请求
if (this.variables.length <= 0) return //无选择变量不请求
let dataset = this.componentConfig.dataset
let getData = null
let getData1 = null
if (dataset.dataType === this.$store.state.dataType[1]) {
let filterConfig = this.componentsData.filterConfig
let dimension = this.componentConfig.dimension[0]
......@@ -212,8 +220,8 @@
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -221,37 +229,19 @@
}).catch(err => {
console.log(err)
})
// let timeType = getTimeSettings(Number(content.substr(0, content.indexOf(","))), content.substr(
// content.indexOf(",") + 1))
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content.substr(content.indexOf(",") + 1) == '最新') {
// console.log(content.substr(content.indexOf(",") + 1))
getData1 = {
"variables": this.variables,
"sourceType": "History",
"layoutSettings": getTimeType(level),
"skipTime": false,
"historySettings": {
"timeType": "Recent",
"valueMethod": "Origin",
"xAxisSetting": "Time",
// "recent": timeType.recent,
// "timeSetting": timeType.timeSetting
}
}
} else if (dataset.dataType === this.$store.state.dataType[2]) {
} else {
getData = historyApiData(startTime, date, this.variables, getTimeType(level), false)
}
} else if (dataset.dataType === this.$store.state.dataType[2]) { //统计数据
let filterConfig = this.componentsData.filterConfig
let dimension = this.componentConfig.dimension[0]
......@@ -264,44 +254,33 @@
let timeType = getTimeType(content1.substr(content1.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
startTime = res.data
}).catch(err => {})
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content1.substr(content1.indexOf(",") + 1) == '最新') {
getData1 = {
"variables": this.variables,
"layoutSettings": getTimeType(level),
"skipTime": false,
"sourceType": "Statistic",
"layoutSettings": getTimeType(level),
"statisticsSettings": {
"shiftName": "AAA",
"valueMethod": "Origin",
"xAxisSetting": "Time",
"timeSetting":getTimeType(level),
"shiftsType": "All"
"timeSetting": getTimeType(level),
}
}
} else {
getData = statisticApiData(startTime, date, this.variables, getTimeType(level), false,
getTimeType(level))
}
} else if (dataset.dataType === this.$store.state.dataType[3]) {
} else if (dataset.dataType === this.$store.state.dataType[3]) { //外部数据
let dimension = this.dimension
let variablesList = JSON.parse(JSON.stringify(this.variables))
let layoutSettings = "Second"
if (dimension.length > 0) {
dimension.forEach((item, index) => {
let tagData = null
if (item.variableType.indexOf('DateTime') > 1) {
......@@ -309,6 +288,7 @@
name: item.variable,
layoutSettings: getTimeType(item.level),
}
layoutSettings = getTimeType(item.level)
variablesList.unshift(tagData)
} else {
tagData = {
......@@ -319,17 +299,24 @@
}
})
}
let filterConfig = this.componentsData.filterConfig
let contentList = filterConfig.list
if (this.tabContent) {
contentList = this.tabContent
}
let newDataType = 0
let newDataValue = null
let filterControls = [] //过滤控件组合
let filterItems = []
for (let i = 0; i < contentList.length; i++) {
let item = contentList[i]
let content = item.content
if (item.type == '时间日期') {
if (item.type == '时间日期' && item.variable != '') {
if (content.substr(content.indexOf(",") + 1) == '最新') {
newDataType += 1
newDataValue = item
}
let recent = Number(content.substr(0, content.indexOf(",")))
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
......@@ -392,6 +379,50 @@
}
let dataSetId = dataset.externalDataId
if (newDataType > 0) {
let variables = JSON.parse(JSON.stringify(this.variables))
let dataNum = 0
if (dimension.length > 0) {
dimension.forEach((item, index) => {
let tagData = null
if (item.variableType.indexOf('DateTime') > 1) {
tagData = {
name: item.variable,
layoutSettings: getTimeType(item.level),
}
dataNum += 1
} else {
tagData = {
name: item.variable,
valueMethod: "Sum"
}
}
variables.splice(index, 0, tagData)
})
if (dataNum <= 0) {
variables.unshift({
"name": newDataValue.variable,
"layoutSettings": layoutSettings
})
}
} else {
variables.unshift({
"name": newDataValue.variable,
"layoutSettings": layoutSettings
})
}
getData1 = {
"variables": variables,
"sourceType": "External",
"layoutSettings": layoutSettings,
"externalSettings": {
"dataSetId": dataSetId
}
}
} else {
getData = {
"filterControls": filterControls,
"variables": variablesList,
......@@ -406,12 +437,11 @@
}
}
}
if (!getData) return
// this.tableLoading = true
}
if (getData) {
this.$api.getQueryMulitySource(getData).then(res => {
let data = res.data
// this.tableLoading = false
if (!data) return
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data)
} else if (dataset.dataType === this.$store.state.dataType[2]) {
......@@ -419,21 +449,72 @@
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data)
}
}).catch(err => {})
}
if (getData1) {
this.$api.getNewest(getData1).then(res => {
let data = res.data
// console.log(res.data)
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[2]) {
this.calculateStatisticData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data, 'newData')
}
})
}
},
//集合外部数据
calculateExternalData(data) {
// console.log(data)
calculateExternalData(data, type) {
this.tableData = []
this.columnData = []
let len = 0
if (type == 'newData') {
len = 1
let tableData1 = []
let dataSum = 0
let row = 0
// for(let key in item){
// if(isNumber(item[key])){
// row += 1
// dataSum += Number(item[key])
// }
// tableData1.push(item[key])
// }
for (let i = 0; i < this.variables1.length; i++) {
let item = data[i]
for (let key in item) {
if (isNumber(item[key])) {
row += 1
dataSum += Number(item[key])
}
tableData1.push(item[key])
}
}
if (this.rowSummary.isShow) { //显示行统计
if (this.rowSummary.type == 'total') {
tableData1.push(dataSum.toFixed(this.decimal))
} else {
tableData1.push((dataSum / row).toFixed(this.decimal))
}
}
this.tableData.push(tableData1)
this.getColumnSummary(len)
} else {
for (let key in data) {
if (len <= data[key].length) {
len = data[key].length
}
}
if (this.numerical) {
if (!this.numerical) return
for (let i = 0; i < len; i++) {
let tableData1 = []
let dataSum = 0
......@@ -448,7 +529,7 @@
// }
this.variables1.forEach(item => {
if (data[item]) {
if (Number(data[item][i]) || Number(data[item][i]) == 0) {
if (isNumber(data[item][i])) {
// console.log(JSON.stringify(Number(data[key][i])))
row += 1
dataSum += Number(data[item][i])
......@@ -469,10 +550,38 @@
// console.log(tableData1)
}
this.getColumnSummary(len)
}
},
//统计历史数据
calculateHistoryData(data) {
calculateHistoryData(data, type) {
if (type == 'newData') {
let len = 1
this.tableData = []
this.columnData = []
let tableData1 = []
let dataSum = 0
let row = 0
tableData1.push(data[0].Time)
for (let key in data) {
if (Number(data[key].Value) || Number(data[key].Value) == 0) {
// console.log(JSON.stringify(Number(data[key][i])))
row += 1
dataSum += Number(data[key].Value)
}
tableData1.push(data[key].Value)
}
if (this.rowSummary.isShow) {
if (this.rowSummary.type == 'total') {
tableData1.push(dataSum.toFixed(this.decimal))
} else {
tableData1.push((dataSum / row).toFixed(this.decimal))
}
}
this.tableData.push(tableData1)
this.getColumnSummary(len)
} else {
let len = data.RecordXValue.length
this.tableData = []
this.columnData = []
......@@ -481,7 +590,8 @@
let dataSum = 0
let row = 0
for (let key in data) {
if (Number(data[key][i]) || Number(data[key][i]) == 0) {
if (isNumber(data[key][i])) {
// console.log(JSON.stringify(Number(data[key][i])))
row += 1
dataSum += Number(data[key][i])
......@@ -499,26 +609,99 @@
this.tableData.push(tableData1)
}
this.getColumnSummary(len)
}
},
//聚合统计数据
calculateStatisticData(data) {
let len = data.RecordXValue.length
calculateStatisticData(data, type) {
let filterConfig = this.componentsData.filterConfig
let content = filterConfig.list[1].content
if (this.tabContent) {
content = this.tabContent[1].content
}
let dimension = this.componentConfig.dimension[0]
let level = dimension.level //展示层级
let content1 = filterConfig.list[0].content
if (this.tabContent) {
content1 = this.tabContent[0].content
}
let timeType = getTimeType(content1.substr(content1.indexOf(",") + 1))
this.tableData = []
this.columnData = []
// let contentList = content.split(",")
let contentList = []
if (content != "" && content != null) {
contentList = content.split(",")
}
if (contentList.length > 0 && getTimeType(level) != 'Hour') { //是否有筛选班次
if (type == 'newData') {
let len = 1
if (contentList.length > 0 && timeType != 'Hour') { //是否有筛选班次
if (data.length <= 0) return
let data1 = data[0]
// for (let key in data1) {
contentList.forEach((item, index) => {
let tableData1 = []
let dataSum = 0
let row = 0
let showDate = 0
data.forEach((item1, index1) => {
if (item1[item]) {
row += 1
dataSum += Number(item1[item])
tableData1.push(item1[item])
showDate += 1
}
})
if (showDate > 0) {
tableData1.unshift(item)
tableData1.unshift(data[0].Time)
if (this.rowSummary.isShow) { //显示行统计
if (this.rowSummary.type == 'total') {
tableData1.push(dataSum.toFixed(this.decimal))
} else {
tableData1.push((dataSum / row).toFixed(this.decimal > 0 ? this
.decimal :
1))
}
}
this.tableData.push(tableData1)
}
})
// }
// for(let key)
this.getColumnSummary(len * contentList.length)
} else {
let tableData1 = []
let dataSum = 0
let row = 0
tableData1.push(data[0].Time)
tableData1.push('')
data.forEach((item, index) => {
row += 1
dataSum += Number(item.Value)
tableData1.push(item.Value)
})
if (this.rowSummary.isShow) { //显示行统计
if (this.rowSummary.type == 'total') {
tableData1.push(dataSum.toFixed(this.decimal))
} else {
tableData1.push((dataSum / row).toFixed(this.decimal > 0 ? this
.decimal :
1))
}
}
this.tableData.push(tableData1)
this.getColumnSummary(len)
}
} else {
let len = data.RecordXValue.length
if (contentList.length > 0 && timeType != 'Hour') { //是否有筛选班次
contentList.forEach((item1, index1) => {
for (let i = 0; i < len; i++) {
let tableData1 = []
......@@ -543,7 +726,8 @@
if (this.rowSummary.type == 'total') {
tableData1.push(dataSum.toFixed(this.decimal))
} else {
tableData1.push((dataSum / row).toFixed(this.decimal > 0 ? this.decimal :
tableData1.push((dataSum / row).toFixed(this.decimal > 0 ? this
.decimal :
1))
}
}
......@@ -560,9 +744,7 @@
this.variables1.forEach((item, index) => {
let refName = item
if (data[refName]) {
if ((Number(data[refName][i]) || Number(data[refName][i]) == 0) && data[refName][
i
]) {
if (isNumber(data[refName][i]) && data[refName][i]) {
row += 1
dataSum += Number(data[refName][i])
}
......@@ -586,6 +768,9 @@
this.getColumnSummary(len)
}
}
},
//统计表格列
getColumnSummary(len) {
......@@ -593,29 +778,28 @@
// console.log(len)
let columnLen = this.tableData[0].length
let tableData = this.tableData
// console.log(columnLen)
for (let i = 0; i < columnLen; i++) {
let columnSum = null
let numberAvg = 0
for (let j = 0; j < len; j++) {
if (Number(tableData[j][i]) || Number(tableData[j][i]) == 0) {
if (!tableData[j]) break;
var a = tableData[j][i];
if (isNumber(a)) {
numberAvg += 1
columnSum += Number(tableData[j][i])
columnSum += Number(a)
}
}
// console.log(columnSum)
if (this.columnSummary.type == 'total') {
let columnAvg = null
if (columnSum || columnSum == 0) {
if (isNumber(columnSum)) {
columnAvg = Number(columnSum).toFixed(this.decimal)
}
this.columnData.push(columnAvg)
// this.columnData.push(columnSum)
}
else {
} else {
let columnAvg = null
if (columnSum || columnSum == 0) {
if (isNumber(columnSum)) {
columnAvg = (columnSum / numberAvg).toFixed(this.decimal > 0 ? this.decimal : 1)
}
......
......@@ -3,7 +3,8 @@
<view class="data-conponent-style" :class="'chartPie'+index" style="position: relative;"
:style="{'height':styleConfigWidth<=defaultWidth?'300px':'250px'}">
<view class="pieTitle">
<image src="../../static/img/eChartTitle.png" style="height:21px;width: 21px;vertical-align: middle" mode="aspectFill"></image>
<image src="../../static/img/eChartTitle.png" style="height:21px;width: 21px;vertical-align: middle"
mode="aspectFill"></image>
<text :style="componentsData.componentConfig.nameFormat">{{pieTitle}}</text>
</view>
......@@ -23,7 +24,8 @@
<view
:style="'background-color:'+item.color+';position: absolute;width: 16px;height:16px;border-radius:4px;top:0;margin-top: 3px;'">
</view>
<view @longtap="showTips($event,item)" @touchend="stopTooltip" class="text-style33" style="float: left;margin-left: 5px;width: 30%;margin-left: 20px;">
<view @longtap="showTips($event,item)" @touchend="stopTooltip" class="text-style33"
style="float: left;margin-left: 5px;width: 30%;margin-left: 20px;">
<text style="font-size:14px;font-family: PingFang SC;font-weight: 500;color: #000000;">
{{item.name}}
</text>
......@@ -46,9 +48,8 @@
</view>
<!-- <view v-show="isTooltip"> -->
<my-tooltip v-show="isTooltip" :text="tooltipText" :topNum="topNum" :heightNum="heightNum" :leftNum="leftNum"></my-tooltip>
</view>
<my-tooltip v-show="isTooltip" :text="tooltipText" :topNum="topNum" :heightNum="heightNum" :leftNum="leftNum">
</my-tooltip>
</view>
</template>
......@@ -63,8 +64,13 @@
avgNumber,
getMaxOrMin,
getSameStrName,
getBoxShadow
getBoxShadow,
isNumber
} from '../../js/tool.js'
import {
historyApiData,
statisticApiData
} from '../../js/data.js'
export default {
props: {
componentsData: {
......@@ -107,11 +113,11 @@
dimensionField: null, //维度字段
styleConfigWidth: '100%',
defaultWidth: 320,
isTooltip:false,
topNum:0,
leftNum:0,
heightNum:20,
tooltipText:''
isTooltip: false,
topNum: 0,
leftNum: 0,
heightNum: 20,
tooltipText: ''
}
......@@ -122,22 +128,22 @@
},
methods: {
//关闭气泡窗
stopTooltip(){
stopTooltip() {
this.isTooltip = false
},
//显示名称
showTips(e,item){
if(e.type == 'longpress'){
showTips(e, item) {
if (e.type == 'longpress') {
let lenHeight = item.name.length/4*14
let lenHeight = item.name.length / 4 * 14
this.isTooltip = true
this.heightNum = lenHeight
let changedTouche = e.changedTouches[0]
let target = e.target
let clientX = changedTouche.clientX-target.offsetLeft-50
let clientY = changedTouche.clientY-lenHeight-70
this.topNum = clientY
this.leftNum = clientX
let clientX = changedTouche.clientX - target.offsetLeft - 50
let clientY = changedTouche.clientY - lenHeight - 70
this.topNum = 0
this.leftNum = 0
this.tooltipText = item.name
}
......@@ -148,6 +154,7 @@
if (this.variables.length <= 0) return //无选择变量不请求
let dataset = this.componentConfig.dataset
let getData = null
let getData1 = null
if (dataset.dataType === this.$store.state.dataType[1]) { //dataset.dataType-历史数据
let filterConfig = this.componentsData.filterConfig
let dimension = this.componentConfig.dimension[0]
......@@ -164,8 +171,8 @@
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -173,31 +180,16 @@
}).catch(err => {
console.log(err)
})
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content.substr(content.indexOf(",") + 1) == '最新') {
// console.log(content.substr(content.indexOf(",") + 1))
getData1 = {
"variables": this.variables,
"sourceType": "History",
"layoutSettings": 'Second',
"skipTime": true,
"historySettings": {
"timeType": "Recent",
"valueMethod": "Origin",
"xAxisSetting": "Time",
}
} else {
getData = historyApiData(startTime, date, this.variables, 'Second', true)
}
if (!getData) return
} else if (dataset.dataType === this.$store.state.dataType[2]) { //dataset.dataType-统计数据
let filterConfig = this.componentsData.filterConfig
let content1 = filterConfig.list[0].content
......@@ -208,8 +200,8 @@
let timeType = getTimeType(content1.substr(content1.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -217,32 +209,18 @@
}).catch(err => {
console.log(err)
})
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content1.substr(content1.indexOf(",") + 1) == '最新') {
getData1 = {
"variables": this.variables,
"layoutSettings": "Second",
"skipTime": true,
"sourceType": "Statistic",
"statisticsSettings": {
"shiftName": "AAA",
"valueMethod": "Origin",
"xAxisSetting": "Time",
"timeSetting": "Hour",
"shiftsType": "All"
}
}
} else {
getData = statisticApiData(startTime, date, this.variables, 'Second', true, 'Hour')
}
} else if (dataset.dataType === this.$store.state.dataType[3]) { //dataset.dataType-外部数据
let filterConfig = this.componentsData.filterConfig
let contentList = filterConfig.list
......@@ -250,10 +228,12 @@
let dimensionField = this.dimensionField
let dimension = this.dimension
let variableList = JSON.parse(JSON.stringify(this.variables))
let skipTime = true
let skipTime = false
let newDataType = 0
let newDataValue = null
if (dimensionField && dimension.length > 0) {
// console.log(dimension)
skipTime = false
// skipTime = false
variableList.unshift({
"name": dimensionField,
layoutSettings: "Day"
......@@ -268,7 +248,11 @@
for (let i = 0; i < contentList.length; i++) {
let item = contentList[i]
let content = item.content
if (item.type == '时间日期') {
if (item.type == '时间日期' && item.variable != '') {
if (content.substr(content.indexOf(",") + 1) == '最新') {
newDataType += 1
newDataValue = item
}
let recent = Number(content.substr(0, content.indexOf(",")))
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
......@@ -330,8 +314,33 @@
}
}
let dataSetId = dataset.externalDataId
if (newDataType > 0) {
let variables = JSON.parse(JSON.stringify(this.variables))
if (dimensionField && dimension.length > 0) {
variables.unshift({
"name": newDataValue.variable,
"layoutSettings": "Day"
})
variables.unshift({
"name": dimensionField,
"valueMethod": "Sum"
})
// variables = variableList
} else {
variables.push({
"name": newDataValue.variable,
"layoutSettings": "Day"
})
}
getData1 = {
"variables": variables,
"sourceType": "External",
"externalSettings": {
"dataSetId": dataSetId
}
}
} else {
getData = {
"filterControls": filterControls,
"variables": variableList,
......@@ -345,12 +354,12 @@
"filterItems": filterItems
}
}
}
if (!getData) return
}
if (getData) {
this.$api.getQueryMulitySource(getData).then(res => {
let data = res.data
if (!data) return
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data)
} else if (dataset.dataType === this.$store.state.dataType[2]) {
......@@ -358,11 +367,27 @@
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data)
}
}).catch(err => {})
}
if (getData1) {
this.$api.getNewest(getData1).then(res => {
let data = res.data
// console.log(res.data)
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[2]) {
this.calculateStatisticData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data, 'newData')
}
})
}
},
//集合外部数据
calculateExternalData(data) {
calculateExternalData(data, type) {
if (!this.numerical) return
this.$nextTick(function() {
this.chartData = {
......@@ -372,9 +397,7 @@
series: []
}
let seriesData2 = []
// console.log(this.variables1)
if (this.variables1.length <= 0) {
// console.log(this.variables1)
this.numerical.forEach(item => {
seriesData2.push({
value: 0,
......@@ -387,27 +410,46 @@
})
}
let dimension = this.componentConfig.dimension
// let seriesData2 = []
this.valueSum = 0
this.variables1.forEach((item2, index) => {
let item = this.numerical[index]
if (type == 'newData') {
// console.log(data[index][item.variable])
if (isNumber(data[index][item.variable])) {
this.valueSum += Number(data[index][item.variable])
}
seriesData2.push({
itemStyle: {
color: item.color
},
value: isNumber(data[index][item.variable]) ? data[index][item
.variable
] : null,
name: item.name,
})
this.$set(this.numerical[index], 'value', data[index][item.variable])
} else {
if (data[item2]) {
this.valueSum += Number(data[item2][0])
seriesData2.push({
value: Number(data[item2][0]) >= 0 ? data[item2][0] : null,
name: item.name,
itemStyle: {
color: item.color
}
},
value: Number(data[item2][0]) >= 0 ? data[item2][0] : null,
name: item.name,
})
this.$set(this.numerical[index], 'value', data[item2][0])
}
}
})
if (dimension.length > 0) {
// console.log(this.variables1[0])
// console.log(data)
seriesData2 = []
for (let i = 0; i < dimension.length; i++) {
let item = dimension[i]
let dimensionText = data[this.dimensionField]
......@@ -424,6 +466,19 @@
}
})
if (type == 'newData') {
this.valueSum = null
let item = seriesData2[i]
let key = data[0][this.dimensionField]
if (key === item.name) {
// console.log(this.variables[0].name)
this.valueSum += Number(data[2][this.variables[0].name])
seriesData2[i].value = data[2][this.variables[0].name]
numerical.value = data[2][this.variables[0].name]
}
} else {
for (let key = 0; key < dimensionText.length; key++) {
if (item.typeName === dimensionText[key]) {
seriesData2[i].value = data[this.variables1[0]][key]
......@@ -431,6 +486,8 @@
}
// break
}
}
this.$set(this.numerical, i, numerical)
}
......@@ -443,7 +500,9 @@
})
},
//统计历史数据
calculateHistoryData(data) {
calculateHistoryData(data, type) {
// console.log(333)
// console.log(data)
if (!this.numerical) return
this.$nextTick(function() {
this.chartData = {
......@@ -456,6 +515,18 @@
this.valueSum = 0
this.variables1.forEach((item2, index) => {
let item = this.numerical[index]
if (type == 'newData') {
this.valueSum += Number(data[index].Value)
seriesData2.push({
itemStyle: {
color: item.color
},
value: Number(data[index].Value) >= 0 ? data[index].Value : null,
name: item.name,
})
this.$set(this.numerical[index], 'value', data[index].Value)
} else {
if (data[item2]) {
this.valueSum += Number(data[item2][0])
seriesData2.push({
......@@ -468,8 +539,11 @@
})
this.$set(this.numerical[index], 'value', data[item2][0])
}
}
})
// console.log(seriesData2)
this.seriesData.data = seriesData2
this.seriesData2.data = seriesData2
this.chartData.series.push(this.seriesData)
......@@ -477,7 +551,7 @@
})
},
//聚合统计数据
calculateStatisticData(data) {
calculateStatisticData(data, type) {
let filterConfig = this.componentsData.filterConfig
let content = filterConfig.list[1].content
if (this.tabContent) {
......@@ -529,7 +603,12 @@
// value = data[item2][0]
// }
// }
if (data[item2]) {
// if (data[item2]) {
// value = data[item2][0]
// }
if (type == 'newData') {
value = data[index].Value
} else {
value = data[item2][0]
}
......@@ -613,7 +692,7 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = item.componentConfig
// this.styleConfigWidth = parseFloat(styleConfig.width)
// console.log(this.styleConfigWidth)
......@@ -647,8 +726,8 @@
})
// let variables2 = this.variables1
let num = getSameStrName(item.variable, this.variables1)
if(this.dimensionField == item.variable && this.dimension.length>0){
num +=1
if (this.dimensionField == item.variable && this.dimension.length > 0) {
num += 1
}
if (num) {
this.variables1.push(item.variable + '_' + num)
......@@ -803,7 +882,7 @@
height: 100%;
position: absolute;
right: 0;
top:0
top: 0
}
.widthStyle4 {
......@@ -813,7 +892,8 @@
// left: 0;
top: 180px
}
.pieTitle{
.pieTitle {
// position: absolute;
z-index: 1;
width: 100%;
......
......@@ -4,7 +4,9 @@
<view v-for="(item,index) in numerical" :key="index" style="padding: 10px 0;">
<view style="overflow:hidden;padding:0 0 5px 0;">
<view :style="componentsData.componentConfig.nameFormat"
style="float: left;margin-left:5%;text-align: center;max-width: 30%;" class="text-style33">{{item.name}}</view>
style="float: left;margin-left:5%;text-align: center;max-width: 30%;" class="text-style33">
{{item.name}}
</view>
<view :style="componentsData.componentConfig.numericalFormat"
style="float: right; text-align: center;margin-right: 5%;">{{item.value}}</view>
......@@ -41,6 +43,10 @@
getSameStrName,
getBoxShadow
} from '../../js/tool.js'
import {
historyApiData,
statisticApiData
} from '../../js/data.js'
export default {
name: 'ProgressBar',
// props: ['componentsData', 'index'],
......@@ -103,7 +109,7 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = this.componentsData.componentConfig
this.progress = componentConfig.progress
this.numerical = componentConfig.numerical
......@@ -114,11 +120,9 @@
this.componentConfig = componentConfig
this.variables = []
this.variables1 = []
// if (this.numerical) {
// this.numerical.forEach(item => {
for(let i = 0;i<this.numerical.length;i++){
for (let i = 0; i < this.numerical.length; i++) {
let item = this.numerical[i]
if(!item.variable) break
if (!item.variable) break
this.variables.push({
"name": item.variable,
"digit": this.decimal,
......@@ -131,17 +135,16 @@
this.variables1.push(item.variable)
}
}
// })
// }
this.styleConfigList.push(styleConfig)
this.componentList.push(item)
},
//历史、统计、外部
async getHistoryExternalData() {
if (!this.componentConfig) return
if(this.variables.length <= 0) return //无选择变量不请求
if (this.variables.length <= 0) return //无选择变量不请求
let dataset = this.componentConfig.dataset
let getData = null
let getData1 = null
if (dataset.dataType === this.$store.state.dataType[1]) {
let filterConfig = this.componentsData.filterConfig
let content = filterConfig.list[0].content
......@@ -156,8 +159,8 @@
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -165,31 +168,18 @@
}).catch(err => {
console.log(err)
})
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content.substr(content.indexOf(",") + 1) == '最新') {
// console.log(content.substr(content.indexOf(",") + 1))
getData1 = {
"variables": this.variables,
"sourceType": "History",
"layoutSettings": 'Second',
"skipTime": true,
"historySettings": {
"timeType": "Recent",
"valueMethod": "Origin",
"xAxisSetting": "Time",
}
} else {
getData = historyApiData(startTime, date, this.variables, 'Second', true)
}
} else if (dataset.dataType === this.$store.state.dataType[2]) {
let filterConfig = this.componentsData.filterConfig
let content1 = filterConfig.list[0].content
......@@ -200,8 +190,8 @@
let timeType = getTimeType(content1.substr(content1.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
let date1 = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
if(timeType != 'Hour' && timeType != 'Second'){
date1 = dateFtt("yyyy-MM-dd", new Date())+' 00:00:00'
if (timeType != 'Hour' && timeType != 'Second') {
date1 = dateFtt("yyyy-MM-dd", new Date()) + ' 00:00:00'
}
let startTime = date
await this.$api.getStartTime(date1, recent, timeType).then(res => {
......@@ -210,45 +200,37 @@
}).catch(err => {
// console.log(err)
})
getData = {
"filterControls": [{
"value1": startTime,
"controlType": "AssociateDateTimePicker",
"pickerType": "BeginTime",
"name": "a1"
},
{
"value1": date,
"controlType": "AssociateDateTimePicker",
"pickerType": "EndTime",
"name": "a2"
}
],
if (content1.substr(content1.indexOf(",") + 1) == '最新') {
getData1 = {
"variables": this.variables,
"layoutSettings": "Second",
"skipTime": true,
"sourceType": "Statistic",
"statisticsSettings": {
"shiftName": "AAA",
"valueMethod": "Origin",
"xAxisSetting": "Time",
"timeSetting":"Hour",
"shiftsType": "All"
"timeSetting": "Hour",
}
}
} else {
getData = statisticApiData(startTime, date, this.variables, 'Second', true, 'Hour')
}
} else if (dataset.dataType === this.$store.state.dataType[3]) {
let filterConfig = this.componentsData.filterConfig
let contentList = filterConfig.list
if (this.tabContent) {
contentList = this.tabContent
}
let newDataType = 0
let newDataValue = null
let filterControls = [] //过滤控件组合
let filterItems = []
for (let i = 0; i < contentList.length; i++) {
let item = contentList[i]
let content = item.content
if (item.type == '时间日期') {
if (item.type == '时间日期' && item.variable != '') {
if (content.substr(content.indexOf(",") + 1) == '最新') {
newDataType += 1
newDataValue = item
}
let recent = Number(content.substr(0, content.indexOf(",")))
let timeType = getTimeType(content.substr(content.indexOf(",") + 1))
let date = dateFtt("yyyy-MM-dd hh:mm:ss", new Date())
......@@ -311,11 +293,25 @@
}
let dataSetId = dataset.externalDataId
if (newDataType > 0) {
let variables = JSON.parse(JSON.stringify(this.variables))
variables.push({
"name": newDataValue.variable,
"layoutSettings": "Day"
})
getData1 = {
"variables": variables,
"sourceType": "External",
"externalSettings": {
"dataSetId": dataSetId
}
}
} else {
getData = {
"filterControls": filterControls,
"variables": this.variables,
"layoutSettings": "Second",
"skipTime": true,
"skipTime": false,
"sourceType": "External",
"externalSettings": {
"valueMethod": "Sum",
......@@ -324,12 +320,13 @@
"filterItems": filterItems
}
}
}
}
if (!getData) return
if (getData) {
this.$api.getQueryMulitySource(getData).then(res => {
let data = res.data
if (!data) return
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data)
} else if (dataset.dataType === this.$store.state.dataType[2]) {
......@@ -337,33 +334,68 @@
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data)
}
}).catch(err => {})
}
if (getData1) {
this.$api.getNewest(getData1).then(res => {
let data = res.data
// console.log(res.data)
if (!data || !Object.keys(data).length) return
if (dataset.dataType === this.$store.state.dataType[1]) {
this.calculateHistoryData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[2]) {
this.calculateStatisticData(data, 'newData')
} else if (dataset.dataType === this.$store.state.dataType[3]) {
this.calculateExternalData(data, 'newData')
}
})
}
},
//集合外部数据
calculateExternalData(data) {
calculateExternalData(data, type) {
if (this.numerical) {
this.variables1.forEach((item2, index) => {
this.$set(this.numerical[index], 'value', data[item2][0])
if (type == 'newData') {
// for (let key in data[0]) {
// if (key == this.numerical[index].variable) {
// this.$set(this.numerical[index], 'value', data[0][key])
// }
// }
this.$set(this.numerical[index], 'value', data[index][this.numerical[index].variable])
} else {
this.$set(this.numerical[index], 'value', data[item2][0])
}
})
}
// if (this.numerical) {
// this.variables1.forEach((item2, index) => {
// this.$set(this.numerical[index], 'value', data[item2][0])
// })
// }
},
//统计历史数据
calculateHistoryData(data) {
calculateHistoryData(data, type) {
if (this.numerical) {
if (type == 'newData') {
this.numerical.forEach((item, index) => {
if (data[item.variable + '_' + index]) {
this.$set(this.numerical[index], 'value', data[item.variable + '_' + index][0])
} else {
if (data[item.variable]) {
this.$set(this.numerical[index], 'value', data[item.variable][0])
}
if (data[index]) {
this.$set(this.numerical[index], 'value', data[index].Value)
}
})
} else {
this.variables1.forEach((item2, index) => {
this.$set(this.numerical[index], 'value', data[item2][0])
})
}
}
},
//聚合统计数据
calculateStatisticData(data) {
calculateStatisticData(data, type) {
let filterConfig = this.componentsData.filterConfig
let content = filterConfig.list[1].content
if (this.tabContent) {
......@@ -381,6 +413,11 @@
let item = this.numerical[index]
let dataList = []
let value = null
if (type == 'newData') {
value = data[index].Value
} else {
value = data[item2][0]
}
// if (contentList.length > 0 && timeType != "Hour" && timeType != "Second") {
// contentList.forEach((item1, index1) => {
// // let refName = '!' + item.variable + '@' + item1
......@@ -415,7 +452,7 @@
// if (data[item2]) {
// value = data[item2][0]
// }
value = data[item2][0]
// value = data[item2][0]
// if(data[item.variable + '_' + index]){
// value = data[item.variable + '_' + index][0]
// }else{
......
<!-- 数据组件-选项卡 -->
<template>
<view :class="'tabs'+index">
<view :class="'tabs'+index" style="position: relative;">
<view :class="{'stopTop':stopTop,'data-conponent-style':stopTop}"
:style="stopTop?componentsData.styleConfig:''">
<view :style="{'height':theme=='theme3'?'40px':'auto'}">
......@@ -111,28 +111,6 @@
// windowHeight = res.windowHeight
windowHeight = res.screenHeight
// if(detail.y+40>= windowHeight){
// console.log(data.height)
// // let heightNum =data.height+140
// // console.log(heightNum)
// uni.pageScrollTo({
// scrollTop:3000,
// duration: 300
// });
// let obj = uni.createSelectorQuery(_this).select('.mainStyleConfigCalss')
// obj.boundingClientRect(function(data) { // data - 各种参数
// let detail = e.detail
// console.log(detail)
// if(detail.y+40>= windowHeight){
// console.log(data.height)
// // let heightNum =data.height+140
// // console.log(heightNum)
// uni.pageScrollTo({
// scrollTop:3000,
// duration: 300
// });
// }
// }).exec()
}
});
uni.pageScrollTo({
......@@ -152,19 +130,41 @@
this.isTooltip = false
},
//显示名称
showTips(e, item) {
async showTips(e, item) {
// console.log(this.componentsData)
let _this = this
let windowHeight = 665
await uni.getSystemInfo({
success: function (res) {
windowHeight = res.windowHeight
}
});
await uni.createSelectorQuery().in(this).select(".tabs"+_this.index).boundingClientRect((data) => {
console.log(e)
let dataHeight = data.height
let dataTop = data.top
let dataBottom = data.bottom
if (e.type == 'longpress') {
let lenHeight = item.name.length / 4 * 14
this.isTooltip = true
this.heightNum = lenHeight
_this.isTooltip = true
_this.heightNum = lenHeight
let changedTouche = e.changedTouches[0]
let target = e.target
let clientX = changedTouche.clientX - 30
let clientY = changedTouche.clientY - lenHeight - 60
this.topNum = clientY
this.leftNum = clientX
this.tooltipText = item.name
let currentTarget = e.currentTarget
let pageY = changedTouche.pageY
let pageX = changedTouche.pageX
_this.topNum = dataHeight+10
if(dataBottom+lenHeight+dataHeight>windowHeight){
_this.topNum = -dataHeight-lenHeight
}
_this.leftNum = changedTouche.clientX-4 * 14
_this.tooltipText = item.name
}
})
.exec();
},
//获取组件列表
......@@ -177,7 +177,7 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// this.$set(this.styleConfig,item.styleConfig)
// this.styleConfig = {
// "background-color":styleConfig.backgroundColor,
......
......@@ -49,7 +49,7 @@
styleConfig.margin = arrayToString(styleConfig.margin)
styleConfig.padding = arrayToString(styleConfig.padding)
styleConfig.borderRadius = arrayToString(styleConfig.borderRadius)
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
// styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
let componentConfig = item.componentConfig
// componentConfig.textContent = componentConfig.textContent.replace(/'↵'/g, '<br/>')
this.$set(componentConfig.nameFormat,'textAlign',componentConfig.nameFormat.alignHorizontal)
......
......@@ -2,20 +2,26 @@
<template>
<view class="mainStyleConfigCalss" style="overflow:auto;height: auto;" :style="mainStyleConfig">
<view class="data-style data-conponent-style" v-if="isShowCompons" v-for="(item,index) in componentsChildren" :key="index" :style="item.styleConfig">
<view class="data-style data-conponent-style" v-if="isShowCompons" v-for="(item,index) in componentsChildren"
:key="index" :style="item.styleConfig">
<rectangular v-if="item.type == 'rectangular'" :ref="'rectangular'+index" :componentsData="item">
</rectangular>
<kpi v-if="item.type == 'kpi'" :ref="item.type+index" :componentsData="item" :index="index" imgType="0"></kpi>
<text-item v-if="item.type == 'text'" :ref="item.type+index" :componentsData="item" :index="index"></text-item>
<list-item v-if="item.type == 'list'" :ref="item.type+index" :index="index" :componentsData="item"></list-item>
<kpi v-if="item.type == 'kpi'" :ref="item.type+index" :componentsData="item" :index="index" imgType="0">
</kpi>
<text-item v-if="item.type == 'text'" :ref="item.type+index" :componentsData="item" :index="index">
</text-item>
<list-item v-if="item.type == 'list'" :ref="item.type+index" :index="index" :componentsData="item">
</list-item>
<progress-bar v-if="item.type == 'progressBar'" :ref="item.type+index" :index="index"
:componentsData="item"></progress-bar>
<pie-echart v-if="item.type == 'chartPie'" :ref="item.type+index" :componentsData="item" :index="index">
</pie-echart>
<line-bar-echart v-if="item.type == 'chartLineBar'" :ref="item.type+index" :index="index"
:componentsData="item"></line-bar-echart>
<banner v-if="item.type == 'banner'" :ref="item.type+index" :componentsData="item" :index="index" :homeViewName="homeViewName" @jump-view="jumpView"></banner>
<card-list v-if="item.type == 'cardList'" :ref="item.type+index" :index="index" :componentsData="item" @jump-view="jumpView">
<banner v-if="item.type == 'banner'" :ref="item.type+index" :componentsData="item" :index="index"
:homeViewName="homeViewName" @jump-view="jumpView"></banner>
<card-list v-if="item.type == 'cardList'" :ref="item.type+index" :index="index" :componentsData="item"
@jump-view="jumpView">
</card-list>
<tabs v-if="item.type == 'tabs'" :ref="item.type+index" :componentsData="item" :index="index"
@select-tab-fun="selectTabFun" class="tabs-box"></tabs>
......@@ -25,12 +31,15 @@
<button @click="test">fhsjsh</button>
</div> -->
</view>
<tips-page v-if="showTips" :text="tipsText"></tips-page>
</view>
</template>
<script>
import {
arrayToString,getBoxShadow
arrayToString,
getBoxShadow
} from '../../js/tool.js'
import jsonData from '../../js/test.json'
import Rectangular from '../data-conponent/rectangular.vue'
......@@ -71,10 +80,12 @@
newTagDataArr: '', //实时变量数据,
tagArr: [], //控件绑定变量集合
timer1: null, //实时定时轮询
timer2:null,//历史,统计、外部轮询
timer2: null, //历史,统计、外部轮询
realTimeList: [], //实时组件列表
historyExternalList: [], //历史、外部、统计组件列表
tabsList:[],//选项卡列表
tabsList: [], //选项卡列表
showTips: false,
tipsText: '暂无数据~'
// children:null
}
......@@ -88,12 +99,7 @@
onResize() {
try {
const res = uni.getSystemInfoSync();
console.log(res.model);
console.log(res.pixelRatio);
console.log(res.windowWidth);
console.log(res.windowHeight);
console.log(res.screenWidth);
console.log(res.screenHeight);
} catch (e) {
// error
......@@ -104,7 +110,7 @@
},
methods: {
//跳转页面
jumpView(){
jumpView() {
this.eliminateTimer()
// console.log('主页面')
},
......@@ -115,7 +121,7 @@
this.$nextTick(function() {
let filter = tabData.filter[0]
let content = filter.content
if(dataType == this.$store.state.dataType[3] || dataType == this.$store.state.dataType[2]){
if (dataType == this.$store.state.dataType[3] || dataType == this.$store.state.dataType[2]) {
content = tabData.filter
}
this.componentsChildren.forEach((item, index) => {
......@@ -133,12 +139,16 @@
//获取页面数据
getViewJson() {
let projectInfo = uni.getStorageSync('projectInfo')
console.log(JSON.stringify(projectInfo))
this.homeViewName = projectInfo.homeViewName
if(this.homeViewName.indexOf("\\")>-1){
this.homeViewName =this.homeViewName.substring(this.homeViewName.indexOf("\\")+1);
if (this.homeViewName.indexOf("\\") > -1) {
this.homeViewName = this.homeViewName.substring(this.homeViewName.indexOf("\\") + 1);
}
let homeViewId = projectInfo.homeViewId
if (!homeViewId) {
this.showTips = true
this.tipsText = '页面找不到,请重新刷新喔~'
return
}
this.projectName = projectInfo.projectName
this.tagArr = []
this.realTimeList = []
......@@ -147,9 +157,13 @@
this.componentsChildren = []
this.$api.getView(this.projectName, homeViewId).then(res => {
uni.stopPullDownRefresh();
if (res.data) {
// console.log(JSON.stringify(res.data))
this.componentsData = res.data
if (!res.data) {
this.showTips = true
this.tipsText = '页面找不到,请重新刷新喔~'
return
}
// console.log(JSON.parse(JSON.stringify(res.data)))
this.componentsData = JSON.parse(JSON.stringify(res.data))
let _this = this
let realTime = 0
let showHistoryExternal = 0
......@@ -161,8 +175,19 @@
let componentConfig = children[i].componentConfig
let styleConfig = children[i].styleConfig
let widthList = JSON.parse(JSON.stringify(styleConfig.margin))
let width = parseFloat(styleConfig.width)+parseFloat(widthList[1])+parseFloat(widthList[3])
styleConfig.width = (width>100?parseFloat(styleConfig.width)-(width-100):parseFloat(styleConfig.width))+'%'
let width = parseFloat(styleConfig.width) + parseFloat(widthList[1]) + parseFloat(
widthList[3]) //获取组件总长度
styleConfig.width = (width > 100 ? parseFloat(styleConfig.width) - (width - 100) :
parseFloat(styleConfig.width)) + '%' //计算组件的宽度
if (styleConfig.boxShadow.internal && styleConfig.boxShadow.internal) {
let internal = getBoxShadow(styleConfig.boxShadow.internal, 'inset')
let external = getBoxShadow(styleConfig.boxShadow.external)
styleConfig.boxShadow = internal + ',' + external
} else {
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
}
// console.log(styleConfig)
if (componentConfig) {
if (componentConfig.dataset) {
let dataset = componentConfig.dataset
......@@ -170,7 +195,9 @@
realTime = 1
let refName = children[i].type + i
this.realTimeList.push(refName)
} else if(dataset.dataType == this.$store.state.dataType[1] || dataset.dataType == this.$store.state.dataType[2] || dataset.dataType == this.$store.state.dataType[3]){
} else if (dataset.dataType == this.$store.state.dataType[1] || dataset
.dataType == this.$store.state.dataType[2] || dataset.dataType == this
.$store.state.dataType[3]) {
showHistoryExternal = 1
let refName = children[i].type + i
this.historyExternalList.push(refName)
......@@ -184,10 +211,10 @@
})
}
}
if(children[i].type == 'tabs'){
if (children[i].type == 'tabs') {
this.tabsList.push({
index:i,
name:children[i].type+i
index: i,
name: children[i].type + i
})
}
}
......@@ -218,8 +245,7 @@
}, 6000)
}
}
}
}).catch(err=>{
}).catch(err => {
uni.stopPullDownRefresh();
this.$toast.toast(err)
})
......@@ -281,7 +307,7 @@
},
//添加定时器
getTimer(){
getTimer() {
this.eliminateTimer()
console.log('添加定时器')
this.timer1 = setInterval(() => {
......@@ -292,7 +318,7 @@
}, 6000)
},
//消除定时器
eliminateTimer(){
eliminateTimer() {
console.log('消除定时器')
if (this.timer1) {
clearInterval(Number(this.timer1))
......@@ -311,13 +337,13 @@
},
//监听页面滚动
onPageScroll:function(e) { //nvue暂不支持滚动监听,可用bindingx代替
onPageScroll: function(e) { //nvue暂不支持滚动监听,可用bindingx代替
// console.log("滚动距离为:" + e.scrollTop);
// let _this = this
// console.log(this.tabsList)
let tabsList = this.tabsList
for(let i=0;i<tabsList.length;i++){
this.$refs[tabsList[i].name][0].shopTop(e.scrollTop,tabsList[i].name,tabsList[i].index)
for (let i = 0; i < tabsList.length; i++) {
this.$refs[tabsList[i].name][0].shopTop(e.scrollTop, tabsList[i].name, tabsList[i].index)
}
},
......@@ -330,7 +356,7 @@
// }, 1000);
},
onShow() {
this.$nextTick(function(){
this.$nextTick(function() {
this.getTimer()
})
// this.getViewJson()
......@@ -352,6 +378,11 @@
beforeDestroy() {
this.eliminateTimer()
},
onLoad() {
// #ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary'); //锁定
// #endif
}
}
</script>
......@@ -368,6 +399,7 @@
// min-height: 100%;
// background: red;
}
.stopTop {
position: fixed;
top: 50px;
......
......@@ -97,9 +97,13 @@
},
onLoad(option){
console.log(6473)
console.log(JSON.stringify(option))
this.homeViewName = option.viewName
this.homeViewId = option.viewId
// #ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary'); //锁定
// #endif
// this.getViewJson()
},
methods: {
......@@ -110,7 +114,6 @@
//添加定时器
getTimer(){
this.eliminateTimer()
console.log('添加定时器1')
this.timer1 = setInterval(() => {
this.postRediusTestFun(this.tagArr)
}, 3000)
......@@ -120,7 +123,6 @@
},
//选项卡点击 dataType-数据类型 associatedComponent-绑定控件ID tabData点击选项卡筛选数据
selectTabFun(dataType, associatedComponent, tabData) {
console.log(tabData)
// if (dataType === '历史数据') {
this.$nextTick(function() {
let filter = tabData.filter[0]
......@@ -145,12 +147,12 @@
getViewJson() {
let projectInfo = uni.getStorageSync('projectInfo')
// this.homeViewName = projectInfo.homeViewName
if(this.homeViewName && this.homeViewName.indexOf("\\")>-1){
this.homeViewName =this.homeViewName.substring(this.homeViewName.indexOf("\\")+1);
}
if(this.homeViewName.indexOf('.view')< 0){
this.homeViewName = this.homeViewName +'.view'
}
// if(this.homeViewName && this.homeViewName.indexOf("\\")>-1){
// this.homeViewName =this.homeViewName.substring(this.homeViewName.indexOf("\\")+1);
// }
// if(this.homeViewName.indexOf('.view')< 0){
// this.homeViewName = this.homeViewName +'.view'
// }
// this.homeViewName = '标准组件'
// console.log(JSON.stringify(projectInfo))
this.projectName = projectInfo.projectName
......@@ -162,8 +164,9 @@
this.$api.getView(this.projectName, this.homeViewId).then(res => {
uni.stopPullDownRefresh();
if (res.data) {
console.log(res.data)
this.componentsData = res.data
console.log(JSON.parse(JSON.stringify(res.data)))
this.componentsData = JSON.parse(JSON.stringify(res.data))
console.log(this.componentsData)
let _this = this
let realTime = 0
let showHistoryExternal = 0
......@@ -177,6 +180,13 @@
let widthList = JSON.parse(JSON.stringify(styleConfig.margin))
let width = parseFloat(styleConfig.width)+parseFloat(widthList[1])+parseFloat(widthList[3])
styleConfig.width = (width>100?parseFloat(styleConfig.width)-(width-100):parseFloat(styleConfig.width))+'%'
if(styleConfig.boxShadow.internal && styleConfig.boxShadow.external){
let internal = getBoxShadow(styleConfig.boxShadow.internal,'inset')
let external = getBoxShadow(styleConfig.boxShadow.external)
styleConfig.boxShadow = internal+','+external
}else{
styleConfig.boxShadow = getBoxShadow(styleConfig.boxShadow)
}
if (componentConfig) {
if (componentConfig.dataset) {
let dataset = componentConfig.dataset
......@@ -353,6 +363,7 @@
// }
},
}
</script>
......
......@@ -33,8 +33,8 @@
data() {
return {
height: '100vh',
userName: 'SuperAdmin',
password: 'SYC888888',
userName: '',
password: '',
logoImg: '../../static/img/hello.png'
}
},
......
<!-- 消息页面 -->
<template>
<view></view>
<view>
<tips-page :text="'功能开发中,请敬请期待~'"></tips-page>
</view>
</template>
<script>
......
<!-- 监控列表页面 -->
<template>
<view class="page-view">
<view>
<view v-if="!showTips" class="page-view">
<view v-for="(item,index) in dataList" :key="index" style="margin-bottom: 10px;">
<collapse :data="item" @collaspe-item-fun="getMonitoringViewInfo"></collapse>
</view>
</view>
<tips-page v-if="showTips" :text="'暂无配置~'"></tips-page>
</view>
</template>
<script>
......@@ -16,8 +19,9 @@
},
data() {
return {
projectName:'',
dataList: []
projectName: '',
dataList: [],
showTips: false
}
},
......@@ -34,10 +38,11 @@
let title = item.SCMSChildMenuKey
let id = item.SCMSChildMenuID
uni.navigateTo({
url: '/pages/monitoring/monitoring-view/index?id=' + id + '&title=' + title+'&projectName='+this.projectName
url: '/pages/monitoring/monitoring-view/index?id=' + id + '&title=' + title +
'&projectName=' + this.projectName
})
}else{
} else {
this.$toast.toast('此菜单不是监控画面,不可查看')
}
......@@ -91,9 +96,14 @@
// this.$store.state.routerInfo = JSON.stringify(data.data)
uni.removeStorageSync('routerChildMenusInfo')
uni.setStorageSync('routerChildMenusInfo', childMenus);
if (mainMenus.length <= 0) {
this.showTips = true
}
// const value = uni.getStorageSync('routerChildMenusInfo');
// console.log(childMenus)
mainMenus.sort(function(a, b){return a.SCMSMainMenuKey - b.SCMSMainMenuKey});
// console.log(mainMenus)
mainMenus.sort(function(a, b) {
return a.SCMSMainMenuRank - b.SCMSMainMenuRank
});
let lastVistInfos = data1.lastVistInfos
mainMenus.forEach(item => {
item.title = item.SCMSMainMenuName
......@@ -101,14 +111,20 @@
for (let i = 0; i < childMenus.length; i++) {
let childMenusItem = childMenus[i]
let SCMSChildMenuKey = childMenusItem.SCMSChildMenuKey
let SCMSChildMenuRank = childMenusItem.SCMSChildMenuRank
if (childMenusItem.SCMSMainMenuID == item.SCMSMainMenuID) {
childMenusItem.img = '../../static/img1/jiankongBg.png'
childMenusItem.textTitle = childMenusItem.SCMSChildMenuName
childMenusItem.textTime = lastVistInfos[SCMSChildMenuKey]?lastVistInfos[SCMSChildMenuKey].lastTime:null
childMenusItem.textTime = lastVistInfos[SCMSChildMenuKey] ?
lastVistInfos[SCMSChildMenuKey].lastTime : null
item.textList.push(childMenusItem)
}
}
item.textList.sort(function(a, b) {
return a.SCMSChildMenuRank - b.SCMSChildMenuRank
});
})
this.dataList = mainMenus
......
......@@ -307,13 +307,10 @@
},
//图表历史,业务数据初始化查询
async initEchart() {
console.log('434=>')
this.$nextTick(() => {
// console.log('444=>'+JSON.stringify(this.$refs.queryButton25.dataValue))
let queryButtonList = this.$refs.queryButton25.dataValue
queryButtonList.forEach((item, index) => {
console.log('434=>545434')
this.searchBtnFun(item)
})
......@@ -340,15 +337,26 @@
}
var myPicker = new Set(picker)
var pickerArray = [...myPicker]
let dataValue = this.$refs.dataTimePicker282.dataValue
let dataValue = this.$refs.dataTimePicker282.dataValue //时间控件
let ComboboxList = this.$refs.combobox299.dataValue //下拉控件
console.log(ComboboxList)
let getDataTimeList = {}
for (let i = 0; i < dataValue.length; i++) {
for (let j = 0; j < pickerArray.length; j++) {
if (dataValue[i].class == pickerArray[j]) {
getDataTimeList[pickerArray[j]] = {
getDataTimeList[dataValue[i].class] = {
Value: dataValue[i].value
}
// for (let j = 0; j < pickerArray.length; j++) {
// if (dataValue[i].class == pickerArray[j]) {
// getDataTimeList[pickerArray[j]] = {
// Value: dataValue[i].value
// }
// }
// }
}
for (let i = 0; i < ComboboxList.length; i++) {
let ComboboxData = ComboboxList[i]
getDataTimeList[ComboboxData.class] = {
Value: ComboboxData.value
}
}
let queryChartData = {
......@@ -682,7 +690,7 @@
// this.initEchart()
setTimeout(() => {
this.initEchart()
},1000)
}, 1000)
// this.$nextTick(function(){
// })
......
......@@ -2,6 +2,7 @@
<template>
<view class="charts-box">
<!-- <qiun-data-charts type="column" :chartData="chartData" /> -->
<tips-page :text="'功能开发中,请敬请期待~'"></tips-page>
</view>
</template>
......@@ -66,6 +67,10 @@
}
</script>
<style>
<style lang="scss" scoped>
.charts-box{
position: relative;
height: 100%;
}
</style>
......@@ -136,6 +136,11 @@ function getStartTime(time,recent,setting){
return api.baseRequest(`/api/Data/GetTime?endTime=${time}&recent=${recent}&setting=${setting}`,"GET",1)
}
//获取最新时间点数据
function getNewest(data){
return api.baseRequest(`/api/Data/GetNewest`,"POST",1,data)
}
export default {
......@@ -164,8 +169,7 @@ export default {
getGlobalProps,
getQueryMulitySource,
getStartTime,
checkTag
checkTag,
getNewest
}
......@@ -70,8 +70,8 @@ const store = new Vuex.Store({
// #ifndef APP-PLUS || APP-NVUE
uni.removeStorageSync('projectInfo');
// let projectName = 'http://192.168.1.85:5000/api/view/GetAppInfo?projectName=0826APP项目A'
let projectName = 'http://192.168.1.85:5002/api/view/GetAppInfo?projectName=Test02'
// let projectName = 'http://192.168.1.85:5000/api/view/GetAppInfo?projectName=测试项目'
// let projectName = 'http://192.168.1.85:5002/api/view/GetAppInfo?projectName=Test02'
let projectName = 'http://192.168.1.85:5000/api/view/GetAppInfo?projectName=测试项目'
$api.getAppInfo(projectName).then(res => {
const code = res.data.code
if (code == 1) {
......
......@@ -58,13 +58,13 @@ module.exports = {
}
for (let i in res) {
let value = '--'
if (res[i].data !== null) {
if (res[i].value != null) {
if(isNaN(res[i].axisValueLabel)&&!isNaN(Date.parse(res[i].axisValueLabel))){
//   result += res[0].axisValueLabel
}else{
result += res[i].axisValueLabel
}
value = res[i].data
value = res[i].value
// #ifdef H5
result += '\n' + res[i].seriesName + ':' + value
// #endif
......@@ -77,6 +77,33 @@ module.exports = {
}
return result;
},
webTooltipfun1:function(res){
console.log(res)
let result = ''
// if(isNaN(res[0].axisValueLabel)&&!isNaN(Date.parse(res[0].axisValueLabel))){
//   result += res[0].axisValueLabel
// }
// for (let i in res) {
// let value = '--'
// if (res[i].data !== null) {
// if(isNaN(res[i].axisValueLabel)&&!isNaN(Date.parse(res[i].axisValueLabel))){
// //   result += res[0].axisValueLabel
// }else{
// result += res[i].axisValueLabel
// }
// value = res[i].data
// // #ifdef H5
// result += '\n' + res[i].seriesName + ':' + value
// // #endif
// // #ifdef APP-PLUS
// result += '<br/>' + res[i].marker + res[i].seriesName + ':' + value
// // #endif
// }
// }
return res;
},
legendFormat: function(name) {
return "自定义图例+" + name;
},
......
......@@ -2,7 +2,7 @@
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/scan-code/index","pages/login/index","pages/monitoring/index","pages/data/index","pages/working/index","pages/message/index","pages/my/index","pages/monitoring/monitoring-view/index","pages/scan-code/app-scan/index","pages/data/jump-view/index"],"window":{"navigationBarTextStyle":"white","navigationBarTitleText":"cms","navigationBarBackgroundColor":"#00B2A5","backgroundColor":"#f2f2f2","pageOrientation":"portrait-primary"},"tabBar":{"color":"#2D2D2D","selectedColor":"#2D2D2D","borderStyle":"rgba(220, 220, 220, 0.24)","backgroundColor":"#ffffff","height":"50px","fontSize":"10px","iconWidth":"22px","spacing":"2px","list":[{"pagePath":"pages/monitoring/index","iconPath":"static/img1/jiankong.png","selectedIconPath":"static/img1/jiankong1.png","text":"监控"},{"pagePath":"pages/data/index","iconPath":"static/img1/shuju.png","selectedIconPath":"static/img1/shuju1.png","text":"数据"},{"pagePath":"pages/working/index","iconPath":"static/img1/gongzuo.png","selectedIconPath":"static/img1/gongzuo1.png","text":"工作"},{"pagePath":"pages/message/index","iconPath":"static/img1/xiaoxi.png","selectedIconPath":"static/img1/xiaoxi1.png","text":"消息","backgroundColor":"#000"},{"pagePath":"pages/my/index","iconPath":"static/img1/wo.png","selectedIconPath":"static/img1/wo1.png","text":"我的"}]},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"SYC","compilerVersion":"3.1.22","entryPagePath":"pages/scan-code/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/scan-code/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"扫码","titleNView":false}},{"path":"/pages/login/index","meta":{},"window":{"titleNView":false}},{"path":"/pages/monitoring/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"监控"}},{"path":"/pages/data/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"数据"}},{"path":"/pages/working/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"工作"}},{"path":"/pages/message/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"消息"}},{"path":"/pages/my/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/monitoring/monitoring-view/index","meta":{},"window":{"titleNView":false,"bounce":false}},{"path":"/pages/scan-code/app-scan/index","meta":{"isNVue":true},"window":{"navigationBarTitleText":"扫码"}},{"path":"/pages/data/jump-view/index","meta":{},"window":{}}];
var __uniRoutes = [{"path":"/pages/scan-code/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"扫码","titleNView":false}},{"path":"/pages/login/index","meta":{},"window":{"titleNView":false}},{"path":"/pages/monitoring/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"监控"}},{"path":"/pages/data/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"数据","enablePullDownRefresh":true}},{"path":"/pages/working/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"工作"}},{"path":"/pages/message/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"消息"}},{"path":"/pages/my/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/monitoring/monitoring-view/index","meta":{},"window":{"titleNView":false,"bounce":false}},{"path":"/pages/scan-code/app-scan/index","meta":{"isNVue":true},"window":{"navigationBarTitleText":"扫码"}},{"path":"/pages/data/jump-view/index","meta":{},"window":{"enablePullDownRefresh":true}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){"use strict";var o=n(5),r=n(2),i=n(7);var a=Object(i.a)(r.default,o.b,o.c,!1,null,null,"0f56f2e1",!1,o.a,void 0);(function(e){this.options.style||(this.options.style={}),Vue.prototype.__merge_style&&Vue.prototype.__$appStyle__&&Vue.prototype.__merge_style(Vue.prototype.__$appStyle__,this.options.style),Vue.prototype.__merge_style?Vue.prototype.__merge_style(n(6).default,this.options.style):Object.assign(this.options.style,n(6).default)}).call(a),t.default=a.exports},function(e,t){e.exports={".page-view":{"":{paddingTop:["12",0,0,16],paddingRight:["12",0,0,16],paddingBottom:["12",0,0,16],paddingLeft:["12",0,0,16]}},".uni-input":{"":{backgroundColor:["#FFFFFF",0,0,17],borderWidth:["1",0,0,17],borderStyle:["solid",0,0,17],borderColor:["#CECECE",0,0,17],borderRadius:["5",0,0,17],height:["47",0,0,17]}},".base-style":{"":{position:["absolute",0,0,18]}},".data-conponent-style":{"":{boxSizing:["border-box",0,0,19]}},".text-style33":{"":{overflow:["hidden",0,0,20],whiteSpace:["nowrap",0,0,20],textOverflow:["ellipsis",0,0,20]}},"@VERSION":2}},function(e,t,n){"use strict";var o=n(3),r=n.n(o);t.default=r.a},function(e,t,n){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={onLoad:function(){},data:function(){return{fil:[0,1,2,3]}},methods:{success:function(t){this.$refs.barcode.cancel(),e("log","success1:"+JSON.stringify(t)," at pages/scan-code/app-scan/index.nvue:23"),uni.redirectTo({url:"/pages/login/index"})},fail1:function(t){this.$refs.barcode.cancel(),e("log","fail1:"+JSON.stringify(t)," at pages/scan-code/app-scan/index.nvue:30")},toStart:function(){this.$refs.barcode.start({conserve:!0,filename:"_doc/barcode/"})},tocancel:function(){this.$refs.barcode.cancel()},toFlash:function(){this.$refs.barcode.setFlash(!0)},toscan:function(){e("log","scan:"," at pages/scan-code/app-scan/index.nvue:46"),n("barcodeScan").scan("/static/barcode1.png",(function(t){e("log","scan_error:"+JSON.stringify(t)," at pages/scan-code/app-scan/index.nvue:50")}))}},mounted:function(){this.$refs.barcode.start({vibrate:!0})}};t.default=o}).call(this,n(11).default,n(12).default)},function(e,t){e.exports={".barcode":{"":{backgroundColor:["#808080",0,0,0]}},"@VERSION":2}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){}));var o=function(){var e=this.$createElement,t=this._self._c||e;return t("scroll-view",{staticStyle:{flexDirection:"column"},attrs:{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true"}},[t("view",{staticStyle:{flex:"1"}},[t("barcode",{ref:"barcode",staticClass:["barcode"],staticStyle:{flex:"1"},attrs:{id:"1",autostart:"true",background:"rgb(0,0,0)",frameColor:"#1C86EE",scanbarColor:"#1C86EE",filters:this.fil},on:{marked:this.success,error:this.fail1}})],1)])},r=[]},function(e,t,n){"use strict";n.r(t);var o=n(4),r=n.n(o);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t.default=r.a},function(e,t,n){"use strict";function o(e,t,n,o,r,i,a,s,c,u){var l,f="function"==typeof e?e.options:e;if(c){f.components||(f.components={});var p=Object.prototype.hasOwnProperty;for(var d in c)p.call(c,d)&&!p.call(f.components,d)&&(f.components[d]=c[d])}if(u&&((u.beforeCreate||(u.beforeCreate=[])).unshift((function(){this[u.__module]=this})),(f.mixins||(f.mixins=[])).push(u)),t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),o&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=l):r&&(l=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),l)if(f.functional){f._injectStyles=l;var _=f.render;f.render=function(e,t){return l.call(t),_(e,t)}}else{var y=f.beforeCreate;f.beforeCreate=y?[].concat(y,l):[l]}return{exports:e,options:f}}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.r(t);n(9);var o=n(0);"undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))}),o.default.mpType="page",o.default.route="pages/scan-code/app-scan/index",o.default.el="#root",new Vue(o.default)},function(e,t,n){Vue.prototype.__$appStyle__={},Vue.prototype.__merge_style&&Vue.prototype.__merge_style(n(10).default,Vue.prototype.__$appStyle__)},function(e,t,n){"use strict";n.r(t);var o=n(1),r=n.n(o);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t.default=r.a},function(e,t,n){"use strict";function o(e){var t=Object.prototype.toString.call(e);return t.substring(8,t.length-1)}function r(){return"string"==typeof __channelId__&&__channelId__}function i(e,t){switch(o(t)){case"Function":return"function() { [native code] }";default:return t}}Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];console[e].apply(console,n)},t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var a=t.shift();if(r())return t.push(t.pop().replace("at ","uni-app:///")),console[a].apply(console,t);var s=t.map((function(e){var t=Object.prototype.toString.call(e).toLowerCase();if("[object object]"===t||"[object array]"===t)try{e="---BEGIN:JSON---"+JSON.stringify(e,i)+"---END:JSON---"}catch(n){e=t}else if(null===e)e="---NULL---";else if(void 0===e)e="---UNDEFINED---";else{var n=o(e).toUpperCase();e="NUMBER"===n||"BOOLEAN"===n?"---BEGIN:"+n+"---"+e+"---END:"+n+"---":String(e)}return e})),c="";if(s.length>1){var u=s.pop();c=s.join("---COMMA---"),0===u.indexOf(" at ")?c+=u:c+="---COMMA---"+u}else c=s[0];console[a](c)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return weex.requireModule(e)}}]);
\ No newline at end of file
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";var o=n(5),r=n(2),i=n(7);var a=Object(i.a)(r.default,o.b,o.c,!1,null,null,"0f56f2e1",!1,o.a,void 0);(function(t){this.options.style||(this.options.style={}),Vue.prototype.__merge_style&&Vue.prototype.__$appStyle__&&Vue.prototype.__merge_style(Vue.prototype.__$appStyle__,this.options.style),Vue.prototype.__merge_style?Vue.prototype.__merge_style(n(6).default,this.options.style):Object.assign(this.options.style,n(6).default)}).call(a),e.default=a.exports},function(t,e){t.exports={".page-view":{"":{paddingTop:["12",0,0,16],paddingRight:["12",0,0,16],paddingBottom:["12",0,0,16],paddingLeft:["12",0,0,16]}},".uni-input":{"":{backgroundColor:["#FFFFFF",0,0,17],borderWidth:["1",0,0,17],borderStyle:["solid",0,0,17],borderColor:["#CECECE",0,0,17],borderRadius:["5",0,0,17],height:["47",0,0,17]}},".base-style":{"":{position:["absolute",0,0,18]}},".data-conponent-style":{"":{boxSizing:["border-box",0,0,19]}},".text-style33":{"":{overflow:["hidden",0,0,20],whiteSpace:["nowrap",0,0,20],textOverflow:["ellipsis",0,0,20]}},"@FONT-FACE":[{fontFamily:"KaiTi",src:'url("fonts/KaiTi.ttf")'},{fontFamily:"PingFangSC",src:'url("fonts/PingFangMedium.ttf")'},{fontFamily:"SourceHanSansCN",src:'url("fonts/SourceHanSansCN-Medium.otf")'},{fontFamily:"FangSong",src:'url("fonts/FangSong.TTF")'},{fontFamily:"YouYuan",src:'url("fonts/YouYuan.TTF")'},{fontFamily:"FZShuTi",src:'url("fonts/FZShuTi.TTF")'},{fontFamily:"LiSu",src:'url("fonts/LiSu.TTF")'},{fontFamily:"FZYaoti",src:'url("fonts/FZYaoti.ttf")'},{fontFamily:"SimHei",src:'url("fonts/SimHei.TTF")'},{fontFamily:"Microsoft YaHei",src:'url("fonts/MicrosoftYaHei.ttf")'},{fontFamily:"SimSun",src:'url("fonts/SimSun.TTF")'}],"@VERSION":2}},function(t,e,n){"use strict";var o=n(3),r=n.n(o);e.default=r.a},function(t,e,n){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={onLoad:function(){},data:function(){return{fil:[0,1,2,3]}},methods:{success:function(e){this.$refs.barcode.cancel(),t("log","success1:"+JSON.stringify(e)," at pages/scan-code/app-scan/index.nvue:23"),uni.redirectTo({url:"/pages/login/index"})},fail1:function(e){this.$refs.barcode.cancel(),t("log","fail1:"+JSON.stringify(e)," at pages/scan-code/app-scan/index.nvue:30")},toStart:function(){this.$refs.barcode.start({conserve:!0,filename:"_doc/barcode/"})},tocancel:function(){this.$refs.barcode.cancel()},toFlash:function(){this.$refs.barcode.setFlash(!0)},toscan:function(){t("log","scan:"," at pages/scan-code/app-scan/index.nvue:46"),n("barcodeScan").scan("/static/barcode1.png",(function(e){t("log","scan_error:"+JSON.stringify(e)," at pages/scan-code/app-scan/index.nvue:50")}))}},mounted:function(){this.$refs.barcode.start({vibrate:!0})}};e.default=o}).call(this,n(11).default,n(12).default)},function(t,e){t.exports={".barcode":{"":{backgroundColor:["#808080",0,0,0]}},"@VERSION":2}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){}));var o=function(){var t=this.$createElement,e=this._self._c||t;return e("scroll-view",{staticStyle:{flexDirection:"column"},attrs:{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true"}},[e("view",{staticStyle:{flex:"1"}},[e("barcode",{ref:"barcode",staticClass:["barcode"],staticStyle:{flex:"1"},attrs:{id:"1",autostart:"true",background:"rgb(0,0,0)",frameColor:"#1C86EE",scanbarColor:"#1C86EE",filters:this.fil},on:{marked:this.success,error:this.fail1}})],1)])},r=[]},function(t,e,n){"use strict";n.r(e);var o=n(4),r=n.n(o);for(var i in o)"default"!==i&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e.default=r.a},function(t,e,n){"use strict";function o(t,e,n,o,r,i,a,s,u,c){var l,f="function"==typeof t?t.options:t;if(u){f.components||(f.components={});var d=Object.prototype.hasOwnProperty;for(var p in u)d.call(u,p)&&!d.call(f.components,p)&&(f.components[p]=u[p])}if(c&&((c.beforeCreate||(c.beforeCreate=[])).unshift((function(){this[c.__module]=this})),(f.mixins||(f.mixins=[])).push(c)),e&&(f.render=e,f.staticRenderFns=n,f._compiled=!0),o&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),a?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},f._ssrRegister=l):r&&(l=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),l)if(f.functional){f._injectStyles=l;var y=f.render;f.render=function(t,e){return l.call(e),y(t,e)}}else{var _=f.beforeCreate;f.beforeCreate=_?[].concat(_,l):[l]}return{exports:t,options:f}}n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";n.r(e);n(9);var o=n(0);"undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){throw n}))}))}),o.default.mpType="page",o.default.route="pages/scan-code/app-scan/index",o.default.el="#root",new Vue(o.default)},function(t,e,n){Vue.prototype.__$appStyle__={},Vue.prototype.__merge_style&&Vue.prototype.__merge_style(n(10).default,Vue.prototype.__$appStyle__)},function(t,e,n){"use strict";n.r(e);var o=n(1),r=n.n(o);for(var i in o)"default"!==i&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e.default=r.a},function(t,e,n){"use strict";function o(t){var e=Object.prototype.toString.call(t);return e.substring(8,e.length-1)}function r(){return"string"==typeof __channelId__&&__channelId__}function i(t,e){switch(o(e)){case"Function":return"function() { [native code] }";default:return e}}Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];console[t].apply(console,n)},e.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var a=e.shift();if(r())return e.push(e.pop().replace("at ","uni-app:///")),console[a].apply(console,e);var s=e.map((function(t){var e=Object.prototype.toString.call(t).toLowerCase();if("[object object]"===e||"[object array]"===e)try{t="---BEGIN:JSON---"+JSON.stringify(t,i)+"---END:JSON---"}catch(n){t=e}else if(null===t)t="---NULL---";else if(void 0===t)t="---UNDEFINED---";else{var n=o(t).toUpperCase();t="NUMBER"===n||"BOOLEAN"===n?"---BEGIN:"+n+"---"+t+"---END:"+n+"---":String(t)}return t})),u="";if(s.length>1){var c=s.pop();u=s.join("---COMMA---"),0===c.indexOf(" at ")?u+=c:u+="---COMMA---"+c}else u=s[0];console[a](u)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return weex.requireModule(t)}}]);
\ No newline at end of file
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment