|
@@ -3,7 +3,7 @@
|
|
<el-tabs v-model="activeTab" type="border-card" tab-position="left" v-loading="loading" style="height: 84vh">
|
|
<el-tabs v-model="activeTab" type="border-card" tab-position="left" v-loading="loading" style="height: 84vh">
|
|
<el-tab-pane
|
|
<el-tab-pane
|
|
style="height: 100%"
|
|
style="height: 100%"
|
|
- v-for="(item,index) in arry1"
|
|
|
|
|
|
+ v-for="(item,index) in list"
|
|
:key="index"
|
|
:key="index"
|
|
>
|
|
>
|
|
<template #label>
|
|
<template #label>
|
|
@@ -30,11 +30,12 @@
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<div v-for="(item,index) in attrList" :key="index">
|
|
<div v-for="(item,index) in attrList" :key="index">
|
|
- <el-form-item :label='item.name' prop="deviceId" v-if="item.name==='累计运行时间'" >
|
|
|
|
|
|
+ <el-form-item :label='item.name' prop="deviceId" v-if="item.name==='当日运转时间'" >
|
|
<el-input
|
|
<el-input
|
|
v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
clearable
|
|
clearable
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
|
+ disabled
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item :label='item.name' prop="deviceId" v-else>
|
|
<el-form-item :label='item.name' prop="deviceId" v-else>
|
|
@@ -67,6 +68,8 @@ import { IotOpeationFillApi, IotOpeationFillVO } from '@/api/pms/iotopeationfill
|
|
import IotOpeationFillForm from './IotOpeationFillForm.vue'
|
|
import IotOpeationFillForm from './IotOpeationFillForm.vue'
|
|
import Vue from "@vitejs/plugin-vue";
|
|
import Vue from "@vitejs/plugin-vue";
|
|
import {useUserStore} from "@/store/modules/user";
|
|
import {useUserStore} from "@/store/modules/user";
|
|
|
|
+
|
|
|
|
+
|
|
/** 运行记录填报 列表 */
|
|
/** 运行记录填报 列表 */
|
|
defineOptions({ name: 'IotOpeationFill' })
|
|
defineOptions({ name: 'IotOpeationFill' })
|
|
|
|
|
|
@@ -116,6 +119,7 @@ const getList = async () => {
|
|
try {
|
|
try {
|
|
queryParams.deptId = deptId.split(",")[0];
|
|
queryParams.deptId = deptId.split(",")[0];
|
|
queryParams.userId = deptId.split(",")[1];
|
|
queryParams.userId = deptId.split(",")[1];
|
|
|
|
+ queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2]));
|
|
const data = await IotOpeationFillApi.getIotOpeationFillPage(queryParams)
|
|
const data = await IotOpeationFillApi.getIotOpeationFillPage(queryParams)
|
|
list.value = data;
|
|
list.value = data;
|
|
list.value.forEach(function (item, index) {
|
|
list.value.forEach(function (item, index) {
|
|
@@ -131,8 +135,13 @@ const getList = async () => {
|
|
loading.value = false
|
|
loading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+function formatTimestamp(timestamp) {
|
|
|
|
+ const date = new Date(timestamp);
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的
|
|
|
|
+ const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
|
+}
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
@@ -168,13 +177,14 @@ const openFill = (deviceCategoryId?:number,deviceId?:number,deptId?:number,devic
|
|
const getAttrList = async () => {
|
|
const getAttrList = async () => {
|
|
loading.value = true
|
|
loading.value = true
|
|
try {
|
|
try {
|
|
|
|
+ totalRunTime1 = 0;
|
|
const data = await IotOpeationFillApi.getAttrs(queryParams)
|
|
const data = await IotOpeationFillApi.getAttrs(queryParams)
|
|
attrList.value = data;
|
|
attrList.value = data;
|
|
-
|
|
|
|
- totalRunTime1 = Number(attrList.value[0].totalRunTime).toFixed(2)
|
|
|
|
|
|
+ //totalRunTime1 = Number(attrList.value[0].totalRunTime).toFixed(2)
|
|
attrList.value.forEach(function (item,index){
|
|
attrList.value.forEach(function (item,index){
|
|
- if(item.name=='累计运行时间'){
|
|
|
|
- totalRunTime1 = Number(item.fillContent).toFixed(2)
|
|
|
|
|
|
+ if(item.name==='累计运行时间'){
|
|
|
|
+ item.name = '当日运转时间'
|
|
|
|
+ totalRunTime1 = Number(item.totalRunTime).toFixed(2)
|
|
}
|
|
}
|
|
item.fillContent = Number(item.fillContent).toFixed(2)
|
|
item.fillContent = Number(item.fillContent).toFixed(2)
|
|
item.deviceCode = queryParams.deviceCode;
|
|
item.deviceCode = queryParams.deviceCode;
|
|
@@ -192,6 +202,8 @@ const getFillInfo = async () => {
|
|
try {
|
|
try {
|
|
attrList.value.forEach(function (item,index){
|
|
attrList.value.forEach(function (item,index){
|
|
item.pointName = item.name;
|
|
item.pointName = item.name;
|
|
|
|
+ item.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2]));
|
|
|
|
+ item.userId = deptId.split(",")[1];
|
|
})
|
|
})
|
|
const data = attrList.value as unknown as IotOpeationFillVO
|
|
const data = attrList.value as unknown as IotOpeationFillVO
|
|
|
|
|