修改现场测试问题
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.code" placeholder="请输入英文接口标识" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="path" label="接口路径">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.path" placeholder="请输入接口路径" />
|
||||
<el-input v-model.trim="form.path" placeholder="请输入接口路径" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="type" label="接口类型">
|
||||
<el-radio-group v-model.trim="form.type">
|
||||
|
||||
@@ -62,6 +62,7 @@ const rankOptions = ref([
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
||||
method: 'POST',
|
||||
exportName: '设备告警',
|
||||
publicHeight: 65,
|
||||
column: [
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center' },
|
||||
|
||||
@@ -66,6 +66,7 @@ import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
const props = defineProps(['deviceTree'])
|
||||
const refheader = ref()
|
||||
const waveFormAnalysisRef = ref()
|
||||
@@ -195,13 +196,17 @@ const tableStore = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
row.loading2 = true
|
||||
const url = window.location.origin + '/api/cs-harmonic-boot/event/getFileZip?eventId=' + row.id
|
||||
window.open(url, '_self')
|
||||
setTimeout(() => {
|
||||
ElMessage.success('波形下载成功!')
|
||||
row.loading2 = false
|
||||
}, 1500)
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -3,12 +3,19 @@
|
||||
<div class="analyze-dvr" v-show="!isWaveCharts" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
||||
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
|
||||
<TableHeader :showReset="false" showExport>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model.trim="tableStore.table.params.searchValue" placeholder="请输入关键字" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table v-if="view" ref="tableRef"></Table>
|
||||
</div>
|
||||
<el-empty v-else description="请选择设备" class="analyze-dvr-right" />
|
||||
</div>
|
||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false" :wp="wp" style="padding: 10px;"/>
|
||||
@handleHideCharts="isWaveCharts = false" :wp="wp" style="padding: 10px;" />
|
||||
<!-- <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@@ -52,8 +59,9 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
|
||||
import { analyseWave } from '@/api/common'
|
||||
import shushiboxi from '@/components/echarts/shushiboxi.vue'
|
||||
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
import { ElMessage } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'govern/analyze/DVR'
|
||||
@@ -83,7 +91,7 @@ const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '事件描述', field: 'showName' },
|
||||
{ title: '事件描述', field: 'showName', sortable: true },
|
||||
{ title: '发生位置', field: 'evtParamPosition' },
|
||||
{ title: '持续时间(s)', field: 'evtParamTm' },
|
||||
{ title: '暂降深度', field: 'evtParamVVaDepth' },
|
||||
@@ -156,13 +164,17 @@ const tableStore = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
row.loading2 = true
|
||||
const url = window.location.origin + '/api/cs-harmonic-boot/event/getFileZip?eventId=' + row.id
|
||||
window.open(url, '_self')
|
||||
setTimeout(() => {
|
||||
ElMessage.success('波形下载成功!')
|
||||
row.loading2 = false
|
||||
}, 1500)
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
@@ -107,7 +107,8 @@ import {
|
||||
resetEquipmentDelivery,
|
||||
governDeviceRegister,
|
||||
portableDeviceRegister,
|
||||
portableDeviceAccess
|
||||
portableDeviceAccess,
|
||||
getExcelTemplate
|
||||
} from '@/api/cs-system-boot/device'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { fullUrl } from '@/utils/common'
|
||||
@@ -456,7 +457,19 @@ const devTypeChange = (e: any) => {
|
||||
}
|
||||
// 下载模版
|
||||
const downLoadFile = () => {
|
||||
window.open(window.location.origin + '/api/cs-device-boot/EquipmentDelivery/getExcelTemplate')
|
||||
getExcelTemplate().then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '设备导入模版.xlsx' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
ElMessage.success('下载成功')
|
||||
})
|
||||
}
|
||||
|
||||
// 导入模版
|
||||
|
||||
@@ -16,6 +16,7 @@ import waveFormAnalysis from './components/waveFormAnalysis.vue'
|
||||
import { ArrowLeft } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
const tableParams: any = ref({})
|
||||
const refheader = ref()
|
||||
const view = ref(true)
|
||||
@@ -137,13 +138,20 @@ const tableStore: any = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
row.loading2 = true
|
||||
const url = window.location.origin + '/api/cs-harmonic-boot/event/getFileZip?eventId=' + row.id
|
||||
window.open(url, '_self')
|
||||
setTimeout(() => {
|
||||
ElMessage.success('波形下载成功!')
|
||||
row.loading2 = false
|
||||
}, 1500)
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -21,6 +21,7 @@ import { ElMessage } from 'element-plus'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
|
||||
import { analyseWave } from '@/api/common'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
const props = defineProps({
|
||||
activeName: String,
|
||||
activeColName: [Object, String]
|
||||
@@ -141,13 +142,18 @@ const tableStore = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
row.loading2 = true
|
||||
const url = window.location.origin + '/api/cs-harmonic-boot/event/getFileZip?eventId=' + row.id
|
||||
window.open(url, '_self')
|
||||
setTimeout(() => {
|
||||
ElMessage.success('波形下载成功!')
|
||||
row.loading2 = false
|
||||
}, 1500)
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="过滤筛选">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue"
|
||||
placeholder="数据名称、别名、名称" clearable></el-input>
|
||||
placeholder="数据名称、别名、展示名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
|
||||
@@ -1,24 +1,32 @@
|
||||
<template>
|
||||
<el-dialog class="cn-operate-dialog" width="800px" v-model.trim="dialogVisible" :title="title">
|
||||
|
||||
<el-form class="form-two" :model="form" label-width="120px" ref="formRef" :rules="rules">
|
||||
<el-form class="form-two" :model="form" label-width="100px" ref="formRef" :rules="rules">
|
||||
<el-form-item label="装置类型:" prop="type">
|
||||
<el-select v-model.trim="form.type" filterable placeholder="请选择" @change="typeChange">
|
||||
<!-- <el-select v-model.trim="form.type" filterable placeholder="请选择" @change="typeChange">
|
||||
<el-option v-for="item in TypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-select v-model.trim="form.type" placeholder="请选择" @change="formDevTypeChange" clearable>
|
||||
<el-option v-for="item in devTypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="装置型号:" prop="devType">
|
||||
<el-select v-model.trim="form.devType" placeholder="请选择" filterable @change="devTypeChange">
|
||||
<!-- <el-select v-model.trim="form.devType" placeholder="请选择" filterable @change="devTypeChange">
|
||||
<el-option v-for="item in DevTypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-select v-model.trim="form.devType" filterable placeholder="请选择" clearable>
|
||||
<el-option v-for="item in formDevModelOptionsFilter" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号:" prop="versionNo">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.versionNo" autocomplete="off"
|
||||
placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本类型:" prop="versionType">
|
||||
<el-form-item label="版本类型:" >
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.versionType" autocomplete="off"
|
||||
placeholder="填写特殊类型(不填默认通用类型)"></el-input>
|
||||
</el-form-item>
|
||||
@@ -27,23 +35,25 @@
|
||||
placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本日期:" prop="versionDate">
|
||||
<el-date-picker v-model.trim="form.versionDate" type="date" value-format="yyyy-MM-dd"
|
||||
<el-date-picker v-model.trim="form.versionDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间" style="width: 100%"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" prop="description">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.description" autocomplete="off"
|
||||
placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="CRC校验:" prop="crcInfo">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.crcInfo" autocomplete="off"
|
||||
placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<el-form :inline="true" :model="form" label-width="120px" class="mt10">
|
||||
<el-form :model="form" label-width="100px" class="mt10">
|
||||
<el-form-item label="描述:" prop="description">
|
||||
<el-input maxlength="300":autosize="{ minRows: 2, maxRows: 4 }" type="textarea" show-word-limit v-model.trim="form.description" autocomplete="off"
|
||||
placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="升级文件:" prop="file">
|
||||
<el-upload :limit="1" :auto-upload="false" :on-change="fileChange" :on-exceed="fileExceed"
|
||||
:file-list="fileList">
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -57,7 +67,7 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, inject } from 'vue'
|
||||
import { ref, inject,computed } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@@ -67,7 +77,9 @@ import { addEdData, auditEdData } from '@/api/cs-device-boot/edData'
|
||||
const TypeOptions = ref()
|
||||
const DevTypeAllOptions = ref()
|
||||
const DevTypeOptions = ref()
|
||||
const devTypeOptions: any = ref([])
|
||||
|
||||
const devModelOptions: any = ref([])
|
||||
const fileList = ref()
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const formRef = ref()
|
||||
@@ -107,6 +119,36 @@ const devTypeChange = (e: any) => {
|
||||
// console.log(e)
|
||||
form.devTypeName = DevTypeOptions.value.filter((item: any) => item.value == e)[0].label
|
||||
}
|
||||
queryByCode('Device_Type').then(res => {
|
||||
queryCsDictTree(res.data.id).then(res => {
|
||||
devTypeOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.id,
|
||||
label: item.name,
|
||||
...item
|
||||
}
|
||||
})
|
||||
})
|
||||
queryByid(res.data.id).then(res => {
|
||||
devModelOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.id,
|
||||
label: item.name,
|
||||
...item
|
||||
}
|
||||
})
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
const formDevModelOptionsFilter = computed(() => {
|
||||
return devModelOptions.value.filter((item: any) => {
|
||||
if (form.type) {
|
||||
return item.pid == form.type
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
})
|
||||
})
|
||||
const fileChange = (e: any) => {
|
||||
|
||||
form.file = e.raw
|
||||
@@ -115,6 +157,12 @@ const fileExceed = (e: any) => {
|
||||
|
||||
ElMessage.error('只能上传一个文件')
|
||||
}
|
||||
const formDevTypeChange = (e: any) => {
|
||||
if (!e) {
|
||||
return
|
||||
}
|
||||
form.devModel = ''
|
||||
}
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('新增版本')
|
||||
const open = (text: string, data?: anyObj) => {
|
||||
|
||||
@@ -109,7 +109,8 @@ import {
|
||||
resetEquipmentDelivery,
|
||||
governDeviceRegister,
|
||||
portableDeviceRegister,
|
||||
portableDeviceAccess
|
||||
portableDeviceAccess,
|
||||
getExcelTemplate
|
||||
} from '@/api/cs-system-boot/device'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { fullUrl } from '@/utils/common'
|
||||
@@ -153,10 +154,10 @@ queryByCode('Device_Type').then(res => {
|
||||
...item
|
||||
}
|
||||
})
|
||||
let index = devTypeOptions.value.findIndex((item: any) => {
|
||||
return item.name == '网关'
|
||||
})
|
||||
devTypeOptions.value.splice(index, 1)
|
||||
// let index = devTypeOptions.value.findIndex((item: any) => {
|
||||
// return item.name == '网关'
|
||||
// })
|
||||
// devTypeOptions.value.splice(index, 1)
|
||||
})
|
||||
queryByid(id).then(res => {
|
||||
res.data.map((item: any, index: any) => {
|
||||
@@ -209,7 +210,7 @@ const tableStore = new TableStore({
|
||||
return devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '设备型号',
|
||||
field: 'devModel',
|
||||
@@ -225,7 +226,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{ title: '录入时间', field: 'createTime' },
|
||||
|
||||
|
||||
{
|
||||
title: '使用状态',
|
||||
render: 'switch',
|
||||
@@ -259,7 +260,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
passwordConfirm(value).then(res => {
|
||||
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status == 6 ? 2 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status == 6 ? 2 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
@@ -560,7 +561,20 @@ const devTypeChange = (e: any) => {
|
||||
}
|
||||
// 下载模版
|
||||
const downLoadFile = () => {
|
||||
window.open(window.location.origin + '/api/cs-device-boot/EquipmentDelivery/getExcelTemplate')
|
||||
|
||||
getExcelTemplate().then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '设备导入模版.xlsx' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
ElMessage.success('下载成功')
|
||||
})
|
||||
}
|
||||
|
||||
// 导入模版
|
||||
@@ -615,9 +629,9 @@ const onSubmit = () => {
|
||||
nDid: res.data.ndid
|
||||
}).then(pres => {
|
||||
ElMessage.success(pres.message)
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
},1000)
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
}, 1000)
|
||||
}).catch(err => {
|
||||
// clearTimeout (time)
|
||||
})
|
||||
|
||||
@@ -40,7 +40,9 @@ const tableStore: any = new TableStore({
|
||||
isWebPaging: true,
|
||||
column: [
|
||||
{ field: 'name', title: '模板名称' },
|
||||
{ field: 'reportForm', title: '模板类型' },
|
||||
{ field: 'reportForm', title: '模板类型',formatter: (row) => {
|
||||
return row.cellValue == 1 ? '电能质量报表类型' : row.cellValue == 2 ? '用能报表类型' : ''
|
||||
} },
|
||||
{ field: 'updateBy', title: '更新用户' },
|
||||
{ field: 'createTime', title: '创建时间' },
|
||||
{ field: 'updateTime', title: '更新时间' },
|
||||
|
||||
@@ -105,7 +105,8 @@ import {
|
||||
resetEquipmentDelivery,
|
||||
governDeviceRegister,
|
||||
portableDeviceRegister,
|
||||
portableDeviceAccess
|
||||
portableDeviceAccess,
|
||||
getExcelTemplate
|
||||
} from '@/api/cs-system-boot/device'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { fullUrl } from '@/utils/common'
|
||||
@@ -290,7 +291,19 @@ const devTypeChange = (e: any) => {
|
||||
}
|
||||
// 下载模版
|
||||
const downLoadFile = () => {
|
||||
window.open(window.location.origin + '/api/cs-device-boot/EquipmentDelivery/getExcelTemplate')
|
||||
getExcelTemplate().then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '设备导入模版.xlsx' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
ElMessage.success('下载成功')
|
||||
})
|
||||
}
|
||||
|
||||
// 导入模版
|
||||
|
||||
@@ -106,7 +106,8 @@ import {
|
||||
resetEquipmentDelivery,
|
||||
governDeviceRegister,
|
||||
portableDeviceRegister,
|
||||
portableDeviceAccess
|
||||
portableDeviceAccess,
|
||||
getExcelTemplate
|
||||
} from '@/api/cs-system-boot/device'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { fullUrl } from '@/utils/common'
|
||||
@@ -291,7 +292,19 @@ const devTypeChange = (e: any) => {
|
||||
}
|
||||
// 下载模版
|
||||
const downLoadFile = () => {
|
||||
window.open(window.location.origin + '/api/cs-device-boot/EquipmentDelivery/getExcelTemplate')
|
||||
getExcelTemplate().then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '设备导入模版.xlsx' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
ElMessage.success('下载成功')
|
||||
})
|
||||
}
|
||||
|
||||
// 导入模版
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.code" placeholder="请输入字典编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" class="top">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.remark"
|
||||
<el-input maxlength="32" :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" show-word-limit v-model.trim="form.remark"
|
||||
placeholder="请输入字典描述"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
Reference in New Issue
Block a user