修改现场测试问题
This commit is contained in:
@@ -18,7 +18,7 @@ let buildUrl = 'wss://pqmcn.com:8087/mqtt'//102
|
||||
const fetchMqttUrl = async () => {
|
||||
|
||||
const response = await fetch('/')
|
||||
const mqttUrl = response.headers.get('X-MQTT-URL')
|
||||
const mqttUrl = response.headers.get('X-Mqtt-Url')
|
||||
|
||||
window.localStorage.setItem('MQTTURL', mqttUrl || buildUrl)
|
||||
|
||||
|
||||
@@ -11,4 +11,12 @@ export function getDeviceDataTrend(data: any) {
|
||||
|
||||
|
||||
|
||||
|
||||
// 波形下载
|
||||
export function getFileZip(params: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/event/getFileZip',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -88,3 +88,11 @@ export const portableDeviceAccess = (data: any) => {
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
// 下载模版
|
||||
export function getExcelTemplate() {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/EquipmentDelivery/getExcelTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -4,7 +4,7 @@ export const dicDelete = (id: string) => {
|
||||
let form = new FormData()
|
||||
form.append('id', id)
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree//delete',
|
||||
url: '/system-boot/dictTree/delete',
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
|
||||
@@ -97,18 +97,16 @@ const getRef = () => {
|
||||
watch(
|
||||
() => tableStore.table.allFlag,
|
||||
newVal => {
|
||||
|
||||
|
||||
if (tableStore.table.allFlag) {
|
||||
console.log("🚀 ~ tableStore.table:", tableStore.table)
|
||||
|
||||
tableRef.value?.exportData({
|
||||
filename: document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字
|
||||
filename: tableStore.table.exportName || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
data: tableStore.table.allData, // 数据源 // 过滤那个字段导出
|
||||
columnFilterMethod: function (column: any) {
|
||||
|
||||
return !(column.column.title === undefined || column.column.title === '序号' || column.column.title === '操作')
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
{{ item.meta.title }}
|
||||
<transition @after-leave="selectNavTab(tabsRefs[navTabs.state.activeIndex])" name="el-fade-in">
|
||||
<Icon
|
||||
v-show="navTabs.state.tabsView.length > 1"
|
||||
v-if="navTabs.state.tabsView.length > 1"
|
||||
class="close-icon"
|
||||
@click.stop="closeTab(item)"
|
||||
size="15"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model.trim="dialogVisible" :title="title">
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" class="form-two">
|
||||
<el-dialog draggable width="600px" v-model.trim="dialogVisible" :title="title">
|
||||
|
||||
<el-form :inline="false" :model="form" label-width="auto" class="form-one">
|
||||
<el-form-item label="用户名称:">
|
||||
<el-input v-model.trim="form.name" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
@@ -21,7 +21,6 @@
|
||||
<el-input v-model.trim="form.email" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
element-loading-background="var(--ba-bg-color-overlay)"
|
||||
element-loading-text="加载中"
|
||||
class="default-main ba-main-loading"
|
||||
:style="{ height:'calc(100vh - 170px)'}"
|
||||
></div>
|
||||
<div v-if="state.showReload" class="loading-footer">
|
||||
<div v-if="state.showReload" class="loading-footer mt10">
|
||||
<el-button @click="refresh" type="warning">重新加载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -104,12 +104,11 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||
response => {
|
||||
removePending(response.config)
|
||||
options.loading && closeLoading(options) // 关闭loading
|
||||
|
||||
if (
|
||||
if (
|
||||
response.data.code === 'A0000' ||
|
||||
response.data.type === 'application/json' ||
|
||||
Array.isArray(response.data) ||
|
||||
response.data.size
|
||||
response.data.size
|
||||
// ||
|
||||
// response.data.type === 'application/octet-stream' ||
|
||||
// response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
|
||||
@@ -10,6 +10,7 @@ interface TableStoreParams {
|
||||
pk?: string
|
||||
column: TableColumn[]
|
||||
params?: anyObj
|
||||
exportName?: any // 导出文件名
|
||||
method?: Method // 请求方式
|
||||
isWebPaging?: boolean // 是否前端分页
|
||||
showPage?: boolean //是否需要分页
|
||||
@@ -25,6 +26,7 @@ export default class TableStore {
|
||||
public pk
|
||||
public method: Method
|
||||
public initData: any = null
|
||||
public exportName: any = null
|
||||
public isWebPaging = false
|
||||
public paramsPOST = true
|
||||
public showPage = true
|
||||
@@ -54,6 +56,7 @@ export default class TableStore {
|
||||
this.pk = options.pk || 'id'
|
||||
this.paramsPOST = options.paramsPOST || false
|
||||
this.isWebPaging = options.isWebPaging || false
|
||||
this.exportName = options.exportName || null
|
||||
this.method = options.method || 'GET'
|
||||
this.table.column = options.column
|
||||
this.showPage = options.showPage !== false
|
||||
@@ -182,25 +185,26 @@ export default class TableStore {
|
||||
[
|
||||
'export',
|
||||
() => {
|
||||
// this.index()
|
||||
ElMessage({
|
||||
message: '正在导出,请稍等...',
|
||||
type: 'info',
|
||||
duration: 1000
|
||||
})
|
||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||
createAxios(
|
||||
Object.assign(
|
||||
{
|
||||
url: this.url,
|
||||
method: this.method
|
||||
},
|
||||
requestPayload(this.method, params, this.paramsPOST)
|
||||
)
|
||||
).then(res => {
|
||||
this.table.allData = filtration(res.data.records || res.data)
|
||||
this.table.allFlag = data.showAllFlag || true
|
||||
})
|
||||
setTimeout(() => {
|
||||
createAxios(
|
||||
Object.assign(
|
||||
{
|
||||
url: this.url,
|
||||
method: this.method
|
||||
},
|
||||
requestPayload(this.method, params, this.paramsPOST)
|
||||
)
|
||||
).then(res => {
|
||||
this.table.allData = filtration(res.data.records || res.data)
|
||||
this.table.allFlag = data.showAllFlag || true
|
||||
})
|
||||
},1500)
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
@@ -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