阅片图表修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ca99572f19
commit
f79084b599
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getReportsChartData } from "@/api/reading"
|
import { getReportsChartData } from "@/api/reading"
|
||||||
|
import moment from "moment"
|
||||||
let echarts = require('echarts/lib/echarts');
|
let echarts = require('echarts/lib/echarts');
|
||||||
|
|
||||||
// 按需引入图表
|
// 按需引入图表
|
||||||
|
|
@ -78,7 +79,9 @@ export default {
|
||||||
xAxisData: LatestScanDateList || [],
|
xAxisData: LatestScanDateList || [],
|
||||||
series: [],
|
series: [],
|
||||||
unit: this.$fd("ValueUnit", res.Result.Unit),
|
unit: this.$fd("ValueUnit", res.Result.Unit),
|
||||||
visitName: res.Result.VisitTaskNameList
|
visitName: res.Result.VisitTaskNameList,
|
||||||
|
min: null,
|
||||||
|
max: null
|
||||||
}
|
}
|
||||||
res.Result.ChartDataList.forEach((item) => {
|
res.Result.ChartDataList.forEach((item) => {
|
||||||
let arr = []
|
let arr = []
|
||||||
|
|
@ -91,6 +94,43 @@ export default {
|
||||||
type: 'line'
|
type: 'line'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
if (Array.isArray(res.Result.LatestScanDateList) && res.Result.LatestScanDateList.length >= 2) {
|
||||||
|
let hours = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).diff(moment(res.Result.LatestScanDateList[0]), 'hours');
|
||||||
|
let days = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).diff(moment(res.Result.LatestScanDateList[0]), 'days');
|
||||||
|
let months = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).diff(moment(res.Result.LatestScanDateList[0]), 'months');
|
||||||
|
console.log(hours, 'hours')
|
||||||
|
console.log(days, 'days')
|
||||||
|
console.log(months, 'months')
|
||||||
|
if (hours < 24) {
|
||||||
|
obj.min = moment(res.Result.LatestScanDateList[0]).format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
obj.max = moment(res.Result.LatestScanDateList[0]).format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
}
|
||||||
|
if (days >= 1 && days <= 7) {
|
||||||
|
obj.min = moment(res.Result.LatestScanDateList[0]).format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
obj.max = moment(res.Result.LatestScanDateList[0]).add(7, 'days').format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
}
|
||||||
|
if (days > 7 && days < 30) {
|
||||||
|
obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
obj.max = moment(res.Result.LatestScanDateList[0]).endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
}
|
||||||
|
if (months >= 1 && months <= 3) {
|
||||||
|
obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
obj.max = moment(res.Result.LatestScanDateList[0]).add(4, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
}
|
||||||
|
if (months > 3 && months <= 6) {
|
||||||
|
obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
obj.max = moment(res.Result.LatestScanDateList[0]).add(7, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
}
|
||||||
|
if (months > 6 && months <= 12) {
|
||||||
|
obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
obj.max = moment(res.Result.LatestScanDateList[0]).add(13, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
}
|
||||||
|
if (months > 12) {
|
||||||
|
obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||||
|
obj.max = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).add(1, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(obj)
|
||||||
this.initChart(obj)
|
this.initChart(obj)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -140,6 +180,8 @@ export default {
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false // 隐藏网格线
|
show: false // 隐藏网格线
|
||||||
},
|
},
|
||||||
|
min: obj.min,
|
||||||
|
max: obj.max
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: obj.unit,
|
name: obj.unit,
|
||||||
|
|
|
||||||
|
|
@ -148,8 +148,8 @@
|
||||||
@change="(val) => { formItemNumberChange(val, question) }" />
|
@change="(val) => { formItemNumberChange(val, question) }" />
|
||||||
<!-- 自动计算 -->
|
<!-- 自动计算 -->
|
||||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;" v-if="question.Type === 'calculation'">
|
||||||
<el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]"
|
<el-input v-model="questionForm[question.Id]"
|
||||||
@input="value = value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')" disabled />
|
@input="value = value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')" disabled />
|
||||||
<svg-icon v-if="question.ShowChartTypeEnum > 0 && taskInfo.IsReadingTaskViewInOrder === 1"
|
<svg-icon v-if="question.ShowChartTypeEnum > 0 && taskInfo.IsReadingTaskViewInOrder === 1"
|
||||||
icon-class="readingChart" class="svg-icon svg-readingChart" @click.stop="(e) => handleReadingChart({
|
icon-class="readingChart" class="svg-icon svg-readingChart" @click.stop="(e) => handleReadingChart({
|
||||||
|
|
@ -176,8 +176,8 @@
|
||||||
{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}
|
{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<svg-icon v-if="question.ShowChartTypeEnum > 0 && taskInfo.IsReadingTaskViewInOrder === 1" icon-class="readingChart" class="svg-icon svg-readingChart"
|
<svg-icon v-if="question.ShowChartTypeEnum > 0 && taskInfo.IsReadingTaskViewInOrder === 1"
|
||||||
@click.stop="(e) => handleReadingChart({
|
icon-class="readingChart" class="svg-icon svg-readingChart" @click.stop="(e) => handleReadingChart({
|
||||||
e,
|
e,
|
||||||
data: {
|
data: {
|
||||||
QuestionId: question.Id,
|
QuestionId: question.Id,
|
||||||
|
|
@ -259,8 +259,8 @@
|
||||||
question.CustomUnit }}</template>
|
question.CustomUnit }}</template>
|
||||||
<template slot="append" v-else-if="question.ValueType === 2">%</template>
|
<template slot="append" v-else-if="question.ValueType === 2">%</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<svg-icon v-if="question.ShowChartTypeEnum > 0 && taskInfo.IsReadingTaskViewInOrder === 1" icon-class="readingChart" class="svg-icon svg-readingChart"
|
<svg-icon v-if="question.ShowChartTypeEnum > 0 && taskInfo.IsReadingTaskViewInOrder === 1"
|
||||||
@click.stop="(e) => handleReadingChart({
|
icon-class="readingChart" class="svg-icon svg-readingChart" @click.stop="(e) => handleReadingChart({
|
||||||
e,
|
e,
|
||||||
data: {
|
data: {
|
||||||
QuestionId: question.Id,
|
QuestionId: question.Id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue