修改测试问题
This commit is contained in:
@@ -1,33 +1,44 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="device-control">
|
||||
<!--治理效果报表 -->
|
||||
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" ref="TableHeaderRef" datePicker
|
||||
@selectChange="selectChange" v-if="fullscreen">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="模板策略">
|
||||
<el-select filterable v-model="tableStore.table.params.tempId" placeholder="请选择模板策略" clearable>
|
||||
<el-option v-for="item in templateList" :key="item.id" :label="item.excelName"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="监测对象">
|
||||
<el-select filterable v-model="tableStore.table.params.sensitiveUserId" placeholder="请选择监测对象"
|
||||
clearable>
|
||||
<el-option v-for="item in idList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div style="display: flex" >
|
||||
<div id="luckysheet" :style="{
|
||||
width: `calc(${prop.width} )`,
|
||||
height: `calc(${prop.height} - 57px + ${fullscreen ? 0 : 56}px)`
|
||||
}"></div>
|
||||
<div v-show="fullscreen">
|
||||
<!-- <PointTree :height="flag ? 106 : 50" @node-click="nodeClick" @pointTypeChange="pointTypeChange"></PointTree> -->
|
||||
<APFTree :height="flag ? 126 : 70" @node-click="handleNodeClick" template @init="handleNodeClick"></APFTree>
|
||||
</div>
|
||||
<div>
|
||||
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" ref="TableHeaderRef" datePicker
|
||||
@selectChange="selectChange" v-if="fullscreen">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="模板策略">
|
||||
<el-select filterable v-model="tableStore.table.params.tempId" placeholder="请选择模板策略" clearable>
|
||||
<el-option v-for="item in templateList" :key="item.id" :label="item.excelName"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="监测对象">
|
||||
<el-select filterable v-model="tableStore.table.params.sensitiveUserId" placeholder="请选择监测对象"
|
||||
clearable>
|
||||
<el-option v-for="item in idList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div style="display: flex">
|
||||
<div id="luckysheet" :style="{
|
||||
width: `calc(${prop.width} - ${fullscreen ? 290 : 0}px)`,
|
||||
height: `calc(${prop.height} - 57px + ${fullscreen ? 0 : 56}px)`
|
||||
}" v-if="tableStore.table.data.length"></div>
|
||||
<el-empty description="暂无报表" v-else style="flex: 1" :style="{
|
||||
width: `calc(${prop.width} - ${fullscreen ? 290 : 0}px)`,
|
||||
height: `calc(${prop.height} - 57px + ${fullscreen ? 0 : 56}px)`
|
||||
}"></el-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -40,6 +51,7 @@ import { querySysExcel } from '@/api/harmonic-boot/luckyexcel'
|
||||
import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import APFTree from '@/components/tree/govern/APFTree.vue'
|
||||
const prop = defineProps({
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
@@ -47,39 +59,38 @@ const prop = defineProps({
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
interval: { type: Number },
|
||||
flag: { type: Boolean }
|
||||
})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
// 报表模板列表
|
||||
const templateList = ref()
|
||||
const templateList = ref([])
|
||||
|
||||
// 监测对象
|
||||
const idList = ref()
|
||||
|
||||
// 监测对象
|
||||
const initListByIds = () => {
|
||||
getListByIds({}).then((res: any) => {
|
||||
if (res.data?.length > 0) {
|
||||
idList.value = res.data
|
||||
|
||||
if (!tableStore.table.params.sensitiveUserId && idList.value?.length > 0) {
|
||||
tableStore.table.params.sensitiveUserId = idList.value[0].id
|
||||
const handleNodeClick = async (data: any) => {
|
||||
if (templateList.value.length == 0) {
|
||||
await querySysExcel({}).then(res => {
|
||||
templateList.value = res.data.filter(item => item.excelType == 4)
|
||||
if (!tableStore.table.params.tempId && templateList.value?.length > 0) {
|
||||
tableStore.table.params.tempId = templateList.value[0].id
|
||||
}
|
||||
templateListData()
|
||||
} else {
|
||||
querySysExcel({}).then(res => {
|
||||
templateList.value = res.data.filter(item => item.excelType == 4)
|
||||
if (!tableStore.table.params.tempId && templateList.value?.length > 0) {
|
||||
tableStore.table.params.tempId = templateList.value[0].id
|
||||
}
|
||||
})
|
||||
tableStore.table.loading = false
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (data?.level == 3 || data?.level == 2) {
|
||||
tableStore.table.params.sensitiveUserId = data.id
|
||||
await tableStore.index()
|
||||
} else {
|
||||
tableStore.table.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const templateListData = () => {
|
||||
querySysExcel({}).then(res => {
|
||||
templateList.value = res.data.filter(item => item.excelType == 4)
|
||||
@@ -98,7 +109,7 @@ const downloadExcel = () => {
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
initListByIds()
|
||||
// initListByIds()
|
||||
})
|
||||
onUnmounted(() => {
|
||||
destroyLuckysheet()
|
||||
@@ -180,7 +191,7 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.height,
|
||||
() => prop.height,
|
||||
val => {
|
||||
renderLuckysheetReport('luckysheet', tableStore.table.data, { allowEdit: false })
|
||||
}
|
||||
@@ -199,4 +210,11 @@ watch(
|
||||
// :deep(.el-select) {
|
||||
// min-width: 80px;
|
||||
// }
|
||||
.device-control {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
:deep(.cn-tree) {
|
||||
padding: 0 10px 0 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user