<template>
|
<FYTable @search="onSearch" :pagination="true" ref="tableRef">
|
<template #options>
|
<!-- 区县 -->
|
<FYOptionLocation
|
:allOption="false"
|
:level="3"
|
:checkStrictly="false"
|
v-model:value="formSearch.locations"
|
></FYOptionLocation>
|
<!-- 场景类型 -->
|
<FYOptionScene
|
:allOption="false"
|
:type="2"
|
v-model:value="formSearch.scenetype"
|
></FYOptionScene>
|
<FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
|
</template>
|
<template #buttons> </template>
|
|
<template #options-expand>
|
<el-form :inline="true">
|
<CompQuickSet @quick-set="setOptions"></CompQuickSet>
|
</el-form>
|
</template>
|
|
<template #table-column>
|
<el-table-column prop="sceneName" :show-overflow-tooltip="true" label="名称">
|
</el-table-column>
|
</template>
|
</FYTable>
|
</template>
|
<script setup>
|
/**
|
* 监测设备和场景匹配记录管理
|
*/
|
import dayjs from 'dayjs';
|
import { ref, reactive, computed, getCurrentInstance } from 'vue';
|
import userMapApi from '@/api/fysp/userMapApi';
|
import CompQuickSet from '@/views/fysp/evaluation/components/CompQuickSet.vue';
|
|
const { $fm } = getCurrentInstance().appContext.config.globalProperties;
|
|
const tableRef = ref();
|
const formSearch = reactive({
|
locations: {},
|
scenetype: {},
|
time: dayjs().add(-1, 'M').date(1).toDate()
|
});
|
|
const area = computed(() => {
|
return {
|
provincecode: formSearch.locations.pCode,
|
provincename: formSearch.locations.pName,
|
citycode: formSearch.locations.cCode,
|
cityname: formSearch.locations.cName,
|
districtcode: formSearch.locations.dCode,
|
districtname: formSearch.locations.dName,
|
towncode: formSearch.locations.tCode,
|
townname: formSearch.locations.tName,
|
starttime: $fm.formatYMDH(formSearch.time),
|
scensetypeid: formSearch.scenetype.value,
|
online: true,
|
// 此处数据来源固定为飞羽监管系统
|
sourceType: 2
|
};
|
});
|
|
function onSearch(page, func) {
|
userMapApi.fetchDeviceMap(area.value).then((res) => {
|
func({ data: res.data });
|
});
|
}
|
|
function setOptions(param) {
|
formSearch.locations = param.locations;
|
formSearch.scenetype = param.scenetype;
|
// formSearch.sourceType = param.sourceType;
|
tableRef.value.onSearch();
|
}
|
</script>
|