|
|
@@ -13,12 +13,12 @@
|
|
|
<a-col :span="6">
|
|
|
<a-form-item
|
|
|
field="address"
|
|
|
- :label="t('dashboard.form.address')"
|
|
|
+ :label="t('device.form.address')"
|
|
|
label-col-flex="50px"
|
|
|
>
|
|
|
<a-input
|
|
|
v-model="formModel.address"
|
|
|
- :placeholder="t('dashboard.form.address')"
|
|
|
+ :placeholder="t('device.form.address')"
|
|
|
allow-clear
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
@@ -26,12 +26,12 @@
|
|
|
<a-col :span="6">
|
|
|
<a-form-item
|
|
|
field="name"
|
|
|
- :label="t('dashboard.form.name')"
|
|
|
+ :label="t('device.form.name')"
|
|
|
label-col-flex="50px"
|
|
|
>
|
|
|
<a-input
|
|
|
v-model="formModel.name"
|
|
|
- :placeholder="t('dashboard.form.name')"
|
|
|
+ :placeholder="t('device.form.name')"
|
|
|
allow-clear
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
@@ -39,12 +39,12 @@
|
|
|
<a-col :span="6">
|
|
|
<a-form-item
|
|
|
field="entityType"
|
|
|
- :label="t('dashboard.form.entityType')"
|
|
|
+ :label="t('device.form.entityType')"
|
|
|
label-col-flex="60px"
|
|
|
>
|
|
|
<a-select
|
|
|
v-model="formModel.entityType"
|
|
|
- :placeholder="t('dashboard.form.entityType')"
|
|
|
+ :placeholder="t('device.form.entityType')"
|
|
|
allow-clear
|
|
|
@clear="formModel.entityType = null"
|
|
|
>
|
|
|
@@ -59,12 +59,12 @@
|
|
|
<a-col :span="6">
|
|
|
<a-form-item
|
|
|
field="status"
|
|
|
- :label="t('dashboard.form.status')"
|
|
|
+ :label="t('device.form.status')"
|
|
|
label-col-flex="60px"
|
|
|
>
|
|
|
<a-select
|
|
|
v-model="formModel.status"
|
|
|
- :placeholder="t('dashboard.form.status')"
|
|
|
+ :placeholder="t('device.form.status')"
|
|
|
allow-clear
|
|
|
@clear="formModel.status = null"
|
|
|
>
|
|
|
@@ -78,7 +78,7 @@
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item
|
|
|
- :label="t('dashboard.form.timeRange')"
|
|
|
+ :label="t('device.form.timeRange')"
|
|
|
label-col-flex="60px"
|
|
|
>
|
|
|
<a-range-picker v-model="formModel.time" />
|
|
|
@@ -162,7 +162,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script lang="ts" setup name="Dashboard">
|
|
|
+<script lang="ts" setup name="DevicePage">
|
|
|
import {
|
|
|
ref,
|
|
|
reactive,
|
|
|
@@ -171,28 +171,21 @@ import {
|
|
|
getCurrentInstance,
|
|
|
computed,
|
|
|
} from 'vue';
|
|
|
-import { useRoute } from 'vue-router';
|
|
|
-import { queryDashboardList, exportDashboardList } from '@/api/dashboard';
|
|
|
-import type { DashboardParams, DataList } from '@/api/dashboard';
|
|
|
+import { queryDeviceList, exportDeviceList } from '@/api/device';
|
|
|
+import type { DeviceParams, DataList } from '@/api/device';
|
|
|
import { SizeProps, Pagination } from '@/types/global';
|
|
|
import BTag from '@/components/business/b-tag/index.vue';
|
|
|
import type { TableColumnData } from '@arco-design/web-vue';
|
|
|
import useLoading from '@/hooks/loading';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
-import { DeviceInfo } from '@/utils/const';
|
|
|
import type { AdditionalProp } from '@/api/dict';
|
|
|
import dayjs from 'dayjs';
|
|
|
-import { downLoadFun } from '@/utils/const';
|
|
|
import { useIntervalFn } from '@vueuse/core';
|
|
|
import DeviceInfoDialog from './device-info/index.vue';
|
|
|
import useDictList from '@/hooks/dict-list';
|
|
|
-import { useStorage } from '@vueuse/core';
|
|
|
-import { STATIONKEY, StationKey } from '@/utils/const';
|
|
|
+import { downLoadFun, DeviceInfo } from '@/utils/const';
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
-const {
|
|
|
- params: { station },
|
|
|
-} = useRoute();
|
|
|
const { loading, setLoading } = useLoading(true);
|
|
|
const cloneColumns = computed(() => [
|
|
|
{
|
|
|
@@ -204,30 +197,30 @@ const cloneColumns = computed(() => [
|
|
|
width: 70,
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.table.time'),
|
|
|
+ title: t('device.table.time'),
|
|
|
dataIndex: 'time',
|
|
|
slotName: 'time',
|
|
|
ellipsis: true,
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.form.status'),
|
|
|
+ title: t('device.form.status'),
|
|
|
dataIndex: 'status',
|
|
|
slotName: 'status',
|
|
|
width: 120,
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.form.name'),
|
|
|
+ title: t('device.form.name'),
|
|
|
dataIndex: 'name',
|
|
|
slotName: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.form.entityType'),
|
|
|
+ title: t('device.form.entityType'),
|
|
|
dataIndex: 'entityType',
|
|
|
slotName: 'entityType',
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- title: t('dashboard.form.address'),
|
|
|
+ title: t('device.form.address'),
|
|
|
dataIndex: 'address',
|
|
|
ellipsis: true,
|
|
|
tooltip: true,
|
|
|
@@ -251,12 +244,11 @@ const generateFormModel = () => {
|
|
|
endTime: null,
|
|
|
time: ['', ''],
|
|
|
entityType: null,
|
|
|
- station: null,
|
|
|
- } as DashboardParams;
|
|
|
+ } as DeviceParams;
|
|
|
};
|
|
|
const renderData = ref<DataList[]>([] as DataList[]);
|
|
|
const size = ref<SizeProps>('medium');
|
|
|
-const formModel = ref<DashboardParams>(generateFormModel());
|
|
|
+const formModel = ref<DeviceParams>(generateFormModel());
|
|
|
const showDeviceInfoDialog = shallowRef<boolean>(false);
|
|
|
const this_ = getCurrentInstance()?.appContext.config.globalProperties;
|
|
|
const deviceInfo = ref<DeviceInfo[]>([] as DeviceInfo[]);
|
|
|
@@ -264,10 +256,6 @@ const deviceTypeList = ref<AdditionalProp[]>([] as AdditionalProp[]);
|
|
|
const deviceStatusList = ref<AdditionalProp[]>([] as AdditionalProp[]);
|
|
|
const deviceId = shallowRef<number>(0);
|
|
|
const deviceType = shallowRef<number | null>(1);
|
|
|
-const obj = useStorage<StationKey>(STATIONKEY, {
|
|
|
- id: null,
|
|
|
- station: null,
|
|
|
-});
|
|
|
useDictList(['DeviceType', 'DeviceStatus']).then(res => {
|
|
|
deviceTypeList.value.push(...res['DeviceType']);
|
|
|
deviceStatusList.value.push(...res['DeviceStatus']);
|
|
|
@@ -279,9 +267,8 @@ function searchTable() {
|
|
|
: ['', ''];
|
|
|
formModel.value.startTime = startTime ? startTime : null;
|
|
|
formModel.value.endTime = endTime ? endTime : null;
|
|
|
- formModel.value.station = obj.value.station;
|
|
|
|
|
|
- queryDashboardList(formModel.value)
|
|
|
+ queryDeviceList(formModel.value)
|
|
|
.then(res => {
|
|
|
pagination.current = formModel.value.pageIndex;
|
|
|
pagination.pageSize = pagination.pageSize;
|
|
|
@@ -309,7 +296,7 @@ const downloadExcel = () => {
|
|
|
const [startTime, endTime] = formModel.value.time;
|
|
|
formModel.value.startTime = startTime ? startTime : null;
|
|
|
formModel.value.endTime = endTime ? endTime : null;
|
|
|
- exportDashboardList(formModel.value)
|
|
|
+ exportDeviceList(formModel.value)
|
|
|
.then(res => {
|
|
|
if (!res.success) {
|
|
|
return;
|