修改云南测试用例

This commit is contained in:
guanj
2025-07-29 19:00:54 +08:00
parent 24c590478e
commit cc47d9b02c
22 changed files with 531 additions and 302 deletions

View File

@@ -1,17 +1,24 @@
<template>
<Tree ref="treRef" :data="tree" style="height: 100%" :width="'100%'" :expanded="expanded" />
</template>
<!-- <div class="mb10">
<el-button type="primary" icon="el-icon-Download" size="small" @click="exportExcelTemplate" :loading="loading">模版下载</el-button>
<el-button type="primary" icon="el-icon-Upload" size="small">导入</el-button>
<el-button type="primary" icon="el-icon-Download" size="small" @click="ledgerEverywhere" :loading="loading1">导出</el-button>
</div> -->
<script lang="ts" setup>
import { ref, nextTick } from 'vue'
import Tree from './index.vue'
import { getTerminalTree } from '@/api/device-boot/Business.ts'
import { getTerminalTree,downTerminalTemplate,exportTerminalBase } from '@/api/device-boot/Business'
import { useConfig } from '@/stores/config'
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
defineOptions({
name: 'govern/deviceTree'
})
const loading = ref(false)
const loading1 = ref(false)
const emit = defineEmits(['init'])
const config = useConfig()
const expanded: any = ref([])
@@ -141,6 +148,44 @@ const info = (id: any) => {
})
})
}
// 下载模版
const exportExcelTemplate = async() => {
loading.value = true
downTerminalTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端台账模版'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
// 导出台账
const ledgerEverywhere = async() => {
loading1.value = true
exportTerminalBase().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端台账'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading1.value = false
}, 0)
}
info('')
defineExpose({ info })