123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440 |
- <template>
- <view>
- <uni-collapse class="uni-flex">
- <uni-collapse-item title="常用操作">
- <uni-grid :column="4" :square="false" :highlight="false">
- <uni-grid-item>
- <view class="grid-item-box pointer" @click="toSign1">
- <image class="img" mode="aspectFit" src="/static/icon/qianzhengshenqing.svg" ></image>
- <text class="text">签证申请单</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box pointer" @click="toSign2">
- <image class="img" mode="aspectFit" src="/static/icon/qianzheng.svg" ></image>
- <text class="text">待审签证单</text>
- </view>
- </uni-grid-item>
- <uni-grid-item>
- <navigator url="../template/GetMaterialIns/GetMaterialIns">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/in.svg" ></image>
- <text class="text">材料验收单</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box pointer" @click="selectProject">
- <image class="img" mode="aspectFit" src="/static/icon/select.svg" />
- <text class="text">选择项目</text>
- </view>
- </uni-grid-item>
- </uni-grid>
- <uni-grid :column="4" :square="false" :highlight="false">
- <uni-grid-item>
- <navigator url="../template/GetInStores/GetInStores">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/lingliao.svg" />
- <text class="text">入库单</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <navigator url="../template/GetMaterialOuts/GetMaterialOuts">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/lingliao.svg" />
- <text class="text">领料单</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <navigator url="../template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/quality.svg" />
- <text class="text">质量检查</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <navigator url="../template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=1">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/safe.svg" />
- <text class="text">安全检查</text>
- </view>
- </navigator>
- </uni-grid-item>
- </uni-grid>
-
- <uni-grid :column="4" :square="false" :highlight="false">
- <uni-grid-item>
- <navigator url="../template/GetPmProgressDTOs/GetPmProgressDTOs">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/progress.svg" />
- <text class="text">进度填报</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <navigator url="../template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=2">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/material.svg" />
- <text class="text">材料检查</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <navigator url="/pages/template/requisitionlist/requisitionlist?type=1">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/change.svg" />
- <text class="text">变更申请单</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <navigator url="../template/GetDesignChangesList/GetDesignChangesList">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/audit.svg" />
- <text class="text">待审变更</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <navigator :url="'../template/SupplierList/SupplierList?projectCode='+$store.state.projectCode">
- <view class="grid-item-box pointer">
- <image class="img" mode="aspectFit" src="/static/icon/audit.svg" />
- <text class="text">供应商申请</text>
- </view>
- </navigator>
- </uni-grid-item>
- <uni-grid-item>
- <view class="grid-item-box pointer" @click="logout">
- <image class="img" mode="aspectFit" src="/static/icon/logout.svg" />
- <text class="text">登出</text>
- </view>
- </uni-grid-item>
- </uni-grid>
-
-
- </uni-collapse-item>
- </uni-collapse>
-
-
- <view class="qiun-columns">
- <view class="qiun-padding" style="font-size: 32rpx;">
- <text>{{tips}}</text>
- </view>
- <view v-for="(item2,index2) in talk">
- <view class="qiun-bg-white qiun-title-bar qiun-common-mt">
- <view class="qiun-title-dot-light">
- <i class="fa fa-minus marginRight" aria-hidden="true" ref='qi_title' v-if="item2.isCollapse" @click='collapse(item2,index2)'></i>
- <i class="fa fa-plus marginRight" aria-hidden="true" ref='qi_title' v-else @click='collapse(item2,index2)'></i>
- 项目({{item2.progressName}})进度图</view>
- </view>
- <view class="line"></view>
- <view ref='qi_content' class="space" v-show="item2.isCollapse">
- <!-- 工作项开始///////////////////////////////// -->
- <view v-for="(item,index) in item2.progressList" :key="index">
- <view class="space height30">
-
- <!-- 折叠标记 -->
- <i class="fa fa-minus marginRight" aria-hidden="true" ref='qi_title' v-if="item.isCollapse" @click='collapse1(item2,index2,item,index)'></i>
- <i class="fa fa-plus marginRight" aria-hidden="true" ref='qi_title' v-else @click='collapse1(item2,index2,item,index)'></i>
- <!-- 圆点标记 -->
- <i class="fa fa-circle red marginRight" aria-hidden="true" v-if="item.alertState==3" title="未按期完成"></i>
- <i class="fa fa-circle orange marginRight" aria-hidden="true" title="即将到期预警" v-else-if="item.alertState==2"></i>
- <i class="fa fa-circle green marginRight" aria-hidden="true" title="正常" v-else></i>
- {{item.nodeName}}
- <i class="fa fa-flag marginLeft red" aria-hidden="true" v-if="item.isCompanyKey==1" title="集团关键节点"></i>
-
-
- </view>
- <view class="space" v-show="item.isCollapse">
- <view class="line" ></view>
- <view class="height30">{{item.plannedStartDate}}--{{item.plannedFinishDate}} 工期:{{item.duration}}</view>
-
- <view class="height30 progress-box">
- <progress :percent="item.completePercent" show-info stroke-width="3" />
- </view>
- <view class="height30">{{item.status==1?'进行中':item.status==4?'已完成':'未开始'}}
- <navigator :url="'../template/GetpmProgressReportDTOs/GetpmProgressReportDTOs?progressNodeId='+item.progressNodeId" class="blue right">看进度报告</navigator>
- </view>
- </view>
-
- <view class="line"></view>
- </view>
- <!-- 工作项结束///////////////////////////////// -->
- </view>
- </view>
- <view class="qiun-title-bar" style="background-color: #E5FDC3;">
- <view class="qiun-title-dot-light">质量图</view>
- </view>
- <view class="qiun-charts" style="background-color: #E5FDC3;">
- <!--#ifdef MP-ALIPAY -->
- <canvas canvas-id="canvasColumn" id="canvasColumn" class="charts" style="background-color: #E5FDC3;" :width="cWidth*pixelRatio"
- :height="cHeight*pixelRatio" :style="{'width':cWidth+'px','height':cHeight+'px'}" @touchstart="touchIt($event,'canvasColumn')"></canvas>
- <!--#endif-->
- <!--#ifndef MP-ALIPAY -->
- <canvas canvas-id="canvasColumn" id="canvasColumn" class="charts" style="background-color: #E5FDC3;" @touchstart="touchIt($event,'canvasColumn')"></canvas>
- <!--#endif-->
- </view>
- <view class="qiun-bg-white qiun-title-bar qiun-common-mt">
- <view class="qiun-title-dot-light">安全图</view>
- </view>
- <view class="qiun-charts">
- <!--#ifdef MP-ALIPAY -->
- <canvas canvas-id="canvasMix" id="canvasMix" class="charts" :width="cWidth*pixelRatio" :height="cHeight*pixelRatio"
- :style="{'width':cWidth+'px','height':cHeight+'px'}" disable-scroll=true @touchstart="touchMix" @touchmove="moveMix"
- @touchend="touchEndMix"></canvas>
- <!--#endif-->
- <!--#ifndef MP-ALIPAY -->
- <canvas canvas-id="canvasMix" id="canvasMix" class="charts" disable-scroll=true @touchstart="touchMix" @touchmove="moveMix"
- @touchend="touchEndMix"></canvas>
- <!--#endif-->
- </view>
-
- </view>
- <page-foot :isShow="true" :showIndex="0"></page-foot>
- </view>
- </template>
- <script>
- import uCharts from '@/components/u-charts/u-charts.js';
- import {
- GetPmProgressItemAndReports
- } from "@/common/api/ProgressApi.js";
- import {
- showImage
- } from "@/common/api/commonApi.js";
-
- var startX, startY;
- var endPos = {},
- isScrolling;
- var _self;
- var canvasObj = {};
- export default {
- data() {
- return {
- href: '',
- state: this.$store.state,
- cWidth: '',
- cHeight: '',
- cWidth2: '', //横屏图表
- cHeight2: '', //横屏图表
- cWidth3: '', //圆弧进度图
- cHeight3: '', //圆弧进度图
- arcbarWidth: '', //圆弧进度图,进度条宽度,此设置可使各端宽度一致
- gaugeWidth: '', //仪表盘宽度,此设置可使各端宽度一致
- tips: '',
- pixelRatio: 1,
- serverData: '',
- itemCount: 30, //x轴单屏数据密度
- sliderMax: 50,
-
- //进度图表
- talk: []
- }
- },
- onLoad() {
- console.info("首页1");
- //判断登录是否超时,若超时,则跳转到登录界面
- this.$util.persistLogin(this);
- _self = this;
- //#ifdef MP-ALIPAY
- uni.getSystemInfo({
- success: function(res) {
- if (res.pixelRatio > 1) {
- //正常这里给2就行,如果pixelRatio=3性能会降低一点
- //_self.pixelRatio =res.pixelRatio;
- _self.pixelRatio = 2;
- }
- }
- });
- //#endif
- this.cWidth = uni.upx2px(750);
- this.cHeight = uni.upx2px(500);
- this.cWidth2 = uni.upx2px(700);
- this.cHeight2 = uni.upx2px(1100);
- this.cWidth3 = uni.upx2px(250);
- this.cHeight3 = uni.upx2px(250);
- this.arcbarWidth = uni.upx2px(24);
- this.gaugeWidth = uni.upx2px(30);
- },
- onReady() {
- this.getServerData();
- },
- created() {
- this.getList();
- },
- methods: {
- toSign1() {
- uni.navigateTo({
- url: '/pages/template/requisitionlist/requisitionlist?type=0'
- });
- },
- toSign2() {
- uni.navigateTo({
- url: '/pages/template/GetVises/GetVises'
- });
- },
- preventhuadong() {
- },
- getList() {
- let _this = this;
- let projectCode = _this.$util.getState(_this, 'projectCode');
- let userCode=_this.$util.getState(_this, 'userCode');
- GetPmProgressItemAndReports(projectCode,userCode).then(res => {
- console.info('GetPmProgressItemAndReports', res);
- if (res) {
-
- if (res.length > 0) {
- res.forEach(function(item, index, arr) {
- _this.talk.push(item);
- });
- console.info('talk', _this.talk);
- //console.info('talk1',_this.talk.progressList.length);
- }
- }
- });
- },
- collapse(item2,index2){ /* 折叠或展开*/
-
- console.info('collapse');
- let that=this;
- if(item2.isCollapse){
- item2.isCollapse=false;
- }
- else{
- item2.isCollapse=true;
- }
- console.info(item2);
- that.$set(that.talk,index2,item2);
- // let talk=this.talk;
- // talk.forEach(function(item,index,array){
- // that.$set(that.talk,index,item);
- // });
-
- },
- collapse1(item2,index2,item,index){
- console.info('collapse1');
- let that=this;
- if(item.isCollapse){
- item.isCollapse=false;
- }
- else{
- item.isCollapse=true;
- }
- console.info(item2);
- that.$set(that.talk,index2,item2);
- },
- logout() {
- console.info("logout");
- this.$store.commit('setIsLogin', false);
- this.$store.commit('setUser', null);
- this.$store.commit('setToken', '');
- this.$store.commit('setName', '');
- this.$store.commit('setRoles', '');
- uni.navigateTo({
- url: "/"
- });
- },
- /* 选择项目 */
- selectProject() {
- uni.navigateTo({
- url: '/pages/SelectProject/SelectProject'
- });
- },
- /* 图表 start*/
- getServerData() {
- uni.showLoading({
- title: "正在加载数据..."
- })
- uni.request({
- url: 'https://unidemo.dcloud.net.cn/hello-uniapp-ucharts-data.json',
- data: {},
- success: function(res) {
- _self.fillData(res.data);
- },
- fail: () => {
- _self.tips = "网络错误,小程序端请检查合法域名";
- },
- complete() {
- uni.hideLoading();
- }
- });
- },
- fillData(data) {
- this.serverData = data;
- this.tips = data.tips;
- this.sliderMax = data.Candle.categories.length;
- let Column = {
- categories: [],
- series: []
- };
- let ColumnMeter = {
- categories: [],
- series: []
- };
- let LineA = {
- categories: [],
- series: []
- };
- let LineB = {
- categories: [],
- series: []
- };
- let Area = {
- categories: [],
- series: []
- };
- let Pie = {
- series: []
- };
- let Ring = {
- series: []
- };
- let Funnel = {
- series: []
- };
- let Radar = {
- categories: [],
- series: []
- };
- let Arcbar1 = {
- series: []
- };
- let Arcbar2 = {
- series: []
- };
- let Arcbar3 = {
- series: []
- };
- let Gauge = {
- categories: [],
- series: []
- };
- let Candle = {
- categories: [],
- series: []
- };
- let Mix = {
- categories: [],
- series: []
- };
- //这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
- Column.categories = data.Column.categories;
- //这里的series数据是后台做好的,如果您的数据没有和前面我注释掉的格式一样,请自行拼接数据
- Column.series = data.Column.series;
- ColumnMeter.categories = data.ColumnMeter.categories;
- //这里的series数据,如果为Meter,series[0]定义为外层数据,series[1]定义为内层数据
- ColumnMeter.series = data.ColumnMeter.series;
- LineA.categories = data.LineA.categories;
- LineA.series = data.LineA.series;
- LineB.categories = data.LineB.categories;
- LineB.series = data.LineB.series;
- Area.categories = data.Area.categories;
- Area.series = data.Area.series;
- Pie.series = data.Pie.series;
- Ring.series = data.Ring.series;
- Funnel.series = data.Pie.series;
- //自定义文案示例,需设置format字段
- for (let i = 0; i < Ring.series.length; i++) {
- Ring.series[i].format = () => {
- return Ring.series[i].name + Ring.series[i].data
- };
- }
- Radar.categories = data.Radar.categories;
- Radar.series = data.Radar.series;
- Arcbar1.series = data.Arcbar1.series;
- Arcbar2.series = data.Arcbar2.series;
- Arcbar3.series = data.Arcbar3.series;
- Gauge.categories = data.Gauge.categories;
- Gauge.series = data.Gauge.series;
- Candle.categories = data.Candle.categories;
- Candle.series = data.Candle.series;
- Mix.categories = data.Mix.categories;
- Mix.series = data.Mix.series;
- this.showColumn("canvasColumn", Column);
- this.showColumnMeter("canvasColumnMeter", ColumnMeter);
- this.showLineA("canvasLineA", LineA);
- this.showLineB("canvasLineB", LineB);
- this.showArea("canvasArea", Area);
- this.showPie("canvasPie", Pie);
- this.showRing("canvasRing", Ring);
- this.showFunnel("canvasFunnel", Funnel);
- this.showRadar("canvasRadar", Radar);
- this.showArcbar("canvasArcbar1", Arcbar1);
- this.showArcbar2("canvasArcbar2", Arcbar2);
- this.showArcbar3("canvasArcbar3", Arcbar3);
- this.showGauge("canvasGauge", Gauge);
- this.showCandle("canvasCandle", Candle);
- this.showMix("canvasMix", Mix);
- },
- showColumn(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'column',
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 0,
- },
- fontSize: 11,
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- animation: false,
- categories: chartData.categories,
- series: chartData.series,
- xAxis: {
- disableGrid: true,
- },
- yAxis: {
- format: (val) => {
- return val.toFixed(0) + '元'
- }
- },
- dataLabel: true,
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- extra: {
- column: {
- type: 'group',
- width: _self.cWidth * _self.pixelRatio * 0.45 / chartData.categories.length
- }
- }
- });
- },
- showColumnMeter(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'column',
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 0,
- },
- fontSize: 11,
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- animation: false,
- categories: chartData.categories,
- series: chartData.series,
- xAxis: {
- disableGrid: true,
- },
- yAxis: {
- //disabled:true
- },
- dataLabel: true,
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- extra: {
- column: {
- type: 'meter',
- width: _self.cWidth * _self.pixelRatio * 0.45 / chartData.categories.length,
- meter: {
- border: 4,
- fillColor: '#E5FDC3'
- }
- }
- }
- });
- },
- showLineA(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'line',
- fontSize: 11,
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 5,
- },
- dataLabel: false,
- dataPointShape: false,
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- categories: chartData.categories,
- series: chartData.series,
- animation: false,
- enableScroll: true, //开启图表拖拽功能
- xAxis: {
- disableGrid: false,
- type: 'grid',
- gridType: 'dash',
- itemCount: 4,
- scrollShow: true,
- scrollAlign: 'left',
- //scrollBackgroundColor:'#F7F7FF',//可不填写,配合enableScroll图表拖拽功能使用,X轴滚动条背景颜色,默认为 #EFEBEF
- //scrollColor:'#DEE7F7',//可不填写,配合enableScroll图表拖拽功能使用,X轴滚动条颜色,默认为 #A6A6A6
- },
- yAxis: {
- //disabled:true
- gridType: 'dash',
- splitNumber: 8,
- min: 10,
- max: 180,
- format: (val) => {
- return val.toFixed(0) + '元'
- } //如不写此方法,Y轴刻度默认保留两位小数
- },
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- dataLabel: true,
- dataPointShape: true,
- extra: {
- lineStyle: 'straight'
- },
- });
- },
- showLineB(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'line',
- fontSize: 11,
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 5,
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- rotate: true, //开启图表横屏
- // #ifdef MP-ALIPAY
- rotateLock: true, //百度及支付宝需要锁定旋转
- // #endif
- categories: chartData.categories,
- animation: false,
- series: chartData.series,
- xAxis: {
- disableGrid: true,
- },
- yAxis: {
- //disabled:true
- },
- width: _self.cWidth2 * _self.pixelRatio,
- height: _self.cHeight2 * _self.pixelRatio,
- dataLabel: true,
- dataPointShape: true,
- extra: {
- lineStyle: 'curve'
- },
- });
- },
- showArea(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'area',
- fontSize: 11,
- padding: [0, 15, 10, 15],
- legend: {
- show: true,
- position: 'top',
- float: 'center',
- itemGap: 30,
- padding: 5,
- lineHeight: 18,
- margin: 0,
- },
- dataLabel: false,
- dataPointShape: true,
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- categories: chartData.categories,
- series: chartData.series,
- animation: false,
- xAxis: {
- type: 'grid',
- gridColor: '#CCCCCC',
- gridType: 'dash',
- dashLength: 8,
- boundaryGap: 'justify' //两端不留白配置
- },
- yAxis: {
- gridType: 'dash',
- gridColor: '#CCCCCC',
- dashLength: 8,
- splitNumber: 5,
- },
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- extra: {
- area: {
- type: 'curve',
- opacity: 0.2,
- addLine: true,
- width: 2
- }
- }
- });
- },
- showPie(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'pie',
- fontSize: 11,
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 0,
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- series: chartData.series,
- animation: false,
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- dataLabel: true,
- extra: {
- pie: {
- lableWidth: 15
- }
- },
- });
- },
- showRing(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'ring',
- fontSize: 11,
- padding: [5, 5, 5, 5],
- legend: {
- show: true,
- position: 'right',
- float: 'center',
- itemGap: 10,
- padding: 5,
- lineHeight: 26,
- margin: 5,
- //backgroundColor:'rgba(41,198,90,0.2)',
- //borderColor :'rgba(41,198,90,0.5)',
- borderWidth: 1
- },
- title: {
- name: '70%',
- color: '#7cb5ec',
- fontSize: 25 * _self.pixelRatio,
- },
- subtitle: {
- name: '收益率',
- color: '#666666',
- fontSize: 15 * _self.pixelRatio,
- },
- extra: {
- pie: {
- lableWidth: 15,
- ringWidth: 40 * _self.pixelRatio, //圆环的宽度
- offsetAngle: 0 //圆环的角度
- }
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- series: chartData.series,
- animation: false,
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- disablePieStroke: true,
- dataLabel: true,
- });
- },
- showFunnel(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'funnel',
- fontSize: 11,
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 0,
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- series: chartData.series,
- animation: false,
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- dataLabel: true,
- extra: {
- funnel: {
- border: true,
- borderWidth: 2,
- borderColor: '#FFFFFF'
- }
- },
- });
- },
- showRadar(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'radar',
- fontSize: 11,
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 0,
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- animation: false,
- dataLabel: true,
- categories: chartData.categories,
- series: chartData.series,
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- extra: {
- radar: {
- max: 200 //雷达数值的最大值
- }
- }
- });
- },
- showArcbar(canvasId, chartData) {
- new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'arcbar',
- fontSize: 11,
- title: {
- name: Math.round(chartData.series[0].data * 100) + '%',
- color: chartData.series[0].color,
- fontSize: 25 * _self.pixelRatio
- },
- subtitle: {
- name: chartData.series[0].name,
- color: '#666666',
- fontSize: 15 * _self.pixelRatio
- },
- extra: {
- arcbar: {
- type: 'default',
- width: _self.arcbarWidth * _self.pixelRatio, //圆弧的宽度
- }
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- series: chartData.series,
- animation: false,
- width: _self.cWidth3 * _self.pixelRatio,
- height: _self.cHeight3 * _self.pixelRatio,
- dataLabel: true,
- });
- },
- showArcbar2(canvasId, chartData) {
- new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'arcbar',
- fontSize: 11,
- title: {
- name: Math.round(chartData.series[0].data * 100) + '%',
- color: chartData.series[0].color,
- fontSize: 25 * _self.pixelRatio
- },
- subtitle: {
- name: chartData.series[0].name,
- color: '#666666',
- fontSize: 15 * _self.pixelRatio
- },
- extra: {
- arcbar: {
- type: 'default',
- width: _self.arcbarWidth * _self.pixelRatio, //圆弧的宽度
- backgroundColor: '#ffe3e8',
- startAngle: 1.25,
- endAngle: 0.75
- }
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- series: chartData.series,
- animation: false,
- width: _self.cWidth3 * _self.pixelRatio,
- height: _self.cHeight3 * _self.pixelRatio,
- dataLabel: true,
- });
- },
- showArcbar3(canvasId, chartData) {
- new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'arcbar',
- fontSize: 11,
- title: {
- name: Math.round(chartData.series[0].data * 100) + '%',
- color: chartData.series[0].color,
- fontSize: 25 * _self.pixelRatio
- },
- subtitle: {
- name: chartData.series[0].name,
- color: '#666666',
- fontSize: 15 * _self.pixelRatio
- },
- extra: {
- arcbar: {
- type: 'circle', //整圆类型进度条图
- width: _self.arcbarWidth * _self.pixelRatio, //圆弧的宽度
- startAngle: 0.5 //整圆类型只需配置起始角度即可
- }
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- series: chartData.series,
- animation: false,
- width: _self.cWidth3 * _self.pixelRatio,
- height: _self.cHeight3 * _self.pixelRatio,
- dataLabel: true,
- });
- },
- showGauge(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'gauge',
- fontSize: 11,
- title: {
- name: Math.round(chartData.series[0].data * 100) + '%',
- color: chartData.categories[1].color,
- fontSize: 25 * _self.pixelRatio,
- offsetY: 50 * _self.pixelRatio, //新增参数,自定义调整Y轴文案距离
- },
- subtitle: {
- name: chartData.series[0].name,
- color: '#666666',
- fontSize: 15 * _self.pixelRatio,
- offsetY: -50 * _self.pixelRatio, //新增参数,自定义调整Y轴文案距离
- },
- extra: {
- gauge: {
- type: 'default',
- width: _self.gaugeWidth * _self.pixelRatio, //仪表盘背景的宽度
- startAngle: 0.75,
- endAngle: 0.25,
- startNumber: 0,
- endNumber: 100,
- splitLine: {
- fixRadius: 0,
- splitNumber: 10,
- width: _self.gaugeWidth * _self.pixelRatio, //仪表盘背景的宽度
- color: '#FFFFFF',
- childNumber: 5,
- childWidth: _self.gaugeWidth * 0.4 * _self.pixelRatio, //仪表盘背景的宽度
- },
- pointer: {
- width: _self.gaugeWidth * 0.8 * _self.pixelRatio, //指针宽度
- color: 'auto'
- }
- }
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- categories: chartData.categories,
- series: chartData.series,
- animation: true,
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- dataLabel: true,
- });
- },
- changeGaugeData() {
- let series = [{
- name: "完成率",
- data: Math.random()
- }]; //这里是随机数据,生产环境请从服务器获取,注意series数据类型为数组
- //这里我借用之前的categories数据,判断一下新数据的title.color,没有写死在程序里,以便于自定义
- let newTitleColor;
- for (let i = 0; i < _self.serverData.Gauge.categories.length; i++) {
- if (series[0].data <= _self.serverData.Gauge.categories[i].value) {
- newTitleColor = _self.serverData.Gauge.categories[i].color;
- break;
- }
- }
- canvasObj['canvasGauge'].updateData({
- series: series, //这里给了新数值
- categories: _self.serverData.Gauge.categories,
- title: {
- name: Math.round(series[0].data * 100) + '%',
- color: newTitleColor,
- fontSize: 25 * _self.pixelRatio,
- offsetY: 50 * _self.pixelRatio, //新增参数,自定义调整Y轴文案距离
- },
- subtitle: {
- name: '更新数据',
- color: '#666666',
- fontSize: 15 * _self.pixelRatio,
- offsetY: -50 * _self.pixelRatio, //新增参数,自定义调整Y轴文案距离
- }
- });
- },
- showCandle(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'candle',
- fontSize: 11,
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 8,
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- enableMarkLine: true,
- /***需要开启标记线***/
- categories: chartData.categories,
- series: chartData.series,
- animation: true,
- enableScroll: true, //开启图表拖拽功能
- xAxis: {
- disableGrid: true, //不绘制X轴网格线
- labelCount: 4, //X轴文案数量
- //type:'grid',
- //gridType:'dash',
- itemCount: _self.itemCount, //可不填写,配合enableScroll图表拖拽功能使用,x轴单屏显示数据的数量,默认为5个
- scrollShow: true, //新增是否显示滚动条,默认false
- scrollAlign: 'right',
- //scrollBackgroundColor:'#F7F7FF',//可不填写,配合enableScroll图表拖拽功能使用,X轴滚动条背景颜色,默认为 #EFEBEF
- //scrollColor:'#DEE7F7',//可不填写,配合enableScroll图表拖拽功能使用,X轴滚动条颜色,默认为 #A6A6A6
- },
- yAxis: {
- //disabled:true
- gridType: 'dash',
- splitNumber: 5,
- format: (val) => {
- return val.toFixed(0)
- }
- },
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- dataLabel: false,
- dataPointShape: true,
- 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']
- }
- },
- tooltip: {
- bgColor: '#000000',
- bgOpacity: 0.7,
- gridType: 'dash',
- dashLength: 5,
- gridColor: '#1890ff',
- fontColor: '#FFFFFF',
- horizentalLine: true,
- xAxisLabel: true,
- yAxisLabel: true,
- labelBgColor: '#DFE8FF',
- labelBgOpacity: 0.95,
- labelAlign: 'left',
- labelFontColor: '#666666'
- },
- markLine: {
- type: 'dash',
- dashLength: 5,
- data: [{
- value: 2150,
- lineColor: '#f04864',
- showLabel: true
- }, {
- value: 2350,
- lineColor: '#f04864',
- showLabel: true
- }]
- }
- }
- });
- },
- touchCandle(e) {
- canvasObj['canvasCandle'].scrollStart(e);
- },
- moveCandle(e) {
- canvasObj['canvasCandle'].scroll(e);
- },
- touchEndCandle(e) {
- canvasObj['canvasCandle'].scrollEnd(e);
- //下面是toolTip事件,如果滚动后不需要显示,可不填写
- canvasObj['canvasCandle'].showToolTip(e, {
- format: function(item, category) {
- return category + ' ' + item.name + ':' + item.data
- }
- });
- },
- changeData() {
- canvasObj['canvasColumn'].updateData({
- series: _self.serverData.ColumnB.series,
- categories: _self.serverData.ColumnB.categories
- });
- },
- touchLineA(e) {
- canvasObj['canvasLineA'].scrollStart(e);
- },
- moveLineA(e) {
- canvasObj['canvasLineA'].scroll(e);
- },
- touchEndLineA(e) {
- canvasObj['canvasLineA'].scrollEnd(e);
- //下面是toolTip事件,如果滚动后不需要显示,可不填写
- canvasObj['canvasLineA'].showToolTip(e, {
- format: function(item, category) {
- return category + ' ' + item.name + ':' + item.data
- }
- });
- },
- showMix(canvasId, chartData) {
- canvasObj[canvasId] = new uCharts({
- $this: _self,
- canvasId: canvasId,
- type: 'mix',
- fontSize: 11,
- padding: [15, 15, 0, 15],
- legend: {
- show: true,
- padding: 5,
- lineHeight: 11,
- margin: 6,
- },
- background: '#FFFFFF',
- pixelRatio: _self.pixelRatio,
- categories: chartData.categories,
- series: chartData.series,
- animation: false,
- enableScroll: true, //开启图表拖拽功能
- xAxis: {
- disableGrid: false,
- type: 'grid',
- gridType: 'dash',
- itemCount: 4,
- scrollShow: true,
- scrollAlign: 'left',
- },
- yAxis: {
- gridType: 'dash',
- dashLength: 4,
- splitNumber: 5,
- min: 10,
- max: 180,
- format: (val) => {
- return val.toFixed(0)
- }
- },
- width: _self.cWidth * _self.pixelRatio,
- height: _self.cHeight * _self.pixelRatio,
- dataLabel: true,
- dataPointShape: true,
- extra: {
- column: {
- width: 20 * _self.pixelRatio
- },
- tooltip: {
- bgColor: '#000000',
- bgOpacity: 0.7,
- gridType: 'dash',
- dashLength: 8,
- gridColor: '#1890ff',
- fontColor: '#FFFFFF',
- horizentalLine: true,
- xAxisLabel: true,
- yAxisLabel: true,
- labelBgColor: '#DFE8FF',
- labelBgOpacity: 0.95,
- labelAlign: 'left',
- labelFontColor: '#666666'
- }
- },
- });
- },
- touchMix(e) {
- canvasObj['canvasMix'].scrollStart(e);
- },
- moveMix(e) {
- canvasObj['canvasMix'].scroll(e);
- },
- touchEndMix(e) {
- canvasObj['canvasMix'].scrollEnd(e);
- canvasObj['canvasMix'].touchLegend(e);
- //下面是toolTip事件,如果滚动后不需要显示,可不填写
- canvasObj['canvasMix'].showToolTip(e, {
- format: function(item, category) {
- return category + ' ' + item.name + ':' + item.data
- }
- });
- },
- touchIt(e, id) {
- canvasObj[id].touchLegend(e, {
- animation: false
- });
- canvasObj[id].showToolTip(e, {
- format: function(item, category) {
- if (typeof item.data === 'object') {
- return category + ' ' + item.name + ':' + item.data.value
- } else {
- return category + ' ' + item.name + ':' + item.data
- }
- }
- });
- },
- touchPie(e, id) {
- canvasObj[id].showToolTip(e, {
- format: function(item) {
- return item.name + ':' + item.data
- }
- });
- },
- /* 图表end */
-
- }
- }
- </script>
- <style scoped>
- uni-view {
- font-size: 15px;
- }
- .uni-row {
- height: 40px;
- }
- .uni-row-column {
- float: left;
- width: 150rpx;
- height: 40px;
- }
- .grid-item-box {
- flex: 1;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 15px 0;
- }
- .qiun-padding {
- padding: 2%;
- width: 96%;
- }
- .qiun-wrap {
- display: flex;
- flex-wrap: wrap;
- }
- .qiun-rows {
- display: flex;
- flex-direction: row !important;
- }
- .qiun-columns {
- display: flex;
- flex-direction: column !important;
- }
- .qiun-common-mt {
- margin-top: 10rpx;
- }
- .qiun-bg-white {
- background: #FFFFFF;
- }
- .qiun-title-bar {
- width: 96%;
- padding: 10rpx 2%;
- flex-wrap: nowrap;
- }
- .qiun-title-dot-light {
- border-left: 10rpx solid #0ea391;
- padding-left: 10rpx;
- font-size: 32rpx;
- color: #000000
- }
- /* 通用样式 */
- .qiun-charts {
- width: 750rpx;
- height: 500rpx;
- background-color: #FFFFFF;
- }
- .qiun-charts1 {
- width: 750rpx;
- height: auto;
- padding: 5px 10px;
- background-color: #FFFFFF;
- }
- .charts {
- width: 750rpx;
- height: 500rpx;
- background-color: #FFFFFF;
- }
- /* 横屏样式 */
- .qiun-charts-rotate {
- width: 700rpx;
- height: 1100rpx;
- background-color: #FFFFFF;
- padding: 25rpx;
- }
- .charts-rotate {
- width: 700rpx;
- height: 1100rpx;
- background-color: #FFFFFF;
- }
- /* 圆弧进度样式 */
- .qiun-charts3 {
- width: 750rpx;
- height: 250rpx;
- background-color: #FFFFFF;
- position: relative;
- }
- .charts3 {
- position: absolute;
- width: 250rpx;
- height: 250rpx;
- background-color: #FFFFFF;
- }
- .qiun-tip {
- display: block;
- width: auto;
- overflow: hidden;
- padding: 15rpx;
- height: 30rpx;
- line-height: 30rpx;
- margin: 10rpx;
- background: #ff9933;
- font-size: 30rpx;
- border-radius: 8rpx;
- justify-content: center;
- text-align: center;
- border: 1px solid #dc7004;
- color: #FFFFFF;
- }
- .gree {
- color: #09BB07;
- }
- .orange {
- color: orange;
- }
- .gray {
- color: #E0E0E0;
- }
- /* 进度图表css */
- .space{
- margin-left:20px;
-
- }
- .height30{
- display: block;
- padding-top:5px;
- padding-bottom: 5px;
- /* height: 30px; */
- height: auto;
- max-height: 45px;
- /* -webkit-line-clamp: 2; */
- }
- .line{
- border-bottom: 3px solid #F2F6FC;
- }
- .marginRight{
- margin-right:15px;
- cursor: pointer;
- }
- .marginLeft{
- margin-left: 15px;
- }
- .red{
- color:#FF3333;
- }
- .green{
- color:#1AAD19;
- }
- .blue{
- color:#0000ff;
- }
- .lef{
- float:left;
- }
- .right{
- float: right;
- padding-right: 15px;
- }
- .awesomeIcon{
- font-size:20px;
- padding:8px 5px;
- }
- .img{
- width: 40px;
- height:40px;
- }
- </style>
|