添加打包命令 区分 冀北还是其他地方的页面
This commit is contained in:
@@ -75,19 +75,23 @@
|
||||
</TableHeader>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:column-config="{ resizable: true }"
|
||||
:checkbox-config="{ labelField: 'name', highlight: true }"
|
||||
|
||||
:radio-config="{
|
||||
labelField: 'name',
|
||||
highlight: true,
|
||||
visibleMethod: row => row.row.level == 6
|
||||
}"
|
||||
:tree-config="{ transform: true, parentField: 'pid' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { exportModelJB } from '@/api/harmonic-boot/harmonic.ts'
|
||||
const dictData = useDictData()
|
||||
const tableRef = ref()
|
||||
|
||||
@@ -104,7 +108,7 @@ const tableStore = new TableStore({
|
||||
method: 'POST',
|
||||
column: [
|
||||
// { width: '60', title: '111', },
|
||||
{ field: 'name', title: '电网拓扑', minWidth: '180px', type: 'checkbox', align: 'left', treeNode: true },
|
||||
{ field: 'name', title: '电网拓扑', minWidth: '180px', type: 'radio', align: 'left', treeNode: true },
|
||||
{
|
||||
field: 'ip',
|
||||
title: '网络参数',
|
||||
@@ -227,7 +231,39 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const exportEvent = () => {
|
||||
console.log(tableRef.value.getRef().getCheckboxRecords())
|
||||
let line = tableRef.value.getRef().getRadioRecord()
|
||||
if (!line) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请选择要导出的数据'
|
||||
})
|
||||
return
|
||||
}
|
||||
let form = new FormData()
|
||||
form.append('isUrl', false)
|
||||
form.append('lineIndex', line.id)
|
||||
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||
form.append('type', 0)
|
||||
form.append('name', line.name)
|
||||
|
||||
exportModelJB(form).then(async res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
})
|
||||
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download =
|
||||
line.name +
|
||||
TableHeaderRef.value.datePickerRef.timeValue[0] +
|
||||
'_' +
|
||||
TableHeaderRef.value.datePickerRef.timeValue[1] // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user