feat():功能开发
parent
278b36e59c
commit
8931b0ee38
|
|
@ -0,0 +1,25 @@
|
|||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
yarn.lock
|
||||
build.7z
|
||||
|
|
@ -1,20 +1,23 @@
|
|||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
{
|
||||
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,5 +59,8 @@
|
|||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"vueVersion" : "2"
|
||||
"vueVersion" : "2",
|
||||
"h5": {
|
||||
"template": "template.html"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"name": "xffxkh-app",
|
||||
"version": "1.0.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
|
@ -7,6 +8,46 @@
|
|||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz",
|
||||
"integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ=="
|
||||
},
|
||||
"node_modules/echarts": {
|
||||
"version": "4.9.0",
|
||||
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-4.9.0.tgz",
|
||||
"integrity": "sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==",
|
||||
"dependencies": {
|
||||
"zrender": "4.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/es6-promise": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmmirror.com/es6-promise/-/es6-promise-4.2.8.tgz",
|
||||
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
|
||||
},
|
||||
"node_modules/flv.js": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/flv.js/-/flv.js-1.6.2.tgz",
|
||||
"integrity": "sha512-xre4gUbX1MPtgQRKj2pxJENp/RnaHaxYvy3YToVVCrSmAWUu85b9mug6pTXF6zakUjNP2lFWZ1rkSX7gxhB/2A==",
|
||||
"dependencies": {
|
||||
"es6-promise": "^4.2.8",
|
||||
"webworkify-webpack": "^2.1.5"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.30.1",
|
||||
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
|
||||
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/webworkify-webpack": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmmirror.com/webworkify-webpack/-/webworkify-webpack-2.1.5.tgz",
|
||||
"integrity": "sha512-2akF8FIyUvbiBBdD+RoHpoTbHMQF2HwjcxfDvgztAX5YwbZNyrtfUMgvfgFVsgDhDPVTlkbb5vyasqDHfIDPQw=="
|
||||
},
|
||||
"node_modules/zrender": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-4.3.2.tgz",
|
||||
"integrity": "sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,62 @@
|
|||
{
|
||||
"name": "xffxkh-app",
|
||||
"version": "1.0.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@escook/request-miniprogram": "^0.2.1"
|
||||
"@escook/request-miniprogram": "^0.2.1",
|
||||
"echarts": "^4.9.0",
|
||||
"es6-promise": "^4.2.8",
|
||||
"flv.js": "^1.6.2",
|
||||
"moment": "^2.30.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@escook/request-miniprogram": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz",
|
||||
"integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ=="
|
||||
},
|
||||
"node_modules/echarts": {
|
||||
"version": "4.9.0",
|
||||
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-4.9.0.tgz",
|
||||
"integrity": "sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==",
|
||||
"dependencies": {
|
||||
"zrender": "4.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/es6-promise": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmmirror.com/es6-promise/-/es6-promise-4.2.8.tgz",
|
||||
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
|
||||
},
|
||||
"node_modules/flv.js": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/flv.js/-/flv.js-1.6.2.tgz",
|
||||
"integrity": "sha512-xre4gUbX1MPtgQRKj2pxJENp/RnaHaxYvy3YToVVCrSmAWUu85b9mug6pTXF6zakUjNP2lFWZ1rkSX7gxhB/2A==",
|
||||
"dependencies": {
|
||||
"es6-promise": "^4.2.8",
|
||||
"webworkify-webpack": "^2.1.5"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.30.1",
|
||||
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
|
||||
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/webworkify-webpack": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmmirror.com/webworkify-webpack/-/webworkify-webpack-2.1.5.tgz",
|
||||
"integrity": "sha512-2akF8FIyUvbiBBdD+RoHpoTbHMQF2HwjcxfDvgztAX5YwbZNyrtfUMgvfgFVsgDhDPVTlkbb5vyasqDHfIDPQw=="
|
||||
},
|
||||
"node_modules/zrender": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-4.3.2.tgz",
|
||||
"integrity": "sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g=="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -19,6 +64,43 @@
|
|||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz",
|
||||
"integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ=="
|
||||
},
|
||||
"echarts": {
|
||||
"version": "4.9.0",
|
||||
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-4.9.0.tgz",
|
||||
"integrity": "sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==",
|
||||
"requires": {
|
||||
"zrender": "4.3.2"
|
||||
}
|
||||
},
|
||||
"es6-promise": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmmirror.com/es6-promise/-/es6-promise-4.2.8.tgz",
|
||||
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
|
||||
},
|
||||
"flv.js": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/flv.js/-/flv.js-1.6.2.tgz",
|
||||
"integrity": "sha512-xre4gUbX1MPtgQRKj2pxJENp/RnaHaxYvy3YToVVCrSmAWUu85b9mug6pTXF6zakUjNP2lFWZ1rkSX7gxhB/2A==",
|
||||
"requires": {
|
||||
"es6-promise": "^4.2.8",
|
||||
"webworkify-webpack": "^2.1.5"
|
||||
}
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.30.1",
|
||||
"resolved": "https://registry.npmmirror.com/moment/-/moment-2.30.1.tgz",
|
||||
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
|
||||
},
|
||||
"webworkify-webpack": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmmirror.com/webworkify-webpack/-/webworkify-webpack-2.1.5.tgz",
|
||||
"integrity": "sha512-2akF8FIyUvbiBBdD+RoHpoTbHMQF2HwjcxfDvgztAX5YwbZNyrtfUMgvfgFVsgDhDPVTlkbb5vyasqDHfIDPQw=="
|
||||
},
|
||||
"zrender": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-4.3.2.tgz",
|
||||
"integrity": "sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"@escook/request-miniprogram": "^0.2.1"
|
||||
"@escook/request-miniprogram": "^0.2.1",
|
||||
"echarts": "^4.9.0",
|
||||
"es6-promise": "^4.2.8",
|
||||
"flv.js": "^1.6.2",
|
||||
"moment": "^2.30.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
46
pages.json
46
pages.json
|
|
@ -3,6 +3,15 @@
|
|||
"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"path" : "pages/water/water",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path" : "pages/rain/rain",
|
||||
"style" :
|
||||
|
|
@ -11,7 +20,36 @@
|
|||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"path" : "pages/rainDetail/rainDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path" : "pages/hdDetail/hdDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path" : "pages/skDetail/skDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
|
|
@ -20,6 +58,12 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
"subPackages":[{
|
||||
"root": "subpkg",
|
||||
"pages": [{
|
||||
"path": "rainDetail/rainDetail"
|
||||
}]
|
||||
}],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "uni-app",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,100 @@
|
|||
<template>
|
||||
<view class="rain-detail-box">
|
||||
<view class="nav-bar">
|
||||
<u-icon name="arrow-left" color="#000" size="28" @click="backTo"></u-icon>
|
||||
<view class="title">
|
||||
{{stnm}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar" >
|
||||
<view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}">
|
||||
监测数据
|
||||
</view>
|
||||
<view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}">
|
||||
统计数据
|
||||
</view>
|
||||
<view class="spjk" @click="activeOne = 3" :class="{'active':activeOne == 3}">
|
||||
视频监控
|
||||
</view>
|
||||
<view class="zbyq" @click="activeOne = 2" :class="{'active':activeOne == 2}">
|
||||
周边雨情
|
||||
</view>
|
||||
</view>
|
||||
<view class="rain-detail-content">
|
||||
<Jcsj :stcd="stcd" :source="source" :grz="grz" :wrz="wrz" v-if="activeOne == 0"/>
|
||||
<Tjsj :stcd="stcd" :source="source" v-else-if="activeOne == 1"/>
|
||||
<Spjk :stcd="stcd" :source="source" v-else-if="activeOne == 3"/>
|
||||
<Zbyq :stcd="stcd" v-else-if="activeOne == 2"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Jcsj from "./jcsj/jcsj.vue"
|
||||
import Tjsj from "./tjsj/tjsj.vue"
|
||||
import Zbyq from "./zbyq/zbyq.vue"
|
||||
import Spjk from "./spjk/spjk.vue"
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
activeOne:0,
|
||||
stcd:'',
|
||||
stnm:'',
|
||||
source:'',
|
||||
wrz:'',
|
||||
grz:''
|
||||
}
|
||||
},
|
||||
components:{
|
||||
Jcsj,
|
||||
Tjsj,
|
||||
Zbyq,
|
||||
Spjk,
|
||||
},
|
||||
methods:{
|
||||
backTo(){
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.stcd = option.stcd;
|
||||
this.stnm = option.stnm;
|
||||
this.source = option.source;
|
||||
this.grz = option.grz;
|
||||
this.wrz = option.wrz;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rain-detail-box{
|
||||
.nav-bar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
box-shadow: 0 5px 10px -8px #dfdfdf inset;
|
||||
}
|
||||
.title{
|
||||
flex:1;
|
||||
text-align: center;
|
||||
margin-right: 18px;
|
||||
}
|
||||
.tab-bar{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px 30px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
}
|
||||
.active{
|
||||
color: #39a6ff;
|
||||
}
|
||||
.rain-detail-content{
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
|
||||
import echarts from 'echarts/lib/echarts';
|
||||
|
||||
export default function DrpOption(data=[],wrz,grz) {
|
||||
const maxVal = Math.max(...data.map(obj => obj.drp))
|
||||
const maxSw = Math.max(...data.map(obj => obj.z))
|
||||
const minSw = Math.min(...data.map(obj => obj.z))
|
||||
const maxLl = Math.max(...data.map(obj => obj.tq))
|
||||
const minLl = Math.min(...data.map(obj => obj.tq))
|
||||
let eopts = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
grid: [
|
||||
{
|
||||
top: "13%",
|
||||
left: "10%",
|
||||
right: "8%",
|
||||
width: '80%',
|
||||
height: '35%'
|
||||
},
|
||||
{
|
||||
bottom: "5%",
|
||||
left: "10%",
|
||||
right: "8%",
|
||||
width: '80%',
|
||||
height: '35%'
|
||||
},
|
||||
],
|
||||
legend: {
|
||||
// 显示图例
|
||||
show: true,
|
||||
// 图例的位置
|
||||
data: ['警戒水位', '危险水位', "降雨量", "水位", "转换流量"],
|
||||
left:3,
|
||||
right:0,
|
||||
itemWidth:16,
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
gridIndex: 0,
|
||||
type: 'category',
|
||||
data: data.map(o => o.tm).reverse(),
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
show:false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.5,
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
gridIndex: 1,
|
||||
type: 'category',
|
||||
data: data.map(o => o.tm.substr("2020-".length,11)),
|
||||
inverse: true,
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
formatter: val => val.substr('2020-'.length, 11)
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.5,
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
inverse: true,
|
||||
gridIndex: 0,
|
||||
type: 'value',
|
||||
position: 'left',
|
||||
name: "降雨量(mm)",
|
||||
nameLocation: "start",
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dotted'
|
||||
}
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
min: 0,
|
||||
max: maxVal
|
||||
},
|
||||
{
|
||||
gridIndex: 1,
|
||||
type: 'value',
|
||||
position: 'left',
|
||||
name: "水位(m)",
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dotted'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
min: minSw,
|
||||
max: maxSw
|
||||
},
|
||||
{
|
||||
gridIndex: 1,
|
||||
type: 'value',
|
||||
position: 'right',
|
||||
name: "流量(m³/s)",
|
||||
splitLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dotted'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
min: minLl,
|
||||
max: maxLl
|
||||
}
|
||||
],
|
||||
}
|
||||
let chartData = {
|
||||
series: [
|
||||
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
name: '警戒水位',
|
||||
type: 'line',
|
||||
color: "#F59A23",
|
||||
barWidth: '60%',
|
||||
data: data.map(o => wrz),
|
||||
lineStyle: {
|
||||
type: "dashed"
|
||||
},
|
||||
symbol: 'none' // 设置标记点为'none',即去掉圆点
|
||||
},
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
name: '危险水位',
|
||||
type: 'line',
|
||||
color: "#D9001B",
|
||||
lineStyle: {
|
||||
type: "dashed"
|
||||
},
|
||||
data: data.map(o => grz),
|
||||
symbol: 'none' // 设置标记点为'none',即去掉圆点
|
||||
},
|
||||
{
|
||||
name: '降雨量',
|
||||
type: 'bar',
|
||||
barWidth: '60%',
|
||||
data: data.map(o => o.drp).reverse(),
|
||||
itemStyle: {
|
||||
color: "#007AFD",
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
name: '水位',
|
||||
type: 'line',
|
||||
symbol: 'none',
|
||||
color: "#0AE0B5",
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
data: data.map(o => o.z ? o.z.toFixed(2) : null),
|
||||
},
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 2,
|
||||
name: '转换流量',
|
||||
type: 'line',
|
||||
color: "#007AFD",
|
||||
symbol: 'none',
|
||||
showSymbol: false,
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
data: data.map(o => o.tq),
|
||||
}
|
||||
]
|
||||
}
|
||||
return {
|
||||
eopts,
|
||||
chartData
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
<template>
|
||||
<view class="jcsj-box">
|
||||
<view class="time-ranger">
|
||||
<uni-datetime-picker type="datetimerange" v-model="tm" @change="handleRanger"></uni-datetime-picker>
|
||||
<view class="search-btn" @click="searchHandle">
|
||||
搜索
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="" style="width: 100%; height: 3px; background-color: #dfdfdf; margin-bottom: 2px;">
|
||||
|
||||
" </view> -->
|
||||
<view style="text-align: right; margin-bottom: -15px;">
|
||||
<text :class="{'active':selactOne == 0}" @click="selactOne = 0" style="display: inline-block; padding: 2px 20px; text-align: center; border: 1px solid #dfdfdf;">图</text>
|
||||
<text :class="{'active':selactOne == 1}" @click="selactOne = 1" style="display: inline-block; padding: 2px 20px; text-align: center; border: 1px solid #dfdfdf;">表</text>
|
||||
</view>
|
||||
<view class="jcsj-charts" v-if="selactOne == 0">
|
||||
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
|
||||
</view>
|
||||
<view style="margin-top: 20px;" v-if="selactOne == 1">
|
||||
<JcsjTable :tableData="tableData" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
import JcsjTable from "./jcsjTable"
|
||||
import drpOption from "./chartOption.js"
|
||||
const stm = moment().subtract(7, 'days').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
|
||||
const etm = moment().add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
source:String,
|
||||
wrz:String,
|
||||
grz:String,
|
||||
default:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tm:[stm,etm],
|
||||
tableData:[],
|
||||
chartData: {},
|
||||
rainChartData:[],
|
||||
selactOne:0
|
||||
}
|
||||
},
|
||||
components:{
|
||||
JcsjTable
|
||||
},
|
||||
watch:{
|
||||
rainChartData(newV, oldV){
|
||||
this.chartData = {...drpOption(newV,this.grz,this.wrz)}
|
||||
this.tableData = [...newV]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleRanger(e){
|
||||
console.log(e);
|
||||
this.tm = [...e]
|
||||
},
|
||||
// 搜索
|
||||
async getJcsjData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/river/water/monitor/data",
|
||||
{
|
||||
stcd:this.stcd,
|
||||
stm:moment(this.tm[0]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
etm:moment(this.tm[1]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
source:this.source
|
||||
})
|
||||
if(data.code == 200){
|
||||
this.rainChartData = [...data.data];
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg();
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
searchHandle(){
|
||||
this.getJcsjData();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getJcsjData();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.jcsj-box{
|
||||
.time-ranger{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
.search-btn{
|
||||
margin: 3px 0 0 5px;
|
||||
color: #3399ef;
|
||||
}
|
||||
}
|
||||
.jcsj-charts{
|
||||
width:100%;
|
||||
height: 530px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.active{
|
||||
border-color: #68bbff !important;
|
||||
color: #68bbff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<template>
|
||||
<div class="table_div">
|
||||
<div class="table_cur">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 40px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 80px">时间</th>
|
||||
<th style="width: 80px;">
|
||||
雨量(mm)
|
||||
</th>
|
||||
<th style="width: 90px;">
|
||||
水位(m)
|
||||
</th>
|
||||
<th style="width: 80px; position: relative;">
|
||||
<view>
|
||||
转换流量<br>
|
||||
<text style="position: absolute; bottom:-10px; left: 20px;">(m³/s)</text>
|
||||
</view>
|
||||
</th>
|
||||
</tr>
|
||||
<div style="max-height: 480px; overflow-y: auto">
|
||||
<tr v-for="(item, index) in newList" :key="index">
|
||||
<td style="width: 30px">{{ index + 1 }}</td>
|
||||
<td style="width: 80px;">{{ item.tm }}</td>
|
||||
<td style="width: 80px">{{ item.drp }}</td>
|
||||
<td style="width: 100px">{{ item.z ? item.z.toFixed(2) : "-" }}</td>
|
||||
<td style="width: 80px">{{ item.tq ? item.tq : "-" }}</td>
|
||||
</tr>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
export default {
|
||||
props:{
|
||||
tableData:{
|
||||
type:Array,
|
||||
default:[],
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
newList(){
|
||||
if(this.tableData.length){
|
||||
return this.tableData.map(item => ({...item,tm:moment(item.tm).format("MM-DD HH:mm")}))
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table_div {
|
||||
height: 100%;
|
||||
max-width: calc(100% - 0px);
|
||||
max-height: calc(100vh);
|
||||
flex: 1;
|
||||
padding-top: 0px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
/*table样式*/
|
||||
.table_cur {
|
||||
width: 100%;
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
}
|
||||
.table_cur tr {
|
||||
display: flex;
|
||||
line-height: 75rpx;
|
||||
}
|
||||
.table_cur th {
|
||||
height: 85rpx;
|
||||
color: #3399ef;
|
||||
background: #e1f3ff;
|
||||
font-size: 14px;
|
||||
// font-weight: bold;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.table_cur td {
|
||||
height: 65rpx;
|
||||
// border-bottom: 1px solid #d8ddeb;
|
||||
font-size: 14px;
|
||||
color: #2f4056;
|
||||
padding: 0 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
/*table样式 end*/
|
||||
</style>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<template>
|
||||
<view class="spjk-box">
|
||||
<view class="select-bar">
|
||||
<uni-data-select
|
||||
v-model="value"
|
||||
:localdata="list"
|
||||
@change="change"
|
||||
:clear="false"
|
||||
>
|
||||
</uni-data-select>
|
||||
</view>
|
||||
<view
|
||||
class="video-box" v-if="this.list.length">
|
||||
<!-- <web-view :src="webURL" style="height: 500px;"></web-view> -->
|
||||
<video id="video-element" controls=""></video>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import flvjs from "@/node_modules/flv.js/dist/flv.min.js"
|
||||
// import 'es6-promise/auto';
|
||||
// import flvjs from "flv.js"
|
||||
export default{
|
||||
props:{
|
||||
stcd:String,
|
||||
source:String,
|
||||
default:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: "",
|
||||
list:[],
|
||||
webURL:'',
|
||||
urls:"",
|
||||
flv:null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList(){
|
||||
try{
|
||||
const {data} = await uni.$http.get(
|
||||
`/gunshiApp/xfflood/stbprp/cctv/listByStcd/${this.stcd}`)
|
||||
if(data.code == 200){
|
||||
let newData;
|
||||
console.log("23",data.data);
|
||||
if(data.data.length > 0){
|
||||
newData = data.data.map(item => ({...item,value:item.camId,text:item.name}))
|
||||
this.list = [...newData];
|
||||
this.value = newData[0].value
|
||||
this.getVideoSrc(newData[0].camId)
|
||||
}
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
async getVideoSrc(id){
|
||||
console.log(id);
|
||||
try{
|
||||
const {data} = await uni.$http.get(
|
||||
`/gunshiApp/xfflood/xfCctvB/preview/${id}`)
|
||||
if(data.code == 200){
|
||||
console.log(data.data);
|
||||
this.urls = data.data;
|
||||
this.webURL="/static/h5Player/webplayer.html?cameraIndexCode="+id+"&cameraUrl="+data.data
|
||||
this.flv.updateConfig({ url: data.data })
|
||||
this.flv.load()
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
console.log("e:", e);
|
||||
this.getVideoSrc(e)
|
||||
},
|
||||
creatFlvElement(){
|
||||
const videoElement = document.getElementById('video-element'); // 获取视频元素
|
||||
const flvPlayer = flvjs.createPlayer({
|
||||
type: 'flv',
|
||||
url: '' // WebSocket 流地址
|
||||
});
|
||||
|
||||
flvPlayer.attachMediaElement(videoElement); // 将播放器与视频元素绑定
|
||||
flvPlayer.load(); // 加载视频流
|
||||
flvPlayer.play(); // 播放视频
|
||||
this.flv = flvPlayer;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
// this.creatFlvElement()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.spjk-box{
|
||||
.select-bar{
|
||||
margin: 10px 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
<template>
|
||||
<view class="tjsj-box">
|
||||
<uni-row class="tjsj-row" :width="700">
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近1h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h1||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近3h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h3||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近6h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h6||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近12h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h12||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近24h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h24||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近48h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h48||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">今日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.today||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">昨日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yesterdayDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本月雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.monthDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本年雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yearDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本年降雨天数</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yearDrpDay||0}}/{{days}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row" >本年最大日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row" style="display: flex; justify-content: center;">
|
||||
<text>{{tableData.maxDrp||0}}</text>
|
||||
<text style="color: #E69224;">({{maxDrpTime}})</text>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">24h水位变幅(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.rzDiff > 0 ? "+" :"" }}{{tableData.rzDiff?tableData.rzDiff.toFixed(2) : 0}}</view>
|
||||
</uni-col> <uni-col :span="12">
|
||||
<view class="first-row" style="border-bottom: 1px solid #dfdfdf;">本年最高水位(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row" style="border-bottom: 1px solid #dfdfdf;">{{tableData.maxRz ? tableData.maxRz.toFixed(2) :0}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
source:String,
|
||||
default:''
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
tableData:{},
|
||||
days:moment().diff(moment().startOf('year'),'days')+1
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
maxDrpTime(){
|
||||
if(this.tableData.maxDrpTime){
|
||||
return moment(this.tableData.maxDrpTime).format("YYYY-MM-DD")
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getTableData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
`/gunshiApp/xfflood/river/water/detail`,{
|
||||
source:this.source,
|
||||
stcd:this.stcd,
|
||||
type:1
|
||||
}
|
||||
)
|
||||
if(data.code == 200){
|
||||
this.tableData = {...data.data};
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tjsj-box{
|
||||
.tjsj-row{
|
||||
.first-row{
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
border-left: 1px solid #dfdfdf;
|
||||
}
|
||||
.second-row{
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
border-left: 1px solid #dfdfdf;
|
||||
border-right: 1px solid #dfdfdf;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<view class="list-box">
|
||||
<uni-row class="list-row" >
|
||||
<uni-col :span="12">
|
||||
<view class="first-row" style="margin-left: 10px;">
|
||||
<text style="display: inline-block; margin-bottom: 10px; font-weight: bold;">{{info.stnm}}</text>
|
||||
<view>
|
||||
<text style="margin-right: 60px; color: #aaaaaa;">{{sttype[info.source]}}</text>
|
||||
<text style="color: #aaaaaa;">{{info.distance ? info.distance.toFixed(2) : 0}}km</text>
|
||||
</view>
|
||||
<text style="color: #aaaaaa;">{{info.tm}}</text>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12" >
|
||||
<view class="second-row" style="border: 1px solid #dfdfdf; font-size: 12px;border-bottom: 1px solid #dfdfdf;">
|
||||
<view style="display: flex;">
|
||||
<view style="flex:0.5; background-color: #e1f3ff; border-right: 1px solid #dfdfdf; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
1h(mm)
|
||||
</view>
|
||||
<view style="flex: 0.5; background-color: #e1f3ff;text-align: center; border-bottom:1px solid #dfdfdf" >
|
||||
3h(mm)
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex: 0.5; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
{{info.h1}}
|
||||
</view>
|
||||
<view style="flex: 0.5; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
{{info.h3}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex:0.5; background-color: #e1f3ff; border-right: 1px solid #dfdfdf; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
6h(mm)
|
||||
</view>
|
||||
<view style="flex: 0.5; background-color: #e1f3ff;text-align: center; border-bottom:1px solid #dfdfdf" >
|
||||
24h(mm)
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex: 0.5; text-align: center; border-right: 1px solid #dfdfdf;">
|
||||
{{info.h6}}
|
||||
</view>
|
||||
<view style="flex: 0.5; text-align: center; ">
|
||||
{{info.h24}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
info:Object,
|
||||
default:{}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sttype: {
|
||||
"SH": '山洪',
|
||||
"SW": '水文',
|
||||
"QX": '气象',
|
||||
"SK": '水库',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list-box{
|
||||
.list-row{
|
||||
padding-bottom: 3px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
.second-row{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<view class="zbyq-box">
|
||||
<view class="search-bar">
|
||||
<u-search
|
||||
shape="square"
|
||||
:clearabled="true"
|
||||
:showAction="false"
|
||||
placeholder="请输入站点"
|
||||
height="40px"
|
||||
@change="inputChange"
|
||||
v-model="formData.value"
|
||||
></u-search>
|
||||
<image
|
||||
src="../../../static/images/filter.png"
|
||||
style="width: 20px; height: 20px; margin-right: 10px; margin-left: 10px;"
|
||||
@click="popupOpen = true"
|
||||
v-show="!popupOpen"
|
||||
>
|
||||
</image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view v-for="(item,index) in list" :key="index" style="margin-bottom: 5px;">
|
||||
<ResList :info="item" />
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="popupOpen" mode="right" @close="popupOpen=false" >
|
||||
<view style="padding: 30px 20px;">
|
||||
<text style="font-weight: bold;">按类型</text>
|
||||
<view style="margin-bottom: 10px; margin-left: -5px;">
|
||||
<u-checkbox-group
|
||||
v-model="formData.sources"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox
|
||||
:customStyle="{margin: '7px'}"
|
||||
v-for="(item, index) in checkboxList1"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
>
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<text style="font-weight: bold; margin-bottom: 5px;">按距离</text>
|
||||
<u--input
|
||||
placeholder="请输入"
|
||||
border="surround"
|
||||
type="number"
|
||||
v-model="formData.distance"
|
||||
style="width: 50%; margin-top: 5px;"
|
||||
></u--input>
|
||||
<view style="display: flex; margin-top: 170%;">
|
||||
<u-button text="重置" class="bottom-btn1"
|
||||
@click="formData = {...formData,sources,distance:1}"></u-button>
|
||||
<u-button text="确认" color="#d9001b" class="bottom-btn2" @click="popConfirm"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ResList from "./resList.vue"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
default:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popupOpen:false,
|
||||
sources:["SH","SW","QX","SK"],
|
||||
checkboxList1: [{
|
||||
name: '山洪',
|
||||
value: "SH"
|
||||
},
|
||||
{
|
||||
name: '水文',
|
||||
value: "SW"
|
||||
},
|
||||
{
|
||||
name: '气象',
|
||||
value: "QX"
|
||||
},
|
||||
{
|
||||
name: '水库',
|
||||
value: "SK"
|
||||
}
|
||||
],
|
||||
|
||||
formData:{
|
||||
value:'',
|
||||
sources:["SH","SW","QX","SK"],
|
||||
distance:1,
|
||||
stcd:this.stcd
|
||||
},
|
||||
list:[], //搜索结果
|
||||
saveList:[] //保存搜索结果
|
||||
}
|
||||
},
|
||||
components:{
|
||||
ResList
|
||||
},
|
||||
methods: {
|
||||
inputChange(e){
|
||||
console.log("e",e);
|
||||
if(!e) this.list = this.saveList;
|
||||
this.formData={...this.formData,value:e}
|
||||
let filterData = this.list.filter(item => item.stnm.indexOf(e) > -1);
|
||||
this.list = filterData;
|
||||
},
|
||||
checkboxChange(n) {
|
||||
console.log('change', n);
|
||||
this.formData = {...this.formData,sources:n};
|
||||
},
|
||||
popConfirm(){
|
||||
this.popupOpen = false
|
||||
this.getList()
|
||||
},
|
||||
async getList(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/attResBase/rainBasinDivision/queryNearbyRainStations",{...this.formData}
|
||||
)
|
||||
console.log("data",data);
|
||||
if(data.code == 200){
|
||||
this.list = [...data.data]
|
||||
this.saveList = [...data.data]
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.zbyq-box{
|
||||
.search-bar{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.content{
|
||||
margin-top: 10px;
|
||||
max-height: 580px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bottom-btn1{
|
||||
width: 100px;
|
||||
margin-left: 130px;
|
||||
}
|
||||
.bottom-btn2{
|
||||
width: 100px;
|
||||
margin-right: -12px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,32 +3,31 @@
|
|||
<div class="table_cur">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 50px">序号</th>
|
||||
<th style="width: 50px">站名</th>
|
||||
<th style="width: 100px">时段雨量(mm)</th>
|
||||
<th style="width: 100px">昨日降雨(mm)</th>
|
||||
<th style="width: 80px">所属政区</th>
|
||||
<th style="width: 50px;">
|
||||
<div style="margin-top: 6px;">序号</div>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<div style="margin-top: 6px;">站名</div></th>
|
||||
<th style="width: 70px;">
|
||||
<div>时段雨量</div>
|
||||
<div style="margin-top: -12px;">(mm)</div>
|
||||
</th>
|
||||
<th style="width: 70px;" >
|
||||
<div>昨日降雨</div>
|
||||
<div style="margin-top: -12px;">(mm)</div>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<div style="margin-top: 6px;">所属政区</div></th>
|
||||
</tr>
|
||||
<div style="max-height: 260px; overflow-y: auto">
|
||||
<tr>
|
||||
<td style="width: 50px">1</td>
|
||||
<td style="width: 50px">jj</td>
|
||||
<td style="width: 100px">5.7</td>
|
||||
<td style="width: 100px">5.7</td>
|
||||
<td style="width: 80px">讲下</td>
|
||||
<div style="max-height: 460px; overflow-y: auto">
|
||||
<tr v-for="(item, index) in list" :key="index">
|
||||
<td style="width: 50px">{{ index + 1 }}</td>
|
||||
<td style="width: 100px;color: #3399ef;" @click="jumpDetail(item)">{{ item.stnm }}</td>
|
||||
<td style="width: 70px">{{ item.drp }}</td>
|
||||
<td style="width: 70px">{{ item.yesDrp || 0 }}</td>
|
||||
<td style="width: 100px">{{ item.adnm }}</td>
|
||||
</tr>
|
||||
<!-- <tr v-for="(item, index) in tableData.data.data" :key="index">
|
||||
<td style="width: 62px">{{ index + 1 }}</td>
|
||||
<td style="width: 70%">{{ item.name }}</td>
|
||||
<td style="width: 50%">{{ item.drp }}</td>
|
||||
</tr> -->
|
||||
</div>
|
||||
|
||||
<!-- <tr>
|
||||
<td style="width: 62px">1</td>
|
||||
<td style="width: 70%">水库水库</td>
|
||||
<td style="width: 50%">11</td>
|
||||
</tr> -->
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -36,13 +35,29 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
list:{
|
||||
type:Array,
|
||||
default:[],
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
jumpDetail(params){
|
||||
console.log(123)
|
||||
uni.navigateTo({
|
||||
url:`/pages/rainDetail/rainDetail?stcd=${params.stcd}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table_div {
|
||||
height: 100%;
|
||||
max-width: calc(100% - 0px);
|
||||
max-height: calc(100vh - 24px);
|
||||
max-height: calc(100vh);
|
||||
flex: 1;
|
||||
padding-top: 0px;
|
||||
overflow-x: scroll;
|
||||
|
|
@ -59,19 +74,19 @@
|
|||
line-height: 56rpx;
|
||||
}
|
||||
.table_cur th {
|
||||
height: 56rpx;
|
||||
color: #2f4056;
|
||||
height: 80rpx;
|
||||
color: #3399ef;
|
||||
background: #e1f3ff;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
padding: 0 10px;
|
||||
// font-weight: bold;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.table_cur td {
|
||||
height: 56rpx;
|
||||
height: 65rpx;
|
||||
// border-bottom: 1px solid #d8ddeb;
|
||||
font-size: 14px;
|
||||
color: #2f4056;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
<template>
|
||||
<view class="rain-box">
|
||||
<view class="nav-bar">
|
||||
<u-icon name="arrow-left" color="#000" size="28"></u-icon>
|
||||
<u-icon name="arrow-left" color="#000" size="28" @click="backTo"></u-icon>
|
||||
<view class="">
|
||||
雨情
|
||||
</view>
|
||||
<!-- <u-icon name="arrow-right" color="#000" size="28"></u-icon> -->
|
||||
<cover-image
|
||||
src="../../static/images/filter.png"
|
||||
style="width: 20px; height: 20px; margin-right: 10px;"
|
||||
@click="()=>this.popupOpen = true"
|
||||
v-show="!this.popupOpen"
|
||||
src="../../static/images/filter.png"
|
||||
style="width: 20px; height: 20px; margin-right: 10px;"
|
||||
@click="popupOpen = true"
|
||||
v-show="!popupOpen"
|
||||
>
|
||||
</cover-image>
|
||||
</view>
|
||||
|
|
@ -18,20 +18,22 @@
|
|||
<view class="search-box">
|
||||
<view class="search-item">
|
||||
<view class="" @click="handleClick" >
|
||||
{{selecetItem[1] || columns[0][0]}}
|
||||
{{selecetItem.adnm == "全部" ? "咸丰县" : selecetItem.adnm || columns[0][0].adnm}}
|
||||
</view>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="switchIcon"></u-icon>
|
||||
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="!switchIcon"></u-icon>
|
||||
|
||||
<view class="rain-input">
|
||||
<view class="rain-input" style="width: 50%;">
|
||||
<u--input
|
||||
placeholder="请输入站点"
|
||||
prefixIcon="search"
|
||||
prefixIconStyle="font-size: 22px;color: #909399"
|
||||
@change="formData = {...formData,stArg:e}"
|
||||
:value="formData.stArg"
|
||||
></u--input>
|
||||
</view>
|
||||
<view class="" @click="handleClick1" >
|
||||
{{selecetItem1[1] || columns[0][0]}}
|
||||
<view class="" @click="handleClick1" >
|
||||
{{selecetItem1.basName == "全部" ? "流域" : selecetItem1.basName || "流域"}}
|
||||
</view>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="switchIcon1"></u-icon>
|
||||
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="!switchIcon1"></u-icon>
|
||||
|
|
@ -39,62 +41,51 @@
|
|||
</view>
|
||||
<!-- 单纯下拉 -->
|
||||
<view class="time-select">
|
||||
<view :class="{'jiangyu':true,'noClick':this.rainTime}" @click="(e)=>{
|
||||
if(this.rainTime){
|
||||
e.stopPropagation();
|
||||
return
|
||||
}
|
||||
this.jiangyu = !this.jiangyu}" >
|
||||
<text>{{selectJyOne ? "按昨日降雨排序" :"按时段降雨排序"}}</text>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="!this.jiangyu"></u-icon>
|
||||
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="this.jiangyu"></u-icon>
|
||||
<view :class="{'jiangyu':true,'noClick':rainTime}" @click="handleJiangyu" >
|
||||
<text>{{formData.orderType ? "按昨日降雨降序" :"按时段降雨降序"}}</text>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="!jiangyu"></u-icon>
|
||||
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="jiangyu"></u-icon>
|
||||
<view class="jiangyu-dropdown" v-show="this.jiangyu">
|
||||
<view :class="{'active': this.selectJyOne == 0}" @click="()=>this.selectJyOne = 0" style="border-bottom: 1px solid #dfdfdf; border-top: 1px solid #dfdfdf; padding: 10px 0; display: flex; align-items: center;">
|
||||
<text style="margin-right: 220px;">按时段降雨排序</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="this.selectJyOne == 0"></u-icon>
|
||||
<view :class="{'active': formData.orderType == 0}" @click="rainsort(0)" style="border-bottom: 1px solid #dfdfdf; border-top: 1px solid #dfdfdf; padding: 10px 0; display: flex; align-items: center;">
|
||||
<text style="margin-right: 220px;">按时段降雨降序</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="formData.orderType == 0"></u-icon>
|
||||
</view>
|
||||
<view :class="{'active': this.selectJyOne == 1}" @click="()=>this.selectJyOne = 1" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<text style="margin-right: 220px;">按昨日降雨排序</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="this.selectJyOne == 1"></u-icon>
|
||||
|
||||
<view :class="{'active':formData.orderType == 1}" @click="rainsort(1)" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<text style="margin-right: 220px;">按昨日降雨降序</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="formData.orderType == 1"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rain-time" @click="(e)=>{
|
||||
if(this.jiangyu){
|
||||
e.stopPropagation();
|
||||
return
|
||||
}
|
||||
this.rainTime = !this.rainTime}">
|
||||
<text>{{selectTimeOne == 0 ? "1h" :
|
||||
selectTimeOne == 1 ? "3h" :
|
||||
selectTimeOne == 2 ? "6h" :
|
||||
selectTimeOne == 3 ? "12h" :
|
||||
selectTimeOne == 4 ? "24h" : ''
|
||||
<view class="rain-time" @click="handleTime">
|
||||
<text>{{formData.timeType == 1 ? "1h" :
|
||||
formData.timeType == 3 ? "3h" :
|
||||
formData.timeType == 6 ? "6h" :
|
||||
formData.timeType == 12 ? "12h" :
|
||||
formData.timeType == 24 ? "24h" : ''
|
||||
|
||||
}}</text>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="!this.rainTime"></u-icon>
|
||||
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="this.rainTime"></u-icon>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="!rainTime"></u-icon>
|
||||
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="rainTime"></u-icon>
|
||||
<view class="rain-time-dropdown" v-show="rainTime">
|
||||
<view class="" :class="{'active': this.selectTimeOne == 0}" @click="()=>this.selectTimeOne = 0" style="border-bottom: 1px solid #dfdfdf; border-top: 1px solid #dfdfdf; padding: 10px 0; display: flex; align-items: center;">
|
||||
<view class="" :class="{'active': formData.timeType == 1}" @click="timesort(1)" style="border-bottom: 1px solid #dfdfdf; border-top: 1px solid #dfdfdf; padding: 10px 0; display: flex; align-items: center;">
|
||||
<text style="margin-right: 300px;">1h</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="this.selectTimeOne == 0"></u-icon>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="formData.timeType == 1"></u-icon>
|
||||
</view>
|
||||
<view class="" :class="{'active': this.selectTimeOne == 1}" @click="()=>this.selectTimeOne = 1" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<view class="" :class="{'active': formData.timeType == 3}" @click="timesort(3)" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<text style="margin-right: 300px;">3h</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="this.selectTimeOne == 1"></u-icon>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="formData.timeType == 3"></u-icon>
|
||||
</view>
|
||||
<view class="" :class="{'active': this.selectTimeOne == 2}" @click="()=>this.selectTimeOne = 2" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<view class="" :class="{'active': formData.timeType == 6}" @click="timesort(6)" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<text style="margin-right: 300px;">6h</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="this.selectTimeOne == 2"></u-icon>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="formData.timeType == 6"></u-icon>
|
||||
</view>
|
||||
<view class="" :class="{'active': this.selectTimeOne == 3}" @click="()=>this.selectTimeOne = 3" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<view class="" :class="{'active': formData.timeType == 12}" @click="timesort(12)" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<text style="margin-right: 300px;">12h</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="this.selectTimeOne == 3"></u-icon>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="formData.timeType == 12"></u-icon>
|
||||
</view>
|
||||
<view class="" :class="{'active': this.selectTimeOne == 4}" @click="()=>this.selectTimeOne = 4" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<view class="" :class="{'active': formData.timeType == 24}" @click="timesort(24)" style="border-bottom: 1px solid #dfdfdf; padding-bottom: 10px; display: flex; align-items: center;">
|
||||
<text style="margin-right: 300px;">24h</text>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="this.selectTimeOne == 4"></u-icon>
|
||||
<u-icon name="checkmark" color="#02a7f0" size="20" v-show="formData.timeType == 24"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -106,10 +97,10 @@
|
|||
</view>
|
||||
<!-- 时间段 -->
|
||||
<view style="padding: 5px 10px; text-align: center; color: #f7b156;">
|
||||
统计时段:2024-04-25 10:00至2024-04-26 10:00
|
||||
统计时段:{{tm.stm}}至{{tm.etm}}
|
||||
</view>
|
||||
<view style="margin: 0 10px;">
|
||||
<Table />
|
||||
<Table :list="rainList"/>
|
||||
</view>
|
||||
<u-picker
|
||||
:show="show"
|
||||
|
|
@ -118,23 +109,24 @@
|
|||
@confirm="confirm"
|
||||
@change="changeHandler"
|
||||
@cancel="cancel"
|
||||
keyName="adnm"
|
||||
>
|
||||
</u-picker>
|
||||
<u-picker
|
||||
:show="show1"
|
||||
ref="uPicker1"
|
||||
:columns="columns"
|
||||
:columns="columns1"
|
||||
@confirm="confirm1"
|
||||
@change="changeHandler1"
|
||||
@cancel="cancel1"
|
||||
keyName="basName"
|
||||
>
|
||||
</u-picker>
|
||||
<u-popup :show="popupOpen" mode="right" @close="()=>this.popupOpen=false" >
|
||||
<u-popup :show="popupOpen" mode="right" @close="popupOpen=false" >
|
||||
<view style="padding: 30px 20px;">
|
||||
<text style="font-weight: bold;">按类型</text>
|
||||
<view style="margin-bottom: 10px; margin-left: -5px;">
|
||||
<u-checkbox-group
|
||||
v-model="checkboxValue1"
|
||||
v-model="formData.source"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox
|
||||
|
|
@ -147,21 +139,24 @@
|
|||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<text style="font-weight: bold;">按时间</text>
|
||||
|
||||
|
||||
<!-- <text style="font-weight: bold;">按时间</text>
|
||||
<view class="example-body" style="display: flex; align-items: center; margin-bottom: 10px; margin-top: 10px;">
|
||||
<uni-datetime-picker type="datetime" v-model="startTm" @change="(e) => this.startTm = e" />
|
||||
<uni-datetime-picker type="datetime" v-model="stm" @change="(e) => this.stm = e" />
|
||||
<text style="margin-left: 10px;">至</text>
|
||||
</view>
|
||||
<view class="example-body" style="width: 92%;">
|
||||
<uni-datetime-picker type="datetime" v-model="endTm" @change="(e) => this.EndTm = e" />
|
||||
<uni-datetime-picker type="datetime" v-model="etm" @change="(e) => this.etm = e" />
|
||||
</view>
|
||||
<view style="display: flex; margin-top: 10px;">
|
||||
<u-button class="first-btn" text="昨日08:00~当前时间"></u-button>
|
||||
<u-button class="second-btn" text="今天08:00~当前时间"></u-button>
|
||||
</view>
|
||||
<view style="display: flex; margin-top: 140%;">
|
||||
<u-button text="重置" class="bottom-btn1"></u-button>
|
||||
<u-button text="确认" color="#d9001b" class="bottom-btn2"></u-button>
|
||||
</view> -->
|
||||
<view style="display: flex; margin-top: 240%;">
|
||||
<u-button text="重置" class="bottom-btn1"
|
||||
@click="formData = {...formData,source}"></u-button>
|
||||
<u-button text="确认" color="#d9001b" class="bottom-btn2" @click="popupOpen = false"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
|
@ -171,6 +166,7 @@
|
|||
<script>
|
||||
import Table from "./Table"
|
||||
import filter from "../../static/images/filter.png"
|
||||
import moment from "moment"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -178,14 +174,16 @@
|
|||
show1:false,
|
||||
switchIcon:true,
|
||||
switchIcon1:true,
|
||||
selecetItem:[],
|
||||
selecetItem1:[],
|
||||
rainList:[],//雨情数据
|
||||
selecetItem:{},
|
||||
selecetItem1:{},
|
||||
jiangyu:false, //显示下拉
|
||||
rainTime:false, //显示下拉,
|
||||
selectJyOne:1,//选中降雨最后一个元素,
|
||||
selectTimeOne:4, //选中时间的最有一个元素
|
||||
popupOpen:false, //抽屉打开
|
||||
checkboxValue1:["SH","SW","QX","SK"],
|
||||
source:["SH","SW","QX","SK"],
|
||||
// checkboxValue1:["SH","SW","QX","SK"],
|
||||
// 基本案列数据
|
||||
checkboxList1: [{
|
||||
name: '山洪',
|
||||
|
|
@ -204,22 +202,70 @@
|
|||
value: "SK"
|
||||
}
|
||||
],
|
||||
startTm: '', //开始时间,
|
||||
endTm:"",//结束时间
|
||||
columns: [
|
||||
['中国', '美国'],
|
||||
['深圳', '厦门', '上海', '拉萨']
|
||||
stm: '', //开始时间,
|
||||
etm:"",//结束时间
|
||||
columns: //政区下拉
|
||||
[
|
||||
[{"adnm": "咸丰县", "adcd": "422826100000000"}],[]
|
||||
],
|
||||
columnData: [
|
||||
['深圳', '厦门', '上海', '拉萨'],
|
||||
['得州', '华盛顿', '纽约', '阿拉斯加']
|
||||
]
|
||||
columnData: [[]],
|
||||
columns1:[[]], //流域选择,
|
||||
formData:{ //表单数据
|
||||
timeType:24,
|
||||
orderType:1,
|
||||
basCode:'',
|
||||
source:["SH","SW","QX","SK"],
|
||||
stArg:'',
|
||||
etm:moment().set({ hour: 8, minute: 0, second: 0, millisecond: 0 }).format("YYYY-MM-DD HH:mm"),
|
||||
stm:moment().subtract(1, 'day').set({ hour: 8, minute: 0, second: 0, millisecond: 0 }).format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
}
|
||||
},
|
||||
components:{
|
||||
Table
|
||||
},
|
||||
computed:{
|
||||
tm(){
|
||||
return {
|
||||
stm:moment().subtract(this.formData.timeType, 'hours').format("YYYY-MM-DD HH:mm"),
|
||||
etm:moment().format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
formData(newV, oldV){
|
||||
console.log("www",newV)
|
||||
this.getRainList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleJiangyu(e){
|
||||
if(this.rainTime){
|
||||
e.stopPropagation();
|
||||
return
|
||||
}
|
||||
this.jiangyu = !this.jiangyu
|
||||
},
|
||||
handleTime(e){
|
||||
if(this.jiangyu){
|
||||
e.stopPropagation();
|
||||
return
|
||||
}
|
||||
this.rainTime = !this.rainTime
|
||||
},
|
||||
//按昨日降雨排序
|
||||
rainsort(e){
|
||||
this.formData = {...this.formData,orderType: e ? 1 : 0}
|
||||
},
|
||||
// 按小时排序
|
||||
timesort(e){
|
||||
this.formData = {
|
||||
...this.formData,
|
||||
stm:moment().subtract(e, 'hours').format("YYYY-MM-DD HH:mm"),
|
||||
etm:moment().format("YYYY-MM-DD HH:mm"),
|
||||
timeType:e
|
||||
}
|
||||
},
|
||||
changeHandler(e) {
|
||||
const {
|
||||
columnIndex,
|
||||
|
|
@ -239,8 +285,10 @@
|
|||
confirm(e) {
|
||||
console.log('confirm', e)
|
||||
this.show = false
|
||||
this.switchIcon=!this.switchIcon;
|
||||
this.selecetItem = [...e.value]
|
||||
this.switchIcon=true;
|
||||
this.selecetItem = e.value[1];
|
||||
// this.formData.adcd = e.value[1].adcd;
|
||||
this.formData = {...this.formData,adcd:e.value[1].adcd}
|
||||
},
|
||||
cancel(e) {
|
||||
this.show = false
|
||||
|
|
@ -264,27 +312,95 @@
|
|||
confirm1(e) {
|
||||
console.log('confirm', e)
|
||||
this.show1 = false
|
||||
this.switchIcon=!this.switchIcon;
|
||||
this.selecetItem1 = [...e.value]
|
||||
this.switchIcon1=true;
|
||||
this.selecetItem1 = e.value[0];
|
||||
this.formData = {...this.formData,basCode:e.value[0].basCode};
|
||||
},
|
||||
cancel1(e) {
|
||||
this.show1 = false
|
||||
},
|
||||
handleClick(){
|
||||
handleClick(e){
|
||||
if(this.selecetItem1.basName && this.selecetItem1.basName != "全部"){
|
||||
e.stopPropagation();
|
||||
return
|
||||
}
|
||||
this.show = true;
|
||||
this.switchIcon = !this.switchIcon
|
||||
},
|
||||
handleClick1(){
|
||||
handleClick1(e){
|
||||
if(this.selecetItem.adnm&&this.selecetItem.adnm != "全部"){
|
||||
e.stopPropagation();
|
||||
return
|
||||
}
|
||||
this.show1 = true;
|
||||
this.switchIcon1 = !this.switchIcon1
|
||||
},
|
||||
checkboxChange(n) {
|
||||
console.log('change', n);
|
||||
this.formData = {...this.formData,source:n};
|
||||
},
|
||||
changeLog(e) {
|
||||
console.log('change事件:', e);
|
||||
},
|
||||
}
|
||||
// 获取行政区域选择
|
||||
async adnmList(){
|
||||
try{
|
||||
const {data} = await uni.$http.get(
|
||||
"/gunshiApp/xfflood/real/rain/adnmList"
|
||||
)
|
||||
if(data.code == 200){
|
||||
|
||||
const all = {
|
||||
adnm:'全部',
|
||||
adcd:''
|
||||
}
|
||||
this.columns = [[...this.columns[0]],[all,...data.data]];
|
||||
this.columnData = [[all,...data.data]];
|
||||
}
|
||||
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
// 获取流域
|
||||
async basNameList(){
|
||||
try{
|
||||
const {data} = await uni.$http.get(
|
||||
"/gunshiApp/xfflood/real/rain/basNameList"
|
||||
)
|
||||
if(data.code == 200){
|
||||
const all = {
|
||||
basName:'全部',
|
||||
basCode:''
|
||||
}
|
||||
this.columns1 = [[all,...data.data]];
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
// 获取雨情列表
|
||||
async getRainList(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/real/rain/list",{...this.formData,timeType:undefined}
|
||||
)
|
||||
if(data.code == 200){
|
||||
this.rainList = [...data.data];
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
backTo(){
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.adnmList();
|
||||
this.basNameList()
|
||||
this.getRainList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -315,9 +431,7 @@
|
|||
background-color: #dddddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.rain-input{
|
||||
// width: 30%;
|
||||
}
|
||||
|
||||
}
|
||||
.time-select{
|
||||
position: relative;
|
||||
|
|
@ -336,7 +450,7 @@
|
|||
}
|
||||
.jiangyu{
|
||||
position: relative;
|
||||
.jiangyu-dropdown,{
|
||||
.jiangyu-dropdown{
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
width: 100vw;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,180 @@
|
|||
|
||||
import echarts from 'echarts/lib/echarts';
|
||||
|
||||
export default function DrpOption(echartData) {
|
||||
let totalDrp = 0;
|
||||
const DRPLEVEL = [10, 20, 50, 100, 250];
|
||||
const maxVal = DRPLEVEL.find(o => o > totalDrp);
|
||||
const xMaxVal = echartData?.actual ? DRPLEVEL.find(o => {
|
||||
let max = Math.max(...echartData?.actual || [])
|
||||
return o > max
|
||||
}):maxVal
|
||||
// const xMaxVal = Math.ceil(Math.max(...echartData.actual)) + 2
|
||||
const yMaxVal = echartData?.actual ? DRPLEVEL.find(o => {
|
||||
let max = Math.max(...echartData?.total)
|
||||
return o > max
|
||||
}): maxVal
|
||||
let eopts = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid:{
|
||||
x: 40,
|
||||
y: 30,
|
||||
x2: 30,
|
||||
y2: 28,
|
||||
borderWidth: 0
|
||||
},
|
||||
legend: {
|
||||
// 显示图例
|
||||
show: true,
|
||||
// 图例的位置
|
||||
data: ['实测', '累计']
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: echartData?.time.map(item => item.substr('2020--'.length)),
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
formatter: val => val.substr('2020-'.length, 11)
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.5,
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
position: 'left',
|
||||
name:"雨量mm",
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
min: 0,
|
||||
max: xMaxVal
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
position: 'right',
|
||||
name:"累计mm",
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
min: 0,
|
||||
max: yMaxVal
|
||||
}
|
||||
]
|
||||
}
|
||||
let chartData = {
|
||||
series: [
|
||||
{
|
||||
name: '实测',
|
||||
type: 'bar',
|
||||
barWidth: '60%',
|
||||
data: echartData?.actual,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: [3, 3, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(
|
||||
0, 0, 0, 1,
|
||||
[
|
||||
{ offset: 0, color: '#3876cd' },
|
||||
{ offset: 0.5, color: '#45b4e7' },
|
||||
{ offset: 1, color: '#54ffff' }
|
||||
]
|
||||
),
|
||||
},
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
markPoint: {
|
||||
data: [
|
||||
{ type: 'max', name: '最大值', symbol: 'circle', symbolSize: 1, symbolOffset: [0, -12] },
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
yAxisIndex: 1,
|
||||
name: '累计',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
data: echartData?.total,
|
||||
lineStyle: {
|
||||
normal: {
|
||||
width: 1,
|
||||
}
|
||||
},
|
||||
areaStyle: {
|
||||
normal: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
||||
offset: 0,
|
||||
color: 'rgba(3, 194, 236, 0.3)'
|
||||
}, {
|
||||
offset: 0.8,
|
||||
color: 'rgba(3, 194, 236, 0)'
|
||||
}
|
||||
], false),
|
||||
shadowColor: 'rgba(0, 0, 0, 0.1)',
|
||||
shadowBlur: 10
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#03C2EC'
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
return {
|
||||
eopts,
|
||||
chartData
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<template>
|
||||
<view class="jcsj-box">
|
||||
<view class="time-ranger">
|
||||
<uni-datetime-picker type="datetimerange" v-model="tm" @change="handleRanger"></uni-datetime-picker>
|
||||
<view class="search-btn" @click="searchHandle">
|
||||
搜索
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="" style="width: 100%; height: 3px; background-color: #dfdfdf; margin-bottom: 2px;">
|
||||
|
||||
</view> -->
|
||||
<view class="jcsj-charts">
|
||||
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts"/>
|
||||
</view>
|
||||
<view class="jcsj-table">
|
||||
<JcsjTable :tableData="tableData" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
import JcsjTable from "./jcsjTable"
|
||||
import drpOption from "./chartOption.js"
|
||||
const stm = moment().subtract(7, 'days').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
|
||||
const etm = moment().add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
default:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tm:[stm,etm],
|
||||
tableData:[],
|
||||
chartData: {},
|
||||
rainChartData:{},
|
||||
}
|
||||
},
|
||||
components:{
|
||||
JcsjTable
|
||||
},
|
||||
watch:{
|
||||
rainChartData(newV, oldV){
|
||||
this.chartData = {...drpOption(newV)}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleRanger(e){
|
||||
console.log(e);
|
||||
this.tm = [...e]
|
||||
},
|
||||
// 搜索
|
||||
async getJcsjData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/attResBase/rainBasinDivision/queryStStbprpPerHour/StcdAndStartTimeAndEndTime",
|
||||
{
|
||||
stcd:this.stcd,
|
||||
startTime:moment(this.tm[0]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
endTime:moment(this.tm[1]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
})
|
||||
if(data.code == 200){
|
||||
this.tableData = [...data.data]
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
// 获取图表数据
|
||||
async getRainChartData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/attResBase/rainBasinDivision/queryStStbprpPerHourChart/StcdAndStartTimeAndEndTime",
|
||||
{
|
||||
stcd:this.stcd,
|
||||
startTime:moment(this.tm[0]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
endTime:moment(this.tm[1]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
})
|
||||
console.log("data",data);
|
||||
if(data.code == 200){
|
||||
this.rainChartData = {...data.data}
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
searchHandle(){
|
||||
this.getJcsjData();
|
||||
this.getRainChartData()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getJcsjData()
|
||||
this.getRainChartData()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.jcsj-box{
|
||||
.time-ranger{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
.search-btn{
|
||||
margin: 3px 0 0 5px;
|
||||
color: #3399ef;
|
||||
}
|
||||
}
|
||||
.jcsj-charts{
|
||||
width:100%;
|
||||
height: 300px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<template>
|
||||
<div class="table_div">
|
||||
<div class="table_cur">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 50px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 200px">时间</th>
|
||||
<th style="width: 150px;">
|
||||
小时雨量(mm)
|
||||
</th>
|
||||
</tr>
|
||||
<div style="max-height: 320px; overflow-y: auto">
|
||||
<tr v-for="(item, index) in tableData" :key="index">
|
||||
<td style="width: 50px">{{ index + 1 }}</td>
|
||||
<td style="width: 200px;">{{ item.time }}</td>
|
||||
<td style="width: 150px">{{ item.sumDrp }}</td>
|
||||
</tr>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
tableData:{
|
||||
type:Array,
|
||||
default:[],
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table_div {
|
||||
height: 100%;
|
||||
max-width: calc(100% - 0px);
|
||||
max-height: calc(100vh);
|
||||
flex: 1;
|
||||
padding-top: 0px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
/*table样式*/
|
||||
.table_cur {
|
||||
width: 100%;
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
}
|
||||
.table_cur tr {
|
||||
display: flex;
|
||||
line-height: 65rpx;
|
||||
}
|
||||
.table_cur th {
|
||||
height: 65rpx;
|
||||
color: #3399ef;
|
||||
background: #e1f3ff;
|
||||
font-size: 14px;
|
||||
// font-weight: bold;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.table_cur td {
|
||||
height: 65rpx;
|
||||
// border-bottom: 1px solid #d8ddeb;
|
||||
font-size: 14px;
|
||||
color: #2f4056;
|
||||
padding: 0 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
/*table样式 end*/
|
||||
</style>
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<template>
|
||||
<view class="rain-detail-box">
|
||||
<view class="nav-bar">
|
||||
<u-icon name="arrow-left" color="#000" size="28" @click="backTo"></u-icon>
|
||||
<view class="title">
|
||||
雨情
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar" >
|
||||
<view class="jcsj" @click="()=>this.activeOne = 0" :class="{'active':this.activeOne == 0}">
|
||||
监测数据
|
||||
</view>
|
||||
<view class="tjsj" @click="()=>this.activeOne = 1" :class="{'active':this.activeOne == 1}">
|
||||
统计数据
|
||||
</view>
|
||||
<view class="zbyq" @click="()=>this.activeOne = 2" :class="{'active':this.activeOne == 2}">
|
||||
周边雨情
|
||||
</view>
|
||||
</view>
|
||||
<view class="rain-detail-content">
|
||||
<Jcsj :stcd="stcd" v-if="activeOne == 0"/>
|
||||
<Tjsj :stcd="stcd" v-else-if="activeOne == 1"/>
|
||||
<Zbyq :stcd="stcd" v-else-if="activeOne == 2"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Jcsj from "./jcsj/jcsj.vue"
|
||||
import Tjsj from "./tjsj/tjsj.vue"
|
||||
import Zbyq from "./zbyq/zbyq.vue"
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
activeOne:0,
|
||||
stcd:''
|
||||
}
|
||||
},
|
||||
components:{
|
||||
Jcsj,
|
||||
Tjsj,
|
||||
Zbyq
|
||||
},
|
||||
methods:{
|
||||
backTo(){
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.stcd = option.stcd
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rain-detail-box{
|
||||
.nav-bar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
box-shadow: 0 5px 10px -8px #dfdfdf inset;
|
||||
}
|
||||
.title{
|
||||
flex:1;
|
||||
text-align: center;
|
||||
}
|
||||
.tab-bar{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px 30px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
}
|
||||
.active{
|
||||
color: #39a6ff;
|
||||
}
|
||||
.rain-detail-content{
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
<template>
|
||||
<view class="tjsj-box">
|
||||
<uni-row class="tjsj-row" :width="700">
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近1h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h1||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近3h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h3||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近6h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h6||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近12h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h12||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近24h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h24||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近48h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h48||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">今日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.today||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">昨日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yesterdayDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本月雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.monthDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本年雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yearDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本年降雨天数</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yearDrpDay||0}}/{{days}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row" style="border-bottom: 1px solid #dfdfdf;">本年最大日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row" style="display: flex; justify-content: center; border-bottom: 1px solid #dfdfdf;">
|
||||
<text>{{tableData.maxDrp||0}}</text>
|
||||
<text style="color: #E69224;">({{maxDrpTime}})</text>
|
||||
</view>
|
||||
</uni-col>
|
||||
|
||||
</uni-row>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
default:''
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
tableData:{},
|
||||
days:moment().diff(moment().startOf('year'),'days')+1
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
maxDrpTime(){
|
||||
if(this.tableData.maxDrpTime){
|
||||
return moment(this.tableData.maxDrpTime).format("YYYY-MM-DD")
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getTableData(){
|
||||
console.log(this.stcd);
|
||||
try{
|
||||
const {data} = await uni.$http.get(
|
||||
`/gunshiApp/xfflood/attResBase/rainBasinDivision/queryStPptnDetails/stcd?stcd=${this.stcd}`
|
||||
)
|
||||
if(data.code == 200){
|
||||
this.tableData = {...data.data};
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tjsj-box{
|
||||
.tjsj-row{
|
||||
.first-row{
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
border-left: 1px solid #dfdfdf;
|
||||
}
|
||||
.second-row{
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
border-left: 1px solid #dfdfdf;
|
||||
border-right: 1px solid #dfdfdf;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<view class="list-box">
|
||||
<uni-row class="list-row" >
|
||||
<uni-col :span="12">
|
||||
<view class="first-row" style="margin-left: 10px;">
|
||||
<text style="display: inline-block; margin-bottom: 10px; font-weight: bold;">{{info.stnm}}</text>
|
||||
<view>
|
||||
<text style="margin-right: 60px; color: #aaaaaa;">{{sttype[info.source]}}</text>
|
||||
<text style="color: #aaaaaa;">{{info.distance ? info.distance.toFixed(2) : 0}}km</text>
|
||||
</view>
|
||||
<text style="color: #aaaaaa;">{{info.tm}}</text>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12" >
|
||||
<view class="second-row" style="border: 1px solid #dfdfdf; font-size: 12px;border-bottom: 1px solid #dfdfdf;">
|
||||
<view style="display: flex;">
|
||||
<view style="flex:0.5; background-color: #e1f3ff; border-right: 1px solid #dfdfdf; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
1h(mm)
|
||||
</view>
|
||||
<view style="flex: 0.5; background-color: #e1f3ff;text-align: center; border-bottom:1px solid #dfdfdf" >
|
||||
3h(mm)
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex: 0.5; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
{{info.h1}}
|
||||
</view>
|
||||
<view style="flex: 0.5; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
{{info.h3}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex:0.5; background-color: #e1f3ff; border-right: 1px solid #dfdfdf; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
6h(mm)
|
||||
</view>
|
||||
<view style="flex: 0.5; background-color: #e1f3ff;text-align: center; border-bottom:1px solid #dfdfdf" >
|
||||
24h(mm)
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex: 0.5; text-align: center; border-right: 1px solid #dfdfdf;">
|
||||
{{info.h6}}
|
||||
</view>
|
||||
<view style="flex: 0.5; text-align: center; ">
|
||||
{{info.h24}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
info:Object,
|
||||
default:{}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sttype: {
|
||||
"SH": '山洪',
|
||||
"SW": '水文',
|
||||
"QX": '气象',
|
||||
"SK": '水库',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list-box{
|
||||
.list-row{
|
||||
padding-bottom: 3px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
.second-row{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<view class="zbyq-box">
|
||||
<view class="search-bar">
|
||||
<u-search
|
||||
shape="square"
|
||||
:clearabled="true"
|
||||
:showAction="false"
|
||||
placeholder="请输入站点"
|
||||
height="40px"
|
||||
@change="inputChange"
|
||||
v-model="formData.value"
|
||||
></u-search>
|
||||
<image
|
||||
src="../../../static/images/filter.png"
|
||||
style="width: 20px; height: 20px; margin-right: 10px; margin-left: 10px;"
|
||||
@click="popupOpen = true"
|
||||
v-show="!popupOpen"
|
||||
>
|
||||
</image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view v-for="(item,index) in list" :key="index" style="margin-bottom: 5px;">
|
||||
<ResList :info="item" />
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="popupOpen" mode="right" @close="popupOpen=false" >
|
||||
<view style="padding: 30px 20px;">
|
||||
<text style="font-weight: bold;">按类型</text>
|
||||
<view style="margin-bottom: 10px; margin-left: -5px;">
|
||||
<u-checkbox-group
|
||||
v-model="formData.sources"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox
|
||||
:customStyle="{margin: '7px'}"
|
||||
v-for="(item, index) in checkboxList1"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
>
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<text style="font-weight: bold; margin-bottom: 5px;">按距离</text>
|
||||
<u--input
|
||||
placeholder="请输入"
|
||||
border="surround"
|
||||
type="number"
|
||||
v-model="formData.distance"
|
||||
style="width: 50%; margin-top: 5px;"
|
||||
></u--input>
|
||||
<view style="display: flex; margin-top: 170%;">
|
||||
<u-button text="重置" class="bottom-btn1"
|
||||
@click="formData = {...formData,sources,distance:1}"></u-button>
|
||||
<u-button text="确认" color="#d9001b" class="bottom-btn2" @click="popConfirm"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ResList from "./resList.vue"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
default:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popupOpen:false,
|
||||
sources:["SH","SW","QX","SK"],
|
||||
checkboxList1: [{
|
||||
name: '山洪',
|
||||
value: "SH"
|
||||
},
|
||||
{
|
||||
name: '水文',
|
||||
value: "SW"
|
||||
},
|
||||
{
|
||||
name: '气象',
|
||||
value: "QX"
|
||||
},
|
||||
{
|
||||
name: '水库',
|
||||
value: "SK"
|
||||
}
|
||||
],
|
||||
|
||||
formData:{
|
||||
value:'',
|
||||
sources:["SH","SW","QX","SK"],
|
||||
distance:1,
|
||||
stcd:this.stcd
|
||||
},
|
||||
list:[], //搜索结果
|
||||
saveList:[] //保存搜索结果
|
||||
}
|
||||
},
|
||||
components:{
|
||||
ResList
|
||||
},
|
||||
methods: {
|
||||
inputChange(e){
|
||||
console.log("e",e);
|
||||
if(!e) this.list = this.saveList;
|
||||
this.formData={...this.formData,value:e}
|
||||
let filterData = this.list.filter(item => item.stnm.indexOf(e) > -1);
|
||||
this.list = filterData;
|
||||
},
|
||||
checkboxChange(n) {
|
||||
console.log('change', n);
|
||||
this.formData = {...this.formData,sources:n};
|
||||
},
|
||||
popConfirm(){
|
||||
this.popupOpen = false
|
||||
this.getList()
|
||||
},
|
||||
async getList(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/attResBase/rainBasinDivision/queryNearbyRainStations",{...this.formData}
|
||||
)
|
||||
console.log("data",data);
|
||||
if(data.code == 200){
|
||||
this.list = [...data.data]
|
||||
this.saveList = [...data.data]
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.zbyq-box{
|
||||
.search-bar{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.content{
|
||||
margin-top: 10px;
|
||||
max-height: 580px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bottom-btn1{
|
||||
width: 100px;
|
||||
margin-left: 130px;
|
||||
}
|
||||
.bottom-btn2{
|
||||
width: 100px;
|
||||
margin-right: -12px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
|
||||
import echarts from 'echarts/lib/echarts';
|
||||
|
||||
export default function DrpOption(
|
||||
data,
|
||||
afsltdz,
|
||||
flLowLimLev,
|
||||
desFloodLev,
|
||||
calFloodLev) {
|
||||
const maxVal = Math.max(...data.map(obj => obj.drp))
|
||||
const maxSw = Math.ceil(Math.max(...data.map(obj => obj.rz)))
|
||||
const minSw = Math.floor(Math.min(...data.map(obj => obj.rz)))
|
||||
const maxKr = Math.max(...data.map(obj => obj.w))
|
||||
const minKr = Math.min(...data.map(obj => obj.w))
|
||||
let eopts = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
grid: [
|
||||
{
|
||||
top: "13%",
|
||||
left: "10%",
|
||||
right: "8%",
|
||||
width: '80%',
|
||||
height: '35%'
|
||||
},
|
||||
{
|
||||
bottom: "5%",
|
||||
left: "10%",
|
||||
right: "8%",
|
||||
width: '80%',
|
||||
height: '35%'
|
||||
},
|
||||
],
|
||||
legend: {
|
||||
// 显示图例
|
||||
show: true,
|
||||
// 图例的位置
|
||||
data: ["校核水位", '设计水位', '汛限水位', '降雨量', '水位', '库容'],
|
||||
left:0,
|
||||
right:0,
|
||||
itemWidth:10,
|
||||
padding:0
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
gridIndex: 0,
|
||||
type: 'category',
|
||||
data: data.map(o => o.tm).reverse(),
|
||||
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.5
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
gridIndex: 1,
|
||||
type: 'category',
|
||||
data: data.map(o => o.tm.substr("2020-".length,11)),
|
||||
inverse: true,
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12,
|
||||
formatter: val => val.substr('2020-'.length, 11)
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.5
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
inverse: true,
|
||||
gridIndex: 0,
|
||||
type: 'value',
|
||||
position: 'left',
|
||||
name: '降雨量(mm)',
|
||||
nameLocation: 'start',
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dotted'
|
||||
}
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
min: 0,
|
||||
max: maxVal
|
||||
},
|
||||
{
|
||||
gridIndex: 1,
|
||||
type: 'value',
|
||||
position: 'left',
|
||||
name: '水位(m)',
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dotted'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
min: minSw,
|
||||
max: maxSw
|
||||
},
|
||||
{
|
||||
gridIndex: 1,
|
||||
type: 'value',
|
||||
position: 'right',
|
||||
name: '库容(万m³)',
|
||||
splitLine: {
|
||||
show: false,
|
||||
lineStyle: {
|
||||
color: '#07a6ff',
|
||||
width: 0.25,
|
||||
type: 'dotted'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#333',
|
||||
fontSize: 12
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
min: minKr,
|
||||
max: maxKr
|
||||
}
|
||||
],
|
||||
}
|
||||
let chartData = {
|
||||
series: [
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
name: '校核水位',
|
||||
type: 'line',
|
||||
color: '#D9001B',
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
},
|
||||
data: data.map(o => calFloodLev),
|
||||
symbol: 'none' // 设置标记点为'none',即去掉圆点
|
||||
},
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
name: '设计水位',
|
||||
type: 'line',
|
||||
color: '#F59A23',
|
||||
data: data.map(o => desFloodLev),
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
},
|
||||
symbol: 'none' // 设置标记点为'none',即去掉圆点
|
||||
},
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
name: '汛限水位',
|
||||
type: 'line',
|
||||
color: '#FDDC9F',
|
||||
data: data.map(o => {
|
||||
return flLowLimLev
|
||||
}),
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
},
|
||||
symbol: 'none' // 设置标记点为'none',即去掉圆点
|
||||
},
|
||||
{
|
||||
name: '降雨量',
|
||||
type: 'bar',
|
||||
barWidth: '60%',
|
||||
data: data.map(o => o.drp).reverse(),
|
||||
itemStyle: {
|
||||
color: '#007AFD'
|
||||
},
|
||||
label: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 1,
|
||||
name: '水位',
|
||||
type: 'line',
|
||||
symbol: 'none',
|
||||
color: '#0AE0B5',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
data: data.map(o => o.rz ? o.rz.toFixed(2):null )
|
||||
},
|
||||
{
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 2,
|
||||
name: '库容',
|
||||
type: 'line',
|
||||
color: '#007AFD',
|
||||
symbol: 'none',
|
||||
showSymbol: false,
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
data: data.map(o => o.w)
|
||||
}
|
||||
],
|
||||
}
|
||||
return {
|
||||
eopts,
|
||||
chartData
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
<template>
|
||||
<view class="jcsj-box">
|
||||
<view class="time-ranger">
|
||||
<uni-datetime-picker type="datetimerange" v-model="tm" @change="handleRanger"></uni-datetime-picker>
|
||||
<view class="search-btn" @click="searchHandle">
|
||||
搜索
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="" style="width: 100%; height: 3px; background-color: #dfdfdf; margin-bottom: 2px;">
|
||||
|
||||
" </view> -->
|
||||
<view style="text-align: right; margin-bottom: -15px;">
|
||||
<text :class="{'active':selactOne == 0}" @click="selactOne = 0" style="display: inline-block; padding: 2px 20px; text-align: center; border: 1px solid #dfdfdf;">图</text>
|
||||
<text :class="{'active':selactOne == 1}" @click="selactOne = 1" style="display: inline-block; padding: 2px 20px; text-align: center; border: 1px solid #dfdfdf;">表</text>
|
||||
</view>
|
||||
<view class="jcsj-charts" v-if="selactOne == 0">
|
||||
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
|
||||
</view>
|
||||
<view style="margin-top: 20px;" v-if="selactOne == 1">
|
||||
<JcsjTable :tableData="tableData" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
import JcsjTable from "./jcsjTable"
|
||||
import drpOption from "./chartOption.js"
|
||||
const stm = moment().subtract(7, 'days').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
|
||||
const etm = moment().add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm");
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
source:String,
|
||||
wrz:String,
|
||||
grz:String,
|
||||
default:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tm:[stm,etm],
|
||||
tableData:[],
|
||||
chartData: {},
|
||||
rainChartData:[],
|
||||
selactOne:0
|
||||
}
|
||||
},
|
||||
components:{
|
||||
JcsjTable
|
||||
},
|
||||
watch:{
|
||||
rainChartData(newV, oldV){
|
||||
this.chartData = {...drpOption(newV,this.grz,this.wrz)}
|
||||
this.tableData = [...newV]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleRanger(e){
|
||||
console.log(e);
|
||||
this.tm = [...e]
|
||||
},
|
||||
// 搜索
|
||||
async getJcsjData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/reservoir/water/monitor/data",
|
||||
{
|
||||
stcd:this.stcd,
|
||||
stm:moment(this.tm[0]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
etm:moment(this.tm[1]).format("YYYY-MM-DD HH:mm:ss"),
|
||||
source:this.source
|
||||
})
|
||||
if(data.code == 200){
|
||||
this.rainChartData = [...data.data];
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg();
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
searchHandle(){
|
||||
this.getJcsjData();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getJcsjData();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.jcsj-box{
|
||||
.time-ranger{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
.search-btn{
|
||||
margin: 3px 0 0 5px;
|
||||
color: #3399ef;
|
||||
}
|
||||
}
|
||||
.jcsj-charts{
|
||||
width:100%;
|
||||
height: 530px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.active{
|
||||
border-color: #68bbff !important;
|
||||
color: #68bbff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<template>
|
||||
<div class="table_div">
|
||||
<div class="table_cur">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 40px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 80px">时间</th>
|
||||
<th style="width: 80px;">
|
||||
雨量(mm)
|
||||
</th>
|
||||
<th style="width: 90px;">
|
||||
水位(m)
|
||||
</th>
|
||||
<th style="width: 80px; position: relative;">
|
||||
<view>
|
||||
库容(万m³)
|
||||
<!-- <text style="position: absolute; bottom:-10px; left: 20px;">(m³/s)</text> -->
|
||||
</view>
|
||||
</th>
|
||||
</tr>
|
||||
<div style="max-height: 480px; overflow-y: auto">
|
||||
<tr v-for="(item, index) in newList" :key="index">
|
||||
<td style="width: 30px">{{ index + 1 }}</td>
|
||||
<td style="width: 80px;">{{ item.tm }}</td>
|
||||
<td style="width: 80px">{{ item.drp }}</td>
|
||||
<td style="width: 100px">{{ item.rz ? item.rz.toFixed(2) : "-" }}</td>
|
||||
<td style="width: 80px">{{ item.w ? item.w : "-" }}</td>
|
||||
</tr>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
export default {
|
||||
props:{
|
||||
tableData:{
|
||||
type:Array,
|
||||
default:[],
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
newList(){
|
||||
if(this.tableData.length){
|
||||
return this.tableData.map(item => ({...item,tm:moment(item.tm).format("MM-DD HH:mm")}))
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table_div {
|
||||
height: 100%;
|
||||
max-width: calc(100% - 0px);
|
||||
max-height: calc(100vh);
|
||||
flex: 1;
|
||||
padding-top: 0px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
/*table样式*/
|
||||
.table_cur {
|
||||
width: 100%;
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
}
|
||||
.table_cur tr {
|
||||
display: flex;
|
||||
line-height: 75rpx;
|
||||
}
|
||||
.table_cur th {
|
||||
height: 85rpx;
|
||||
color: #3399ef;
|
||||
background: #e1f3ff;
|
||||
font-size: 14px;
|
||||
// font-weight: bold;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.table_cur td {
|
||||
height: 65rpx;
|
||||
// border-bottom: 1px solid #d8ddeb;
|
||||
font-size: 14px;
|
||||
color: #2f4056;
|
||||
padding: 0 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
/*table样式 end*/
|
||||
</style>
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
<template>
|
||||
<view class="rain-detail-box">
|
||||
<view class="nav-bar">
|
||||
<u-icon name="arrow-left" color="#000" size="28" @click="backTo"></u-icon>
|
||||
<view class="title">
|
||||
{{stnm}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar">
|
||||
<uni-swiper-dot :info="Array(2).fill(0)" :current="current" field="content" :dotsStyles="dotsStyles">
|
||||
<swiper class="swiper-box" style="height: 30px;" @change="change">
|
||||
<swiper-item >
|
||||
<view style="display: flex;">
|
||||
<view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}">
|
||||
监测数据
|
||||
</view>
|
||||
<view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}" style="margin: 0 25px;">
|
||||
统计数据
|
||||
</view>
|
||||
<view class="tjsj" @click="activeOne = 2" :class="{'active':activeOne == 2}" style="margin: 0 25px 0 0;">
|
||||
责任体系
|
||||
</view>
|
||||
<view class="tjsj" @click="activeOne = 3" :class="{'active':activeOne == 3}" >
|
||||
图像监测
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item >
|
||||
<view style="display: flex;">
|
||||
<view class="spjk" @click="activeOne = 4" :class="{'active':activeOne == 4}">
|
||||
视频监控
|
||||
</view>
|
||||
<view class="zbyq" @click="activeOne = 5" :class="{'active':activeOne == 5}" style="margin-left: 25px;">
|
||||
周边雨情
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</uni-swiper-dot>
|
||||
|
||||
</view>
|
||||
<view class="rain-detail-content">
|
||||
<Jcsj :stcd="stcd" :source="source" :afsltdz="afsltdz" :flLowLimLev="flLowLimLev" :desFloodLev="desFloodLev" :calFloodLev="calFloodLev" v-if="activeOne == 0"/>
|
||||
<Tjsj :stcd="stcd" :source="source" v-else-if="activeOne == 1"/>
|
||||
<Zrtx :stcd="stcd" :source="source" :resCode="resCode" v-else-if="activeOne == 2"/>
|
||||
<Txjc :resCode="resCode" :source="source" v-else-if="activeOne == 3"/>
|
||||
<Spjk :stcd="stcd" :source="source" v-else-if="activeOne == 4"/>
|
||||
<Zbyq :stcd="stcd" v-else-if="activeOne == 5"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Jcsj from "./jcsj/jcsj.vue"
|
||||
import Tjsj from "./tjsj/tjsj.vue"
|
||||
import Zbyq from "./zbyq/zbyq.vue"
|
||||
import Spjk from "./spjk/spjk.vue"
|
||||
import Zrtx from "./zrtx/zrtx.vue"
|
||||
import Txjc from "./txjc/txjc.vue"
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
activeOne:0,
|
||||
stcd:'',
|
||||
stnm:'',
|
||||
source:'',
|
||||
wrz:'',
|
||||
grz:'',
|
||||
calFloodLev:'',
|
||||
desFloodLev:'',
|
||||
flLowLimLev:'',
|
||||
afsltdz:'',
|
||||
resCode:'',
|
||||
current:0,
|
||||
dotsStyles:{
|
||||
bottom:0,
|
||||
selectedBackgroundColor:"#d9001b"
|
||||
}
|
||||
}
|
||||
},
|
||||
components:{
|
||||
Jcsj,
|
||||
Tjsj,
|
||||
Zbyq,
|
||||
Spjk,
|
||||
Zrtx,
|
||||
Txjc
|
||||
},
|
||||
methods:{
|
||||
backTo(){
|
||||
uni.navigateBack({delta:1})
|
||||
},
|
||||
change(e) {
|
||||
console.log(e.detail.current);
|
||||
this.current = e.detail.current;
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.stcd = option.stcd;
|
||||
this.stnm = option.stnm;
|
||||
this.source = option.source;
|
||||
this.grz = option.grz;
|
||||
this.wrz = option.wrz;
|
||||
this.afsltdz = option.afsltdz;
|
||||
this.calFloodLev = option.calFloodLev;
|
||||
this.flLowLimLev = option.flLowLimLev;
|
||||
this.desFloodLev = option.desFloodLev;
|
||||
this.resCode = option.resCode;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rain-detail-box{
|
||||
.nav-bar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
box-shadow: 0 5px 10px -8px #dfdfdf inset;
|
||||
}
|
||||
.title{
|
||||
flex:1;
|
||||
text-align: center;
|
||||
margin-right: 18px;
|
||||
}
|
||||
.tab-bar{
|
||||
// width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 5px 30px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
// overflow-x: auto;
|
||||
}
|
||||
.active{
|
||||
color: #39a6ff;
|
||||
}
|
||||
.rain-detail-content{
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
<template>
|
||||
<view class="spjk-box">
|
||||
<view class="select-bar">
|
||||
<uni-data-select
|
||||
v-model="value"
|
||||
:localdata="list"
|
||||
@change="change"
|
||||
:clear="false"
|
||||
>
|
||||
</uni-data-select>
|
||||
</view>
|
||||
<view class="video-box">
|
||||
<!-- <video :src="videoObject.src" controls is-live="true"></video> -->
|
||||
|
||||
<!-- <HFivePlayer :wsUrl="videoObject" :size="1" :playerID="'111'"/> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import HFivePlayer from "../../../components/VideoPlay/videoPlay.vue"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
source:String,
|
||||
default:''
|
||||
},
|
||||
// components:{
|
||||
// HFivePlayer
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
value: "",
|
||||
list:[],
|
||||
videoObject:{},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList(){
|
||||
try{
|
||||
const {data} = await uni.$http.get(
|
||||
`/gunshiApp/xfflood/stbprp/cctv/listByStcd/${this.stcd}`)
|
||||
if(data.code == 200){
|
||||
let newData = data.data.map(item => ({...item,value:item.camId,text:item.name}))
|
||||
this.list = [...newData];
|
||||
this.value = newData[0].value
|
||||
this.getVideoSrc(newData[0].camId)
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
async getVideoSrc(id){
|
||||
try{
|
||||
const {data} = await uni.$http.get(
|
||||
`/gunshiApp/xfflood/xfCctvB/preview/${id}`)
|
||||
if(data.code == 200){
|
||||
console.log(data.data);
|
||||
this.videoObject = {src:data.data}
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
playStatus(val){
|
||||
if(val.type === 'success'){
|
||||
console.log('播放成功');
|
||||
}else{
|
||||
console.log('播放失败')
|
||||
console.log(val.msg)
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
console.log("e:", e);
|
||||
this.getVideoSrc(e)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.spjk-box{
|
||||
.select-bar{
|
||||
margin: 10px 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
<template>
|
||||
<view class="tjsj-box">
|
||||
<uni-row class="tjsj-row" :width="700">
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近1h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h1||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近3h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h3||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近6h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h6||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近12h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h12||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近24h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h24||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">近48h雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.h48||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">今日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.today||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">昨日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yesterdayDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本月雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.monthDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本年雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yearDrp||0}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">本年降雨天数</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.yearDrpDay||0}}/{{days}}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row" >本年最大日雨量(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row" style="display: flex; justify-content: center;">
|
||||
<text>{{tableData.maxDrp||0}}</text>
|
||||
<text style="color: #E69224;">({{maxDrpTime}})</text>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="first-row">24h水位变幅(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row">{{tableData.rzDiff > 0 ? "+" :"" }}{{tableData.rzDiff?tableData.rzDiff.toFixed(2) : 0}}</view>
|
||||
</uni-col> <uni-col :span="12">
|
||||
<view class="first-row" style="border-bottom: 1px solid #dfdfdf;">本年最高水位(mm)</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="second-row" style="border-bottom: 1px solid #dfdfdf;">{{tableData.maxRz ? tableData.maxRz.toFixed(2) :0}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
source:String,
|
||||
default:''
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
tableData:{},
|
||||
days:moment().diff(moment().startOf('year'),'days')+1
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
maxDrpTime(){
|
||||
if(this.tableData.maxDrpTime){
|
||||
return moment(this.tableData.maxDrpTime).format("YYYY-MM-DD")
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getTableData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
`/gunshiApp/xfflood/river/water/detail`,{
|
||||
source:this.source,
|
||||
stcd:this.stcd,
|
||||
type:2
|
||||
}
|
||||
)
|
||||
if(data.code == 200){
|
||||
this.tableData = {...data.data};
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tjsj-box{
|
||||
.tjsj-row{
|
||||
.first-row{
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
border-left: 1px solid #dfdfdf;
|
||||
}
|
||||
.second-row{
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
border-left: 1px solid #dfdfdf;
|
||||
border-right: 1px solid #dfdfdf;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<template>
|
||||
<view class="txjc-box">
|
||||
<view class="time-ranger">
|
||||
<uni-datetime-picker type="datetimerange" v-model="tm" @change="handleRanger"></uni-datetime-picker>
|
||||
<view class="search-btn" @click="searchHandle">
|
||||
搜索
|
||||
</view>
|
||||
</view>
|
||||
<view class="pic-box" style="margin-top: 20px; position: relative; height: 800px;">
|
||||
<!-- <u-album :urls="list" singleSize="360" rowCount="1"></u-album> -->
|
||||
<u-image :src="list[current]" width="380" height="400" mode="scaleToFill" :lazy-load="true" @click="previewImage"></u-image>
|
||||
<image src="../../../static/images/icon.png" @click="handleLeft" class="icon-left"></image>
|
||||
<image src="../../../static/images/icon.png" @click="handleRight" class="icon-right"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
const stm = moment().subtract(7, 'days').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm:ss");
|
||||
const etm = moment().add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm:ss");
|
||||
export default {
|
||||
props:{
|
||||
source:String,
|
||||
resCode:String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tm:[stm,etm],
|
||||
list:[],
|
||||
current:0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleLeft(){
|
||||
if(this.current > 0){
|
||||
this.current -= 1;
|
||||
}else{
|
||||
uni.$showMsg("已经是第一张图片了")
|
||||
}
|
||||
},
|
||||
handleRight(){
|
||||
if(this.list.length > this.current){
|
||||
this.current += 1;
|
||||
}else{
|
||||
uni.$showMsg("已经是最后一张图片了")
|
||||
}
|
||||
},
|
||||
// 预览图片
|
||||
previewImage(){
|
||||
uni.previewImage({
|
||||
urls:this.list
|
||||
})
|
||||
},
|
||||
handleRanger(e){
|
||||
this.tm = [...e]
|
||||
},
|
||||
// 搜索
|
||||
searchHandle(){
|
||||
this.getData()
|
||||
|
||||
},
|
||||
async getData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/river/water/image/info",
|
||||
{
|
||||
source:this.source,
|
||||
resCode:this.resCode,
|
||||
stm:this.tm[0],
|
||||
etm:this.tm[1],
|
||||
"pageSo": {
|
||||
"pageSize": 10,
|
||||
"pageNumber": 1
|
||||
}
|
||||
})
|
||||
if(data.code == 200){
|
||||
let newList = data.data.records.map(item =>item.imgPath)
|
||||
this.list = [...newList]
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.txjc-box{
|
||||
.time-ranger{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
.search-btn{
|
||||
margin: 3px 0 0 5px;
|
||||
color: #3399ef;
|
||||
}
|
||||
}
|
||||
.icon-left{
|
||||
position: absolute;
|
||||
top: 23%;
|
||||
transform: translateY(-50%);
|
||||
left: 0;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
.icon-right{
|
||||
position: absolute;
|
||||
top: 23%;
|
||||
transform: translateY(-50%) rotate(-180deg);
|
||||
right: 0;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<view class="list-box">
|
||||
<uni-row class="list-row" >
|
||||
<uni-col :span="12">
|
||||
<view class="first-row" style="margin-left: 10px;">
|
||||
<text style="display: inline-block; margin-bottom: 10px; font-weight: bold;">{{info.stnm}}</text>
|
||||
<view>
|
||||
<text style="margin-right: 60px; color: #aaaaaa;">{{sttype[info.source]}}</text>
|
||||
<text style="color: #aaaaaa;">{{info.distance ? info.distance.toFixed(2) : 0}}km</text>
|
||||
</view>
|
||||
<text style="color: #aaaaaa;">{{info.tm}}</text>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="12" >
|
||||
<view class="second-row" style="border: 1px solid #dfdfdf; font-size: 12px;border-bottom: 1px solid #dfdfdf;">
|
||||
<view style="display: flex;">
|
||||
<view style="flex:0.5; background-color: #e1f3ff; border-right: 1px solid #dfdfdf; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
1h(mm)
|
||||
</view>
|
||||
<view style="flex: 0.5; background-color: #e1f3ff;text-align: center; border-bottom:1px solid #dfdfdf" >
|
||||
3h(mm)
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex: 0.5; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
{{info.h1}}
|
||||
</view>
|
||||
<view style="flex: 0.5; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
{{info.h3}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex:0.5; background-color: #e1f3ff; border-right: 1px solid #dfdfdf; text-align: center; border-bottom:1px solid #dfdfdf">
|
||||
6h(mm)
|
||||
</view>
|
||||
<view style="flex: 0.5; background-color: #e1f3ff;text-align: center; border-bottom:1px solid #dfdfdf" >
|
||||
24h(mm)
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view style="flex: 0.5; text-align: center; border-right: 1px solid #dfdfdf;">
|
||||
{{info.h6}}
|
||||
</view>
|
||||
<view style="flex: 0.5; text-align: center; ">
|
||||
{{info.h24}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
info:Object,
|
||||
default:{}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sttype: {
|
||||
"SH": '山洪',
|
||||
"SW": '水文',
|
||||
"QX": '气象',
|
||||
"SK": '水库',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list-box{
|
||||
.list-row{
|
||||
padding-bottom: 3px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
.second-row{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<view class="zbyq-box">
|
||||
<view class="search-bar">
|
||||
<u-search
|
||||
shape="square"
|
||||
:clearabled="true"
|
||||
:showAction="false"
|
||||
placeholder="请输入站点"
|
||||
height="40px"
|
||||
@change="inputChange"
|
||||
v-model="formData.value"
|
||||
></u-search>
|
||||
<image
|
||||
src="../../../static/images/filter.png"
|
||||
style="width: 20px; height: 20px; margin-right: 10px; margin-left: 10px;"
|
||||
@click="popupOpen = true"
|
||||
v-show="!popupOpen"
|
||||
>
|
||||
</image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view v-for="(item,index) in list" :key="index" style="margin-bottom: 5px;">
|
||||
<ResList :info="item" />
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="popupOpen" mode="right" @close="popupOpen=false" >
|
||||
<view style="padding: 30px 20px;">
|
||||
<text style="font-weight: bold;">按类型</text>
|
||||
<view style="margin-bottom: 10px; margin-left: -5px;">
|
||||
<u-checkbox-group
|
||||
v-model="formData.sources"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox
|
||||
:customStyle="{margin: '7px'}"
|
||||
v-for="(item, index) in checkboxList1"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
>
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<text style="font-weight: bold; margin-bottom: 5px;">按距离</text>
|
||||
<u--input
|
||||
placeholder="请输入"
|
||||
border="surround"
|
||||
type="number"
|
||||
v-model="formData.distance"
|
||||
style="width: 50%; margin-top: 5px;"
|
||||
></u--input>
|
||||
<view style="display: flex; margin-top: 170%;">
|
||||
<u-button text="重置" class="bottom-btn1"
|
||||
@click="formData = {...formData,sources,distance:1}"></u-button>
|
||||
<u-button text="确认" color="#d9001b" class="bottom-btn2" @click="popConfirm"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ResList from "./resList.vue"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
default:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popupOpen:false,
|
||||
sources:["SH","SW","QX","SK"],
|
||||
checkboxList1: [{
|
||||
name: '山洪',
|
||||
value: "SH"
|
||||
},
|
||||
{
|
||||
name: '水文',
|
||||
value: "SW"
|
||||
},
|
||||
{
|
||||
name: '气象',
|
||||
value: "QX"
|
||||
},
|
||||
{
|
||||
name: '水库',
|
||||
value: "SK"
|
||||
}
|
||||
],
|
||||
|
||||
formData:{
|
||||
value:'',
|
||||
sources:["SH","SW","QX","SK"],
|
||||
distance:1,
|
||||
stcd:this.stcd
|
||||
},
|
||||
list:[], //搜索结果
|
||||
saveList:[] //保存搜索结果
|
||||
}
|
||||
},
|
||||
components:{
|
||||
ResList
|
||||
},
|
||||
methods: {
|
||||
inputChange(e){
|
||||
console.log("e",e);
|
||||
if(!e) this.list = this.saveList;
|
||||
this.formData={...this.formData,value:e}
|
||||
let filterData = this.list.filter(item => item.stnm.indexOf(e) > -1);
|
||||
this.list = filterData;
|
||||
},
|
||||
checkboxChange(n) {
|
||||
console.log('change', n);
|
||||
this.formData = {...this.formData,sources:n};
|
||||
},
|
||||
popConfirm(){
|
||||
this.popupOpen = false
|
||||
this.getList()
|
||||
},
|
||||
async getList(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/attResBase/rainBasinDivision/queryNearbyRainStations",{...this.formData}
|
||||
)
|
||||
console.log("data",data);
|
||||
if(data.code == 200){
|
||||
this.list = [...data.data]
|
||||
this.saveList = [...data.data]
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.zbyq-box{
|
||||
.search-bar{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.content{
|
||||
margin-top: 10px;
|
||||
max-height: 580px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bottom-btn1{
|
||||
width: 100px;
|
||||
margin-left: 130px;
|
||||
}
|
||||
.bottom-btn2{
|
||||
width: 100px;
|
||||
margin-right: -12px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<template>
|
||||
<view class="zrtx-box">
|
||||
<view class="title" style="text-align: center; font-size: 20px; font-weight: bold;">
|
||||
{{dic}}
|
||||
</view>
|
||||
<view class="table_cur">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 50px;">
|
||||
姓名
|
||||
</th>
|
||||
<th style="width: 130px">单位</th>
|
||||
<th style="width: 80px;">
|
||||
职务
|
||||
</th>
|
||||
<th style="width: 100px;">
|
||||
联系方式
|
||||
</th>
|
||||
</tr>
|
||||
<view style="max-height: 500px; overflow-y: auto">
|
||||
<tr>
|
||||
<td style="width: 50px">{{info.personName}}</td>
|
||||
<td style="width: 130px;">{{info.orgName}}</td>
|
||||
<td style="width: 80px">{{info.position}}</td>
|
||||
<td style="width: 100px;color: #62bafa;" @click="show = true">{{info.tel}}</td>
|
||||
</tr>
|
||||
</view>
|
||||
</table>
|
||||
|
||||
</view>
|
||||
<u-action-sheet :actions="list" :title="title" :show="show" :description="info.tel" @select="selectClick" :closeOnClickOverlay="true" :closeOnClickAction="true"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {repDict} from "../../utils/dicType.js"
|
||||
export default {
|
||||
props:{
|
||||
info:Object,
|
||||
default:{}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show:false,
|
||||
title:"",
|
||||
list: [
|
||||
{
|
||||
name:'呼叫'
|
||||
},
|
||||
{
|
||||
name:'复制'
|
||||
},
|
||||
{
|
||||
name:'取消'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
dic(){
|
||||
return repDict(this.info.repType)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectClick(obj){
|
||||
if(obj.name == "呼叫"){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.info.tel,
|
||||
});
|
||||
this.show = false
|
||||
}else if(obj.name == "复制"){
|
||||
uni.setClipboardData({
|
||||
data:this.info.tel,
|
||||
showToast:true
|
||||
})
|
||||
this.show = false
|
||||
}
|
||||
// else if(obj.name == "保存至手机通讯录"){
|
||||
// uni.addPhoneContact({
|
||||
// lastName: this.info.personName.substr(0,1),
|
||||
// firstName: this.info.personName.substr(1),
|
||||
// mobilePhoneNumber: this.info.tel,
|
||||
// success: function () {
|
||||
// uni.$showMsg("保存成功")
|
||||
// },
|
||||
// fail: function () {
|
||||
// console.log('fail');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
else{
|
||||
this.show = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.zrtx-box{
|
||||
border: 1px solid #c1f2ce;
|
||||
border-radius: 2px;
|
||||
padding:10px 10px 5px 10px;
|
||||
background-color: #ebfbef;
|
||||
margin-bottom: 10px;
|
||||
.table_div {
|
||||
height: 100%;
|
||||
max-width: calc(100% - 0px);
|
||||
max-height: calc(100vh);
|
||||
flex: 1;
|
||||
padding-top: 0px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
/*table样式*/
|
||||
.table_cur {
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
}
|
||||
.table_cur tr {
|
||||
display: flex;
|
||||
line-height: 65rpx;
|
||||
}
|
||||
.table_cur th {
|
||||
height: 65rpx;
|
||||
font-size: 14px;
|
||||
// font-weight: bold;
|
||||
|
||||
font-weight: 100;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.table_cur td {
|
||||
height: 65rpx;
|
||||
// border-bottom: 1px solid #d8ddeb;
|
||||
font-size: 14px;
|
||||
color: #2f4056;
|
||||
padding: 0 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<template>
|
||||
<view style="max-height: 620px; overflow-y: auto;">
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
<Card :info="item" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Card from "./card.vue"
|
||||
export default {
|
||||
props:{
|
||||
resCode:String,
|
||||
default:''
|
||||
},
|
||||
components:{
|
||||
Card
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list:[]
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getData(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/reservoir/water/safe/person",
|
||||
{
|
||||
resCode:this.resCode
|
||||
})
|
||||
console.log("data",data);
|
||||
if(data.code == 200){
|
||||
this.list = [...data.data];
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg();
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
export function repDict(e) {
|
||||
let name=""
|
||||
if(e=="1"){
|
||||
name="行政责任人"
|
||||
}else if(e=="2"){
|
||||
name="技术责任人"
|
||||
}else if(e=="3"){
|
||||
name="巡查责任人"
|
||||
}else if(e=="4"){
|
||||
name="主管部门责任人"
|
||||
}else if(e=="5"){
|
||||
name="管理单位责任人"
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
<template>
|
||||
<view class="zbyq-box">
|
||||
<view class="search-bar">
|
||||
<u-search
|
||||
shape="square"
|
||||
:clearabled="true"
|
||||
:showAction="false"
|
||||
placeholder="请输入站点"
|
||||
height="40px"
|
||||
@change="inputChange"
|
||||
v-model="formData.args"
|
||||
></u-search>
|
||||
<image
|
||||
src="../../../static/images/filter.png"
|
||||
style="width: 20px; height: 20px; margin-left: 20px;"
|
||||
@click="popupOpen = true"
|
||||
v-show="!popupOpen"
|
||||
>
|
||||
</image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<Table :list="list" />
|
||||
</view>
|
||||
<u-popup :show="popupOpen" mode="right" @close="popupOpen=false" >
|
||||
<view style="padding: 30px 20px;">
|
||||
<text style="font-weight: bold;">按类型</text>
|
||||
<view style="margin-bottom: 10px; margin-left: -5px;">
|
||||
<u-checkbox-group
|
||||
v-model="formData.sources"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox
|
||||
:customStyle="{margin: '7px'}"
|
||||
v-for="(item, index) in checkboxList1"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
>
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<view style="display: flex; margin-top: 195%;">
|
||||
<u-button text="重置" class="bottom-btn1"
|
||||
@click="formData = {...formData,sources}"></u-button>
|
||||
<u-button text="确认" color="#d9001b" class="bottom-btn2" @click="popConfirm"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Table from "./table.vue"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
default:''
|
||||
},
|
||||
components:{
|
||||
Table
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popupOpen:false,
|
||||
sources:["SH","SW"],
|
||||
checkboxList1: [{
|
||||
name: '山洪',
|
||||
value: "SH"
|
||||
},
|
||||
{
|
||||
name: '水文',
|
||||
value: "SW"
|
||||
},
|
||||
],
|
||||
|
||||
formData:{
|
||||
args:'',
|
||||
sources:["SH","SW"],
|
||||
},
|
||||
list:[], //搜索结果
|
||||
saveList:[] //保存搜索结果
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
inputChange(e){
|
||||
console.log("e",e);
|
||||
if(!e) this.list = this.saveList;
|
||||
this.formData={...this.formData,value:e}
|
||||
let filterData = this.list.filter(item => item.stnm.indexOf(e) > -1);
|
||||
this.list = filterData;
|
||||
},
|
||||
checkboxChange(n) {
|
||||
this.formData = {...this.formData,sources:n};
|
||||
},
|
||||
popConfirm(){
|
||||
this.popupOpen = false
|
||||
this.getList()
|
||||
},
|
||||
async getList(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/river/water/list",{...this.formData}
|
||||
)
|
||||
console.log("data",data);
|
||||
if(data.code == 200){
|
||||
this.list = [...data.data]
|
||||
this.saveList = [...data.data]
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.zbyq-box{
|
||||
.search-bar{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.content{
|
||||
margin-top: 10px;
|
||||
max-height: 580px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bottom-btn1{
|
||||
width: 100px;
|
||||
margin-left: 130px;
|
||||
}
|
||||
.bottom-btn2{
|
||||
width: 100px;
|
||||
margin-right: -12px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<template>
|
||||
<div class="table_div">
|
||||
<div class="table_cur">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 50px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 130px">
|
||||
站名
|
||||
<th style="width: 110px;">
|
||||
监测时间
|
||||
</th>
|
||||
<th style="width: 100px;" >
|
||||
实时水位(m)
|
||||
</th>
|
||||
</tr>
|
||||
<div style="max-height: 500px; overflow-y: auto">
|
||||
<tr v-for="(item, index) in newList" :key="index">
|
||||
<td style="width: 50px">{{ index + 1 }}</td>
|
||||
<td style="width: 130px;color: #3399ef;" @click="jumpDetail(item)">{{ item.stnm }}</td>
|
||||
<td style="width: 110px">{{item.tm}}</td>
|
||||
<td style="width: 100px; position: relative;" >
|
||||
<text :class="{'active1':item.gstate == 1,'active2':item.wstate == 1}">{{ item.z.toFixed(2) }}</text>
|
||||
<text v-if="item.state == 1"
|
||||
style="position: absolute; top: 0px; right: 0; color: #FF7D7D;font-size:18px;">↑</text>
|
||||
<text v-else-if="item.state == 2" style="position: absolute;
|
||||
top:0px;right: 0; color: #32E48E; font-size: 18px;">↓</text>
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
export default {
|
||||
props:{
|
||||
list:{
|
||||
type:Array,
|
||||
default:[],
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
newList(){
|
||||
if(this.list.length > 0){
|
||||
let newData = this.list.map(item=>({...item,tm:moment(item.tm).format("MM-DD HH:mm")}))
|
||||
return newData
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
jumpDetail(params){
|
||||
uni.navigateTo({
|
||||
url:`/pages/hdDetail/hdDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&wrz=${params.wrz}&grz=${params.grz}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table_div {
|
||||
height: 100%;
|
||||
max-width: calc(100% - 0px);
|
||||
max-height: calc(100vh);
|
||||
flex: 1;
|
||||
padding-top: 0px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
/*table样式*/
|
||||
.table_cur {
|
||||
width: 100%;
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
}
|
||||
.table_cur tr {
|
||||
display: flex;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
.table_cur th {
|
||||
height: 56rpx;
|
||||
color: #3399ef;
|
||||
background: #e1f3ff;
|
||||
font-size: 14px;
|
||||
// font-weight: bold;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.table_cur td {
|
||||
height: 65rpx;
|
||||
// border-bottom: 1px solid #d8ddeb;
|
||||
font-size: 14px;
|
||||
color: #2f4056;
|
||||
padding: 0 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
.active2{
|
||||
color: #f59a23;
|
||||
}
|
||||
.active1{
|
||||
color: #d9001b;
|
||||
}
|
||||
/*table样式 end*/
|
||||
</style>
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
<template>
|
||||
<view class="zbyq-box">
|
||||
<view class="search-bar">
|
||||
<u-search
|
||||
shape="square"
|
||||
:clearabled="true"
|
||||
:showAction="false"
|
||||
placeholder="请输入站点"
|
||||
height="40px"
|
||||
@change="inputChange"
|
||||
v-model="formData.args"
|
||||
></u-search>
|
||||
<image
|
||||
src="../../../static/images/filter.png"
|
||||
style="width: 20px; height: 20px; margin-left: 20px;"
|
||||
@click="popupOpen = true"
|
||||
v-show="!popupOpen"
|
||||
>
|
||||
</image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<Table :list="list" />
|
||||
</view>
|
||||
<u-popup :show="popupOpen" mode="right" @close="popupOpen=false" >
|
||||
<view style="padding: 30px 20px;">
|
||||
<text style="font-weight: bold;">按类型</text>
|
||||
<view style="margin-bottom: 10px; margin-left: -5px;">
|
||||
<u-checkbox-group
|
||||
v-model="formData.sources"
|
||||
@change="checkboxChange"
|
||||
>
|
||||
<u-checkbox
|
||||
:customStyle="{margin: '7px'}"
|
||||
v-for="(item, index) in checkboxList1"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
>
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<view style="display: flex; margin-top: 195%;">
|
||||
<u-button text="重置" class="bottom-btn1"
|
||||
@click="formData = {...formData,sources}"></u-button>
|
||||
<u-button text="确认" color="#d9001b" class="bottom-btn2" @click="popConfirm"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Table from "./table.vue"
|
||||
export default {
|
||||
props:{
|
||||
stcd:String,
|
||||
default:''
|
||||
},
|
||||
components:{
|
||||
Table
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popupOpen:false,
|
||||
sources:["SW","SK"],
|
||||
checkboxList1: [
|
||||
{
|
||||
name: '水文',
|
||||
value: "SW"
|
||||
},
|
||||
{
|
||||
name: '水库',
|
||||
value: "SK"
|
||||
},
|
||||
],
|
||||
|
||||
formData:{
|
||||
args:'',
|
||||
sources:["SW","SK"],
|
||||
},
|
||||
list:[], //搜索结果
|
||||
saveList:[] //保存搜索结果
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
inputChange(e){
|
||||
console.log("e",e);
|
||||
if(!e) this.list = this.saveList;
|
||||
this.formData={...this.formData,value:e}
|
||||
let filterData = this.list.filter(item => item.stnm.indexOf(e) > -1);
|
||||
this.list = filterData;
|
||||
},
|
||||
checkboxChange(n) {
|
||||
console.log('change', n);
|
||||
this.formData = {...this.formData,sources:n};
|
||||
},
|
||||
popConfirm(){
|
||||
this.popupOpen = false
|
||||
this.getList()
|
||||
},
|
||||
async getList(){
|
||||
try{
|
||||
const {data} = await uni.$http.post(
|
||||
"/gunshiApp/xfflood/reservoir/water/list",{...this.formData}
|
||||
)
|
||||
console.log("data",data);
|
||||
if(data.code == 200){
|
||||
this.list = [...data.data]
|
||||
this.saveList = [...data.data]
|
||||
}
|
||||
}catch(e){
|
||||
uni.$showMsg()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.zbyq-box{
|
||||
.search-bar{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.content{
|
||||
margin-top: 10px;
|
||||
max-height: 580px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bottom-btn1{
|
||||
width: 100px;
|
||||
margin-left: 130px;
|
||||
}
|
||||
.bottom-btn2{
|
||||
width: 100px;
|
||||
margin-right: -12px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
<template>
|
||||
<div class="table_div">
|
||||
<div class="table_cur">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 40px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 90px">
|
||||
站名
|
||||
<th style="width: 80px;">
|
||||
监测时间
|
||||
</th>
|
||||
<th style="width: 100px;" >
|
||||
实时水位(m)
|
||||
</th>
|
||||
<th style="width: 90px;" >
|
||||
超汛限(m)
|
||||
</th>
|
||||
</tr>
|
||||
<div style="max-height: 500px; overflow-y: auto">
|
||||
<tr v-for="(item, index) in newList" :key="index">
|
||||
<td style="width: 40px">{{ index + 1 }}</td>
|
||||
<td style="width: 90px;color: #3399ef;" @click="jumpDetail(item)">{{ item.stnm }}</td>
|
||||
<td style="width: 80px">{{item.tm}}</td>
|
||||
<td style="width: 100px; position: relative;" >
|
||||
<text :class="{'active1':item.flState == 1,'active2':item.desState == 1,'active3':item.calState}">{{ item.rz.toFixed(2) }}</text>
|
||||
<text v-if="item.state == 1"
|
||||
style="position: absolute; top: 0px; right: 0; color: #FF7D7D;font-size:18px;">↑</text>
|
||||
<text v-else-if="item.state == 2" style="position: absolute;
|
||||
top:0px;right: 0; color: #32E48E; font-size: 18px;">↓</text>
|
||||
</td>
|
||||
<td style="width: 90px">{{item.afsltdz ? item.afsltdz.toFixed(2):'-'}}</td>
|
||||
</tr>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
export default {
|
||||
props:{
|
||||
list:{
|
||||
type:Array,
|
||||
default:[],
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
newList(){
|
||||
if(this.list.length > 0){
|
||||
let newData = this.list.map(item=>({...item,tm:moment(item.tm).format("MM-DD HH:mm")}))
|
||||
return newData
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
jumpDetail(params){
|
||||
console.log(params);
|
||||
uni.navigateTo({
|
||||
url:`/pages/skDetail/skDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&afsltdz=${params.afsltdz}&flLowLimLev=${params.flLowLimLev}&desFloodLev=${params.desFloodLev}&calFloodLev=${params.calFloodLev}&resCode=${params.resCode}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table_div {
|
||||
height: 100%;
|
||||
max-width: calc(100% - 0px);
|
||||
max-height: calc(100vh);
|
||||
flex: 1;
|
||||
padding-top: 0px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
/*table样式*/
|
||||
.table_cur {
|
||||
width: 100%;
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
font-size: 14px;
|
||||
}
|
||||
.table_cur tr {
|
||||
display: flex;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
.table_cur th {
|
||||
height: 56rpx;
|
||||
color: #3399ef;
|
||||
background: #e1f3ff;
|
||||
font-size: 14px;
|
||||
// font-weight: bold;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.table_cur td {
|
||||
height: 65rpx;
|
||||
// border-bottom: 1px solid #d8ddeb;
|
||||
font-size: 14px;
|
||||
color: #2f4056;
|
||||
padding: 0 10px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-align: center !important;
|
||||
}
|
||||
.active2{
|
||||
color: #f59a23;
|
||||
}
|
||||
.active1{
|
||||
color: #c4c415;
|
||||
}
|
||||
.active3{
|
||||
color: #d9001b;
|
||||
}
|
||||
/*table样式 end*/
|
||||
</style>
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
<template>
|
||||
<view class="water-box">
|
||||
<view class="nav-bar">
|
||||
<u-icon name="arrow-left" color="#000" size="28" @click="backTo"></u-icon>
|
||||
<view class="title">
|
||||
水情
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar" >
|
||||
<view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}">
|
||||
河道水情
|
||||
</view>
|
||||
<view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}">
|
||||
水库水情
|
||||
</view>
|
||||
</view>
|
||||
<view class="water-detail-content">
|
||||
<HdWater v-if="activeOne == 0"/>
|
||||
<SkWater v-if="activeOne == 1"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HdWater from "./hdWater/hdWater.vue"
|
||||
import SkWater from "./skWater/skWater.vue"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeOne:0
|
||||
}
|
||||
},
|
||||
components:{
|
||||
HdWater,
|
||||
SkWater
|
||||
},
|
||||
methods: {
|
||||
backTo(){
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.water-box{
|
||||
.nav-bar{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
box-shadow: 0 5px 10px -8px #dfdfdf inset;
|
||||
}
|
||||
.title{
|
||||
flex:1;
|
||||
text-align: center;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.tab-bar{
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 10px 40px;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
}
|
||||
.rain-detail-content{
|
||||
padding: 10px;
|
||||
}
|
||||
.active{
|
||||
color: #39a6ff;
|
||||
}
|
||||
.rain-detail-content{
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1 @@
|
|||
1、删除Decoder.js的外部引用,由于Decoder.js加载完全在笔记本耗时较久,很容易出现还没加载时完全出现的批量报错
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,642 @@
|
|||
/**
|
||||
* Created by wangweijie5 on 2016/12/5.
|
||||
*/
|
||||
(function (event) {
|
||||
const AUDIO_TYPE = 0; // 音频
|
||||
const VIDEO_TYPE = 1; // 视频
|
||||
const PRIVT_TYPE = 2; // 私有帧
|
||||
|
||||
const PLAYM4_AUDIO_FRAME = 100; // 音频帧
|
||||
const PLAYM4_VIDEO_FRAME = 101; // 视频帧
|
||||
|
||||
const PLAYM4_OK = 1;
|
||||
const PLAYM4_ORDER_ERROR = 2;
|
||||
const PLAYM4_DECODE_ERROR = 44 // 解码失败
|
||||
const PLAYM4_NOT_KEYFRAME = 48; // 非关键帧
|
||||
const PLAYM4_NEED_MORE_DATA = 31; // 需要更多数据才能解析
|
||||
const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
|
||||
const PLAYM4_SYS_NOT_SUPPORT = 16; // 不支持
|
||||
|
||||
importScripts('Decoder.js');
|
||||
Module.addOnPostRun(function () {
|
||||
postMessage({ 'function': "loaded" });
|
||||
});
|
||||
|
||||
var iStreamMode = 0; // 流模式
|
||||
|
||||
var bOpenMode = false;
|
||||
var bOpenStream = false;
|
||||
|
||||
var funGetFrameData = null;
|
||||
var funGetAudFrameData = null;
|
||||
|
||||
var bWorkerPrintLog = false;//worker层log开关
|
||||
|
||||
var g_nPort = -1;
|
||||
var pInputData = null;
|
||||
var inputBufferSize = 40960;
|
||||
|
||||
self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
|
||||
let port = nPort;
|
||||
let user = pUser;
|
||||
let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
|
||||
let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
|
||||
let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
|
||||
let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
|
||||
let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
|
||||
// console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
|
||||
postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
|
||||
}
|
||||
|
||||
onmessage = function (event) {
|
||||
var eventData = event.data;
|
||||
var res = 0;
|
||||
switch (eventData.command) {
|
||||
case "printLog":
|
||||
let downloadFlag = eventData.data;
|
||||
if (downloadFlag === true) {
|
||||
bWorkerPrintLog = true;
|
||||
res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
|
||||
}
|
||||
else {
|
||||
bWorkerPrintLog = false;
|
||||
res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
|
||||
}
|
||||
|
||||
if (res !== PLAYM4_OK) {
|
||||
console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
|
||||
postMessage({ 'function': "printLog", 'errorCode': res });
|
||||
}
|
||||
break;
|
||||
case "SetPlayPosition":
|
||||
let nFrameNumOrTime = eventData.data;
|
||||
let enPosType = eventData.type;
|
||||
// res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
|
||||
// if (res !== PLAYM4_OK)
|
||||
// {
|
||||
// postMessage({'function': "SetPlayPosition", 'errorCode': res});
|
||||
// return;
|
||||
// }
|
||||
// //有没有buffer需要清除
|
||||
|
||||
break;
|
||||
case "SetStreamOpenMode":
|
||||
//获取端口号
|
||||
g_nPort = Module._GetPort();
|
||||
//设置流打开模式
|
||||
iStreamMode = eventData.data;
|
||||
res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
bOpenMode = true;
|
||||
break;
|
||||
|
||||
case "OpenStream":
|
||||
// 接收到的数据
|
||||
var iHeadLen = eventData.dataSize;
|
||||
var pHead = Module._malloc(iHeadLen + 4);
|
||||
if (pHead === null) {
|
||||
return;
|
||||
}
|
||||
var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
|
||||
aHead.set(new Uint8Array(eventData.data));
|
||||
res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
|
||||
postMessage({ 'function': "OpenStream", 'errorCode': res });
|
||||
if (res !== PLAYM4_OK) {
|
||||
//释放内存
|
||||
Module._free(pHead);
|
||||
pHead = null;
|
||||
return;
|
||||
}
|
||||
bOpenStream = true;
|
||||
break;
|
||||
case "Play":
|
||||
let resP = Module._Play(g_nPort);
|
||||
if (resP !== PLAYM4_OK) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "InputData":
|
||||
// 接收到的数据
|
||||
var iLen = eventData.dataSize;
|
||||
if (iLen > 0) {
|
||||
if (pInputData == null || iLen > inputBufferSize) {
|
||||
if (pInputData != null) {
|
||||
Module._free(pInputData);
|
||||
pInputData = null;
|
||||
}
|
||||
if (iLen > inputBufferSize) {
|
||||
inputBufferSize = iLen;
|
||||
}
|
||||
|
||||
pInputData = Module._malloc(inputBufferSize);
|
||||
if (pInputData === null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var inputData = new Uint8Array(eventData.data);
|
||||
// var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
|
||||
// aInputData.set(inputData);
|
||||
Module.writeArrayToMemory(inputData, pInputData);
|
||||
inputData = null;
|
||||
res = Module._InputData(g_nPort, pInputData, iLen);
|
||||
if (res !== PLAYM4_OK) {
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
|
||||
postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
|
||||
}
|
||||
//Module._free(pInputData);
|
||||
//pInputData = null;
|
||||
} else {
|
||||
let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
|
||||
if (sourceRemain == 0) {
|
||||
postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// if (funGetFrameData === null) {
|
||||
// funGetFrameData = Module.cwrap('GetFrameData', 'number');
|
||||
// }
|
||||
|
||||
while (bOpenMode && bOpenStream) {
|
||||
|
||||
var ret = getFrameData();
|
||||
// 直到获取视频帧或数据不足为止
|
||||
if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret || || PLAYM4_NEED_NEET_LOOP === ret
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "SetSecretKey":
|
||||
var keyLen = eventData.nKeyLen;
|
||||
var pKeyData = Module._malloc(keyLen);
|
||||
if (pKeyData === null) {
|
||||
return;
|
||||
}
|
||||
var nKeySize = eventData.data.length
|
||||
var bufData = stringToBytes(eventData.data);
|
||||
var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
|
||||
let u8array = new Uint8Array(keyLen);
|
||||
aKeyData.set(u8array, 0);
|
||||
aKeyData.set(new Uint8Array(bufData));
|
||||
aKeyData = null;
|
||||
u8array = null;
|
||||
|
||||
res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetSecretKey", 'errorCode': res });
|
||||
Module._free(pKeyData);
|
||||
pKeyData = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Module._free(pKeyData);
|
||||
pKeyData = null;
|
||||
break;
|
||||
|
||||
case "GetBMP":
|
||||
var nBMPWidth = eventData.width;
|
||||
var nBMPHeight = eventData.height;
|
||||
var pYUVData = eventData.data;
|
||||
var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
|
||||
var oJpegCropRect = {
|
||||
left: eventData.left,
|
||||
top: eventData.top,
|
||||
right: eventData.right,
|
||||
bottom: eventData.bottom
|
||||
};
|
||||
|
||||
var pDataYUV = Module._malloc(nYUVSize);
|
||||
if (pDataYUV === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
|
||||
|
||||
// 分配BMP空间
|
||||
var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
|
||||
var pBmpData = Module._malloc(nBmpSize);
|
||||
var pBmpSize = Module._malloc(4);
|
||||
if (pBmpData === null || pBmpSize === null) {
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
|
||||
if (pBmpData != null) {
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
}
|
||||
|
||||
if (pBmpSize != null) {
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
|
||||
Module.setValue(pBmpSize, nBmpSize, "i32");
|
||||
res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
|
||||
oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "GetBMP", 'errorCode': res });
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取BMP图片大小
|
||||
var nBmpDataSize = Module.getValue(pBmpSize, "i32");
|
||||
|
||||
// 获取BMP图片数据
|
||||
var aBmpData = new Uint8Array(nBmpDataSize);
|
||||
aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
|
||||
|
||||
postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
|
||||
aBmpData = null;
|
||||
if (pDataYUV != null) {
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
}
|
||||
if (pBmpData != null) {
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
}
|
||||
if (pBmpSize != null) {
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
}
|
||||
break;
|
||||
|
||||
case "GetJPEG":
|
||||
var nJpegWidth = eventData.width;
|
||||
var nJpegHeight = eventData.height;
|
||||
var pYUVData1 = eventData.data;
|
||||
var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
|
||||
var oJpegCropRect = {
|
||||
left: eventData.left,
|
||||
top: eventData.top,
|
||||
right: eventData.right,
|
||||
bottom: eventData.bottom
|
||||
};
|
||||
|
||||
var pDataYUV1 = Module._malloc(nYUVSize1);
|
||||
if (pDataYUV1 === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
|
||||
|
||||
// 分配JPEG空间
|
||||
var pJpegData = Module._malloc(nYUVSize1);
|
||||
var pJpegSize = Module._malloc(4);
|
||||
if (pJpegData === null || pJpegSize === null) {
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32"); // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
|
||||
|
||||
res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
|
||||
oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "GetJPEG", 'errorCode': res });
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取JPEG图片大小
|
||||
var nJpegSize = Module.getValue(pJpegSize, "i32");
|
||||
|
||||
// 获取JPEG图片数据
|
||||
var aJpegData = new Uint8Array(nJpegSize);
|
||||
aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
|
||||
|
||||
postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
|
||||
|
||||
nJpegSize = null;
|
||||
aJpegData = null;
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
break;
|
||||
|
||||
case "SetDecodeFrameType":
|
||||
var nFrameType = eventData.data;
|
||||
res = Module._SetDecodeFrameType(g_nPort, nFrameType);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "CloseStream":
|
||||
//stop
|
||||
let resS = Module._Stop(g_nPort);
|
||||
if (resS !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "Stop", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
//closeStream
|
||||
res = Module._CloseStream(g_nPort);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "CloseStream", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
//freePort
|
||||
let resF = Module._FreePort(g_nPort);
|
||||
if (resF !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "FreePort", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
if (pInputData != null) {
|
||||
Module._free(pInputData);
|
||||
pInputData = null;
|
||||
}
|
||||
break;
|
||||
case "PlaySound":
|
||||
let resPS = Module._PlaySound(g_nPort);
|
||||
if (resPS !== PLAYM4_OK) {
|
||||
console.log("PlaySound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "StopSound":
|
||||
let resSS = Module._StopSound();
|
||||
if (resSS !== PLAYM4_OK) {
|
||||
console.log("StopSound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "SetVolume":
|
||||
let resSV = Module._SetVolume(g_nPort, eventData.volume);
|
||||
if (resSV !== PLAYM4_OK) {
|
||||
console.log("Audio SetVolume failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "GetVolume":
|
||||
let volume = Module._GetVolume();
|
||||
if (volume > 0) {
|
||||
postMessage({ 'function': "GetVolume", 'volume': volume });
|
||||
}
|
||||
else {
|
||||
console.log("Audio GetVolume failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "OnlyPlaySound":
|
||||
let resOPS = Module._OnlyPlaySound(g_nPort);
|
||||
if (resOPS !== PLAYM4_OK) {
|
||||
console.log("OnlyPlaySound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "Pause":
|
||||
let resPa = Module._Pause(g_nPort, eventData.bPlay);
|
||||
if (resPa !== PLAYM4_OK) {
|
||||
console.log("Pause failed");
|
||||
return;
|
||||
}
|
||||
case "PlayRate":
|
||||
Module._SetPlayRate(g_nPort, eventData.playRate);
|
||||
break;
|
||||
case "SetIFrameDecInterval":
|
||||
Module._SetIFrameDecInterval(g_nPort, eventData.data);
|
||||
break;
|
||||
case "SetLostFrameMode":
|
||||
Module._SetLostFrameMode(g_nPort, eventData.data, 0);
|
||||
break;
|
||||
case "SetDemuxModel":
|
||||
Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
|
||||
break;
|
||||
case "SkipErrorData":
|
||||
Module._SkipErrorData(g_nPort, eventData.bSkip);
|
||||
break;
|
||||
case "SetDecodeERC":
|
||||
Module._SetDecodeERC(g_nPort, eventData.nLevel);
|
||||
break;
|
||||
case "SetANRParam":
|
||||
Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
|
||||
break;
|
||||
case "SetResampleValue":
|
||||
Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
|
||||
break;
|
||||
case "GetLastError":
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
|
||||
break;
|
||||
case "SetGlobalBaseTime":
|
||||
Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
|
||||
break;
|
||||
case "SetRunTimeInfoCB":
|
||||
Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
function getOSDTime(oFrameInfo) {
|
||||
var iYear = oFrameInfo.year;
|
||||
var iMonth = oFrameInfo.month;
|
||||
var iDay = oFrameInfo.day;
|
||||
var iHour = oFrameInfo.hour;
|
||||
var iMinute = oFrameInfo.minute;
|
||||
var iSecond = oFrameInfo.second;
|
||||
|
||||
if (iMonth < 10) {
|
||||
iMonth = "0" + iMonth;
|
||||
}
|
||||
if (iDay < 10) {
|
||||
iDay = "0" + iDay;
|
||||
}
|
||||
if (iHour < 10) {
|
||||
iHour = "0" + iHour;
|
||||
}
|
||||
if (iMinute < 10) {
|
||||
iMinute = "0" + iMinute;
|
||||
}
|
||||
if (iSecond < 10) {
|
||||
iSecond = "0" + iSecond;
|
||||
}
|
||||
|
||||
return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
|
||||
}
|
||||
// 获取帧数据
|
||||
function getFrameData() {
|
||||
// function getFrameData() {
|
||||
// 获取帧数据
|
||||
var res = Module._GetFrameData();
|
||||
//var res = fun();
|
||||
if (res === PLAYM4_OK) {
|
||||
var oFrameInfo = Module._GetFrameInfo();
|
||||
switch (oFrameInfo.frameType) {
|
||||
case AUDIO_TYPE:
|
||||
var iSize = oFrameInfo.frameSize;
|
||||
if (0 === iSize) {
|
||||
return -1;
|
||||
}
|
||||
var pPCM = Module._GetFrameBuffer();
|
||||
// var audioBuf = new ArrayBuffer(iSize);
|
||||
var aPCMData = new Uint8Array(iSize);
|
||||
aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
|
||||
if (bWorkerPrintLog) {
|
||||
console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
|
||||
}
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
|
||||
'frameInfo': oFrameInfo, 'errorCode': res
|
||||
}, [aPCMData.buffer]);
|
||||
|
||||
oFrameInfo = null;
|
||||
pPCM = null;
|
||||
aPCMData = null;
|
||||
return PLAYM4_AUDIO_FRAME;
|
||||
|
||||
case VIDEO_TYPE:
|
||||
var szOSDTime = getOSDTime(oFrameInfo);
|
||||
|
||||
var iWidth = oFrameInfo.width;
|
||||
var iHeight = oFrameInfo.height;
|
||||
|
||||
var iYUVSize = iWidth * iHeight * 3 / 2;
|
||||
if (0 === iYUVSize) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var pYUV = Module._GetFrameBuffer();
|
||||
|
||||
// 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
|
||||
var aYUVData = new Uint8Array(iYUVSize);
|
||||
aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
|
||||
if (bWorkerPrintLog) {
|
||||
console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
|
||||
}
|
||||
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
|
||||
'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
|
||||
}, [aYUVData.buffer]);
|
||||
|
||||
oFrameInfo = null;
|
||||
pYUV = null;
|
||||
aYUVData = null;
|
||||
return PLAYM4_VIDEO_FRAME;
|
||||
|
||||
case PRIVT_TYPE:
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
|
||||
});
|
||||
return PLAYM4_SYS_NOT_SUPPORT;
|
||||
|
||||
default:
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
|
||||
});
|
||||
return PLAYM4_SYS_NOT_SUPPORT;
|
||||
}
|
||||
}
|
||||
else {
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
//解码失败返回裸数据
|
||||
if (PLAYM4_DECODE_ERROR === errorCode) {
|
||||
var rawInfo = Module._GetRawDataInfo();
|
||||
var pRawData = Module._GetRawDataBuffer();
|
||||
var aRawData = new Uint8Array(rawInfo.isize);
|
||||
aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
|
||||
postMessage({
|
||||
'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
|
||||
'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
|
||||
});
|
||||
rawInfo = null;
|
||||
pRawData = null;
|
||||
aRawData = null;
|
||||
}
|
||||
//需要更多数据
|
||||
if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
|
||||
});
|
||||
}
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
// 开始计算时间
|
||||
function startTime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
// 结束计算时间
|
||||
function endTime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
// 字母字符串转byte数组
|
||||
function stringToBytes(str) {
|
||||
var ch, st, re = [];
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
ch = str.charCodeAt(i); // get char
|
||||
st = []; // set up "stack"
|
||||
do {
|
||||
st.push(ch & 0xFF); // push byte to stack
|
||||
ch = ch >> 8; // shift value down by 1 byte
|
||||
}
|
||||
while (ch);
|
||||
// add stack contents to result
|
||||
// done because chars have "wrong" endianness
|
||||
re = re.concat(st.reverse());
|
||||
}
|
||||
// return an array of bytes
|
||||
return re;
|
||||
}
|
||||
})();
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,642 @@
|
|||
/**
|
||||
* Created by wangweijie5 on 2016/12/5.
|
||||
*/
|
||||
(function (event) {
|
||||
const AUDIO_TYPE = 0; // 音频
|
||||
const VIDEO_TYPE = 1; // 视频
|
||||
const PRIVT_TYPE = 2; // 私有帧
|
||||
|
||||
const PLAYM4_AUDIO_FRAME = 100; // 音频帧
|
||||
const PLAYM4_VIDEO_FRAME = 101; // 视频帧
|
||||
|
||||
const PLAYM4_OK = 1;
|
||||
const PLAYM4_ORDER_ERROR = 2;
|
||||
const PLAYM4_DECODE_ERROR = 44 // 解码失败
|
||||
const PLAYM4_NOT_KEYFRAME = 48; // 非关键帧
|
||||
const PLAYM4_NEED_MORE_DATA = 31; // 需要更多数据才能解析
|
||||
const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
|
||||
const PLAYM4_SYS_NOT_SUPPORT = 16; // 不支持
|
||||
|
||||
importScripts('Decoder.js');
|
||||
Module.addOnPostRun(function () {
|
||||
postMessage({ 'function': "loaded" });
|
||||
});
|
||||
|
||||
var iStreamMode = 0; // 流模式
|
||||
|
||||
var bOpenMode = false;
|
||||
var bOpenStream = false;
|
||||
|
||||
var funGetFrameData = null;
|
||||
var funGetAudFrameData = null;
|
||||
|
||||
var bWorkerPrintLog = false;//worker层log开关
|
||||
|
||||
var g_nPort = -1;
|
||||
var pInputData = null;
|
||||
var inputBufferSize = 40960;
|
||||
|
||||
self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
|
||||
let port = nPort;
|
||||
let user = pUser;
|
||||
let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
|
||||
let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
|
||||
let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
|
||||
let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
|
||||
let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
|
||||
// console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
|
||||
postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
|
||||
}
|
||||
|
||||
onmessage = function (event) {
|
||||
var eventData = event.data;
|
||||
var res = 0;
|
||||
switch (eventData.command) {
|
||||
case "printLog":
|
||||
let downloadFlag = eventData.data;
|
||||
if (downloadFlag === true) {
|
||||
bWorkerPrintLog = true;
|
||||
res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
|
||||
}
|
||||
else {
|
||||
bWorkerPrintLog = false;
|
||||
res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
|
||||
}
|
||||
|
||||
if (res !== PLAYM4_OK) {
|
||||
console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
|
||||
postMessage({ 'function': "printLog", 'errorCode': res });
|
||||
}
|
||||
break;
|
||||
case "SetPlayPosition":
|
||||
let nFrameNumOrTime = eventData.data;
|
||||
let enPosType = eventData.type;
|
||||
// res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
|
||||
// if (res !== PLAYM4_OK)
|
||||
// {
|
||||
// postMessage({'function': "SetPlayPosition", 'errorCode': res});
|
||||
// return;
|
||||
// }
|
||||
// //有没有buffer需要清除
|
||||
|
||||
break;
|
||||
case "SetStreamOpenMode":
|
||||
//获取端口号
|
||||
g_nPort = Module._GetPort();
|
||||
//设置流打开模式
|
||||
iStreamMode = eventData.data;
|
||||
res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
bOpenMode = true;
|
||||
break;
|
||||
|
||||
case "OpenStream":
|
||||
// 接收到的数据
|
||||
var iHeadLen = eventData.dataSize;
|
||||
var pHead = Module._malloc(iHeadLen + 4);
|
||||
if (pHead === null) {
|
||||
return;
|
||||
}
|
||||
var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
|
||||
aHead.set(new Uint8Array(eventData.data));
|
||||
res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
|
||||
postMessage({ 'function': "OpenStream", 'errorCode': res });
|
||||
if (res !== PLAYM4_OK) {
|
||||
//释放内存
|
||||
Module._free(pHead);
|
||||
pHead = null;
|
||||
return;
|
||||
}
|
||||
bOpenStream = true;
|
||||
break;
|
||||
case "Play":
|
||||
let resP = Module._Play(g_nPort);
|
||||
if (resP !== PLAYM4_OK) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "InputData":
|
||||
// 接收到的数据
|
||||
var iLen = eventData.dataSize;
|
||||
if (iLen > 0) {
|
||||
if (pInputData == null || iLen > inputBufferSize) {
|
||||
if (pInputData != null) {
|
||||
Module._free(pInputData);
|
||||
pInputData = null;
|
||||
}
|
||||
if (iLen > inputBufferSize) {
|
||||
inputBufferSize = iLen;
|
||||
}
|
||||
|
||||
pInputData = Module._malloc(inputBufferSize);
|
||||
if (pInputData === null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var inputData = new Uint8Array(eventData.data);
|
||||
// var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
|
||||
// aInputData.set(inputData);
|
||||
Module.writeArrayToMemory(inputData, pInputData);
|
||||
inputData = null;
|
||||
res = Module._InputData(g_nPort, pInputData, iLen);
|
||||
if (res !== PLAYM4_OK) {
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
|
||||
postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
|
||||
}
|
||||
//Module._free(pInputData);
|
||||
//pInputData = null;
|
||||
} else {
|
||||
let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
|
||||
if (sourceRemain == 0) {
|
||||
postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// if (funGetFrameData === null) {
|
||||
// funGetFrameData = Module.cwrap('GetFrameData', 'number');
|
||||
// }
|
||||
|
||||
while (bOpenMode && bOpenStream) {
|
||||
|
||||
var ret = getFrameData();
|
||||
// 直到获取视频帧或数据不足为止
|
||||
if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret || || PLAYM4_NEED_NEET_LOOP === ret
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "SetSecretKey":
|
||||
var keyLen = eventData.nKeyLen;
|
||||
var pKeyData = Module._malloc(keyLen);
|
||||
if (pKeyData === null) {
|
||||
return;
|
||||
}
|
||||
var nKeySize = eventData.data.length
|
||||
var bufData = stringToBytes(eventData.data);
|
||||
var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
|
||||
let u8array = new Uint8Array(keyLen);
|
||||
aKeyData.set(u8array, 0);
|
||||
aKeyData.set(new Uint8Array(bufData));
|
||||
aKeyData = null;
|
||||
u8array = null;
|
||||
|
||||
res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetSecretKey", 'errorCode': res });
|
||||
Module._free(pKeyData);
|
||||
pKeyData = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Module._free(pKeyData);
|
||||
pKeyData = null;
|
||||
break;
|
||||
|
||||
case "GetBMP":
|
||||
var nBMPWidth = eventData.width;
|
||||
var nBMPHeight = eventData.height;
|
||||
var pYUVData = eventData.data;
|
||||
var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
|
||||
var oJpegCropRect = {
|
||||
left: eventData.left,
|
||||
top: eventData.top,
|
||||
right: eventData.right,
|
||||
bottom: eventData.bottom
|
||||
};
|
||||
|
||||
var pDataYUV = Module._malloc(nYUVSize);
|
||||
if (pDataYUV === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
|
||||
|
||||
// 分配BMP空间
|
||||
var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
|
||||
var pBmpData = Module._malloc(nBmpSize);
|
||||
var pBmpSize = Module._malloc(4);
|
||||
if (pBmpData === null || pBmpSize === null) {
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
|
||||
if (pBmpData != null) {
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
}
|
||||
|
||||
if (pBmpSize != null) {
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
|
||||
Module.setValue(pBmpSize, nBmpSize, "i32");
|
||||
res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
|
||||
oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "GetBMP", 'errorCode': res });
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取BMP图片大小
|
||||
var nBmpDataSize = Module.getValue(pBmpSize, "i32");
|
||||
|
||||
// 获取BMP图片数据
|
||||
var aBmpData = new Uint8Array(nBmpDataSize);
|
||||
aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
|
||||
|
||||
postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
|
||||
aBmpData = null;
|
||||
if (pDataYUV != null) {
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
}
|
||||
if (pBmpData != null) {
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
}
|
||||
if (pBmpSize != null) {
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
}
|
||||
break;
|
||||
|
||||
case "GetJPEG":
|
||||
var nJpegWidth = eventData.width;
|
||||
var nJpegHeight = eventData.height;
|
||||
var pYUVData1 = eventData.data;
|
||||
var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
|
||||
var oJpegCropRect = {
|
||||
left: eventData.left,
|
||||
top: eventData.top,
|
||||
right: eventData.right,
|
||||
bottom: eventData.bottom
|
||||
};
|
||||
|
||||
var pDataYUV1 = Module._malloc(nYUVSize1);
|
||||
if (pDataYUV1 === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
|
||||
|
||||
// 分配JPEG空间
|
||||
var pJpegData = Module._malloc(nYUVSize1);
|
||||
var pJpegSize = Module._malloc(4);
|
||||
if (pJpegData === null || pJpegSize === null) {
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32"); // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
|
||||
|
||||
res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
|
||||
oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "GetJPEG", 'errorCode': res });
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取JPEG图片大小
|
||||
var nJpegSize = Module.getValue(pJpegSize, "i32");
|
||||
|
||||
// 获取JPEG图片数据
|
||||
var aJpegData = new Uint8Array(nJpegSize);
|
||||
aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
|
||||
|
||||
postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
|
||||
|
||||
nJpegSize = null;
|
||||
aJpegData = null;
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
break;
|
||||
|
||||
case "SetDecodeFrameType":
|
||||
var nFrameType = eventData.data;
|
||||
res = Module._SetDecodeFrameType(g_nPort, nFrameType);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "CloseStream":
|
||||
//stop
|
||||
let resS = Module._Stop(g_nPort);
|
||||
if (resS !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "Stop", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
//closeStream
|
||||
res = Module._CloseStream(g_nPort);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "CloseStream", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
//freePort
|
||||
let resF = Module._FreePort(g_nPort);
|
||||
if (resF !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "FreePort", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
if (pInputData != null) {
|
||||
Module._free(pInputData);
|
||||
pInputData = null;
|
||||
}
|
||||
break;
|
||||
case "PlaySound":
|
||||
let resPS = Module._PlaySound(g_nPort);
|
||||
if (resPS !== PLAYM4_OK) {
|
||||
console.log("PlaySound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "StopSound":
|
||||
let resSS = Module._StopSound();
|
||||
if (resSS !== PLAYM4_OK) {
|
||||
console.log("StopSound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "SetVolume":
|
||||
let resSV = Module._SetVolume(g_nPort, eventData.volume);
|
||||
if (resSV !== PLAYM4_OK) {
|
||||
console.log("Audio SetVolume failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "GetVolume":
|
||||
let volume = Module._GetVolume();
|
||||
if (volume > 0) {
|
||||
postMessage({ 'function': "GetVolume", 'volume': volume });
|
||||
}
|
||||
else {
|
||||
console.log("Audio GetVolume failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "OnlyPlaySound":
|
||||
let resOPS = Module._OnlyPlaySound(g_nPort);
|
||||
if (resOPS !== PLAYM4_OK) {
|
||||
console.log("OnlyPlaySound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "Pause":
|
||||
let resPa = Module._Pause(g_nPort, eventData.bPlay);
|
||||
if (resPa !== PLAYM4_OK) {
|
||||
console.log("Pause failed");
|
||||
return;
|
||||
}
|
||||
case "PlayRate":
|
||||
Module._SetPlayRate(g_nPort, eventData.playRate);
|
||||
break;
|
||||
case "SetIFrameDecInterval":
|
||||
Module._SetIFrameDecInterval(g_nPort, eventData.data);
|
||||
break;
|
||||
case "SetLostFrameMode":
|
||||
Module._SetLostFrameMode(g_nPort, eventData.data, 0);
|
||||
break;
|
||||
case "SetDemuxModel":
|
||||
Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
|
||||
break;
|
||||
case "SkipErrorData":
|
||||
Module._SkipErrorData(g_nPort, eventData.bSkip);
|
||||
break;
|
||||
case "SetDecodeERC":
|
||||
Module._SetDecodeERC(g_nPort, eventData.nLevel);
|
||||
break;
|
||||
case "SetANRParam":
|
||||
Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
|
||||
break;
|
||||
case "SetResampleValue":
|
||||
Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
|
||||
break;
|
||||
case "GetLastError":
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
|
||||
break;
|
||||
case "SetGlobalBaseTime":
|
||||
Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
|
||||
break;
|
||||
case "SetRunTimeInfoCB":
|
||||
Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
function getOSDTime(oFrameInfo) {
|
||||
var iYear = oFrameInfo.year;
|
||||
var iMonth = oFrameInfo.month;
|
||||
var iDay = oFrameInfo.day;
|
||||
var iHour = oFrameInfo.hour;
|
||||
var iMinute = oFrameInfo.minute;
|
||||
var iSecond = oFrameInfo.second;
|
||||
|
||||
if (iMonth < 10) {
|
||||
iMonth = "0" + iMonth;
|
||||
}
|
||||
if (iDay < 10) {
|
||||
iDay = "0" + iDay;
|
||||
}
|
||||
if (iHour < 10) {
|
||||
iHour = "0" + iHour;
|
||||
}
|
||||
if (iMinute < 10) {
|
||||
iMinute = "0" + iMinute;
|
||||
}
|
||||
if (iSecond < 10) {
|
||||
iSecond = "0" + iSecond;
|
||||
}
|
||||
|
||||
return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
|
||||
}
|
||||
// 获取帧数据
|
||||
function getFrameData() {
|
||||
// function getFrameData() {
|
||||
// 获取帧数据
|
||||
var res = Module._GetFrameData();
|
||||
//var res = fun();
|
||||
if (res === PLAYM4_OK) {
|
||||
var oFrameInfo = Module._GetFrameInfo();
|
||||
switch (oFrameInfo.frameType) {
|
||||
case AUDIO_TYPE:
|
||||
var iSize = oFrameInfo.frameSize;
|
||||
if (0 === iSize) {
|
||||
return -1;
|
||||
}
|
||||
var pPCM = Module._GetFrameBuffer();
|
||||
// var audioBuf = new ArrayBuffer(iSize);
|
||||
var aPCMData = new Uint8Array(iSize);
|
||||
aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
|
||||
if (bWorkerPrintLog) {
|
||||
console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
|
||||
}
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
|
||||
'frameInfo': oFrameInfo, 'errorCode': res
|
||||
}, [aPCMData.buffer]);
|
||||
|
||||
oFrameInfo = null;
|
||||
pPCM = null;
|
||||
aPCMData = null;
|
||||
return PLAYM4_AUDIO_FRAME;
|
||||
|
||||
case VIDEO_TYPE:
|
||||
var szOSDTime = getOSDTime(oFrameInfo);
|
||||
|
||||
var iWidth = oFrameInfo.width;
|
||||
var iHeight = oFrameInfo.height;
|
||||
|
||||
var iYUVSize = iWidth * iHeight * 3 / 2;
|
||||
if (0 === iYUVSize) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var pYUV = Module._GetFrameBuffer();
|
||||
|
||||
// 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
|
||||
var aYUVData = new Uint8Array(iYUVSize);
|
||||
aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
|
||||
if (bWorkerPrintLog) {
|
||||
console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
|
||||
}
|
||||
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
|
||||
'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
|
||||
}, [aYUVData.buffer]);
|
||||
|
||||
oFrameInfo = null;
|
||||
pYUV = null;
|
||||
aYUVData = null;
|
||||
return PLAYM4_VIDEO_FRAME;
|
||||
|
||||
case PRIVT_TYPE:
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
|
||||
});
|
||||
return PLAYM4_SYS_NOT_SUPPORT;
|
||||
|
||||
default:
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
|
||||
});
|
||||
return PLAYM4_SYS_NOT_SUPPORT;
|
||||
}
|
||||
}
|
||||
else {
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
//解码失败返回裸数据
|
||||
if (PLAYM4_DECODE_ERROR === errorCode) {
|
||||
var rawInfo = Module._GetRawDataInfo();
|
||||
var pRawData = Module._GetRawDataBuffer();
|
||||
var aRawData = new Uint8Array(rawInfo.isize);
|
||||
aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
|
||||
postMessage({
|
||||
'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
|
||||
'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
|
||||
});
|
||||
rawInfo = null;
|
||||
pRawData = null;
|
||||
aRawData = null;
|
||||
}
|
||||
//需要更多数据
|
||||
if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
|
||||
});
|
||||
}
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
// 开始计算时间
|
||||
function startTime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
// 结束计算时间
|
||||
function endTime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
// 字母字符串转byte数组
|
||||
function stringToBytes(str) {
|
||||
var ch, st, re = [];
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
ch = str.charCodeAt(i); // get char
|
||||
st = []; // set up "stack"
|
||||
do {
|
||||
st.push(ch & 0xFF); // push byte to stack
|
||||
ch = ch >> 8; // shift value down by 1 byte
|
||||
}
|
||||
while (ch);
|
||||
// add stack contents to result
|
||||
// done because chars have "wrong" endianness
|
||||
re = re.concat(st.reverse());
|
||||
}
|
||||
// return an array of bytes
|
||||
return re;
|
||||
}
|
||||
})();
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
"use strict";var Module={};var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}JSPlayerModule(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{Module["__emscripten_thread_exit"](-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
"use strict";var Module={};var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}JSPlayerModule(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{Module["__emscripten_thread_exit"](-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}JSAudioInterComModule(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{Module["__emscripten_thread_exit"](-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
|
@ -0,0 +1,120 @@
|
|||
importScripts('libSystemTransform.js');
|
||||
const RECORDRTP = 0; //录制一份未经过转封装的码流原始数据,用于定位问题
|
||||
let dataType = 1;
|
||||
|
||||
// 转封装库回调函数
|
||||
self.STCallBack = function (fileIndex,indexLen, data, dataLen)
|
||||
{
|
||||
//stFrameInfo的类型见DETAIL_FRAME_INFO
|
||||
let stFrameInfo = Module._GetDetialFrameInfo();
|
||||
let nIsMp4Index = stFrameInfo.nIsMp4Index;
|
||||
//console.log("FrameType is " , stFrameInfo);
|
||||
//console.log("nIsMp4Index is " + nIsMp4Index);
|
||||
//debugger
|
||||
var pData = null;
|
||||
pData = new Uint8Array(dataLen);
|
||||
pData.set(Module.HEAPU8.subarray(data, data + dataLen));
|
||||
if (dataType === 1) {
|
||||
if (pData[0] == 0x49 && pData[1] == 0x4d && pData[2] == 0x4b && pData[3] == 0x48) {//码流头丢掉
|
||||
return;
|
||||
}
|
||||
postMessage({type: "outputData", buf: pData, dType: 1});
|
||||
dataType = 2;
|
||||
} else {
|
||||
if (nIsMp4Index) {
|
||||
postMessage({type: "outputData", buf: pData, dType: 6}); //6:索引类型
|
||||
} else {
|
||||
postMessage({type: "outputData", buf: pData, dType: 2}); //2:码流
|
||||
}
|
||||
}
|
||||
|
||||
//stFrameInfo的类型见DETAIL_FRAME_INFO
|
||||
//let stFrameInfo = Module._GetDetialFrameInfo();
|
||||
//let stFrameType = stFrameInfo.nFrameType;
|
||||
//let nFrameNum = stFrameInfo.nFrameNum;
|
||||
//let nTimeStamp = stFrameInfo.nTimeStamp;
|
||||
//let nIsMp4Index = stFrameInfo.nIsMp4Index;
|
||||
|
||||
//console.log("FrameType is " + stFrameType);
|
||||
//console.log("nIsMp4Index is " + nIsMp4Index);
|
||||
|
||||
}
|
||||
|
||||
// self.Module = { memoryInitializerRequest: loadMemInitFile(), TOTAL_MEMORY: 128*1024*1024 };
|
||||
// importScripts('SystemTransform.js');
|
||||
|
||||
self.Module['onRuntimeInitialized'] = function (){
|
||||
postMessage({type: "loaded"});
|
||||
}
|
||||
onmessage = function (e) {
|
||||
var data = e.data;
|
||||
if ("create" === data.type) {
|
||||
if (RECORDRTP) {
|
||||
postMessage({type: "created"});
|
||||
postMessage({type: "outputData", buf: data.buf, dType: 1});
|
||||
} else {
|
||||
var iHeadLen = data.len;
|
||||
var pHead = Module._malloc(iHeadLen);
|
||||
|
||||
self.writeArrayToMemory(new Uint8Array(data.buf), pHead);
|
||||
var iTransType = data.packType;//目标格式
|
||||
var iRet = Module._CreatHandle(pHead, iTransType, 4096);
|
||||
if (iRet != 0) {
|
||||
console.log("_CreatHandle failed!" + iRet);
|
||||
} else {
|
||||
iRet = Module._SysTransRegisterDataCallBack();
|
||||
if(iRet != 0)
|
||||
{
|
||||
console.log("_SysTransRegisterDataCallBack Failed:" + iRet);
|
||||
}
|
||||
|
||||
iRet = Module._SysTransStart(null, null);
|
||||
if(iRet != 0)
|
||||
{
|
||||
console.log("_SysTransStart Failed:" + iRet);
|
||||
}
|
||||
postMessage({type: "created"});
|
||||
}
|
||||
}
|
||||
|
||||
} else if ("inputData" === data.type) {
|
||||
if (RECORDRTP) {
|
||||
var aFileData = new Uint8Array(data.buf); // 拷贝一份
|
||||
var iBufferLen = aFileData.length;
|
||||
var szBufferLen = iBufferLen.toString(16);
|
||||
if (szBufferLen.length === 1) {
|
||||
szBufferLen = "000" + szBufferLen;
|
||||
} else if (szBufferLen.length === 2) {
|
||||
szBufferLen = "00" + szBufferLen;
|
||||
} else if (szBufferLen.length === 3) {
|
||||
szBufferLen = "0" + szBufferLen;
|
||||
}
|
||||
var aData = [0, 0, parseInt(szBufferLen.substring(0, 2), 16), parseInt(szBufferLen.substring(2, 4), 16)];
|
||||
for(var iIndex = 0, iDataLength = aFileData.length; iIndex < iDataLength; iIndex++) {
|
||||
aData[iIndex + 4] = aFileData[iIndex]
|
||||
}
|
||||
var dataUint8 = new Uint8Array(aData);
|
||||
postMessage({type: "outputData", buf: dataUint8.buffer, dType: 2});
|
||||
} else {
|
||||
let pInputDataBuf = Module._malloc(data.len);
|
||||
var idataLen = data.len;
|
||||
self.writeArrayToMemory(new Uint8Array(data.buf), pInputDataBuf);
|
||||
// 输入数据,每次最多2m
|
||||
let pp = Module._SysTransInputData(0, pInputDataBuf, idataLen);
|
||||
if(pp != 0) {
|
||||
//console.log("InputData Failed:" + pp);
|
||||
}
|
||||
Module._free(pInputDataBuf);
|
||||
}
|
||||
} else if ("release" === data.type) {
|
||||
var iRet = Module._SysTransStop();
|
||||
if (iRet != 0) {
|
||||
console.log("_SysTransStop Failed:", iRet);
|
||||
}
|
||||
Module._SysTransRelease();
|
||||
if (iRet != 0) {
|
||||
console.log("_SysTransRelease Failed:", iRet);
|
||||
}
|
||||
close();
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="./h5player.min.js"></script>
|
||||
<style type="text/css">
|
||||
.myplayer {
|
||||
width: 90vw;
|
||||
height: 28vh;
|
||||
border-radius: 2vh;
|
||||
overflow: hidden;
|
||||
/* background: #000; */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="play_window" class="myplayer"></div>
|
||||
<script>
|
||||
// 这里写js业务代码
|
||||
// 初始化插件
|
||||
var myPlugin = new JSPlugin({
|
||||
szId: 'play_window', //需要英文字母开头 必填
|
||||
szBasePath: './h5player.min.js', // 必填,引用H5player.min.js的js相对路径
|
||||
iCurrentSplit: 1,
|
||||
})
|
||||
// 获取视频播放流
|
||||
var playURL = GetQueryString("cameraUrl")
|
||||
console.log("222",playURL);
|
||||
// 有视频流地址以后,才进行播放
|
||||
if(playURL){
|
||||
// 窗口下标
|
||||
var curIndex = 0;
|
||||
// 获取监控点唯一标识,方便作为抓图存储的key
|
||||
var cameraIndexCode = GetQueryString("cameraIndexCode")
|
||||
// 视频预览
|
||||
myPlugin.JS_Play(playURL, {
|
||||
playURL,
|
||||
mode: 1
|
||||
}, curIndex).then(() => {
|
||||
console.log("dsdsdsddsdsdsds1111111111111");
|
||||
console.info('JS_Play success 播放成功');
|
||||
// do you want...
|
||||
// 抓图
|
||||
var fileName = 'img';
|
||||
var fileType = 'JPEG';
|
||||
//不进行下载,数据回调
|
||||
myPlugin.JS_CapturePicture(curIndex, fileName, fileType,imageData => {
|
||||
console.info('JS_CapturePicture success 抓图成功'); //2.1.0开始全是base64,之前的版本存在blob或者是base64
|
||||
// do you want...
|
||||
plus.storage.setItem(cameraIndexCode,imageData);
|
||||
})
|
||||
}, (err) => {
|
||||
console.info('JS_Play failed:', err);
|
||||
// do you want...
|
||||
});
|
||||
}
|
||||
|
||||
//取url中的参数值
|
||||
function GetQueryString(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(r[2]);
|
||||
return null;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 386 B |
|
|
@ -0,0 +1,11 @@
|
|||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>
|
||||
<%= htmlWebpackPlugin.options.title %>
|
||||
</title>
|
||||
<!-- Open Graph data -->
|
||||
<!-- <meta property="og:title" content="Title Here" /> -->
|
||||
<!-- <meta property="og:url" content="http://www.example.com/" /> -->
|
||||
<!-- <meta property="og:image" content="http://example.com/image.jpg" /> -->
|
||||
<!-- <meta property="og:description" content="Description Here" /> -->
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<script src="static/h5Player/h5player.min.js"></script>
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>Please enable JavaScript to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,320 @@
|
|||
## 2.5.0-20230101(2023-01-01)
|
||||
- 秋云图表组件 修改条件编译顺序,确保uniapp的cli方式的项目依赖不完整时可以正常显示
|
||||
- 秋云图表组件 恢复props属性directory的使用,以修复vue3项目中,开启echarts后,echarts目录识别错误的bug
|
||||
- uCharts.js 修复区域图、混合图只有一个数据时图表显示不正确的bug
|
||||
- uCharts.js 修复折线图、区域图中时间轴类别图表tooltip指示点显示不正确的bug
|
||||
- uCharts.js 修复x轴使用labelCount时,并且boundaryGap = 'justify' 并且关闭Y轴显示的时候,最后一个坐标值不显示的bug
|
||||
- uCharts.js 修复折线图只有一组数据时 ios16 渲染颜色不正确的bug
|
||||
- uCharts.js 修复玫瑰图半径显示不正确的bug
|
||||
- uCharts.js 柱状图、山峰图增加正负图功能,y轴网格如果需要显示0轴则由 min max 及 splitNumber 确定,后续版本优化自动显示0轴
|
||||
- uCharts.js 柱状图column增加 opts.extra.column.labelPosition,数据标签位置,有效值为 outside外部, insideTop内顶部, center内中间, bottom内底部
|
||||
- uCharts.js 雷达图radar增加 opts.extra.radar.labelShow,否显示各项标识文案是,默认true
|
||||
- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.boxPadding,提示窗边框填充距离,默认3px
|
||||
- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.fontSize,提示窗字体大小配置,默认13px
|
||||
- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.lineHeight,提示窗文字行高,默认20px
|
||||
- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.legendShow,是否显示左侧图例,默认true
|
||||
- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.legendShape,图例形状,图例标识样式,有效值为 auto自动跟随图例, diamond◆, circle●, triangle▲, square■, rect▬, line-
|
||||
- uCharts.js 标记线markLine增加 opts.extra.markLine.labelFontSize,字体大小配置,默认13px
|
||||
- uCharts.js 标记线markLine增加 opts.extra.markLine.labelPadding,标签边框内填充距离,默认6px
|
||||
- uCharts.js 折线图line增加 opts.extra.line.linearType,渐变色类型,可选值 none关闭渐变色,custom 自定义渐变色。使用自定义渐变色时请赋值serie.linearColor作为颜色值
|
||||
- uCharts.js 折线图line增加 serie.linearColor,渐变色数组,格式为2维数组[起始位置,颜色值],例如[[0,'#0EE2F8'],[0.3,'#2BDCA8'],[0.6,'#1890FF'],[1,'#9A60B4']]
|
||||
- uCharts.js 折线图line增加 opts.extra.line.onShadow,是否开启折线阴影,开启后请赋值serie.setShadow阴影设置
|
||||
- uCharts.js 折线图line增加 serie.setShadow,阴影配置,格式为4位数组:[offsetX,offsetY,blur,color]
|
||||
- uCharts.js 折线图line增加 opts.extra.line.animation,动画效果方向,可选值为vertical 垂直动画效果,horizontal 水平动画效果
|
||||
- uCharts.js X轴xAxis增加 opts.xAxis.lineHeight,X轴字体行高,默认20px
|
||||
- uCharts.js X轴xAxis增加 opts.xAxis.marginTop,X轴文字距离轴线的距离,默认0px
|
||||
- uCharts.js X轴xAxis增加 opts.xAxis.title,当前X轴标题
|
||||
- uCharts.js X轴xAxis增加 opts.xAxis.titleFontSize,标题字体大小,默认13px
|
||||
- uCharts.js X轴xAxis增加 opts.xAxis.titleOffsetY,标题纵向偏移距离,负数为向上偏移,正数向下偏移
|
||||
- uCharts.js X轴xAxis增加 opts.xAxis.titleOffsetX,标题横向偏移距离,负数为向左偏移,正数向右偏移
|
||||
- uCharts.js X轴xAxis增加 opts.xAxis.titleFontColor,标题字体颜色,默认#666666
|
||||
|
||||
## 报错TypeError: Cannot read properties of undefined (reading 'length')
|
||||
- 如果是uni-modules版本组件,请先登录HBuilderX账号;
|
||||
- 在HBuilderX中的manifest.json,点击重新获取uniapp的appid,或者删除appid重新粘贴,重新运行;
|
||||
- 如果是cli项目请使用码云上的非uniCloud版本组件;
|
||||
- 或者添加uniCloud的依赖;
|
||||
- 或者使用原生uCharts;
|
||||
## 2.4.5-20221130(2022-11-30)
|
||||
- uCharts.js 优化tooltip当文字很多变为左侧显示时,如果画布仍显显示不下,提示框错位置变为以左侧0位置起画
|
||||
- uCharts.js 折线图修复特殊情况下只有单点数据,并改变线宽后点变为圆形的bug
|
||||
- uCharts.js 修复Y轴disabled启用后无效并报错的bug
|
||||
- uCharts.js 修复仪表盘起始结束角度特殊情况下显示不正确的bug
|
||||
- uCharts.js 雷达图新增参数 opts.extra.radar.radius , 自定义雷达图半径
|
||||
- uCharts.js 折线图、区域图增加tooltip指示点,opts.extra.line.activeType/opts.extra.area.activeType,可选值"none"不启用激活指示点,"hollow"空心点模式,"solid"实心点模式
|
||||
## 2.4.4-20221102(2022-11-02)
|
||||
- 秋云图表组件 修复使用echarts时reload、reshow无法调用重新渲染的bug,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/40)
|
||||
- 秋云图表组件 修复使用echarts时,初始化时宽高不正确的bug,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/42)
|
||||
- 秋云图表组件 修复uniapp的h5使用history模式时,无法加载echarts的bug
|
||||
- 秋云图表组件 小程序端@complete、@scrollLeft、@scrollRight、@getTouchStart、@getTouchMove、@getTouchEnd事件增加opts参数传出,方便一些特殊需求的交互获取数据。
|
||||
|
||||
- uCharts.js 修复calTooltipYAxisData方法内formatter格式化方法未与y轴方法同步的问题,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/43)
|
||||
- uCharts.js 地图新增参数opts.series[i].fillOpacity,以透明度方式来设置颜色过度效果,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/38)
|
||||
- uCharts.js 地图新增参数opts.extra.map.active,是否启用点击激活变色
|
||||
- uCharts.js 地图新增参数opts.extra.map.activeTextColor,是否启用点击激活变色
|
||||
- uCharts.js 地图新增渲染完成事件renderComplete
|
||||
- uCharts.js 漏斗图修复当部分数据相同时tooltip提示窗点击错误的bug
|
||||
- uCharts.js 漏斗图新增参数series.data[i].centerText 居中标签文案
|
||||
- uCharts.js 漏斗图新增参数series.data[i].centerTextSize 居中标签文案字体大小,默认opts.fontSize
|
||||
- uCharts.js 漏斗图新增参数series.data[i].centerTextColor 居中标签文案字体颜色,默认#FFFFFF
|
||||
- uCharts.js 漏斗图新增参数opts.extra.funnel.minSize 最小值的最小宽度,默认0
|
||||
- uCharts.js 进度条新增参数opts.extra.arcbar.direction,动画方向,可选值为cw顺时针、ccw逆时针
|
||||
- uCharts.js 混合图新增参数opts.extra.mix.line.width,折线的宽度,默认2
|
||||
- uCharts.js 修复tooltip开启horizentalLine水平横线标注时,图表显示错位的bug
|
||||
- uCharts.js 优化tooltip当文字很多变为左侧显示时,如果画布仍显显示不下,提示框错位置变为以左侧0位置起画
|
||||
- uCharts.js 修复开启滚动条后X轴文字超出绘图区域后的隐藏逻辑
|
||||
- uCharts.js 柱状图、条状图修复堆叠模式不能通过{value,color}赋值单个柱子颜色的问题
|
||||
- uCharts.js 气泡图修复不识别series.textSize和series.textColor的bug
|
||||
|
||||
## 报错TypeError: Cannot read properties of undefined (reading 'length')
|
||||
1. 如果是uni-modules版本组件,请先登录HBuilderX账号;
|
||||
2. 在HBuilderX中的manifest.json,点击重新获取uniapp的appid,或者删除appid重新粘贴,重新运行;
|
||||
3. 如果是cli项目请使用码云上的非uniCloud版本组件;
|
||||
4. 或者添加uniCloud的依赖;
|
||||
5. 或者使用原生uCharts;
|
||||
## 2.4.3-20220505(2022-05-05)
|
||||
- 秋云图表组件 修复开启canvas2d后将series赋值为空数组显示加载图标时,再次赋值后画布闪动的bug
|
||||
- 秋云图表组件 修复升级hbx最新版后ECharts的highlight方法报错的bug
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.gridEval,数据点位网格抽希,默认1
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.axisLabel, 是否显示刻度点值,默认false
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.axisLabelTofix,刻度点值小数位数,默认0
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.labelPointShow,是否显示末端刻度圆点,默认false
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.labelPointRadius,刻度圆点的半径,默认3
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.labelPointColor,刻度圆点的颜色,默认#cccccc
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.linearType,渐变色类型,可选值"none"关闭渐变,"custom"开启渐变
|
||||
- uCharts.js 雷达图新增参数opts.extra.radar.customColor,自定义渐变颜色,数组类型对应series的数组长度以匹配不同series颜色的不同配色方案,例如["#FA7D8D", "#EB88E2"]
|
||||
- uCharts.js 雷达图优化支持series.textColor、series.textSize属性
|
||||
- uCharts.js 柱状图中温度计式图标,优化支持全圆角类型,修复边框有缝隙的bug,详见官网【演示】中的温度计图表
|
||||
- uCharts.js 柱状图新增参数opts.extra.column.activeWidth,当前点击柱状图的背景宽度,默认一个单元格单位
|
||||
- uCharts.js 混合图增加opts.extra.mix.area.gradient 区域图是否开启渐变色
|
||||
- uCharts.js 混合图增加opts.extra.mix.area.opacity 区域图透明度,默认0.2
|
||||
- uCharts.js 饼图、圆环图、玫瑰图、漏斗图,增加opts.series[0].data[i].labelText,自定义标签文字,避免formatter格式化的繁琐,详见官网【演示】中的饼图
|
||||
- uCharts.js 饼图、圆环图、玫瑰图、漏斗图,增加opts.series[0].data[i].labelShow,自定义是否显示某一个指示标签,避免因饼图类别太多导致标签重复或者居多导致图形变形的问题,详见官网【演示】中的饼图
|
||||
- uCharts.js 增加opts.series[i].legendText/opts.series[0].data[i].legendText(与series.name同级)自定义图例显示文字的方法
|
||||
- uCharts.js 优化X轴、Y轴formatter格式化方法增加形参,统一为fromatter:function(value,index,opts){}
|
||||
- uCharts.js 修复横屏模式下无法使用双指缩放方法的bug
|
||||
- uCharts.js 修复当只有一条数据或者多条数据值相等的时候Y轴自动计算的最大值错误的bug
|
||||
- 【官网模板】增加外部自定义图例与图表交互的例子,[点击跳转](https://www.ucharts.cn/v2/#/layout/info?id=2)
|
||||
|
||||
## 注意:非unimodules 版本如因更新 hbx 至 3.4.7 导致报错如下,请到码云更新非 unimodules 版本组件,[点击跳转](https://gitee.com/uCharts/uCharts/tree/master/uni-app/uCharts-%E7%BB%84%E4%BB%B6)
|
||||
> Error in callback for immediate watcher "uchartsOpts": "SyntaxError: Unexpected token u in JSON at position 0"
|
||||
## 2.4.2-20220421(2022-04-21)
|
||||
- 秋云图表组件 修复HBX升级3.4.6.20220420版本后echarts报错的问题
|
||||
## 2.4.2-20220420(2022-04-20)
|
||||
## 重要!此版本uCharts新增了很多功能,修复了诸多已知问题
|
||||
- 秋云图表组件 新增onzoom开启双指缩放功能(仅uCharts),前提需要直角坐标系类图表类型,并且ontouch为true、opts.enableScroll为true,详见实例项目K线图
|
||||
- 秋云图表组件 新增optsWatch是否监听opts变化,关闭optsWatch后,动态修改opts不会触发图表重绘
|
||||
- 秋云图表组件 修复开启canvas2d功能后,动态更新数据后画布闪动的bug
|
||||
- 秋云图表组件 去除directory属性,改为自动获取echarts.min.js路径(升级不受影响)
|
||||
- 秋云图表组件 增加getImage()方法及@getImage事件,通过ref调用getImage()方法获,触发@getImage事件获取当前画布的base64图片文件流。
|
||||
- 秋云图表组件 支付宝、字节跳动、飞书、快手小程序支持开启canvas2d同层渲染设置。
|
||||
- 秋云图表组件 新增加【非uniCloud】版本组件,避免有些不需要uniCloud的使用组件发布至小程序需要提交隐私声明问题,请到码云[【非uniCloud版本】](https://gitee.com/uCharts/uCharts/tree/master/uni-app/uCharts-%E7%BB%84%E4%BB%B6),或npm[【非uniCloud版本】](https://www.npmjs.com/package/@qiun/uni-ucharts)下载使用。
|
||||
- uCharts.js 新增dobuleZoom双指缩放功能
|
||||
- uCharts.js 新增山峰图type="mount",数据格式为饼图类格式,不需要传入categories,具体详见新版官网在线演示
|
||||
- uCharts.js 修复折线图当数据中存在null时tooltip报错的bug
|
||||
- uCharts.js 修复饼图类当画布比较小时自动计算的半径是负数报错的bug
|
||||
- uCharts.js 统一各图表类型的series.formatter格式化方法的形参为(val, index, series, opts),方便格式化时有更多参数可用
|
||||
- uCharts.js 标记线功能增加labelText自定义显示文字,增加labelAlign标签显示位置(左侧或右侧),增加标签显示位置微调labelOffsetX、labelOffsetY
|
||||
- uCharts.js 修复条状图当数值很小时开启圆角后样式错误的bug
|
||||
- uCharts.js 修复X轴开启disabled后,X轴仍占用空间的bug
|
||||
- uCharts.js 修复X轴开启滚动条并且开启rotateLabel后,X轴文字与滚动条重叠的bug
|
||||
- uCharts.js 增加X轴rotateAngle文字旋转自定义角度,取值范围(-90至90)
|
||||
- uCharts.js 修复地图文字标签层级显示不正确的bug
|
||||
- uCharts.js 修复饼图、圆环图、玫瑰图当数据全部为0的时候不显示数据标签的bug
|
||||
- uCharts.js 修复当opts.padding上边距为0时,Y轴顶部刻度标签位置不正确的bug
|
||||
|
||||
## 另外我们还开发了各大原生小程序组件,已发布至码云和npm
|
||||
[https://gitee.com/uCharts/uCharts](https://gitee.com/uCharts/uCharts)
|
||||
[https://www.npmjs.com/~qiun](https://www.npmjs.com/~qiun)
|
||||
|
||||
## 对于原生uCharts文档我们已上线新版官方网站,详情点击下面链接进入官网
|
||||
[https://www.uCharts.cn/v2/](https://www.ucharts.cn/v2/)
|
||||
## 2.3.7-20220122(2022-01-22)
|
||||
## 重要!使用vue3编译,请使用cli模式并升级至最新依赖,HbuilderX编译需要使用3.3.8以上版本
|
||||
- uCharts.js 修复uni-app平台组件模式使用vue3编译到小程序报错的bug。
|
||||
## 2.3.7-20220118(2022-01-18)
|
||||
## 注意,使用vue3的前提是需要3.3.8.20220114-alpha版本的HBuilder!
|
||||
## 2.3.67-20220118(2022-01-18)
|
||||
- 秋云图表组件 组件初步支持vue3,全端编译会有些问题,具体详见下面修改:
|
||||
1. 小程序端运行时,在uni_modules文件夹的qiun-data-charts.js中搜索 new uni_modules_qiunDataCharts_js_sdk_uCharts_uCharts.uCharts,将.uCharts去掉。
|
||||
2. 小程序端发行时,在uni_modules文件夹的qiun-data-charts.js中搜索 new e.uCharts,将.uCharts去掉,变为 new e。
|
||||
3. 如果觉得上述步骤比较麻烦,如果您的项目只编译到小程序端,可以修改u-charts.js最后一行导出方式,将 export default uCharts;变更为 export default { uCharts: uCharts }; 这样变更后,H5和App端的renderjs会有问题,请开发者自行选择。(此问题非组件问题,请等待DC官方修复Vue3的小程序端)
|
||||
## 2.3.6-20220111(2022-01-11)
|
||||
- 秋云图表组件 修改组件 props 属性中的 background 默认值为 rgba(0,0,0,0)
|
||||
## 2.3.6-20211201(2021-12-01)
|
||||
- uCharts.js 修复bar条状图开启圆角模式时,值很小时圆角渲染错误的bug
|
||||
## 2.3.5-20211014(2021-10-15)
|
||||
- uCharts.js 增加vue3的编译支持(仅原生uCharts,qiun-data-charts组件后续会支持,请关注更新)
|
||||
## 2.3.4-20211012(2021-10-12)
|
||||
- 秋云图表组件 修复 mac os x 系统 mouseover 事件丢失的 bug
|
||||
## 2.3.3-20210706(2021-07-06)
|
||||
- uCharts.js 增加雷达图开启数据点值(opts.dataLabel)的显示
|
||||
## 2.3.2-20210627(2021-06-27)
|
||||
- 秋云图表组件 修复tooltipCustom个别情况下传值不正确报错TypeError: Cannot read property 'name' of undefined的bug
|
||||
## 2.3.1-20210616(2021-06-16)
|
||||
- uCharts.js 修复圆角柱状图使用4角圆角时,当数值过大时不正确的bug
|
||||
## 2.3.0-20210612(2021-06-12)
|
||||
- uCharts.js 【重要】uCharts增加nvue兼容,可在nvue项目中使用gcanvas组件渲染uCharts,[详见码云uCharts-demo-nvue](https://gitee.com/uCharts/uCharts)
|
||||
- 秋云图表组件 增加tapLegend属性,是否开启图例点击交互事件
|
||||
- 秋云图表组件 getIndex事件中增加返回uCharts实例中的opts参数,以便在页面中调用参数
|
||||
- 示例项目 pages/other/other.vue增加app端自定义tooltip的方法,详见showOptsTooltip方法
|
||||
## 2.2.1-20210603(2021-06-03)
|
||||
- uCharts.js 修复饼图、圆环图、玫瑰图,当起始角度不为0时,tooltip位置不准确的bug
|
||||
- uCharts.js 增加温度计式柱状图开启顶部半圆形的配置
|
||||
## 2.2.0-20210529(2021-05-29)
|
||||
- uCharts.js 增加条状图type="bar"
|
||||
- 示例项目 pages/ucharts/ucharts.vue增加条状图的demo
|
||||
## 2.1.7-20210524(2021-05-24)
|
||||
- uCharts.js 修复大数据量模式下曲线图不平滑的bug
|
||||
## 2.1.6-20210523(2021-05-23)
|
||||
- 秋云图表组件 修复小程序端开启滚动条更新数据后滚动条位置不符合预期的bug
|
||||
## 2.1.5-2021051702(2021-05-17)
|
||||
- uCharts.js 修复自定义Y轴min和max值为0时不能正确显示的bug
|
||||
## 2.1.5-20210517(2021-05-17)
|
||||
- uCharts.js 修复Y轴自定义min和max时,未按指定的最大值最小值显示坐标轴刻度的bug
|
||||
## 2.1.4-20210516(2021-05-16)
|
||||
- 秋云图表组件 优化onWindowResize防抖方法
|
||||
- 秋云图表组件 修复APP端uCharts更新数据时,清空series显示loading图标后再显示图表,图表抖动的bug
|
||||
- uCharts.js 修复开启canvas2d后,x轴、y轴、series自定义字体大小未按比例缩放的bug
|
||||
- 示例项目 修复format-e.vue拼写错误导致app端使用uCharts渲染图表
|
||||
## 2.1.3-20210513(2021-05-13)
|
||||
- 秋云图表组件 修改uCharts变更chartData数据为updateData方法,支持带滚动条的数据动态打点
|
||||
- 秋云图表组件 增加onWindowResize防抖方法 fix by ど誓言,如尘般染指流年づ
|
||||
- 秋云图表组件 H5或者APP变更chartData数据显示loading图表时,原数据闪现的bug
|
||||
- 秋云图表组件 props增加errorReload禁用错误点击重新加载的方法
|
||||
- uCharts.js 增加tooltip显示category(x轴对应点位)标题的功能,opts.extra.tooltip.showCategory,默认为false
|
||||
- uCharts.js 修复mix混合图只有柱状图时,tooltip的分割线显示位置不正确的bug
|
||||
- uCharts.js 修复开启滚动条,图表在拖动中动态打点,滚动条位置不正确的bug
|
||||
- uCharts.js 修复饼图类数据格式为echarts数据格式,series为空数组报错的bug
|
||||
- 示例项目 修改uCharts.js更新到v2.1.2版本后,@getIndex方法获取索引值变更为e.currentIndex.index
|
||||
- 示例项目 pages/updata/updata.vue增加滚动条拖动更新(数据动态打点)的demo
|
||||
- 示例项目 pages/other/other.vue增加errorReload禁用错误点击重新加载的demo
|
||||
## 2.1.2-20210509(2021-05-09)
|
||||
秋云图表组件 修复APP端初始化时就传入chartData或lacaldata不显示图表的bug
|
||||
## 2.1.1-20210509(2021-05-09)
|
||||
- 秋云图表组件 变更ECharts的eopts配置在renderjs内执行,支持在config-echarts.js配置文件内写function配置。
|
||||
- 秋云图表组件 修复APP端报错Prop being mutated: "onmouse"错误的bug。
|
||||
- 秋云图表组件 修复APP端报错Error: Not Found:Page[6][-1,27] at view.umd.min.js:1的bug。
|
||||
## 2.1.0-20210507(2021-05-07)
|
||||
- 秋云图表组件 修复初始化时就有数据或者数据更新的时候loading加载动画闪动的bug
|
||||
- uCharts.js 修复x轴format方法categories为字符串类型时返回NaN的bug
|
||||
- uCharts.js 修复series.textColor、legend.fontColor未执行全局默认颜色的bug
|
||||
## 2.1.0-20210506(2021-05-06)
|
||||
- 秋云图表组件 修复极个别情况下报错item.properties undefined的bug
|
||||
- 秋云图表组件 修复极个别情况下关闭加载动画reshow不起作用,无法显示图表的bug
|
||||
- 示例项目 pages/ucharts/ucharts.vue 增加时间轴折线图(type="tline")、时间轴区域图(type="tarea")、散点图(type="scatter")、气泡图demo(type="bubble")、倒三角形漏斗图(opts.extra.funnel.type="triangle")、金字塔形漏斗图(opts.extra.funnel.type="pyramid")
|
||||
- 示例项目 pages/format-u/format-u.vue 增加X轴format格式化示例
|
||||
- uCharts.js 升级至v2.1.0版本
|
||||
- uCharts.js 修复 玫瑰图面积模式点击tooltip位置不正确的bug
|
||||
- uCharts.js 修复 玫瑰图点击图例,只剩一个类别显示空白的bug
|
||||
- uCharts.js 修复 饼图类图点击图例,其他图表tooltip位置某些情况下不准的bug
|
||||
- uCharts.js 修复 x轴为矢量轴(时间轴)情况下,点击tooltip位置不正确的bug
|
||||
- uCharts.js 修复 词云图获取点击索引偶尔不准的bug
|
||||
- uCharts.js 增加 直角坐标系图表X轴format格式化方法(原生uCharts.js用法请使用formatter)
|
||||
- uCharts.js 增加 漏斗图扩展配置,倒三角形(opts.extra.funnel.type="triangle"),金字塔形(opts.extra.funnel.type="pyramid")
|
||||
- uCharts.js 增加 散点图(opts.type="scatter")、气泡图(opts.type="bubble")
|
||||
- 后期计划 完善散点图、气泡图,增加markPoints标记点,增加横向条状图。
|
||||
## 2.0.0-20210502(2021-05-02)
|
||||
- uCharts.js 修复词云图获取点击索引不正确的bug
|
||||
## 2.0.0-20210501(2021-05-01)
|
||||
- 秋云图表组件 修复QQ小程序、百度小程序在关闭动画效果情况下,v-for循环使用图表,显示不正确的bug
|
||||
## 2.0.0-20210426(2021-04-26)
|
||||
- 秋云图表组件 修复QQ小程序不支持canvas2d的bug
|
||||
- 秋云图表组件 修复钉钉小程序某些情况点击坐标计算错误的bug
|
||||
- uCharts.js 增加 extra.column.categoryGap 参数,柱状图类每个category点位(X轴点)柱子组之间的间距
|
||||
- uCharts.js 增加 yAxis.data[i].titleOffsetY 参数,标题纵向偏移距离,负数为向上偏移,正数向下偏移
|
||||
- uCharts.js 增加 yAxis.data[i].titleOffsetX 参数,标题横向偏移距离,负数为向左偏移,正数向右偏移
|
||||
- uCharts.js 增加 extra.gauge.labelOffset 参数,仪表盘标签文字径向便宜距离,默认13px
|
||||
## 2.0.0-20210422-2(2021-04-22)
|
||||
秋云图表组件 修复 formatterAssign 未判断 args[key] == null 的情况导致栈溢出的 bug
|
||||
## 2.0.0-20210422(2021-04-22)
|
||||
- 秋云图表组件 修复H5、APP、支付宝小程序、微信小程序canvas2d模式下横屏模式的bug
|
||||
## 2.0.0-20210421(2021-04-21)
|
||||
- uCharts.js 修复多行图例的情况下,图例在上方或者下方时,图例float为左侧或者右侧时,第二行及以后的图例对齐方式不正确的bug
|
||||
## 2.0.0-20210420(2021-04-20)
|
||||
- 秋云图表组件 修复微信小程序开启canvas2d模式后,windows版微信小程序不支持canvas2d模式的bug
|
||||
- 秋云图表组件 修改非uni_modules版本为v2.0版本qiun-data-charts组件
|
||||
## 2.0.0-20210419(2021-04-19)
|
||||
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。
|
||||
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑;
|
||||
## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。
|
||||
## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。
|
||||
## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn)
|
||||
## <font color=#FF0000> 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! </font>
|
||||
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn)
|
||||
## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651)
|
||||
- uCharts.js 修复混合图中柱状图单独设置颜色不生效的bug
|
||||
- uCharts.js 修复多Y轴单独设置fontSize时,开启canvas2d后,未对应放大字体的bug
|
||||
## 2.0.0-20210418(2021-04-18)
|
||||
- 秋云图表组件 增加directory配置,修复H5端history模式下如果发布到二级目录无法正确加载echarts.min.js的bug
|
||||
## 2.0.0-20210416(2021-04-16)
|
||||
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。
|
||||
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑;
|
||||
## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。
|
||||
## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。
|
||||
## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn)
|
||||
## <font color=#FF0000> 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! </font>
|
||||
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn)
|
||||
## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651)
|
||||
- 秋云图表组件 修复APP端某些情况下报错`Not Found Page`的bug,fix by 高级bug开发技术员
|
||||
- 示例项目 修复APP端v-for循环某些情况下报错`Not Found Page`的bug,fix by 高级bug开发技术员
|
||||
- uCharts.js 修复非直角坐标系tooltip提示窗右侧超出未变换方向显示的bug
|
||||
## 2.0.0-20210415(2021-04-15)
|
||||
- 秋云图表组件 修复H5端发布到二级目录下echarts无法加载的bug
|
||||
- 秋云图表组件 修复某些情况下echarts.off('finished')移除监听事件报错的bug
|
||||
## 2.0.0-20210414(2021-04-14)
|
||||
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。
|
||||
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑;
|
||||
## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。
|
||||
## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。
|
||||
## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn)
|
||||
## <font color=#FF0000> 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! </font>
|
||||
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn)
|
||||
## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651)
|
||||
- 秋云图表组件 修复H5端在cli项目下ECharts引用地址错误的bug
|
||||
- 示例项目 增加ECharts的formatter用法的示例(详见示例项目format-e.vue)
|
||||
- uCharts.js 增加圆环图中心背景色的配置extra.ring.centerColor
|
||||
- uCharts.js 修复微信小程序安卓端柱状图开启透明色后显示不正确的bug
|
||||
## 2.0.0-20210413(2021-04-13)
|
||||
- 秋云图表组件 修复百度小程序多个图表真机未能正确获取根元素dom尺寸的bug
|
||||
- 秋云图表组件 修复百度小程序横屏模式方向不正确的bug
|
||||
- 秋云图表组件 修改ontouch时,@getTouchStart@getTouchMove@getTouchEnd的触发条件
|
||||
- uCharts.js 修复饼图类数据格式series属性不生效的bug
|
||||
- uCharts.js 增加时序区域图 详见示例项目中ucharts.vue
|
||||
## 2.0.0-20210412-2(2021-04-12)
|
||||
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。
|
||||
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX。如仍不好用,请重启电脑,此问题已于DCloud官方确认,HBuilderX下个版本会修复。
|
||||
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn)
|
||||
## [图表组件在uniCloudAdmin中的应用 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651)
|
||||
- 秋云图表组件 修复uCharts在APP端横屏模式下不能正确渲染的bug
|
||||
- 示例项目 增加ECharts柱状图渐变色、圆角柱状图、横向柱状图(条状图)的示例
|
||||
## 2.0.0-20210412(2021-04-12)
|
||||
- 秋云图表组件 修复created中判断echarts导致APP端无法识别,改回mounted中判断echarts初始化
|
||||
- uCharts.js 修复2d模式下series.textOffset未乘像素比的bug
|
||||
## 2.0.0-20210411(2021-04-11)
|
||||
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。
|
||||
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,并清空小程序开发者工具缓存。
|
||||
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn)
|
||||
## [图表组件在uniCloudAdmin中的应用 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651)
|
||||
- uCharts.js 折线图区域图增加connectNulls断点续连的功能,详见示例项目中ucharts.vue
|
||||
- 秋云图表组件 变更初始化方法为created,变更type2d默认值为true,优化2d模式下组件初始化后dom获取不到的bug
|
||||
- 秋云图表组件 修复左右布局时,右侧图表点击坐标错误的bug,修复tooltip柱状图自定义颜色显示object的bug
|
||||
## 2.0.0-20210410(2021-04-10)
|
||||
- 修复左右布局时,右侧图表点击坐标错误的bug,修复柱状图自定义颜色tooltip显示object的bug
|
||||
- 增加标记线及柱状图自定义颜色的demo
|
||||
## 2.0.0-20210409(2021-04-08)
|
||||
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧【使用HBuilderX导入插件】即可体验,DEMO演示及在线生成工具(v2.0文档)[https://demo.ucharts.cn](https://demo.ucharts.cn)
|
||||
## 图表组件在uniCloudAdmin中的应用 [UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651)
|
||||
- uCharts.js 修复钉钉小程序百度小程序measureText不准确的bug,修复2d模式下饼图类activeRadius为按比例放大的bug
|
||||
- 修复组件在支付宝小程序端点击位置不准确的bug
|
||||
## 2.0.0-20210408(2021-04-07)
|
||||
- 修复组件在支付宝小程序端不能显示的bug(目前支付宝小程不能点击交互,后续修复)
|
||||
- uCharts.js 修复高分屏下柱状图类,圆弧进度条 自定义宽度不能按比例放大的bug
|
||||
## 2.0.0-20210407(2021-04-06)
|
||||
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧【使用HBuilderX导入插件】即可体验,DEMO演示及在线生成工具(v2.0文档)[https://demo.ucharts.cn](https://demo.ucharts.cn)
|
||||
## 增加 通过tofix和unit快速格式化y轴的demo add by `howcode`
|
||||
## 增加 图表组件在uniCloudAdmin中的应用 [UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651)
|
||||
## 2.0.0-20210406(2021-04-05)
|
||||
# 秋云图表组件+uCharts v2.0版本同步上线,使用方法详见https://demo.ucharts.cn帮助页
|
||||
## 2.0.0(2021-04-05)
|
||||
# 秋云图表组件+uCharts v2.0版本同步上线,使用方法详见https://demo.ucharts.cn帮助页
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,162 @@
|
|||
<template>
|
||||
<view class="container loading1">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading1',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
.container.loading1 {
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
.loading1 .shape1 {
|
||||
-webkit-animation: animation1shape1 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape1 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, 16px);
|
||||
transform: translate(16px, 16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, 16px);
|
||||
transform: translate(16px, 16px);
|
||||
}
|
||||
}
|
||||
.loading1 .shape2 {
|
||||
-webkit-animation: animation1shape2 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape2 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, 16px);
|
||||
transform: translate(-16px, 16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, 16px);
|
||||
transform: translate(-16px, 16px);
|
||||
}
|
||||
}
|
||||
.loading1 .shape3 {
|
||||
-webkit-animation: animation1shape3 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape3 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, -16px);
|
||||
transform: translate(16px, -16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(16px, -16px);
|
||||
transform: translate(16px, -16px);
|
||||
}
|
||||
}
|
||||
.loading1 .shape4 {
|
||||
-webkit-animation: animation1shape4 0.5s ease 0s infinite alternate;
|
||||
animation: animation1shape4 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation1shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, -16px);
|
||||
transform: translate(-16px, -16px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation1shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-16px, -16px);
|
||||
transform: translate(-16px, -16px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
<template>
|
||||
<view class="container loading2">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading2',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading2 {
|
||||
-webkit-transform: rotate(10deg);
|
||||
transform: rotate(10deg);
|
||||
}
|
||||
.container.loading2 .shape {
|
||||
border-radius: 5px;
|
||||
}
|
||||
.container.loading2{
|
||||
-webkit-animation: rotation 1s infinite;
|
||||
animation: rotation 1s infinite;
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
|
||||
.loading2 .shape1 {
|
||||
-webkit-animation: animation2shape1 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape1 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, 20px);
|
||||
transform: translate(20px, 20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, 20px);
|
||||
transform: translate(20px, 20px);
|
||||
}
|
||||
}
|
||||
.loading2 .shape2 {
|
||||
-webkit-animation: animation2shape2 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape2 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, 20px);
|
||||
transform: translate(-20px, 20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, 20px);
|
||||
transform: translate(-20px, 20px);
|
||||
}
|
||||
}
|
||||
.loading2 .shape3 {
|
||||
-webkit-animation: animation2shape3 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape3 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, -20px);
|
||||
transform: translate(20px, -20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(20px, -20px);
|
||||
transform: translate(20px, -20px);
|
||||
}
|
||||
}
|
||||
.loading2 .shape4 {
|
||||
-webkit-animation: animation2shape4 0.5s ease 0s infinite alternate;
|
||||
animation: animation2shape4 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation2shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, -20px);
|
||||
transform: translate(-20px, -20px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation2shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-20px, -20px);
|
||||
transform: translate(-20px, -20px);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
<template>
|
||||
<view class="container loading3">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading3',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading3 {
|
||||
-webkit-animation: rotation 1s infinite;
|
||||
animation: rotation 1s infinite;
|
||||
}
|
||||
.container.loading3 .shape1 {
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
.container.loading3 .shape2 {
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
.container.loading3 .shape3 {
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
.container.loading3 .shape4 {
|
||||
border-bottom-right-radius: 10px;
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
.loading3 .shape1 {
|
||||
-webkit-animation: animation3shape1 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape1 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, 5px);
|
||||
transform: translate(5px, 5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape1 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, 5px);
|
||||
transform: translate(5px, 5px);
|
||||
}
|
||||
}
|
||||
.loading3 .shape2 {
|
||||
-webkit-animation: animation3shape2 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape2 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, 5px);
|
||||
transform: translate(-5px, 5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape2 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, 5px);
|
||||
transform: translate(-5px, 5px);
|
||||
}
|
||||
}
|
||||
.loading3 .shape3 {
|
||||
-webkit-animation: animation3shape3 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape3 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, -5px);
|
||||
transform: translate(5px, -5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape3 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(5px, -5px);
|
||||
transform: translate(5px, -5px);
|
||||
}
|
||||
}
|
||||
.loading3 .shape4 {
|
||||
-webkit-animation: animation3shape4 0.5s ease 0s infinite alternate;
|
||||
animation: animation3shape4 0.5s ease 0s infinite alternate;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation3shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, -5px);
|
||||
transform: translate(-5px, -5px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation3shape4 {
|
||||
from {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: translate(-5px, -5px);
|
||||
transform: translate(-5px, -5px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
<template>
|
||||
<view class="container loading5">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading5',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading5 .shape {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
.loading5 .shape1 {
|
||||
animation: animation5shape1 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, 15px);
|
||||
transform: translate(15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, 15px);
|
||||
transform: translate(15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
}
|
||||
.loading5 .shape2 {
|
||||
animation: animation5shape2 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, 15px);
|
||||
transform: translate(-15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, 15px);
|
||||
transform: translate(-15px, 15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 15px);
|
||||
transform: translate(0, 15px);
|
||||
}
|
||||
}
|
||||
.loading5 .shape3 {
|
||||
animation: animation5shape3 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, -15px);
|
||||
transform: translate(15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(15px, 0);
|
||||
transform: translate(15px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(15px, -15px);
|
||||
transform: translate(15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
}
|
||||
.loading5 .shape4 {
|
||||
animation: animation5shape4 2s ease 0s infinite reverse;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation5shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, -15px);
|
||||
transform: translate(-15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation5shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -15px);
|
||||
transform: translate(0, -15px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-15px, -15px);
|
||||
transform: translate(-15px, -15px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-15px, 0);
|
||||
transform: translate(-15px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,229 @@
|
|||
<template>
|
||||
<view class="container loading6">
|
||||
<view class="shape shape1"></view>
|
||||
<view class="shape shape2"></view>
|
||||
<view class="shape shape3"></view>
|
||||
<view class="shape shape4"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'loading6',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped="true">
|
||||
.container {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container.loading6 {
|
||||
-webkit-animation: rotation 1s infinite;
|
||||
animation: rotation 1s infinite;
|
||||
}
|
||||
.container.loading6 .shape {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.container .shape {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.container .shape.shape1 {
|
||||
left: 0;
|
||||
background-color: #1890FF;
|
||||
}
|
||||
.container .shape.shape2 {
|
||||
right: 0;
|
||||
background-color: #91CB74;
|
||||
}
|
||||
.container .shape.shape3 {
|
||||
bottom: 0;
|
||||
background-color: #FAC858;
|
||||
}
|
||||
.container .shape.shape4 {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: #EE6666;
|
||||
}
|
||||
|
||||
|
||||
.loading6 .shape1 {
|
||||
-webkit-animation: animation6shape1 2s linear 0s infinite normal;
|
||||
animation: animation6shape1 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, 18px);
|
||||
transform: translate(18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape1 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, 18px);
|
||||
transform: translate(18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
}
|
||||
.loading6 .shape2 {
|
||||
-webkit-animation: animation6shape2 2s linear 0s infinite normal;
|
||||
animation: animation6shape2 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, 18px);
|
||||
transform: translate(-18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape2 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, 18px);
|
||||
transform: translate(-18px, 18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, 18px);
|
||||
transform: translate(0, 18px);
|
||||
}
|
||||
}
|
||||
.loading6 .shape3 {
|
||||
-webkit-animation: animation6shape3 2s linear 0s infinite normal;
|
||||
animation: animation6shape3 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, -18px);
|
||||
transform: translate(18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape3 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(18px, 0);
|
||||
transform: translate(18px, 0);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(18px, -18px);
|
||||
transform: translate(18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
}
|
||||
.loading6 .shape4 {
|
||||
-webkit-animation: animation6shape4 2s linear 0s infinite normal;
|
||||
animation: animation6shape4 2s linear 0s infinite normal;
|
||||
}
|
||||
|
||||
@-webkit-keyframes animation6shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, -18px);
|
||||
transform: translate(-18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animation6shape4 {
|
||||
0% {
|
||||
-webkit-transform: translate(0, 0);
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: translate(0, -18px);
|
||||
transform: translate(0, -18px);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: translate(-18px, -18px);
|
||||
transform: translate(-18px, -18px);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: translate(-18px, 0);
|
||||
transform: translate(-18px, 0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
<view>
|
||||
<Loading1 v-if="loadingType==1"/>
|
||||
<Loading2 v-if="loadingType==2"/>
|
||||
<Loading3 v-if="loadingType==3"/>
|
||||
<Loading4 v-if="loadingType==4"/>
|
||||
<Loading5 v-if="loadingType==5"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Loading1 from "./loading1.vue";
|
||||
import Loading2 from "./loading2.vue";
|
||||
import Loading3 from "./loading3.vue";
|
||||
import Loading4 from "./loading4.vue";
|
||||
import Loading5 from "./loading5.vue";
|
||||
export default {
|
||||
components:{Loading1,Loading2,Loading3,Loading4,Loading5},
|
||||
name: 'qiun-loading',
|
||||
props: {
|
||||
loadingType: {
|
||||
type: Number,
|
||||
default: 2
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,422 @@
|
|||
/*
|
||||
* uCharts®
|
||||
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台
|
||||
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
|
||||
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
* 复制使用请保留本段注释,感谢支持开源!
|
||||
*
|
||||
* uCharts®官方网站
|
||||
* https://www.uCharts.cn
|
||||
*
|
||||
* 开源地址:
|
||||
* https://gitee.com/uCharts/uCharts
|
||||
*
|
||||
* uni-app插件市场地址:
|
||||
* http://ext.dcloud.net.cn/plugin?id=271
|
||||
*
|
||||
*/
|
||||
|
||||
// 通用配置项
|
||||
|
||||
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
|
||||
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'];
|
||||
|
||||
const cfe = {
|
||||
//demotype为自定义图表类型
|
||||
"type": ["pie", "ring", "rose", "funnel", "line", "column", "area", "radar", "gauge","candle","demotype"],
|
||||
//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型例如最后的"demotype"
|
||||
"categories": ["line", "column", "area", "radar", "gauge", "candle","demotype"],
|
||||
//instance为实例变量承载属性,option为eopts承载属性,不要删除
|
||||
"instance": {},
|
||||
"option": {},
|
||||
//下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
|
||||
"formatter":{
|
||||
"tooltipDemo1":function(res){
|
||||
let result = ''
|
||||
for (let i in res) {
|
||||
if (i == 0) {
|
||||
result += res[i].axisValueLabel + '年销售额'
|
||||
}
|
||||
let value = '--'
|
||||
if (res[i].data !== null) {
|
||||
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 result;
|
||||
},
|
||||
legendFormat:function(name){
|
||||
return "自定义图例+"+name;
|
||||
},
|
||||
yAxisFormatDemo:function (value, index) {
|
||||
return value + '元';
|
||||
},
|
||||
seriesFormatDemo:function(res){
|
||||
return res.name + '年' + res.value + '元';
|
||||
}
|
||||
},
|
||||
//这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在eopts参数,会将demotype与eopts中option合并后渲染图表。
|
||||
"demotype":{
|
||||
"color": color,
|
||||
//在这里填写echarts的option即可
|
||||
|
||||
},
|
||||
//下面是自定义配置,请添加项目所需的通用配置
|
||||
"column": {
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"tooltip": {
|
||||
"trigger": 'axis'
|
||||
},
|
||||
"grid": {
|
||||
"top": 30,
|
||||
"bottom": 50,
|
||||
"right": 15,
|
||||
"left": 40
|
||||
},
|
||||
"legend": {
|
||||
"bottom": 'left',
|
||||
},
|
||||
"toolbox": {
|
||||
"show": false,
|
||||
},
|
||||
"xAxis": {
|
||||
"type": 'category',
|
||||
"axisLabel": {
|
||||
"color": '#666666'
|
||||
},
|
||||
"axisLine": {
|
||||
"lineStyle": {
|
||||
"color": '#CCCCCC'
|
||||
}
|
||||
},
|
||||
"boundaryGap": true,
|
||||
"data": []
|
||||
},
|
||||
"yAxis": {
|
||||
"type": 'value',
|
||||
"axisTick": {
|
||||
"show": false,
|
||||
},
|
||||
"axisLabel": {
|
||||
"color": '#666666'
|
||||
},
|
||||
"axisLine": {
|
||||
"lineStyle": {
|
||||
"color": '#CCCCCC'
|
||||
}
|
||||
},
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'bar',
|
||||
"data": [],
|
||||
"barwidth": 20,
|
||||
"label": {
|
||||
"show": true,
|
||||
"color": "#666666",
|
||||
"position": 'top',
|
||||
},
|
||||
},
|
||||
},
|
||||
"line": {
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"tooltip": {
|
||||
"trigger": 'axis'
|
||||
},
|
||||
"grid": {
|
||||
"top": 30,
|
||||
"bottom": 50,
|
||||
"right": 15,
|
||||
"left": 40
|
||||
},
|
||||
"legend": {
|
||||
"bottom": 'left',
|
||||
},
|
||||
"toolbox": {
|
||||
"show": false,
|
||||
},
|
||||
"xAxis": {
|
||||
"type": 'category',
|
||||
"axisLabel": {
|
||||
"color": '#666666'
|
||||
},
|
||||
"axisLine": {
|
||||
"lineStyle": {
|
||||
"color": '#CCCCCC'
|
||||
}
|
||||
},
|
||||
"boundaryGap": true,
|
||||
"data": []
|
||||
},
|
||||
"yAxis": {
|
||||
"type": 'value',
|
||||
"axisTick": {
|
||||
"show": false,
|
||||
},
|
||||
"axisLabel": {
|
||||
"color": '#666666'
|
||||
},
|
||||
"axisLine": {
|
||||
"lineStyle": {
|
||||
"color": '#CCCCCC'
|
||||
}
|
||||
},
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'line',
|
||||
"data": [],
|
||||
"barwidth": 20,
|
||||
"label": {
|
||||
"show": true,
|
||||
"color": "#666666",
|
||||
"position": 'top',
|
||||
},
|
||||
},
|
||||
},
|
||||
"area": {
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"tooltip": {
|
||||
"trigger": 'axis'
|
||||
},
|
||||
"grid": {
|
||||
"top": 30,
|
||||
"bottom": 50,
|
||||
"right": 15,
|
||||
"left": 40
|
||||
},
|
||||
"legend": {
|
||||
"bottom": 'left',
|
||||
},
|
||||
"toolbox": {
|
||||
"show": false,
|
||||
},
|
||||
"xAxis": {
|
||||
"type": 'category',
|
||||
"axisLabel": {
|
||||
"color": '#666666'
|
||||
},
|
||||
"axisLine": {
|
||||
"lineStyle": {
|
||||
"color": '#CCCCCC'
|
||||
}
|
||||
},
|
||||
"boundaryGap": true,
|
||||
"data": []
|
||||
},
|
||||
"yAxis": {
|
||||
"type": 'value',
|
||||
"axisTick": {
|
||||
"show": false,
|
||||
},
|
||||
"axisLabel": {
|
||||
"color": '#666666'
|
||||
},
|
||||
"axisLine": {
|
||||
"lineStyle": {
|
||||
"color": '#CCCCCC'
|
||||
}
|
||||
},
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'line',
|
||||
"data": [],
|
||||
"areaStyle": {},
|
||||
"label": {
|
||||
"show": true,
|
||||
"color": "#666666",
|
||||
"position": 'top',
|
||||
},
|
||||
},
|
||||
},
|
||||
"pie": {
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"tooltip": {
|
||||
"trigger": 'item'
|
||||
},
|
||||
"grid": {
|
||||
"top": 40,
|
||||
"bottom": 30,
|
||||
"right": 15,
|
||||
"left": 15
|
||||
},
|
||||
"legend": {
|
||||
"bottom": 'left',
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'pie',
|
||||
"data": [],
|
||||
"radius": '50%',
|
||||
"label": {
|
||||
"show": true,
|
||||
"color": "#666666",
|
||||
"position": 'top',
|
||||
},
|
||||
},
|
||||
},
|
||||
"ring": {
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"tooltip": {
|
||||
"trigger": 'item'
|
||||
},
|
||||
"grid": {
|
||||
"top": 40,
|
||||
"bottom": 30,
|
||||
"right": 15,
|
||||
"left": 15
|
||||
},
|
||||
"legend": {
|
||||
"bottom": 'left',
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'pie',
|
||||
"data": [],
|
||||
"radius": ['40%', '70%'],
|
||||
"avoidLabelOverlap": false,
|
||||
"label": {
|
||||
"show": true,
|
||||
"color": "#666666",
|
||||
"position": 'top',
|
||||
},
|
||||
"labelLine": {
|
||||
"show": true
|
||||
},
|
||||
},
|
||||
},
|
||||
"rose": {
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"tooltip": {
|
||||
"trigger": 'item'
|
||||
},
|
||||
"legend": {
|
||||
"top": 'bottom'
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'pie',
|
||||
"data": [],
|
||||
"radius": "55%",
|
||||
"center": ['50%', '50%'],
|
||||
"roseType": 'area',
|
||||
},
|
||||
},
|
||||
"funnel": {
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"tooltip": {
|
||||
"trigger": 'item',
|
||||
"formatter": "{b} : {c}%"
|
||||
},
|
||||
"legend": {
|
||||
"top": 'bottom'
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'funnel',
|
||||
"left": '10%',
|
||||
"top": 60,
|
||||
"bottom": 60,
|
||||
"width": '80%',
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"minSize": '0%',
|
||||
"maxSize": '100%',
|
||||
"sort": 'descending',
|
||||
"gap": 2,
|
||||
"label": {
|
||||
"show": true,
|
||||
"position": 'inside'
|
||||
},
|
||||
"labelLine": {
|
||||
"length": 10,
|
||||
"lineStyle": {
|
||||
"width": 1,
|
||||
"type": 'solid'
|
||||
}
|
||||
},
|
||||
"itemStyle": {
|
||||
"bordercolor": '#fff',
|
||||
"borderwidth": 1
|
||||
},
|
||||
"emphasis": {
|
||||
"label": {
|
||||
"fontSize": 20
|
||||
}
|
||||
},
|
||||
"data": [],
|
||||
},
|
||||
},
|
||||
"gauge": {
|
||||
"color": color,
|
||||
"tooltip": {
|
||||
"formatter": '{a} <br/>{b} : {c}%'
|
||||
},
|
||||
"seriesTemplate": {
|
||||
"name": '业务指标',
|
||||
"type": 'gauge',
|
||||
"detail": {"formatter": '{value}%'},
|
||||
"data": [{"value": 50, "name": '完成率'}]
|
||||
},
|
||||
},
|
||||
"candle": {
|
||||
"xAxis": {
|
||||
"data": []
|
||||
},
|
||||
"yAxis": {},
|
||||
"color": color,
|
||||
"title": {
|
||||
"text": ''
|
||||
},
|
||||
"dataZoom": [{
|
||||
"type": 'inside',
|
||||
"xAxisIndex": [0, 1],
|
||||
"start": 10,
|
||||
"end": 100
|
||||
},
|
||||
{
|
||||
"show": true,
|
||||
"xAxisIndex": [0, 1],
|
||||
"type": 'slider',
|
||||
"bottom": 10,
|
||||
"start": 10,
|
||||
"end": 100
|
||||
}
|
||||
],
|
||||
"seriesTemplate": {
|
||||
"name": '',
|
||||
"type": 'k',
|
||||
"data": [],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default cfe;
|
||||
|
|
@ -0,0 +1,606 @@
|
|||
/*
|
||||
* uCharts®
|
||||
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台
|
||||
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
|
||||
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
* 复制使用请保留本段注释,感谢支持开源!
|
||||
*
|
||||
* uCharts®官方网站
|
||||
* https://www.uCharts.cn
|
||||
*
|
||||
* 开源地址:
|
||||
* https://gitee.com/uCharts/uCharts
|
||||
*
|
||||
* uni-app插件市场地址:
|
||||
* http://ext.dcloud.net.cn/plugin?id=271
|
||||
*
|
||||
*/
|
||||
|
||||
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
|
||||
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'];
|
||||
|
||||
//事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改
|
||||
const formatDateTime = (timeStamp, returnType)=>{
|
||||
var date = new Date();
|
||||
date.setTime(timeStamp * 1000);
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth() + 1;
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
var d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
var h = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
var minute = date.getMinutes();
|
||||
var second = date.getSeconds();
|
||||
minute = minute < 10 ? ('0' + minute) : minute;
|
||||
second = second < 10 ? ('0' + second) : second;
|
||||
if(returnType == 'full'){return y + '-' + m + '-' + d + ' '+ h +':' + minute + ':' + second;}
|
||||
if(returnType == 'y-m-d'){return y + '-' + m + '-' + d;}
|
||||
if(returnType == 'h:m'){return h +':' + minute;}
|
||||
if(returnType == 'h:m:s'){return h +':' + minute +':' + second;}
|
||||
return [y, m, d, h, minute, second];
|
||||
}
|
||||
|
||||
const cfu = {
|
||||
//demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可
|
||||
"type":["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"],
|
||||
"range":["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","山峰图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"],
|
||||
//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
|
||||
//自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
|
||||
"categories":["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"],
|
||||
//instance为实例变量承载属性,不要删除
|
||||
"instance":{},
|
||||
//option为opts及eopts承载属性,不要删除
|
||||
"option":{},
|
||||
//下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
|
||||
"formatter":{
|
||||
"yAxisDemo1":function(val, index, opts){return val+'元'},
|
||||
"yAxisDemo2":function(val, index, opts){return val.toFixed(2)},
|
||||
"xAxisDemo1":function(val, index, opts){return val+'年';},
|
||||
"xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')},
|
||||
"seriesDemo1":function(val, index, series, opts){return val+'元'},
|
||||
"tooltipDemo1":function(item, category, index, opts){
|
||||
if(index==0){
|
||||
return '随便用'+item.data+'年'
|
||||
}else{
|
||||
return '其他我没改'+item.data+'天'
|
||||
}
|
||||
},
|
||||
"pieDemo":function(val, index, series, opts){
|
||||
if(index !== undefined){
|
||||
return series[index].name+':'+series[index].data+'元'
|
||||
}
|
||||
},
|
||||
},
|
||||
//这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。
|
||||
"demotype":{
|
||||
//我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "curve",
|
||||
"width": 2
|
||||
},
|
||||
}
|
||||
},
|
||||
//下面是自定义配置,请添加项目所需的通用配置
|
||||
"pie":{
|
||||
"type": "pie",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"extra": {
|
||||
"pie": {
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": true,
|
||||
"borderWidth": 3,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
}
|
||||
},
|
||||
"ring":{
|
||||
"type": "ring",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"rotate": false,
|
||||
"dataLabel": true,
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "right",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"title": {
|
||||
"name": "收益率",
|
||||
"fontSize": 15,
|
||||
"color": "#666666"
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "70%",
|
||||
"fontSize": 25,
|
||||
"color": "#7cb5ec"
|
||||
},
|
||||
"extra": {
|
||||
"ring": {
|
||||
"ringWidth":30,
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": true,
|
||||
"borderWidth": 3,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
},
|
||||
},
|
||||
"rose":{
|
||||
"type": "rose",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "left",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"extra": {
|
||||
"rose": {
|
||||
"type": "area",
|
||||
"minRadius": 50,
|
||||
"activeOpacity": 0.5,
|
||||
"activeRadius": 10,
|
||||
"offsetAngle": 0,
|
||||
"labelWidth": 15,
|
||||
"border": false,
|
||||
"borderWidth": 2,
|
||||
"borderColor": "#FFFFFF"
|
||||
},
|
||||
}
|
||||
},
|
||||
"word":{
|
||||
"type": "word",
|
||||
"color": color,
|
||||
"extra": {
|
||||
"word": {
|
||||
"type": "normal",
|
||||
"autoColors": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"funnel":{
|
||||
"type": "funnel",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"extra": {
|
||||
"funnel": {
|
||||
"activeOpacity": 0.3,
|
||||
"activeWidth": 10,
|
||||
"border": true,
|
||||
"borderWidth": 2,
|
||||
"borderColor": "#FFFFFF",
|
||||
"fillOpacity": 1,
|
||||
"labelAlign": "right"
|
||||
},
|
||||
}
|
||||
},
|
||||
"map":{
|
||||
"type": "map",
|
||||
"color": color,
|
||||
"padding": [0,0,0,0],
|
||||
"dataLabel": true,
|
||||
"extra": {
|
||||
"map": {
|
||||
"border": true,
|
||||
"borderWidth": 1,
|
||||
"borderColor": "#666666",
|
||||
"fillOpacity": 0.6,
|
||||
"activeBorderColor": "#F04864",
|
||||
"activeFillColor": "#FACC14",
|
||||
"activeFillOpacity": 1
|
||||
},
|
||||
}
|
||||
},
|
||||
"arcbar":{
|
||||
"type": "arcbar",
|
||||
"color": color,
|
||||
"title": {
|
||||
"name": "百分比",
|
||||
"fontSize": 25,
|
||||
"color": "#00FF00"
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "默认标题",
|
||||
"fontSize": 15,
|
||||
"color": "#666666"
|
||||
},
|
||||
"extra": {
|
||||
"arcbar": {
|
||||
"type": "default",
|
||||
"width": 12,
|
||||
"backgroundColor": "#E9E9E9",
|
||||
"startAngle": 0.75,
|
||||
"endAngle": 0.25,
|
||||
"gap": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"line":{
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "straight",
|
||||
"width": 2,
|
||||
"activeType": "hollow"
|
||||
},
|
||||
}
|
||||
},
|
||||
"tline":{
|
||||
"type": "line",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"boundaryGap":"justify",
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
"data":[
|
||||
{
|
||||
"min":0,
|
||||
"max":80
|
||||
}
|
||||
]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"line": {
|
||||
"type": "curve",
|
||||
"width": 2,
|
||||
"activeType": "hollow"
|
||||
},
|
||||
}
|
||||
},
|
||||
"tarea":{
|
||||
"type": "area",
|
||||
"color": color,
|
||||
"padding": [15,10,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
"boundaryGap":"justify",
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
"data":[
|
||||
{
|
||||
"min":0,
|
||||
"max":80
|
||||
}
|
||||
]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"area": {
|
||||
"type": "curve",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 2,
|
||||
"gradient": true,
|
||||
"activeType": "hollow"
|
||||
},
|
||||
}
|
||||
},
|
||||
"column":{
|
||||
"type": "column",
|
||||
"color": color,
|
||||
"padding": [15,15,0,5],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"data":[{"min":0}]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"column": {
|
||||
"type": "group",
|
||||
"width": 30,
|
||||
"activeBgColor": "#000000",
|
||||
"activeBgOpacity": 0.08
|
||||
},
|
||||
}
|
||||
},
|
||||
"mount":{
|
||||
"type": "mount",
|
||||
"color": color,
|
||||
"padding": [15,15,0,5],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"data":[{"min":0}]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"mount": {
|
||||
"type": "mount",
|
||||
"widthRatio": 1.5,
|
||||
},
|
||||
}
|
||||
},
|
||||
"bar":{
|
||||
"type": "bar",
|
||||
"color": color,
|
||||
"padding": [15,30,0,5],
|
||||
"xAxis": {
|
||||
"boundaryGap":"justify",
|
||||
"disableGrid":false,
|
||||
"min":0,
|
||||
"axisLine":false
|
||||
},
|
||||
"yAxis": {
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"bar": {
|
||||
"type": "group",
|
||||
"width": 30,
|
||||
"meterBorde": 1,
|
||||
"meterFillColor": "#FFFFFF",
|
||||
"activeBgColor": "#000000",
|
||||
"activeBgOpacity": 0.08
|
||||
},
|
||||
}
|
||||
},
|
||||
"area":{
|
||||
"type": "area",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"gridType": "dash",
|
||||
"dashLength": 2,
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"area": {
|
||||
"type": "straight",
|
||||
"opacity": 0.2,
|
||||
"addLine": true,
|
||||
"width": 2,
|
||||
"gradient": false,
|
||||
"activeType": "hollow"
|
||||
},
|
||||
}
|
||||
},
|
||||
"radar":{
|
||||
"type": "radar",
|
||||
"color": color,
|
||||
"padding": [5,5,5,5],
|
||||
"dataLabel": false,
|
||||
"legend": {
|
||||
"show": true,
|
||||
"position": "right",
|
||||
"lineHeight": 25,
|
||||
},
|
||||
"extra": {
|
||||
"radar": {
|
||||
"gridType": "radar",
|
||||
"gridColor": "#CCCCCC",
|
||||
"gridCount": 3,
|
||||
"opacity": 0.2,
|
||||
"max": 200,
|
||||
"labelShow": true
|
||||
},
|
||||
}
|
||||
},
|
||||
"gauge":{
|
||||
"type": "gauge",
|
||||
"color": color,
|
||||
"title": {
|
||||
"name": "66Km/H",
|
||||
"fontSize": 25,
|
||||
"color": "#2fc25b",
|
||||
"offsetY": 50
|
||||
},
|
||||
"subtitle": {
|
||||
"name": "实时速度",
|
||||
"fontSize": 15,
|
||||
"color": "#1890ff",
|
||||
"offsetY": -50
|
||||
},
|
||||
"extra": {
|
||||
"gauge": {
|
||||
"type": "default",
|
||||
"width": 30,
|
||||
"labelColor": "#666666",
|
||||
"startAngle": 0.75,
|
||||
"endAngle": 0.25,
|
||||
"startNumber": 0,
|
||||
"endNumber": 100,
|
||||
"labelFormat": "",
|
||||
"splitLine": {
|
||||
"fixRadius": 0,
|
||||
"splitNumber": 10,
|
||||
"width": 30,
|
||||
"color": "#FFFFFF",
|
||||
"childNumber": 5,
|
||||
"childWidth": 12
|
||||
},
|
||||
"pointer": {
|
||||
"width": 24,
|
||||
"color": "auto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"candle":{
|
||||
"type": "candle",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"enableScroll": true,
|
||||
"enableMarkLine": true,
|
||||
"dataLabel": false,
|
||||
"xAxis": {
|
||||
"labelCount": 4,
|
||||
"itemCount": 40,
|
||||
"disableGrid": true,
|
||||
"gridColor": "#CCCCCC",
|
||||
"gridType": "solid",
|
||||
"dashLength": 4,
|
||||
"scrollShow": true,
|
||||
"scrollAlign": "left",
|
||||
"scrollColor": "#A6A6A6",
|
||||
"scrollBackgroundColor": "#EFEBEF"
|
||||
},
|
||||
"yAxis": {
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"candle": {
|
||||
"color": {
|
||||
"upLine": "#f04864",
|
||||
"upFill": "#f04864",
|
||||
"downLine": "#2fc25b",
|
||||
"downFill": "#2fc25b"
|
||||
},
|
||||
"average": {
|
||||
"show": true,
|
||||
"name": ["MA5","MA10","MA30"],
|
||||
"day": [5,10,20],
|
||||
"color": ["#1890ff","#2fc25b","#facc14"]
|
||||
}
|
||||
},
|
||||
"markLine": {
|
||||
"type": "dash",
|
||||
"dashLength": 5,
|
||||
"data": [
|
||||
{
|
||||
"value": 2150,
|
||||
"lineColor": "#f04864",
|
||||
"showLabel": true
|
||||
},
|
||||
{
|
||||
"value": 2350,
|
||||
"lineColor": "#f04864",
|
||||
"showLabel": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"mix":{
|
||||
"type": "mix",
|
||||
"color": color,
|
||||
"padding": [15,15,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": true,
|
||||
},
|
||||
"yAxis": {
|
||||
"disabled": false,
|
||||
"disableGrid": false,
|
||||
"splitNumber": 5,
|
||||
"gridType": "dash",
|
||||
"dashLength": 4,
|
||||
"gridColor": "#CCCCCC",
|
||||
"padding": 10,
|
||||
"showTitle": true,
|
||||
"data": []
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"mix": {
|
||||
"column": {
|
||||
"width": 20
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
"scatter":{
|
||||
"type": "scatter",
|
||||
"color":color,
|
||||
"padding":[15,15,0,15],
|
||||
"dataLabel":false,
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
"splitNumber":5,
|
||||
"boundaryGap":"justify",
|
||||
"min":0
|
||||
},
|
||||
"yAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"scatter": {
|
||||
},
|
||||
}
|
||||
},
|
||||
"bubble":{
|
||||
"type": "bubble",
|
||||
"color":color,
|
||||
"padding":[15,15,0,15],
|
||||
"xAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
"splitNumber":5,
|
||||
"boundaryGap":"justify",
|
||||
"min":0,
|
||||
"max":250
|
||||
},
|
||||
"yAxis": {
|
||||
"disableGrid": false,
|
||||
"gridType":"dash",
|
||||
"data":[{
|
||||
"min":0,
|
||||
"max":150
|
||||
}]
|
||||
},
|
||||
"legend": {
|
||||
},
|
||||
"extra": {
|
||||
"bubble": {
|
||||
"border":2,
|
||||
"opacity": 0.5,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default cfu;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# uCharts JSSDK说明
|
||||
1、如不使用uCharts组件,可直接引用u-charts.js,打包编译后会`自动压缩`,压缩后体积约为`120kb`。
|
||||
2、如果120kb的体积仍需压缩,请手到uCharts官网通过在线定制选择您需要的图表。
|
||||
3、config-ucharts.js为uCharts组件的用户配置文件,升级前请`自行备份config-ucharts.js`文件,以免被强制覆盖。
|
||||
4、config-echarts.js为ECharts组件的用户配置文件,升级前请`自行备份config-echarts.js`文件,以免被强制覆盖。
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
"id": "qiun-data-charts",
|
||||
"displayName": "秋云 ucharts echarts 高性能跨全端图表组件",
|
||||
"version": "2.5.0-20230101",
|
||||
"description": "uCharts 新增正负柱状图!支持H5及APP用 ucharts echarts 渲染图表,uniapp可视化首选组件",
|
||||
"keywords": [
|
||||
"ucharts",
|
||||
"echarts",
|
||||
"f2",
|
||||
"图表",
|
||||
"可视化"
|
||||
],
|
||||
"repository": "https://gitee.com/uCharts/uCharts",
|
||||
"engines": {
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": "474119"
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "插件不采集任何数据",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": "https://www.npmjs.com/~qiun",
|
||||
"type": "component-vue"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "y",
|
||||
"联盟": "y"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||

|
||||
|
||||
|
||||
[](https://gitee.com/uCharts/uCharts/stargazers)
|
||||
[](https://gitee.com/uCharts/uCharts/members)
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0.html)
|
||||
[](https://www.npmjs.com/~qiun)
|
||||
|
||||
|
||||
## uCharts简介
|
||||
|
||||
`uCharts`是一款基于`canvas API`开发的适用于所有前端应用的图表库,开发者编写一套代码,可运行到 Web、iOS、Android(基于 uni-app / taro )、以及各种小程序(微信/支付宝/百度/头条/飞书/QQ/快手/钉钉/淘宝)、快应用等更多支持 canvas API 的平台。
|
||||
|
||||
## 官方网站
|
||||
|
||||
## [https://www.ucharts.cn](https://www.ucharts.cn)
|
||||
|
||||
## 快速体验
|
||||
|
||||
一套代码编到多个平台,依次扫描二维码,亲自体验uCharts图表跨平台效果!其他平台请自行编译。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 致开发者
|
||||
|
||||
感谢各位开发者`五年`来对秋云及uCharts的支持,uCharts的进步离不开各位开发者的鼓励与贡献。为更好的帮助各位开发者使用图表工具,我们推出了新版官网,增加了在线定制、问答社区、在线配置等一些增值服务,为确保您能更好的应用图表组件,建议您先`仔细阅读官网指南`以及`常见问题`,而不是下载下来`直接使用`。如仍然不能解决,请到`官网社区`或开通会员后加入`专属VIP会员群`提问将会很快得到回答。
|
||||
|
||||
## 视频教程
|
||||
|
||||
## [uCharts新手入门教程](https://www.bilibili.com/video/BV1qA411Q7se/?share_source=copy_web&vd_source=42a1242f9aaade6427736af69eb2e1d9)
|
||||
|
||||
|
||||
## 社群支持
|
||||
|
||||
uCharts官方拥有5个2000人的QQ群及专属VIP会员群支持,庞大的用户量证明我们一直在努力,请各位放心使用!uCharts的开源图表组件的开发,团队付出了大量的时间与精力,经过四来的考验,不会有比较明显的bug,请各位放心使用。如果您有更好的想法,可以在`码云提交Pull Requests`以帮助更多开发者完成需求,再次感谢各位对uCharts的鼓励与支持!
|
||||
|
||||
#### 官方交流群
|
||||
- 交流群1:371774600(已满)
|
||||
- 交流群2:619841586(已满)
|
||||
- 交流群3:955340127(已满)
|
||||
- 交流群4:641669795(已满)
|
||||
- 交流群5:236294809(只能扫码加入)
|
||||
|
||||

|
||||
|
||||
- 口令`uniapp`
|
||||
|
||||
#### 专属VIP会员群
|
||||
- 开通会员后详见【账号详情】页面中顶部的滚动通知
|
||||
- 口令`您的用户ID`
|
||||
|
||||
## 版权信息
|
||||
|
||||
uCharts始终坚持开源,遵循 [Apache Licence 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) 开源协议,意味着您无需支付任何费用,即可将uCharts应用到您的产品中。
|
||||
|
||||
注意:这并不意味着您可以将uCharts应用到非法的领域,比如涉及赌博,暴力等方面。如因此产生纠纷或法律问题,uCharts相关方及秋云科技不承担任何责任。
|
||||
|
||||
## 合作伙伴
|
||||
|
||||
[](https://www.diygw.com/)
|
||||
[](https://gitee.com/howcode/has-chat)
|
||||
[](https://www.uviewui.com/)
|
||||
[](https://ext.dcloud.net.cn/plugin?id=7088)
|
||||
[](https://ext.dcloud.net.cn/publisher?id=202)
|
||||
[](https://www.firstui.cn/)
|
||||
[](https://ext.dcloud.net.cn/plugin?id=5169)
|
||||
[](https://www.graceui.com/)
|
||||
|
||||
|
||||
## 更新记录
|
||||
|
||||
详见官网指南中说明,[点击此处查看](https://www.ucharts.cn/v2/#/guide/index?id=100)
|
||||
|
||||
|
||||
## 相关链接
|
||||
- [uCharts官网](https://www.ucharts.cn)
|
||||
- [DCloud插件市场地址](https://ext.dcloud.net.cn/plugin?id=271)
|
||||
- [uCharts码云开源托管地址](https://gitee.com/uCharts/uCharts) [](https://gitee.com/uCharts/uCharts/stargazers)
|
||||
- [uCharts npm开源地址](https://www.ucharts.cn)
|
||||
- [ECharts官网](https://echarts.apache.org/zh/index.html)
|
||||
- [ECharts配置手册](https://echarts.apache.org/zh/option.html)
|
||||
- [图表组件在项目中的应用 ReportPlus数据报表](https://www.ucharts.cn/v2/#/layout/info?id=1)
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
var isReady=false;var onReadyCallbacks=[];
|
||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
||||
var __uniConfig = {"pages":["pages/rain/rain","pages/index/index"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","backgroundColorTop":"transparent","navigationStyle":"custom","background":"#efeff4"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"xffxkh-app","compilerVersion":"3.6.18","entryPagePath":"pages/rain/rain","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/rain/rain","meta":{"isQuit":true},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/index/index","meta":{},"window":{"navigationBarTitleText":""}}];
|
||||
var __uniConfig = {"pages":["pages/water/water","pages/rain/rain","pages/rainDetail/rainDetail","pages/hdDetail/hdDetail","pages/skDetail/skDetail","pages/index/index","subpkg/rainDetail/rainDetail"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","backgroundColorTop":"transparent","navigationStyle":"custom","background":"#efeff4"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"xffxkh-app","compilerVersion":"3.6.18","entryPagePath":"pages/water/water","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/water/water","meta":{"isQuit":true},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/rain/rain","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/rainDetail/rainDetail","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/hdDetail/hdDetail","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/skDetail/skDetail","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/index/index","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/subpkg/rainDetail/rainDetail","meta":{},"window":{}}];
|
||||
__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}}}});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
1、删除Decoder.js的外部引用,由于Decoder.js加载完全在笔记本耗时较久,很容易出现还没加载时完全出现的批量报错
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,642 @@
|
|||
/**
|
||||
* Created by wangweijie5 on 2016/12/5.
|
||||
*/
|
||||
(function (event) {
|
||||
const AUDIO_TYPE = 0; // 音频
|
||||
const VIDEO_TYPE = 1; // 视频
|
||||
const PRIVT_TYPE = 2; // 私有帧
|
||||
|
||||
const PLAYM4_AUDIO_FRAME = 100; // 音频帧
|
||||
const PLAYM4_VIDEO_FRAME = 101; // 视频帧
|
||||
|
||||
const PLAYM4_OK = 1;
|
||||
const PLAYM4_ORDER_ERROR = 2;
|
||||
const PLAYM4_DECODE_ERROR = 44 // 解码失败
|
||||
const PLAYM4_NOT_KEYFRAME = 48; // 非关键帧
|
||||
const PLAYM4_NEED_MORE_DATA = 31; // 需要更多数据才能解析
|
||||
const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
|
||||
const PLAYM4_SYS_NOT_SUPPORT = 16; // 不支持
|
||||
|
||||
importScripts('Decoder.js');
|
||||
Module.addOnPostRun(function () {
|
||||
postMessage({ 'function': "loaded" });
|
||||
});
|
||||
|
||||
var iStreamMode = 0; // 流模式
|
||||
|
||||
var bOpenMode = false;
|
||||
var bOpenStream = false;
|
||||
|
||||
var funGetFrameData = null;
|
||||
var funGetAudFrameData = null;
|
||||
|
||||
var bWorkerPrintLog = false;//worker层log开关
|
||||
|
||||
var g_nPort = -1;
|
||||
var pInputData = null;
|
||||
var inputBufferSize = 40960;
|
||||
|
||||
self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
|
||||
let port = nPort;
|
||||
let user = pUser;
|
||||
let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
|
||||
let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
|
||||
let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
|
||||
let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
|
||||
let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
|
||||
// console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
|
||||
postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
|
||||
}
|
||||
|
||||
onmessage = function (event) {
|
||||
var eventData = event.data;
|
||||
var res = 0;
|
||||
switch (eventData.command) {
|
||||
case "printLog":
|
||||
let downloadFlag = eventData.data;
|
||||
if (downloadFlag === true) {
|
||||
bWorkerPrintLog = true;
|
||||
res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
|
||||
}
|
||||
else {
|
||||
bWorkerPrintLog = false;
|
||||
res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
|
||||
}
|
||||
|
||||
if (res !== PLAYM4_OK) {
|
||||
console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
|
||||
postMessage({ 'function': "printLog", 'errorCode': res });
|
||||
}
|
||||
break;
|
||||
case "SetPlayPosition":
|
||||
let nFrameNumOrTime = eventData.data;
|
||||
let enPosType = eventData.type;
|
||||
// res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
|
||||
// if (res !== PLAYM4_OK)
|
||||
// {
|
||||
// postMessage({'function': "SetPlayPosition", 'errorCode': res});
|
||||
// return;
|
||||
// }
|
||||
// //有没有buffer需要清除
|
||||
|
||||
break;
|
||||
case "SetStreamOpenMode":
|
||||
//获取端口号
|
||||
g_nPort = Module._GetPort();
|
||||
//设置流打开模式
|
||||
iStreamMode = eventData.data;
|
||||
res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
bOpenMode = true;
|
||||
break;
|
||||
|
||||
case "OpenStream":
|
||||
// 接收到的数据
|
||||
var iHeadLen = eventData.dataSize;
|
||||
var pHead = Module._malloc(iHeadLen + 4);
|
||||
if (pHead === null) {
|
||||
return;
|
||||
}
|
||||
var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
|
||||
aHead.set(new Uint8Array(eventData.data));
|
||||
res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
|
||||
postMessage({ 'function': "OpenStream", 'errorCode': res });
|
||||
if (res !== PLAYM4_OK) {
|
||||
//释放内存
|
||||
Module._free(pHead);
|
||||
pHead = null;
|
||||
return;
|
||||
}
|
||||
bOpenStream = true;
|
||||
break;
|
||||
case "Play":
|
||||
let resP = Module._Play(g_nPort);
|
||||
if (resP !== PLAYM4_OK) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "InputData":
|
||||
// 接收到的数据
|
||||
var iLen = eventData.dataSize;
|
||||
if (iLen > 0) {
|
||||
if (pInputData == null || iLen > inputBufferSize) {
|
||||
if (pInputData != null) {
|
||||
Module._free(pInputData);
|
||||
pInputData = null;
|
||||
}
|
||||
if (iLen > inputBufferSize) {
|
||||
inputBufferSize = iLen;
|
||||
}
|
||||
|
||||
pInputData = Module._malloc(inputBufferSize);
|
||||
if (pInputData === null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var inputData = new Uint8Array(eventData.data);
|
||||
// var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
|
||||
// aInputData.set(inputData);
|
||||
Module.writeArrayToMemory(inputData, pInputData);
|
||||
inputData = null;
|
||||
res = Module._InputData(g_nPort, pInputData, iLen);
|
||||
if (res !== PLAYM4_OK) {
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
|
||||
postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
|
||||
}
|
||||
//Module._free(pInputData);
|
||||
//pInputData = null;
|
||||
} else {
|
||||
let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
|
||||
if (sourceRemain == 0) {
|
||||
postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// if (funGetFrameData === null) {
|
||||
// funGetFrameData = Module.cwrap('GetFrameData', 'number');
|
||||
// }
|
||||
|
||||
while (bOpenMode && bOpenStream) {
|
||||
|
||||
var ret = getFrameData();
|
||||
// 直到获取视频帧或数据不足为止
|
||||
if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret || || PLAYM4_NEED_NEET_LOOP === ret
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "SetSecretKey":
|
||||
var keyLen = eventData.nKeyLen;
|
||||
var pKeyData = Module._malloc(keyLen);
|
||||
if (pKeyData === null) {
|
||||
return;
|
||||
}
|
||||
var nKeySize = eventData.data.length
|
||||
var bufData = stringToBytes(eventData.data);
|
||||
var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
|
||||
let u8array = new Uint8Array(keyLen);
|
||||
aKeyData.set(u8array, 0);
|
||||
aKeyData.set(new Uint8Array(bufData));
|
||||
aKeyData = null;
|
||||
u8array = null;
|
||||
|
||||
res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetSecretKey", 'errorCode': res });
|
||||
Module._free(pKeyData);
|
||||
pKeyData = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Module._free(pKeyData);
|
||||
pKeyData = null;
|
||||
break;
|
||||
|
||||
case "GetBMP":
|
||||
var nBMPWidth = eventData.width;
|
||||
var nBMPHeight = eventData.height;
|
||||
var pYUVData = eventData.data;
|
||||
var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
|
||||
var oJpegCropRect = {
|
||||
left: eventData.left,
|
||||
top: eventData.top,
|
||||
right: eventData.right,
|
||||
bottom: eventData.bottom
|
||||
};
|
||||
|
||||
var pDataYUV = Module._malloc(nYUVSize);
|
||||
if (pDataYUV === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
|
||||
|
||||
// 分配BMP空间
|
||||
var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
|
||||
var pBmpData = Module._malloc(nBmpSize);
|
||||
var pBmpSize = Module._malloc(4);
|
||||
if (pBmpData === null || pBmpSize === null) {
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
|
||||
if (pBmpData != null) {
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
}
|
||||
|
||||
if (pBmpSize != null) {
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
|
||||
Module.setValue(pBmpSize, nBmpSize, "i32");
|
||||
res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
|
||||
oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "GetBMP", 'errorCode': res });
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取BMP图片大小
|
||||
var nBmpDataSize = Module.getValue(pBmpSize, "i32");
|
||||
|
||||
// 获取BMP图片数据
|
||||
var aBmpData = new Uint8Array(nBmpDataSize);
|
||||
aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
|
||||
|
||||
postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
|
||||
aBmpData = null;
|
||||
if (pDataYUV != null) {
|
||||
Module._free(pDataYUV);
|
||||
pDataYUV = null;
|
||||
}
|
||||
if (pBmpData != null) {
|
||||
Module._free(pBmpData);
|
||||
pBmpData = null;
|
||||
}
|
||||
if (pBmpSize != null) {
|
||||
Module._free(pBmpSize);
|
||||
pBmpSize = null;
|
||||
}
|
||||
break;
|
||||
|
||||
case "GetJPEG":
|
||||
var nJpegWidth = eventData.width;
|
||||
var nJpegHeight = eventData.height;
|
||||
var pYUVData1 = eventData.data;
|
||||
var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
|
||||
var oJpegCropRect = {
|
||||
left: eventData.left,
|
||||
top: eventData.top,
|
||||
right: eventData.right,
|
||||
bottom: eventData.bottom
|
||||
};
|
||||
|
||||
var pDataYUV1 = Module._malloc(nYUVSize1);
|
||||
if (pDataYUV1 === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
|
||||
|
||||
// 分配JPEG空间
|
||||
var pJpegData = Module._malloc(nYUVSize1);
|
||||
var pJpegSize = Module._malloc(4);
|
||||
if (pJpegData === null || pJpegSize === null) {
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32"); // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
|
||||
|
||||
res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
|
||||
oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "GetJPEG", 'errorCode': res });
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取JPEG图片大小
|
||||
var nJpegSize = Module.getValue(pJpegSize, "i32");
|
||||
|
||||
// 获取JPEG图片数据
|
||||
var aJpegData = new Uint8Array(nJpegSize);
|
||||
aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
|
||||
|
||||
postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
|
||||
|
||||
nJpegSize = null;
|
||||
aJpegData = null;
|
||||
|
||||
if (pDataYUV1 != null) {
|
||||
Module._free(pDataYUV1);
|
||||
pDataYUV1 = null;
|
||||
}
|
||||
if (pJpegData != null) {
|
||||
Module._free(pJpegData);
|
||||
pJpegData = null;
|
||||
}
|
||||
if (pJpegSize != null) {
|
||||
Module._free(pJpegSize);
|
||||
pJpegSize = null;
|
||||
}
|
||||
break;
|
||||
|
||||
case "SetDecodeFrameType":
|
||||
var nFrameType = eventData.data;
|
||||
res = Module._SetDecodeFrameType(g_nPort, nFrameType);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "CloseStream":
|
||||
//stop
|
||||
let resS = Module._Stop(g_nPort);
|
||||
if (resS !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "Stop", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
//closeStream
|
||||
res = Module._CloseStream(g_nPort);
|
||||
if (res !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "CloseStream", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
//freePort
|
||||
let resF = Module._FreePort(g_nPort);
|
||||
if (resF !== PLAYM4_OK) {
|
||||
postMessage({ 'function': "FreePort", 'errorCode': res });
|
||||
return;
|
||||
}
|
||||
if (pInputData != null) {
|
||||
Module._free(pInputData);
|
||||
pInputData = null;
|
||||
}
|
||||
break;
|
||||
case "PlaySound":
|
||||
let resPS = Module._PlaySound(g_nPort);
|
||||
if (resPS !== PLAYM4_OK) {
|
||||
console.log("PlaySound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "StopSound":
|
||||
let resSS = Module._StopSound();
|
||||
if (resSS !== PLAYM4_OK) {
|
||||
console.log("StopSound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "SetVolume":
|
||||
let resSV = Module._SetVolume(g_nPort, eventData.volume);
|
||||
if (resSV !== PLAYM4_OK) {
|
||||
console.log("Audio SetVolume failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "GetVolume":
|
||||
let volume = Module._GetVolume();
|
||||
if (volume > 0) {
|
||||
postMessage({ 'function': "GetVolume", 'volume': volume });
|
||||
}
|
||||
else {
|
||||
console.log("Audio GetVolume failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "OnlyPlaySound":
|
||||
let resOPS = Module._OnlyPlaySound(g_nPort);
|
||||
if (resOPS !== PLAYM4_OK) {
|
||||
console.log("OnlyPlaySound failed");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "Pause":
|
||||
let resPa = Module._Pause(g_nPort, eventData.bPlay);
|
||||
if (resPa !== PLAYM4_OK) {
|
||||
console.log("Pause failed");
|
||||
return;
|
||||
}
|
||||
case "PlayRate":
|
||||
Module._SetPlayRate(g_nPort, eventData.playRate);
|
||||
break;
|
||||
case "SetIFrameDecInterval":
|
||||
Module._SetIFrameDecInterval(g_nPort, eventData.data);
|
||||
break;
|
||||
case "SetLostFrameMode":
|
||||
Module._SetLostFrameMode(g_nPort, eventData.data, 0);
|
||||
break;
|
||||
case "SetDemuxModel":
|
||||
Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
|
||||
break;
|
||||
case "SkipErrorData":
|
||||
Module._SkipErrorData(g_nPort, eventData.bSkip);
|
||||
break;
|
||||
case "SetDecodeERC":
|
||||
Module._SetDecodeERC(g_nPort, eventData.nLevel);
|
||||
break;
|
||||
case "SetANRParam":
|
||||
Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
|
||||
break;
|
||||
case "SetResampleValue":
|
||||
Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
|
||||
break;
|
||||
case "GetLastError":
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
|
||||
break;
|
||||
case "SetGlobalBaseTime":
|
||||
Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
|
||||
break;
|
||||
case "SetRunTimeInfoCB":
|
||||
Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
function getOSDTime(oFrameInfo) {
|
||||
var iYear = oFrameInfo.year;
|
||||
var iMonth = oFrameInfo.month;
|
||||
var iDay = oFrameInfo.day;
|
||||
var iHour = oFrameInfo.hour;
|
||||
var iMinute = oFrameInfo.minute;
|
||||
var iSecond = oFrameInfo.second;
|
||||
|
||||
if (iMonth < 10) {
|
||||
iMonth = "0" + iMonth;
|
||||
}
|
||||
if (iDay < 10) {
|
||||
iDay = "0" + iDay;
|
||||
}
|
||||
if (iHour < 10) {
|
||||
iHour = "0" + iHour;
|
||||
}
|
||||
if (iMinute < 10) {
|
||||
iMinute = "0" + iMinute;
|
||||
}
|
||||
if (iSecond < 10) {
|
||||
iSecond = "0" + iSecond;
|
||||
}
|
||||
|
||||
return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
|
||||
}
|
||||
// 获取帧数据
|
||||
function getFrameData() {
|
||||
// function getFrameData() {
|
||||
// 获取帧数据
|
||||
var res = Module._GetFrameData();
|
||||
//var res = fun();
|
||||
if (res === PLAYM4_OK) {
|
||||
var oFrameInfo = Module._GetFrameInfo();
|
||||
switch (oFrameInfo.frameType) {
|
||||
case AUDIO_TYPE:
|
||||
var iSize = oFrameInfo.frameSize;
|
||||
if (0 === iSize) {
|
||||
return -1;
|
||||
}
|
||||
var pPCM = Module._GetFrameBuffer();
|
||||
// var audioBuf = new ArrayBuffer(iSize);
|
||||
var aPCMData = new Uint8Array(iSize);
|
||||
aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
|
||||
if (bWorkerPrintLog) {
|
||||
console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
|
||||
}
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
|
||||
'frameInfo': oFrameInfo, 'errorCode': res
|
||||
}, [aPCMData.buffer]);
|
||||
|
||||
oFrameInfo = null;
|
||||
pPCM = null;
|
||||
aPCMData = null;
|
||||
return PLAYM4_AUDIO_FRAME;
|
||||
|
||||
case VIDEO_TYPE:
|
||||
var szOSDTime = getOSDTime(oFrameInfo);
|
||||
|
||||
var iWidth = oFrameInfo.width;
|
||||
var iHeight = oFrameInfo.height;
|
||||
|
||||
var iYUVSize = iWidth * iHeight * 3 / 2;
|
||||
if (0 === iYUVSize) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var pYUV = Module._GetFrameBuffer();
|
||||
|
||||
// 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
|
||||
var aYUVData = new Uint8Array(iYUVSize);
|
||||
aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
|
||||
if (bWorkerPrintLog) {
|
||||
console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
|
||||
}
|
||||
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
|
||||
'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
|
||||
}, [aYUVData.buffer]);
|
||||
|
||||
oFrameInfo = null;
|
||||
pYUV = null;
|
||||
aYUVData = null;
|
||||
return PLAYM4_VIDEO_FRAME;
|
||||
|
||||
case PRIVT_TYPE:
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
|
||||
});
|
||||
return PLAYM4_SYS_NOT_SUPPORT;
|
||||
|
||||
default:
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
|
||||
});
|
||||
return PLAYM4_SYS_NOT_SUPPORT;
|
||||
}
|
||||
}
|
||||
else {
|
||||
let errorCode = Module._GetLastError(g_nPort);
|
||||
//解码失败返回裸数据
|
||||
if (PLAYM4_DECODE_ERROR === errorCode) {
|
||||
var rawInfo = Module._GetRawDataInfo();
|
||||
var pRawData = Module._GetRawDataBuffer();
|
||||
var aRawData = new Uint8Array(rawInfo.isize);
|
||||
aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
|
||||
postMessage({
|
||||
'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
|
||||
'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
|
||||
});
|
||||
rawInfo = null;
|
||||
pRawData = null;
|
||||
aRawData = null;
|
||||
}
|
||||
//需要更多数据
|
||||
if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
|
||||
postMessage({
|
||||
'function': "GetFrameData", 'type': "", 'data': null,
|
||||
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
|
||||
});
|
||||
}
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
// 开始计算时间
|
||||
function startTime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
// 结束计算时间
|
||||
function endTime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
// 字母字符串转byte数组
|
||||
function stringToBytes(str) {
|
||||
var ch, st, re = [];
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
ch = str.charCodeAt(i); // get char
|
||||
st = []; // set up "stack"
|
||||
do {
|
||||
st.push(ch & 0xFF); // push byte to stack
|
||||
ch = ch >> 8; // shift value down by 1 byte
|
||||
}
|
||||
while (ch);
|
||||
// add stack contents to result
|
||||
// done because chars have "wrong" endianness
|
||||
re = re.concat(st.reverse());
|
||||
}
|
||||
// return an array of bytes
|
||||
return re;
|
||||
}
|
||||
})();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue