|
@@ -69,49 +69,19 @@
|
|
|
designScope="modelsensor-history"
|
|
|
:scroll="{ y: chartsColumns.length > 0 ? 300 : 600 }"
|
|
|
/>
|
|
|
-
|
|
|
- <div style="margin-top: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px">
|
|
|
- <Select
|
|
|
- @change="handleSensorChange1"
|
|
|
- :options="FxData"
|
|
|
- :fieldNames="{ label: 'strinstallpos', value: 'deviceID' }"
|
|
|
- v-model:value="strinstallpos"
|
|
|
- style="width: 200px; color: black"
|
|
|
- placeholder="请选择查询设备"
|
|
|
- :allowClear="true"
|
|
|
- />
|
|
|
- <Select
|
|
|
- :options="historyFxData"
|
|
|
- :fieldNames="{ label: 'valuename', value: 'valuecode' }"
|
|
|
- v-model:value="valuename"
|
|
|
- style="width: 200px; color: black"
|
|
|
- placeholder="分析点位"
|
|
|
- :allowClear="true"
|
|
|
- />
|
|
|
- <div style="display: inline-flex; gap: 10px">
|
|
|
- <div>
|
|
|
- <a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" placeholder="开始时间" v-model:value="startTime" style="width: 220px" />
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" v-model:value="endTime" style="width: 220px" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <a-button type="primary" preIcon="ant-design:export-outlined" @click="postFxHistory">查询</a-button>
|
|
|
- </div>
|
|
|
-
|
|
|
<div class="charts-box" v-if="chartsColumns.length > 0">
|
|
|
- <BarAndLine
|
|
|
+ <!-- <BarAndLine
|
|
|
:chartsColumnsType="selectData.deviceType"
|
|
|
xAxisPropType="ttime"
|
|
|
- :dataSource="historyDataSource2"
|
|
|
+ :dataSource="historyDataSource"
|
|
|
height="300px"
|
|
|
:chartsColumns="chartsColumns"
|
|
|
chartsType="history"
|
|
|
- :option="echartsOption"
|
|
|
+ :option="echartsOption1"
|
|
|
@refresh="refreshEchatrs"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
<!-- 设备历史数据组件测试代码 -->
|
|
|
- <!-- <DeviceHistoryChart
|
|
|
+ <DeviceHistoryChart
|
|
|
:chartsColumnsType="selectData.deviceType"
|
|
|
xAxisPropType="ttime"
|
|
|
:dataSource="historyDataSource"
|
|
@@ -120,7 +90,7 @@
|
|
|
chartsType="history"
|
|
|
:option="echartsOption1"
|
|
|
@refresh="refreshEchatrs"
|
|
|
- /> -->
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-tab-pane>
|
|
@@ -205,7 +175,6 @@ import { getDictItemsByCode } from '/@/utils/dict';
|
|
|
import { device } from '../../gas/gasPipeNet/gasPipeNet.api';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
|
-import dayjs from 'dayjs';
|
|
|
|
|
|
const router = useRouter();
|
|
|
const { sysOrgCode } = useGlobSetting();
|
|
@@ -226,20 +195,14 @@ interface DeviceItem {
|
|
|
deviceID: string;
|
|
|
strinstallpos: string;
|
|
|
}
|
|
|
-const startTime = ref(dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'));
|
|
|
-const endTime = ref(dayjs().format('YYYY-MM-DD HH:mm:ss'));
|
|
|
const FxData = ref<any[]>([]);
|
|
|
-const historyFxData = ref<any[]>([]);
|
|
|
const detailDataSource = ref<any[]>([]);
|
|
|
const historyDataSource = ref<any[]>([]);
|
|
|
const historyDataSource1 = ref<any[]>([]);
|
|
|
-const historyDataSource2 = ref<any[]>([]);
|
|
|
const chartsColumns = ref<any[]>([]);
|
|
|
-const chartsColumns1 = ref<any[]>([]);
|
|
|
const chartsColumnsFx = ref<any[]>([]);
|
|
|
const loading = ref(true);
|
|
|
-const strinstallpos = ref('');
|
|
|
-const valuename = ref('');
|
|
|
+
|
|
|
const echartsOption = {
|
|
|
grid: {
|
|
|
top: '20%',
|
|
@@ -387,7 +350,6 @@ function handleSensorChange(type) {
|
|
|
timer = null;
|
|
|
dataSource.value = [];
|
|
|
detailDataSource.value = [];
|
|
|
- handleSensorChange2();
|
|
|
}
|
|
|
async function handleSensorChange1(id) {
|
|
|
FxId.value = id;
|
|
@@ -402,28 +364,8 @@ async function handleSensorChange1(id) {
|
|
|
item.ttime = item.createTime;
|
|
|
});
|
|
|
historyDataSource1.value = result || [];
|
|
|
- handleSensorChange2();
|
|
|
-}
|
|
|
-//获取valueCode接口
|
|
|
-async function handleSensorChange2() {
|
|
|
- historyFxData.value = [];
|
|
|
- const result = await defHttp.get({
|
|
|
- url: '/safety/ventanalyMonitorParams/list',
|
|
|
- params: {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 1000,
|
|
|
- devicetype: deviceKind.value,
|
|
|
- },
|
|
|
- });
|
|
|
- result.records.forEach((item) => {
|
|
|
- item.ttime = item.createTime;
|
|
|
- historyFxData.value.push({
|
|
|
- valuecode: item.valuecode,
|
|
|
- valuename: item.valuename,
|
|
|
- });
|
|
|
- });
|
|
|
- // historyDataSource.value = result || [];
|
|
|
}
|
|
|
+
|
|
|
function refreshEchatrs() {
|
|
|
timer = null;
|
|
|
// getMonitor(true);
|
|
@@ -460,31 +402,7 @@ function onExportXlsFnFx() {
|
|
|
deviceId: FxId.value,
|
|
|
});
|
|
|
}
|
|
|
-//历史数据查询计算接口
|
|
|
-function postFxHistory() {
|
|
|
- if (!strinstallpos.value || !valuename.value || !startTime.value || !endTime.value) {
|
|
|
- return;
|
|
|
- }
|
|
|
- defHttp
|
|
|
- .post({
|
|
|
- url: '/safety/ventanalyMonitorData/getRealHistoryData',
|
|
|
- params: {
|
|
|
- deviceId: strinstallpos.value,
|
|
|
- valueCode: valuename.value,
|
|
|
- startTime: startTime.value,
|
|
|
- endTime: endTime.value,
|
|
|
- },
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- console.log(res, 'res');
|
|
|
- historyDataSource2.value =
|
|
|
- res.list?.map((item) => ({
|
|
|
- ...item,
|
|
|
- ttime: item.createtime,
|
|
|
- })) || [];
|
|
|
- handleChange(deviceKind.value);
|
|
|
- });
|
|
|
-}
|
|
|
+
|
|
|
onBeforeMount(() => {
|
|
|
getDeviceBaseList();
|
|
|
});
|
|
@@ -502,7 +420,6 @@ onMounted(async () => {
|
|
|
deviceTypeOption.value = res;
|
|
|
deviceKind.value = deviceTypeOption.value[0]['value'];
|
|
|
handleChange(deviceKind.value);
|
|
|
- handleSensorChange2();
|
|
|
await getMonitor(true);
|
|
|
});
|
|
|
onUnmounted(() => {
|