修改云南测试用例

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

@@ -3,6 +3,7 @@
<vxe-table
ref="tableRef"
height="auto"
:key="key"
:data="tableStore.table.data"
v-loading="tableStore.table.loading"
v-bind="Object.assign({}, defaultAttribute, $attrs)"
@@ -21,7 +22,6 @@
:key="key + '-column'"
v-for="(item, key) in tableStore.table.column"
:tree-node="item.treeNode"
>
<!-- tableStore 预设的列 render 方案 -->
<template v-if="item.render" #default="scope">
@@ -76,7 +76,7 @@ const config = useConfig()
const tableRef = ref<VxeTableInstance>()
const tableStore = inject('tableStore') as TableStoreClass
const router = useRouter()
const key = ref(0)
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
isGroup?: boolean
showOverflow?: boolean
@@ -129,6 +129,7 @@ const handleSortChange = ({ column, order }: { column: TableColumn; order: 'asc'
tableStore.table.params.pageNum = 1
tableStore.index()
key.value += 1
// // 在这里可以根据 column 和 order 进行相应的数据排序操作
// if (order === 'asc') {
// } else if (order === 'desc') {

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 })