forked from dyf/dyf-vue-ui
联调中心,根据类型,上传logo调取不同接口,优化了其他代码
This commit is contained in:
@ -222,7 +222,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.amap-container {
|
||||
height: 640px;
|
||||
height: calc(100vh - 22vh);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
@ -234,11 +234,12 @@ onUnmounted(() => {
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 0px 6px 0px rgba(0, 34, 96, 0.1);
|
||||
background: rgba(255, 255, 255, 1);
|
||||
height: 620px;
|
||||
height: calc(100vh - 25vh);
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 10px;
|
||||
left: 10px
|
||||
left: 10px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* 其他样式保持不变... */
|
||||
|
||||
@ -455,7 +455,7 @@ const forceAlarm = async () => {
|
||||
const typeName = firstDevice.typeName; // 取第一个设备的typeName,为空时给默认值
|
||||
let data = {
|
||||
deviceIds: deviceIds,
|
||||
typeName: typeName,
|
||||
typeName: typeName,
|
||||
batchId: batchId,
|
||||
deviceImeiList: deviceImeiList,
|
||||
instructValue: '1' //强制报警1,解除报警0
|
||||
@ -563,7 +563,7 @@ const forceAlarm = async () => {
|
||||
}
|
||||
|
||||
.Maplist {
|
||||
height: 680px;
|
||||
height: calc(100vh - 24vh);
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -251,7 +251,7 @@ const handleExport = () => {
|
||||
<style lang="scss" scoped>
|
||||
.p-2{
|
||||
background: rgba(247, 248, 252, 1);
|
||||
min-height: 100vh;
|
||||
height: calc(100vh - 8vh);
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
}
|
||||
@ -299,7 +299,7 @@ const handleExport = () => {
|
||||
}
|
||||
|
||||
.Maplist {
|
||||
height: 680px;
|
||||
height: calc(100vh - 24vh);
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -259,7 +259,7 @@ const historyjectory = (row: any) => {
|
||||
<style lang="scss" scoped>
|
||||
.p-2{
|
||||
background: rgba(247, 248, 252, 1);
|
||||
min-height: 100vh;
|
||||
height: calc(100vh - 8vh);
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
}
|
||||
@ -307,7 +307,7 @@ const historyjectory = (row: any) => {
|
||||
}
|
||||
|
||||
.Maplist {
|
||||
height: 680px;
|
||||
height: calc(100vh - 24vh);
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -248,6 +248,7 @@
|
||||
import api from '@/api/debugCenter/debugCenter';
|
||||
import common from '@/utils/common';
|
||||
import apiTypeAll from '@/api/equipmentManagement/device/index';
|
||||
import uploadHelper from '@/api/debugCenter/deviceApi';
|
||||
|
||||
var fileInput = document.getElementById('fileInput');
|
||||
var fileInputs = {
|
||||
@ -540,22 +541,39 @@ function SaveMultiData() {
|
||||
}, 0);
|
||||
}
|
||||
//上传开机画面
|
||||
function updaeLogo(ids, file) {
|
||||
|
||||
if (!file || !ids) {
|
||||
// function updaeLogo(ids, file) {
|
||||
// if (!file || !ids) {
|
||||
// return Promise.resolve({ code: 200, msg: '成功' });
|
||||
// }
|
||||
// if (!Array.isArray(ids)) {
|
||||
// ids = [ids];
|
||||
// }
|
||||
// var formData = new FormData();
|
||||
// ids.forEach((element) => {
|
||||
// formData.append('deviceIds', element);
|
||||
// });
|
||||
// formData.append('file', file);
|
||||
// return api.uploadBoot(formData);
|
||||
// }
|
||||
// 上传开机画面根据类型适配不同的上传接口,其他类型暂且默认670
|
||||
function updaeLogo(ids, file, deviceType?: number,) {
|
||||
const selectedRows = getSelectionRows(grid);
|
||||
let realDeviceType = 670; // 默认670
|
||||
if (selectedRows.length > 0) {
|
||||
const deviceTypeName = selectedRows[0].typeName || '';
|
||||
if (deviceTypeName.includes('670')) {
|
||||
realDeviceType = 670;
|
||||
} else if (deviceTypeName.includes('6170')) {
|
||||
realDeviceType = 6170;
|
||||
}
|
||||
}
|
||||
const finalDeviceType = deviceType || realDeviceType;
|
||||
const finalIds = Array.isArray(ids) ? ids : [ids];
|
||||
const finalFile = file || checkFile.file || cEdit.fileBoot.file;
|
||||
if (!finalFile || finalIds.length === 0) {
|
||||
return Promise.resolve({ code: 200, msg: '成功' });
|
||||
}
|
||||
if (!Array.isArray(ids)) {
|
||||
ids = [ids];
|
||||
}
|
||||
var formData = new FormData();
|
||||
ids.forEach((element) => {
|
||||
formData.append('deviceIds', element);
|
||||
});
|
||||
|
||||
formData.append('file', file);
|
||||
|
||||
return api.uploadBoot(formData);
|
||||
return uploadHelper.uploadLogo(finalDeviceType, finalIds, finalFile);
|
||||
}
|
||||
//保存单个设备的数据
|
||||
function SaveItemData() {
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
<template>
|
||||
|
||||
<!-- 图表容器,设置宽高 -->
|
||||
<div class="vchartPage">
|
||||
<div ref="chartRef" class="chartRef"></div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -118,7 +116,7 @@ onMounted(() => {
|
||||
myChart.setOption(option);
|
||||
window.addEventListener('resize', handleResize);
|
||||
}
|
||||
}, 200)
|
||||
},500)
|
||||
|
||||
|
||||
});
|
||||
|
||||
@ -22,7 +22,7 @@ let dataTimer: NodeJS.Timeout | null = null; // 数据更新定时器
|
||||
const fetchDataAndUpdate = (days: number) => {
|
||||
getDeviceUsageFrequency({ days }).then((res) => {
|
||||
if (res.code === 200 && res.data && myChart) {
|
||||
// 处理接口返回的真实数据(转换为图表所需格式)
|
||||
//(转换为图表所需格式)
|
||||
const chartData = res.data.map(item => ({
|
||||
name: item.deviceName,
|
||||
value: item.frequency
|
||||
@ -78,8 +78,6 @@ const initChart = () => {
|
||||
if (!chartRef.value) return;
|
||||
|
||||
myChart = echarts.init(chartRef.value);
|
||||
|
||||
// 初始图表配置(空数据占位)
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@ -115,7 +113,7 @@ const initChart = () => {
|
||||
name: '使用频次',
|
||||
type: 'bar',
|
||||
data: [], // 初始空数据
|
||||
barWidth: '14px',
|
||||
barWidth: '10px',
|
||||
stack: 'total',
|
||||
label: {
|
||||
show: true,
|
||||
@ -171,7 +169,7 @@ onUnmounted(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.vchartPage {
|
||||
margin-top: 4.8vh;
|
||||
margin-top: 4.9vh;
|
||||
position: relative; // 确保按钮定位正确
|
||||
}
|
||||
|
||||
@ -203,6 +201,6 @@ onUnmounted(() => {
|
||||
|
||||
.chartRef {
|
||||
width: 100%;
|
||||
height: 25vh;
|
||||
height: 24vh;
|
||||
}
|
||||
</style>
|
||||
@ -9,7 +9,6 @@
|
||||
</div>
|
||||
<div class="alarm-table-body">
|
||||
<div ref="tableBody" class="alarm-table-body-inner">
|
||||
<!-- 第一份数据 -->
|
||||
<div v-for="(item, index) in displayData" :key="`first-${getKey(item, index)}`" class="alarm-item">
|
||||
<div class="item-cell">{{ item.startTime }}</div>
|
||||
<div class="item-cell">{{ item.deviceTypeName }}</div>
|
||||
@ -19,7 +18,6 @@
|
||||
</div>
|
||||
<div class="item-cell loaction">{{ item.location }}</div>
|
||||
</div>
|
||||
<!-- 第二份数据(用于无缝滚动) -->
|
||||
<div v-for="(item, index) in displayData" :key="`second-${getKey(item, index)}`" class="alarm-item">
|
||||
<div class="item-cell">{{ item.startTime }}</div>
|
||||
<div class="item-cell">{{ item.deviceTypeName }}</div>
|
||||
|
||||
Reference in New Issue
Block a user