Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
dabedbd432
|
@ -501,7 +501,6 @@ export default {
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: "#ffffff",
|
color: "#ffffff",
|
||||||
},
|
},
|
||||||
|
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
|
|
|
@ -30,9 +30,10 @@
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-date-picker v-model="timeRange" type="datetimerange" range-separator="至"
|
<el-date-picker v-model="timeRange" type="datetimerange"
|
||||||
start-placeholder="开始时间" end-placeholder="结束时间" @change="handleQuery"
|
value-format="YYYY-MM-DD HH:mm:ss" range-separator="至"
|
||||||
style="width: 100%" />
|
start-placeholder="开始时间" end-placeholder="结束时间" @change="handleQuery"
|
||||||
|
style="width: 100%" />
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
|
@ -41,7 +42,8 @@
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-container>
|
||||||
|
<el-main class="nopadding">
|
||||||
<scTable
|
<scTable
|
||||||
ref="table"
|
ref="table"
|
||||||
:apiObj="apiObj"
|
:apiObj="apiObj"
|
||||||
|
@ -51,6 +53,7 @@
|
||||||
:query="query"
|
:query="query"
|
||||||
highlightCurrentRow
|
highlightCurrentRow
|
||||||
@row-click="rowClick"
|
@row-click="rowClick"
|
||||||
|
@dataChange="dataChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="测点" prop="mpoint_name">
|
<el-table-column label="测点" prop="mpoint_name">
|
||||||
|
@ -93,6 +96,12 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
|
<el-aside style="width: 50%; float: right;">
|
||||||
|
<!-- 折线图组件 -->
|
||||||
|
<scEcharts :option="chartOption" height="400px" />
|
||||||
|
</el-aside>
|
||||||
|
</el-container>
|
||||||
|
</el-container>
|
||||||
<el-dialog title="校正" v-model="visible">
|
<el-dialog title="校正" v-model="visible">
|
||||||
<el-main style="padding: 0 20px 20px 20px">
|
<el-main style="padding: 0 20px 20px 20px">
|
||||||
<el-form
|
<el-form
|
||||||
|
@ -142,9 +151,9 @@
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-container>
|
</template>
|
||||||
</template>
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "sflog",
|
name: "sflog",
|
||||||
data() {
|
data() {
|
||||||
|
@ -157,6 +166,42 @@ export default {
|
||||||
start_time: null,
|
start_time: null,
|
||||||
end_time: null
|
end_time: null
|
||||||
},
|
},
|
||||||
|
chartOption: {
|
||||||
|
color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
label: {
|
||||||
|
backgroundColor: "#6a7985",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
top: 5,
|
||||||
|
right: 5,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "2%",
|
||||||
|
right: "4%",
|
||||||
|
bottom: "5%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
name: "",
|
||||||
|
type: "category",
|
||||||
|
data: [],
|
||||||
|
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: "当前值",
|
||||||
|
type: "value",
|
||||||
|
|
||||||
|
},
|
||||||
|
series: [],
|
||||||
|
},
|
||||||
options: [
|
options: [
|
||||||
{ label: "小时", value: "hour"},
|
{ label: "小时", value: "hour"},
|
||||||
{ label: "天", value: "day" },
|
{ label: "天", value: "day" },
|
||||||
|
@ -177,6 +222,28 @@ export default {
|
||||||
this.getMpoints();
|
this.getMpoints();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
dataChange(req, tableData) {
|
||||||
|
let that = this;
|
||||||
|
let option = { ...that.chartOption };
|
||||||
|
// 获取 x 轴的数据
|
||||||
|
option.xAxis.data = tableData.map((item, index) => (index+1).toString());
|
||||||
|
|
||||||
|
// 获取 y 轴的数据
|
||||||
|
|
||||||
|
option.series = [
|
||||||
|
{
|
||||||
|
name: '总生产',
|
||||||
|
type: 'line', // 折线图类型
|
||||||
|
data: tableData.map((item) => parseFloat(item.val)), // 将字符串转为数字
|
||||||
|
smooth: true, // 平滑曲线
|
||||||
|
}
|
||||||
|
];
|
||||||
|
option.legend.data = ['总生产'];
|
||||||
|
|
||||||
|
// 更新图表选项
|
||||||
|
that.chartOption = option;
|
||||||
|
},
|
||||||
|
|
||||||
getMpoints() {
|
getMpoints() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$API.enm.mpoint.list
|
this.$API.enm.mpoint.list
|
||||||
|
|
Loading…
Reference in New Issue